carbon-components-angular 5.41.0 → 5.42.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/docs/documentation/classes/CheckboxExportedTests.html +1 -1
- package/docs/documentation/components/ComboBox.html +4 -4
- package/docs/documentation/components/TextareaLabelComponent.html +346 -128
- package/docs/documentation/coverage.html +6 -6
- package/docs/documentation/directives/RouterLinkExtendedDirective.html +1 -1
- package/docs/documentation/directives/TextArea.html +58 -0
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboBoxModule.html +4 -4
- package/docs/documentation/modules/ContentSwitcherModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +41 -37
- package/docs/documentation/modules/DatePickerInputModule.html +41 -37
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +38 -38
- package/docs/documentation/modules/DatePickerModule.html +38 -38
- package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
- package/docs/documentation/modules/GridModule.html +60 -60
- package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LoadingModule.html +4 -4
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.html +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +4 -4
- package/docs/documentation/modules/RadioModule.html +4 -4
- package/docs/documentation/modules/SelectModule/dependencies.svg +58 -58
- package/docs/documentation/modules/SelectModule.html +58 -58
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/TabsModule/dependencies.svg +69 -69
- package/docs/documentation/modules/TabsModule.html +69 -69
- package/docs/documentation/modules/TagModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TagModule.html +4 -4
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TilesModule/dependencies.svg +86 -86
- package/docs/documentation/modules/TilesModule.html +86 -86
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +40 -44
- package/docs/documentation/modules/TimePickerSelectModule.html +40 -44
- package/docs/documentation/modules/ToggleModule/dependencies.svg +42 -46
- package/docs/documentation/modules/ToggleModule.html +42 -46
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ToggletipModule.html +4 -4
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +35 -35
- package/docs/documentation/modules/TreeviewModule.html +35 -35
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +200 -108
- package/docs/storybook/1250.47c381c1.iframe.bundle.js +1 -0
- package/docs/storybook/1277.4be2b1a4.iframe.bundle.js +1 -0
- package/docs/storybook/{1345.9eabf5e2.iframe.bundle.js → 1345.ec2701f8.iframe.bundle.js} +1 -1
- package/docs/storybook/{6765.2096c92a.iframe.bundle.js → 6765.2c6ceeb0.iframe.bundle.js} +1 -1
- package/docs/storybook/{combobox-combobox-stories.3bbada2d.iframe.bundle.js → combobox-combobox-stories.84acbfa0.iframe.bundle.js} +1 -1
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/index.json +1 -1
- package/docs/storybook/input-textarea-stories.f6532f41.iframe.bundle.js +1 -0
- package/docs/storybook/main.a2b57351.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/runtime~main.f3aed674.iframe.bundle.js +1 -0
- package/docs/storybook/stories.json +1 -1
- package/esm2020/combobox/combobox.component.mjs +3 -3
- package/esm2020/input/label.component.mjs +1 -1
- package/esm2020/input/text-area.directive.mjs +8 -2
- package/esm2020/input/textarea-label.component.mjs +186 -106
- package/esm2020/ui-shell/sidenav/routerlink-extended.directive.mjs +2 -2
- package/fesm2015/carbon-components-angular-combobox.mjs +2 -2
- package/fesm2015/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-input.mjs +193 -107
- package/fesm2015/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs +1 -1
- package/fesm2015/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-combobox.mjs +2 -2
- package/fesm2020/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-input.mjs +193 -107
- package/fesm2020/carbon-components-angular-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs +1 -1
- package/fesm2020/carbon-components-angular-ui-shell.mjs.map +1 -1
- package/input/text-area.directive.d.ts +1 -0
- package/input/textarea-label.component.d.ts +7 -1
- package/package.json +1 -1
- package/docs/storybook/7529.5272f30b.iframe.bundle.js +0 -1
- package/docs/storybook/input-textarea-stories.1a3b5e80.iframe.bundle.js +0 -1
- package/docs/storybook/main.7f34f466.iframe.bundle.js +0 -1
- package/docs/storybook/runtime~main.d2952d59.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -5282,12 +5282,12 @@
|
|
|
5282
5282
|
"classes": [
|
|
5283
5283
|
{
|
|
5284
5284
|
"name": "CheckboxExportedTests",
|
|
5285
|
-
"id": "class-CheckboxExportedTests-
|
|
5285
|
+
"id": "class-CheckboxExportedTests-8affd6b64e31427d567ce5cccb33165a969637d1cc13fac2ac2a4f784ec79f065e254ab87629c3fff06f3492a5402c0b72dab3b809dcc985a6569f5cc5272ebb",
|
|
5286
5286
|
"file": "src/checkbox/checkbox-exported-tests.ts",
|
|
5287
5287
|
"deprecated": false,
|
|
5288
5288
|
"deprecationMessage": "",
|
|
5289
5289
|
"type": "class",
|
|
5290
|
-
"sourceCode": "import { expect } from \"chai\";\nimport merge from \"lodash/merge\";\nimport ComponentTests from \"../exported-tests/component-tests\";\n\nconst defaults = {\n\tselectors: {\n\t\troot: \"cds-checkbox\",\n\t\tinput: \"input\"\n\t}\n};\n\nclass CheckboxExportedTests extends ComponentTests {\n\tconstructor(configs) {\n\t\tsuper(merge({}, defaults, configs));\n\t\tthis.tests = this.tests.concat(this.structure());\n\t}\n\n\tstructure() {\n\t\tconst tests = [\n\t\t\t{\n\t\t\t\tname: \"initially be unchecked, be checked on click\",\n\t\t\t\tgetActual: fragment =>\n\t\t\t\t\tnew Promise(resolve => {\n\t\t\t\t\t\tconst component = this.getComponent(\n\t\t\t\t\t\t\tfragment,\n\t\t\t\t\t\t\t`${this.settings.selectors.root} ${this.settings.selectors.input}`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst initialState = component.checked;\n\t\t\t\t\t\tcomponent.click();\n\t\t\t\t\t\tconst afterClickState = component.checked;\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tinitialState,\n\t\t\t\t\t\t\tafterClickState\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\t\trunComparison: results => {\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.initialState).to.be.false;\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.afterClickState).to.be.true;\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\t\treturn [{\n\t\t\tname: \"Basic checkbox tests\",\n\t\t\ttests: this.getTests(tests)\n\t\t}];\n\t}\n}\n\nexport default CheckboxExportedTests;\n",
|
|
5290
|
+
"sourceCode": "import { expect } from \"chai\";\nimport merge from \"lodash-es/merge\";\nimport ComponentTests from \"../exported-tests/component-tests\";\n\nconst defaults = {\n\tselectors: {\n\t\troot: \"cds-checkbox\",\n\t\tinput: \"input\"\n\t}\n};\n\nclass CheckboxExportedTests extends ComponentTests {\n\tconstructor(configs) {\n\t\tsuper(merge({}, defaults, configs));\n\t\tthis.tests = this.tests.concat(this.structure());\n\t}\n\n\tstructure() {\n\t\tconst tests = [\n\t\t\t{\n\t\t\t\tname: \"initially be unchecked, be checked on click\",\n\t\t\t\tgetActual: fragment =>\n\t\t\t\t\tnew Promise(resolve => {\n\t\t\t\t\t\tconst component = this.getComponent(\n\t\t\t\t\t\t\tfragment,\n\t\t\t\t\t\t\t`${this.settings.selectors.root} ${this.settings.selectors.input}`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst initialState = component.checked;\n\t\t\t\t\t\tcomponent.click();\n\t\t\t\t\t\tconst afterClickState = component.checked;\n\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\tinitialState,\n\t\t\t\t\t\t\tafterClickState\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\t\trunComparison: results => {\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.initialState).to.be.false;\n\t\t\t\t\t// tslint:disable-next-line\n\t\t\t\t\texpect(results.afterClickState).to.be.true;\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\t\treturn [{\n\t\t\tname: \"Basic checkbox tests\",\n\t\t\ttests: this.getTests(tests)\n\t\t}];\n\t}\n}\n\nexport default CheckboxExportedTests;\n",
|
|
5291
5291
|
"constructorObj": {
|
|
5292
5292
|
"name": "constructor",
|
|
5293
5293
|
"description": "",
|
|
@@ -15942,12 +15942,12 @@
|
|
|
15942
15942
|
},
|
|
15943
15943
|
{
|
|
15944
15944
|
"name": "RouterLinkExtendedDirective",
|
|
15945
|
-
"id": "directive-RouterLinkExtendedDirective-
|
|
15945
|
+
"id": "directive-RouterLinkExtendedDirective-5e5c28177be38ef9a1bb8c74d6e1905dbcc16d89d14393825fd626f312f778691a8d80d24bfe122dd49eb44836e83b6dc0002f93240b5da7e8016ad33ca20820",
|
|
15946
15946
|
"file": "src/ui-shell/sidenav/routerlink-extended.directive.ts",
|
|
15947
15947
|
"type": "directive",
|
|
15948
15948
|
"description": "",
|
|
15949
15949
|
"rawdescription": "\n",
|
|
15950
|
-
"sourceCode": "import { Directive, Input, OnChanges, SimpleChanges } from \"@angular/core\";\nimport { NavigationExtras, RouterLinkWithHref } from \"@angular/router\";\nimport keys from \"lodash/keys\";\n\n@Directive({\n\t// tslint:disable-next-line\n\tselector: \"[routerLink]\"\n})\nexport class RouterLinkExtendedDirective extends RouterLinkWithHref implements OnChanges {\n\t// TODO: Change RouterLinkWithHref with RouterLink from angular 15 since RouterLinkWithHref has been deprecated\n\t@Input() routeExtras: NavigationExtras;\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes.routeExtras && this.routeExtras) {\n\t\t\tkeys(this.routeExtras).forEach(routeExtraProperty => this[routeExtraProperty] = this.routeExtras[routeExtraProperty]);\n\t\t}\n\n\t\tsuper.ngOnChanges(changes);\n\t}\n}\n",
|
|
15950
|
+
"sourceCode": "import { Directive, Input, OnChanges, SimpleChanges } from \"@angular/core\";\nimport { NavigationExtras, RouterLinkWithHref } from \"@angular/router\";\nimport keys from \"lodash-es/keys\";\n\n@Directive({\n\t// tslint:disable-next-line\n\tselector: \"[routerLink]\"\n})\nexport class RouterLinkExtendedDirective extends RouterLinkWithHref implements OnChanges {\n\t// TODO: Change RouterLinkWithHref with RouterLink from angular 15 since RouterLinkWithHref has been deprecated\n\t@Input() routeExtras: NavigationExtras;\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes.routeExtras && this.routeExtras) {\n\t\t\tkeys(this.routeExtras).forEach(routeExtraProperty => this[routeExtraProperty] = this.routeExtras[routeExtraProperty]);\n\t\t}\n\n\t\tsuper.ngOnChanges(changes);\n\t}\n}\n",
|
|
15951
15951
|
"selector": "[routerLink]",
|
|
15952
15952
|
"providers": [],
|
|
15953
15953
|
"hostDirectives": [],
|
|
@@ -17275,12 +17275,12 @@
|
|
|
17275
17275
|
},
|
|
17276
17276
|
{
|
|
17277
17277
|
"name": "TextArea",
|
|
17278
|
-
"id": "directive-TextArea-
|
|
17278
|
+
"id": "directive-TextArea-8d330b7a2bb57091bffb8b71f610d9f3f98049b5d8dfb70f002d482b00d7509202e1ed207dc3f39eb43e3501ef0eddbe53558b9d3882d3c690ad73e626db938f",
|
|
17279
17279
|
"file": "src/input/text-area.directive.ts",
|
|
17280
17280
|
"type": "directive",
|
|
17281
17281
|
"description": "<p>A directive for applying styling to a textarea element.</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><textarea cdsTextArea></textarea></code></pre></div><p>See the <a href=\"http://www.carbondesignsystem.com/components/text-input/code\">vanilla carbon docs</a> for more detail.</p>\n",
|
|
17282
17282
|
"rawdescription": "\n\nA directive for applying styling to a textarea element.\n\nExample:\n\n```html\n<textarea cdsTextArea></textarea>\n```\n\nSee the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.\n",
|
|
17283
|
-
"sourceCode": "import { Directive, HostBinding, Input } from \"@angular/core\";\n\n/**\n * A directive for applying styling to a textarea element.\n *\n * Example:\n *\n * ```html\n * <textarea cdsTextArea></textarea>\n * ```\n *\n * See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.\n */\n@Directive({\n\tselector: \"[cdsTextArea], [ibmTextArea]\"\n})\nexport class TextArea {\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` input theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@HostBinding(\"class.cds--text-area\") baseClass = true;\n\t@HostBinding(\"class.cds--text-area--invalid\") @Input() invalid = false;\n\t@HostBinding(\"class.cds--skeleton\") @Input() skeleton = false;\n\t@HostBinding(\"class.cds--text-area--light\") get isLightTheme() {\n\t\treturn this.theme === \"light\";\n\t}\n}\n",
|
|
17283
|
+
"sourceCode": "import { Directive, HostBinding, Input } from \"@angular/core\";\n\n/**\n * A directive for applying styling to a textarea element.\n *\n * Example:\n *\n * ```html\n * <textarea cdsTextArea></textarea>\n * ```\n *\n * See the [vanilla carbon docs](http://www.carbondesignsystem.com/components/text-input/code) for more detail.\n */\n@Directive({\n\tselector: \"[cdsTextArea], [ibmTextArea]\"\n})\nexport class TextArea {\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` input theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@HostBinding(\"class.cds--text-area\") baseClass = true;\n\t@HostBinding(\"class.cds--text-area--invalid\") @Input() invalid = false;\n\t@HostBinding(\"class.cds--skeleton\") @Input() skeleton = false;\n\t@HostBinding(\"class.cds--text-area--light\") get isLightTheme() {\n\t\treturn this.theme === \"light\";\n\t}\n\n\t@HostBinding(\"attr.data-invalid\") get getInvalidAttr() {\n\t\treturn this.invalid ? true : undefined;\n\t}\n}\n",
|
|
17284
17284
|
"selector": "[cdsTextArea], [ibmTextArea]",
|
|
17285
17285
|
"providers": [],
|
|
17286
17286
|
"hostDirectives": [],
|
|
@@ -17338,6 +17338,14 @@
|
|
|
17338
17338
|
"deprecated": false,
|
|
17339
17339
|
"deprecationMessage": "",
|
|
17340
17340
|
"hostBindings": [
|
|
17341
|
+
{
|
|
17342
|
+
"name": "attr.data-invalid",
|
|
17343
|
+
"deprecated": false,
|
|
17344
|
+
"deprecationMessage": "",
|
|
17345
|
+
"line": 31,
|
|
17346
|
+
"type": "boolean",
|
|
17347
|
+
"decorators": []
|
|
17348
|
+
},
|
|
17341
17349
|
{
|
|
17342
17350
|
"name": "class.cds--text-area",
|
|
17343
17351
|
"defaultValue": "true",
|
|
@@ -17389,6 +17397,15 @@
|
|
|
17389
17397
|
"returnType": "",
|
|
17390
17398
|
"line": 27
|
|
17391
17399
|
}
|
|
17400
|
+
},
|
|
17401
|
+
"getInvalidAttr": {
|
|
17402
|
+
"name": "getInvalidAttr",
|
|
17403
|
+
"getSignature": {
|
|
17404
|
+
"name": "getInvalidAttr",
|
|
17405
|
+
"type": "",
|
|
17406
|
+
"returnType": "",
|
|
17407
|
+
"line": 31
|
|
17408
|
+
}
|
|
17392
17409
|
}
|
|
17393
17410
|
}
|
|
17394
17411
|
},
|
|
@@ -22786,7 +22803,7 @@
|
|
|
22786
22803
|
},
|
|
22787
22804
|
{
|
|
22788
22805
|
"name": "ComboBox",
|
|
22789
|
-
"id": "component-ComboBox-
|
|
22806
|
+
"id": "component-ComboBox-7fc271b7eb589247bc96ffee3435bb23012052e34908a706dc2136679976a7cb2fe2d5e4160ec61c05978b5464d5ccdc2745db53364004732dabe157e6bd9246",
|
|
22790
22807
|
"file": "src/combobox/combobox.component.ts",
|
|
22791
22808
|
"encapsulation": [],
|
|
22792
22809
|
"entryComponents": [],
|
|
@@ -22921,7 +22938,7 @@
|
|
|
22921
22938
|
},
|
|
22922
22939
|
{
|
|
22923
22940
|
"name": "id",
|
|
22924
|
-
"defaultValue": "`
|
|
22941
|
+
"defaultValue": "`combobox-${ComboBox.comboBoxCount++}`",
|
|
22925
22942
|
"deprecated": false,
|
|
22926
22943
|
"deprecationMessage": "",
|
|
22927
22944
|
"line": 266,
|
|
@@ -22982,7 +22999,7 @@
|
|
|
22982
22999
|
},
|
|
22983
23000
|
{
|
|
22984
23001
|
"name": "labelId",
|
|
22985
|
-
"defaultValue": "`
|
|
23002
|
+
"defaultValue": "`combobox-label-${ComboBox.comboBoxCount++}`",
|
|
22986
23003
|
"deprecated": false,
|
|
22987
23004
|
"deprecationMessage": "",
|
|
22988
23005
|
"line": 267,
|
|
@@ -23930,7 +23947,7 @@
|
|
|
23930
23947
|
"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",
|
|
23931
23948
|
"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",
|
|
23932
23949
|
"type": "component",
|
|
23933
|
-
"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",
|
|
23950
|
+
"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 = `combobox-${ComboBox.comboBoxCount++}`;\n\t@Input() labelId = `combobox-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",
|
|
23934
23951
|
"assetsDirs": [],
|
|
23935
23952
|
"styleUrlsData": "",
|
|
23936
23953
|
"stylesData": "",
|
|
@@ -60850,7 +60867,7 @@
|
|
|
60850
60867
|
},
|
|
60851
60868
|
{
|
|
60852
60869
|
"name": "TextareaLabelComponent",
|
|
60853
|
-
"id": "component-TextareaLabelComponent-
|
|
60870
|
+
"id": "component-TextareaLabelComponent-8433030a7fde2d29804317a250bbca59f7ba089e9b89712804e08222e3e68b24cf245c37d8eeefda4a577988d2c68c2295392b189cea305f60a7f73c5b817787",
|
|
60854
60871
|
"file": "src/input/textarea-label.component.ts",
|
|
60855
60872
|
"encapsulation": [],
|
|
60856
60873
|
"entryComponents": [],
|
|
@@ -60860,7 +60877,7 @@
|
|
|
60860
60877
|
"selector": "cds-textarea-label, ibm-textarea-label",
|
|
60861
60878
|
"styleUrls": [],
|
|
60862
60879
|
"styles": [],
|
|
60863
|
-
"template": "<label\n\t[for]=\"labelInputID\"\n\t[attr.aria-label]=\"ariaLabel\"\n\tclass=\"cds--label\"\n\t[ngClass]=\"{\n\t\t'cds--label--disabled': disabled
|
|
60880
|
+
"template": "<ng-container *ngIf=\"skeleton\">\n\t<span class=\"cds--label cds--skeleton\"></span>\n\t<div class=\"cds--text-area cds--skeleton\"></div>\n</ng-container>\n<ng-container *ngIf=\"!skeleton\">\n\t<div class=\"cds--text-area__label-wrapper\">\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled\n\t\t\t}\">\n\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t<ng-template #labelContent>\n\t\t\t\t<ng-content></ng-content>\n\t\t\t</ng-template>\n\t\t</label>\n\t</div>\n\t<div\n\t\tclass=\"cds--text-area__wrapper\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--text-area__wrapper--warn': warn\n\t\t}\"\n\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t#wrapper>\n\t\t<svg\n\t\t\t*ngIf=\"!fluid && invalid\"\n\t\t\tcdsIcon=\"warning--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--text-area__invalid-icon\">\n\t\t</svg>\n\t\t<svg\n\t\t\t*ngIf=\"!fluid && !invalid && warn\"\n\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--text-area__invalid-icon cds--text-area__invalid-icon--warning\">\n\t\t</svg>\n\t\t<ng-template *ngIf=\"textAreaTemplate; else textAreaContent\" [ngTemplateOutlet]=\"textAreaTemplate\"></ng-template>\n\t\t<ng-template #textAreaContent>\n\t\t\t<ng-content select=\"[cdsTextArea],[ibmTextArea],textarea\"></ng-content>\n\t\t</ng-template>\n\n\t\t<ng-container *ngIf=\"fluid\">\n\t\t\t<hr class=\"cds--text-area__divider\" />\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\t<svg\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-area__invalid-icon\">\n\t\t\t\t</svg>\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\t<svg\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-area__invalid-icon cds--text-area__invalid-icon--warning\">\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</ng-container>\n\t</div>\n\t<ng-container *ngIf=\"!fluid\">\n\t\t<div\n\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t</div>\n\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t</div>\n\t</ng-container>\n</ng-container>\n\t",
|
|
60864
60881
|
"templateUrl": [],
|
|
60865
60882
|
"viewProviders": [],
|
|
60866
60883
|
"hostDirectives": [],
|
|
@@ -60871,7 +60888,7 @@
|
|
|
60871
60888
|
"deprecationMessage": "",
|
|
60872
60889
|
"rawdescription": "\n\nSet the arialabel for label\n",
|
|
60873
60890
|
"description": "<p>Set the arialabel for label</p>\n",
|
|
60874
|
-
"line":
|
|
60891
|
+
"line": 168,
|
|
60875
60892
|
"type": "string",
|
|
60876
60893
|
"decorators": []
|
|
60877
60894
|
},
|
|
@@ -60882,7 +60899,18 @@
|
|
|
60882
60899
|
"deprecationMessage": "",
|
|
60883
60900
|
"rawdescription": "\n\nSet to `true` for a disabled label.\n",
|
|
60884
60901
|
"description": "<p>Set to <code>true</code> for a disabled label.</p>\n",
|
|
60885
|
-
"line":
|
|
60902
|
+
"line": 133,
|
|
60903
|
+
"type": "boolean",
|
|
60904
|
+
"decorators": []
|
|
60905
|
+
},
|
|
60906
|
+
{
|
|
60907
|
+
"name": "fluid",
|
|
60908
|
+
"defaultValue": "false",
|
|
60909
|
+
"deprecated": false,
|
|
60910
|
+
"deprecationMessage": "",
|
|
60911
|
+
"rawdescription": "\n\nExperimental: enable fluid state\n",
|
|
60912
|
+
"description": "<p>Experimental: enable fluid state</p>\n",
|
|
60913
|
+
"line": 173,
|
|
60886
60914
|
"type": "boolean",
|
|
60887
60915
|
"decorators": []
|
|
60888
60916
|
},
|
|
@@ -60892,7 +60920,7 @@
|
|
|
60892
60920
|
"deprecationMessage": "",
|
|
60893
60921
|
"rawdescription": "\n\nOptional helper text that appears under the label.\n",
|
|
60894
60922
|
"description": "<p>Optional helper text that appears under the label.</p>\n",
|
|
60895
|
-
"line":
|
|
60923
|
+
"line": 148,
|
|
60896
60924
|
"type": "string | TemplateRef<any>",
|
|
60897
60925
|
"decorators": []
|
|
60898
60926
|
},
|
|
@@ -60903,7 +60931,7 @@
|
|
|
60903
60931
|
"deprecationMessage": "",
|
|
60904
60932
|
"rawdescription": "\n\nSet to `true` for an invalid label component.\n",
|
|
60905
60933
|
"description": "<p>Set to <code>true</code> for an invalid label component.</p>\n",
|
|
60906
|
-
"line":
|
|
60934
|
+
"line": 156,
|
|
60907
60935
|
"type": "boolean",
|
|
60908
60936
|
"decorators": []
|
|
60909
60937
|
},
|
|
@@ -60913,7 +60941,7 @@
|
|
|
60913
60941
|
"deprecationMessage": "",
|
|
60914
60942
|
"rawdescription": "\n\nSets the invalid text.\n",
|
|
60915
60943
|
"description": "<p>Sets the invalid text.</p>\n",
|
|
60916
|
-
"line":
|
|
60944
|
+
"line": 152,
|
|
60917
60945
|
"type": "string | TemplateRef<any>",
|
|
60918
60946
|
"decorators": []
|
|
60919
60947
|
},
|
|
@@ -60924,7 +60952,7 @@
|
|
|
60924
60952
|
"deprecationMessage": "",
|
|
60925
60953
|
"rawdescription": "\n\nThe id of the input item associated with the `Label`. This value is also used to associate the `Label` with\nits input counterpart through the 'for' attribute.\n",
|
|
60926
60954
|
"description": "<p>The id of the input item associated with the <code>Label</code>. This value is also used to associate the <code>Label</code> with\nits input counterpart through the 'for' attribute.</p>\n",
|
|
60927
|
-
"line":
|
|
60955
|
+
"line": 128,
|
|
60928
60956
|
"type": "string",
|
|
60929
60957
|
"decorators": []
|
|
60930
60958
|
},
|
|
@@ -60934,7 +60962,7 @@
|
|
|
60934
60962
|
"deprecationMessage": "",
|
|
60935
60963
|
"rawdescription": "\n\nHelper input property for ease of migration\nSince we cannot pass ng-content down easily from label component, we will accept the templates\n",
|
|
60936
60964
|
"description": "<p>Helper input property for ease of migration\nSince we cannot pass ng-content down easily from label component, we will accept the templates</p>\n",
|
|
60937
|
-
"line":
|
|
60965
|
+
"line": 143,
|
|
60938
60966
|
"type": "TemplateRef<any>",
|
|
60939
60967
|
"decorators": []
|
|
60940
60968
|
},
|
|
@@ -60945,7 +60973,7 @@
|
|
|
60945
60973
|
"deprecationMessage": "",
|
|
60946
60974
|
"rawdescription": "\n\nSet to `true` for a loading label.\n",
|
|
60947
60975
|
"description": "<p>Set to <code>true</code> for a loading label.</p>\n",
|
|
60948
|
-
"line":
|
|
60976
|
+
"line": 137,
|
|
60949
60977
|
"type": "boolean",
|
|
60950
60978
|
"decorators": []
|
|
60951
60979
|
},
|
|
@@ -60953,7 +60981,7 @@
|
|
|
60953
60981
|
"name": "textAreaTemplate",
|
|
60954
60982
|
"deprecated": false,
|
|
60955
60983
|
"deprecationMessage": "",
|
|
60956
|
-
"line":
|
|
60984
|
+
"line": 144,
|
|
60957
60985
|
"type": "TemplateRef<any>",
|
|
60958
60986
|
"decorators": []
|
|
60959
60987
|
},
|
|
@@ -60964,7 +60992,7 @@
|
|
|
60964
60992
|
"deprecationMessage": "",
|
|
60965
60993
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warningText)\n",
|
|
60966
60994
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warningText)</p>\n",
|
|
60967
|
-
"line":
|
|
60995
|
+
"line": 160,
|
|
60968
60996
|
"type": "boolean",
|
|
60969
60997
|
"decorators": []
|
|
60970
60998
|
},
|
|
@@ -60974,7 +61002,7 @@
|
|
|
60974
61002
|
"deprecationMessage": "",
|
|
60975
61003
|
"rawdescription": "\n\nSets the warning text\n",
|
|
60976
61004
|
"description": "<p>Sets the warning text</p>\n",
|
|
60977
|
-
"line":
|
|
61005
|
+
"line": 164,
|
|
60978
61006
|
"type": "string | TemplateRef<any>",
|
|
60979
61007
|
"decorators": []
|
|
60980
61008
|
}
|
|
@@ -60989,7 +61017,7 @@
|
|
|
60989
61017
|
"type": "",
|
|
60990
61018
|
"optional": false,
|
|
60991
61019
|
"description": "",
|
|
60992
|
-
"line":
|
|
61020
|
+
"line": 181,
|
|
60993
61021
|
"decorators": [
|
|
60994
61022
|
{
|
|
60995
61023
|
"name": "HostBinding",
|
|
@@ -61008,7 +61036,7 @@
|
|
|
61008
61036
|
"type": "number",
|
|
61009
61037
|
"optional": false,
|
|
61010
61038
|
"description": "<p>Used to build the id of the input item associated with the <code>Label</code>.</p>\n",
|
|
61011
|
-
"line":
|
|
61039
|
+
"line": 123,
|
|
61012
61040
|
"rawdescription": "\n\nUsed to build the id of the input item associated with the `Label`.\n",
|
|
61013
61041
|
"modifierKind": [
|
|
61014
61042
|
126
|
|
@@ -61021,7 +61049,7 @@
|
|
|
61021
61049
|
"type": "TextArea",
|
|
61022
61050
|
"optional": false,
|
|
61023
61051
|
"description": "",
|
|
61024
|
-
"line":
|
|
61052
|
+
"line": 179,
|
|
61025
61053
|
"decorators": [
|
|
61026
61054
|
{
|
|
61027
61055
|
"name": "ContentChild",
|
|
@@ -61039,7 +61067,7 @@
|
|
|
61039
61067
|
"type": "ElementRef<HTMLDivElement>",
|
|
61040
61068
|
"optional": false,
|
|
61041
61069
|
"description": "",
|
|
61042
|
-
"line":
|
|
61070
|
+
"line": 176,
|
|
61043
61071
|
"decorators": [
|
|
61044
61072
|
{
|
|
61045
61073
|
"name": "ViewChild",
|
|
@@ -61065,7 +61093,7 @@
|
|
|
61065
61093
|
"optional": false,
|
|
61066
61094
|
"returnType": "boolean",
|
|
61067
61095
|
"typeParameters": [],
|
|
61068
|
-
"line":
|
|
61096
|
+
"line": 228,
|
|
61069
61097
|
"deprecated": false,
|
|
61070
61098
|
"deprecationMessage": "",
|
|
61071
61099
|
"modifierKind": [
|
|
@@ -61092,7 +61120,7 @@
|
|
|
61092
61120
|
"defaultValue": "true",
|
|
61093
61121
|
"deprecated": false,
|
|
61094
61122
|
"deprecationMessage": "",
|
|
61095
|
-
"line":
|
|
61123
|
+
"line": 181,
|
|
61096
61124
|
"type": "boolean",
|
|
61097
61125
|
"decorators": []
|
|
61098
61126
|
},
|
|
@@ -61100,9 +61128,25 @@
|
|
|
61100
61128
|
"name": "class.cds--text-area__wrapper--readonly",
|
|
61101
61129
|
"deprecated": false,
|
|
61102
61130
|
"deprecationMessage": "",
|
|
61103
|
-
"line":
|
|
61131
|
+
"line": 183,
|
|
61104
61132
|
"type": "any",
|
|
61105
61133
|
"decorators": []
|
|
61134
|
+
},
|
|
61135
|
+
{
|
|
61136
|
+
"name": "class.cds--text-area--fluid",
|
|
61137
|
+
"deprecated": false,
|
|
61138
|
+
"deprecationMessage": "",
|
|
61139
|
+
"line": 187,
|
|
61140
|
+
"type": "boolean",
|
|
61141
|
+
"decorators": []
|
|
61142
|
+
},
|
|
61143
|
+
{
|
|
61144
|
+
"name": "class.cds--text-area--fluid__skeleton",
|
|
61145
|
+
"deprecated": false,
|
|
61146
|
+
"deprecationMessage": "",
|
|
61147
|
+
"line": 191,
|
|
61148
|
+
"type": "boolean",
|
|
61149
|
+
"decorators": []
|
|
61106
61150
|
}
|
|
61107
61151
|
],
|
|
61108
61152
|
"hostListeners": [],
|
|
@@ -61111,7 +61155,7 @@
|
|
|
61111
61155
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { InputModule } from 'carbon-components-angular';</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-textarea-label>\n Label\n <textarea cdsTextArea class="textarea-field">\n</cds-textarea-label></code></pre></div><p><a href=\"../../?path=/story/components-input-text-area--basic\">See demo</a></p>\n",
|
|
61112
61156
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { InputModule } from 'carbon-components-angular';\n```\n\n```html\n<cds-textarea-label>\n\tLabel\n\t<textarea cdsTextArea class=\"textarea-field\">\n</cds-textarea-label>\n```\n\n[See demo](../../?path=/story/components-input-text-area--basic)\n",
|
|
61113
61157
|
"type": "component",
|
|
61114
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tContentChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\nimport { TextArea } from \"./text-area.directive\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-textarea-label>\n * \tLabel\n * \t<textarea cdsTextArea class=\"textarea-field\">\n * </cds-textarea-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input-text-area--basic)\n */\n@Component({\n\tselector: \"cds-textarea-label, ibm-textarea-label\",\n\ttemplate: `\n\t\t<label\n\t\t\t[for]=\"labelInputID\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\tclass=\"cds--label\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--label--disabled': disabled
|
|
61158
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tAfterViewInit,\n\tElementRef,\n\tHostBinding,\n\tTemplateRef,\n\tViewChild,\n\tContentChild,\n\tChangeDetectorRef\n} from \"@angular/core\";\n\nimport { TextArea } from \"./text-area.directive\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { InputModule } from 'carbon-components-angular';\n * ```\n *\n * ```html\n * <cds-textarea-label>\n * \tLabel\n * \t<textarea cdsTextArea class=\"textarea-field\">\n * </cds-textarea-label>\n * ```\n *\n * [See demo](../../?path=/story/components-input-text-area--basic)\n */\n@Component({\n\tselector: \"cds-textarea-label, ibm-textarea-label\",\n\ttemplate: `\n\t\t<ng-container *ngIf=\"skeleton\">\n\t\t\t<span class=\"cds--label cds--skeleton\"></span>\n\t\t\t<div class=\"cds--text-area cds--skeleton\"></div>\n\t\t</ng-container>\n\t\t<ng-container *ngIf=\"!skeleton\">\n\t\t\t<div class=\"cds--text-area__label-wrapper\">\n\t\t\t\t<label\n\t\t\t\t\t[for]=\"labelInputID\"\n\t\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--label--disabled': disabled\n\t\t\t\t\t}\">\n\t\t\t\t\t<ng-template *ngIf=\"labelTemplate; else labelContent\" [ngTemplateOutlet]=\"labelTemplate\"></ng-template>\n\t\t\t\t\t<ng-template #labelContent>\n\t\t\t\t\t\t<ng-content></ng-content>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"cds--text-area__wrapper\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--text-area__wrapper--warn': warn\n\t\t\t\t}\"\n\t\t\t\t[attr.data-invalid]=\"(invalid ? true : null)\"\n\t\t\t\t#wrapper>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!fluid && invalid\"\n\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-area__invalid-icon\">\n\t\t\t\t</svg>\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!fluid && !invalid && warn\"\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\tclass=\"cds--text-area__invalid-icon cds--text-area__invalid-icon--warning\">\n\t\t\t\t</svg>\n\t\t\t\t<ng-template *ngIf=\"textAreaTemplate; else textAreaContent\" [ngTemplateOutlet]=\"textAreaTemplate\"></ng-template>\n\t\t\t\t<ng-template #textAreaContent>\n\t\t\t\t\t<ng-content select=\"[cdsTextArea],[ibmTextArea],textarea\"></ng-content>\n\t\t\t\t</ng-template>\n\n\t\t\t\t<ng-container *ngIf=\"fluid\">\n\t\t\t\t\t<hr class=\"cds--text-area__divider\" />\n\t\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--text-area__invalid-icon\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\tclass=\"cds--text-area__invalid-icon cds--text-area__invalid-icon--warning\">\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t</div>\n\t\t\t<ng-container *ngIf=\"!fluid\">\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</ng-container>\n\t\t</ng-container>\n\t`\n})\nexport class TextareaLabelComponent implements AfterViewInit {\n\t/**\n\t * Used to build the id of the input item associated with the `Label`.\n\t */\n\tstatic labelCounter = 0;\n\t/**\n\t * The id of the input item associated with the `Label`. This value is also used to associate the `Label` with\n\t * its input counterpart through the 'for' attribute.\n\t*/\n\t@Input() labelInputID = \"ibm-textarea-\" + TextareaLabelComponent.labelCounter;\n\n\t/**\n\t * Set to `true` for a disabled label.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a loading label.\n\t */\n\t@Input() skeleton = false;\n\n\t/**\n\t * Helper input property for ease of migration\n\t * Since we cannot pass ng-content down easily from label component, we will accept the templates\n\t */\n\t@Input() labelTemplate: TemplateRef<any>;\n\t@Input() textAreaTemplate: TemplateRef<any>;\n\t/**\n\t * Optional helper text that appears under the label.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * Sets the invalid text.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` for an invalid label component.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\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 * Set the arialabel for label\n\t */\n\t@Input() ariaLabel: string;\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@Input() fluid = false;\n\n\t// @ts-ignore\n\t@ViewChild(\"wrapper\", { static: false }) wrapper: ElementRef<HTMLDivElement>;\n\n\t// @ts-ignore\n\t@ContentChild(TextArea, { static: false }) textArea: TextArea;\n\n\t@HostBinding(\"class.cds--form-item\") labelClass = true;\n\n\t@HostBinding(\"class.cds--text-area__wrapper--readonly\") get isReadonly() {\n\t\treturn this.wrapper?.nativeElement.querySelector(\"textarea\")?.readOnly ?? false;\n\t}\n\n\t@HostBinding(\"class.cds--text-area--fluid\") get fluidClass() {\n\t\treturn this.fluid && !this.skeleton;\n\t}\n\n\t@HostBinding(\"class.cds--text-area--fluid__skeleton\") get fluidSkeletonClass() {\n\t\treturn this.fluid && this.skeleton;\n\t}\n\n\t/**\n\t * Creates an instance of Label.\n\t */\n\tconstructor(protected changeDetectorRef: ChangeDetectorRef) {}\n\n\t/**\n\t * Sets the id on the input item associated with the `Label`.\n\t */\n\tngAfterViewInit() {\n\t\tif (this.wrapper) {\n\t\t\t// Prioritize setting id to `textarea` over div\n\t\t\tconst inputElement = this.wrapper.nativeElement.querySelector(\"textarea\");\n\t\t\tif (inputElement) {\n\t\t\t\t// avoid overriding ids already set by the user reuse it instead\n\t\t\t\tif (inputElement.id) {\n\t\t\t\t\tthis.labelInputID = inputElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tinputElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst divElement = this.wrapper.nativeElement.querySelector(\"div\");\n\t\t\tif (divElement) {\n\t\t\t\tif (divElement.id) {\n\t\t\t\t\tthis.labelInputID = divElement.id;\n\t\t\t\t\tthis.changeDetectorRef.detectChanges();\n\t\t\t\t}\n\t\t\t\tdivElement.setAttribute(\"id\", this.labelInputID);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
61115
61159
|
"assetsDirs": [],
|
|
61116
61160
|
"styleUrlsData": "",
|
|
61117
61161
|
"stylesData": "",
|
|
@@ -61128,7 +61172,7 @@
|
|
|
61128
61172
|
"deprecationMessage": ""
|
|
61129
61173
|
}
|
|
61130
61174
|
],
|
|
61131
|
-
"line":
|
|
61175
|
+
"line": 193,
|
|
61132
61176
|
"rawdescription": "\n\nCreates an instance of Label.\n",
|
|
61133
61177
|
"jsdoctags": [
|
|
61134
61178
|
{
|
|
@@ -61153,7 +61197,25 @@
|
|
|
61153
61197
|
"name": "isReadonly",
|
|
61154
61198
|
"type": "",
|
|
61155
61199
|
"returnType": "",
|
|
61156
|
-
"line":
|
|
61200
|
+
"line": 183
|
|
61201
|
+
}
|
|
61202
|
+
},
|
|
61203
|
+
"fluidClass": {
|
|
61204
|
+
"name": "fluidClass",
|
|
61205
|
+
"getSignature": {
|
|
61206
|
+
"name": "fluidClass",
|
|
61207
|
+
"type": "",
|
|
61208
|
+
"returnType": "",
|
|
61209
|
+
"line": 187
|
|
61210
|
+
}
|
|
61211
|
+
},
|
|
61212
|
+
"fluidSkeletonClass": {
|
|
61213
|
+
"name": "fluidSkeletonClass",
|
|
61214
|
+
"getSignature": {
|
|
61215
|
+
"name": "fluidSkeletonClass",
|
|
61216
|
+
"type": "",
|
|
61217
|
+
"returnType": "",
|
|
61218
|
+
"line": 191
|
|
61157
61219
|
}
|
|
61158
61220
|
}
|
|
61159
61221
|
}
|
|
@@ -71693,7 +71755,7 @@
|
|
|
71693
71755
|
"name": "Basic",
|
|
71694
71756
|
"ctype": "miscellaneous",
|
|
71695
71757
|
"subtype": "variable",
|
|
71696
|
-
"file": "src/
|
|
71758
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
71697
71759
|
"deprecated": false,
|
|
71698
71760
|
"deprecationMessage": "",
|
|
71699
71761
|
"type": "",
|
|
@@ -71703,7 +71765,7 @@
|
|
|
71703
71765
|
"name": "Basic",
|
|
71704
71766
|
"ctype": "miscellaneous",
|
|
71705
71767
|
"subtype": "variable",
|
|
71706
|
-
"file": "src/button/button.stories.ts",
|
|
71768
|
+
"file": "src/button/button-set.stories.ts",
|
|
71707
71769
|
"deprecated": false,
|
|
71708
71770
|
"deprecationMessage": "",
|
|
71709
71771
|
"type": "",
|
|
@@ -71713,7 +71775,7 @@
|
|
|
71713
71775
|
"name": "Basic",
|
|
71714
71776
|
"ctype": "miscellaneous",
|
|
71715
71777
|
"subtype": "variable",
|
|
71716
|
-
"file": "src/button/
|
|
71778
|
+
"file": "src/button/button.stories.ts",
|
|
71717
71779
|
"deprecated": false,
|
|
71718
71780
|
"deprecationMessage": "",
|
|
71719
71781
|
"type": "",
|
|
@@ -71723,7 +71785,7 @@
|
|
|
71723
71785
|
"name": "Basic",
|
|
71724
71786
|
"ctype": "miscellaneous",
|
|
71725
71787
|
"subtype": "variable",
|
|
71726
|
-
"file": "src/
|
|
71788
|
+
"file": "src/button/icon-button.stories.ts",
|
|
71727
71789
|
"deprecated": false,
|
|
71728
71790
|
"deprecationMessage": "",
|
|
71729
71791
|
"type": "",
|
|
@@ -72730,6 +72792,16 @@
|
|
|
72730
72792
|
"type": "",
|
|
72731
72793
|
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<!--\n\t\tapp-* components are for demo purposes only.\n\t\tYou can create your own implementation by using the component source found at:\n\t\thttps://github.com/IBM/carbon-components-angular/tree/master/src/table/stories/app-model-filter-table.component.ts\n\t\t-->\n\t\t<app-model-filter-table\n\t\t\t[stickyHeader]=\"stickyHeader\"\n\t\t\t[size]=\"size\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[showSelectionColumn]=\"showSelectionColumn\"\n\t\t\t[striped]=\"striped\"\n\t\t\t[isDataGrid]=\"isDataGrid\">\n\t\t</app-model-filter-table>\n\t`\n})"
|
|
72732
72794
|
},
|
|
72795
|
+
{
|
|
72796
|
+
"name": "Fluid",
|
|
72797
|
+
"ctype": "miscellaneous",
|
|
72798
|
+
"subtype": "variable",
|
|
72799
|
+
"file": "src/input/textarea.stories.ts",
|
|
72800
|
+
"deprecated": false,
|
|
72801
|
+
"deprecationMessage": "",
|
|
72802
|
+
"type": "",
|
|
72803
|
+
"defaultValue": "Template.bind({})"
|
|
72804
|
+
},
|
|
72733
72805
|
{
|
|
72734
72806
|
"name": "Fluid",
|
|
72735
72807
|
"ctype": "miscellaneous",
|
|
@@ -74415,41 +74487,41 @@
|
|
|
74415
74487
|
"name": "Template",
|
|
74416
74488
|
"ctype": "miscellaneous",
|
|
74417
74489
|
"subtype": "variable",
|
|
74418
|
-
"file": "src/
|
|
74490
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
74419
74491
|
"deprecated": false,
|
|
74420
74492
|
"deprecationMessage": "",
|
|
74421
74493
|
"type": "",
|
|
74422
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
74494
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
74423
74495
|
},
|
|
74424
74496
|
{
|
|
74425
74497
|
"name": "Template",
|
|
74426
74498
|
"ctype": "miscellaneous",
|
|
74427
74499
|
"subtype": "variable",
|
|
74428
|
-
"file": "src/button/button.stories.ts",
|
|
74500
|
+
"file": "src/button/button-set.stories.ts",
|
|
74429
74501
|
"deprecated": false,
|
|
74430
74502
|
"deprecationMessage": "",
|
|
74431
74503
|
"type": "",
|
|
74432
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button
|
|
74504
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
74433
74505
|
},
|
|
74434
74506
|
{
|
|
74435
74507
|
"name": "Template",
|
|
74436
74508
|
"ctype": "miscellaneous",
|
|
74437
74509
|
"subtype": "variable",
|
|
74438
|
-
"file": "src/button/
|
|
74510
|
+
"file": "src/button/button.stories.ts",
|
|
74439
74511
|
"deprecated": false,
|
|
74440
74512
|
"deprecationMessage": "",
|
|
74441
74513
|
"type": "",
|
|
74442
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
74514
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
74443
74515
|
},
|
|
74444
74516
|
{
|
|
74445
74517
|
"name": "Template",
|
|
74446
74518
|
"ctype": "miscellaneous",
|
|
74447
74519
|
"subtype": "variable",
|
|
74448
|
-
"file": "src/
|
|
74520
|
+
"file": "src/button/icon-button.stories.ts",
|
|
74449
74521
|
"deprecated": false,
|
|
74450
74522
|
"deprecationMessage": "",
|
|
74451
74523
|
"type": "",
|
|
74452
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
74524
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-icon-button\n\t\t\tbuttonId=\"icon-btn1\"\n\t\t\ttype=\"button\"\n\t\t\t[kind]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[align]=\"align\"\n\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t[buttonAttributes]=\"buttonAttributes\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\tdescription=\"Icon Description\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t</cds-icon-button>\n\t`\n})"
|
|
74453
74525
|
},
|
|
74454
74526
|
{
|
|
74455
74527
|
"name": "Template",
|
|
@@ -74599,7 +74671,7 @@
|
|
|
74599
74671
|
"deprecated": false,
|
|
74600
74672
|
"deprecationMessage": "",
|
|
74601
74673
|
"type": "",
|
|
74602
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-textarea-label\n\t\t[helperText]=\"helperText\"\n\t\t[invalid]=\"invalid\"\n\t\t[disabled]=\"disabled\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\">\n\t\t{{label}}\n\t\t<textarea\n\t\t\tcdsTextArea\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[rows]=\"rows\"\n\t\t\t[cols]=\"cols\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\taria-label=\"textarea\"></textarea>\n\t\t</cds-textarea-label>\n\t`\n})"
|
|
74674
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-textarea-label\n\t\t[helperText]=\"helperText\"\n\t\t[invalid]=\"invalid\"\n\t\t[disabled]=\"disabled\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[fluid]=\"fluid\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\">\n\t\t{{label}}\n\t\t<textarea\n\t\t\tcdsTextArea\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[rows]=\"rows\"\n\t\t\t[cols]=\"cols\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\taria-label=\"textarea\"></textarea>\n\t\t</cds-textarea-label>\n\t`\n})"
|
|
74603
74675
|
},
|
|
74604
74676
|
{
|
|
74605
74677
|
"name": "Template",
|
|
@@ -78215,199 +78287,199 @@
|
|
|
78215
78287
|
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"width: 500px\">\n\t\t\t<cds-accordion>\n\t\t\t\t<cds-accordion-item [title]=\"title\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t\t<cds-accordion-item [title]=\"titleWithContext\" [context]=\"{ index: 2 }\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t</cds-accordion>\n\t\t</div>\n\t\t<ng-template #title>\n\t\t\t<p class=\"cds--accordion__title\">Section 1 title</p>\n\t\t</ng-template>\n\t\t<ng-template #titleWithContext let-index=\"index\">\n\t\t\t<p class=\"cds--accordion__title\">Section {{ index }} title</p>\n\t\t</ng-template>\n\t`\n})"
|
|
78216
78288
|
}
|
|
78217
78289
|
],
|
|
78218
|
-
"src/
|
|
78290
|
+
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
78219
78291
|
{
|
|
78220
78292
|
"name": "Basic",
|
|
78221
78293
|
"ctype": "miscellaneous",
|
|
78222
78294
|
"subtype": "variable",
|
|
78223
|
-
"file": "src/
|
|
78295
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78224
78296
|
"deprecated": false,
|
|
78225
78297
|
"deprecationMessage": "",
|
|
78226
78298
|
"type": "",
|
|
78227
78299
|
"defaultValue": "Template.bind({})"
|
|
78228
78300
|
},
|
|
78229
78301
|
{
|
|
78230
|
-
"name": "
|
|
78302
|
+
"name": "breadcrumbItems",
|
|
78231
78303
|
"ctype": "miscellaneous",
|
|
78232
78304
|
"subtype": "variable",
|
|
78233
|
-
"file": "src/
|
|
78305
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78234
78306
|
"deprecated": false,
|
|
78235
78307
|
"deprecationMessage": "",
|
|
78236
|
-
"type": ""
|
|
78237
|
-
|
|
78238
|
-
}
|
|
78239
|
-
],
|
|
78240
|
-
"src/button/button.stories.ts": [
|
|
78308
|
+
"type": ""
|
|
78309
|
+
},
|
|
78241
78310
|
{
|
|
78242
|
-
"name": "
|
|
78311
|
+
"name": "createBreadcrumbItems",
|
|
78243
78312
|
"ctype": "miscellaneous",
|
|
78244
78313
|
"subtype": "variable",
|
|
78245
|
-
"file": "src/
|
|
78314
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78246
78315
|
"deprecated": false,
|
|
78247
78316
|
"deprecationMessage": "",
|
|
78248
78317
|
"type": "",
|
|
78249
|
-
"defaultValue": "
|
|
78318
|
+
"defaultValue": "(count: number, content = \"Breadcrumb\"): Array<BreadcrumbItem> => {\n\tif (breadcrumbItems && count === breadcrumbItems.length) {\n\t\treturn breadcrumbItems;\n\t}\n\tbreadcrumbItems = Array(count).fill(0).map((x, i) => ({\n\t\tcontent: `${content} ${i + 1}`,\n\t\thref: \"#\" + (i + 1)\n\t}));\n\treturn breadcrumbItems;\n}"
|
|
78250
78319
|
},
|
|
78251
78320
|
{
|
|
78252
|
-
"name": "
|
|
78321
|
+
"name": "CurrentPage",
|
|
78253
78322
|
"ctype": "miscellaneous",
|
|
78254
78323
|
"subtype": "variable",
|
|
78255
|
-
"file": "src/
|
|
78324
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78256
78325
|
"deprecated": false,
|
|
78257
78326
|
"deprecationMessage": "",
|
|
78258
78327
|
"type": "",
|
|
78259
|
-
"defaultValue": "(
|
|
78328
|
+
"defaultValue": "CurrentPageTemplate.bind({})"
|
|
78260
78329
|
},
|
|
78261
78330
|
{
|
|
78262
|
-
"name": "
|
|
78331
|
+
"name": "CurrentPageTemplate",
|
|
78263
78332
|
"ctype": "miscellaneous",
|
|
78264
78333
|
"subtype": "variable",
|
|
78265
|
-
"file": "src/
|
|
78334
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78266
78335
|
"deprecated": false,
|
|
78267
78336
|
"deprecationMessage": "",
|
|
78268
78337
|
"type": "",
|
|
78269
|
-
"defaultValue": "
|
|
78338
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item current=\"true\" href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78270
78339
|
},
|
|
78271
78340
|
{
|
|
78272
|
-
"name": "
|
|
78341
|
+
"name": "Model",
|
|
78273
78342
|
"ctype": "miscellaneous",
|
|
78274
78343
|
"subtype": "variable",
|
|
78275
|
-
"file": "src/
|
|
78344
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78276
78345
|
"deprecated": false,
|
|
78277
78346
|
"deprecationMessage": "",
|
|
78278
78347
|
"type": "",
|
|
78279
|
-
"defaultValue": "(
|
|
78280
|
-
}
|
|
78281
|
-
],
|
|
78282
|
-
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
78348
|
+
"defaultValue": "ModelTemplate.bind({})"
|
|
78349
|
+
},
|
|
78283
78350
|
{
|
|
78284
|
-
"name": "
|
|
78351
|
+
"name": "ModelTemplate",
|
|
78285
78352
|
"ctype": "miscellaneous",
|
|
78286
78353
|
"subtype": "variable",
|
|
78287
78354
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78288
78355
|
"deprecated": false,
|
|
78289
78356
|
"deprecationMessage": "",
|
|
78290
78357
|
"type": "",
|
|
78291
|
-
"defaultValue": "
|
|
78358
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems\n\t},\n\ttemplate: `\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"createBreadcrumbItems(itemCount, content)\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78292
78359
|
},
|
|
78293
78360
|
{
|
|
78294
|
-
"name": "
|
|
78361
|
+
"name": "ModelWithTemplate",
|
|
78295
78362
|
"ctype": "miscellaneous",
|
|
78296
78363
|
"subtype": "variable",
|
|
78297
78364
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78298
78365
|
"deprecated": false,
|
|
78299
78366
|
"deprecationMessage": "",
|
|
78300
|
-
"type": ""
|
|
78367
|
+
"type": "",
|
|
78368
|
+
"defaultValue": "ModelWTemplate.bind({})"
|
|
78301
78369
|
},
|
|
78302
78370
|
{
|
|
78303
|
-
"name": "
|
|
78371
|
+
"name": "ModelWTemplate",
|
|
78304
78372
|
"ctype": "miscellaneous",
|
|
78305
78373
|
"subtype": "variable",
|
|
78306
78374
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78307
78375
|
"deprecated": false,
|
|
78308
78376
|
"deprecationMessage": "",
|
|
78309
78377
|
"type": "",
|
|
78310
|
-
"defaultValue": "(
|
|
78378
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems,\n\t\twithTemplate\n\t},\n\ttemplate: `\n\t\t<ng-template #breadcrumbTemplate let-item>\n\t\t\t{{ templateContent }}{{ item.content }}\n\t\t</ng-template>\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"withTemplate(breadcrumbTemplate, createBreadcrumbItems(itemCount, content))\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78311
78379
|
},
|
|
78312
78380
|
{
|
|
78313
|
-
"name": "
|
|
78381
|
+
"name": "Skeleton",
|
|
78314
78382
|
"ctype": "miscellaneous",
|
|
78315
78383
|
"subtype": "variable",
|
|
78316
78384
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78317
78385
|
"deprecated": false,
|
|
78318
78386
|
"deprecationMessage": "",
|
|
78319
78387
|
"type": "",
|
|
78320
|
-
"defaultValue": "
|
|
78388
|
+
"defaultValue": "WithSkeleton.bind({})"
|
|
78321
78389
|
},
|
|
78322
78390
|
{
|
|
78323
|
-
"name": "
|
|
78391
|
+
"name": "Template",
|
|
78324
78392
|
"ctype": "miscellaneous",
|
|
78325
78393
|
"subtype": "variable",
|
|
78326
78394
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78327
78395
|
"deprecated": false,
|
|
78328
78396
|
"deprecationMessage": "",
|
|
78329
78397
|
"type": "",
|
|
78330
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item
|
|
78398
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78331
78399
|
},
|
|
78332
78400
|
{
|
|
78333
|
-
"name": "
|
|
78401
|
+
"name": "WithSkeleton",
|
|
78334
78402
|
"ctype": "miscellaneous",
|
|
78335
78403
|
"subtype": "variable",
|
|
78336
78404
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78337
78405
|
"deprecated": false,
|
|
78338
78406
|
"deprecationMessage": "",
|
|
78339
78407
|
"type": "",
|
|
78340
|
-
"defaultValue": "
|
|
78408
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb skeleton=\"true\" [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
78341
78409
|
},
|
|
78342
78410
|
{
|
|
78343
|
-
"name": "
|
|
78411
|
+
"name": "withTemplate",
|
|
78344
78412
|
"ctype": "miscellaneous",
|
|
78345
78413
|
"subtype": "variable",
|
|
78346
78414
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
78347
78415
|
"deprecated": false,
|
|
78348
78416
|
"deprecationMessage": "",
|
|
78349
78417
|
"type": "",
|
|
78350
|
-
"defaultValue": "(
|
|
78351
|
-
}
|
|
78418
|
+
"defaultValue": "(templateRef, items) => items.map(item => Object.assign(item, { template: templateRef }))"
|
|
78419
|
+
}
|
|
78420
|
+
],
|
|
78421
|
+
"src/button/button-set.stories.ts": [
|
|
78352
78422
|
{
|
|
78353
|
-
"name": "
|
|
78423
|
+
"name": "Basic",
|
|
78354
78424
|
"ctype": "miscellaneous",
|
|
78355
78425
|
"subtype": "variable",
|
|
78356
|
-
"file": "src/
|
|
78426
|
+
"file": "src/button/button-set.stories.ts",
|
|
78357
78427
|
"deprecated": false,
|
|
78358
78428
|
"deprecationMessage": "",
|
|
78359
78429
|
"type": "",
|
|
78360
|
-
"defaultValue": "
|
|
78430
|
+
"defaultValue": "Template.bind({})"
|
|
78361
78431
|
},
|
|
78362
78432
|
{
|
|
78363
|
-
"name": "
|
|
78433
|
+
"name": "Template",
|
|
78364
78434
|
"ctype": "miscellaneous",
|
|
78365
78435
|
"subtype": "variable",
|
|
78366
|
-
"file": "src/
|
|
78436
|
+
"file": "src/button/button-set.stories.ts",
|
|
78367
78437
|
"deprecated": false,
|
|
78368
78438
|
"deprecationMessage": "",
|
|
78369
78439
|
"type": "",
|
|
78370
|
-
"defaultValue": "(args) => ({\n\tprops:
|
|
78371
|
-
}
|
|
78440
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
78441
|
+
}
|
|
78442
|
+
],
|
|
78443
|
+
"src/button/button.stories.ts": [
|
|
78372
78444
|
{
|
|
78373
|
-
"name": "
|
|
78445
|
+
"name": "Basic",
|
|
78374
78446
|
"ctype": "miscellaneous",
|
|
78375
78447
|
"subtype": "variable",
|
|
78376
|
-
"file": "src/
|
|
78448
|
+
"file": "src/button/button.stories.ts",
|
|
78377
78449
|
"deprecated": false,
|
|
78378
78450
|
"deprecationMessage": "",
|
|
78379
78451
|
"type": "",
|
|
78380
|
-
"defaultValue": "
|
|
78452
|
+
"defaultValue": "Template.bind({})"
|
|
78381
78453
|
},
|
|
78382
78454
|
{
|
|
78383
78455
|
"name": "Template",
|
|
78384
78456
|
"ctype": "miscellaneous",
|
|
78385
78457
|
"subtype": "variable",
|
|
78386
|
-
"file": "src/
|
|
78458
|
+
"file": "src/button/button.stories.ts",
|
|
78387
78459
|
"deprecated": false,
|
|
78388
78460
|
"deprecationMessage": "",
|
|
78389
78461
|
"type": "",
|
|
78390
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
78462
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
78391
78463
|
},
|
|
78392
78464
|
{
|
|
78393
|
-
"name": "
|
|
78465
|
+
"name": "WithIcon",
|
|
78394
78466
|
"ctype": "miscellaneous",
|
|
78395
78467
|
"subtype": "variable",
|
|
78396
|
-
"file": "src/
|
|
78468
|
+
"file": "src/button/button.stories.ts",
|
|
78397
78469
|
"deprecated": false,
|
|
78398
78470
|
"deprecationMessage": "",
|
|
78399
78471
|
"type": "",
|
|
78400
|
-
"defaultValue": "(
|
|
78472
|
+
"defaultValue": "WithIconTemplate.bind({})"
|
|
78401
78473
|
},
|
|
78402
78474
|
{
|
|
78403
|
-
"name": "
|
|
78475
|
+
"name": "WithIconTemplate",
|
|
78404
78476
|
"ctype": "miscellaneous",
|
|
78405
78477
|
"subtype": "variable",
|
|
78406
|
-
"file": "src/
|
|
78478
|
+
"file": "src/button/button.stories.ts",
|
|
78407
78479
|
"deprecated": false,
|
|
78408
78480
|
"deprecationMessage": "",
|
|
78409
78481
|
"type": "",
|
|
78410
|
-
"defaultValue": "(
|
|
78482
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseleave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tWith icon\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n\t\t</button>\n\t`\n})"
|
|
78411
78483
|
}
|
|
78412
78484
|
],
|
|
78413
78485
|
"src/checkbox/checkbox.stories.ts": [
|
|
@@ -79287,6 +79359,16 @@
|
|
|
79287
79359
|
"type": "",
|
|
79288
79360
|
"defaultValue": "Template.bind({})"
|
|
79289
79361
|
},
|
|
79362
|
+
{
|
|
79363
|
+
"name": "Fluid",
|
|
79364
|
+
"ctype": "miscellaneous",
|
|
79365
|
+
"subtype": "variable",
|
|
79366
|
+
"file": "src/input/textarea.stories.ts",
|
|
79367
|
+
"deprecated": false,
|
|
79368
|
+
"deprecationMessage": "",
|
|
79369
|
+
"type": "",
|
|
79370
|
+
"defaultValue": "Template.bind({})"
|
|
79371
|
+
},
|
|
79290
79372
|
{
|
|
79291
79373
|
"name": "Skeleton",
|
|
79292
79374
|
"ctype": "miscellaneous",
|
|
@@ -79315,7 +79397,7 @@
|
|
|
79315
79397
|
"deprecated": false,
|
|
79316
79398
|
"deprecationMessage": "",
|
|
79317
79399
|
"type": "",
|
|
79318
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-textarea-label\n\t\t[helperText]=\"helperText\"\n\t\t[invalid]=\"invalid\"\n\t\t[disabled]=\"disabled\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\">\n\t\t{{label}}\n\t\t<textarea\n\t\t\tcdsTextArea\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[rows]=\"rows\"\n\t\t\t[cols]=\"cols\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\taria-label=\"textarea\"></textarea>\n\t\t</cds-textarea-label>\n\t`\n})"
|
|
79400
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-textarea-label\n\t\t[helperText]=\"helperText\"\n\t\t[invalid]=\"invalid\"\n\t\t[disabled]=\"disabled\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[fluid]=\"fluid\"\n\t\t[skeleton]=\"skeleton\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\">\n\t\t{{label}}\n\t\t<textarea\n\t\t\tcdsTextArea\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[rows]=\"rows\"\n\t\t\t[cols]=\"cols\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\taria-label=\"textarea\"></textarea>\n\t\t</cds-textarea-label>\n\t`\n})"
|
|
79319
79401
|
}
|
|
79320
79402
|
],
|
|
79321
79403
|
"src/layer/layer.stories.ts": [
|
|
@@ -85703,8 +85785,8 @@
|
|
|
85703
85785
|
"type": "directive",
|
|
85704
85786
|
"linktype": "directive",
|
|
85705
85787
|
"name": "TextArea",
|
|
85706
|
-
"coveragePercent":
|
|
85707
|
-
"coverageCount": "1/
|
|
85788
|
+
"coveragePercent": 12,
|
|
85789
|
+
"coverageCount": "1/8",
|
|
85708
85790
|
"status": "low"
|
|
85709
85791
|
},
|
|
85710
85792
|
{
|
|
@@ -85721,8 +85803,8 @@
|
|
|
85721
85803
|
"type": "component",
|
|
85722
85804
|
"linktype": "component",
|
|
85723
85805
|
"name": "TextareaLabelComponent",
|
|
85724
|
-
"coveragePercent":
|
|
85725
|
-
"coverageCount": "
|
|
85806
|
+
"coveragePercent": 60,
|
|
85807
|
+
"coverageCount": "14/23",
|
|
85726
85808
|
"status": "good"
|
|
85727
85809
|
},
|
|
85728
85810
|
{
|
|
@@ -85735,6 +85817,16 @@
|
|
|
85735
85817
|
"coverageCount": "0/1",
|
|
85736
85818
|
"status": "low"
|
|
85737
85819
|
},
|
|
85820
|
+
{
|
|
85821
|
+
"filePath": "src/input/textarea.stories.ts",
|
|
85822
|
+
"type": "variable",
|
|
85823
|
+
"linktype": "miscellaneous",
|
|
85824
|
+
"linksubtype": "variable",
|
|
85825
|
+
"name": "Fluid",
|
|
85826
|
+
"coveragePercent": 0,
|
|
85827
|
+
"coverageCount": "0/1",
|
|
85828
|
+
"status": "low"
|
|
85829
|
+
},
|
|
85738
85830
|
{
|
|
85739
85831
|
"filePath": "src/input/textarea.stories.ts",
|
|
85740
85832
|
"type": "variable",
|