carbon-components-angular 5.31.0 → 5.33.0
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/combobox/combobox.component.d.ts +5 -1
- package/docs/documentation/components/ComboBox.html +179 -136
- package/docs/documentation/components/TreeNodeComponent.html +67 -36
- package/docs/documentation/components/TreeViewComponent.html +83 -1
- package/docs/documentation/coverage.html +9 -9
- package/docs/documentation/interfaces/Node.html +47 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +26 -26
- package/docs/documentation/modules/TimePickerModule.html +26 -26
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerSelectModule.html +4 -4
- package/docs/documentation/modules/ToggleModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggleModule.html +4 -4
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggletipModule.html +4 -4
- package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TooltipModule.html +28 -28
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +34 -34
- package/docs/documentation/modules/TreeviewModule.html +34 -34
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +177 -148
- package/docs/storybook/combobox-combobox-stories.3bbada2d.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.f6f7b65b.iframe.bundle.js +1 -0
- package/docs/storybook/{patterns-forms-multi-step-form-stories.89086fc2.iframe.bundle.js → patterns-forms-multi-step-form-stories.22da53c6.iframe.bundle.js} +1 -1
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.d1f42191.iframe.bundle.js → runtime~main.b455b6c9.iframe.bundle.js} +1 -1
- package/docs/storybook/{treeview-treeview-stories.eec445b3.iframe.bundle.js → treeview-treeview-stories.85954a19.iframe.bundle.js} +1 -1
- package/esm2020/combobox/combobox.component.mjs +18 -8
- package/esm2020/treeview/tree-node.component.mjs +8 -4
- package/esm2020/treeview/tree-node.types.mjs +1 -1
- package/esm2020/treeview/treeview.component.mjs +11 -3
- package/fesm2015/carbon-components-angular-combobox.mjs +17 -7
- package/fesm2015/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-treeview.mjs +20 -8
- package/fesm2015/carbon-components-angular-treeview.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-combobox.mjs +17 -7
- package/fesm2020/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-treeview.mjs +17 -5
- package/fesm2020/carbon-components-angular-treeview.mjs.map +1 -1
- package/package.json +1 -1
- package/treeview/tree-node.component.d.ts +2 -1
- package/treeview/tree-node.types.d.ts +1 -0
- package/treeview/treeview.component.d.ts +1 -0
- package/docs/storybook/combobox-combobox-stories.57374785.iframe.bundle.js +0 -1
- package/docs/storybook/main.0d9139c6.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -1077,12 +1077,12 @@
|
|
|
1077
1077
|
},
|
|
1078
1078
|
{
|
|
1079
1079
|
"name": "Node",
|
|
1080
|
-
"id": "interface-Node-
|
|
1080
|
+
"id": "interface-Node-edec89fb3656ba70a0f7f007520c3f4a9501f4fd644b7c925dc041a592cabb45e60b40806aa86c48628a87daac9b0bafca5decb6647aca2cbb534f57f10885b9",
|
|
1081
1081
|
"file": "src/treeview/tree-node.types.ts",
|
|
1082
1082
|
"deprecated": false,
|
|
1083
1083
|
"deprecationMessage": "",
|
|
1084
1084
|
"type": "interface",
|
|
1085
|
-
"sourceCode": "import { TemplateRef } from \"@angular/core\";\n\nexport interface Node {\n\tlabel: string | TemplateRef<any>;\n\tlabelContext?: any;\n\tvalue?: any;\n\tid?: string;\n\tactive?: boolean;\n\tdisabled?: boolean;\n\texpanded?: boolean;\n\tselected?: boolean;\n\ticon?: string | TemplateRef<any>;\n\ticonContext?: any;\n\tchildren?: Node[];\n\t[key: string]: any;\n}\n",
|
|
1085
|
+
"sourceCode": "import { TemplateRef } from \"@angular/core\";\n\nexport interface Node {\n\tlabel: string | TemplateRef<any>;\n\tlabelContext?: any;\n\tvalue?: any;\n\tid?: string;\n\tactive?: boolean;\n\tdisabled?: boolean;\n\texpanded?: boolean;\n\tselected?: boolean;\n\ticon?: string | TemplateRef<any>;\n\ticonContext?: any;\n\tgap?: number;\n\tchildren?: Node[];\n\t[key: string]: any;\n}\n",
|
|
1086
1086
|
"properties": [
|
|
1087
1087
|
{
|
|
1088
1088
|
"name": "active",
|
|
@@ -1100,7 +1100,7 @@
|
|
|
1100
1100
|
"type": "Node[]",
|
|
1101
1101
|
"optional": true,
|
|
1102
1102
|
"description": "",
|
|
1103
|
-
"line":
|
|
1103
|
+
"line": 15
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
1106
1106
|
"name": "disabled",
|
|
@@ -1120,6 +1120,15 @@
|
|
|
1120
1120
|
"description": "",
|
|
1121
1121
|
"line": 10
|
|
1122
1122
|
},
|
|
1123
|
+
{
|
|
1124
|
+
"name": "gap",
|
|
1125
|
+
"deprecated": false,
|
|
1126
|
+
"deprecationMessage": "",
|
|
1127
|
+
"type": "number",
|
|
1128
|
+
"optional": true,
|
|
1129
|
+
"description": "",
|
|
1130
|
+
"line": 14
|
|
1131
|
+
},
|
|
1123
1132
|
{
|
|
1124
1133
|
"name": "icon",
|
|
1125
1134
|
"deprecated": false,
|
|
@@ -1186,7 +1195,7 @@
|
|
|
1186
1195
|
],
|
|
1187
1196
|
"indexSignatures": [
|
|
1188
1197
|
{
|
|
1189
|
-
"id": "index-declaration-
|
|
1198
|
+
"id": "index-declaration-edec89fb3656ba70a0f7f007520c3f4a9501f4fd644b7c925dc041a592cabb45e60b40806aa86c48628a87daac9b0bafca5decb6647aca2cbb534f57f10885b9",
|
|
1190
1199
|
"args": [
|
|
1191
1200
|
{
|
|
1192
1201
|
"name": "key",
|
|
@@ -1196,7 +1205,7 @@
|
|
|
1196
1205
|
}
|
|
1197
1206
|
],
|
|
1198
1207
|
"returnType": "any",
|
|
1199
|
-
"line":
|
|
1208
|
+
"line": 15,
|
|
1200
1209
|
"deprecated": false,
|
|
1201
1210
|
"deprecationMessage": ""
|
|
1202
1211
|
}
|
|
@@ -22671,7 +22680,7 @@
|
|
|
22671
22680
|
},
|
|
22672
22681
|
{
|
|
22673
22682
|
"name": "ComboBox",
|
|
22674
|
-
"id": "component-ComboBox-
|
|
22683
|
+
"id": "component-ComboBox-0faba74069aaef129ce53ea4dad541eeeae0d52927675d873ecb68bfccd0f50cfc39d5a06d82fda3b8643ba05a45c74feeb026abebd60e96b527bc858eb2b4a5",
|
|
22675
22684
|
"file": "src/combobox/combobox.component.ts",
|
|
22676
22685
|
"encapsulation": [],
|
|
22677
22686
|
"entryComponents": [],
|
|
@@ -22685,7 +22694,7 @@
|
|
|
22685
22694
|
"selector": "cds-combo-box, ibm-combo-box",
|
|
22686
22695
|
"styleUrls": [],
|
|
22687
22696
|
"styles": [],
|
|
22688
|
-
"template": "<div class=\"cds--list-box__wrapper\">\n\t<label\n\t\t*ngIf=\"label\"\n\t\t[for]=\"id\"\n\t\t[id]=\"labelId\"\n\t\tclass=\"cds--label\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--label--disabled': disabled,\n\t\t\t'cds--visually-hidden': hideLabel\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div\n\t\t#listbox\n\t\t[ngClass]=\"{\n\t\t\t'cds--multi-select cds--multi-select--filterable': type === 'multi',\n\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t'cds--list-box--expanded': open,\n\t\t\t'cds--list-box--sm': size === 'sm',\n\t\t\t'cds--list-box--md': size === 'md',\n\t\t\t'cds--list-box--lg': size === 'lg',\n\t\t\t'cds--list-box--disabled': disabled,\n\t\t\t'cds--combo-box--warning cds--list-box--warning': warn\n\t\t}\"\n\t\tclass=\"cds--list-box cds--combo-box\"\n\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t<div\n\t\t\tclass=\"cds--list-box__field\"\n\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t(blur)=\"onBlur()\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\tclass=\"cds--tag cds--tag--filter cds--tag--high-contrast\"\n\t\t\t\t[ngClass]=\"{'cds--tag--disabled': disabled}\">\n\t\t\t\t<span class=\"cds--tag__label\">{{ pills.length }}</span>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t(click)=\"clearSelected($event)\"\n\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t(keydown.enter)=\"clearSelected($event)\"\n\t\t\t\t\tclass=\"cds--tag__close-icon\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\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</button>\n\t\t\t</div>\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\trole=\"combobox\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t(input)=\"onSearch($event.target.value)\"\n\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\tclass=\"cds--text-input\"\n\t\t\t\t[ngClass]=\"{'cds--text-input--empty': !showClearButton}\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[id]=\"id\"\n\t\t\t\t[attr.aria-labelledby]=\"labelId\"\n\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t[attr.aria-controls]=\"open ? view?.listId : null\"\n\t\t\t\t[attr.aria-autocomplete]=\"autocomplete\"\n\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--list-box__invalid-icon\">\n\t\t\t</svg>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t\t</svg>\n\t\t\t<div\n\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"cds--list-box__selection\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t(keyup.enter)=\"clearInput($event)\"\n\t\t\t\t(click)=\"clearInput($event)\"\n\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t<svg cdsIcon=\"close\" size=\"16\"></svg>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"cds--list-box__menu-icon\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t[attr.aria-label]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': open}\">\n\t\t\t\t<svg cdsIcon=\"chevron--down\" size=\"16\"></svg>\n\t\t\t</button>\n\t\t</div>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"open\"></ng-content>\n\t\t</div>\n\t</div>\n\t<div\n\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\tclass=\"cds--form__helper-text\"\n\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t</div>\n</div>\n\t",
|
|
22697
|
+
"template": "<div class=\"cds--list-box__wrapper\">\n\t<label\n\t\t*ngIf=\"label\"\n\t\t[for]=\"id\"\n\t\t[id]=\"labelId\"\n\t\tclass=\"cds--label\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--label--disabled': disabled,\n\t\t\t'cds--visually-hidden': hideLabel\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div\n\t\t#listbox\n\t\t[ngClass]=\"{\n\t\t\t'cds--multi-select cds--multi-select--filterable': type === 'multi',\n\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t'cds--list-box--expanded': open,\n\t\t\t'cds--list-box--sm': size === 'sm',\n\t\t\t'cds--list-box--md': size === 'md',\n\t\t\t'cds--list-box--lg': size === 'lg',\n\t\t\t'cds--list-box--disabled': disabled,\n\t\t\t'cds--combo-box--readonly': readonly,\n\t\t\t'cds--combo-box--warning cds--list-box--warning': warn\n\t\t}\"\n\t\tclass=\"cds--list-box cds--combo-box\"\n\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t<div\n\t\t\tclass=\"cds--list-box__field\"\n\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t(blur)=\"onBlur()\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\tclass=\"cds--tag cds--tag--filter cds--tag--high-contrast\"\n\t\t\t\t[ngClass]=\"{'cds--tag--disabled': disabled || readonly}\">\n\t\t\t\t<span class=\"cds--tag__label\">{{ pills.length }}</span>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t(click)=\"clearSelected($event)\"\n\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t(keydown.enter)=\"clearSelected($event)\"\n\t\t\t\t\tclass=\"cds--tag__close-icon\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t[disabled]=\"disabled || readonly\"\n\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\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</button>\n\t\t\t</div>\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\trole=\"combobox\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readOnly]=\"readonly\"\n\t\t\t\t(input)=\"onSearch($event.target.value)\"\n\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\tclass=\"cds--text-input\"\n\t\t\t\t[ngClass]=\"{'cds--text-input--empty': !showClearButton}\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[id]=\"id\"\n\t\t\t\t[attr.aria-labelledby]=\"labelId\"\n\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t[attr.aria-controls]=\"open ? view?.listId : null\"\n\t\t\t\t[attr.aria-autocomplete]=\"autocomplete\"\n\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--list-box__invalid-icon\">\n\t\t\t</svg>\n\t\t\t<svg\n\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\tsize=\"16\"\n\t\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t\t</svg>\n\t\t\t<div\n\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"cds--list-box__selection\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t(keyup.enter)=\"clearInput($event)\"\n\t\t\t\t(click)=\"clearInput($event)\"\n\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t<svg cdsIcon=\"close\" size=\"16\"></svg>\n\t\t\t</div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"button\"\n\t\t\t\tclass=\"cds--list-box__menu-icon\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t[attr.aria-label]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': open}\">\n\t\t\t\t<svg cdsIcon=\"chevron--down\" size=\"16\"></svg>\n\t\t\t</button>\n\t\t</div>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"open\"></ng-content>\n\t\t</div>\n\t</div>\n\t<div\n\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\tclass=\"cds--form__helper-text\"\n\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t</div>\n</div>\n\t",
|
|
22689
22698
|
"templateUrl": [],
|
|
22690
22699
|
"viewProviders": [],
|
|
22691
22700
|
"hostDirectives": [],
|
|
@@ -22697,7 +22706,7 @@
|
|
|
22697
22706
|
"deprecationMessage": "",
|
|
22698
22707
|
"rawdescription": "\n\nset to `true` to place the dropdown view inline with the component\n",
|
|
22699
22708
|
"description": "<p>set to <code>true</code> to place the dropdown view inline with the component</p>\n",
|
|
22700
|
-
"line":
|
|
22709
|
+
"line": 322,
|
|
22701
22710
|
"type": "boolean",
|
|
22702
22711
|
"decorators": []
|
|
22703
22712
|
},
|
|
@@ -22708,7 +22717,7 @@
|
|
|
22708
22717
|
"deprecationMessage": "",
|
|
22709
22718
|
"rawdescription": "\n\nSpecify aria-autocomplete attribute of text input.\n\"list\", is the expected value for a combobox that invokes a drop-down list\n",
|
|
22710
22719
|
"description": "<p>Specify aria-autocomplete attribute of text input.\n"list", is the expected value for a combobox that invokes a drop-down list</p>\n",
|
|
22711
|
-
"line":
|
|
22720
|
+
"line": 358,
|
|
22712
22721
|
"type": "string",
|
|
22713
22722
|
"decorators": []
|
|
22714
22723
|
},
|
|
@@ -22718,7 +22727,7 @@
|
|
|
22718
22727
|
"deprecationMessage": "",
|
|
22719
22728
|
"rawdescription": "\n\nValue to display for accessibility purposes on the clear the selected item icon, when single is selected\n",
|
|
22720
22729
|
"description": "<p>Value to display for accessibility purposes on the clear the selected item icon, when single is selected</p>\n",
|
|
22721
|
-
"line":
|
|
22730
|
+
"line": 258,
|
|
22722
22731
|
"type": "string | Observable",
|
|
22723
22732
|
"decorators": []
|
|
22724
22733
|
},
|
|
@@ -22728,7 +22737,7 @@
|
|
|
22728
22737
|
"deprecationMessage": "",
|
|
22729
22738
|
"rawdescription": "\n\nValue to display for accessibility purposes to clear selections, when multi is selected\n",
|
|
22730
22739
|
"description": "<p>Value to display for accessibility purposes to clear selections, when multi is selected</p>\n",
|
|
22731
|
-
"line":
|
|
22740
|
+
"line": 238,
|
|
22732
22741
|
"type": "string | Observable",
|
|
22733
22742
|
"decorators": []
|
|
22734
22743
|
},
|
|
@@ -22738,7 +22747,7 @@
|
|
|
22738
22747
|
"deprecationMessage": "",
|
|
22739
22748
|
"rawdescription": "\n\nValue to display on the clear selections icon, when multi is selected\n",
|
|
22740
22749
|
"description": "<p>Value to display on the clear selections icon, when multi is selected</p>\n",
|
|
22741
|
-
"line":
|
|
22750
|
+
"line": 228,
|
|
22742
22751
|
"type": "string | Observable",
|
|
22743
22752
|
"decorators": []
|
|
22744
22753
|
},
|
|
@@ -22748,7 +22757,7 @@
|
|
|
22748
22757
|
"deprecationMessage": "",
|
|
22749
22758
|
"rawdescription": "\n\nValue to display on the clear the selected item icon, when single is selected\n",
|
|
22750
22759
|
"description": "<p>Value to display on the clear the selected item icon, when single is selected</p>\n",
|
|
22751
|
-
"line":
|
|
22760
|
+
"line": 248,
|
|
22752
22761
|
"type": "string | Observable",
|
|
22753
22762
|
"decorators": []
|
|
22754
22763
|
},
|
|
@@ -22758,7 +22767,7 @@
|
|
|
22758
22767
|
"deprecationMessage": "",
|
|
22759
22768
|
"rawdescription": "\n\nValue to display for accessibility purposes on the combobox control menu when opened\n",
|
|
22760
22769
|
"description": "<p>Value to display for accessibility purposes on the combobox control menu when opened</p>\n",
|
|
22761
|
-
"line":
|
|
22770
|
+
"line": 218,
|
|
22762
22771
|
"type": "string | Observable",
|
|
22763
22772
|
"decorators": []
|
|
22764
22773
|
},
|
|
@@ -22769,7 +22778,7 @@
|
|
|
22769
22778
|
"deprecationMessage": "",
|
|
22770
22779
|
"rawdescription": "\n\nSet to `true` to disable combobox.\n",
|
|
22771
22780
|
"description": "<p>Set to <code>true</code> to disable combobox.</p>\n",
|
|
22772
|
-
"line":
|
|
22781
|
+
"line": 366,
|
|
22773
22782
|
"type": "boolean",
|
|
22774
22783
|
"decorators": []
|
|
22775
22784
|
},
|
|
@@ -22779,7 +22788,7 @@
|
|
|
22779
22788
|
"deprecationMessage": "",
|
|
22780
22789
|
"rawdescription": "\n\nOverrides the automatic dropUp.\n",
|
|
22781
22790
|
"description": "<p>Overrides the automatic dropUp.</p>\n",
|
|
22782
|
-
"line":
|
|
22791
|
+
"line": 362,
|
|
22783
22792
|
"type": "boolean",
|
|
22784
22793
|
"decorators": []
|
|
22785
22794
|
},
|
|
@@ -22789,7 +22798,7 @@
|
|
|
22789
22798
|
"deprecationMessage": "",
|
|
22790
22799
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
22791
22800
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
22792
|
-
"line":
|
|
22801
|
+
"line": 318,
|
|
22793
22802
|
"type": "string | TemplateRef<any>",
|
|
22794
22803
|
"decorators": []
|
|
22795
22804
|
},
|
|
@@ -22800,7 +22809,7 @@
|
|
|
22800
22809
|
"deprecationMessage": "",
|
|
22801
22810
|
"rawdescription": "\n\nHide label while keeping it accessible for screen readers\n",
|
|
22802
22811
|
"description": "<p>Hide label while keeping it accessible for screen readers</p>\n",
|
|
22803
|
-
"line":
|
|
22812
|
+
"line": 314,
|
|
22804
22813
|
"type": "boolean",
|
|
22805
22814
|
"decorators": []
|
|
22806
22815
|
},
|
|
@@ -22809,7 +22818,7 @@
|
|
|
22809
22818
|
"defaultValue": "`dropdown-${ComboBox.comboBoxCount++}`",
|
|
22810
22819
|
"deprecated": false,
|
|
22811
22820
|
"deprecationMessage": "",
|
|
22812
|
-
"line":
|
|
22821
|
+
"line": 266,
|
|
22813
22822
|
"type": "string",
|
|
22814
22823
|
"decorators": []
|
|
22815
22824
|
},
|
|
@@ -22820,7 +22829,7 @@
|
|
|
22820
22829
|
"deprecationMessage": "",
|
|
22821
22830
|
"rawdescription": "\n\nSet to `true` to show the invalid state.\n",
|
|
22822
22831
|
"description": "<p>Set to <code>true</code> to show the invalid state.</p>\n",
|
|
22823
|
-
"line":
|
|
22832
|
+
"line": 326,
|
|
22824
22833
|
"type": "boolean",
|
|
22825
22834
|
"decorators": []
|
|
22826
22835
|
},
|
|
@@ -22830,7 +22839,7 @@
|
|
|
22830
22839
|
"deprecationMessage": "",
|
|
22831
22840
|
"rawdescription": "\n\nValue displayed if combobox is in an invalid state.\n",
|
|
22832
22841
|
"description": "<p>Value displayed if combobox is in an invalid state.</p>\n",
|
|
22833
|
-
"line":
|
|
22842
|
+
"line": 330,
|
|
22834
22843
|
"type": "string | TemplateRef<any>",
|
|
22835
22844
|
"decorators": []
|
|
22836
22845
|
},
|
|
@@ -22841,7 +22850,7 @@
|
|
|
22841
22850
|
"deprecationMessage": "",
|
|
22842
22851
|
"rawdescription": "\n\nList of items to fill the content with.\n\n**Example:**\n```javascript\nitems = [\n\t\t{\n\t\t\tcontent: \"Abacus\",\n\t\t\tselected: false\n\t\t},\n\t\t{\n\t\t\tcontent: \"Byte\",\n\t\t\tselected: false,\n\t\t},\n\t\t{\n\t\t\tcontent: \"Computer\",\n\t\t\tselected: false\n\t\t},\n\t\t{\n\t\t\tcontent: \"Digital\",\n\t\t\tselected: false\n\t\t}\n];\n```\n\n",
|
|
22843
22852
|
"description": "<p>List of items to fill the content with.</p>\n<p><strong>Example:</strong></p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-javascript\">items = [\n {\n content: "Abacus",\n selected: false\n },\n {\n content: "Byte",\n selected: false,\n },\n {\n content: "Computer",\n selected: false\n },\n {\n content: "Digital",\n selected: false\n }\n];</code></pre></div>",
|
|
22844
|
-
"line":
|
|
22853
|
+
"line": 294,
|
|
22845
22854
|
"type": "Array<ListItem>",
|
|
22846
22855
|
"decorators": []
|
|
22847
22856
|
},
|
|
@@ -22851,7 +22860,7 @@
|
|
|
22851
22860
|
"deprecationMessage": "",
|
|
22852
22861
|
"rawdescription": "\n\nSpecifies the property to be used as the return value to `ngModel`\n",
|
|
22853
22862
|
"description": "<p>Specifies the property to be used as the return value to <code>ngModel</code></p>\n",
|
|
22854
|
-
"line":
|
|
22863
|
+
"line": 306,
|
|
22855
22864
|
"type": "string",
|
|
22856
22865
|
"decorators": []
|
|
22857
22866
|
},
|
|
@@ -22861,7 +22870,7 @@
|
|
|
22861
22870
|
"deprecationMessage": "",
|
|
22862
22871
|
"rawdescription": "\n\nLabel for the combobox.\n",
|
|
22863
22872
|
"description": "<p>Label for the combobox.</p>\n",
|
|
22864
|
-
"line":
|
|
22873
|
+
"line": 310,
|
|
22865
22874
|
"type": "string | TemplateRef<any>",
|
|
22866
22875
|
"decorators": []
|
|
22867
22876
|
},
|
|
@@ -22870,7 +22879,7 @@
|
|
|
22870
22879
|
"defaultValue": "`dropdown-label-${ComboBox.comboBoxCount++}`",
|
|
22871
22880
|
"deprecated": false,
|
|
22872
22881
|
"deprecationMessage": "",
|
|
22873
|
-
"line":
|
|
22882
|
+
"line": 267,
|
|
22874
22883
|
"type": "string",
|
|
22875
22884
|
"decorators": []
|
|
22876
22885
|
},
|
|
@@ -22881,7 +22890,7 @@
|
|
|
22881
22890
|
"deprecationMessage": "",
|
|
22882
22891
|
"rawdescription": "\n\nMax length value to limit input characters\n",
|
|
22883
22892
|
"description": "<p>Max length value to limit input characters</p>\n",
|
|
22884
|
-
"line":
|
|
22893
|
+
"line": 342,
|
|
22885
22894
|
"type": "number",
|
|
22886
22895
|
"decorators": []
|
|
22887
22896
|
},
|
|
@@ -22891,7 +22900,7 @@
|
|
|
22891
22900
|
"deprecationMessage": "",
|
|
22892
22901
|
"rawdescription": "\n\nValue to display for accessibility purposes on the combobox control menu when closed\n",
|
|
22893
22902
|
"description": "<p>Value to display for accessibility purposes on the combobox control menu when closed</p>\n",
|
|
22894
|
-
"line":
|
|
22903
|
+
"line": 208,
|
|
22895
22904
|
"type": "string | Observable",
|
|
22896
22905
|
"decorators": []
|
|
22897
22906
|
},
|
|
@@ -22901,10 +22910,21 @@
|
|
|
22901
22910
|
"deprecationMessage": "",
|
|
22902
22911
|
"rawdescription": "\n\nText to show when nothing is selected.\n",
|
|
22903
22912
|
"description": "<p>Text to show when nothing is selected.</p>\n",
|
|
22904
|
-
"line":
|
|
22913
|
+
"line": 198,
|
|
22905
22914
|
"type": "string | Observable",
|
|
22906
22915
|
"decorators": []
|
|
22907
22916
|
},
|
|
22917
|
+
{
|
|
22918
|
+
"name": "readonly",
|
|
22919
|
+
"defaultValue": "false",
|
|
22920
|
+
"deprecated": false,
|
|
22921
|
+
"deprecationMessage": "",
|
|
22922
|
+
"rawdescription": "\n\nSet to `true` for readonly state.\n",
|
|
22923
|
+
"description": "<p>Set to <code>true</code> for readonly state.</p>\n",
|
|
22924
|
+
"line": 370,
|
|
22925
|
+
"type": "boolean",
|
|
22926
|
+
"decorators": []
|
|
22927
|
+
},
|
|
22908
22928
|
{
|
|
22909
22929
|
"name": "selectionFeedback",
|
|
22910
22930
|
"defaultValue": "\"top-after-reopen\"",
|
|
@@ -22912,7 +22932,7 @@
|
|
|
22912
22932
|
"deprecationMessage": "",
|
|
22913
22933
|
"rawdescription": "\n\nSpecify feedback (mode) of the selection.\n`top`: selected item jumps to top\n`fixed`: selected item stays at its position\n`top-after-reopen`: selected item jump to top after reopen dropdown\n",
|
|
22914
22934
|
"description": "<p>Specify feedback (mode) of the selection.\n<code>top</code>: selected item jumps to top\n<code>fixed</code>: selected item stays at its position\n<code>top-after-reopen</code>: selected item jump to top after reopen dropdown</p>\n",
|
|
22915
|
-
"line":
|
|
22935
|
+
"line": 353,
|
|
22916
22936
|
"type": "\"top\" | \"fixed\" | \"top-after-reopen\"",
|
|
22917
22937
|
"decorators": []
|
|
22918
22938
|
},
|
|
@@ -22923,7 +22943,7 @@
|
|
|
22923
22943
|
"deprecationMessage": "",
|
|
22924
22944
|
"rawdescription": "\n\nCombo box render size.\n",
|
|
22925
22945
|
"description": "<p>Combo box render size.</p>\n",
|
|
22926
|
-
"line":
|
|
22946
|
+
"line": 302,
|
|
22927
22947
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
22928
22948
|
"decorators": []
|
|
22929
22949
|
},
|
|
@@ -22934,15 +22954,15 @@
|
|
|
22934
22954
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead",
|
|
22935
22955
|
"jsdoctags": [
|
|
22936
22956
|
{
|
|
22937
|
-
"pos":
|
|
22938
|
-
"end":
|
|
22957
|
+
"pos": 9868,
|
|
22958
|
+
"end": 9926,
|
|
22939
22959
|
"flags": 16842752,
|
|
22940
22960
|
"modifierFlagsCache": 0,
|
|
22941
22961
|
"transformFlags": 0,
|
|
22942
22962
|
"kind": 338,
|
|
22943
22963
|
"tagName": {
|
|
22944
|
-
"pos":
|
|
22945
|
-
"end":
|
|
22964
|
+
"pos": 9869,
|
|
22965
|
+
"end": 9879,
|
|
22946
22966
|
"flags": 16842752,
|
|
22947
22967
|
"modifierFlagsCache": 0,
|
|
22948
22968
|
"transformFlags": 0,
|
|
@@ -22952,7 +22972,7 @@
|
|
|
22952
22972
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead</p>\n"
|
|
22953
22973
|
}
|
|
22954
22974
|
],
|
|
22955
|
-
"line":
|
|
22975
|
+
"line": 346,
|
|
22956
22976
|
"type": "\"light\" | \"dark\"",
|
|
22957
22977
|
"decorators": []
|
|
22958
22978
|
},
|
|
@@ -22963,7 +22983,7 @@
|
|
|
22963
22983
|
"deprecationMessage": "",
|
|
22964
22984
|
"rawdescription": "\n\nCombo box type (supporting single or multi selection of items).\n",
|
|
22965
22985
|
"description": "<p>Combo box type (supporting single or multi selection of items).</p>\n",
|
|
22966
|
-
"line":
|
|
22986
|
+
"line": 298,
|
|
22967
22987
|
"type": "\"single\" | \"multi\"",
|
|
22968
22988
|
"decorators": []
|
|
22969
22989
|
},
|
|
@@ -22974,7 +22994,7 @@
|
|
|
22974
22994
|
"deprecationMessage": "",
|
|
22975
22995
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warnText)\n",
|
|
22976
22996
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warnText)</p>\n",
|
|
22977
|
-
"line":
|
|
22997
|
+
"line": 334,
|
|
22978
22998
|
"type": "boolean",
|
|
22979
22999
|
"decorators": []
|
|
22980
23000
|
},
|
|
@@ -22984,7 +23004,7 @@
|
|
|
22984
23004
|
"deprecationMessage": "",
|
|
22985
23005
|
"rawdescription": "\n\nSets the warning text\n",
|
|
22986
23006
|
"description": "<p>Sets the warning text</p>\n",
|
|
22987
|
-
"line":
|
|
23007
|
+
"line": 338,
|
|
22988
23008
|
"type": "string | TemplateRef<any>",
|
|
22989
23009
|
"decorators": []
|
|
22990
23010
|
}
|
|
@@ -22997,7 +23017,7 @@
|
|
|
22997
23017
|
"deprecationMessage": "",
|
|
22998
23018
|
"rawdescription": "\nEmits an event when the clear button is clicked.",
|
|
22999
23019
|
"description": "<p>Emits an event when the clear button is clicked.</p>\n",
|
|
23000
|
-
"line":
|
|
23020
|
+
"line": 422,
|
|
23001
23021
|
"type": "EventEmitter"
|
|
23002
23022
|
},
|
|
23003
23023
|
{
|
|
@@ -23007,7 +23027,7 @@
|
|
|
23007
23027
|
"deprecationMessage": "",
|
|
23008
23028
|
"rawdescription": "\nEmits an empty event when the menu is closed",
|
|
23009
23029
|
"description": "<p>Emits an empty event when the menu is closed</p>\n",
|
|
23010
|
-
"line":
|
|
23030
|
+
"line": 418,
|
|
23011
23031
|
"type": "EventEmitter"
|
|
23012
23032
|
},
|
|
23013
23033
|
{
|
|
@@ -23017,7 +23037,7 @@
|
|
|
23017
23037
|
"deprecationMessage": "",
|
|
23018
23038
|
"rawdescription": "\nEmits the search string from the input",
|
|
23019
23039
|
"description": "<p>Emits the search string from the input</p>\n",
|
|
23020
|
-
"line":
|
|
23040
|
+
"line": 420,
|
|
23021
23041
|
"type": "EventEmitter"
|
|
23022
23042
|
},
|
|
23023
23043
|
{
|
|
@@ -23027,7 +23047,7 @@
|
|
|
23027
23047
|
"deprecationMessage": "",
|
|
23028
23048
|
"rawdescription": "\n\nEmits a ListItem\n\nExample:\n```javascript\n{\n\t\tcontent: \"one\",\n\t\tselected: true\n}\n```\n",
|
|
23029
23049
|
"description": "<p>Emits a ListItem</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-javascript\">{\n content: "one",\n selected: true\n}</code></pre></div>",
|
|
23030
|
-
"line":
|
|
23050
|
+
"line": 382,
|
|
23031
23051
|
"type": "EventEmitter"
|
|
23032
23052
|
},
|
|
23033
23053
|
{
|
|
@@ -23037,7 +23057,7 @@
|
|
|
23037
23057
|
"deprecationMessage": "",
|
|
23038
23058
|
"rawdescription": "\n\nIntended to be used to add items to the list.\n\nEmits an event that includes the current item list, the suggested index for the new item, and a simple ListItem\n\nExample:\n```javascript\n\t{\n\t\titems: [{content: \"one\", selected: true}, {content: \"two\", selected: true}],\n\t\tindex: 1,\n\t\tvalue: {\n\t\t\tcontent: \"some user string\",\n\t\t\tselected: false\n\t\t}\n\t}\n```\n\n\nExample:\n```javascript\n{\n\tafter: 1,\n\tvalue: \"some user string\"\n}\n```\n",
|
|
23039
23059
|
"description": "<p>Intended to be used to add items to the list.</p>\n<p>Emits an event that includes the current item list, the suggested index for the new item, and a simple ListItem</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-javascript\"> {\n items: [{content: "one", selected: true}, {content: "two", selected: true}],\n index: 1,\n value: {\n content: "some user string",\n selected: false\n }\n }</code></pre></div><p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-javascript\">{\n after: 1,\n value: "some user string"\n}</code></pre></div>",
|
|
23040
|
-
"line":
|
|
23060
|
+
"line": 409,
|
|
23041
23061
|
"type": "EventEmitter"
|
|
23042
23062
|
}
|
|
23043
23063
|
],
|
|
@@ -23050,7 +23070,7 @@
|
|
|
23050
23070
|
"type": "",
|
|
23051
23071
|
"optional": false,
|
|
23052
23072
|
"description": "<p>controls whether the <code>drop-up</code> class is applied</p>\n",
|
|
23053
|
-
"line":
|
|
23073
|
+
"line": 445,
|
|
23054
23074
|
"rawdescription": "\n\ncontrols whether the `drop-up` class is applied\n"
|
|
23055
23075
|
},
|
|
23056
23076
|
{
|
|
@@ -23061,7 +23081,7 @@
|
|
|
23061
23081
|
"type": "number",
|
|
23062
23082
|
"optional": false,
|
|
23063
23083
|
"description": "",
|
|
23064
|
-
"line":
|
|
23084
|
+
"line": 265,
|
|
23065
23085
|
"modifierKind": [
|
|
23066
23086
|
126
|
|
23067
23087
|
]
|
|
@@ -23074,7 +23094,7 @@
|
|
|
23074
23094
|
"type": "string",
|
|
23075
23095
|
"optional": false,
|
|
23076
23096
|
"description": "",
|
|
23077
|
-
"line":
|
|
23097
|
+
"line": 429,
|
|
23078
23098
|
"decorators": [
|
|
23079
23099
|
{
|
|
23080
23100
|
"name": "HostBinding",
|
|
@@ -23092,7 +23112,7 @@
|
|
|
23092
23112
|
"type": "",
|
|
23093
23113
|
"optional": false,
|
|
23094
23114
|
"description": "",
|
|
23095
|
-
"line":
|
|
23115
|
+
"line": 425,
|
|
23096
23116
|
"decorators": [
|
|
23097
23117
|
{
|
|
23098
23118
|
"name": "ViewChild",
|
|
@@ -23111,7 +23131,7 @@
|
|
|
23111
23131
|
"type": "",
|
|
23112
23132
|
"optional": false,
|
|
23113
23133
|
"description": "",
|
|
23114
|
-
"line":
|
|
23134
|
+
"line": 428,
|
|
23115
23135
|
"decorators": [
|
|
23116
23136
|
{
|
|
23117
23137
|
"name": "HostBinding",
|
|
@@ -23129,7 +23149,7 @@
|
|
|
23129
23149
|
"type": "ElementRef",
|
|
23130
23150
|
"optional": false,
|
|
23131
23151
|
"description": "",
|
|
23132
|
-
"line":
|
|
23152
|
+
"line": 426,
|
|
23133
23153
|
"decorators": [
|
|
23134
23154
|
{
|
|
23135
23155
|
"name": "ViewChild",
|
|
@@ -23148,7 +23168,7 @@
|
|
|
23148
23168
|
"type": "",
|
|
23149
23169
|
"optional": false,
|
|
23150
23170
|
"description": "",
|
|
23151
|
-
"line":
|
|
23171
|
+
"line": 441
|
|
23152
23172
|
},
|
|
23153
23173
|
{
|
|
23154
23174
|
"name": "listbox",
|
|
@@ -23157,7 +23177,7 @@
|
|
|
23157
23177
|
"type": "ElementRef",
|
|
23158
23178
|
"optional": false,
|
|
23159
23179
|
"description": "",
|
|
23160
|
-
"line":
|
|
23180
|
+
"line": 427,
|
|
23161
23181
|
"decorators": [
|
|
23162
23182
|
{
|
|
23163
23183
|
"name": "ViewChild",
|
|
@@ -23176,7 +23196,7 @@
|
|
|
23176
23196
|
"type": "",
|
|
23177
23197
|
"optional": false,
|
|
23178
23198
|
"description": "",
|
|
23179
|
-
"line":
|
|
23199
|
+
"line": 431,
|
|
23180
23200
|
"modifierKind": [
|
|
23181
23201
|
125
|
|
23182
23202
|
]
|
|
@@ -23189,7 +23209,7 @@
|
|
|
23189
23209
|
"type": "",
|
|
23190
23210
|
"optional": false,
|
|
23191
23211
|
"description": "",
|
|
23192
|
-
"line":
|
|
23212
|
+
"line": 440
|
|
23193
23213
|
},
|
|
23194
23214
|
{
|
|
23195
23215
|
"name": "pills",
|
|
@@ -23199,7 +23219,7 @@
|
|
|
23199
23219
|
"type": "[]",
|
|
23200
23220
|
"optional": false,
|
|
23201
23221
|
"description": "<p>Selected items for multi-select combo-boxes.</p>\n",
|
|
23202
|
-
"line":
|
|
23222
|
+
"line": 436,
|
|
23203
23223
|
"rawdescription": "\nSelected items for multi-select combo-boxes.",
|
|
23204
23224
|
"modifierKind": [
|
|
23205
23225
|
125
|
|
@@ -23213,7 +23233,7 @@
|
|
|
23213
23233
|
"type": "string",
|
|
23214
23234
|
"optional": false,
|
|
23215
23235
|
"description": "<p>used to update the displayValue</p>\n",
|
|
23216
|
-
"line":
|
|
23236
|
+
"line": 438,
|
|
23217
23237
|
"rawdescription": "\nused to update the displayValue",
|
|
23218
23238
|
"modifierKind": [
|
|
23219
23239
|
125
|
|
@@ -23227,7 +23247,7 @@
|
|
|
23227
23247
|
"type": "",
|
|
23228
23248
|
"optional": false,
|
|
23229
23249
|
"description": "",
|
|
23230
|
-
"line":
|
|
23250
|
+
"line": 433,
|
|
23231
23251
|
"modifierKind": [
|
|
23232
23252
|
125
|
|
23233
23253
|
]
|
|
@@ -23239,7 +23259,7 @@
|
|
|
23239
23259
|
"type": "AbstractDropdownView",
|
|
23240
23260
|
"optional": false,
|
|
23241
23261
|
"description": "<p>ContentChild reference to the instantiated dropdown list</p>\n",
|
|
23242
|
-
"line":
|
|
23262
|
+
"line": 424,
|
|
23243
23263
|
"rawdescription": "\nContentChild reference to the instantiated dropdown list",
|
|
23244
23264
|
"decorators": [
|
|
23245
23265
|
{
|
|
@@ -23259,7 +23279,7 @@
|
|
|
23259
23279
|
"optional": false,
|
|
23260
23280
|
"returnType": "void",
|
|
23261
23281
|
"typeParameters": [],
|
|
23262
|
-
"line":
|
|
23282
|
+
"line": 831,
|
|
23263
23283
|
"deprecated": false,
|
|
23264
23284
|
"deprecationMessage": "",
|
|
23265
23285
|
"rawdescription": "\n\nCreates the `Dropdown` list as an element that is appended to the DOM body.\n",
|
|
@@ -23271,7 +23291,7 @@
|
|
|
23271
23291
|
"optional": false,
|
|
23272
23292
|
"returnType": "void",
|
|
23273
23293
|
"typeParameters": [],
|
|
23274
|
-
"line":
|
|
23294
|
+
"line": 842,
|
|
23275
23295
|
"deprecated": false,
|
|
23276
23296
|
"deprecationMessage": "",
|
|
23277
23297
|
"rawdescription": "\n\nCreates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n",
|
|
@@ -23290,7 +23310,7 @@
|
|
|
23290
23310
|
"optional": false,
|
|
23291
23311
|
"returnType": "void",
|
|
23292
23312
|
"typeParameters": [],
|
|
23293
|
-
"line":
|
|
23313
|
+
"line": 811,
|
|
23294
23314
|
"deprecated": false,
|
|
23295
23315
|
"deprecationMessage": "",
|
|
23296
23316
|
"rawdescription": "\n\nHandles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n",
|
|
@@ -23313,7 +23333,7 @@
|
|
|
23313
23333
|
"optional": false,
|
|
23314
23334
|
"returnType": "void",
|
|
23315
23335
|
"typeParameters": [],
|
|
23316
|
-
"line":
|
|
23336
|
+
"line": 605,
|
|
23317
23337
|
"deprecated": false,
|
|
23318
23338
|
"deprecationMessage": ""
|
|
23319
23339
|
},
|
|
@@ -23330,7 +23350,7 @@
|
|
|
23330
23350
|
"optional": false,
|
|
23331
23351
|
"returnType": "void",
|
|
23332
23352
|
"typeParameters": [],
|
|
23333
|
-
"line":
|
|
23353
|
+
"line": 871,
|
|
23334
23354
|
"deprecated": false,
|
|
23335
23355
|
"deprecationMessage": "",
|
|
23336
23356
|
"rawdescription": "\n\nHandles clicks outside of the `Dropdown` list.\n",
|
|
@@ -23353,7 +23373,7 @@
|
|
|
23353
23373
|
"optional": false,
|
|
23354
23374
|
"returnType": "any",
|
|
23355
23375
|
"typeParameters": [],
|
|
23356
|
-
"line":
|
|
23376
|
+
"line": 851,
|
|
23357
23377
|
"deprecated": false,
|
|
23358
23378
|
"deprecationMessage": "",
|
|
23359
23379
|
"rawdescription": "\n\nDetects whether or not the `Dropdown` list is visible within all scrollable parents.\nThis can be overridden by passing in a value to the `dropUp` input.\n",
|
|
@@ -23372,7 +23392,7 @@
|
|
|
23372
23392
|
"optional": false,
|
|
23373
23393
|
"returnType": "void",
|
|
23374
23394
|
"typeParameters": [],
|
|
23375
|
-
"line":
|
|
23395
|
+
"line": 783,
|
|
23376
23396
|
"deprecated": false,
|
|
23377
23397
|
"deprecationMessage": "",
|
|
23378
23398
|
"jsdoctags": [
|
|
@@ -23400,7 +23420,7 @@
|
|
|
23400
23420
|
"optional": false,
|
|
23401
23421
|
"returnType": "void",
|
|
23402
23422
|
"typeParameters": [],
|
|
23403
|
-
"line":
|
|
23423
|
+
"line": 671,
|
|
23404
23424
|
"deprecated": false,
|
|
23405
23425
|
"deprecationMessage": "",
|
|
23406
23426
|
"modifierKind": [
|
|
@@ -23424,7 +23444,7 @@
|
|
|
23424
23444
|
"optional": false,
|
|
23425
23445
|
"returnType": "void",
|
|
23426
23446
|
"typeParameters": [],
|
|
23427
|
-
"line":
|
|
23447
|
+
"line": 691,
|
|
23428
23448
|
"deprecated": false,
|
|
23429
23449
|
"deprecationMessage": "",
|
|
23430
23450
|
"rawdescription": "\n\nCloses the dropdown and emits the close event.\n",
|
|
@@ -23446,7 +23466,7 @@
|
|
|
23446
23466
|
"optional": false,
|
|
23447
23467
|
"returnType": "void",
|
|
23448
23468
|
"typeParameters": [],
|
|
23449
|
-
"line":
|
|
23469
|
+
"line": 580,
|
|
23450
23470
|
"deprecated": false,
|
|
23451
23471
|
"deprecationMessage": "",
|
|
23452
23472
|
"rawdescription": "\n\nHandles `Escape/Tab` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n",
|
|
@@ -23485,7 +23505,7 @@
|
|
|
23485
23505
|
"optional": false,
|
|
23486
23506
|
"returnType": "boolean",
|
|
23487
23507
|
"typeParameters": [],
|
|
23488
|
-
"line":
|
|
23508
|
+
"line": 804,
|
|
23489
23509
|
"deprecated": false,
|
|
23490
23510
|
"deprecationMessage": "",
|
|
23491
23511
|
"modifierKind": [
|
|
@@ -23509,7 +23529,7 @@
|
|
|
23509
23529
|
"optional": false,
|
|
23510
23530
|
"returnType": "void",
|
|
23511
23531
|
"typeParameters": [],
|
|
23512
|
-
"line":
|
|
23532
|
+
"line": 642,
|
|
23513
23533
|
"deprecated": false,
|
|
23514
23534
|
"deprecationMessage": ""
|
|
23515
23535
|
},
|
|
@@ -23533,7 +23553,7 @@
|
|
|
23533
23553
|
"optional": false,
|
|
23534
23554
|
"returnType": "void",
|
|
23535
23555
|
"typeParameters": [],
|
|
23536
|
-
"line":
|
|
23556
|
+
"line": 739,
|
|
23537
23557
|
"deprecated": false,
|
|
23538
23558
|
"deprecationMessage": "",
|
|
23539
23559
|
"rawdescription": "\n\nSets the list group filter, and manages single select item selection.\n",
|
|
@@ -23576,7 +23596,7 @@
|
|
|
23576
23596
|
"optional": false,
|
|
23577
23597
|
"returnType": "void",
|
|
23578
23598
|
"typeParameters": [],
|
|
23579
|
-
"line":
|
|
23599
|
+
"line": 772,
|
|
23580
23600
|
"deprecated": false,
|
|
23581
23601
|
"deprecationMessage": "",
|
|
23582
23602
|
"rawdescription": "\n\nIntended to be used to add items to the list.\n",
|
|
@@ -23602,7 +23622,7 @@
|
|
|
23602
23622
|
"optional": false,
|
|
23603
23623
|
"returnType": "void",
|
|
23604
23624
|
"typeParameters": [],
|
|
23605
|
-
"line":
|
|
23625
|
+
"line": 705,
|
|
23606
23626
|
"deprecated": false,
|
|
23607
23627
|
"deprecationMessage": "",
|
|
23608
23628
|
"rawdescription": "\n\nOpens the dropdown.\n",
|
|
@@ -23624,7 +23644,7 @@
|
|
|
23624
23644
|
"optional": false,
|
|
23625
23645
|
"returnType": "void",
|
|
23626
23646
|
"typeParameters": [],
|
|
23627
|
-
"line":
|
|
23647
|
+
"line": 646,
|
|
23628
23648
|
"deprecated": false,
|
|
23629
23649
|
"deprecationMessage": "",
|
|
23630
23650
|
"jsdoctags": [
|
|
@@ -23652,7 +23672,7 @@
|
|
|
23652
23672
|
"optional": false,
|
|
23653
23673
|
"returnType": "void",
|
|
23654
23674
|
"typeParameters": [],
|
|
23655
|
-
"line":
|
|
23675
|
+
"line": 650,
|
|
23656
23676
|
"deprecated": false,
|
|
23657
23677
|
"deprecationMessage": "",
|
|
23658
23678
|
"jsdoctags": [
|
|
@@ -23680,7 +23700,7 @@
|
|
|
23680
23700
|
"optional": false,
|
|
23681
23701
|
"returnType": "void",
|
|
23682
23702
|
"typeParameters": [],
|
|
23683
|
-
"line":
|
|
23703
|
+
"line": 659,
|
|
23684
23704
|
"deprecated": false,
|
|
23685
23705
|
"deprecationMessage": "",
|
|
23686
23706
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the combobox.\n\nex: `this.formGroup.get(\"myCoolCombobox\").disable();`\n",
|
|
@@ -23703,7 +23723,7 @@
|
|
|
23703
23723
|
"optional": false,
|
|
23704
23724
|
"returnType": "void",
|
|
23705
23725
|
"typeParameters": [],
|
|
23706
|
-
"line":
|
|
23726
|
+
"line": 728,
|
|
23707
23727
|
"deprecated": false,
|
|
23708
23728
|
"deprecationMessage": "",
|
|
23709
23729
|
"rawdescription": "\n\nToggles the dropdown.\n",
|
|
@@ -23718,7 +23738,7 @@
|
|
|
23718
23738
|
"optional": false,
|
|
23719
23739
|
"returnType": "void",
|
|
23720
23740
|
"typeParameters": [],
|
|
23721
|
-
"line":
|
|
23741
|
+
"line": 666,
|
|
23722
23742
|
"deprecated": false,
|
|
23723
23743
|
"deprecationMessage": "",
|
|
23724
23744
|
"rawdescription": "\n\nCalled by `n-pill-input` when the selected pills have changed.\n",
|
|
@@ -23740,7 +23760,7 @@
|
|
|
23740
23760
|
"optional": false,
|
|
23741
23761
|
"returnType": "void",
|
|
23742
23762
|
"typeParameters": [],
|
|
23743
|
-
"line":
|
|
23763
|
+
"line": 610,
|
|
23744
23764
|
"deprecated": false,
|
|
23745
23765
|
"deprecationMessage": "",
|
|
23746
23766
|
"jsdoctags": [
|
|
@@ -23764,7 +23784,7 @@
|
|
|
23764
23784
|
"defaultValue": "true",
|
|
23765
23785
|
"deprecated": false,
|
|
23766
23786
|
"deprecationMessage": "",
|
|
23767
|
-
"line":
|
|
23787
|
+
"line": 428,
|
|
23768
23788
|
"type": "boolean",
|
|
23769
23789
|
"decorators": []
|
|
23770
23790
|
},
|
|
@@ -23773,7 +23793,7 @@
|
|
|
23773
23793
|
"defaultValue": "\"block\"",
|
|
23774
23794
|
"deprecated": false,
|
|
23775
23795
|
"deprecationMessage": "",
|
|
23776
|
-
"line":
|
|
23796
|
+
"line": 429,
|
|
23777
23797
|
"type": "string",
|
|
23778
23798
|
"decorators": []
|
|
23779
23799
|
}
|
|
@@ -23796,7 +23816,7 @@
|
|
|
23796
23816
|
"deprecationMessage": "",
|
|
23797
23817
|
"rawdescription": "\n\nHandles `Escape/Tab` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n",
|
|
23798
23818
|
"description": "<p>Handles <code>Escape/Tab</code> key closing the dropdown, and arrow up/down focus to/from the dropdown list.</p>\n",
|
|
23799
|
-
"line":
|
|
23819
|
+
"line": 580
|
|
23800
23820
|
}
|
|
23801
23821
|
],
|
|
23802
23822
|
"standalone": false,
|
|
@@ -23804,7 +23824,7 @@
|
|
|
23804
23824
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { ComboBoxModule } from 'carbon-components-angular';</code></pre></div><p>ComboBoxes are similar to dropdowns, except a combobox provides an input field for users to search items and (optionally) add their own.\nMulti-select comboboxes also provide "pills" of selected items.</p>\n<p><a href=\"../../?path=/story/components-combobox--basic\">See demo</a></p>\n",
|
|
23805
23825
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { ComboBoxModule } from 'carbon-components-angular';\n```\n\nComboBoxes are similar to dropdowns, except a combobox provides an input field for users to search items and (optionally) add their own.\nMulti-select comboboxes also provide \"pills\" of selected items.\n\n[See demo](../../?path=/story/components-combobox--basic)\n",
|
|
23806
23826
|
"type": "component",
|
|
23807
|
-
"sourceCode": "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\tOnDestroy\n} from \"@angular/core\";\nimport { AbstractDropdownView, DropdownService } from \"carbon-components-angular/dropdown\";\nimport { ListItem } from \"carbon-components-angular/dropdown\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { filter } from \"rxjs/operators\";\nimport {\n\tgetScrollableParents,\n\thasScrollableParents\n} from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ComboBoxModule } from 'carbon-components-angular';\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/components-combobox--basic)\n */\n@Component({\n\tselector: \"cds-combo-box, ibm-combo-box\",\n\ttemplate: `\n\t\t<div class=\"cds--list-box__wrapper\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\t[id]=\"labelId\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\t#listbox\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--multi-select cds--multi-select--filterable': type === 'multi',\n\t\t\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t\t\t'cds--list-box--expanded': open,\n\t\t\t\t\t'cds--list-box--sm': size === 'sm',\n\t\t\t\t\t'cds--list-box--md': size === 'md',\n\t\t\t\t\t'cds--list-box--lg': size === 'lg',\n\t\t\t\t\t'cds--list-box--disabled': disabled,\n\t\t\t\t\t'cds--combo-box--warning cds--list-box--warning': warn\n\t\t\t\t}\"\n\t\t\t\tclass=\"cds--list-box cds--combo-box\"\n\t\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--list-box__field\"\n\t\t\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\t\t\tclass=\"cds--tag cds--tag--filter cds--tag--high-contrast\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tag--disabled': disabled}\">\n\t\t\t\t\t\t<span class=\"cds--tag__label\">{{ pills.length }}</span>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t(click)=\"clearSelected($event)\"\n\t\t\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t\t\t(keydown.enter)=\"clearSelected($event)\"\n\t\t\t\t\t\t\tclass=\"cds--tag__close-icon\"\n\t\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\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\t\t</svg>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t(input)=\"onSearch($event.target.value)\"\n\t\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\t\t\tclass=\"cds--text-input\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--text-input--empty': !showClearButton}\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t\t[attr.aria-labelledby]=\"labelId\"\n\t\t\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t\t\t[attr.aria-controls]=\"open ? view?.listId : null\"\n\t\t\t\t\t\t[attr.aria-autocomplete]=\"autocomplete\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__invalid-icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tclass=\"cds--list-box__selection\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t\t\t(keyup.enter)=\"clearInput($event)\"\n\t\t\t\t\t\t(click)=\"clearInput($event)\"\n\t\t\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t\t\t<svg cdsIcon=\"close\" size=\"16\"></svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tclass=\"cds--list-box__menu-icon\"\n\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t\t[attr.aria-label]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': open}\">\n\t\t\t\t\t\t<svg cdsIcon=\"chevron--down\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t#dropdownMenu\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-content *ngIf=\"open\"></ng-content>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\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, OnDestroy {\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 * 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\tstatic comboBoxCount = 0;\n\t@Input() id = `dropdown-${ComboBox.comboBoxCount++}`;\n\t@Input() labelId = `dropdown-label-${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 * 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 * Specifies the property to be used as the return value to `ngModel`\n\t */\n\t@Input() itemValueKey: string;\n\t/**\n\t * Label for the combobox.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Hide label while keeping it accessible for screen readers\n\t */\n\t@Input() hideLabel = false;\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` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline: boolean = null;\n\t/**\n\t * Set to `true` to show the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if combobox is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t* Set to `true` to show a warning (contents set by warnText)\n\t*/\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: 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 * @deprecated since v5 - Use `cdsLayer` directive instead\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Specify feedback (mode) of the selection.\n\t * `top`: selected item jumps to top\n\t * `fixed`: selected item stays at its position\n\t * `top-after-reopen`: selected item jump to top after reopen dropdown\n\t */\n\t@Input() selectionFeedback: \"top\" | \"fixed\" | \"top-after-reopen\" = \"top-after-reopen\";\n\t/**\n\t * Specify aria-autocomplete attribute of text input.\n\t * \"list\", is the expected value for a combobox that invokes a drop-down list\n\t */\n\t@Input() autocomplete = \"list\";\n\t/**\n\t * Overrides the automatic dropUp.\n\t */\n\t@Input() dropUp: boolean;\n\t/**\n\t * Set to `true` to disable combobox.\n\t */\n\t@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<{\n\t\titems: ListItem[],\n\t\tindex: number,\n\t\tvalue: {\n\t\t\tcontent: string,\n\t\t\tselected: boolean\n\t\t}\n\t}>();\n\t/** Emits an empty event when the menu is closed */\n\t@Output() close = new EventEmitter<void>();\n\t/** Emits the search string from the input */\n\t@Output() search = new EventEmitter<string>();\n\t/** Emits an event when the clear button is clicked. */\n\t@Output() clear = new EventEmitter<Event>();\n\t/** ContentChild reference to the instantiated dropdown list */\n\t@ContentChild(AbstractDropdownView, { static: true }) view: AbstractDropdownView;\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\t@ViewChild(\"input\", { static: true }) input: ElementRef;\n\t@ViewChild(\"listbox\", { static: true }) listbox: ElementRef;\n\t@HostBinding(\"class.cds--list-box__wrapper\") hostClass = true;\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\toutsideClick = this._outsideClick.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\t/**\n\t * controls whether the `drop-up` class is applied\n\t */\n\t_dropUp = false;\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 dropdownService: DropdownService,\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\tthis.updateSelected();\n\t\t\t// If new items are added into the combobox while there is search input,\n\t\t\t// repeat the search. Search should only trigger for type 'single' when there is no value selected.\n\t\t\tif (this.type === \"multi\" || (this.type === \"single\" && !this.selectedValue)) {\n\t\t\t\tthis.onSearch(this.input.nativeElement.value, false);\n\t\t\t}\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\n\t\t\t// function to check if the event is organic (isUpdate === false) or programmatic\n\t\t\tconst isUpdate = event => event && event.isUpdate;\n\n\t\t\tthis.view.select.subscribe(event => {\n\t\t\t\tif (Array.isArray(event)) {\n\t\t\t\t\tthis.updatePills();\n\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\tif (this.itemValueKey && this.view.getSelected()) {\n\t\t\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.itemValueKey]);\n\t\t\t\t\t\t\tthis.propagateChangeCallback(values);\n\t\t\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selected.emit(event);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If type is single, dropdown list will emit an object\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\n\t\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t\t\t\tthis.propagateChangeCallback(event.item[this.itemValueKey]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.propagateChangeCallback(event.item);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.selectedValue = \"\";\n\t\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\t\tthis.propagateChangeCallback(null);\n\t\t\t\t\t\t}\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\t// only focus for \"organic\" selections\n\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\tthis.elementRef.nativeElement.querySelector(\"input\").focus();\n\t\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t\t\tthis.selected.emit(event.item);\n\t\t\t\t\t}\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\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(\".cds--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\t// if appendInline is default valued (null) we should:\n\t\t// 1. if there are scrollable parents (not including body) don't append inline\n\t\t// this should also cover the case where the dropdown is in a modal\n\t\t// (where we _do_ want to append to the placeholder)\n\t\tif (this.appendInline === null && hasScrollableParents(this.elementRef.nativeElement)) {\n\t\t\tthis.appendInline = false;\n\t\t// 2. otherwise we should append inline\n\t\t} else if (this.appendInline === null) {\n\t\t\tthis.appendInline = true;\n\t\t}\n\t}\n\n\t/**\n\t * Removing the `Dropdown` from the body if it is appended to the body.\n\t */\n\tngOnDestroy() {\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Handles `Escape/Tab` 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\")\n\t\t\t&& (!this.dropdownMenu || !this.dropdownMenu.nativeElement.contains(ev.target))) {\n\t\t\tev.preventDefault();\n\t\t\tthis.openDropdown();\n\t\t\tsetTimeout(() => { this.view.initFocus(); }, 0);\n\t\t}\n\n\t\tif (\n\t\t\tthis.open && ev.key === \"Tab\" &&\n\t\t\t(this.dropdownMenu.nativeElement.contains(ev.target as Node) || ev.target === this.input.nativeElement)\n\t\t) {\n\t\t\tthis.closeDropdown();\n\t\t}\n\n\t\tif (this.open && ev.key === \"Tab\" && ev.shiftKey) {\n\t\t\tthis.closeDropdown();\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\tif (this.itemValueKey) {\n\t\t\t\t// clone the specified item and update its state\n\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.itemValueKey] === value));\n\t\t\t\tnewValue.selected = true;\n\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t} else {\n\t\t\t\t// all items in propagateSelected must be iterable\n\t\t\t\tthis.view.propagateSelected([value || \"\"]);\n\t\t\t}\n\t\t\tthis.showClearButton = !!(value && this.view.getSelected().length);\n\t\t} else {\n\t\t\tif (this.itemValueKey) {\n\t\t\t\t// clone the items and update their state based on the received value array\n\t\t\t\t// this way we don't lose any additional metadata that may be passed in via the `items` Input\n\t\t\t\tlet newValues = [];\n\t\t\t\tfor (const v of value) {\n\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\tif (item[this.itemValueKey] === v) {\n\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t} else {\n\t\t\t\tthis.view.propagateSelected(value ? value : [\"\"]);\n\t\t\t}\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 * `ControlValueAccessor` method to programmatically disable the combobox.\n\t *\n\t * ex: `this.formGroup.get(\"myCoolCombobox\").disable();`\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\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.checkForReorder();\n\t}\n\n\tpublic clearSelected(event) {\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\tconst selected = this.view.getSelected();\n\t\tthis.propagateChangeCallback(selected);\n\t\tthis.selected.emit(selected as any);\n\t\tthis.clear.emit(event);\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.checkForReorder();\n\t\tthis.close.emit();\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\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\tthis._dropUp = false;\n\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\n\t\t// set the dropdown menu to drop up if it is near the bottom of the screen\n\t\t// setTimeout lets us do the calculations after it is visible in the DOM\n\t\tsetTimeout(() => {\n\t\t\tif (this.dropUp === null || this.dropUp === undefined) {\n\t\t\t\tthis._dropUp = this._shouldDropUp();\n\t\t\t}\n\t\t}, 0);\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;\n\t\tthis.view.filterBy(searchString);\n\t\tif (searchString !== \"\") {\n\t\t\tif (!this.open) {\n\t\t\t\tthis.openDropdown();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.selectedValue = \"\";\n\t\t\tif (this.type === \"multi\" &&\n\t\t\t\t(this.selectionFeedback === \"top\" || this.selectionFeedback === \"top-after-reopen\")) {\n\t\t\t\tthis.view.reorderSelected();\n\t\t\t}\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(searchString);\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\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.type === \"single\") { // don't want to clear selected or close if multi\n\t\t\tthis.clearSelected(event);\n\t\t\tthis.closeDropdown();\n\t\t}\n\n\t\tthis.selectedValue = \"\";\n\t\tthis.input.nativeElement.value = \"\";\n\n\t\tthis.showClearButton = false;\n\t\tthis.input.nativeElement.focus();\n\t\tthis.onSearch(this.input.nativeElement.value);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Handles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n\t */\n\t_keyboardNav(event: KeyboardEvent) {\n\t\tif ((event.key === \"Escape\") && this.open) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close modal if inside of it\n\t\t}\n\t\tif (event.key === \"Escape\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeDropdown();\n\t\t\tthis.input.nativeElement.focus();\n\t\t} else if (this.open && event.key === \"Tab\") {\n\t\t\t// this way focus will start on the next focusable item from the dropdown\n\t\t\t// not the top of the body!\n\t\t\tthis.input.nativeElement.focus();\n\t\t\tthis.input.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", { bubbles: true, cancelable: true, key: \"Tab\" }));\n\t\t\tthis.closeDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.listbox.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\t`${this.elementRef.nativeElement.className}${this.open ? \" cds--list-box--expanded\" : \"\"}`);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n\t */\n\t_appendToDropdown() {\n\t\tthis.dropdownService.appendToDropdown(this.elementRef.nativeElement);\n\t\tthis.dropdownMenu.nativeElement.removeEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Detects whether or not the `Dropdown` list is visible within all scrollable parents.\n\t * This can be overridden by passing in a value to the `dropUp` input.\n\t */\n\t_shouldDropUp() {\n\t\t// check if dropdownMenu exists first.\n\t\tconst menu = this.dropdownMenu && this.dropdownMenu.nativeElement.querySelector(\".cds--list-box__menu\");\n\t\t// check if menu exists first.\n\t\tconst menuRect = menu && menu.getBoundingClientRect();\n\t\tif (menu && menuRect) {\n\t\t\tconst scrollableParents = getScrollableParents(menu);\n\t\t\treturn scrollableParents.reduce((shouldDropUp: boolean, parent: HTMLElement) => {\n\t\t\t\tconst parentRect = parent.getBoundingClientRect();\n\t\t\t\tconst isBelowParent = !(menuRect.bottom <= parentRect.bottom);\n\t\t\t\treturn shouldDropUp || isBelowParent;\n\t\t\t}, false);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Handles clicks outside of the `Dropdown` list.\n\t */\n\t_outsideClick(event) {\n\t\tif (!this.elementRef.nativeElement.contains(event.target) &&\n\t\t\t// if we're appendToBody the list isn't within the _elementRef,\n\t\t\t// so we've got to check if our target is possibly in there too.\n\t\t\t!this.dropdownMenu.nativeElement.contains(event.target)) {\n\t\t\tthis.closeDropdown();\n\t\t}\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) {\n\t\t\tconst value = selected[0] ? selected[0].content : \"\";\n\t\t\tconst changeCallbackValue = selected[0] ? selected[0] : \"\";\n\t\t\tthis.selectedValue = value;\n\t\t\tthis.showClearButton = !!value;\n\t\t}\n\t}\n\n\tprotected checkForReorder() {\n\t\tconst topAfterReopen = !this.open && this.selectionFeedback === \"top-after-reopen\";\n\t\tif ((this.type === \"multi\") && (topAfterReopen || this.selectionFeedback === \"top\")) {\n\t\t\tthis.view.reorderSelected(true);\n\t\t}\n\t}\n}\n",
|
|
23827
|
+
"sourceCode": "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\tOnDestroy\n} from \"@angular/core\";\nimport { AbstractDropdownView, DropdownService } from \"carbon-components-angular/dropdown\";\nimport { ListItem } from \"carbon-components-angular/dropdown\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { filter } from \"rxjs/operators\";\nimport {\n\tgetScrollableParents,\n\thasScrollableParents\n} from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ComboBoxModule } from 'carbon-components-angular';\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/components-combobox--basic)\n */\n@Component({\n\tselector: \"cds-combo-box, ibm-combo-box\",\n\ttemplate: `\n\t\t<div class=\"cds--list-box__wrapper\">\n\t\t\t<label\n\t\t\t\t*ngIf=\"label\"\n\t\t\t\t[for]=\"id\"\n\t\t\t\t[id]=\"labelId\"\n\t\t\t\tclass=\"cds--label\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--label--disabled': disabled,\n\t\t\t\t\t'cds--visually-hidden': hideLabel\n\t\t\t\t}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t</label>\n\t\t\t<div\n\t\t\t\t#listbox\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--multi-select cds--multi-select--filterable': type === 'multi',\n\t\t\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t\t\t'cds--list-box--expanded': open,\n\t\t\t\t\t'cds--list-box--sm': size === 'sm',\n\t\t\t\t\t'cds--list-box--md': size === 'md',\n\t\t\t\t\t'cds--list-box--lg': size === 'lg',\n\t\t\t\t\t'cds--list-box--disabled': disabled,\n\t\t\t\t\t'cds--combo-box--readonly': readonly,\n\t\t\t\t\t'cds--combo-box--warning cds--list-box--warning': warn\n\t\t\t\t}\"\n\t\t\t\tclass=\"cds--list-box cds--combo-box\"\n\t\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"cds--list-box__field\"\n\t\t\t\t\t(click)=\"toggleDropdown()\"\n\t\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"type === 'multi' && pills.length > 0\"\n\t\t\t\t\t\tclass=\"cds--tag cds--tag--filter cds--tag--high-contrast\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tag--disabled': disabled || readonly}\">\n\t\t\t\t\t\t<span class=\"cds--tag__label\">{{ pills.length }}</span>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t(click)=\"clearSelected($event)\"\n\t\t\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t\t\t(keydown.enter)=\"clearSelected($event)\"\n\t\t\t\t\t\t\tclass=\"cds--tag__close-icon\"\n\t\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t\t[title]=\"clearSelectionsTitle\"\n\t\t\t\t\t\t\t[disabled]=\"disabled || readonly\"\n\t\t\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\">\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\twidth=\"16\"\n\t\t\t\t\t\t\t\theight=\"16\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\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\t\t</svg>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t[readOnly]=\"readonly\"\n\t\t\t\t\t\t(input)=\"onSearch($event.target.value)\"\n\t\t\t\t\t\t(blur)=\"onBlur()\"\n\t\t\t\t\t\t(keydown.enter)=\"onSubmit($event)\"\n\t\t\t\t\t\t[value]=\"selectedValue\"\n\t\t\t\t\t\tclass=\"cds--text-input\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--text-input--empty': !showClearButton}\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t[id]=\"id\"\n\t\t\t\t\t\t[attr.aria-labelledby]=\"labelId\"\n\t\t\t\t\t\t[attr.aria-expanded]=\"open\"\n\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t[attr.maxlength]=\"maxLength\"\n\t\t\t\t\t\t[attr.aria-controls]=\"open ? view?.listId : null\"\n\t\t\t\t\t\t[attr.aria-autocomplete]=\"autocomplete\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"/>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__invalid-icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"showClearButton\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tclass=\"cds--list-box__selection\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\t[attr.aria-label]=\"clearSelectionAria\"\n\t\t\t\t\t\t[title]=\"clearSelectionTitle\"\n\t\t\t\t\t\t(keyup.enter)=\"clearInput($event)\"\n\t\t\t\t\t\t(click)=\"clearInput($event)\"\n\t\t\t\t\t\t(blur)=\"onBlur()\">\n\t\t\t\t\t\t<svg cdsIcon=\"close\" size=\"16\"></svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tclass=\"cds--list-box__menu-icon\"\n\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t[title]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t\t[attr.aria-label]=\"open ? closeMenuAria : openMenuAria\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': open}\">\n\t\t\t\t\t\t<svg cdsIcon=\"chevron--down\" size=\"16\"></svg>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t#dropdownMenu\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-content *ngIf=\"open\"></ng-content>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t</div>\n\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t</div>\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, OnDestroy {\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 * 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\tstatic comboBoxCount = 0;\n\t@Input() id = `dropdown-${ComboBox.comboBoxCount++}`;\n\t@Input() labelId = `dropdown-label-${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 * 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 * Specifies the property to be used as the return value to `ngModel`\n\t */\n\t@Input() itemValueKey: string;\n\t/**\n\t * Label for the combobox.\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Hide label while keeping it accessible for screen readers\n\t */\n\t@Input() hideLabel = false;\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` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline: boolean = null;\n\t/**\n\t * Set to `true` to show the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if combobox is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t* Set to `true` to show a warning (contents set by warnText)\n\t*/\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: 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 * @deprecated since v5 - Use `cdsLayer` directive instead\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Specify feedback (mode) of the selection.\n\t * `top`: selected item jumps to top\n\t * `fixed`: selected item stays at its position\n\t * `top-after-reopen`: selected item jump to top after reopen dropdown\n\t */\n\t@Input() selectionFeedback: \"top\" | \"fixed\" | \"top-after-reopen\" = \"top-after-reopen\";\n\t/**\n\t * Specify aria-autocomplete attribute of text input.\n\t * \"list\", is the expected value for a combobox that invokes a drop-down list\n\t */\n\t@Input() autocomplete = \"list\";\n\t/**\n\t * Overrides the automatic dropUp.\n\t */\n\t@Input() dropUp: boolean;\n\t/**\n\t * Set to `true` to disable combobox.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for readonly state.\n\t */\n\t@Input() readonly = 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<{\n\t\titems: ListItem[],\n\t\tindex: number,\n\t\tvalue: {\n\t\t\tcontent: string,\n\t\t\tselected: boolean\n\t\t}\n\t}>();\n\t/** Emits an empty event when the menu is closed */\n\t@Output() close = new EventEmitter<void>();\n\t/** Emits the search string from the input */\n\t@Output() search = new EventEmitter<string>();\n\t/** Emits an event when the clear button is clicked. */\n\t@Output() clear = new EventEmitter<Event>();\n\t/** ContentChild reference to the instantiated dropdown list */\n\t@ContentChild(AbstractDropdownView, { static: true }) view: AbstractDropdownView;\n\t@ViewChild(\"dropdownMenu\") dropdownMenu;\n\t@ViewChild(\"input\", { static: true }) input: ElementRef;\n\t@ViewChild(\"listbox\", { static: true }) listbox: ElementRef;\n\t@HostBinding(\"class.cds--list-box__wrapper\") hostClass = true;\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\toutsideClick = this._outsideClick.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\t/**\n\t * controls whether the `drop-up` class is applied\n\t */\n\t_dropUp = false;\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 dropdownService: DropdownService,\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\tthis.updateSelected();\n\t\t\t// If new items are added into the combobox while there is search input,\n\t\t\t// repeat the search. Search should only trigger for type 'single' when there is no value selected.\n\t\t\tif (this.type === \"multi\" || (this.type === \"single\" && !this.selectedValue)) {\n\t\t\t\tthis.onSearch(this.input.nativeElement.value, false);\n\t\t\t}\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\n\t\t\t// function to check if the event is organic (isUpdate === false) or programmatic\n\t\t\tconst isUpdate = event => event && event.isUpdate;\n\n\t\t\tthis.view.select.subscribe(event => {\n\t\t\t\tif (Array.isArray(event)) {\n\t\t\t\t\tthis.updatePills();\n\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\tif (this.itemValueKey && this.view.getSelected()) {\n\t\t\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.itemValueKey]);\n\t\t\t\t\t\t\tthis.propagateChangeCallback(values);\n\t\t\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.propagateChangeCallback(this.view.getSelected());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.selected.emit(event);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If type is single, dropdown list will emit an object\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\n\t\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t\t\t\tthis.propagateChangeCallback(event.item[this.itemValueKey]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.propagateChangeCallback(event.item);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.selectedValue = \"\";\n\t\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\t\tthis.propagateChangeCallback(null);\n\t\t\t\t\t\t}\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\t// only focus for \"organic\" selections\n\t\t\t\t\tif (!isUpdate(event)) {\n\t\t\t\t\t\tthis.elementRef.nativeElement.querySelector(\"input\").focus();\n\t\t\t\t\t\tthis.view.filterBy(\"\");\n\t\t\t\t\t\tthis.selected.emit(event.item);\n\t\t\t\t\t}\n\t\t\t\t\tthis.closeDropdown();\n\t\t\t\t}\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(\".cds--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\t// if appendInline is default valued (null) we should:\n\t\t// 1. if there are scrollable parents (not including body) don't append inline\n\t\t// this should also cover the case where the dropdown is in a modal\n\t\t// (where we _do_ want to append to the placeholder)\n\t\tif (this.appendInline === null && hasScrollableParents(this.elementRef.nativeElement)) {\n\t\t\tthis.appendInline = false;\n\t\t// 2. otherwise we should append inline\n\t\t} else if (this.appendInline === null) {\n\t\t\tthis.appendInline = true;\n\t\t}\n\t}\n\n\t/**\n\t * Removing the `Dropdown` from the body if it is appended to the body.\n\t */\n\tngOnDestroy() {\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Handles `Escape/Tab` 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\")\n\t\t\t&& (!this.dropdownMenu || !this.dropdownMenu.nativeElement.contains(ev.target))) {\n\t\t\tev.preventDefault();\n\t\t\tthis.openDropdown();\n\t\t\tsetTimeout(() => { this.view.initFocus(); }, 0);\n\t\t}\n\n\t\tif (\n\t\t\tthis.open && ev.key === \"Tab\" &&\n\t\t\t(this.dropdownMenu.nativeElement.contains(ev.target as Node) || ev.target === this.input.nativeElement)\n\t\t) {\n\t\t\tthis.closeDropdown();\n\t\t}\n\n\t\tif (this.open && ev.key === \"Tab\" && ev.shiftKey) {\n\t\t\tthis.closeDropdown();\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\tif (this.itemValueKey) {\n\t\t\t\t// clone the specified item and update its state\n\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.itemValueKey] === value));\n\t\t\t\tnewValue.selected = true;\n\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t} else {\n\t\t\t\t// all items in propagateSelected must be iterable\n\t\t\t\tthis.view.propagateSelected([value || \"\"]);\n\t\t\t}\n\t\t\tthis.showClearButton = !!(value && this.view.getSelected().length);\n\t\t} else {\n\t\t\tif (this.itemValueKey) {\n\t\t\t\t// clone the items and update their state based on the received value array\n\t\t\t\t// this way we don't lose any additional metadata that may be passed in via the `items` Input\n\t\t\t\tlet newValues = [];\n\t\t\t\tfor (const v of value) {\n\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\tif (item[this.itemValueKey] === v) {\n\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t} else {\n\t\t\t\tthis.view.propagateSelected(value ? value : [\"\"]);\n\t\t\t}\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 * `ControlValueAccessor` method to programmatically disable the combobox.\n\t *\n\t * ex: `this.formGroup.get(\"myCoolCombobox\").disable();`\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\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.checkForReorder();\n\t}\n\n\tpublic clearSelected(event) {\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\tconst selected = this.view.getSelected();\n\t\tthis.propagateChangeCallback(selected);\n\t\tthis.selected.emit(selected as any);\n\t\tthis.clear.emit(event);\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.checkForReorder();\n\t\tthis.close.emit();\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToDropdown();\n\t\t}\n\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\n\t}\n\n\t/**\n\t * Opens the dropdown.\n\t */\n\tpublic openDropdown() {\n\t\tif (this.disabled || this.readonly) { return; }\n\t\tthis.open = true;\n\t\tthis._dropUp = false;\n\n\t\tif (!this.appendInline) {\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\n\t\t// set the dropdown menu to drop up if it is near the bottom of the screen\n\t\t// setTimeout lets us do the calculations after it is visible in the DOM\n\t\tsetTimeout(() => {\n\t\t\tif (this.dropUp === null || this.dropUp === undefined) {\n\t\t\t\tthis._dropUp = this._shouldDropUp();\n\t\t\t}\n\t\t}, 0);\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;\n\t\tthis.view.filterBy(searchString);\n\t\tif (searchString !== \"\") {\n\t\t\tif (!this.open) {\n\t\t\t\tthis.openDropdown();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.selectedValue = \"\";\n\t\t\tif (this.type === \"multi\" &&\n\t\t\t\t(this.selectionFeedback === \"top\" || this.selectionFeedback === \"top-after-reopen\")) {\n\t\t\t\tthis.view.reorderSelected();\n\t\t\t}\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(searchString);\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\tif (this.disabled || this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.type === \"single\") { // don't want to clear selected or close if multi\n\t\t\tthis.clearSelected(event);\n\t\t\tthis.closeDropdown();\n\t\t}\n\n\t\tthis.selectedValue = \"\";\n\t\tthis.input.nativeElement.value = \"\";\n\n\t\tthis.showClearButton = false;\n\t\tthis.input.nativeElement.focus();\n\t\tthis.onSearch(this.input.nativeElement.value);\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Handles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n\t */\n\t_keyboardNav(event: KeyboardEvent) {\n\t\tif ((event.key === \"Escape\") && this.open) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close modal if inside of it\n\t\t}\n\t\tif (event.key === \"Escape\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeDropdown();\n\t\t\tthis.input.nativeElement.focus();\n\t\t} else if (this.open && event.key === \"Tab\") {\n\t\t\t// this way focus will start on the next focusable item from the dropdown\n\t\t\t// not the top of the body!\n\t\t\tthis.input.nativeElement.focus();\n\t\t\tthis.input.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", { bubbles: true, cancelable: true, key: \"Tab\" }));\n\t\t\tthis.closeDropdown();\n\t\t}\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.listbox.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\t`${this.elementRef.nativeElement.className}${this.open ? \" cds--list-box--expanded\" : \"\"}`);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Creates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n\t */\n\t_appendToDropdown() {\n\t\tthis.dropdownService.appendToDropdown(this.elementRef.nativeElement);\n\t\tthis.dropdownMenu.nativeElement.removeEventListener(\"keydown\", this.keyboardNav, true);\n\t}\n\n\t/**\n\t * Detects whether or not the `Dropdown` list is visible within all scrollable parents.\n\t * This can be overridden by passing in a value to the `dropUp` input.\n\t */\n\t_shouldDropUp() {\n\t\t// check if dropdownMenu exists first.\n\t\tconst menu = this.dropdownMenu && this.dropdownMenu.nativeElement.querySelector(\".cds--list-box__menu\");\n\t\t// check if menu exists first.\n\t\tconst menuRect = menu && menu.getBoundingClientRect();\n\t\tif (menu && menuRect) {\n\t\t\tconst scrollableParents = getScrollableParents(menu);\n\t\t\treturn scrollableParents.reduce((shouldDropUp: boolean, parent: HTMLElement) => {\n\t\t\t\tconst parentRect = parent.getBoundingClientRect();\n\t\t\t\tconst isBelowParent = !(menuRect.bottom <= parentRect.bottom);\n\t\t\t\treturn shouldDropUp || isBelowParent;\n\t\t\t}, false);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Handles clicks outside of the `Dropdown` list.\n\t */\n\t_outsideClick(event) {\n\t\tif (!this.elementRef.nativeElement.contains(event.target) &&\n\t\t\t// if we're appendToBody the list isn't within the _elementRef,\n\t\t\t// so we've got to check if our target is possibly in there too.\n\t\t\t!this.dropdownMenu.nativeElement.contains(event.target)) {\n\t\t\tthis.closeDropdown();\n\t\t}\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) {\n\t\t\tconst value = selected[0] ? selected[0].content : \"\";\n\t\t\tconst changeCallbackValue = selected[0] ? selected[0] : \"\";\n\t\t\tthis.selectedValue = value;\n\t\t\tthis.showClearButton = !!value;\n\t\t}\n\t}\n\n\tprotected checkForReorder() {\n\t\tconst topAfterReopen = !this.open && this.selectionFeedback === \"top-after-reopen\";\n\t\tif ((this.type === \"multi\") && (topAfterReopen || this.selectionFeedback === \"top\")) {\n\t\t\tthis.view.reorderSelected(true);\n\t\t}\n\t}\n}\n",
|
|
23808
23828
|
"assetsDirs": [],
|
|
23809
23829
|
"styleUrlsData": "",
|
|
23810
23830
|
"stylesData": "",
|
|
@@ -23833,7 +23853,7 @@
|
|
|
23833
23853
|
"deprecationMessage": ""
|
|
23834
23854
|
}
|
|
23835
23855
|
],
|
|
23836
|
-
"line":
|
|
23856
|
+
"line": 457,
|
|
23837
23857
|
"rawdescription": "\n\nCreates an instance of ComboBox.\n",
|
|
23838
23858
|
"jsdoctags": [
|
|
23839
23859
|
{
|
|
@@ -23889,7 +23909,7 @@
|
|
|
23889
23909
|
}
|
|
23890
23910
|
],
|
|
23891
23911
|
"returnType": "void",
|
|
23892
|
-
"line":
|
|
23912
|
+
"line": 198,
|
|
23893
23913
|
"rawdescription": "\n\nText to show when nothing is selected.\n",
|
|
23894
23914
|
"description": "<p>Text to show when nothing is selected.</p>\n",
|
|
23895
23915
|
"jsdoctags": [
|
|
@@ -23908,7 +23928,7 @@
|
|
|
23908
23928
|
"name": "placeholder",
|
|
23909
23929
|
"type": "",
|
|
23910
23930
|
"returnType": "",
|
|
23911
|
-
"line":
|
|
23931
|
+
"line": 202
|
|
23912
23932
|
}
|
|
23913
23933
|
},
|
|
23914
23934
|
"openMenuAria": {
|
|
@@ -23927,7 +23947,7 @@
|
|
|
23927
23947
|
}
|
|
23928
23948
|
],
|
|
23929
23949
|
"returnType": "void",
|
|
23930
|
-
"line":
|
|
23950
|
+
"line": 208,
|
|
23931
23951
|
"rawdescription": "\n\nValue to display for accessibility purposes on the combobox control menu when closed\n",
|
|
23932
23952
|
"description": "<p>Value to display for accessibility purposes on the combobox control menu when closed</p>\n",
|
|
23933
23953
|
"jsdoctags": [
|
|
@@ -23946,7 +23966,7 @@
|
|
|
23946
23966
|
"name": "openMenuAria",
|
|
23947
23967
|
"type": "",
|
|
23948
23968
|
"returnType": "",
|
|
23949
|
-
"line":
|
|
23969
|
+
"line": 212
|
|
23950
23970
|
}
|
|
23951
23971
|
},
|
|
23952
23972
|
"closeMenuAria": {
|
|
@@ -23965,7 +23985,7 @@
|
|
|
23965
23985
|
}
|
|
23966
23986
|
],
|
|
23967
23987
|
"returnType": "void",
|
|
23968
|
-
"line":
|
|
23988
|
+
"line": 218,
|
|
23969
23989
|
"rawdescription": "\n\nValue to display for accessibility purposes on the combobox control menu when opened\n",
|
|
23970
23990
|
"description": "<p>Value to display for accessibility purposes on the combobox control menu when opened</p>\n",
|
|
23971
23991
|
"jsdoctags": [
|
|
@@ -23984,7 +24004,7 @@
|
|
|
23984
24004
|
"name": "closeMenuAria",
|
|
23985
24005
|
"type": "",
|
|
23986
24006
|
"returnType": "",
|
|
23987
|
-
"line":
|
|
24007
|
+
"line": 222
|
|
23988
24008
|
}
|
|
23989
24009
|
},
|
|
23990
24010
|
"clearSelectionsTitle": {
|
|
@@ -24003,7 +24023,7 @@
|
|
|
24003
24023
|
}
|
|
24004
24024
|
],
|
|
24005
24025
|
"returnType": "void",
|
|
24006
|
-
"line":
|
|
24026
|
+
"line": 228,
|
|
24007
24027
|
"rawdescription": "\n\nValue to display on the clear selections icon, when multi is selected\n",
|
|
24008
24028
|
"description": "<p>Value to display on the clear selections icon, when multi is selected</p>\n",
|
|
24009
24029
|
"jsdoctags": [
|
|
@@ -24022,7 +24042,7 @@
|
|
|
24022
24042
|
"name": "clearSelectionsTitle",
|
|
24023
24043
|
"type": "",
|
|
24024
24044
|
"returnType": "",
|
|
24025
|
-
"line":
|
|
24045
|
+
"line": 232
|
|
24026
24046
|
}
|
|
24027
24047
|
},
|
|
24028
24048
|
"clearSelectionsAria": {
|
|
@@ -24041,7 +24061,7 @@
|
|
|
24041
24061
|
}
|
|
24042
24062
|
],
|
|
24043
24063
|
"returnType": "void",
|
|
24044
|
-
"line":
|
|
24064
|
+
"line": 238,
|
|
24045
24065
|
"rawdescription": "\n\nValue to display for accessibility purposes to clear selections, when multi is selected\n",
|
|
24046
24066
|
"description": "<p>Value to display for accessibility purposes to clear selections, when multi is selected</p>\n",
|
|
24047
24067
|
"jsdoctags": [
|
|
@@ -24060,7 +24080,7 @@
|
|
|
24060
24080
|
"name": "clearSelectionsAria",
|
|
24061
24081
|
"type": "",
|
|
24062
24082
|
"returnType": "",
|
|
24063
|
-
"line":
|
|
24083
|
+
"line": 242
|
|
24064
24084
|
}
|
|
24065
24085
|
},
|
|
24066
24086
|
"clearSelectionTitle": {
|
|
@@ -24079,7 +24099,7 @@
|
|
|
24079
24099
|
}
|
|
24080
24100
|
],
|
|
24081
24101
|
"returnType": "void",
|
|
24082
|
-
"line":
|
|
24102
|
+
"line": 248,
|
|
24083
24103
|
"rawdescription": "\n\nValue to display on the clear the selected item icon, when single is selected\n",
|
|
24084
24104
|
"description": "<p>Value to display on the clear the selected item icon, when single is selected</p>\n",
|
|
24085
24105
|
"jsdoctags": [
|
|
@@ -24098,7 +24118,7 @@
|
|
|
24098
24118
|
"name": "clearSelectionTitle",
|
|
24099
24119
|
"type": "",
|
|
24100
24120
|
"returnType": "",
|
|
24101
|
-
"line":
|
|
24121
|
+
"line": 252
|
|
24102
24122
|
}
|
|
24103
24123
|
},
|
|
24104
24124
|
"clearSelectionAria": {
|
|
@@ -24117,7 +24137,7 @@
|
|
|
24117
24137
|
}
|
|
24118
24138
|
],
|
|
24119
24139
|
"returnType": "void",
|
|
24120
|
-
"line":
|
|
24140
|
+
"line": 258,
|
|
24121
24141
|
"rawdescription": "\n\nValue to display for accessibility purposes on the clear the selected item icon, when single is selected\n",
|
|
24122
24142
|
"description": "<p>Value to display for accessibility purposes on the clear the selected item icon, when single is selected</p>\n",
|
|
24123
24143
|
"jsdoctags": [
|
|
@@ -24136,7 +24156,7 @@
|
|
|
24136
24156
|
"name": "clearSelectionAria",
|
|
24137
24157
|
"type": "",
|
|
24138
24158
|
"returnType": "",
|
|
24139
|
-
"line":
|
|
24159
|
+
"line": 262
|
|
24140
24160
|
}
|
|
24141
24161
|
}
|
|
24142
24162
|
}
|
|
@@ -37094,7 +37114,7 @@
|
|
|
37094
37114
|
},
|
|
37095
37115
|
{
|
|
37096
37116
|
"name": "MultiStepFormStory",
|
|
37097
|
-
"id": "component-MultiStepFormStory-
|
|
37117
|
+
"id": "component-MultiStepFormStory-75613380ff6f52c2bf18317bb358bd1627e8ba0d6f5db0d88ba531b40b6fbc0226990a8b0bc632bc7ffd29d4b77fea4ff22ca72558cd8d871837ebcd6139af68",
|
|
37098
37118
|
"file": "src/patterns/forms/multi-step-form.stories.ts",
|
|
37099
37119
|
"encapsulation": [],
|
|
37100
37120
|
"entryComponents": [],
|
|
@@ -37121,7 +37141,7 @@
|
|
|
37121
37141
|
"type": "number",
|
|
37122
37142
|
"optional": false,
|
|
37123
37143
|
"description": "",
|
|
37124
|
-
"line":
|
|
37144
|
+
"line": 179
|
|
37125
37145
|
},
|
|
37126
37146
|
{
|
|
37127
37147
|
"name": "resourceGroups",
|
|
@@ -37131,7 +37151,7 @@
|
|
|
37131
37151
|
"type": "[]",
|
|
37132
37152
|
"optional": false,
|
|
37133
37153
|
"description": "",
|
|
37134
|
-
"line":
|
|
37154
|
+
"line": 173
|
|
37135
37155
|
},
|
|
37136
37156
|
{
|
|
37137
37157
|
"name": "step2FormGroup",
|
|
@@ -37147,7 +37167,7 @@
|
|
|
37147
37167
|
},
|
|
37148
37168
|
{
|
|
37149
37169
|
"name": "steps",
|
|
37150
|
-
"defaultValue": "[\n\t\t{\n\t\t\
|
|
37170
|
+
"defaultValue": "[\n\t\t{\n\t\t\tlabel: \"Step 1\",\n\t\t\tcomplete: true\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 2\",\n\t\t\tcurrent: true,\n\t\t\tcomplete: false\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 3\",\n\t\t\tcomplete: false,\n\t\t\tinvalid: true\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 4\",\n\t\t\tcomplete: false,\n\t\t\tsecondaryLabel: \"Optional\"\n\t\t}\n\t]",
|
|
37151
37171
|
"deprecated": false,
|
|
37152
37172
|
"deprecationMessage": "",
|
|
37153
37173
|
"type": "[]",
|
|
@@ -37170,7 +37190,7 @@
|
|
|
37170
37190
|
"optional": false,
|
|
37171
37191
|
"returnType": "void",
|
|
37172
37192
|
"typeParameters": [],
|
|
37173
|
-
"line":
|
|
37193
|
+
"line": 199,
|
|
37174
37194
|
"deprecated": false,
|
|
37175
37195
|
"deprecationMessage": "",
|
|
37176
37196
|
"jsdoctags": [
|
|
@@ -37195,7 +37215,7 @@
|
|
|
37195
37215
|
"description": "",
|
|
37196
37216
|
"rawdescription": "\n",
|
|
37197
37217
|
"type": "component",
|
|
37198
|
-
"sourceCode": "import { Component, OnInit, OnDestroy } from \"@angular/core\";\nimport { moduleMetadata, Meta } from \"@storybook/angular\";\nimport { GridModule } from \"../../grid\";\nimport { UIShellModule } from \"../../ui-shell\";\nimport { DropdownModule } from \"../../dropdown\";\nimport { ButtonModule } from \"../../button\";\nimport { InputModule } from \"../../input\";\nimport { ProgressIndicatorModule } from \"../../progress-indicator\";\nimport { BreadcrumbModule } from \"../../breadcrumb\";\nimport {\n\tFormBuilder,\n\tFormControl,\n\tFormGroup,\n\tReactiveFormsModule\n} from \"@angular/forms\";\n\n@Component({\n\tselector: \"app-multi-step-form\",\n\ttemplate: `\n\t\t<div cdsGrid>\n\t\t\t<div cdsRow class=\"header\">\n\t\t\t\t<cds-header name=\"Patterns\">\n\t\t\t\t\t<cds-hamburger></cds-hamburger>\n\t\t\t\t</cds-header>\n\t\t\t</div>\n\t\t\t<div cdsRow>\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 8, 'md': 8, 'sm': 8}\">\n\t\t\t\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\t\t\t\tDashboard\n\t\t\t\t\t\t</cds-breadcrumb-item>\n\t\t\t\t\t</cds-breadcrumb>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div cdsRow class=\"sub-heading\">\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 8, 'md': 8, 'sm': 8}\">\n\t\t\t\t\t<h4>Vertical multi-step form</h4>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div cdsRow>\n\t\t\t\t<div\n\t\t\t\t\tcdsCol\n\t\t\t\t\t[columnNumbers]=\"{'lg': 2, 'md': 2, 'sm': 2}\"\n\t\t\t\t\tclass=\"indicator-wrapper\">\n\t\t\t\t\t<div class=\"indicator\">\n\t\t\t\t\t\t<cds-progress-indicator\n\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t[steps]=\"steps\"\n\t\t\t\t\t\t\t[current]=\"currentStep\">\n\t\t\t\t\t\t</cds-progress-indicator>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 6, 'md': 6, 'sm': 6}\" [ngSwitch]=\"currentStep\">\n\t\t\t\t\t<ng-container *ngSwitchCase=\"1\">\n\t\t\t\t\t\t<form [formGroup]=\"step2FormGroup\">\n\t\t\t\t\t\t\t<div cdsGrid>\n\t\t\t\t\t\t\t\t<div cdsRow>\n\t\t\t\t\t\t\t\t\t<h4>Create a new workspace</h4>\n\t\t\t\t\t\t\t\t\t<label class=\"form-label\">\n\t\t\t\t\t\t\t\t\t\tWhen you create a workspace, you connect IBM Cloud\n\t\t\t\t\t\t\t\t\t\tSchematics to existing Github / Gitlab repos that host\n\t\t\t\t\t\t\t\t\t\tyour Terraform templates.\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-label>\n\t\t\t\t\t\t\t\t\t\tWorkspace name\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tcdsText\n\t\t\t\t\t\t\t\t\t\t\t[autocomplete]=\"false\"\n\t\t\t\t\t\t\t\t\t\t\tformControlName=\"workspaceName\">\n\t\t\t\t\t\t\t\t\t</cds-label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-dropdown\n\t\t\t\t\t\t\t\t\t\tclass=\"dropdown\"\n\t\t\t\t\t\t\t\t\t\tlabel=\"Resource group\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"content\"\n\t\t\t\t\t\t\t\t\t\tformControlName=\"resourceGroup\"\n\t\t\t\t\t\t\t\t\t\t[dropUp]=\"false\">\n\t\t\t\t\t\t\t\t\t\t<cds-dropdown-list [items]=\"resourceGroups\"></cds-dropdown-list>\n\t\t\t\t\t\t\t\t\t</cds-dropdown>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-label>\n\t\t\t\t\t\t\t\t\t\tDescription (optional)\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\tcdsTextArea\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"What is the purpose of this workspace?\"\n\t\t\t\t\t\t\t\t\t\t\tformControlName=\"purpose\"\n\t\t\t\t\t\t\t\t\t\t\t[rows]=\"3\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"textarea\"></textarea>\n\t\t\t\t\t\t\t\t\t</cds-label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<button cdsButton (click)=\"changeStep(2)\">Step 3</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-container *ngSwitchCase=\"2\">\n\t\t\t\t\t\t<div cdsGrid>\n\t\t\t\t\t\t\t<div cdsRow>\n\t\t\t\t\t\t\t\tStep 3 form!\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t<button cdsButton (click)=\"changeStep(1)\">Step 2</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tstyles: [`\n\t\t.header {\n\t\t\tmargin-bottom: 5rem;\n\t\t}\n\n\t\t.indicator-wrapper {\n\t\t\tbackground-color: #f4f4f4;\n\t\t}\n\n\t\t.sub-heading {\n\t\t\tmargin-bottom: 1.5rem;\n\t\t}\n\n\t\t.indicator {\n\t\t\tmargin-top: 1rem;\n\t\t}\n\n\t\t.form-label {\n\t\t\tmargin-top: 0.7rem;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t}\n\n\t\t.dropdown {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t.form-item {\n\t\t\tmargin-top: 1.5rem;\n\t\t}\n\t`]\n})\nclass MultiStepFormStory implements OnInit, OnDestroy {\n\tpublic step2FormGroup: FormGroup;\n\n\tsteps = [\n\t\t{\n\t\t\
|
|
37218
|
+
"sourceCode": "import { Component, OnInit, OnDestroy } from \"@angular/core\";\nimport { moduleMetadata, Meta } from \"@storybook/angular\";\nimport { GridModule } from \"../../grid\";\nimport { UIShellModule } from \"../../ui-shell\";\nimport { DropdownModule } from \"../../dropdown\";\nimport { ButtonModule } from \"../../button\";\nimport { InputModule } from \"../../input\";\nimport { ProgressIndicatorModule } from \"../../progress-indicator\";\nimport { BreadcrumbModule } from \"../../breadcrumb\";\nimport {\n\tFormBuilder,\n\tFormControl,\n\tFormGroup,\n\tReactiveFormsModule\n} from \"@angular/forms\";\n\n@Component({\n\tselector: \"app-multi-step-form\",\n\ttemplate: `\n\t\t<div cdsGrid>\n\t\t\t<div cdsRow class=\"header\">\n\t\t\t\t<cds-header name=\"Patterns\">\n\t\t\t\t\t<cds-hamburger></cds-hamburger>\n\t\t\t\t</cds-header>\n\t\t\t</div>\n\t\t\t<div cdsRow>\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 8, 'md': 8, 'sm': 8}\">\n\t\t\t\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\t\t\t\tDashboard\n\t\t\t\t\t\t</cds-breadcrumb-item>\n\t\t\t\t\t</cds-breadcrumb>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div cdsRow class=\"sub-heading\">\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 8, 'md': 8, 'sm': 8}\">\n\t\t\t\t\t<h4>Vertical multi-step form</h4>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div cdsRow>\n\t\t\t\t<div\n\t\t\t\t\tcdsCol\n\t\t\t\t\t[columnNumbers]=\"{'lg': 2, 'md': 2, 'sm': 2}\"\n\t\t\t\t\tclass=\"indicator-wrapper\">\n\t\t\t\t\t<div class=\"indicator\">\n\t\t\t\t\t\t<cds-progress-indicator\n\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t[steps]=\"steps\"\n\t\t\t\t\t\t\t[current]=\"currentStep\">\n\t\t\t\t\t\t</cds-progress-indicator>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div cdsCol [columnNumbers]=\"{'lg': 6, 'md': 6, 'sm': 6}\" [ngSwitch]=\"currentStep\">\n\t\t\t\t\t<ng-container *ngSwitchCase=\"1\">\n\t\t\t\t\t\t<form [formGroup]=\"step2FormGroup\">\n\t\t\t\t\t\t\t<div cdsGrid>\n\t\t\t\t\t\t\t\t<div cdsRow>\n\t\t\t\t\t\t\t\t\t<h4>Create a new workspace</h4>\n\t\t\t\t\t\t\t\t\t<label class=\"form-label\">\n\t\t\t\t\t\t\t\t\t\tWhen you create a workspace, you connect IBM Cloud\n\t\t\t\t\t\t\t\t\t\tSchematics to existing Github / Gitlab repos that host\n\t\t\t\t\t\t\t\t\t\tyour Terraform templates.\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-label>\n\t\t\t\t\t\t\t\t\t\tWorkspace name\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tcdsText\n\t\t\t\t\t\t\t\t\t\t\t[autocomplete]=\"false\"\n\t\t\t\t\t\t\t\t\t\t\tformControlName=\"workspaceName\">\n\t\t\t\t\t\t\t\t\t</cds-label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-dropdown\n\t\t\t\t\t\t\t\t\t\tclass=\"dropdown\"\n\t\t\t\t\t\t\t\t\t\tlabel=\"Resource group\"\n\t\t\t\t\t\t\t\t\t\tvalue=\"content\"\n\t\t\t\t\t\t\t\t\t\tformControlName=\"resourceGroup\"\n\t\t\t\t\t\t\t\t\t\t[dropUp]=\"false\">\n\t\t\t\t\t\t\t\t\t\t<cds-dropdown-list [items]=\"resourceGroups\"></cds-dropdown-list>\n\t\t\t\t\t\t\t\t\t</cds-dropdown>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<cds-label>\n\t\t\t\t\t\t\t\t\t\tDescription (optional)\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\tcdsTextArea\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"What is the purpose of this workspace?\"\n\t\t\t\t\t\t\t\t\t\t\tformControlName=\"purpose\"\n\t\t\t\t\t\t\t\t\t\t\t[rows]=\"3\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"textarea\"></textarea>\n\t\t\t\t\t\t\t\t\t</cds-label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t\t<button cdsButton (click)=\"changeStep(2)\">Step 3</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-container *ngSwitchCase=\"2\">\n\t\t\t\t\t\t<div cdsGrid>\n\t\t\t\t\t\t\t<div cdsRow>\n\t\t\t\t\t\t\t\tStep 3 form!\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div cdsRow class=\"form-item\">\n\t\t\t\t\t\t\t\t<button cdsButton (click)=\"changeStep(1)\">Step 2</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`,\n\tstyles: [`\n\t\t.header {\n\t\t\tmargin-bottom: 5rem;\n\t\t}\n\n\t\t.indicator-wrapper {\n\t\t\tbackground-color: #f4f4f4;\n\t\t}\n\n\t\t.sub-heading {\n\t\t\tmargin-bottom: 1.5rem;\n\t\t}\n\n\t\t.indicator {\n\t\t\tmargin-top: 1rem;\n\t\t}\n\n\t\t.form-label {\n\t\t\tmargin-top: 0.7rem;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t}\n\n\t\t.dropdown {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t.form-item {\n\t\t\tmargin-top: 1.5rem;\n\t\t}\n\t`]\n})\nclass MultiStepFormStory implements OnInit, OnDestroy {\n\tpublic step2FormGroup: FormGroup;\n\n\tsteps = [\n\t\t{\n\t\t\tlabel: \"Step 1\",\n\t\t\tcomplete: true\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 2\",\n\t\t\tcurrent: true,\n\t\t\tcomplete: false\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 3\",\n\t\t\tcomplete: false,\n\t\t\tinvalid: true\n\t\t},\n\t\t{\n\t\t\tlabel: \"Step 4\",\n\t\t\tcomplete: false,\n\t\t\tsecondaryLabel: \"Optional\"\n\t\t}\n\t];\n\n\tresourceGroups = [\n\t\t{ content: \"None\" },\n\t\t{ content: \"Resource group 1\" },\n\t\t{ content: \"Resource group 2\" }\n\t];\n\n\tcurrentStep = 1;\n\n\tconstructor(protected formBuilder: FormBuilder) { }\n\n\tngOnInit() {\n\t\tdocument.querySelector(\".sb-show-main\")?.classList.add(\"full-page\");\n\n\t\tthis.step2FormGroup = this.formBuilder.group({\n\t\t\tworkspaceName: new FormControl(),\n\t\t\tresourceGroup: new FormControl(),\n\t\t\tpurpose: new FormControl()\n\t\t});\n\n\t\tthis.step2FormGroup.get(\"resourceGroup\")?.setValue(\"None\");\n\t}\n\n\tngOnDestroy() {\n\t\tdocument.querySelector(\".sb-show-main\")?.classList.remove(\"full-page\");\n\t}\n\n\tchangeStep(step: number) {\n\t\tthis.currentStep = step;\n\t}\n}\n\n// Storybook starts here\nexport default {\n\ttitle: \"Pattern/Forms\",\n\tdecorators: [\n\t\tmoduleMetadata({\n\t\t\tdeclarations: [ MultiStepFormStory ],\n\t\t\timports: [\n\t\t\t\tButtonModule,\n\t\t\t\tGridModule,\n\t\t\t\tUIShellModule,\n\t\t\t\tProgressIndicatorModule,\n\t\t\t\tBreadcrumbModule,\n\t\t\t\tReactiveFormsModule,\n\t\t\t\tInputModule,\n\t\t\t\tDropdownModule\n\t\t\t]\n\t\t})\n\t]\n} as Meta;\n\nconst Template = (args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\t\tapp-* components are for demo purposes only.\n\t\t\tYou can create your own implementation by using the component source as an example.\n\t\t-->\n\t\t<app-multi-step-form></app-multi-step-form>\n\t`\n});\nexport const MultiStep = Template.bind({});\n",
|
|
37199
37219
|
"assetsDirs": [],
|
|
37200
37220
|
"styleUrlsData": "",
|
|
37201
37221
|
"stylesData": "\n\t\t.header {\n\t\t\tmargin-bottom: 5rem;\n\t\t}\n\n\t\t.indicator-wrapper {\n\t\t\tbackground-color: #f4f4f4;\n\t\t}\n\n\t\t.sub-heading {\n\t\t\tmargin-bottom: 1.5rem;\n\t\t}\n\n\t\t.indicator {\n\t\t\tmargin-top: 1rem;\n\t\t}\n\n\t\t.form-label {\n\t\t\tmargin-top: 0.7rem;\n\t\t\tmargin-bottom: 0.5rem;\n\t\t}\n\n\t\t.dropdown {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t.form-item {\n\t\t\tmargin-top: 1.5rem;\n\t\t}\n\t\n",
|
|
@@ -37212,7 +37232,7 @@
|
|
|
37212
37232
|
"deprecationMessage": ""
|
|
37213
37233
|
}
|
|
37214
37234
|
],
|
|
37215
|
-
"line":
|
|
37235
|
+
"line": 179,
|
|
37216
37236
|
"jsdoctags": [
|
|
37217
37237
|
{
|
|
37218
37238
|
"name": "formBuilder",
|
|
@@ -66470,7 +66490,7 @@
|
|
|
66470
66490
|
},
|
|
66471
66491
|
{
|
|
66472
66492
|
"name": "TreeNodeComponent",
|
|
66473
|
-
"id": "component-TreeNodeComponent-
|
|
66493
|
+
"id": "component-TreeNodeComponent-c92ddc59f0218683e4fcc77e08c4981a5bc88974f90c94b24cb01d09b757cd6c980a04425f538445af59ba71061124b7ae89a54f150ba0dc68e78310c61879ce",
|
|
66474
66494
|
"file": "src/treeview/tree-node.component.ts",
|
|
66475
66495
|
"encapsulation": [],
|
|
66476
66496
|
"entryComponents": [],
|
|
@@ -66499,7 +66519,7 @@
|
|
|
66499
66519
|
"defaultValue": "[]",
|
|
66500
66520
|
"deprecated": false,
|
|
66501
66521
|
"deprecationMessage": "",
|
|
66502
|
-
"line":
|
|
66522
|
+
"line": 133,
|
|
66503
66523
|
"type": "Node[]",
|
|
66504
66524
|
"decorators": []
|
|
66505
66525
|
},
|
|
@@ -66510,7 +66530,7 @@
|
|
|
66510
66530
|
"deprecationMessage": "",
|
|
66511
66531
|
"rawdescription": "\n\nDetermines the depth of the node\nCalculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n",
|
|
66512
66532
|
"description": "<p>Determines the depth of the node\nCalculated by default when passing <code>Node</code> array to <code>TreeViewComponent</code>, manual entry required otherwise</p>\n",
|
|
66513
|
-
"line":
|
|
66533
|
+
"line": 139,
|
|
66514
66534
|
"type": "number",
|
|
66515
66535
|
"decorators": []
|
|
66516
66536
|
},
|
|
@@ -66532,6 +66552,15 @@
|
|
|
66532
66552
|
"type": "boolean",
|
|
66533
66553
|
"decorators": []
|
|
66534
66554
|
},
|
|
66555
|
+
{
|
|
66556
|
+
"name": "gap",
|
|
66557
|
+
"defaultValue": "0",
|
|
66558
|
+
"deprecated": false,
|
|
66559
|
+
"deprecationMessage": "",
|
|
66560
|
+
"line": 132,
|
|
66561
|
+
"type": "number",
|
|
66562
|
+
"decorators": []
|
|
66563
|
+
},
|
|
66535
66564
|
{
|
|
66536
66565
|
"name": "icon",
|
|
66537
66566
|
"deprecated": false,
|
|
@@ -66579,7 +66608,7 @@
|
|
|
66579
66608
|
"deprecationMessage": "",
|
|
66580
66609
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
66581
66610
|
"description": "<p>Simple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.</p>\n",
|
|
66582
|
-
"line":
|
|
66611
|
+
"line": 145,
|
|
66583
66612
|
"type": "Node",
|
|
66584
66613
|
"decorators": []
|
|
66585
66614
|
},
|
|
@@ -66607,7 +66636,7 @@
|
|
|
66607
66636
|
"defaultValue": "new EventEmitter()",
|
|
66608
66637
|
"deprecated": false,
|
|
66609
66638
|
"deprecationMessage": "",
|
|
66610
|
-
"line":
|
|
66639
|
+
"line": 168,
|
|
66611
66640
|
"type": "EventEmitter"
|
|
66612
66641
|
},
|
|
66613
66642
|
{
|
|
@@ -66615,7 +66644,7 @@
|
|
|
66615
66644
|
"defaultValue": "new EventEmitter()",
|
|
66616
66645
|
"deprecated": false,
|
|
66617
66646
|
"deprecationMessage": "",
|
|
66618
|
-
"line":
|
|
66647
|
+
"line": 167,
|
|
66619
66648
|
"type": "EventEmitter"
|
|
66620
66649
|
},
|
|
66621
66650
|
{
|
|
@@ -66623,7 +66652,7 @@
|
|
|
66623
66652
|
"defaultValue": "new EventEmitter()",
|
|
66624
66653
|
"deprecated": false,
|
|
66625
66654
|
"deprecationMessage": "",
|
|
66626
|
-
"line":
|
|
66655
|
+
"line": 169,
|
|
66627
66656
|
"type": "EventEmitter"
|
|
66628
66657
|
},
|
|
66629
66658
|
{
|
|
@@ -66631,7 +66660,7 @@
|
|
|
66631
66660
|
"defaultValue": "new EventEmitter()",
|
|
66632
66661
|
"deprecated": false,
|
|
66633
66662
|
"deprecationMessage": "",
|
|
66634
|
-
"line":
|
|
66663
|
+
"line": 170,
|
|
66635
66664
|
"type": "EventEmitter"
|
|
66636
66665
|
}
|
|
66637
66666
|
],
|
|
@@ -66643,7 +66672,7 @@
|
|
|
66643
66672
|
"type": "",
|
|
66644
66673
|
"optional": false,
|
|
66645
66674
|
"description": "",
|
|
66646
|
-
"line":
|
|
66675
|
+
"line": 172
|
|
66647
66676
|
},
|
|
66648
66677
|
{
|
|
66649
66678
|
"name": "treeNodeCount",
|
|
@@ -66666,7 +66695,7 @@
|
|
|
66666
66695
|
"optional": false,
|
|
66667
66696
|
"returnType": "number",
|
|
66668
66697
|
"typeParameters": [],
|
|
66669
|
-
"line":
|
|
66698
|
+
"line": 221,
|
|
66670
66699
|
"deprecated": false,
|
|
66671
66700
|
"deprecationMessage": "",
|
|
66672
66701
|
"rawdescription": "\n\nCalculate the node offset\n",
|
|
@@ -66674,8 +66703,8 @@
|
|
|
66674
66703
|
"jsdoctags": [
|
|
66675
66704
|
{
|
|
66676
66705
|
"tagName": {
|
|
66677
|
-
"pos":
|
|
66678
|
-
"end":
|
|
66706
|
+
"pos": 6114,
|
|
66707
|
+
"end": 6121,
|
|
66679
66708
|
"flags": 16842752,
|
|
66680
66709
|
"modifierFlagsCache": 0,
|
|
66681
66710
|
"transformFlags": 0,
|
|
@@ -66699,7 +66728,7 @@
|
|
|
66699
66728
|
"optional": false,
|
|
66700
66729
|
"returnType": "void",
|
|
66701
66730
|
"typeParameters": [],
|
|
66702
|
-
"line":
|
|
66731
|
+
"line": 244,
|
|
66703
66732
|
"deprecated": false,
|
|
66704
66733
|
"deprecationMessage": "",
|
|
66705
66734
|
"jsdoctags": [
|
|
@@ -66727,7 +66756,7 @@
|
|
|
66727
66756
|
"optional": false,
|
|
66728
66757
|
"returnType": "void",
|
|
66729
66758
|
"typeParameters": [],
|
|
66730
|
-
"line":
|
|
66759
|
+
"line": 240,
|
|
66731
66760
|
"deprecated": false,
|
|
66732
66761
|
"deprecationMessage": "",
|
|
66733
66762
|
"jsdoctags": [
|
|
@@ -66748,7 +66777,7 @@
|
|
|
66748
66777
|
"optional": false,
|
|
66749
66778
|
"returnType": "any",
|
|
66750
66779
|
"typeParameters": [],
|
|
66751
|
-
"line":
|
|
66780
|
+
"line": 291,
|
|
66752
66781
|
"deprecated": false,
|
|
66753
66782
|
"deprecationMessage": "",
|
|
66754
66783
|
"modifierKind": [
|
|
@@ -66768,7 +66797,7 @@
|
|
|
66768
66797
|
"optional": false,
|
|
66769
66798
|
"returnType": "boolean",
|
|
66770
66799
|
"typeParameters": [],
|
|
66771
|
-
"line":
|
|
66800
|
+
"line": 287,
|
|
66772
66801
|
"deprecated": false,
|
|
66773
66802
|
"deprecationMessage": "",
|
|
66774
66803
|
"modifierKind": [
|
|
@@ -66799,7 +66828,7 @@
|
|
|
66799
66828
|
"optional": false,
|
|
66800
66829
|
"returnType": "void",
|
|
66801
66830
|
"typeParameters": [],
|
|
66802
|
-
"line":
|
|
66831
|
+
"line": 264,
|
|
66803
66832
|
"deprecated": false,
|
|
66804
66833
|
"deprecationMessage": "",
|
|
66805
66834
|
"rawdescription": "\n\nManages the keyboard accessibility for children expansion & selection\n",
|
|
@@ -66829,7 +66858,7 @@
|
|
|
66829
66858
|
"optional": false,
|
|
66830
66859
|
"returnType": "void",
|
|
66831
66860
|
"typeParameters": [],
|
|
66832
|
-
"line":
|
|
66861
|
+
"line": 207,
|
|
66833
66862
|
"deprecated": false,
|
|
66834
66863
|
"deprecationMessage": "",
|
|
66835
66864
|
"rawdescription": "\n\nSelects the node and emits the event from the tree view component\n",
|
|
@@ -66837,8 +66866,8 @@
|
|
|
66837
66866
|
"jsdoctags": [
|
|
66838
66867
|
{
|
|
66839
66868
|
"name": {
|
|
66840
|
-
"pos":
|
|
66841
|
-
"end":
|
|
66869
|
+
"pos": 5761,
|
|
66870
|
+
"end": 5766,
|
|
66842
66871
|
"flags": 16842752,
|
|
66843
66872
|
"modifierFlagsCache": 0,
|
|
66844
66873
|
"transformFlags": 0,
|
|
@@ -66849,8 +66878,8 @@
|
|
|
66849
66878
|
"deprecated": false,
|
|
66850
66879
|
"deprecationMessage": "",
|
|
66851
66880
|
"tagName": {
|
|
66852
|
-
"pos":
|
|
66853
|
-
"end":
|
|
66881
|
+
"pos": 5755,
|
|
66882
|
+
"end": 5760,
|
|
66854
66883
|
"flags": 16842752,
|
|
66855
66884
|
"modifierFlagsCache": 0,
|
|
66856
66885
|
"transformFlags": 0,
|
|
@@ -66874,7 +66903,7 @@
|
|
|
66874
66903
|
"optional": false,
|
|
66875
66904
|
"returnType": "void",
|
|
66876
66905
|
"typeParameters": [],
|
|
66877
|
-
"line":
|
|
66906
|
+
"line": 252,
|
|
66878
66907
|
"deprecated": false,
|
|
66879
66908
|
"deprecationMessage": "",
|
|
66880
66909
|
"rawdescription": "\n\nExpand children if not disabled\n",
|
|
@@ -66882,8 +66911,8 @@
|
|
|
66882
66911
|
"jsdoctags": [
|
|
66883
66912
|
{
|
|
66884
66913
|
"name": {
|
|
66885
|
-
"pos":
|
|
66886
|
-
"end":
|
|
66914
|
+
"pos": 6800,
|
|
66915
|
+
"end": 6805,
|
|
66887
66916
|
"flags": 16842752,
|
|
66888
66917
|
"modifierFlagsCache": 0,
|
|
66889
66918
|
"transformFlags": 0,
|
|
@@ -66894,8 +66923,8 @@
|
|
|
66894
66923
|
"deprecated": false,
|
|
66895
66924
|
"deprecationMessage": "",
|
|
66896
66925
|
"tagName": {
|
|
66897
|
-
"pos":
|
|
66898
|
-
"end":
|
|
66926
|
+
"pos": 6794,
|
|
66927
|
+
"end": 6799,
|
|
66899
66928
|
"flags": 16842752,
|
|
66900
66929
|
"modifierFlagsCache": 0,
|
|
66901
66930
|
"transformFlags": 0,
|
|
@@ -66916,7 +66945,7 @@
|
|
|
66916
66945
|
"description": "",
|
|
66917
66946
|
"rawdescription": "\n",
|
|
66918
66947
|
"type": "component",
|
|
66919
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tOnInit,\n\tOnDestroy,\n\tAfterContentInit,\n\tTemplateRef,\n\tAfterContentChecked\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { TreeViewService } from \"./treeview.service\";\nimport { Node } from \"./tree-node.types\";\n\n@Component({\n\tselector: \"cds-tree-node\",\n\ttemplate: `\n\t\t<div\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--tree-node\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree-node--active': active,\n\t\t\t\t'cds--tree-node--disabled': disabled,\n\t\t\t\t'cds--tree-node--selected': selected,\n\t\t\t\t'cds--tree-leaf-node': !children.length,\n\t\t\t\t'cds--tree-parent-node': children.length,\n\t\t\t\t'cds--tree-node--with-icon': icon\n\t\t\t}\"\n\t\t\t[attr.aria-expanded]=\"expanded || null\"\n\t\t\t[attr.aria-current]=\"active || null\"\n\t\t\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\trole=\"treeitem\"\n\t\t\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t\t\t(focus)=\"emitFocusEvent($event)\"\n\t\t\t(blur)=\"emitBlurEvent($event)\"\n\t\t\t(keydown)=\"navigateTree($event)\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"!children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<!-- Icon -->\n\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template\n\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\trole=\"group\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"expanded\"\n\t\t\t\trole=\"group\"\n\t\t\t\tclass=\"cds--tree-node__children\">\n\t\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #notProjected>\n\t\t\t\t\t<cds-tree-node\n\t\t\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t\t\t[node]=\"childNode\"\n\t\t\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t\t\t[disabled]=\"disabled\">\n\t\t\t\t\t</cds-tree-node>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`\n})\nexport class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy {\n\tstatic treeNodeCount = 0;\n\t@Input() id = `tree-node-${TreeNodeComponent.treeNodeCount++}`;\n\t@Input() active = false;\n\t@Input() disabled = false;\n\t@Input() expanded = false;\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() labelContext: any;\n\t@Input() selected = false;\n\t@Input() value;\n\t@Input() icon: string | TemplateRef<any>;\n\t@Input() iconContext: any;\n\t@Input() children: Node[] = [];\n\n\t/**\n\t * Determines the depth of the node\n\t * Calculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n\t */\n\t@Input() depth = 0;\n\n\t/**\n\t * Simple way to set all attributes of Node component via node object\n\t * Would simplify setting component attributes when dynamically rendering node.\n\t */\n\t@Input() set node(node: Node) {\n\t\tthis._node = node;\n\n\t\tthis.id = node.id ?? this.id;\n\t\tthis.active = node.active ?? this.active;\n\t\tthis.disabled = node.disabled ?? this.disabled;\n\t\tthis.expanded = node.expanded ?? this.expanded;\n\t\tthis.label = node.label ?? this.label;\n\t\tthis.labelContext = node.labelContext ?? this.labelContext;\n\t\tthis.value = node.value ?? this.value;\n\t\tthis.icon = node.icon ?? this.icon;\n\t\tthis.selected = node.selected ?? this.selected;\n\t\tthis.depth = node.depth ?? this.depth;\n\t\tthis.children = node.children ?? this.children;\n\t\tthis.iconContext = node.iconText ?? this.iconContext;\n\t}\n\n\tget node() {\n\t\treturn this._node;\n\t}\n\n\t@Output() nodeFocus = new EventEmitter();\n\t@Output() nodeBlur = new EventEmitter();\n\t@Output() nodeSelect = new EventEmitter();\n\t@Output() nodetoggle = new EventEmitter();\n\n\toffset;\n\tprivate _node;\n\tprivate subscription: Subscription;\n\n\tconstructor(private treeViewService: TreeViewService) {}\n\n\t/**\n\t * Caclulate offset for margin/padding\n\t */\n\tngAfterContentChecked(): void {\n\t\tthis.offset = this.calculateOffset();\n\t}\n\n\t/**\n\t * Highlight the node\n\t */\n\tngOnInit(): void {\n\t\t// Highlight the node\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((value: Map<string, Node>) => {\n\t\t\tthis.selected = value.has(this.id);\n\t\t\tthis.active = this.selected;\n\t\t});\n\t}\n\n\t/**\n\t * Unsubscribe from subscriptions\n\t */\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\t/**\n\t * Selects the node and emits the event from the tree view component\n\t * @param event\n\t */\n\tnodeClick(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.selected = true;\n\t\t\tthis.active = true;\n\t\t\tevent.target.parentElement.focus();\n\t\t\t// Passes event to all nodes to update highlighting & parent to emit\n\t\t\tthis.treeViewService.selectNode({ id: this.id, label: this.label, value: this.value });\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the node offset\n\t * @returns Number\n\t */\n\tcalculateOffset() {\n\t\t// Parent node with icon\n\t\tif (this.children.length && this.icon) {\n\t\t\treturn this.depth + 1 + this.depth * 0.5;\n\t\t}\n\n\t\t// parent node without icon\n\t\tif (this.children.length) {\n\t\t\treturn this.depth + 1;\n\t\t}\n\n\t\t// leaf node with icon\n\t\tif (this.icon) {\n\t\t\treturn this.depth + 2 + this.depth * 0.5;\n\t\t}\n\n\t\treturn this.depth + 2.5;\n\t}\n\n\temitFocusEvent(event) {\n\t\tthis.nodeFocus.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\temitBlurEvent(event) {\n\t\tthis.nodeBlur.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\t/**\n\t * Expand children if not disabled\n\t * @param event: Event\n\t */\n\ttoggleExpanded(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.nodetoggle.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t\t\tthis.expanded = !this.expanded;\n\t\t\t// Prevent selection of the node\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for children expansion & selection\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\" || event.key === \"Enter\") {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\t// Unexpand\n\t\tif (event.key === \"ArrowLeft\") {\n\t\t\tif (this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"ArrowRight\") {\n\t\t\tif (!this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.nodeClick(event);\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n}\n",
|
|
66948
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tOnInit,\n\tOnDestroy,\n\tAfterContentInit,\n\tTemplateRef,\n\tAfterContentChecked\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { TreeViewService } from \"./treeview.service\";\nimport { Node } from \"./tree-node.types\";\n\n@Component({\n\tselector: \"cds-tree-node\",\n\ttemplate: `\n\t\t<div\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--tree-node\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree-node--active': active,\n\t\t\t\t'cds--tree-node--disabled': disabled,\n\t\t\t\t'cds--tree-node--selected': selected,\n\t\t\t\t'cds--tree-leaf-node': !children.length,\n\t\t\t\t'cds--tree-parent-node': children.length,\n\t\t\t\t'cds--tree-node--with-icon': icon\n\t\t\t}\"\n\t\t\t[attr.aria-expanded]=\"expanded || null\"\n\t\t\t[attr.aria-current]=\"active || null\"\n\t\t\t[attr.aria-selected]=\"disabled ? null : selected\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\trole=\"treeitem\"\n\t\t\t[attr.tabindex]=\"selected ? 0 : -1\"\n\t\t\t(focus)=\"emitFocusEvent($event)\"\n\t\t\t(blur)=\"emitBlurEvent($event)\"\n\t\t\t(keydown)=\"navigateTree($event)\">\n\t\t\t<div\n\t\t\t\t*ngIf=\"!children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<!-- Icon -->\n\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template *ngIf=\"isTemplate(icon)\" [ngTemplateOutlet]=\"icon\"></ng-template>\n\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t<ng-template\n\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"children.length\"\n\t\t\t\tclass=\"cds--tree-node__label\"\n\t\t\t\t[style.padding-inline-start.rem]=\"offset\"\n\t\t\t\t[style.margin-inline-start.rem]=\"-offset\"\n\t\t\t\trole=\"group\"\n\t\t\t\t(click)=\"nodeClick($event)\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"cds--tree-parent-node__toggle\"\n\t\t\t\t\t[attr.disabled]=\"disabled || null\"\n\t\t\t\t\t(click)=\"toggleExpanded($event)\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"cds--tree-parent-node__toggle-icon\"\n\t\t\t\t\t\t[ngClass]=\"{'cds--tree-parent-node__toggle-icon--expanded' : expanded}\"\n\t\t\t\t\t\tibmIcon=\"caret--down\"\n\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t\t<span class=\"cds--tree-node__label__details\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<ng-container *ngIf=\"icon && !isTemplate(icon)\">\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tclass=\"cds--tree-node__icon\"\n\t\t\t\t\t\t\t[cdsIcon]=\"icon\"\n\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(icon)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"icon\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: iconContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\t*ngIf=\"expanded\"\n\t\t\t\trole=\"group\"\n\t\t\t\tclass=\"cds--tree-node__children\">\n\t\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #notProjected>\n\t\t\t\t\t<cds-tree-node\n\t\t\t\t\t\t*ngFor=\"let childNode of children\"\n\t\t\t\t\t\t[node]=\"childNode\"\n\t\t\t\t\t\t[depth]=\"depth + 1\"\n\t\t\t\t\t\t[disabled]=\"disabled\">\n\t\t\t\t\t</cds-tree-node>\n\t\t\t\t</ng-template>\n\t\t\t</div>\n\t\t</div>\n\t`\n})\nexport class TreeNodeComponent implements AfterContentChecked, OnInit, OnDestroy {\n\tstatic treeNodeCount = 0;\n\t@Input() id = `tree-node-${TreeNodeComponent.treeNodeCount++}`;\n\t@Input() active = false;\n\t@Input() disabled = false;\n\t@Input() expanded = false;\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() labelContext: any;\n\t@Input() selected = false;\n\t@Input() value;\n\t@Input() icon: string | TemplateRef<any>;\n\t@Input() iconContext: any;\n\t@Input() gap = 0;\n\t@Input() children: Node[] = [];\n\n\t/**\n\t * Determines the depth of the node\n\t * Calculated by default when passing `Node` array to `TreeViewComponent`, manual entry required otherwise\n\t */\n\t@Input() depth = 0;\n\n\t/**\n\t * Simple way to set all attributes of Node component via node object\n\t * Would simplify setting component attributes when dynamically rendering node.\n\t */\n\t@Input() set node(node: Node) {\n\t\tthis._node = node;\n\n\t\tthis.id = node.id ?? this.id;\n\t\tthis.active = node.active ?? this.active;\n\t\tthis.disabled = node.disabled ?? this.disabled;\n\t\tthis.expanded = node.expanded ?? this.expanded;\n\t\tthis.label = node.label ?? this.label;\n\t\tthis.labelContext = node.labelContext ?? this.labelContext;\n\t\tthis.value = node.value ?? this.value;\n\t\tthis.icon = node.icon ?? this.icon;\n\t\tthis.selected = node.selected ?? this.selected;\n\t\tthis.depth = node.depth ?? this.depth;\n\t\tthis.gap = node.gap ?? this.gap;\n\t\tthis.children = node.children ?? this.children;\n\t\tthis.iconContext = node.iconText ?? this.iconContext;\n\t}\n\n\tget node() {\n\t\treturn this._node;\n\t}\n\n\t@Output() nodeFocus = new EventEmitter();\n\t@Output() nodeBlur = new EventEmitter();\n\t@Output() nodeSelect = new EventEmitter();\n\t@Output() nodetoggle = new EventEmitter();\n\n\toffset;\n\tprivate _node;\n\tprivate subscription: Subscription;\n\n\tconstructor(private treeViewService: TreeViewService) {}\n\n\t/**\n\t * Caclulate offset for margin/padding\n\t */\n\tngAfterContentChecked(): void {\n\t\tthis.offset = this.calculateOffset();\n\t}\n\n\t/**\n\t * Highlight the node\n\t */\n\tngOnInit(): void {\n\t\t// Highlight the node\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((value: Map<string, Node>) => {\n\t\t\tthis.selected = value.has(this.id);\n\t\t\tthis.active = this.selected;\n\t\t});\n\t}\n\n\t/**\n\t * Unsubscribe from subscriptions\n\t */\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\t/**\n\t * Selects the node and emits the event from the tree view component\n\t * @param event\n\t */\n\tnodeClick(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.selected = true;\n\t\t\tthis.active = true;\n\t\t\tevent.target.parentElement.focus();\n\t\t\t// Passes event to all nodes to update highlighting & parent to emit\n\t\t\tthis.treeViewService.selectNode({ id: this.id, label: this.label, value: this.value });\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the node offset\n\t * @returns Number\n\t */\n\tcalculateOffset() {\n\t\t// Parent node with icon\n\t\tif (this.children.length && this.icon) {\n\t\t\treturn this.depth + 1 + this.depth * 0.5;\n\t\t}\n\n\t\t// parent node without icon\n\t\tif (this.children.length) {\n\t\t\treturn this.depth + 1;\n\t\t}\n\n\t\t// leaf node with icon\n\t\tif (this.icon) {\n\t\t\treturn this.depth + 2 + this.depth * 0.5;\n\t\t}\n\n\t\treturn this.depth + this.gap + 2.5;\n\t}\n\n\temitFocusEvent(event) {\n\t\tthis.nodeFocus.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\temitBlurEvent(event) {\n\t\tthis.nodeBlur.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t}\n\n\t/**\n\t * Expand children if not disabled\n\t * @param event: Event\n\t */\n\ttoggleExpanded(event) {\n\t\tif (!this.disabled) {\n\t\t\tthis.nodetoggle.emit({ node: { id: this.id, label: this.label, value: this.value }, event });\n\t\t\tthis.expanded = !this.expanded;\n\t\t\t// Prevent selection of the node\n\t\t\tevent.stopPropagation();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for children expansion & selection\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\" || event.key === \"Enter\") {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\t// Unexpand\n\t\tif (event.key === \"ArrowLeft\") {\n\t\t\tif (this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"ArrowRight\") {\n\t\t\tif (!this.expanded && this.children) {\n\t\t\t\tthis.toggleExpanded(event);\n\t\t\t}\n\t\t}\n\n\t\tif (event.key === \"Enter\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.nodeClick(event);\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n}\n",
|
|
66920
66949
|
"assetsDirs": [],
|
|
66921
66950
|
"styleUrlsData": "",
|
|
66922
66951
|
"stylesData": "",
|
|
@@ -66933,7 +66962,7 @@
|
|
|
66933
66962
|
"deprecationMessage": ""
|
|
66934
66963
|
}
|
|
66935
66964
|
],
|
|
66936
|
-
"line":
|
|
66965
|
+
"line": 174,
|
|
66937
66966
|
"jsdoctags": [
|
|
66938
66967
|
{
|
|
66939
66968
|
"name": "treeViewService",
|
|
@@ -66969,7 +66998,7 @@
|
|
|
66969
66998
|
}
|
|
66970
66999
|
],
|
|
66971
67000
|
"returnType": "void",
|
|
66972
|
-
"line":
|
|
67001
|
+
"line": 145,
|
|
66973
67002
|
"rawdescription": "\n\nSimple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.\n",
|
|
66974
67003
|
"description": "<p>Simple way to set all attributes of Node component via node object\nWould simplify setting component attributes when dynamically rendering node.</p>\n",
|
|
66975
67004
|
"jsdoctags": [
|
|
@@ -66988,14 +67017,14 @@
|
|
|
66988
67017
|
"name": "node",
|
|
66989
67018
|
"type": "",
|
|
66990
67019
|
"returnType": "",
|
|
66991
|
-
"line":
|
|
67020
|
+
"line": 163
|
|
66992
67021
|
}
|
|
66993
67022
|
}
|
|
66994
67023
|
}
|
|
66995
67024
|
},
|
|
66996
67025
|
{
|
|
66997
67026
|
"name": "TreeViewComponent",
|
|
66998
|
-
"id": "component-TreeViewComponent-
|
|
67027
|
+
"id": "component-TreeViewComponent-9b6130f78321359e71f56d2044bb1ed7d588faff0561c87756d1f591288e94fb45666b6e97d4edf883c7f4984fba82bcb92d55a211c507f20e64b097f855b0cb",
|
|
66999
67028
|
"file": "src/treeview/treeview.component.ts",
|
|
67000
67029
|
"encapsulation": [],
|
|
67001
67030
|
"entryComponents": [],
|
|
@@ -67197,8 +67226,8 @@
|
|
|
67197
67226
|
"jsdoctags": [
|
|
67198
67227
|
{
|
|
67199
67228
|
"name": {
|
|
67200
|
-
"pos":
|
|
67201
|
-
"end":
|
|
67229
|
+
"pos": 3986,
|
|
67230
|
+
"end": 3991,
|
|
67202
67231
|
"flags": 16842752,
|
|
67203
67232
|
"modifierFlagsCache": 0,
|
|
67204
67233
|
"transformFlags": 0,
|
|
@@ -67209,8 +67238,8 @@
|
|
|
67209
67238
|
"deprecated": false,
|
|
67210
67239
|
"deprecationMessage": "",
|
|
67211
67240
|
"tagName": {
|
|
67212
|
-
"pos":
|
|
67213
|
-
"end":
|
|
67241
|
+
"pos": 3980,
|
|
67242
|
+
"end": 3985,
|
|
67214
67243
|
"flags": 16842752,
|
|
67215
67244
|
"modifierFlagsCache": 0,
|
|
67216
67245
|
"transformFlags": 0,
|
|
@@ -67231,7 +67260,7 @@
|
|
|
67231
67260
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { TreeviewModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-tree-view--basic\">See demo</a></p>\n",
|
|
67232
67261
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { TreeviewModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-tree-view--basic)\n",
|
|
67233
67262
|
"type": "component",
|
|
67234
|
-
"sourceCode": "import { DOCUMENT } from \"@angular/common\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tTemplateRef,\n\tEventEmitter,\n\tAfterViewInit,\n\tInject,\n\tViewChild,\n\tElementRef,\n\tOnInit,\n\tOnDestroy\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { Node } from \"./tree-node.types\";\nimport { TreeViewService } from \"./treeview.service\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TreeviewModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tree-view--basic)\n */\n@Component({\n\tselector: \"cds-tree-view\",\n\ttemplate: `\n\t\t<label\n\t\t\t*ngIf=\"label\"\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--tree\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree--sm': size === 'sm',\n\t\t\t\t'cds--tree--xs': size === 'xs'\n\t\t\t}\"\n\t\t\t[attr.aria-label]=\"label ? label : null\"\n\t\t\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t\t\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\t\t\trole=\"tree\"\n\t\t\t(keydown)=\"navigateTree($event)\"\n\t\t\t#treeWrapper>\n\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-container>\n\t\t\t<ng-template #notProjected>\n\t\t\t\t<cds-tree-node\n\t\t\t\t\t*ngFor=\"let node of tree\"\n\t\t\t\t\t[node]=\"node\">\n\t\t\t\t</cds-tree-node>\n\t\t\t</ng-template>\n\t\t</div>\n\t`,\n\tproviders: [TreeViewService]\n})\nexport class TreeViewComponent implements AfterViewInit, OnInit, OnDestroy {\n\t/**\n\t * Pass `Node[]` array to have tree view render the nodes\n\t * Passing value will disregard projected content\n\t */\n\t@Input() set tree(treeNodes: Node[]) {\n\t\tthis._tree = treeNodes.map((node) =>
|
|
67263
|
+
"sourceCode": "import { DOCUMENT } from \"@angular/common\";\nimport {\n\tComponent,\n\tInput,\n\tOutput,\n\tTemplateRef,\n\tEventEmitter,\n\tAfterViewInit,\n\tInject,\n\tViewChild,\n\tElementRef,\n\tOnInit,\n\tOnDestroy\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { Node } from \"./tree-node.types\";\nimport { TreeViewService } from \"./treeview.service\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TreeviewModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tree-view--basic)\n */\n@Component({\n\tselector: \"cds-tree-view\",\n\ttemplate: `\n\t\t<label\n\t\t\t*ngIf=\"label\"\n\t\t\t[id]=\"id\"\n\t\t\tclass=\"cds--label\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"isTemplate(label)\"\n\t\t\t\t[ngTemplateOutlet]=\"label\"\n\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: labelContext }\">\n\t\t\t</ng-template>\n\t\t</label>\n\t\t<div\n\t\t\tclass=\"cds--tree\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--tree--sm': size === 'sm',\n\t\t\t\t'cds--tree--xs': size === 'xs'\n\t\t\t}\"\n\t\t\t[attr.aria-label]=\"label ? label : null\"\n\t\t\t[attr.aria-labelledby]=\"!label ? id : null\"\n\t\t\t[attr.aria-multiselectable]=\"isMultiSelect || null\"\n\t\t\trole=\"tree\"\n\t\t\t(keydown)=\"navigateTree($event)\"\n\t\t\t#treeWrapper>\n\t\t\t<ng-container *ngIf=\"isProjected(); else notProjected\">\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-container>\n\t\t\t<ng-template #notProjected>\n\t\t\t\t<cds-tree-node\n\t\t\t\t\t*ngFor=\"let node of tree\"\n\t\t\t\t\t[node]=\"node\">\n\t\t\t\t</cds-tree-node>\n\t\t\t</ng-template>\n\t\t</div>\n\t`,\n\tproviders: [TreeViewService]\n})\nexport class TreeViewComponent implements AfterViewInit, OnInit, OnDestroy {\n\t/**\n\t * Pass `Node[]` array to have tree view render the nodes\n\t * Passing value will disregard projected content\n\t */\n\t@Input() set tree(treeNodes: Node[]) {\n\t\tthis._tree = treeNodes.map((node) => this.copyNode(node));\n\t\tthis.treeViewService.contentProjected = false;\n\t}\n\n\tget tree() {\n\t\treturn this._tree;\n\t}\n\n\tstatic treeViewCount = 0;\n\n\t@Input() id = `tree-view-${TreeViewComponent.treeViewCount++}`;\n\t/**\n\t * Tree view label\n\t */\n\t@Input() label: string | TemplateRef<any>;\n\t/**\n\t * Optional context for label if it's a template\n\t */\n\t@Input() labelContext: any;\n\t/**\n\t * Specify the size of the list items in the tree\n\t */\n\t@Input() size: \"xs\" | \"sm\" = \"sm\";\n\t/**\n\t * **Experimental** - Enable to select multiple nodes\n\t */\n\t@Input() set isMultiSelect(isMulti: boolean) {\n\t\tthis.treeViewService.isMultiSelect = isMulti;\n\t}\n\n\t@Output() select = new EventEmitter<Node | Node[]>();\n\t@ViewChild(\"treeWrapper\") root: ElementRef;\n\n\tprivate treeWalker: TreeWalker;\n\tprivate _tree: Node[] = [];\n\tprivate subscription: Subscription;\n\n\tconstructor(\n\t\t@Inject(DOCUMENT) private document: Document,\n\t\tpublic treeViewService: TreeViewService,\n\t\tprivate elementRef: ElementRef\n\t) {}\n\n\t/**\n\t * Subscribe for node selection\n\t */\n\tngOnInit(): void {\n\t\tthis.subscription = this.treeViewService.selectionObservable.subscribe((nodesMap: Map<string, Node>) => {\n\t\t\t// Get all values from the map to emit\n\t\t\tconst nodes = [...nodesMap.values()];\n\n\t\t\t// Update focus to reset arrow key traversal\n\t\t\t// Select the current highlight node as the last node, since we preserve order in map\n\t\t\tthis.treeWalker.currentNode = this.elementRef.nativeElement.querySelector(`#${CSS.escape(nodes[nodes.length - 1].id)}`);\n\t\t\tthis.select.emit(this.treeViewService.isMultiSelect ? nodes : nodes[0]);\n\t\t});\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscription.unsubscribe();\n\t}\n\n\t/**\n\t * Initialize tree walker to support keyboard navigation\n\t */\n\tngAfterViewInit(): void {\n\t\tthis.treeWalker = this.document.createTreeWalker(this.root.nativeElement, NodeFilter.SHOW_ELEMENT, {\n\t\t\tacceptNode: function (node: HTMLElement) {\n\t\t\t\tif (node.classList.contains(`cds--tree-node--disabled`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_REJECT;\n\t\t\t\t}\n\t\t\t\tif (node.matches(`div.cds--tree-node`)) {\n\t\t\t\t\treturn NodeFilter.FILTER_ACCEPT;\n\t\t\t\t}\n\t\t\t\treturn NodeFilter.FILTER_SKIP;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Navigate tree using tree walker\n\t * @param event - KeyboardEvent\n\t */\n\tnavigateTree(event: KeyboardEvent) {\n\t\tif (event.key === \"ArrowUp\") {\n\t\t\t(this.treeWalker.previousNode() as HTMLElement)?.focus();\n\t\t}\n\n\t\tif (event.key === \"ArrowDown\") {\n\t\t\t(this.treeWalker.nextNode() as HTMLElement)?.focus();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tpublic isProjected() {\n\t\treturn this.treeViewService.contentProjected;\n\t}\n\n\tprivate copyNode(node: Node): Node {\n\t\t// making a recursive shallow copy to avoid performance issues when deeply cloning templateRefs if defined in the node\n\t\tconst copiedNode = Object.assign({}, node);\n\t\tif (node.children) {\n\t\t copiedNode.children = node.children.map(child => this.copyNode(child));\n\t\t}\n\t\treturn copiedNode;\n\t}\n}\n",
|
|
67235
67264
|
"assetsDirs": [],
|
|
67236
67265
|
"styleUrlsData": "",
|
|
67237
67266
|
"stylesData": "",
|
|
@@ -72791,7 +72820,7 @@
|
|
|
72791
72820
|
"deprecated": false,
|
|
72792
72821
|
"deprecationMessage": "",
|
|
72793
72822
|
"type": "",
|
|
72794
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
72823
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
72795
72824
|
},
|
|
72796
72825
|
{
|
|
72797
72826
|
"name": "MultiTemplate",
|
|
@@ -73916,7 +73945,7 @@
|
|
|
73916
73945
|
"deprecated": false,
|
|
73917
73946
|
"deprecationMessage": "",
|
|
73918
73947
|
"type": "",
|
|
73919
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
73948
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
73920
73949
|
},
|
|
73921
73950
|
{
|
|
73922
73951
|
"name": "Template",
|
|
@@ -78080,7 +78109,7 @@
|
|
|
78080
78109
|
"deprecated": false,
|
|
78081
78110
|
"deprecationMessage": "",
|
|
78082
78111
|
"type": "",
|
|
78083
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
78112
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
78084
78113
|
},
|
|
78085
78114
|
{
|
|
78086
78115
|
"name": "ReactiveForms",
|
|
@@ -78110,7 +78139,7 @@
|
|
|
78110
78139
|
"deprecated": false,
|
|
78111
78140
|
"deprecationMessage": "",
|
|
78112
78141
|
"type": "",
|
|
78113
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
78142
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
78114
78143
|
}
|
|
78115
78144
|
],
|
|
78116
78145
|
"src/content-switcher/content-switcher.stories.ts": [
|
|
@@ -83208,7 +83237,7 @@
|
|
|
83208
83237
|
"linktype": "component",
|
|
83209
83238
|
"name": "ComboBox",
|
|
83210
83239
|
"coveragePercent": 68,
|
|
83211
|
-
"coverageCount": "
|
|
83240
|
+
"coverageCount": "50/73",
|
|
83212
83241
|
"status": "good"
|
|
83213
83242
|
},
|
|
83214
83243
|
{
|
|
@@ -88692,7 +88721,7 @@
|
|
|
88692
88721
|
"linktype": "component",
|
|
88693
88722
|
"name": "TreeNodeComponent",
|
|
88694
88723
|
"coveragePercent": 20,
|
|
88695
|
-
"coverageCount": "6/
|
|
88724
|
+
"coverageCount": "6/30",
|
|
88696
88725
|
"status": "low"
|
|
88697
88726
|
},
|
|
88698
88727
|
{
|
|
@@ -88701,7 +88730,7 @@
|
|
|
88701
88730
|
"linktype": "interface",
|
|
88702
88731
|
"name": "Node",
|
|
88703
88732
|
"coveragePercent": 0,
|
|
88704
|
-
"coverageCount": "0/
|
|
88733
|
+
"coverageCount": "0/13",
|
|
88705
88734
|
"status": "low"
|
|
88706
88735
|
},
|
|
88707
88736
|
{
|