carbon-components-angular
Version:
Next generation components
3,554 lines • 149 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">
<style>
footer.carbon {
position: absolute;
bottom: 0;
width: 100%;
z-index: 9999;
}
#root > div {
/*
* Subtracting the height of the footer to prevent
* overlaying the footer ontop of content
*/
height: calc(100vh - 48px);
}
</style>
</head>
<body>
<script>
// Blocking script to avoid flickering dark mode
// Dark mode toggle button
var useDark = window.matchMedia('(prefers-color-scheme: dark)');
var darkModeState = useDark.matches;
var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
function checkToggle(check) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].checked = check;
}
}
function toggleDarkMode(state) {
if (window.localStorage) {
localStorage.setItem('compodoc_darkmode-state', state);
}
checkToggle(state);
const hasClass = document.body.classList.contains('dark');
if (state) {
for (var i = 0; i < $darkModeToggles.length; i++) {
$darkModeToggles[i].classList.add('dark');
}
if (!hasClass) {
document.body.classList.add('dark');
}
} else {
for (var i = 0; i < $darkModeToggles.length; i++) {
$darkModeToggles[i].classList.remove('dark');
}
if (hasClass) {
document.body.classList.remove('dark');
}
}
}
useDark.addEventListener('change', function (evt) {
toggleDarkMode(evt.matches);
});
if (darkModeStateLocal) {
darkModeState = darkModeStateLocal === 'true';
}
toggleDarkMode(darkModeState);
</script>
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
<div class="d-flex">
<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>
<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="d-none d-md-block menu">
<compodoc-menu mode="normal"></compodoc-menu>
</div>
<!-- START CONTENT -->
<div class="content component">
<div class="content-data">
<ol class="breadcrumb">
<li class="breadcrumb-item">Components</li>
<li class="breadcrumb-item"
>
DropdownList</li>
</ol>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a href="#info" 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>
<li class="nav-item">
<a href="#tree" class="nav-link"
role="tab" id="tree-tab" data-bs-toggle="tab" data-link="dom-tree">DOM Tree</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/list/dropdown-list.component.ts</code>
</p>
<p class="comment">
<h3>Description</h3>
</p>
<p class="comment">
<b>Example :</b><div><pre class="line-numbers"><code class="language-html"><cds-dropdown-list [items]="listItems"></cds-dropdown-list></code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-typescript">listItems = [
{
content: "item one",
selected: false
},
{
content: "item two",
selected: false,
},
{
content: "item three",
selected: false
},
{
content: "item four",
selected: false
}
];</code></pre></div>
</p>
<p class="comment">
<h3>Implements</h3>
</p>
<p class="comment">
<code><a href="../directives/AbstractDropdownView.html" target="_self" >AbstractDropdownView</a></code>
<code>AfterViewInit</code>
<code>OnDestroy</code>
</p>
<section data-compodoc="block-metadata">
<h3>Metadata</h3>
<table class="table table-sm table-hover metadata">
<tbody>
<tr>
<td class="col-md-3">providers</td>
<td class="col-md-9">
<code>{
provide: AbstractDropdownView, useExisting: DropdownList
}</code>
</td>
</tr>
<tr>
<td class="col-md-3">selector</td>
<td class="col-md-9"><code>cds-dropdown-list, ibm-dropdown-list</code></td>
</tr>
<tr>
<td class="col-md-3">template</td>
<td class="col-md-9"><pre class="line-numbers"><code class="language-html"><ul
#list
[id]="listId"
role="listbox"
class="cds--list-box__menu cds--multi-select"
(scroll)="emitScroll($event)"
(keydown)="navigateList($event)"
tabindex="0"
[attr.aria-label]="ariaLabel"
[attr.aria-activedescendant]="highlightedItem">
<li
role="option"
*ngFor="let item of displayItems; let i = index"
(click)="doClick($event, item)"
class="cds--list-box__menu-item"
[attr.aria-selected]="item.selected"
[id]="getItemId(i)"
[attr.tabindex]="highlightedItem === getItemId(i) ? 0 : null"
[attr.title]=" showTitles ? item.content : null"
[attr.disabled]="item.disabled ? true : null"
[ngClass]="{
'cds--list-box__menu-item--active': item.selected,
'cds--list-box__menu-item--highlighted': highlightedItem === getItemId(i)
}">
<div
#listItem
tabindex="-1"
class="cds--list-box__menu-item__option">
<div
*ngIf="!listTpl && type === 'multi'"
class="cds--form-item cds--checkbox-wrapper">
<label
[attr.data-contained-checkbox-state]="item.selected"
class="cds--checkbox-label">
<input
class="cds--checkbox"
type="checkbox"
[checked]="item.selected"
[disabled]="item.disabled"
tabindex="-1">
<span class="cds--checkbox-appearance"></span>
<span class="cds--checkbox-label-text">{{item.content}}</span>
</label>
</div>
<ng-container *ngIf="!listTpl && type === 'single'">{{item.content}}</ng-container>
<svg
*ngIf="!listTpl && type === 'single'"
cdsIcon="checkmark"
size="16"
class="cds--list-box__menu-item__selected-icon">
</svg>
<ng-template
*ngIf="listTpl"
[ngTemplateOutletContext]="{item: item}"
[ngTemplateOutlet]="listTpl">
</ng-template>
</div>
</li>
</ul></code></pre></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">Protected</span>
<a href="#_items" >_items</a>
</li>
<li>
<span class="modifier">Protected</span>
<a href="#_itemsReady" >_itemsReady</a>
</li>
<li>
<span class="modifier">Protected</span>
<a href="#_itemsSubscription" >_itemsSubscription</a>
</li>
<li>
<span class="modifier">Protected</span>
<a href="#_originalItems" >_originalItems</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#displayItems" >displayItems</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#elementRef" >elementRef</a>
</li>
<li>
<span class="modifier">Protected</span>
<a href="#focusJump" >focusJump</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#highlightedItem" >highlightedItem</a>
</li>
<li>
<span class="modifier">Protected</span>
<a href="#index" >index</a>
</li>
<li>
<span class="modifier"></span>
<a href="#list" >list</a>
</li>
<li>
<span class="modifier">Static</span>
<a href="#listCount" >listCount</a>
</li>
<li>
<span class="modifier"></span>
<span class="modifier">Protected</span>
<a href="#listElementList" >listElementList</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#listId" >listId</a>
</li>
<li>
<span class="modifier">Public</span>
<a href="#size" >size</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="#doClick" >doClick</a>
</li>
<li>
<a href="#doEmitSelect" >doEmitSelect</a>
</li>
<li>
<a href="#emitScroll" >emitScroll</a>
</li>
<li>
<a href="#filterBy" >filterBy</a>
</li>
<li>
<a href="#getCurrentElement" >getCurrentElement</a>
</li>
<li>
<a href="#getCurrentItem" >getCurrentItem</a>
</li>
<li>
<a href="#getItemId" >getItemId</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="#navigateList" >navigateList</a>
</li>
<li>
<a href="#ngAfterViewInit" >ngAfterViewInit</a>
</li>
<li>
<a href="#ngOnDestroy" >ngOnDestroy</a>
</li>
<li>
<a href="#onItemBlur" >onItemBlur</a>
</li>
<li>
<a href="#onItemFocus" >onItemFocus</a>
</li>
<li>
<a href="#onItemsReady" >onItemsReady</a>
</li>
<li>
<a href="#propagateSelected" >propagateSelected</a>
</li>
<li>
<a href="#reorderSelected" >reorderSelected</a>
</li>
<li>
<a href="#setupFocusObservable" >setupFocusObservable</a>
</li>
<li>
<a href="#updateIndex" >updateIndex</a>
</li>
<li>
<a href="#updateList" >updateList</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="#ariaLabel" >ariaLabel</a>
</li>
<li>
<a href="#items" >items</a>
</li>
<li>
<a href="#listTpl" >listTpl</a>
</li>
<li>
<a href="#showTitles" >showTitles</a>
</li>
<li>
<a href="#type" >type</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="#scroll" >scroll</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-constructor">
<h3 id="constructor">Constructor</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(elementRef: ElementRef, i18n: <a href="../injectables/I18n.html" target="_self">I18n</a>, appRef: ApplicationRef)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="223" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:223</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Creates an instance of <code>DropdownList</code>.</p>
</div>
<div>
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>elementRef</td>
<td>
<code>ElementRef</code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>i18n</td>
<td>
<code><a href="../injectables/I18n.html" target="_self" >I18n</a></code>
</td>
<td>
No
</td>
</tr>
<tr>
<td>appRef</td>
<td>
<code>ApplicationRef</code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
</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="ariaLabel"></a>
<b>ariaLabel</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>this.i18n.get().DROPDOWN_LIST.LABEL</code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="121" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:121</a></div>
</td>
</tr>
</tbody>
</table>
<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="125" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:125</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>The list items belonging to the <code>DropdownList</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="listTpl"></a>
<b>listTpl</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>string | TemplateRef<any></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="150" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:150</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Template to bind to items in the <code>DropdownList</code> (optional).</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="showTitles"></a>
<b>showTitles</b>
</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/boolean" target="_blank" >boolean</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>true</code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="182" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:182</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Defines whether to show title attribute or not</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="type"></a>
<b>type</b>
</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-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="177" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:177</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Defines 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-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</code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="168" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:168</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>When this event fires focus should be placed on some element outside of the list - blurring the list as a result</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="scroll"></a>
<b>scroll</b>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/ScrollCustomEvent.html" target="_self" >EventEmitter<ScrollCustomEvent></a></code>
</td>
</tr>
<tr>
<td class="col-md-2" colspan="2">
<div class="io-line">Defined in <a href="" data-line="158" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:158</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Event to emit scroll event of a list within the <code>DropdownList</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="154" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:154</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Event to emit selection of a list item within the <code>DropdownList</code>.</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="doClick"></a>
<span class="name">
<span ><b>doClick</b></span>
<a href="#doClick"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>doClick(event, item)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="552"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:552</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Emits the selected item or items after a mouse click event has occurred.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>event</td>
<td>
No
</td>
</tr>
<tr>
<td>item</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="doEmitSelect"></a>
<span class="name">
<span ><b>doEmitSelect</b></span>
<a href="#doEmitSelect"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>doEmitSelect(isUpdate)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="254"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:254</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>Optional</td>
<td>Default value</td>
</tr>
</thead>
<tbody>
<tr>
<td>isUpdate</td>
<td>
No
</td>
<td>
<code>true</code>
</td>
</tr>
</tbody>
</table>
</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="emitScroll"></a>
<span class="name">
<span ><b>emitScroll</b></span>
<a href="#emitScroll"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>emitScroll(event)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="587"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:587</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Emits the scroll event of the options list</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>event</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="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(query: <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="284"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:284</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Filters the items being displayed in the DOM list.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
<td>Default value</td>
</tr>
</thead>
<tbody>
<tr>
<td>query</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>
<code>""</code>
</td>
</tr>
</tbody>
</table>
</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="415"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:415</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="405"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:405</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="getItemId"></a>
<span class="name">
<span ><b>getItemId</b></span>
<a href="#getItemId"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>getItemId(index: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="266"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:266</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>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</div>
<div class="io-description">
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</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="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="425"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:425</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns the 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="336"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:336</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="318"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:318</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="379"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:379</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="362"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:362</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="432"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:432</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns a list containing the selected item(s) 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="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="328"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:328</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns <code>true</code> if the selected item is not the last item in the <code>DropdownList</code>.</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="372"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:372</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Returns <code>true</code> if the selected item is not the first in the list.</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="494"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:494</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Initializes focus in the list, effectively a wrapper for <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="navigateList"></a>
<span class="name">
<span ><b>navigateList</b></span>
<a href="#navigateList"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>navigateList(event: KeyboardEvent)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="520"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:520</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Manages the keyboard accessibility for navigation and selection within a <code>DropdownList</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>event</td>
<td>
<code>KeyboardEvent</code>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="ngAfterViewInit"></a>
<span class="name">
<span ><b>ngAfterViewInit</b></span>
<a href="#ngAfterViewInit"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>ngAfterViewInit()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="234"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:234</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Retrieves array of list items and index of the selected item after view has rendered.
Additionally, any Observables for the <code>DropdownList</code> are initialized.</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="ngOnDestroy"></a>
<span class="name">
<span ><b>ngOnDestroy</b></span>
<a href="#ngOnDestroy"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>ngOnDestroy()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="245"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:245</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Removes any Observables on destruction of the component.</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="onItemBlur"></a>
<span class="name">
<span ><b>onItemBlur</b></span>
<a href="#onItemBlur"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onItemBlur(index)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="578"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:578</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>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="onItemFocus"></a>
<span class="name">
<span ><b>onItemFocus</b></span>
<a href="#onItemFocus"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>onItemFocus(index)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="572"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:572</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>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>index</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="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="597"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:597</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 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="443"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:443</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 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)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="602"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:602</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>Optional</td>
<td>Default value</td>
</tr>
</thead>
<tbody>
<tr>
<td>moveFocus</td>
<td>
No
</td>
<td>
<code>true</code>
</td>
</tr>
</tbody>
</table>
</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="setupFocusObservable"></a>
<span class="name">
<span ><b>setupFocusObservable</b></span>
<a href="#setupFocusObservable"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>setupFocusObservable()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="303"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:303</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Initializes (or re-initializes) the Observable that handles switching focus to an element based on
key input matching the first letter of the item in the list.</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="updateIndex"></a>
<span class="name">
<span ><b>updateIndex</b></span>
<a href="#updateIndex"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updateIndex()</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="505"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:505</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<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="updateList"></a>
<span class="name">
<span ><b>updateList</b></span>
<a href="#updateList"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<code>updateList(items)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="273"
class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:273</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Updates the displayed list of items and then retrieves the most current properties for the <code>DropdownList</code> from the DOM.</p>
</div>
<div class="io-description">
<b>Parameters :</b>
<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>items</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</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="_items"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>_items</b></span>
<a href="#_items"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem></a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>[]</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="219" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:219</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Useful representation of the items, should be accessed via <code>getListItems</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="_itemsReady"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>_itemsReady</b></span>
<a href="#_itemsReady"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>Observable<boolean></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="223" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:223</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Used to wait for items in case they are passed through an observable.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="_itemsSubscription"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>_itemsSubscription</b></span>
<a href="#_itemsSubscription"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>Subscription</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="211" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:211</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Tracks the current (if any) subscription to the items observable so we can clean up when the input is updated.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="_originalItems"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>_originalItems</b></span>
<a href="#_originalItems"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem> | Observable<Array<ListItem>></a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="215" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:215</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Used to retain the original items passed to the setter.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="displayItems"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>displayItems</b></span>
<a href="#displayItems"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../interfaces/ListItem.html" target="_self" >Array<ListItem></a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>[]</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="195" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:195</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Holds the list of items that will be displayed in the <code>DropdownList</code>.
It differs from the the complete set of items when filtering is used (but
it is always a subset of the total items in <code>DropdownList</code>).</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="elementRef"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>elementRef</b></span>
<a href="#elementRef"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>ElementRef</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="228" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:228</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="focusJump"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>focusJump</b></span>
<a href="#focusJump"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="207" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:207</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Observable bound to keydown events to control filtering.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="highlightedItem"></a>
<span class="name">
<span class="modifier">Public</span>
<span ><b>highlightedItem</b></span>
<a href="#highlightedItem"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>null</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="189" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:189</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="index"></a>
<span class="name">
<span class="modifier">Protected</span>
<span ><b>index</b></span>
<a href="#index"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>-1</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="199" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:199</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Maintains the index for the selected item within the <code>DropdownList</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="list"></a>
<span class="name">
<span class="modifier"></span>
<span ><b>list</b></span>
<a href="#list"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code>ElementRef</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<b>Decorators : </b>
<br />
<code>
@ViewChild('list', {static: true})<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="172" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:172</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Maintains a reference to the view DOM element for the unordered list of items within the <code>DropdownList</code>.</p>
</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="listCount"></a>
<span class="name">
<span class="modifier">Static</span>
<span ><b>listCount</b></span>
<a href="#listCount"><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/number" target="_blank" >number</a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Default value : </i><code>0</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="120" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:120</a></div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="listElementList"></a>
<span class="name">
<span class="modifier"></span>
<span class="modifier">Protected</span>
<span ><b>listElementList</b></span>
<a href="#listElementList"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<i>Type : </i> <code><a href="../directives/List.html" target="_self" >QueryList<ElementRef></a></code>
</td>
</tr>
<tr>
<td class="col-md-4">
<b>Decorators : </b>
<br />
<code>
@ViewChildren('listItem')<br />
</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="203" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:203</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>An array holding the HTML list elements in the view.</p>
</div>
</td>
</tr>
</tbody>
</table>
<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 ><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>Default value : </i><code>`listbox-${DropdownList.listCount++}`</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="188" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:188</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="187" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:187</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>Defines the rendering size of the <code>DropdownList</code> input component.</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="144" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:144</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="125" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:125</a></div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-description"><p>The list items belonging to the <code>DropdownList</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 {
Component,
Input,
Output,
OnDestroy,
EventEmitter,
TemplateRef,
AfterViewInit,
ViewChild,
ElementRef,
ViewChildren,
QueryList,
ApplicationRef
} from "@angular/core";
import { Observable, isObservable, Subscription, of } from "rxjs";
import { first } from "rxjs/operators";
import { I18n } from "carbon-components-angular/i18n";
import { AbstractDropdownView } from "../abstract-dropdown-view.class";
import { ListItem } from "../list-item.interface";
import { watchFocusJump } from "../dropdowntools";
import { ScrollCustomEvent } from "./scroll-custom-event.interface";
/**
* ```html
* <cds-dropdown-list [items]="listItems"></cds-dropdown-list>
* ```
* ```typescript
* listItems = [
* {
* content: "item one",
* selected: false
* },
* {
* content: "item two",
* selected: false,
* },
* {
* content: "item three",
* selected: false
* },
* {
* content: "item four",
* selected: false
* }
* ];
* ```
*/
@Component({
selector: "cds-dropdown-list, ibm-dropdown-list",
template: `
<ul
#list
[id]="listId"
role="listbox"
class="cds--list-box__menu cds--multi-select"
(scroll)="emitScroll($event)"
(keydown)="navigateList($event)"
tabindex="0"
[attr.aria-label]="ariaLabel"
[attr.aria-activedescendant]="highlightedItem">
<li
role="option"
*ngFor="let item of displayItems; let i = index"
(click)="doClick($event, item)"
class="cds--list-box__menu-item"
[attr.aria-selected]="item.selected"
[id]="getItemId(i)"
[attr.tabindex]="highlightedItem === getItemId(i) ? 0 : null"
[attr.title]=" showTitles ? item.content : null"
[attr.disabled]="item.disabled ? true : null"
[ngClass]="{
'cds--list-box__menu-item--active': item.selected,
'cds--list-box__menu-item--highlighted': highlightedItem === getItemId(i)
}">
<div
#listItem
tabindex="-1"
class="cds--list-box__menu-item__option">
<div
*ngIf="!listTpl && type === 'multi'"
class="cds--form-item cds--checkbox-wrapper">
<label
[attr.data-contained-checkbox-state]="item.selected"
class="cds--checkbox-label">
<input
class="cds--checkbox"
type="checkbox"
[checked]="item.selected"
[disabled]="item.disabled"
tabindex="-1">
<span class="cds--checkbox-appearance"></span>
<span class="cds--checkbox-label-text">{{item.content}}</span>
</label>
</div>
<ng-container *ngIf="!listTpl && type === 'single'">{{item.content}}</ng-container>
<svg
*ngIf="!listTpl && type === 'single'"
cdsIcon="checkmark"
size="16"
class="cds--list-box__menu-item__selected-icon">
</svg>
<ng-template
*ngIf="listTpl"
[ngTemplateOutletContext]="{item: item}"
[ngTemplateOutlet]="listTpl">
</ng-template>
</div>
</li>
</ul>`,
providers: [
{
provide: AbstractDropdownView,
useExisting: DropdownList
}
]
})
export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDestroy {
static listCount = 0;
@Input() ariaLabel = this.i18n.get().DROPDOWN_LIST.LABEL;
/**
* The list items belonging to the `DropdownList`.
*/
@Input() set items(value: Array<ListItem> | Observable<Array<ListItem>>) {
if (isObservable(value)) {
if (this._itemsSubscription) {
this._itemsSubscription.unsubscribe();
}
this._itemsReady = new Observable<boolean>((observer) => {
this._itemsSubscription = value.subscribe(v => {
this.updateList(v);
observer.next(true);
observer.complete();
});
});
this.onItemsReady(null);
} else {
this.updateList(value);
}
this._originalItems = value;
}
get items(): Array<ListItem> | Observable<Array<ListItem>> {
return this._originalItems;
}
/**
* Template to bind to items in the `DropdownList` (optional).
*/
@Input() listTpl: string | TemplateRef<any> = null;
/**
* Event to emit selection of a list item within the `DropdownList`.
*/
@Output() select: EventEmitter<{ item: ListItem, isUpdate?: boolean } | ListItem[]> = new EventEmitter();
/**
* Event to emit scroll event of a list within the `DropdownList`.
*/
@Output() scroll: EventEmitter<ScrollCustomEvent> = new EventEmitter();
/**
* 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
*
* When this event fires focus should be placed on some element outside of the list - blurring the list as a result
*/
@Output() blurIntent = new EventEmitter<"top" | "bottom">();
/**
* Maintains a reference to the view DOM element for the unordered list of items within the `DropdownList`.
*/
@ViewChild("list", { static: true }) list: ElementRef;
/**
* Defines whether or not the `DropdownList` supports selecting multiple items as opposed to single
* item selection.
*/
@Input() type: "single" | "multi" = "single";
/**
* Defines whether to show title attribute or not
*/
@Input() showTitles = true;
/**
* Defines the rendering size of the `DropdownList` input component.
*/
public size: "sm" | "md" | "lg" = "md";
public listId = `listbox-${DropdownList.listCount++}`;
public highlightedItem = null;
/**
* Holds the list of items that will be displayed in the `DropdownList`.
* It differs from the the complete set of items when filtering is used (but
* it is always a subset of the total items in `DropdownList`).
*/
public displayItems: Array<ListItem> = [];
/**
* Maintains the index for the selected item within the `DropdownList`.
*/
protected index = -1;
/**
* An array holding the HTML list elements in the view.
*/
@ViewChildren("listItem") protected listElementList: QueryList<ElementRef>;
/**
* Observable bound to keydown events to control filtering.
*/
protected focusJump;
/**
* Tracks the current (if any) subscription to the items observable so we can clean up when the input is updated.
*/
protected _itemsSubscription: Subscription;
/**
* Used to retain the original items passed to the setter.
*/
protected _originalItems: Array<ListItem> | Observable<Array<ListItem>>;
/**
* Useful representation of the items, should be accessed via `getListItems`.
*/
protected _items: Array<ListItem> = [];
/**
* Used to wait for items in case they are passed through an observable.
*/
protected _itemsReady: Observable<boolean>;
/**
* Creates an instance of `DropdownList`.
*/
constructor(public elementRef: ElementRef, protected i18n: I18n, protected appRef: ApplicationRef) {}
/**
* Retrieves array of list items and index of the selected item after view has rendered.
* Additionally, any Observables for the `DropdownList` are initialized.
*/
ngAfterViewInit() {
this.index = this.getListItems().findIndex(item => item.selected);
this.setupFocusObservable();
setTimeout(() => {
this.doEmitSelect(true);
});
}
/**
* Removes any Observables on destruction of the component.
*/
ngOnDestroy() {
if (this.focusJump) {
this.focusJump.unsubscribe();
}
if (this._itemsSubscription) {
this._itemsSubscription.unsubscribe();
}
}
doEmitSelect(isUpdate = true) {
if (this.type === "single") {
this.select.emit({ item: this._items.find(item => item.selected), isUpdate: isUpdate });
} else {
// abuse javascripts object mutability until we can break the API and switch to
// { items: [], isUpdate: true }
const selected = this.getSelected() || [];
selected["isUpdate"] = isUpdate;
this.select.emit(selected);
}
}
getItemId(index: number) {
return `${this.listId}-${index}`;
}
/**
* Updates the displayed list of items and then retrieves the most current properties for the `DropdownList` from the DOM.
*/
updateList(items) {
this._items = items.map(item => Object.assign({}, item));
this.displayItems = this._items;
this.updateIndex();
this.setupFocusObservable();
this.doEmitSelect();
}
/**
* Filters the items being displayed in the DOM list.
*/
filterBy(query = "") {
if (query) {
this.displayItems = this.getListItems().filter(item => item.content.toLowerCase().includes(query.toLowerCase()));
// Reset index if items were found
// Prevent selecting index in list that are undefined.
if (this.displayItems) {
this.index = 0;
}
} else {
this.displayItems = this.getListItems();
}
this.updateIndex();
}
/**
* Initializes (or re-initializes) the Observable that handles switching focus to an element based on
* key input matching the first letter of the item in the list.
*/
setupFocusObservable() {
if (!this.list) { return; }
if (this.focusJump) {
this.focusJump.unsubscribe();
}
let elList = Array.from(this.list.nativeElement.querySelectorAll("li"));
this.focusJump = watchFocusJump(this.list.nativeElement, elList)
.subscribe(el => {
el.focus();
});
}
/**
* Returns the `ListItem` that is subsequent to the selected item in the `DropdownList`.
*/
getNextItem(): ListItem {
if (this.index < this.displayItems.length - 1) {
this.index++;
}
return this.displayItems[this.index];
}
/**
* Returns `true` if the selected item is not the last item in the `DropdownList`.
*/
hasNextElement(): boolean {
return this.index < this.displayItems.length - 1 &&
(!(this.index === this.displayItems.length - 2) || !this.displayItems[this.index + 1].disabled);
}
/**
* Returns the `HTMLElement` for the item that is subsequent to the selected item.
*/
getNextElement(): HTMLElement {
// Only return native elements if they are rendered
const elemList = this.listElementList ? this.listElementList.toArray() : [];
if (!elemList.length) {
return null;
}
/**
* Start checking from next index
* Continue looping through the list until a non disabeled element is found or
* end of list is reached
*/
for (let i = this.index + 1; i < elemList.length; i++) {
// If the values in the list are not disabled
if (!this.displayItems[i].disabled) {
this.index = i;
return elemList[i].nativeElement;
}
}
return elemList[this.index]?.nativeElement;
}
/**
* Returns the `ListItem` that precedes the selected item within `DropdownList`.
*/
getPrevItem(): ListItem {
if (this.index > 0) {
this.index--;
}
return this.displayItems[this.index];
}
/**
* Returns `true` if the selected item is not the first in the list.
*/
hasPrevElement(): boolean {
return this.index > 0 && (!(this.index === 1) || !this.displayItems[0].disabled);
}
/**
* Returns the `HTMLElement` for the item that precedes the selected item.
*/
getPrevElement(): HTMLElement {
// Only return native elements if they are rendered
const elemList = this.listElementList ? this.listElementList.toArray() : [];
if (!elemList.length) {
return null;
}
/**
* Start checking from next index
* Continue looping through the list until a non disabeled element is found or
* end of list is reached
*/
for (let i = this.index - 1; i < this.index && i >= 0; i--) {
// If the values in the list are not disabled
if (!this.displayItems[i].disabled) {
this.index = i;
return elemList[i].nativeElement;
}
}
return elemList[this.index].nativeElement;
}
/**
* Returns the `ListItem` that is selected within `DropdownList`.
*/
getCurrentItem(): ListItem {
if (this.index < 0) {
return this.displayItems[0];
}
return this.displayItems[this.index];
}
/**
* Returns the `HTMLElement` for the item that is selected within the `DropdownList`.
*/
getCurrentElement(): HTMLElement {
if (this.index < 0) {
return this.listElementList.first.nativeElement;
}
return this.listElementList.toArray()[this.index].nativeElement;
}
/**
* Returns the items as an Array
*/
getListItems(): Array<ListItem> {
return this._items;
}
/**
* Returns a list containing the selected item(s) in the `DropdownList`.
*/
getSelected(): ListItem[] {
let selected = this.getListItems().filter(item => item.selected);
if (selected.length === 0) {
return [];
}
return selected;
}
/**
* Transforms array input list of items to the correct state by updating the selected item(s).
*/
propagateSelected(value: Array<ListItem>): void {
// if we get a non-array, log out an error (since it is one)
if (!Array.isArray(value)) {
console.error(`${this.constructor.name}.propagateSelected expects an Array<ListItem>, got ${JSON.stringify(value)}`);
}
this.onItemsReady(() => {
const selectedNewItems = [];
for (let newItem of value) {
if (newItem && newItem.selected) {
// copy the item
let tempNewItem: string | ListItem = Object.assign({}, newItem);
// deleted selected because it's what we _want_ to change
delete tempNewItem.selected;
// stringify for compare later
tempNewItem = JSON.stringify(tempNewItem);
// add to the list of selected items
selectedNewItems.push(tempNewItem);
}
}
// loop through the list items and update the `selected` state for matching items in `value`
for (let oldItem of this.getListItems()) {
// fast path when no items are selected
if (selectedNewItems.length === 0) {
oldItem.selected = false;
continue;
}
// copy the item
let tempOldItem: string | ListItem = Object.assign({}, oldItem);
// deleted selected because it's what we _want_ to change
delete tempOldItem.selected;
// stringify for compare
tempOldItem = JSON.stringify(tempOldItem);
for (let selectedNewItem of selectedNewItems) {
// do the compare
if (tempOldItem.includes(selectedNewItem)) {
oldItem.selected = true;
// if we've found a matching item, we can stop looping
break;
} else {
oldItem.selected = false;
}
}
}
});
}
/**
* Initializes focus in the list, effectively a wrapper for `getCurrentElement().focus()`
*/
initFocus() {
if (this.index < 0) {
this.updateIndex();
}
this.list.nativeElement.focus();
setTimeout(() => {
this.highlightedItem = this.getItemId(this.index);
});
}
updateIndex() {
// initialize index on the first selected item or
// on the next non disabled item if no items are selected
// in case, if all items are disabled, the index value will remain same
const selected = this.getSelected();
if (selected.length) {
this.index = this.displayItems.indexOf(selected[0]);
} else if (this.index < 0 && this.hasNextElement()) {
this.getNextElement();
}
}
/**
* Manages the keyboard accessibility for navigation and selection within a `DropdownList`.
*/
navigateList(event: KeyboardEvent) {
if (event.key === "Enter" || event.key === " ") {
if (this.listElementList.some(option => option.nativeElement === event.target)) {
event.preventDefault();
}
if (event.key === "Enter") {
this.doClick(event, this.getCurrentItem());
}
} else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
event.preventDefault();
if (event.key === "ArrowDown") {
if (this.hasNextElement()) {
this.getNextElement()?.scrollIntoView({ block: "end" });
} else {
this.blurIntent.emit("bottom");
}
} else if (event.key === "ArrowUp") {
if (this.hasPrevElement()) {
this.getPrevElement().scrollIntoView({ block: "nearest" });
} else {
this.blurIntent.emit("top");
}
}
setTimeout(() => {
this.highlightedItem = this.getItemId(this.index);
});
}
}
/**
* Emits the selected item or items after a mouse click event has occurred.
*/
doClick(event, item) {
event.preventDefault();
if (item && !item.disabled) {
this.list.nativeElement.focus();
if (this.type === "single") {
item.selected = true;
// reset the selection
for (let otherItem of this.getListItems()) {
if (item !== otherItem) { otherItem.selected = false; }
}
} else {
item.selected = !item.selected;
}
this.index = this.displayItems.indexOf(item);
this.highlightedItem = this.getItemId(this.index);
this.doEmitSelect(false);
this.appRef.tick();
}
}
onItemFocus(index) {
const element = this.listElementList.toArray()[index].nativeElement;
element.classList.add("cds--list-box__menu-item--highlighted");
element.tabIndex = 0;
}
onItemBlur(index) {
const element = this.listElementList.toArray()[index].nativeElement;
element.classList.remove("cds--list-box__menu-item--highlighted");
element.tabIndex = -1;
}
/**
* Emits the scroll event of the options list
*/
emitScroll(event) {
const atTop: boolean = event.srcElement.scrollTop === 0;
const atBottom: boolean = event.srcElement.scrollHeight - event.srcElement.scrollTop === event.srcElement.clientHeight;
const customScrollEvent = { atTop, atBottom, event };
this.scroll.emit(customScrollEvent);
}
/**
* Subscribe the function passed to an internal observable that will resolve once the items are ready
*/
onItemsReady(subcription: () => void): void {
// this subscription will auto unsubscribe because of the `first()` pipe
(this._itemsReady || of(true)).pipe(first()).subscribe(subcription);
}
reorderSelected(moveFocus = true): void {
this.displayItems = [...this.getSelected(), ...this.getListItems().filter(item => !item.selected)];
if (moveFocus) {
setTimeout(() => {
this.updateIndex();
this.highlightedItem = this.getItemId(this.index);
});
}
}
}
</code></pre>
</div>
<div class="tab-pane fade " id="tree">
<div id="tree-container"></div>
<div class="tree-legend">
<div class="title">
<b>Legend</b>
</div>
<div>
<div class="color htmlelement"></div><span>Html element</span>
</div>
<div>
<div class="color component"></div><span>Component</span>
</div>
<div>
<div class="color directive"></div><span>Html element with directive</span>
</div>
</div>
</div>
</div>
<script src="../js/libs/vis.min.js"></script>
<script src="../js/libs/htmlparser.js"></script>
<script src="../js/libs/deep-iterator.js"></script>
<script>
var COMPONENT_TEMPLATE = '<div><ul #list [id]="listId" role="listbox" class="cds--list-box__menu cds--multi-select" (scroll)="emitScroll($event)" (keydown)="navigateList($event)" tabindex="0" [attr.aria-label]="ariaLabel" [attr.aria-activedescendant]="highlightedItem"> <li role="option" *ngFor="let item of displayItems; let i = index" (click)="doClick($event, item)" class="cds--list-box__menu-item" [attr.aria-selected]="item.selected" [id]="getItemId(i)" [attr.tabindex]="highlightedItem === getItemId(i) ? 0 : null" [attr.title]=" showTitles ? item.content : null" [attr.disabled]="item.disabled ? true : null" [ngClass]="{ \'cds--list-box__menu-item--active\': item.selected, \'cds--list-box__menu-item--highlighted\': highlightedItem === getItemId(i) }"> <div #listItem tabindex="-1" class="cds--list-box__menu-item__option"> <div *ngIf="!listTpl && type === \'multi\'" class="cds--form-item cds--checkbox-wrapper"> <label [attr.data-contained-checkbox-state]="item.selected" class="cds--checkbox-label"> <input class="cds--checkbox" type="checkbox" [checked]="item.selected" [disabled]="item.disabled" tabindex="-1"> <span class="cds--checkbox-appearance"></span> <span class="cds--checkbox-label-text">{{item.content}}</span> </label> </div> <ng-container *ngIf="!listTpl && type === \'single\'">{{item.content}}</ng-container> <svg *ngIf="!listTpl && type === \'single\'" cdsIcon="checkmark" size="16" class="cds--list-box__menu-item__selected-icon"> </svg> <ng-template *ngIf="listTpl" [ngTemplateOutletContext]="{item: item}" [ngTemplateOutlet]="listTpl"> </ng-template> </div> </li></ul></div>'
var COMPONENTS = [{'name': 'Accordion', 'selector': 'cds-accordion, ibm-accordion'},{'name': 'AccordionItem', 'selector': 'cds-accordion-item, ibm-accordion-item'},{'name': 'ActionableNotification', 'selector': 'cds-actionable-notification, ibm-actionable-notification'},{'name': 'AlertModal', 'selector': 'cds-alert-modal, ibm-alert-modal'},{'name': 'BaseIconButton', 'selector': ''},{'name': 'BaseNotification', 'selector': ''},{'name': 'BaseTabHeader', 'selector': ''},{'name': 'Breadcrumb', 'selector': 'cds-breadcrumb, ibm-breadcrumb'},{'name': 'BreadcrumbItemComponent', 'selector': 'cds-breadcrumb-item, ibm-breadcrumb-item'},{'name': 'ButtonSet', 'selector': 'cds-button-set, ibm-button-set'},{'name': 'Checkbox', 'selector': 'cds-checkbox, ibm-checkbox'},{'name': 'ClickableTile', 'selector': 'cds-clickable-tile, ibm-clickable-tile'},{'name': 'CodeSnippet', 'selector': 'cds-code-snippet, ibm-code-snippet'},{'name': 'ComboBox', 'selector': 'cds-combo-box, ibm-combo-box'},{'name': 'ComboButtonComponent', 'selector': 'cds-combo-button'},{'name': 'ContainedList', 'selector': 'cds-contained-list, ibm-contained-list'},{'name': 'ContainedListItem', 'selector': 'cds-contained-list-item, ibm-contained-list-item'},{'name': 'ContentSwitcher', 'selector': 'cds-content-switcher, ibm-content-switcher'},{'name': 'ContextMenuComponent', 'selector': 'cds-menu, cds-context-menu, ibm-context-menu'},{'name': 'ContextMenuDividerComponent', 'selector': 'cds-menu-divider, cds-context-menu-divider, ibm-context-menu-divider'},{'name': 'ContextMenuGroupComponent', 'selector': 'cds-menu-group, cds-context-menu-group, ibm-context-menu-group'},{'name': 'ContextMenuItemComponent', 'selector': 'cds-menu-item, cds-context-menu-item, ibm-context-menu-item'},{'name': 'DatePicker', 'selector': 'cds-date-picker, ibm-date-picker'},{'name': 'DatePickerInput', 'selector': 'cds-date-picker-input, ibm-date-picker-input'},{'name': 'Dialog', 'selector': 'cds-dialog, ibm-dialog'},{'name': 'Documentation', 'selector': 'cds-documentation'},{'name': 'Dropdown', 'selector': 'cds-dropdown, ibm-dropdown'},{'name': 'DropdownList', 'selector': 'cds-dropdown-list, ibm-dropdown-list'},{'name': 'ExpandableTile', 'selector': 'cds-expandable-tile, ibm-expandable-tile'},{'name': 'FileComponent', 'selector': 'cds-file, ibm-file'},{'name': 'FileUploader', 'selector': 'cds-file-uploader, ibm-file-uploader'},{'name': 'Hamburger', 'selector': 'cds-hamburger, ibm-hamburger'},{'name': 'Header', 'selector': 'cds-header, ibm-header'},{'name': 'HeaderAction', 'selector': 'cds-header-action, ibm-header-action'},{'name': 'HeaderGlobal', 'selector': 'cds-header-global, ibm-header-global'},{'name': 'HeaderItem', 'selector': 'cds-header-item, ibm-header-item'},{'name': 'HeaderMenu', 'selector': 'cds-header-menu, ibm-header-menu'},{'name': 'HeaderNavigation', 'selector': 'cds-header-navigation, ibm-header-navigation'},{'name': 'IconButton', 'selector': 'cds-icon-button, ibm-icon-button'},{'name': 'InlineLoading', 'selector': 'cds-inline-loading, ibm-inline-loading'},{'name': 'Label', 'selector': 'cds-label, ibm-label'},{'name': 'ListColumn', 'selector': 'cds-list-column, ibm-list-column'},{'name': 'ListHeader', 'selector': 'cds-list-header, ibm-list-header'},{'name': 'ListRow', 'selector': 'cds-list-row, ibm-list-row'},{'name': 'Loading', 'selector': 'cds-loading, ibm-loading'},{'name': 'MenuButtonComponent', 'selector': 'cds-menu-button'},{'name': 'Modal', 'selector': 'cds-modal, ibm-modal'},{'name': 'ModalFooter', 'selector': 'cds-modal-footer, ibm-modal-footer'},{'name': 'ModalHeader', 'selector': 'cds-modal-header, ibm-modal-header'},{'name': 'Notification', 'selector': 'cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification'},{'name': 'NumberComponent', 'selector': 'cds-number, ibm-number'},{'name': 'OverflowMenu', 'selector': 'cds-overflow-menu, ibm-overflow-menu'},{'name': 'OverflowMenuCustomPane', 'selector': 'cds-overflow-custom-menu-pane, ibm-overflow-custom-menu-pane'},{'name': 'OverflowMenuOption', 'selector': 'cds-overflow-menu-option, ibm-overflow-menu-option'},{'name': 'OverflowMenuPane', 'selector': 'cds-overflow-menu-pane, ibm-overflow-menu-pane'},{'name': 'Overlay', 'selector': 'cds-overlay, ibm-overlay'},{'name': 'Pagination', 'selector': 'cds-pagination, ibm-pagination'},{'name': 'PaginationNav', 'selector': 'cds-pagination-nav, ibm-pagination-navm'},{'name': 'PaginationNavItem', 'selector': 'cds-pagination-nav-item, ibm-pagination-nav-item'},{'name': 'PaginationOverflow', 'selector': 'cds-pagination-overflow, ibm-pagination-overflow'},{'name': 'Panel', 'selector': 'cds-panel, ibm-panel'},{'name': 'PasswordInputLabelComponent', 'selector': 'cds-password-label, ibm-password-label'},{'name': 'Placeholder', 'selector': 'cds-placeholder, ibm-placeholder'},{'name': 'PopoverContent', 'selector': 'cds-popover-content, ibm-popover-content'},{'name': 'ProgressBar', 'selector': 'cds-progress-bar, ibm-progress-bar'},{'name': 'ProgressIndicator', 'selector': 'cds-progress-indicator, ibm-progress-indicator'},{'name': 'Radio', 'selector': 'cds-radio, ibm-radio'},{'name': 'RadioGroup', 'selector': 'cds-radio-group, ibm-radio-group'},{'name': 'Search', 'selector': 'cds-search, ibm-search'},{'name': 'Select', 'selector': 'cds-select, ibm-select'},{'name': 'SelectionTile', 'selector': 'cds-selection-tile, ibm-selection-tile'},{'name': 'SideNav', 'selector': 'cds-sidenav, ibm-sidenav'},{'name': 'SideNavItem', 'selector': 'cds-sidenav-item, ibm-sidenav-item'},{'name': 'SideNavMenu', 'selector': 'cds-sidenav-menu, ibm-sidenav-menu'},{'name': 'SkeletonPlaceholder', 'selector': 'cds-skeleton-placeholder, ibm-skeleton-placeholder'},{'name': 'SkeletonText', 'selector': 'cds-skeleton-text, ibm-skeleton-text'},{'name': 'Slider', 'selector': 'cds-slider, ibm-slider'},{'name': 'StructuredList', 'selector': 'cds-structured-list, ibm-structured-list'},{'name': 'SwitcherList', 'selector': 'cds-switcher-list, ibm-switcher-list'},{'name': 'SwitcherListItem', 'selector': 'cds-switcher-list-item, ibm-switcher-list-item'},{'name': 'Tab', 'selector': 'cds-tab, ibm-tab'},{'name': 'TabHeaderGroup', 'selector': 'cds-tab-header-group, ibm-tab-header-group'},{'name': 'TabHeaders', 'selector': 'cds-tab-headers, ibm-tab-headers'},{'name': 'Table', 'selector': 'cds-table, ibm-table'},{'name': 'TableBody', 'selector': '[cdsTableBody], [ibmTableBody]'},{'name': 'TableCheckbox', 'selector': '[cdsTableCheckbox], [ibmTableCheckbox]'},{'name': 'TableContainer', 'selector': 'cds-table-container, ibm-table-container'},{'name': 'TableData', 'selector': '[cdsTableData], [ibmTableData]'},{'name': 'TableExpandButton', 'selector': '[cdsTableExpandButton], [ibmTableExpandButton]'},{'name': 'TableExpandedRow', 'selector': '[cdsTableExpandedRow], [ibmTableExpandedRow]'},{'name': 'TableHead', 'selector': '[cdsTableHead], [ibmTableHead]'},{'name': 'TableHeadCell', 'selector': '[cdsTableHeadCell], [ibmTableHeadCell]'},{'name': 'TableHeadCheckbox', 'selector': '[cdsTableHeadCheckbox], [ibmTableHeadCheckbox]'},{'name': 'TableHeader', 'selector': 'cds-table-header, ibm-table-header'},{'name': 'TableHeadExpand', 'selector': '[cdsTableHeadExpand], [ibmTableHeadExpand]'},{'name': 'TableRadio', 'selector': '[cdsTableRadio], [ibmTableRadio]'},{'name': 'TableRowComponent', 'selector': '[cdsTableRow], [ibmTableRow]'},{'name': 'TableToolbar', 'selector': 'cds-table-toolbar, ibm-table-toolbar'},{'name': 'TableToolbarActions', 'selector': 'cds-table-toolbar-actions, ibm-table-toolbar-actions'},{'name': 'TableToolbarContent', 'selector': 'cds-table-toolbar-content, ibm-table-toolbar-content'},{'name': 'TableToolbarSearch', 'selector': 'cds-table-toolbar-search, ibm-table-toolbar-search'},{'name': 'Tabs', 'selector': 'cds-tabs, ibm-tabs'},{'name': 'TabSkeleton', 'selector': 'cds-tabs-skeleton, ibm-tabs-skeleton'},{'name': 'Tag', 'selector': 'cds-tag, ibm-tag'},{'name': 'TagFilter', 'selector': 'cds-tag-filter, ibm-tag-filter'},{'name': 'TagOperationalComponent', 'selector': 'cds-tag-operational, ibm-tag-operational'},{'name': 'TagSelectableComponent', 'selector': 'cds-tag-selectable, ibm-tag-selectable'},{'name': 'TextareaLabelComponent', 'selector': 'cds-textarea-label, ibm-textarea-label'},{'name': 'TextInputLabelComponent', 'selector': 'cds-text-label, ibm-text-label'},{'name': 'Tile', 'selector': 'cds-tile, ibm-tile'},{'name': 'TileGroup', 'selector': 'cds-tile-group, ibm-tile-group'},{'name': 'TimePicker', 'selector': 'cds-timepicker, ibm-timepicker'},{'name': 'TimePickerSelect', 'selector': 'cds-timepicker-select, ibm-timepicker-select'},{'name': 'Toast', 'selector': 'cds-toast, ibm-toast'},{'name': 'Toggle', 'selector': 'cds-toggle, ibm-toggle'},{'name': 'Toggletip', 'selector': 'cds-toggletip, ibm-toggletip'},{'name': 'Tooltip', 'selector': 'cds-tooltip, ibm-tooltip'},{'name': 'TooltipDefinition', 'selector': 'cds-tooltip-definition, ibm-tooltip-definition'},{'name': 'TreeNodeComponent', 'selector': 'cds-tree-node'},{'name': 'TreeViewComponent', 'selector': 'cds-tree-view'}];
var DIRECTIVES = [{'name': 'AbstractDropdownView', 'selector': '[cdsAbstractDropdownView], [ibmAbstractDropdownView]'},{'name': 'ActionableButton', 'selector': '[cdsActionableButton], [ibmActionableButton]'},{'name': 'ActionableSubtitle', 'selector': '[cdsActionableSubtitle], [ibmActionableSubtitle]'},{'name': 'ActionableTitle', 'selector': '[cdsActionableTitle], [ibmActionableTitle]'},{'name': 'BaseModal', 'selector': '[cdsBaseModal], [ibmBaseModal]'},{'name': 'Button', 'selector': '[cdsButton], [ibmButton]'},{'name': 'ClickableTileIconDirective', 'selector': '[cdsClickableTileIcon], [ibmClickableTileIcon]'},{'name': 'ColumnDirective', 'selector': '[cdsCol], [ibmCol]'},{'name': 'ContentSwitcherOption', 'selector': '[cdsContentOption], [ibmContentOption]'},{'name': 'DialogDirective', 'selector': '[cdsDialog], [ibmDialog]'},{'name': 'ExpandableTileAboveFoldDirective', 'selector': '[cdsAboveFold], [ibmAboveFold]'},{'name': 'ExpandableTileBelowFoldDirective', 'selector': '[cdsBelowFold], [ibmBelowFold]'},{'name': 'ExpandedRowHover', 'selector': '[cdsExpandedRowHover], [ibmExpandedRowHover]'},{'name': 'GridDirective', 'selector': '[cdsGrid], [ibmGrid]'},{'name': 'IconDirective', 'selector': '[cdsIcon], [ibmIcon]'},{'name': 'LayerDirective', 'selector': '[cdsLayer], [ibmLayer]'},{'name': 'Link', 'selector': '[cdsLink], [ibmLink]'},{'name': 'LinkIconDirective', 'selector': '[ibmLinkIcon], [cdsLinkIcon]'},{'name': 'List', 'selector': '[cdsList], [ibmList]'},{'name': 'ListItemDirective', 'selector': '[cdsListItem], [ibmListItem]'},{'name': 'ModalContent', 'selector': '[cdsModalContent], [ibmModalContent]'},{'name': 'ModalContentText', 'selector': '[cdsModalContentText], [ibmModalContentText]'},{'name': 'ModalHeaderHeading', 'selector': '[cdsModalHeaderHeading], [ibmModalHeaderHeading]'},{'name': 'ModalHeaderLabel', 'selector': '[cdsModalHeaderLabel], [ibmModalHeaderLabel]'},{'name': 'NotificationSubtitle', 'selector': '[cdsNotificationSubtitle], [ibmNotificationSubtitle]'},{'name': 'NotificationTitle', 'selector': '[cdsNotificationTitle], [ibmNotificationTitle]'},{'name': 'OptGroup', 'selector': 'optgroup'},{'name': 'Option', 'selector': 'option'},{'name': 'OverflowMenuDirective', 'selector': '[cdsOverflowMenu], [ibmOverflowMenu]'},{'name': 'PasswordInput', 'selector': '[cdsPassword], [ibmPassword]'},{'name': 'PopoverContainer', 'selector': '[cdsPopover], [ibmPopover]'},{'name': 'RouterLinkExtendedDirective', 'selector': '[routerLink]'},{'name': 'RowDirective', 'selector': '[cdsRow], [ibmRow]'},{'name': 'ScrollableList', 'selector': '[cdsScrollableList], [ibmScrollableList]'},{'name': 'StackDirective', 'selector': '[cdsStack], [ibmStack]'},{'name': 'TabHeader', 'selector': '[cdsTabHeader], [ibmTabHeader]'},{'name': 'TableDirective', 'selector': '[cdsTable], [ibmTable]'},{'name': 'TableHeadCellLabel', 'selector': '[cdsTableHeadCellLabel], [ibmTableHeadCellLabel]'},{'name': 'TableHeaderDescription', 'selector': '[cdsTableHeaderDescription], [ibmTableHeaderDescription]'},{'name': 'TableHeaderTitle', 'selector': '[cdsTableHeaderTitle], [ibmTableHeaderTitle]'},{'name': 'TagIconDirective', 'selector': '[cdsTagIcon], [ibmTagIcon]'},{'name': 'TextArea', 'selector': '[cdsTextArea], [ibmTextArea]'},{'name': 'TextInput', 'selector': '[cdsText], [ibmText]'},{'name': 'ThemeDirective', 'selector': '[cdsTheme], [ibmTheme]'},{'name': 'ToastCaption', 'selector': '[cdsToastCaption], [ibmToastCaption]'},{'name': 'ToastSubtitle', 'selector': '[cdsToastSubtitle], [ibmToastSubtitle]'},{'name': 'ToastTitle', 'selector': '[cdsToastTitle], [ibmToastTitle]'},{'name': 'ToggletipAction', 'selector': '[cdsToggletipAction], [ibmToggletipAction]'},{'name': 'ToggletipButton', 'selector': '[cdsToggletipButton], [ibmToggletipButton]'},{'name': 'ToggletipContent', 'selector': '[cdsToggletipContent], [ibmToggletipContent]'},{'name': 'ToggletipLabel', 'selector': '[cdsToggletipLabel], [ibmToggletipLabel]'}];
var ACTUAL_COMPONENT = {'name': 'DropdownList'};
</script>
<script src="../js/tree.js"></script>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
<!-- END CONTENT -->
</div>
</div>
<label class="dark-mode-switch">
<input type="checkbox">
<span class="slider">
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
</svg>
</span>
</label>
<script>
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
var COMPODOC_CURRENT_PAGE_CONTEXT = 'component';
var COMPODOC_CURRENT_PAGE_URL = 'DropdownList.html';
var MAX_SEARCH_RESULTS = 15;
</script>
<script>
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
checkToggle(darkModeState);
if ($darkModeToggleSwitchers.length > 0) {
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
darkModeState = !darkModeState;
toggleDarkMode(darkModeState);
});
}
}
</script>
<script src="../js/libs/custom-elements.min.js"></script>
<script src="../js/libs/lit-html.js"></script>
<script src="../js/menu-wc.js" defer></script>
<script nomodule src="../js/menu-wc_es5.js" defer></script>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
<script src="../js/tabs.js"></script>
<script src="../js/menu.js"></script>
<script src="../js/libs/clipboard.min.js"></script>
<script src="../js/libs/prism.js"></script>
<script src="../js/sourceCode.js"></script>
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
<script src="../js/search/search_index.js"></script>
<script src="../js/lazy-load-graphs.js"></script>
<footer class="carbon">
<dds-footer-container key="footer" disable-locale-button="true" size="micro" />
</footer>
<script
key="8"
type="module"
src="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/footer.min.js">
</script>
<!-- Storybook override -->
<script>
document.title = "Carbon Components Angular";
</script>
<script
src="//1.www.s81c.com/common/stats/ibm-common.js"
type="text/javascript"
async="async">
</script>
</body>
</html>