carbon-components-angular 3.53.8 → 3.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/carbon-angular.umd.js +9 -9
- package/bundle/carbon-angular.umd.js.map +1 -1
- package/combobox/combobox.component.js +1 -7
- package/combobox/combobox.component.js.map +1 -1
- package/docs/documentation/classes/SearchChange.html +11 -0
- package/docs/documentation/components/ComboBox.html +5 -10
- package/docs/documentation/components/DropdownList.html +79 -31
- package/docs/documentation/components/Pagination.html +114 -56
- package/docs/documentation/components/Search.html +96 -17
- package/docs/documentation/components/TableToolbarSearch.html +96 -16
- package/docs/documentation/components/TagFilter.html +131 -4
- package/docs/documentation/coverage.html +17 -17
- package/docs/documentation/interfaces/PaginationTranslations.html +87 -11
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/storybook/iframe.html +3 -3
- package/docs/storybook/{main.293b4966d65e38f1c80c.bundle.js → main.1ccde517361f3d1a057c.bundle.js} +86 -33
- package/docs/storybook/main.1ccde517361f3d1a057c.bundle.js.map +1 -0
- package/docs/storybook/{runtime~main.293b4966d65e38f1c80c.bundle.js → runtime~main.1ccde517361f3d1a057c.bundle.js} +1 -1
- package/docs/storybook/{runtime~main.293b4966d65e38f1c80c.bundle.js.map → runtime~main.1ccde517361f3d1a057c.bundle.js.map} +1 -1
- package/docs/storybook/{vendors~main.293b4966d65e38f1c80c.bundle.js → vendors~main.1ccde517361f3d1a057c.bundle.js} +1 -1
- package/docs/storybook/{vendors~main.293b4966d65e38f1c80c.bundle.js.map → vendors~main.1ccde517361f3d1a057c.bundle.js.map} +1 -1
- package/dropdown/list/dropdown-list.component.d.ts +1 -0
- package/dropdown/list/dropdown-list.component.js +17 -10
- package/dropdown/list/dropdown-list.component.js.map +1 -1
- package/dropdown/list/dropdown-list.component.metadata.json +1 -1
- package/dropdown/list/dropdown-list.component.ngsummary.json +1 -1
- package/i18n/en.d.ts +2 -1
- package/i18n/en.js +3 -2
- package/i18n/en.js.map +1 -1
- package/i18n/i18n.service.d.ts +13 -3
- package/package.json +1 -1
- package/pagination/pagination.component.d.ts +9 -4
- package/pagination/pagination.component.js +9 -5
- package/pagination/pagination.component.js.map +1 -1
- package/pagination/pagination.component.metadata.json +1 -1
- package/pagination/pagination.component.ngfactory.js +20 -18
- package/pagination/pagination.component.ngfactory.js.map +1 -1
- package/search/search.component.d.ts +8 -0
- package/search/search.component.js +12 -1
- package/search/search.component.js.map +1 -1
- package/search/search.component.metadata.json +1 -1
- package/search/search.component.ngfactory.js +6 -3
- package/search/search.component.ngfactory.js.map +1 -1
- package/search/search.component.ngsummary.json +1 -1
- package/table/toolbar/table-toolbar-search.component.js +1 -1
- package/table/toolbar/table-toolbar-search.component.js.map +1 -1
- package/table/toolbar/table-toolbar-search.component.metadata.json +1 -1
- package/table/toolbar/table-toolbar-search.component.ngfactory.js +6 -3
- package/table/toolbar/table-toolbar-search.component.ngfactory.js.map +1 -1
- package/table/toolbar/table-toolbar-search.component.ngsummary.json +1 -1
- package/tag/tag-filter.component.d.ts +9 -0
- package/tag/tag-filter.component.js +15 -1
- package/tag/tag-filter.component.js.map +1 -1
- package/tag/tag-filter.component.metadata.json +1 -1
- package/tag/tag-filter.component.ngfactory.js +2 -2
- package/tag/tag-filter.component.ngfactory.js.map +1 -1
- package/tag/tag-filter.component.ngsummary.json +1 -1
- package/tag/tag.module.ngfactory.js.map +1 -1
- package/docs/storybook/main.293b4966d65e38f1c80c.bundle.js.map +0 -1
|
@@ -418,13 +418,7 @@ var ComboBox = /** @class */ (function () {
|
|
|
418
418
|
var matches = this.view.getListItems().some(function (item) { return item.content.toLowerCase().includes(searchString.toLowerCase()); });
|
|
419
419
|
if (!matches) {
|
|
420
420
|
var selected = this.view.getSelected();
|
|
421
|
-
if (selected
|
|
422
|
-
selected[0].selected = false;
|
|
423
|
-
// notify that the selection has changed
|
|
424
|
-
this.view.select.emit({ item: selected[0] });
|
|
425
|
-
this.propagateChangeCallback(null);
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
421
|
+
if (!selected || !selected[0]) {
|
|
428
422
|
this.view.filterBy("");
|
|
429
423
|
}
|
|
430
424
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.component.js","sourceRoot":"","sources":["../src/combobox/combobox.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EAET,YAAY,EACZ,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EAGZ,WAAW,EACX,WAAW,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAe,MAAM,qBAAqB,CAAC;AAGxD;;;;;;;GAOG;AACH;IAoTC;;OAEG;IACH,kBACW,UAAsB,EACtB,eAAgC,EAChC,IAAU;QAFV,eAAU,GAAV,UAAU,CAAY;QACtB,oBAAe,GAAf,eAAe,CAAiB;QAChC,SAAI,GAAJ,IAAI,CAAM;QA/MZ,OAAE,GAAG,cAAY,QAAQ,CAAC,aAAa,EAAI,CAAC;QACrD;;;;;;;;;;;;;;;;;;;;;;;;;WAyBG;QACM,UAAK,GAAoB,EAAE,CAAC;QAWrC;;WAEG;QACM,SAAI,GAAuB,QAAQ,CAAC;QAC7C;;WAEG;QACM,SAAI,GAAuB,IAAI,CAAC;QASzC;;WAEG;QACM,YAAO,GAAG,KAAK,CAAC;QAKzB;;WAEG;QACM,cAAS,GAAW,IAAI,CAAC;QA6DlC;;WAEG;QACyC,aAAQ,GAAG,KAAK,CAAC;QAC7D;;;;;;;;;;WAUG;QACO,aAAQ,GAAG,IAAI,YAAY,EAAyB,CAAC;QAC/D;;;;;;;;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AAK;8BAIL,KAAK;4BAIL,KAAK;+BAIL,KAAK;gCAUL,KAAK;uCAUL,KAAK;sCAUL,KAAK;sCAUL,KAAK;qCAUL,KAAK;2BAUL,WAAW,SAAC,oBAAoB,cAAG,KAAK;2BAYxC,MAAM;yBA2BN,MAAM;wBAEN,MAAM;yBACN,MAAM;uBAEN,YAAY,SAAC,oBAAoB;+BACjC,SAAS,SAAC,cAAc;wBACxB,SAAS,SAAC,OAAO;4BACjB,WAAW,SAAC,6BAA6B;uBACzC,WAAW,SAAC,WAAW;0BACvB,WAAW,SAAC,eAAe;2BAuG3B,YAAY,SAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;IAmKpC,eAAC;CAAA,AAviBD,IAuiBC;SA9bY,QAAQ","sourcesContent":["import {\n\tComponent,\n\tOnChanges,\n\tContentChild,\n\tInput,\n\tOutput,\n\tHostListener,\n\tElementRef,\n\tViewChild,\n\tEventEmitter,\n\tAfterViewInit,\n\tAfterContentInit,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { AbstractDropdownView } from \"./../dropdown/abstract-dropdown-view.class\";\nimport { ListItem } from \"./../dropdown/list-item.interface\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { filter } from \"rxjs/operators\";\nimport { DocumentService } from \"../utils/utils.module\";\nimport { I18n, Overridable } from \"../i18n/i18n.module\";\nimport { Observable } from \"rxjs\";\n\n/**\n * ComboBoxes are similar to dropdowns, except a combobox provides an input field for users to search items and (optionally) add their own.\n * Multi-select comboboxes also provide \"pills\" of selected items.\n *\n * [See demo](../../?path=/story/combobox--basic)\n *\n * <example-url>../../iframe.html?id=combobox--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-combo-box\",\n\ttemplate: `\n\t\t<label *ngIf=\"label\" [for]=\"id\" class=\"bx--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t</label>\n\t\t<div *ngIf=\"helperText\" class=\"bx--form__helper-text\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div\n\t\t\t[ngClass]=\"{\n\t\t\t\t'bx--multi-select': type === 'multi',\n\t\t\t\t'bx--combo-box': type === 'single' || !pills.length,\n\t\t\t\t'bx--list-box--disabled': disabled\n\t\t\t}\"\n\t\t\tclass=\"bx--combo-box bx--list-box\"\n\t\t\trole=\"listbox\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t\t<div\n\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"bx--list-box__field\"\n\t\t\t\ttype=\"button\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t[attr.aria-label]=\"label\"\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t\t[id]=\"id\">\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t\t(keydown.enter)=\"clearSelected()\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tclass=\"bx--tag--filter bx--list-box__selection--multi\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\n\t\t\t\t\t{{ pills.length }}\n\t\t\t\t\t<svg\n\t\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M12 4.7l-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z\"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t<input\n\t\t\t\t\t#input\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t(keyup)=\"onSearch($event.target.value)\"\n\t\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\t\tclass=\"bx--text-input\"\n\t\t\t\t\t[ngClass]=\"{'bx--text-input--empty': !showClearButton}\"\n\t\t\t\t\trole=\"searchbox\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[attr.aria-aria-labelledby]=\"id\"\n\t\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tautocomplete=\"list\"\n\t\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t\t<ibm-icon-warning-filled16 *ngIf=\"invalid\" class=\"bx--list-box__invalid-icon\"></ibm-icon-warning-filled16>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tclass=\"bx--list-box__selection\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t\t(click)=\"clearInput($event)\">\n\t\t\t\t\t<ibm-icon-close16></ibm-icon-close16>\n\t\t\t\t</div>\n\t\t\t\t<ibm-icon-chevron-down16\n\t\t\t\t\t[ngClass]=\"{'bx--list-box__menu-icon--open': open}\"\n\t\t\t\t\tclass=\"bx--list-box__menu-icon\"\n\t\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t[ariaLabel]=\"open ? closeMenuAria : openMenuAria\">\n\t\t\t\t</ibm-icon-chevron-down16>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t#dropdownMenu\n\t\t\t\t*ngIf=\"open\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</div>\n\t\t</div>\n\t\t<div *ngIf=\"invalid\">\n\t\t\t<div *ngIf=\"!isTemplate(invalidText)\" class=\"bx--form-requirement\">{{ invalidText }}</div>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ComboBox,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class ComboBox implements OnChanges, AfterViewInit, AfterContentInit {\n\tstatic comboBoxCount = 0;\n\t@Input() id = `dropdown-${ComboBox.comboBoxCount++}`;\n\t/**\n\t * List of items to fill the content with.\n\t *\n\t * **Example:**\n\t * ```javascript\n\t * items = [\n\t *\t\t{\n\t *\t\t\tcontent: \"Abacus\",\n\t *\t\t\tselected: false\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Byte\",\n\t *\t\t\tselected: false,\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Computer\",\n\t *\t\t\tselected: false\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Digital\",\n\t *\t\t\tselected: false\n\t *\t\t}\n\t * ];\n\t * ```\n\t *\n\t */\n\t@Input() items: Array<ListItem> = [];\n\t/**\n\t * Text to show when nothing is selected.\n\t */\n\t@Input() set placeholder(value: string | Observable<string>) {\n\t\tthis._placeholder.override(value);\n\t}\n\n\tget placeholder() {\n\t\treturn this._placeholder.value;\n\t}\n\t/**\n\t * Combo box type (supporting single or multi selection of items).\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * Combo box render size.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Label for the combobox.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Max length value to limit input characters\n\t */\n\t@Input() maxLength: number = null;\n\t/**\n\t * Value to display for accessibility purposes on the combobox control menu when closed\n\t */\n\t@Input() set openMenuAria(value: string | Observable<string>) {\n\t\tthis._openMenuAria.override(value);\n\t}\n\n\tget openMenuAria() {\n\t\treturn this._openMenuAria.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes on the combobox control menu when opened\n\t */\n\t@Input() set closeMenuAria(value: string | Observable<string>) {\n\t\tthis._closeMenuAria.override(value);\n\t}\n\n\tget closeMenuAria() {\n\t\treturn this._closeMenuAria.value;\n\t}\n\t/**\n\t * Value to display on the clear selections icon, when multi is selected\n\t */\n\t@Input() set clearSelectionsTitle(value: string | Observable<string>) {\n\t\tthis._clearSelectionsTitle.override(value);\n\t}\n\n\tget clearSelectionsTitle() {\n\t\treturn this._clearSelectionsTitle.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes to clear selections, when multi is selected\n\t */\n\t@Input() set clearSelectionsAria(value: string | Observable<string>) {\n\t\tthis._clearSelectionsAria.override(value);\n\t}\n\n\tget clearSelectionsAria() {\n\t\treturn this._clearSelectionsAria.value;\n\t}\n\t/**\n\t * Value to display on the clear the selected item icon, when single is selected\n\t */\n\t@Input() set clearSelectionTitle(value: string | Observable<string>) {\n\t\tthis._clearSelectionTitle.override(value);\n\t}\n\n\tget clearSelectionTitle() {\n\t\treturn this._clearSelectionTitle.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes on the clear the selected item icon, when single is selected\n\t */\n\t@Input() set clearSelectionAria(value: string | Observable<string>) {\n\t\tthis._clearSelectionAria.override(value);\n\t}\n\n\tget clearSelectionAria() {\n\t\treturn this._clearSelectionAria.value;\n\t}\n\t/**\n\t * Set to `true` to disable combobox.\n\t */\n\t@HostBinding(\"attr.aria-disabled\") @Input() disabled = false;\n\t/**\n\t * Emits a ListItem\n\t *\n\t * Example:\n\t * ```javascript\n\t * {\n\t * \t\tcontent: \"one\",\n\t * \t\tselected: true\n\t * }\n\t * ```\n\t */\n\t@Output() selected = new EventEmitter<ListItem | ListItem[]>();\n\t/**\n\t * Intended to be used to add items to the list.\n\t *\n\t * Emits an event that includes the current item list, the suggested index for the new item, and a simple ListItem\n\t *\n\t * Example:\n\t * ```javascript\n\t *\t{\n\t *\t\titems: [{content: \"one\", selected: true}, {content: \"two\", selected: true}],\n\t *\t\tindex: 1,\n\t *\t\tvalue: {\n\t *\t\t\tcontent: \"some user string\",\n\t *\t\t\tselected: false\n\t *\t\t}\n\t *\t}\n\t * ```\n\t *\n\t *\n\t * Example:\n\t * ```javascript\n\t * {\n\t *\tafter: 1,\n\t *\tvalue: \"some user string\"\n\t * }\n\t * ```\n\t */\n\t@Output() submit = new EventEmitter<any>();\n\t/** emits an empty event when the menu is closed */\n\t@Output() close = new EventEmitter<any>();\n\t@Output() search = new EventEmitter<any>();\n\t/** ContentChild reference to the instantiated dropdown list */\n\t@ContentChild(AbstractDropdownView) view: AbstractDropdownView;\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\t@ViewChild(\"input\") input: ElementRef;\n\t@HostBinding(\"class.bx--list-box__wrapper\") hostClass = true;\n\t@HostBinding(\"attr.role\") role = \"combobox\";\n\t@HostBinding(\"style.display\") display = \"block\";\n\n\tpublic open = false;\n\n\tpublic showClearButton = false;\n\n\t/** Selected items for multi-select combo-boxes. */\n\tpublic pills = [];\n\t/** used to update the displayValue */\n\tpublic selectedValue = \"\";\n\n\tprotected noop = this._noop.bind(this);\n\tprotected onTouchedCallback: () => void = this._noop;\n\tprotected propagateChangeCallback: (_: any) => void = this._noop;\n\n\tprotected _placeholder = this.i18n.getOverridable(\"COMBOBOX.PLACEHOLDER\");\n\tprotected _closeMenuAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLOSE_MENU\");\n\tprotected _openMenuAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.OPEN_MENU\");\n\tprotected _clearSelectionsTitle = this.i18n.getOverridable(\"COMBOBOX.CLEAR_SELECTIONS\");\n\tprotected _clearSelectionsAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLEAR_SELECTIONS\");\n\tprotected _clearSelectionTitle = this.i18n.getOverridable(\"COMBOBOX.CLEAR_SELECTED\");\n\tprotected _clearSelectionAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLEAR_SELECTED\");\n\n\t/**\n\t * Creates an instance of ComboBox.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected documentService: DocumentService,\n\t\tprotected i18n: I18n\n\t) {}\n\n\t/**\n\t * Lifecycle hook.\n\t * Updates pills if necessary.\n\t *\n\t */\n\tngOnChanges(changes) {\n\t\tif (changes.items) {\n\t\t\tthis.view.items = changes.items.currentValue;\n\t\t\t// If new items are added into the combobox while there is search input,\n\t\t\t// repeat the search.\n\t\t\tthis.onSearch(this.input.nativeElement.value, false);\n\t\t\tthis.updateSelected();\n\t\t}\n\t}\n\n\t/**\n\t * Sets initial state that depends on child components\n\t * Subscribes to select events and handles focus/filtering/initial list updates\n\t */\n\tngAfterContentInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t\tthis.view.select.subscribe(event => {\n\t\t\t\tif (this.type === \"multi\") {\n\t\t\t\t\tthis.updatePills();\n\t\t\t\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t\t\t\t} else {\n\t\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\t\tthis.showClearButton = true;\n\t\t\t\t\t\tthis.selectedValue = event.item.content;\n\t\t\t\t\t\tthis.propagateChangeCallback(event.item);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.selectedValue = \"\";\n\t\t\t\t\t\tthis.propagateChangeCallback(null);\n\t\t\t\t\t}\n\t\t\t\t\t// not guarding these since the nativeElement has to be loaded\n\t\t\t\t\t// for select to even fire\n\t\t\t\t\tthis.elementRef.nativeElement.querySelector(\"input\").focus();\n\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\n\t\t\t\tthis.selected.emit(event);\n\t\t\t});\n\t\t\t// update the rest of combobox with any pre-selected items\n\t\t\t// setTimeout just defers the call to the next check cycle\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.updateSelected();\n\t\t\t});\n\n\t\t\tthis.view.blurIntent.pipe(filter(v => v === \"top\")).subscribe(() => {\n\t\t\t\tthis.elementRef.nativeElement.querySelector(\".bx--text-input\").focus();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Binds event handlers against the rendered view\n\t */\n\tngAfterViewInit() {\n\t\tthis.documentService.handleClick(event => {\n\t\t\tif (!this.elementRef.nativeElement.contains(event.target)) {\n\t\t\t\tif (this.open) {\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Handles `Escape` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\thostkeys(ev: KeyboardEvent) {\n\t\tif (ev.key === \"Escape\") {\n\t\t\tthis.closeDropdown();\n\t\t} else if ((ev.key === \"ArrowDown\" || ev.key === \"Down\") // `\"Down\"` is IE specific value\n\t\t\t&& (!this.dropdownMenu || !this.dropdownMenu.nativeElement.contains(ev.target))) {\n\t\t\tev.stopPropagation();\n\t\t\tthis.openDropdown();\n\t\t\tsetTimeout(() => this.view.getCurrentElement().focus(), 0);\n\t\t}\n\t}\n\n\t/*\n\t * no-op method for null event listeners, and other no op calls\n\t */\n\t_noop() {}\n\n\t/*\n\t * propagates the value provided from ngModel\n\t */\n\twriteValue(value: any) {\n\t\tif (this.type === \"single\") {\n\t\t\tthis.view.propagateSelected([value]);\n\t\t} else {\n\t\t\tthis.view.propagateSelected(value);\n\t\t}\n\t\tthis.updateSelected();\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChangeCallback = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * Called by `n-pill-input` when the selected pills have changed.\n\t */\n\tpublic updatePills() {\n\t\tthis.pills = this.view.getSelected() || [];\n\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t}\n\n\tpublic clearSelected() {\n\t\tthis.items = this.items.map(item => {\n\t\t\tif (!item.disabled) {\n\t\t\t\titem.selected = false;\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t\tthis.view.items = this.items;\n\t\tthis.updatePills();\n\t\t// clearSelected can only fire on type=multi\n\t\t// so we just emit getSelected() (just in case there's any disabled but selected items)\n\t\tthis.selected.emit(this.view.getSelected() as any);\n\t}\n\n\t/**\n\t * Closes the dropdown and emits the close event.\n\t */\n\tpublic closeDropdown() {\n\t\tthis.open = false;\n\t\tthis.close.emit();\n\t}\n\n\t/**\n\t * Opens the dropdown.\n\t */\n\tpublic openDropdown() {\n\t\tif (this.disabled) { return; }\n\t\tthis.open = true;\n\t}\n\n\t/**\n\t * Toggles the dropdown.\n\t */\n\tpublic toggleDropdown() {\n\t\tif (this.open) {\n\t\t\tthis.closeDropdown();\n\t\t} else {\n\t\t\tthis.openDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Sets the list group filter, and manages single select item selection.\n\t */\n\tpublic onSearch(searchString, shouldEmitSearch = true) {\n\t\tif (shouldEmitSearch) {\n\t\t\tthis.search.emit(searchString);\n\t\t}\n\t\tthis.showClearButton = searchString && this.type === \"single\";\n\t\tthis.view.filterBy(searchString);\n\t\tif (searchString !== \"\") {\n\t\t\tthis.openDropdown();\n\t\t} else {\n\t\t\tthis.selectedValue = \"\";\n\t\t}\n\t\tif (this.type === \"single\") {\n\t\t\t// deselect if the input doesn't match the content\n\t\t\t// of any given item\n\t\t\tconst matches = this.view.getListItems().some(item => item.content.toLowerCase().includes(searchString.toLowerCase()));\n\t\t\tif (!matches) {\n\t\t\t\tconst selected = this.view.getSelected();\n\t\t\t\tif (selected && selected[0]) {\n\t\t\t\t\tselected[0].selected = false;\n\t\t\t\t\t// notify that the selection has changed\n\t\t\t\t\tthis.view.select.emit({ item: selected[0] });\n\t\t\t\t\tthis.propagateChangeCallback(null);\n\t\t\t\t} else {\n\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Intended to be used to add items to the list.\n\t */\n\tpublic onSubmit(event: KeyboardEvent) {\n\t\tthis.submit.emit({\n\t\t\titems: this.view.getListItems(),\n\t\t\tindex: 0,\n\t\t\tvalue: {\n\t\t\t\tcontent: (event.target as HTMLInputElement).value,\n\t\t\t\tselected: false\n\t\t\t}\n\t\t});\n\t}\n\n\tclearInput(event) {\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\n\t\tthis.clearSelected();\n\t\tthis.input.nativeElement.value = \"\";\n\t\tthis.selectedValue = \"\";\n\t\tthis.closeDropdown();\n\n\t\tthis.showClearButton = false;\n\t\tthis.search.emit(\"\");\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tprotected updateSelected() {\n\t\tconst selected = this.view.getSelected();\n\t\tif (this.type === \"multi\" ) {\n\t\t\tthis.updatePills();\n\t\t} else if (selected && selected[0]) {\n\t\t\tthis.selectedValue = selected[0].content;\n\t\t\tthis.showClearButton = true;\n\t\t\tthis.propagateChangeCallback(selected[0]);\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"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AC,QAAQ,CAAC;;IA8JpC,eAAC;CAAA,AAliBD,IAkiBC;SAzbY,QAAQ","sourcesContent":["import {\n\tComponent,\n\tOnChanges,\n\tContentChild,\n\tInput,\n\tOutput,\n\tHostListener,\n\tElementRef,\n\tViewChild,\n\tEventEmitter,\n\tAfterViewInit,\n\tAfterContentInit,\n\tHostBinding,\n\tTemplateRef\n} from \"@angular/core\";\nimport { AbstractDropdownView } from \"./../dropdown/abstract-dropdown-view.class\";\nimport { ListItem } from \"./../dropdown/list-item.interface\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { filter } from \"rxjs/operators\";\nimport { DocumentService } from \"../utils/utils.module\";\nimport { I18n, Overridable } from \"../i18n/i18n.module\";\nimport { Observable } from \"rxjs\";\n\n/**\n * ComboBoxes are similar to dropdowns, except a combobox provides an input field for users to search items and (optionally) add their own.\n * Multi-select comboboxes also provide \"pills\" of selected items.\n *\n * [See demo](../../?path=/story/combobox--basic)\n *\n * <example-url>../../iframe.html?id=combobox--basic</example-url>\n */\n@Component({\n\tselector: \"ibm-combo-box\",\n\ttemplate: `\n\t\t<label *ngIf=\"label\" [for]=\"id\" class=\"bx--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t</label>\n\t\t<div *ngIf=\"helperText\" class=\"bx--form__helper-text\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div\n\t\t\t[ngClass]=\"{\n\t\t\t\t'bx--multi-select': type === 'multi',\n\t\t\t\t'bx--combo-box': type === 'single' || !pills.length,\n\t\t\t\t'bx--list-box--disabled': disabled\n\t\t\t}\"\n\t\t\tclass=\"bx--combo-box bx--list-box\"\n\t\t\trole=\"listbox\"\n\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t\t<div\n\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"bx--list-box__field\"\n\t\t\t\ttype=\"button\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t[attr.aria-label]=\"label\"\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t\t[id]=\"id\">\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t\t(keydown.enter)=\"clearSelected()\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tclass=\"bx--tag--filter bx--list-box__selection--multi\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\n\t\t\t\t\t{{ pills.length }}\n\t\t\t\t\t<svg\n\t\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<path d=\"M12 4.7l-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z\"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t\t<input\n\t\t\t\t\t#input\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t(keyup)=\"onSearch($event.target.value)\"\n\t\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\t\tclass=\"bx--text-input\"\n\t\t\t\t\t[ngClass]=\"{'bx--text-input--empty': !showClearButton}\"\n\t\t\t\t\trole=\"searchbox\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[attr.aria-aria-labelledby]=\"id\"\n\t\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tautocomplete=\"list\"\n\t\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t\t<ibm-icon-warning-filled16 *ngIf=\"invalid\" class=\"bx--list-box__invalid-icon\"></ibm-icon-warning-filled16>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tclass=\"bx--list-box__selection\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t\t(click)=\"clearInput($event)\">\n\t\t\t\t\t<ibm-icon-close16></ibm-icon-close16>\n\t\t\t\t</div>\n\t\t\t\t<ibm-icon-chevron-down16\n\t\t\t\t\t[ngClass]=\"{'bx--list-box__menu-icon--open': open}\"\n\t\t\t\t\tclass=\"bx--list-box__menu-icon\"\n\t\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t[ariaLabel]=\"open ? closeMenuAria : openMenuAria\">\n\t\t\t\t</ibm-icon-chevron-down16>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t#dropdownMenu\n\t\t\t\t*ngIf=\"open\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</div>\n\t\t</div>\n\t\t<div *ngIf=\"invalid\">\n\t\t\t<div *ngIf=\"!isTemplate(invalidText)\" class=\"bx--form-requirement\">{{ invalidText }}</div>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: ComboBox,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class ComboBox implements OnChanges, AfterViewInit, AfterContentInit {\n\tstatic comboBoxCount = 0;\n\t@Input() id = `dropdown-${ComboBox.comboBoxCount++}`;\n\t/**\n\t * List of items to fill the content with.\n\t *\n\t * **Example:**\n\t * ```javascript\n\t * items = [\n\t *\t\t{\n\t *\t\t\tcontent: \"Abacus\",\n\t *\t\t\tselected: false\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Byte\",\n\t *\t\t\tselected: false,\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Computer\",\n\t *\t\t\tselected: false\n\t *\t\t},\n\t *\t\t{\n\t *\t\t\tcontent: \"Digital\",\n\t *\t\t\tselected: false\n\t *\t\t}\n\t * ];\n\t * ```\n\t *\n\t */\n\t@Input() items: Array<ListItem> = [];\n\t/**\n\t * Text to show when nothing is selected.\n\t */\n\t@Input() set placeholder(value: string | Observable<string>) {\n\t\tthis._placeholder.override(value);\n\t}\n\n\tget placeholder() {\n\t\treturn this._placeholder.value;\n\t}\n\t/**\n\t * Combo box type (supporting single or multi selection of items).\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * Combo box render size.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Label for the combobox.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Max length value to limit input characters\n\t */\n\t@Input() maxLength: number = null;\n\t/**\n\t * Value to display for accessibility purposes on the combobox control menu when closed\n\t */\n\t@Input() set openMenuAria(value: string | Observable<string>) {\n\t\tthis._openMenuAria.override(value);\n\t}\n\n\tget openMenuAria() {\n\t\treturn this._openMenuAria.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes on the combobox control menu when opened\n\t */\n\t@Input() set closeMenuAria(value: string | Observable<string>) {\n\t\tthis._closeMenuAria.override(value);\n\t}\n\n\tget closeMenuAria() {\n\t\treturn this._closeMenuAria.value;\n\t}\n\t/**\n\t * Value to display on the clear selections icon, when multi is selected\n\t */\n\t@Input() set clearSelectionsTitle(value: string | Observable<string>) {\n\t\tthis._clearSelectionsTitle.override(value);\n\t}\n\n\tget clearSelectionsTitle() {\n\t\treturn this._clearSelectionsTitle.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes to clear selections, when multi is selected\n\t */\n\t@Input() set clearSelectionsAria(value: string | Observable<string>) {\n\t\tthis._clearSelectionsAria.override(value);\n\t}\n\n\tget clearSelectionsAria() {\n\t\treturn this._clearSelectionsAria.value;\n\t}\n\t/**\n\t * Value to display on the clear the selected item icon, when single is selected\n\t */\n\t@Input() set clearSelectionTitle(value: string | Observable<string>) {\n\t\tthis._clearSelectionTitle.override(value);\n\t}\n\n\tget clearSelectionTitle() {\n\t\treturn this._clearSelectionTitle.value;\n\t}\n\t/**\n\t * Value to display for accessibility purposes on the clear the selected item icon, when single is selected\n\t */\n\t@Input() set clearSelectionAria(value: string | Observable<string>) {\n\t\tthis._clearSelectionAria.override(value);\n\t}\n\n\tget clearSelectionAria() {\n\t\treturn this._clearSelectionAria.value;\n\t}\n\t/**\n\t * Set to `true` to disable combobox.\n\t */\n\t@HostBinding(\"attr.aria-disabled\") @Input() disabled = false;\n\t/**\n\t * Emits a ListItem\n\t *\n\t * Example:\n\t * ```javascript\n\t * {\n\t * \t\tcontent: \"one\",\n\t * \t\tselected: true\n\t * }\n\t * ```\n\t */\n\t@Output() selected = new EventEmitter<ListItem | ListItem[]>();\n\t/**\n\t * Intended to be used to add items to the list.\n\t *\n\t * Emits an event that includes the current item list, the suggested index for the new item, and a simple ListItem\n\t *\n\t * Example:\n\t * ```javascript\n\t *\t{\n\t *\t\titems: [{content: \"one\", selected: true}, {content: \"two\", selected: true}],\n\t *\t\tindex: 1,\n\t *\t\tvalue: {\n\t *\t\t\tcontent: \"some user string\",\n\t *\t\t\tselected: false\n\t *\t\t}\n\t *\t}\n\t * ```\n\t *\n\t *\n\t * Example:\n\t * ```javascript\n\t * {\n\t *\tafter: 1,\n\t *\tvalue: \"some user string\"\n\t * }\n\t * ```\n\t */\n\t@Output() submit = new EventEmitter<any>();\n\t/** emits an empty event when the menu is closed */\n\t@Output() close = new EventEmitter<any>();\n\t@Output() search = new EventEmitter<any>();\n\t/** ContentChild reference to the instantiated dropdown list */\n\t@ContentChild(AbstractDropdownView) view: AbstractDropdownView;\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\t@ViewChild(\"input\") input: ElementRef;\n\t@HostBinding(\"class.bx--list-box__wrapper\") hostClass = true;\n\t@HostBinding(\"attr.role\") role = \"combobox\";\n\t@HostBinding(\"style.display\") display = \"block\";\n\n\tpublic open = false;\n\n\tpublic showClearButton = false;\n\n\t/** Selected items for multi-select combo-boxes. */\n\tpublic pills = [];\n\t/** used to update the displayValue */\n\tpublic selectedValue = \"\";\n\n\tprotected noop = this._noop.bind(this);\n\tprotected onTouchedCallback: () => void = this._noop;\n\tprotected propagateChangeCallback: (_: any) => void = this._noop;\n\n\tprotected _placeholder = this.i18n.getOverridable(\"COMBOBOX.PLACEHOLDER\");\n\tprotected _closeMenuAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLOSE_MENU\");\n\tprotected _openMenuAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.OPEN_MENU\");\n\tprotected _clearSelectionsTitle = this.i18n.getOverridable(\"COMBOBOX.CLEAR_SELECTIONS\");\n\tprotected _clearSelectionsAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLEAR_SELECTIONS\");\n\tprotected _clearSelectionTitle = this.i18n.getOverridable(\"COMBOBOX.CLEAR_SELECTED\");\n\tprotected _clearSelectionAria = this.i18n.getOverridable(\"COMBOBOX.A11Y.CLEAR_SELECTED\");\n\n\t/**\n\t * Creates an instance of ComboBox.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected documentService: DocumentService,\n\t\tprotected i18n: I18n\n\t) {}\n\n\t/**\n\t * Lifecycle hook.\n\t * Updates pills if necessary.\n\t *\n\t */\n\tngOnChanges(changes) {\n\t\tif (changes.items) {\n\t\t\tthis.view.items = changes.items.currentValue;\n\t\t\t// If new items are added into the combobox while there is search input,\n\t\t\t// repeat the search.\n\t\t\tthis.onSearch(this.input.nativeElement.value, false);\n\t\t\tthis.updateSelected();\n\t\t}\n\t}\n\n\t/**\n\t * Sets initial state that depends on child components\n\t * Subscribes to select events and handles focus/filtering/initial list updates\n\t */\n\tngAfterContentInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t\tthis.view.select.subscribe(event => {\n\t\t\t\tif (this.type === \"multi\") {\n\t\t\t\t\tthis.updatePills();\n\t\t\t\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t\t\t\t} else {\n\t\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\t\tthis.showClearButton = true;\n\t\t\t\t\t\tthis.selectedValue = event.item.content;\n\t\t\t\t\t\tthis.propagateChangeCallback(event.item);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.selectedValue = \"\";\n\t\t\t\t\t\tthis.propagateChangeCallback(null);\n\t\t\t\t\t}\n\t\t\t\t\t// not guarding these since the nativeElement has to be loaded\n\t\t\t\t\t// for select to even fire\n\t\t\t\t\tthis.elementRef.nativeElement.querySelector(\"input\").focus();\n\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\n\t\t\t\tthis.selected.emit(event);\n\t\t\t});\n\t\t\t// update the rest of combobox with any pre-selected items\n\t\t\t// setTimeout just defers the call to the next check cycle\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.updateSelected();\n\t\t\t});\n\n\t\t\tthis.view.blurIntent.pipe(filter(v => v === \"top\")).subscribe(() => {\n\t\t\t\tthis.elementRef.nativeElement.querySelector(\".bx--text-input\").focus();\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Binds event handlers against the rendered view\n\t */\n\tngAfterViewInit() {\n\t\tthis.documentService.handleClick(event => {\n\t\t\tif (!this.elementRef.nativeElement.contains(event.target)) {\n\t\t\t\tif (this.open) {\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Handles `Escape` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\thostkeys(ev: KeyboardEvent) {\n\t\tif (ev.key === \"Escape\") {\n\t\t\tthis.closeDropdown();\n\t\t} else if ((ev.key === \"ArrowDown\" || ev.key === \"Down\") // `\"Down\"` is IE specific value\n\t\t\t&& (!this.dropdownMenu || !this.dropdownMenu.nativeElement.contains(ev.target))) {\n\t\t\tev.stopPropagation();\n\t\t\tthis.openDropdown();\n\t\t\tsetTimeout(() => this.view.getCurrentElement().focus(), 0);\n\t\t}\n\t}\n\n\t/*\n\t * no-op method for null event listeners, and other no op calls\n\t */\n\t_noop() {}\n\n\t/*\n\t * propagates the value provided from ngModel\n\t */\n\twriteValue(value: any) {\n\t\tif (this.type === \"single\") {\n\t\t\tthis.view.propagateSelected([value]);\n\t\t} else {\n\t\t\tthis.view.propagateSelected(value);\n\t\t}\n\t\tthis.updateSelected();\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChangeCallback = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * Called by `n-pill-input` when the selected pills have changed.\n\t */\n\tpublic updatePills() {\n\t\tthis.pills = this.view.getSelected() || [];\n\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t}\n\n\tpublic clearSelected() {\n\t\tthis.items = this.items.map(item => {\n\t\t\tif (!item.disabled) {\n\t\t\t\titem.selected = false;\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t\tthis.view.items = this.items;\n\t\tthis.updatePills();\n\t\t// clearSelected can only fire on type=multi\n\t\t// so we just emit getSelected() (just in case there's any disabled but selected items)\n\t\tthis.selected.emit(this.view.getSelected() as any);\n\t}\n\n\t/**\n\t * Closes the dropdown and emits the close event.\n\t */\n\tpublic closeDropdown() {\n\t\tthis.open = false;\n\t\tthis.close.emit();\n\t}\n\n\t/**\n\t * Opens the dropdown.\n\t */\n\tpublic openDropdown() {\n\t\tif (this.disabled) { return; }\n\t\tthis.open = true;\n\t}\n\n\t/**\n\t * Toggles the dropdown.\n\t */\n\tpublic toggleDropdown() {\n\t\tif (this.open) {\n\t\t\tthis.closeDropdown();\n\t\t} else {\n\t\t\tthis.openDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Sets the list group filter, and manages single select item selection.\n\t */\n\tpublic onSearch(searchString, shouldEmitSearch = true) {\n\t\tif (shouldEmitSearch) {\n\t\t\tthis.search.emit(searchString);\n\t\t}\n\t\tthis.showClearButton = searchString && this.type === \"single\";\n\t\tthis.view.filterBy(searchString);\n\t\tif (searchString !== \"\") {\n\t\t\tthis.openDropdown();\n\t\t} else {\n\t\t\tthis.selectedValue = \"\";\n\t\t}\n\t\tif (this.type === \"single\") {\n\t\t\t// deselect if the input doesn't match the content\n\t\t\t// of any given item\n\t\t\tconst matches = this.view.getListItems().some(item => item.content.toLowerCase().includes(searchString.toLowerCase()));\n\t\t\tif (!matches) {\n\t\t\t\tconst selected = this.view.getSelected();\n\t\t\t\tif (!selected || !selected[0]) {\n\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Intended to be used to add items to the list.\n\t */\n\tpublic onSubmit(event: KeyboardEvent) {\n\t\tthis.submit.emit({\n\t\t\titems: this.view.getListItems(),\n\t\t\tindex: 0,\n\t\t\tvalue: {\n\t\t\t\tcontent: (event.target as HTMLInputElement).value,\n\t\t\t\tselected: false\n\t\t\t}\n\t\t});\n\t}\n\n\tclearInput(event) {\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\n\t\tthis.clearSelected();\n\t\tthis.input.nativeElement.value = \"\";\n\t\tthis.selectedValue = \"\";\n\t\tthis.closeDropdown();\n\n\t\tthis.showClearButton = false;\n\t\tthis.search.emit(\"\");\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tprotected updateSelected() {\n\t\tconst selected = this.view.getSelected();\n\t\tif (this.type === \"multi\" ) {\n\t\t\tthis.updatePills();\n\t\t} else if (selected && selected[0]) {\n\t\t\tthis.selectedValue = selected[0].content;\n\t\t\tthis.showClearButton = true;\n\t\t\tthis.propagateChangeCallback(selected[0]);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -333,6 +333,10 @@ export class Search implements ControlValueAccessor {
|
|
|
333
333
|
* Emits an event when value is changed.
|
|
334
334
|
*/
|
|
335
335
|
@Output() valueChange = new EventEmitter<string>();
|
|
336
|
+
/**
|
|
337
|
+
* Emits an event on enter.
|
|
338
|
+
*/
|
|
339
|
+
@Output() search = new EventEmitter<string>();
|
|
336
340
|
@Output() open = new EventEmitter<boolean>();
|
|
337
341
|
/**
|
|
338
342
|
* Emits an event when the clear button is clicked.
|
|
@@ -393,6 +397,13 @@ export class Search implements ControlValueAccessor {
|
|
|
393
397
|
this.doValueChange();
|
|
394
398
|
}
|
|
395
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Called on enter.
|
|
402
|
+
*/
|
|
403
|
+
onEnter() {
|
|
404
|
+
this.search.emit(this.value);
|
|
405
|
+
}
|
|
406
|
+
|
|
396
407
|
/**
|
|
397
408
|
* Called when clear button is clicked.
|
|
398
409
|
*/
|
|
@@ -1325,7 +1325,7 @@ Multi-select comboboxes also provide "pills" of selected items.</p>
|
|
|
1325
1325
|
|
|
1326
1326
|
<tr>
|
|
1327
1327
|
<td class="col-md-4">
|
|
1328
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1328
|
+
<div class="io-line">Defined in <a href="" data-line="551" class="link-to-prism">src/combobox/combobox.component.ts:551</a></div>
|
|
1329
1329
|
</td>
|
|
1330
1330
|
</tr>
|
|
1331
1331
|
|
|
@@ -1474,7 +1474,7 @@ Multi-select comboboxes also provide "pills" of selected items.</p>
|
|
|
1474
1474
|
|
|
1475
1475
|
<tr>
|
|
1476
1476
|
<td class="col-md-4">
|
|
1477
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1477
|
+
<div class="io-line">Defined in <a href="" data-line="564" class="link-to-prism">src/combobox/combobox.component.ts:564</a></div>
|
|
1478
1478
|
</td>
|
|
1479
1479
|
</tr>
|
|
1480
1480
|
|
|
@@ -1812,7 +1812,7 @@ Updates pills if necessary.</p>
|
|
|
1812
1812
|
|
|
1813
1813
|
<tr>
|
|
1814
1814
|
<td class="col-md-4">
|
|
1815
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1815
|
+
<div class="io-line">Defined in <a href="" data-line="540" class="link-to-prism">src/combobox/combobox.component.ts:540</a></div>
|
|
1816
1816
|
</td>
|
|
1817
1817
|
</tr>
|
|
1818
1818
|
|
|
@@ -2149,7 +2149,7 @@ Updates pills if necessary.</p>
|
|
|
2149
2149
|
|
|
2150
2150
|
<tr>
|
|
2151
2151
|
<td class="col-md-4">
|
|
2152
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
2152
|
+
<div class="io-line">Defined in <a href="" data-line="568" class="link-to-prism">src/combobox/combobox.component.ts:568</a></div>
|
|
2153
2153
|
</td>
|
|
2154
2154
|
</tr>
|
|
2155
2155
|
|
|
@@ -3931,12 +3931,7 @@ export class ComboBox implements OnChanges, AfterViewInit, AfterContentInit {
|
|
|
3931
3931
|
const matches = this.view.getListItems().some(item => item.content.toLowerCase().includes(searchString.toLowerCase()));
|
|
3932
3932
|
if (!matches) {
|
|
3933
3933
|
const selected = this.view.getSelected();
|
|
3934
|
-
if (selected
|
|
3935
|
-
selected[0].selected = false;
|
|
3936
|
-
// notify that the selection has changed
|
|
3937
|
-
this.view.select.emit({ item: selected[0] });
|
|
3938
|
-
this.propagateChangeCallback(null);
|
|
3939
|
-
} else {
|
|
3934
|
+
if (!selected || !selected[0]) {
|
|
3940
3935
|
this.view.filterBy("");
|
|
3941
3936
|
}
|
|
3942
3937
|
}
|
|
@@ -259,6 +259,9 @@
|
|
|
259
259
|
<li>
|
|
260
260
|
<a href="#doClick">doClick</a>
|
|
261
261
|
</li>
|
|
262
|
+
<li>
|
|
263
|
+
<a href="#doEmitSelect">doEmitSelect</a>
|
|
264
|
+
</li>
|
|
262
265
|
<li>
|
|
263
266
|
<a href="#doKeyDown">doKeyDown</a>
|
|
264
267
|
</li>
|
|
@@ -652,7 +655,7 @@ ArrowUp -> emit event</p>
|
|
|
652
655
|
|
|
653
656
|
<tr>
|
|
654
657
|
<td class="col-md-4">
|
|
655
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
658
|
+
<div class="io-line">Defined in <a href="" data-line="478" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:478</a></div>
|
|
656
659
|
</td>
|
|
657
660
|
</tr>
|
|
658
661
|
|
|
@@ -706,6 +709,44 @@ ArrowUp -> emit event</p>
|
|
|
706
709
|
</tr>
|
|
707
710
|
</tbody>
|
|
708
711
|
</table>
|
|
712
|
+
<table class="table table-sm table-bordered">
|
|
713
|
+
<tbody>
|
|
714
|
+
<tr>
|
|
715
|
+
<td class="col-md-4">
|
|
716
|
+
<a name="doEmitSelect"></a>
|
|
717
|
+
<span class="name">
|
|
718
|
+
<b>
|
|
719
|
+
doEmitSelect
|
|
720
|
+
</b>
|
|
721
|
+
<a href="#doEmitSelect"><span class="icon ion-ios-link"></span></a>
|
|
722
|
+
</span>
|
|
723
|
+
</td>
|
|
724
|
+
</tr>
|
|
725
|
+
<tr>
|
|
726
|
+
<td class="col-md-4">
|
|
727
|
+
<code>doEmitSelect()</code>
|
|
728
|
+
</td>
|
|
729
|
+
</tr>
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
<tr>
|
|
733
|
+
<td class="col-md-4">
|
|
734
|
+
<div class="io-line">Defined in <a href="" data-line="233" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:233</a></div>
|
|
735
|
+
</td>
|
|
736
|
+
</tr>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<tr>
|
|
740
|
+
<td class="col-md-4">
|
|
741
|
+
|
|
742
|
+
<div class="io-description">
|
|
743
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
744
|
+
|
|
745
|
+
</div>
|
|
746
|
+
</td>
|
|
747
|
+
</tr>
|
|
748
|
+
</tbody>
|
|
749
|
+
</table>
|
|
709
750
|
<table class="table table-sm table-bordered">
|
|
710
751
|
<tbody>
|
|
711
752
|
<tr>
|
|
@@ -728,7 +769,7 @@ ArrowUp -> emit event</p>
|
|
|
728
769
|
|
|
729
770
|
<tr>
|
|
730
771
|
<td class="col-md-4">
|
|
731
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
772
|
+
<div class="io-line">Defined in <a href="" data-line="448" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:448</a></div>
|
|
732
773
|
</td>
|
|
733
774
|
</tr>
|
|
734
775
|
|
|
@@ -811,7 +852,7 @@ ArrowUp -> emit event</p>
|
|
|
811
852
|
|
|
812
853
|
<tr>
|
|
813
854
|
<td class="col-md-4">
|
|
814
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
855
|
+
<div class="io-line">Defined in <a href="" data-line="513" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:513</a></div>
|
|
815
856
|
</td>
|
|
816
857
|
</tr>
|
|
817
858
|
|
|
@@ -878,7 +919,7 @@ ArrowUp -> emit event</p>
|
|
|
878
919
|
|
|
879
920
|
<tr>
|
|
880
921
|
<td class="col-md-4">
|
|
881
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
922
|
+
<div class="io-line">Defined in <a href="" data-line="262" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:262</a></div>
|
|
882
923
|
</td>
|
|
883
924
|
</tr>
|
|
884
925
|
|
|
@@ -953,7 +994,7 @@ ArrowUp -> emit event</p>
|
|
|
953
994
|
|
|
954
995
|
<tr>
|
|
955
996
|
<td class="col-md-4">
|
|
956
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
997
|
+
<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>
|
|
957
998
|
</td>
|
|
958
999
|
</tr>
|
|
959
1000
|
|
|
@@ -993,7 +1034,7 @@ ArrowUp -> emit event</p>
|
|
|
993
1034
|
|
|
994
1035
|
<tr>
|
|
995
1036
|
<td class="col-md-4">
|
|
996
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1037
|
+
<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>
|
|
997
1038
|
</td>
|
|
998
1039
|
</tr>
|
|
999
1040
|
|
|
@@ -1033,7 +1074,7 @@ ArrowUp -> emit event</p>
|
|
|
1033
1074
|
|
|
1034
1075
|
<tr>
|
|
1035
1076
|
<td class="col-md-4">
|
|
1036
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1077
|
+
<div class="io-line">Defined in <a href="" data-line="382" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:382</a></div>
|
|
1037
1078
|
</td>
|
|
1038
1079
|
</tr>
|
|
1039
1080
|
|
|
@@ -1073,7 +1114,7 @@ ArrowUp -> emit event</p>
|
|
|
1073
1114
|
|
|
1074
1115
|
<tr>
|
|
1075
1116
|
<td class="col-md-4">
|
|
1076
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1117
|
+
<div class="io-line">Defined in <a href="" data-line="311" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:311</a></div>
|
|
1077
1118
|
</td>
|
|
1078
1119
|
</tr>
|
|
1079
1120
|
|
|
@@ -1113,7 +1154,7 @@ ArrowUp -> emit event</p>
|
|
|
1113
1154
|
|
|
1114
1155
|
<tr>
|
|
1115
1156
|
<td class="col-md-4">
|
|
1116
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1157
|
+
<div class="io-line">Defined in <a href="" data-line="290" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:290</a></div>
|
|
1117
1158
|
</td>
|
|
1118
1159
|
</tr>
|
|
1119
1160
|
|
|
@@ -1153,7 +1194,7 @@ ArrowUp -> emit event</p>
|
|
|
1153
1194
|
|
|
1154
1195
|
<tr>
|
|
1155
1196
|
<td class="col-md-4">
|
|
1156
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1197
|
+
<div class="io-line">Defined in <a href="" data-line="347" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:347</a></div>
|
|
1157
1198
|
</td>
|
|
1158
1199
|
</tr>
|
|
1159
1200
|
|
|
@@ -1193,7 +1234,7 @@ ArrowUp -> emit event</p>
|
|
|
1193
1234
|
|
|
1194
1235
|
<tr>
|
|
1195
1236
|
<td class="col-md-4">
|
|
1196
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1237
|
+
<div class="io-line">Defined in <a href="" data-line="326" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:326</a></div>
|
|
1197
1238
|
</td>
|
|
1198
1239
|
</tr>
|
|
1199
1240
|
|
|
@@ -1233,7 +1274,7 @@ ArrowUp -> emit event</p>
|
|
|
1233
1274
|
|
|
1234
1275
|
<tr>
|
|
1235
1276
|
<td class="col-md-4">
|
|
1236
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1277
|
+
<div class="io-line">Defined in <a href="" data-line="389" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:389</a></div>
|
|
1237
1278
|
</td>
|
|
1238
1279
|
</tr>
|
|
1239
1280
|
|
|
@@ -1273,7 +1314,7 @@ ArrowUp -> emit event</p>
|
|
|
1273
1314
|
|
|
1274
1315
|
<tr>
|
|
1275
1316
|
<td class="col-md-4">
|
|
1276
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1317
|
+
<div class="io-line">Defined in <a href="" data-line="301" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:301</a></div>
|
|
1277
1318
|
</td>
|
|
1278
1319
|
</tr>
|
|
1279
1320
|
|
|
@@ -1314,7 +1355,7 @@ TODO: standardize</p>
|
|
|
1314
1355
|
|
|
1315
1356
|
<tr>
|
|
1316
1357
|
<td class="col-md-4">
|
|
1317
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1358
|
+
<div class="io-line">Defined in <a href="" data-line="337" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:337</a></div>
|
|
1318
1359
|
</td>
|
|
1319
1360
|
</tr>
|
|
1320
1361
|
|
|
@@ -1355,7 +1396,7 @@ TODO: standardize</p>
|
|
|
1355
1396
|
|
|
1356
1397
|
<tr>
|
|
1357
1398
|
<td class="col-md-4">
|
|
1358
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1399
|
+
<div class="io-line">Defined in <a href="" data-line="437" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:437</a></div>
|
|
1359
1400
|
</td>
|
|
1360
1401
|
</tr>
|
|
1361
1402
|
|
|
@@ -1436,7 +1477,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1436
1477
|
|
|
1437
1478
|
<tr>
|
|
1438
1479
|
<td class="col-md-4">
|
|
1439
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1480
|
+
<div class="io-line">Defined in <a href="" data-line="224" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:224</a></div>
|
|
1440
1481
|
</td>
|
|
1441
1482
|
</tr>
|
|
1442
1483
|
|
|
@@ -1476,7 +1517,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1476
1517
|
|
|
1477
1518
|
<tr>
|
|
1478
1519
|
<td class="col-md-4">
|
|
1479
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1520
|
+
<div class="io-line">Defined in <a href="" data-line="504" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:504</a></div>
|
|
1480
1521
|
</td>
|
|
1481
1522
|
</tr>
|
|
1482
1523
|
|
|
@@ -1541,7 +1582,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1541
1582
|
|
|
1542
1583
|
<tr>
|
|
1543
1584
|
<td class="col-md-4">
|
|
1544
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1585
|
+
<div class="io-line">Defined in <a href="" data-line="498" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:498</a></div>
|
|
1545
1586
|
</td>
|
|
1546
1587
|
</tr>
|
|
1547
1588
|
|
|
@@ -1606,7 +1647,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1606
1647
|
|
|
1607
1648
|
<tr>
|
|
1608
1649
|
<td class="col-md-4">
|
|
1609
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1650
|
+
<div class="io-line">Defined in <a href="" data-line="523" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:523</a></div>
|
|
1610
1651
|
</td>
|
|
1611
1652
|
</tr>
|
|
1612
1653
|
|
|
@@ -1677,7 +1718,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1677
1718
|
|
|
1678
1719
|
<tr>
|
|
1679
1720
|
<td class="col-md-4">
|
|
1680
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1721
|
+
<div class="io-line">Defined in <a href="" data-line="400" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:400</a></div>
|
|
1681
1722
|
</td>
|
|
1682
1723
|
</tr>
|
|
1683
1724
|
|
|
@@ -1748,7 +1789,7 @@ Additionally, any Observables for the <code>DropdownList</code> are initialized.
|
|
|
1748
1789
|
|
|
1749
1790
|
<tr>
|
|
1750
1791
|
<td class="col-md-4">
|
|
1751
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1792
|
+
<div class="io-line">Defined in <a href="" data-line="276" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:276</a></div>
|
|
1752
1793
|
</td>
|
|
1753
1794
|
</tr>
|
|
1754
1795
|
|
|
@@ -1789,7 +1830,7 @@ key input matching the first letter of the item in the list.</p>
|
|
|
1789
1830
|
|
|
1790
1831
|
<tr>
|
|
1791
1832
|
<td class="col-md-4">
|
|
1792
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1833
|
+
<div class="io-line">Defined in <a href="" data-line="248" class="link-to-prism">src/dropdown/list/dropdown-list.component.ts:248</a></div>
|
|
1793
1834
|
</td>
|
|
1794
1835
|
</tr>
|
|
1795
1836
|
|
|
@@ -2605,6 +2646,9 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
|
|
|
2605
2646
|
*/
|
|
2606
2647
|
ngAfterViewInit() {
|
|
2607
2648
|
this.index = this.getListItems().findIndex(item => item.selected);
|
|
2649
|
+
setTimeout(() => {
|
|
2650
|
+
this.doEmitSelect();
|
|
2651
|
+
})
|
|
2608
2652
|
this.setupFocusObservable();
|
|
2609
2653
|
}
|
|
2610
2654
|
|
|
@@ -2620,6 +2664,18 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
|
|
|
2620
2664
|
}
|
|
2621
2665
|
}
|
|
2622
2666
|
|
|
2667
|
+
doEmitSelect() {
|
|
2668
|
+
if (this.type === "single") {
|
|
2669
|
+
this.select.emit({ item: this._items.find(item => item.selected), isUpdate: true });
|
|
2670
|
+
} else {
|
|
2671
|
+
// abuse javascripts object mutability until we can break the API and switch to
|
|
2672
|
+
// { items: [], isUpdate: true }
|
|
2673
|
+
const selected = this.getSelected() || [];
|
|
2674
|
+
selected["isUpdate"] = true;
|
|
2675
|
+
this.select.emit(selected);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2623
2679
|
/**
|
|
2624
2680
|
* Updates the displayed list of items and then retrieves the most current properties for the `DropdownList` from the DOM.
|
|
2625
2681
|
*/
|
|
@@ -2630,15 +2686,7 @@ export class DropdownList implements AbstractDropdownView, AfterViewInit, OnDest
|
|
|
2630
2686
|
this.setupFocusObservable();
|
|
2631
2687
|
setTimeout(() => {
|
|
2632
2688
|
if (this.getSelected() !== []) { return; }
|
|
2633
|
-
|
|
2634
|
-
this.select.emit({ item: this._items.find(item => item.selected), isUpdate: true });
|
|
2635
|
-
} else {
|
|
2636
|
-
// abuse javascripts object mutability until we can break the API and switch to
|
|
2637
|
-
// { items: [], isUpdate: true }
|
|
2638
|
-
const selected = this.getSelected() || [];
|
|
2639
|
-
selected["isUpdate"] = true;
|
|
2640
|
-
this.select.emit(selected);
|
|
2641
|
-
}
|
|
2689
|
+
this.doEmitSelect();
|
|
2642
2690
|
});
|
|
2643
2691
|
}
|
|
2644
2692
|
|