carbon-components-angular
Version:
Next generation components
1,356 lines (1,180 loc) • 52.7 kB
HTML
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>carbon-components-angular documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="stylesheet" href="../styles/style.css">
<link rel="stylesheet" href="../styles/dark.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top d-block d-sm-none">
<a href="../" class="navbar-brand">carbon-components-angular documentation</a>
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
</div>
<div class="xs-menu menu" id="mobile-menu">
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
<compodoc-menu mode="normal"></compodoc-menu>
</div>
<!-- START CONTENT -->
<div class="content directive">
<div class="content-data">
<ol class="breadcrumb">
<li class="breadcrumb-item">Directives</li>
<li class="breadcrumb-item" >AbstractDropdownView</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a href="#info"
class="nav-link"
class="nav-link active"
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
</li>
<li class="nav-item">
<a href="#source"
class="nav-link"
role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="info">
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/dropdown/abstract-dropdown-view.class.ts</code>
</p>
<p class="comment">
<h3>Description</h3>
</p>
<p class="comment">
<p>A component that intends to be used within <code>Dropdown</code> must provide an implementation that extends this base class.
It also must provide the base class in the <code>@Component</code> meta-data.
ex: <code>providers: [{provide: AbstractDropdownView, useExisting: forwardRef(() => MyDropdownView)}]</code></p>
</p>
<section data-compodoc="block-metadata">
<h3>Metadata</h3>
<table class="table table-sm table-hover metadata">
<tbody>
<tr>
<td class="col-md-3">Selector</td>
<td class="col-md-9"><code>[cdsAbstractDropdownView], [ibmAbstractDropdownView]</code></td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-index">
<h3 id="index">Index</h3>
<table class="table table-sm table-bordered index-table">
<tbody>
<tr>
<td class="col-md-4">
<h6><b>Properties</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<span class="modifier">Public</span>
<span class="modifier">Optional</span>
<a href="#listId" >listId</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#size" >size</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#type" >type</a>
</li>
</ul>
</td>
</tr>
<tr>
<td class="col-md-4">
<h6><b>Methods</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#filterBy" >filterBy</a>
</li>
<li>
<a href="#getCurrentElement" >getCurrentElement</a>
</li>
<li>
<a href="#getCurrentItem" >getCurrentItem</a>
</li>
<li>
<a href="#getListItems" >getListItems</a>
</li>
<li>
<a href="#getNextElement" >getNextElement</a>
</li>
<li>
<a href="#getNextItem" >getNextItem</a>
</li>
<li>
<a href="#getPrevElement" >getPrevElement</a>
</li>
<li>
<a href="#getPrevItem" >getPrevItem</a>
</li>
<li>
<a href="#getSelected" >getSelected</a>
</li>
<li>
<a href="#hasNextElement" >hasNextElement</a>
</li>
<li>
<a href="#hasPrevElement" >hasPrevElement</a>
</li>
<li>
<a href="#initFocus" >initFocus</a>
</li>
<li>
<a href="#onItemsReady" >onItemsReady</a>
</li>
<li>
<a href="#propagateSelected" >propagateSelected</a>
</li>
<li>
<a href="#reorderSelected" >reorderSelected</a>
</li>
</ul>
</td>
</tr>
<tr>
<td class="col-md-4">
<h6><b>Inputs</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#items" >items</a>
</li>
</ul>
</td>
</tr>
<tr>
<td class="col-md-4">
<h6><b>Outputs</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#blurIntent" >blurIntent</a>
</li>
<li>
<a href="#select" >select</a>
</li>
</ul>
</td>
</tr>
<tr>
<td class="col-md-4">
<h6><b>Accessors</b></h6>
</td>
</tr>
<tr>
<td class="col-md-4">
<ul class="index-list">
<li>
<a href="#items" >items</a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-inputs">
<h3 id="inputs">Inputs</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="items"></a>
<b>items</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>Array | Observable</code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:23</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>The items to be displayed in the list within the <code>AbstractDropDownView</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-outputs">
<h3 id="outputs">Outputs</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="blurIntent"></a>
<b>blurIntent</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>EventEmitter<any></code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="40" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:40</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Event to suggest a blur on the view.
Emits <em>after</em> the first/last item has been focused.
ex.
ArrowUp -> focus first item
ArrowUp -> emit event</p>
<p>It's recommended that the implementing view include a specific type union of possible blurs
ex. <code>@Output() blurIntent = new EventEmitter<"top" | "bottom">();</code></p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="select"></a>
<b>select</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>EventEmitter<literal type | []></code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:29</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Emits selection events to controlling classes</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-methods">
<h3 id="methods">
Methods
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="filterBy"></a>
<span class="name">
<span ><b>filterBy</b></span>
<a href="#filterBy"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>filterBy(value: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="99"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:99</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>value</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
<td>
No
</td>
<td>
<p>value to filter the list by</p>
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getCurrentElement"></a>
<span class="name">
<span ><b>getCurrentElement</b></span>
<a href="#getCurrentElement"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getCurrentElement()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="86"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:86</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>HTMLElement</code> for the item that is selected within the <code>DropdownList</code>.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code>HTMLElement</code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getCurrentItem"></a>
<span class="name">
<span ><b>getCurrentItem</b></span>
<a href="#getCurrentItem"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getCurrentItem()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="82"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:82</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>ListItem</code> that is selected within <code>DropdownList</code>.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ListItem.html" target="_self" >ListItem</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getListItems"></a>
<span class="name">
<span ><b>getListItems</b></span>
<a href="#getListItems"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getListItems()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="90"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:90</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Guaranteed to return the current items as an Array.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem></a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getNextElement"></a>
<span class="name">
<span ><b>getNextElement</b></span>
<a href="#getNextElement"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getNextElement()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="62"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:62</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>HTMLElement</code> for the item that is subsequent to the selected item.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code>HTMLElement</code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getNextItem"></a>
<span class="name">
<span ><b>getNextItem</b></span>
<a href="#getNextItem"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getNextItem()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="54"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:54</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>ListItem</code> that is subsequent to the selected item in the <code>DropdownList</code>.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ListItem.html" target="_self" >ListItem</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getPrevElement"></a>
<span class="name">
<span ><b>getPrevElement</b></span>
<a href="#getPrevElement"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getPrevElement()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="74"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:74</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>HTMLElement</code> for the item that precedes the selected item.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code>HTMLElement</code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getPrevItem"></a>
<span class="name">
<span ><b>getPrevItem</b></span>
<a href="#getPrevItem"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getPrevItem()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="66"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:66</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the <code>ListItem</code> that precedes the selected item within <code>DropdownList</code>.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ListItem.html" target="_self" >ListItem</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="getSelected"></a>
<span class="name">
<span ><b>getSelected</b></span>
<a href="#getSelected"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getSelected()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="78"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:78</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the selected leaf level item(s) within the <code>DropdownList</code>.</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="../interfaces/ListItem.html" target="_self" >ListItem[]</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="hasNextElement"></a>
<span class="name">
<span ><b>hasNextElement</b></span>
<a href="#hasNextElement"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>hasNextElement()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="58"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:58</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns a boolean if the currently selected item is preceded by another</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="hasPrevElement"></a>
<span class="name">
<span ><b>hasPrevElement</b></span>
<a href="#hasPrevElement"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>hasPrevElement()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="70"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:70</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns a boolean if the currently selected item is followed by another</p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="initFocus"></a>
<span class="name">
<span ><b>initFocus</b></span>
<a href="#initFocus"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>initFocus()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="104"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:104</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Initializes focus in the list
In most cases this just calls <code>getCurrentElement().focus()</code></p>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="onItemsReady"></a>
<span class="name">
<span ><b>onItemsReady</b></span>
<a href="#onItemsReady"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onItemsReady(subcription: () => void)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="108"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:108</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Subscribe the function passed to an internal observable that will resolve once the items are ready</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>subcription</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function" target="_blank" >function</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="propagateSelected"></a>
<span class="name">
<span ><b>propagateSelected</b></span>
<a href="#propagateSelected"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>propagateSelected(value: <a href="../interfaces/ListItem.html" target="_self">Array<ListItem></a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="94"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:94</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Transforms array input list of items to the correct state by updating the selected item(s).</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>value</td>
<td>
<code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem></a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="reorderSelected"></a>
<span class="name">
<span ><b>reorderSelected</b></span>
<a href="#reorderSelected"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>reorderSelected(moveFocus?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank">boolean</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="112"
class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:112</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Reorder selected items bringing them to the top of the list</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>moveFocus</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
</td>
<td>
Yes
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
<div class="io-description">
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-properties">
<h3 id="inputs">
Properties
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="listId"></a>
<span class="name">
<span class="modifier">Public</span>
<span class="modifier">Optional</span>
<span ><b>listId</b></span>
<a href="#listId"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="50" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:50</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="size"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>size</b></span>
<a href="#size"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>"sm" | "md" | "lg"</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>"md"</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="49" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:49</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Specifies the render size of the items within the <code>AbstractDropdownView</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="type"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>type</b></span>
<a href="#type"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>"single" | "multi"</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>"single"</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="45" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:45</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Specifies whether or not the <code>DropdownList</code> supports selecting multiple items as opposed to single
item selection.</p>
</div>
</td>
</tr>
</tbody>
</table>
</section>
<section data-compodoc="block-accessors">
<h3 id="accessors">
Accessors
</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="items"></a>
<span class="name"><b>items</b><a href="#items"><span class="icon ion-ios-link"></span></a></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="accessor"><b>get</b><code>items()</code></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="25" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:25</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="accessor"><b>set</b><code>items(value: <a href="../interfaces/ListItem.html" target="_self">Array<ListItem> | Observable<Array<ListItem>></a>)</code></span>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/dropdown/abstract-dropdown-view.class.ts:23</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>The items to be displayed in the list within the <code>AbstractDropDownView</code>.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>value</td>
<td>
<code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem> | Observable<Array<ListItem>></a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
</div>
</td>
</tr>
</tbody>
</table>
</section>
</div>
<div class="tab-pane fade tab-source-code" id="source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
Input,
Output,
EventEmitter,
Directive
} from "@angular/core";
import { ListItem } from "./list-item.interface";
import { Observable } from "rxjs";
/**
* A component that intends to be used within `Dropdown` must provide an implementation that extends this base class.
* It also must provide the base class in the `@Component` meta-data.
* ex: `providers: [{provide: AbstractDropdownView, useExisting: forwardRef(() => MyDropdownView)}]`
*/
@Directive({
selector: "[cdsAbstractDropdownView], [ibmAbstractDropdownView]"
})
export class AbstractDropdownView {
/**
* The items to be displayed in the list within the `AbstractDropDownView`.
*/
@Input() set items(value: Array<ListItem> | Observable<Array<ListItem>>) { }
get items(): Array<ListItem> | Observable<Array<ListItem>> { return; }
/**
* Emits selection events to controlling classes
*/
@Output() select: EventEmitter<{item: ListItem } | ListItem[]>;
/**
* Event to suggest a blur on the view.
* Emits _after_ the first/last item has been focused.
* ex.
* ArrowUp -> focus first item
* ArrowUp -> emit event
*
* It's recommended that the implementing view include a specific type union of possible blurs
* ex. `@Output() blurIntent = new EventEmitter<"top" | "bottom">();`
*/
@Output() blurIntent: EventEmitter<any>;
/**
* Specifies whether or not the `DropdownList` supports selecting multiple items as opposed to single
* item selection.
*/
public type: "single" | "multi" = "single";
/**
* Specifies the render size of the items within the `AbstractDropdownView`.
*/
public size: "sm" | "md" | "lg" = "md";
public listId?: string;
/**
* Returns the `ListItem` that is subsequent to the selected item in the `DropdownList`.
*/
getNextItem(): ListItem { return; }
/**
* Returns a boolean if the currently selected item is preceded by another
*/
hasNextElement(): boolean { return; }
/**
* Returns the `HTMLElement` for the item that is subsequent to the selected item.
*/
getNextElement(): HTMLElement { return; }
/**
* Returns the `ListItem` that precedes the selected item within `DropdownList`.
*/
getPrevItem(): ListItem { return; }
/**
* Returns a boolean if the currently selected item is followed by another
*/
hasPrevElement(): boolean { return; }
/**
* Returns the `HTMLElement` for the item that precedes the selected item.
*/
getPrevElement(): HTMLElement { return; }
/**
* Returns the selected leaf level item(s) within the `DropdownList`.
*/
getSelected(): ListItem[] { return; }
/**
* Returns the `ListItem` that is selected within `DropdownList`.
*/
getCurrentItem(): ListItem { return; }
/**
* Returns the `HTMLElement` for the item that is selected within the `DropdownList`.
*/
getCurrentElement(): HTMLElement { return; }
/**
* Guaranteed to return the current items as an Array.
*/
getListItems(): Array<ListItem> { return; }
/**
* Transforms array input list of items to the correct state by updating the selected item(s).
*/
propagateSelected(value: Array<ListItem>): void {}
/**
*
* @param value value to filter the list by
*/
filterBy(value: string): void {}
/**
* Initializes focus in the list
* In most cases this just calls `getCurrentElement().focus()`
*/
initFocus(): void {}
/**
* Subscribe the function passed to an inter