carbon-components-angular 5.72.1 → 5.72.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/combobox.component.d.ts +3 -0
- package/datepicker/datepicker.component.d.ts +1 -1
- package/docs/documentation/components/ComboBox.html +214 -67
- package/docs/documentation/components/DatePicker.html +34 -34
- package/docs/documentation/components/Dropdown.html +347 -158
- package/docs/documentation/components/DropdownList.html +6 -2
- package/docs/documentation/components/ProgressIndicator.html +13 -9
- package/docs/documentation/components/RadioGroup.html +166 -77
- package/docs/documentation/coverage.html +46 -10
- package/docs/documentation/js/menu-wc_es5.js +1 -1
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/miscellaneous/functions.html +257 -1
- package/docs/documentation/modules/CheckboxModule/dependencies.svg +42 -42
- package/docs/documentation/modules/CheckboxModule.html +42 -42
- package/docs/documentation/modules/CodeSnippetModule/dependencies.svg +4 -4
- package/docs/documentation/modules/CodeSnippetModule.html +4 -4
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +6 -6
- package/docs/documentation/modules/ComboBoxModule.html +6 -6
- package/docs/documentation/modules/ContentSwitcherModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
- package/docs/documentation/modules/ContextMenuModule/dependencies.svg +67 -67
- package/docs/documentation/modules/ContextMenuModule.html +67 -67
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +4 -4
- package/docs/documentation/modules/DatePickerInputModule.html +4 -4
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +6 -6
- package/docs/documentation/modules/DatePickerModule.html +6 -6
- package/docs/documentation/modules/DialogModule/dependencies.svg +4 -4
- package/docs/documentation/modules/DialogModule.html +4 -4
- package/docs/documentation/modules/DropdownModule/dependencies.svg +68 -68
- package/docs/documentation/modules/DropdownModule.html +68 -68
- package/docs/documentation/modules/FileUploaderModule/dependencies.svg +37 -37
- package/docs/documentation/modules/FileUploaderModule.html +37 -37
- package/docs/documentation/modules/GridModule/dependencies.svg +4 -4
- package/docs/documentation/modules/GridModule.html +4 -4
- package/docs/documentation/modules/HeaderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/HeaderModule.html +4 -4
- package/docs/documentation/modules/I18nModule/dependencies.svg +14 -14
- package/docs/documentation/modules/I18nModule.html +14 -14
- package/docs/documentation/modules/IconModule/dependencies.svg +4 -4
- package/docs/documentation/modules/IconModule.html +4 -4
- package/docs/documentation/modules/InlineLoadingModule/dependencies.svg +15 -15
- package/docs/documentation/modules/InlineLoadingModule.html +15 -15
- package/docs/documentation/modules/InputModule/dependencies.svg +76 -76
- package/docs/documentation/modules/InputModule.html +76 -76
- package/docs/documentation/modules/LayoutModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LayoutModule.html +4 -4
- package/docs/documentation/modules/LinkModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LinkModule.html +4 -4
- package/docs/documentation/modules/MenuButtonModule/dependencies.svg +28 -28
- package/docs/documentation/modules/MenuButtonModule.html +28 -28
- package/docs/documentation/modules/ModalModule/dependencies.svg +115 -115
- package/docs/documentation/modules/ModalModule.html +115 -115
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NotificationModule/dependencies.svg +124 -124
- package/docs/documentation/modules/NotificationModule.html +124 -124
- package/docs/documentation/modules/NumberModule/dependencies.svg +24 -24
- package/docs/documentation/modules/NumberModule.html +24 -24
- package/docs/documentation/modules/PaginationModule/dependencies.svg +56 -56
- package/docs/documentation/modules/PaginationModule.html +56 -56
- package/docs/documentation/modules/PanelModule/dependencies.svg +4 -4
- package/docs/documentation/modules/PanelModule.html +4 -4
- package/docs/documentation/modules/PlaceholderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/PlaceholderModule.html +4 -4
- package/docs/documentation/modules/PopoverModule/dependencies.svg +4 -4
- package/docs/documentation/modules/PopoverModule.html +4 -4
- package/docs/documentation/modules/ProgressBarModule/dependencies.svg +12 -12
- package/docs/documentation/modules/ProgressBarModule.html +12 -12
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +24 -24
- package/docs/documentation/modules/ProgressIndicatorModule.html +24 -24
- package/docs/documentation/modules/RadioModule/dependencies.svg +61 -57
- package/docs/documentation/modules/RadioModule.html +61 -57
- package/docs/documentation/modules/SelectModule/dependencies.svg +60 -60
- package/docs/documentation/modules/SelectModule.html +60 -60
- package/docs/documentation/modules/SideNavModule/dependencies.svg +40 -40
- package/docs/documentation/modules/SideNavModule.html +40 -40
- package/docs/documentation/modules/SkeletonModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SkeletonModule.html +4 -4
- package/docs/documentation/modules/SliderModule/dependencies.svg +38 -42
- package/docs/documentation/modules/SliderModule.html +38 -42
- package/docs/documentation/modules/StructuredListModule/dependencies.svg +4 -4
- package/docs/documentation/modules/StructuredListModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TableModule.html +4 -4
- package/docs/documentation/modules/TabsModule/dependencies.svg +136 -136
- package/docs/documentation/modules/TabsModule.html +136 -136
- 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 +109 -109
- package/docs/documentation/modules/TilesModule.html +109 -109
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +17 -17
- package/docs/documentation/modules/TimePickerModule.html +17 -17
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +42 -38
- package/docs/documentation/modules/TimePickerSelectModule.html +42 -38
- package/docs/documentation/modules/ToggleModule/dependencies.svg +17 -17
- package/docs/documentation/modules/ToggleModule.html +17 -17
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +38 -38
- package/docs/documentation/modules/ToggletipModule.html +38 -38
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +28 -28
- package/docs/documentation/modules/TreeviewModule.html +28 -28
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +273 -748
- package/docs/storybook/3224.3c2075c3.iframe.bundle.js +1 -0
- package/docs/storybook/557.d4341469.iframe.bundle.js +1 -0
- package/docs/storybook/955.7522f55b.iframe.bundle.js +1 -0
- package/docs/storybook/combobox-combobox-stories.49ceebb5.iframe.bundle.js +1 -0
- package/docs/storybook/{datepicker-datepicker-stories.559a71ec.iframe.bundle.js → datepicker-datepicker-stories.71ef84d0.iframe.bundle.js} +1 -1
- package/docs/storybook/dropdown-dropdown-stories.cf59b2ab.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.5e4c090e.iframe.bundle.js +1 -0
- package/docs/storybook/modal-modal-stories.cc2d04cb.iframe.bundle.js +1 -0
- package/docs/storybook/{pagination-pagination-nav-stories.547eede3.iframe.bundle.js → pagination-pagination-nav-stories.01637d11.iframe.bundle.js} +1 -1
- package/docs/storybook/{pagination-pagination-stories.fa7c9094.iframe.bundle.js → pagination-pagination-stories.40d17ebd.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-dialogs-modal-with-table-stories.b72796c6.iframe.bundle.js → patterns-dialogs-modal-with-table-stories.8acaa07a.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-filtering-single-selection-stories.ec91f833.iframe.bundle.js → patterns-filtering-multi-selection-stories.a46a1d6e.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-filtering-multiple-categories-stories.531f27d7.iframe.bundle.js → patterns-filtering-multiple-categories-stories.740c719e.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-filtering-multi-selection-stories.9086f77f.iframe.bundle.js → patterns-filtering-single-selection-stories.cc647b4a.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-forms-multi-step-form-stories.8696062a.iframe.bundle.js → patterns-forms-multi-step-form-stories.495d62f5.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-loading-large-loading-stories.734fb9bc.iframe.bundle.js → patterns-loading-large-loading-stories.564e9ea6.iframe.bundle.js} +1 -1
- package/docs/storybook/{patterns-loading-progressive-loading-stories.10bcf9f2.iframe.bundle.js → patterns-loading-progressive-loading-stories.63165c09.iframe.bundle.js} +1 -1
- package/docs/storybook/{progress-indicator-progress-indicator-stories.dae29927.iframe.bundle.js → progress-indicator-progress-indicator-stories.f7da9e42.iframe.bundle.js} +1 -1
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/radio-radio-stories.8ff73370.iframe.bundle.js +1 -0
- package/docs/storybook/runtime~main.b2adb95b.iframe.bundle.js +1 -0
- package/docs/storybook/sb-addons/essentials-controls-1/manager-bundle.js +30 -30
- package/dropdown/dropdown.component.d.ts +10 -3
- package/dropdown/list/dropdown-list.component.d.ts +1 -1
- package/esm2020/combobox/combobox.component.mjs +19 -9
- package/esm2020/datepicker/datepicker.component.mjs +9 -9
- package/esm2020/dropdown/dropdown.component.mjs +37 -21
- package/esm2020/dropdown/list/dropdown-list.component.mjs +1 -1
- package/esm2020/progress-indicator/progress-indicator.component.mjs +8 -5
- package/esm2020/radio/radio-group.component.mjs +19 -7
- package/fesm2015/carbon-components-angular-combobox.mjs +18 -8
- package/fesm2015/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-datepicker.mjs +8 -8
- package/fesm2015/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-dropdown.mjs +37 -20
- package/fesm2015/carbon-components-angular-dropdown.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-progress-indicator.mjs +7 -4
- package/fesm2015/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-radio.mjs +18 -6
- package/fesm2015/carbon-components-angular-radio.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-combobox.mjs +18 -8
- package/fesm2020/carbon-components-angular-combobox.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker.mjs +8 -8
- package/fesm2020/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-dropdown.mjs +36 -20
- package/fesm2020/carbon-components-angular-dropdown.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-progress-indicator.mjs +7 -4
- package/fesm2020/carbon-components-angular-progress-indicator.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-radio.mjs +18 -6
- package/fesm2020/carbon-components-angular-radio.mjs.map +1 -1
- package/package.json +1 -1
- package/radio/radio-group.component.d.ts +4 -2
- package/docs/storybook/1250.47c381c1.iframe.bundle.js +0 -1
- package/docs/storybook/3224.3e279e46.iframe.bundle.js +0 -1
- package/docs/storybook/955.99b6ac85.iframe.bundle.js +0 -1
- package/docs/storybook/combobox-combobox-stories.e7427226.iframe.bundle.js +0 -1
- package/docs/storybook/dropdown-dropdown-stories.a76101be.iframe.bundle.js +0 -1
- package/docs/storybook/main.d2b9abb3.iframe.bundle.js +0 -1
- package/docs/storybook/modal-modal-stories.0a864a6a.iframe.bundle.js +0 -1
- package/docs/storybook/radio-radio-stories.444fc044.iframe.bundle.js +0 -1
- package/docs/storybook/runtime~main.86875b86.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -5401,333 +5401,6 @@
|
|
|
5401
5401
|
"guards": [],
|
|
5402
5402
|
"interceptors": [],
|
|
5403
5403
|
"classes": [
|
|
5404
|
-
{
|
|
5405
|
-
"name": "CheckboxExportedTests",
|
|
5406
|
-
"id": "class-CheckboxExportedTests-8affd6b64e31427d567ce5cccb33165a969637d1cc13fac2ac2a4f784ec79f065e254ab87629c3fff06f3492a5402c0b72dab3b809dcc985a6569f5cc5272ebb",
|
|
5407
|
-
"file": "src/checkbox/checkbox-exported-tests.ts",
|
|
5408
|
-
"deprecated": false,
|
|
5409
|
-
"deprecationMessage": "",
|
|
5410
|
-
"type": "class",
|
|
5411
|
-
"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",
|
|
5412
|
-
"constructorObj": {
|
|
5413
|
-
"name": "constructor",
|
|
5414
|
-
"description": "",
|
|
5415
|
-
"deprecated": false,
|
|
5416
|
-
"deprecationMessage": "",
|
|
5417
|
-
"args": [
|
|
5418
|
-
{
|
|
5419
|
-
"name": "configs",
|
|
5420
|
-
"type": "",
|
|
5421
|
-
"deprecated": false,
|
|
5422
|
-
"deprecationMessage": ""
|
|
5423
|
-
}
|
|
5424
|
-
],
|
|
5425
|
-
"line": 12,
|
|
5426
|
-
"jsdoctags": [
|
|
5427
|
-
{
|
|
5428
|
-
"name": "configs",
|
|
5429
|
-
"type": "",
|
|
5430
|
-
"deprecated": false,
|
|
5431
|
-
"deprecationMessage": "",
|
|
5432
|
-
"tagName": {
|
|
5433
|
-
"text": "param"
|
|
5434
|
-
}
|
|
5435
|
-
}
|
|
5436
|
-
]
|
|
5437
|
-
},
|
|
5438
|
-
"inputsClass": [],
|
|
5439
|
-
"outputsClass": [],
|
|
5440
|
-
"properties": [
|
|
5441
|
-
{
|
|
5442
|
-
"name": "defaults",
|
|
5443
|
-
"defaultValue": "{\n\t\tselectors: {\n\t\t\troot: \"\"\n\t\t},\n\t\tclasses: {}\n\t}",
|
|
5444
|
-
"deprecated": false,
|
|
5445
|
-
"deprecationMessage": "",
|
|
5446
|
-
"type": "object",
|
|
5447
|
-
"optional": false,
|
|
5448
|
-
"description": "",
|
|
5449
|
-
"line": 11,
|
|
5450
|
-
"modifierKind": [
|
|
5451
|
-
126
|
|
5452
|
-
],
|
|
5453
|
-
"inheritance": {
|
|
5454
|
-
"file": "ComponentTests"
|
|
5455
|
-
}
|
|
5456
|
-
},
|
|
5457
|
-
{
|
|
5458
|
-
"name": "settings",
|
|
5459
|
-
"defaultValue": "{}",
|
|
5460
|
-
"deprecated": false,
|
|
5461
|
-
"deprecationMessage": "",
|
|
5462
|
-
"type": "any",
|
|
5463
|
-
"optional": false,
|
|
5464
|
-
"description": "",
|
|
5465
|
-
"line": 17,
|
|
5466
|
-
"inheritance": {
|
|
5467
|
-
"file": "ComponentTests"
|
|
5468
|
-
}
|
|
5469
|
-
},
|
|
5470
|
-
{
|
|
5471
|
-
"name": "tests",
|
|
5472
|
-
"defaultValue": "[]",
|
|
5473
|
-
"deprecated": false,
|
|
5474
|
-
"deprecationMessage": "",
|
|
5475
|
-
"type": "any[]",
|
|
5476
|
-
"optional": false,
|
|
5477
|
-
"description": "",
|
|
5478
|
-
"line": 18,
|
|
5479
|
-
"inheritance": {
|
|
5480
|
-
"file": "ComponentTests"
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
],
|
|
5484
|
-
"methods": [
|
|
5485
|
-
{
|
|
5486
|
-
"name": "structure",
|
|
5487
|
-
"args": [],
|
|
5488
|
-
"optional": false,
|
|
5489
|
-
"returnType": "{}",
|
|
5490
|
-
"typeParameters": [],
|
|
5491
|
-
"line": 18,
|
|
5492
|
-
"deprecated": false,
|
|
5493
|
-
"deprecationMessage": ""
|
|
5494
|
-
},
|
|
5495
|
-
{
|
|
5496
|
-
"name": "getComponent",
|
|
5497
|
-
"args": [
|
|
5498
|
-
{
|
|
5499
|
-
"name": "fragment",
|
|
5500
|
-
"type": "",
|
|
5501
|
-
"deprecated": false,
|
|
5502
|
-
"deprecationMessage": ""
|
|
5503
|
-
},
|
|
5504
|
-
{
|
|
5505
|
-
"name": "selector",
|
|
5506
|
-
"type": "",
|
|
5507
|
-
"deprecated": false,
|
|
5508
|
-
"deprecationMessage": ""
|
|
5509
|
-
}
|
|
5510
|
-
],
|
|
5511
|
-
"optional": false,
|
|
5512
|
-
"returnType": "any",
|
|
5513
|
-
"typeParameters": [],
|
|
5514
|
-
"line": 31,
|
|
5515
|
-
"deprecated": false,
|
|
5516
|
-
"deprecationMessage": "",
|
|
5517
|
-
"jsdoctags": [
|
|
5518
|
-
{
|
|
5519
|
-
"name": "fragment",
|
|
5520
|
-
"type": "",
|
|
5521
|
-
"deprecated": false,
|
|
5522
|
-
"deprecationMessage": "",
|
|
5523
|
-
"tagName": {
|
|
5524
|
-
"text": "param"
|
|
5525
|
-
}
|
|
5526
|
-
},
|
|
5527
|
-
{
|
|
5528
|
-
"name": "selector",
|
|
5529
|
-
"type": "",
|
|
5530
|
-
"deprecated": false,
|
|
5531
|
-
"deprecationMessage": "",
|
|
5532
|
-
"tagName": {
|
|
5533
|
-
"text": "param"
|
|
5534
|
-
}
|
|
5535
|
-
}
|
|
5536
|
-
],
|
|
5537
|
-
"inheritance": {
|
|
5538
|
-
"file": "ComponentTests"
|
|
5539
|
-
}
|
|
5540
|
-
},
|
|
5541
|
-
{
|
|
5542
|
-
"name": "getTests",
|
|
5543
|
-
"args": [
|
|
5544
|
-
{
|
|
5545
|
-
"name": "tests",
|
|
5546
|
-
"type": "",
|
|
5547
|
-
"deprecated": false,
|
|
5548
|
-
"deprecationMessage": ""
|
|
5549
|
-
}
|
|
5550
|
-
],
|
|
5551
|
-
"optional": false,
|
|
5552
|
-
"returnType": "any",
|
|
5553
|
-
"typeParameters": [],
|
|
5554
|
-
"line": 24,
|
|
5555
|
-
"deprecated": false,
|
|
5556
|
-
"deprecationMessage": "",
|
|
5557
|
-
"jsdoctags": [
|
|
5558
|
-
{
|
|
5559
|
-
"name": "tests",
|
|
5560
|
-
"type": "",
|
|
5561
|
-
"deprecated": false,
|
|
5562
|
-
"deprecationMessage": "",
|
|
5563
|
-
"tagName": {
|
|
5564
|
-
"text": "param"
|
|
5565
|
-
}
|
|
5566
|
-
}
|
|
5567
|
-
],
|
|
5568
|
-
"inheritance": {
|
|
5569
|
-
"file": "ComponentTests"
|
|
5570
|
-
}
|
|
5571
|
-
}
|
|
5572
|
-
],
|
|
5573
|
-
"indexSignatures": [],
|
|
5574
|
-
"extends": [
|
|
5575
|
-
"ComponentTests"
|
|
5576
|
-
],
|
|
5577
|
-
"hostBindings": [],
|
|
5578
|
-
"hostListeners": []
|
|
5579
|
-
},
|
|
5580
|
-
{
|
|
5581
|
-
"name": "ComponentTests",
|
|
5582
|
-
"id": "class-ComponentTests-570443a7237adc3e663bcb3ca106de54f8e8cc0ebfcc230b0e3b5b7b379888a1916d9e4633ef24e1c9784c6da4ffe0c94b041f3768bd78ad27029c63a5fe0802",
|
|
5583
|
-
"file": "src/exported-tests/component-tests.ts",
|
|
5584
|
-
"deprecated": false,
|
|
5585
|
-
"deprecationMessage": "",
|
|
5586
|
-
"type": "class",
|
|
5587
|
-
"sourceCode": "import merge from \"lodash-es/merge\";\n\nfunction isObject(val) {\n\tif (val === null) {\n\t\treturn false;\n\t}\n\treturn typeof val === \"function\" || typeof val === \"object\";\n}\n\nclass ComponentTests {\n\tstatic defaults = {\n\t\tselectors: {\n\t\t\troot: \"\"\n\t\t},\n\t\tclasses: {}\n\t};\n\tsettings: any = {};\n\ttests: any[] = [];\n\n\tconstructor(configs = {}) {\n\t\tthis.settings = merge({}, ComponentTests.defaults, configs);\n\t}\n\n\tgetTests(tests) {\n\t\tif (isObject(tests)) {\n\t\t\treturn Object.keys(tests).map(i => tests[i]);\n\t\t}\n\t\treturn tests;\n\t}\n\n\tgetComponent(fragment, selector) {\n\t\tconst root = fragment.querySelector(selector);\n\t\treturn root;\n\t}\n}\n\nexport default ComponentTests;\n",
|
|
5588
|
-
"constructorObj": {
|
|
5589
|
-
"name": "constructor",
|
|
5590
|
-
"description": "",
|
|
5591
|
-
"deprecated": false,
|
|
5592
|
-
"deprecationMessage": "",
|
|
5593
|
-
"args": [
|
|
5594
|
-
{
|
|
5595
|
-
"name": "configs",
|
|
5596
|
-
"type": "object",
|
|
5597
|
-
"deprecated": false,
|
|
5598
|
-
"deprecationMessage": "",
|
|
5599
|
-
"defaultValue": "{}"
|
|
5600
|
-
}
|
|
5601
|
-
],
|
|
5602
|
-
"line": 18,
|
|
5603
|
-
"jsdoctags": [
|
|
5604
|
-
{
|
|
5605
|
-
"name": "configs",
|
|
5606
|
-
"type": "object",
|
|
5607
|
-
"deprecated": false,
|
|
5608
|
-
"deprecationMessage": "",
|
|
5609
|
-
"defaultValue": "{}",
|
|
5610
|
-
"tagName": {
|
|
5611
|
-
"text": "param"
|
|
5612
|
-
}
|
|
5613
|
-
}
|
|
5614
|
-
]
|
|
5615
|
-
},
|
|
5616
|
-
"inputsClass": [],
|
|
5617
|
-
"outputsClass": [],
|
|
5618
|
-
"properties": [
|
|
5619
|
-
{
|
|
5620
|
-
"name": "defaults",
|
|
5621
|
-
"defaultValue": "{\n\t\tselectors: {\n\t\t\troot: \"\"\n\t\t},\n\t\tclasses: {}\n\t}",
|
|
5622
|
-
"deprecated": false,
|
|
5623
|
-
"deprecationMessage": "",
|
|
5624
|
-
"type": "object",
|
|
5625
|
-
"optional": false,
|
|
5626
|
-
"description": "",
|
|
5627
|
-
"line": 11,
|
|
5628
|
-
"modifierKind": [
|
|
5629
|
-
126
|
|
5630
|
-
]
|
|
5631
|
-
},
|
|
5632
|
-
{
|
|
5633
|
-
"name": "settings",
|
|
5634
|
-
"defaultValue": "{}",
|
|
5635
|
-
"deprecated": false,
|
|
5636
|
-
"deprecationMessage": "",
|
|
5637
|
-
"type": "any",
|
|
5638
|
-
"optional": false,
|
|
5639
|
-
"description": "",
|
|
5640
|
-
"line": 17
|
|
5641
|
-
},
|
|
5642
|
-
{
|
|
5643
|
-
"name": "tests",
|
|
5644
|
-
"defaultValue": "[]",
|
|
5645
|
-
"deprecated": false,
|
|
5646
|
-
"deprecationMessage": "",
|
|
5647
|
-
"type": "any[]",
|
|
5648
|
-
"optional": false,
|
|
5649
|
-
"description": "",
|
|
5650
|
-
"line": 18
|
|
5651
|
-
}
|
|
5652
|
-
],
|
|
5653
|
-
"methods": [
|
|
5654
|
-
{
|
|
5655
|
-
"name": "getComponent",
|
|
5656
|
-
"args": [
|
|
5657
|
-
{
|
|
5658
|
-
"name": "fragment",
|
|
5659
|
-
"type": "",
|
|
5660
|
-
"deprecated": false,
|
|
5661
|
-
"deprecationMessage": ""
|
|
5662
|
-
},
|
|
5663
|
-
{
|
|
5664
|
-
"name": "selector",
|
|
5665
|
-
"type": "",
|
|
5666
|
-
"deprecated": false,
|
|
5667
|
-
"deprecationMessage": ""
|
|
5668
|
-
}
|
|
5669
|
-
],
|
|
5670
|
-
"optional": false,
|
|
5671
|
-
"returnType": "any",
|
|
5672
|
-
"typeParameters": [],
|
|
5673
|
-
"line": 31,
|
|
5674
|
-
"deprecated": false,
|
|
5675
|
-
"deprecationMessage": "",
|
|
5676
|
-
"jsdoctags": [
|
|
5677
|
-
{
|
|
5678
|
-
"name": "fragment",
|
|
5679
|
-
"type": "",
|
|
5680
|
-
"deprecated": false,
|
|
5681
|
-
"deprecationMessage": "",
|
|
5682
|
-
"tagName": {
|
|
5683
|
-
"text": "param"
|
|
5684
|
-
}
|
|
5685
|
-
},
|
|
5686
|
-
{
|
|
5687
|
-
"name": "selector",
|
|
5688
|
-
"type": "",
|
|
5689
|
-
"deprecated": false,
|
|
5690
|
-
"deprecationMessage": "",
|
|
5691
|
-
"tagName": {
|
|
5692
|
-
"text": "param"
|
|
5693
|
-
}
|
|
5694
|
-
}
|
|
5695
|
-
]
|
|
5696
|
-
},
|
|
5697
|
-
{
|
|
5698
|
-
"name": "getTests",
|
|
5699
|
-
"args": [
|
|
5700
|
-
{
|
|
5701
|
-
"name": "tests",
|
|
5702
|
-
"type": "",
|
|
5703
|
-
"deprecated": false,
|
|
5704
|
-
"deprecationMessage": ""
|
|
5705
|
-
}
|
|
5706
|
-
],
|
|
5707
|
-
"optional": false,
|
|
5708
|
-
"returnType": "any",
|
|
5709
|
-
"typeParameters": [],
|
|
5710
|
-
"line": 24,
|
|
5711
|
-
"deprecated": false,
|
|
5712
|
-
"deprecationMessage": "",
|
|
5713
|
-
"jsdoctags": [
|
|
5714
|
-
{
|
|
5715
|
-
"name": "tests",
|
|
5716
|
-
"type": "",
|
|
5717
|
-
"deprecated": false,
|
|
5718
|
-
"deprecationMessage": "",
|
|
5719
|
-
"tagName": {
|
|
5720
|
-
"text": "param"
|
|
5721
|
-
}
|
|
5722
|
-
}
|
|
5723
|
-
]
|
|
5724
|
-
}
|
|
5725
|
-
],
|
|
5726
|
-
"indexSignatures": [],
|
|
5727
|
-
"extends": [],
|
|
5728
|
-
"hostBindings": [],
|
|
5729
|
-
"hostListeners": []
|
|
5730
|
-
},
|
|
5731
5404
|
{
|
|
5732
5405
|
"name": "CustomHeaderItem",
|
|
5733
5406
|
"id": "class-CustomHeaderItem-43dec1fee39d015661af87a2e0758230b3fe81f583b813b9295a920fa61c1f02e93d480424afab37673e46ee64fddb53093c74715a7b4269e5e642504d5fa75b",
|
|
@@ -26053,7 +25726,7 @@
|
|
|
26053
25726
|
},
|
|
26054
25727
|
{
|
|
26055
25728
|
"name": "ComboBox",
|
|
26056
|
-
"id": "component-ComboBox-
|
|
25729
|
+
"id": "component-ComboBox-efa282052e0cf1f3c3085852368cf9ab633555f4a730773591e42493ec4569bcb4bf3ca55391c4827e6ab2f1940bb941c81bbde8fa326e6f0e291512c7a9d8b4",
|
|
26057
25730
|
"file": "src/combobox/combobox.component.ts",
|
|
26058
25731
|
"encapsulation": [],
|
|
26059
25732
|
"entryComponents": [],
|
|
@@ -26654,7 +26327,7 @@
|
|
|
26654
26327
|
"optional": false,
|
|
26655
26328
|
"returnType": "void",
|
|
26656
26329
|
"typeParameters": [],
|
|
26657
|
-
"line":
|
|
26330
|
+
"line": 878,
|
|
26658
26331
|
"deprecated": false,
|
|
26659
26332
|
"deprecationMessage": "",
|
|
26660
26333
|
"rawdescription": "\n\nCreates the `Dropdown` list as an element that is appended to the DOM body.\n",
|
|
@@ -26666,7 +26339,7 @@
|
|
|
26666
26339
|
"optional": false,
|
|
26667
26340
|
"returnType": "void",
|
|
26668
26341
|
"typeParameters": [],
|
|
26669
|
-
"line":
|
|
26342
|
+
"line": 889,
|
|
26670
26343
|
"deprecated": false,
|
|
26671
26344
|
"deprecationMessage": "",
|
|
26672
26345
|
"rawdescription": "\n\nCreates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n",
|
|
@@ -26685,7 +26358,7 @@
|
|
|
26685
26358
|
"optional": false,
|
|
26686
26359
|
"returnType": "void",
|
|
26687
26360
|
"typeParameters": [],
|
|
26688
|
-
"line":
|
|
26361
|
+
"line": 858,
|
|
26689
26362
|
"deprecated": false,
|
|
26690
26363
|
"deprecationMessage": "",
|
|
26691
26364
|
"rawdescription": "\n\nHandles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n",
|
|
@@ -26708,7 +26381,7 @@
|
|
|
26708
26381
|
"optional": false,
|
|
26709
26382
|
"returnType": "void",
|
|
26710
26383
|
"typeParameters": [],
|
|
26711
|
-
"line":
|
|
26384
|
+
"line": 635,
|
|
26712
26385
|
"deprecated": false,
|
|
26713
26386
|
"deprecationMessage": ""
|
|
26714
26387
|
},
|
|
@@ -26725,7 +26398,7 @@
|
|
|
26725
26398
|
"optional": false,
|
|
26726
26399
|
"returnType": "void",
|
|
26727
26400
|
"typeParameters": [],
|
|
26728
|
-
"line":
|
|
26401
|
+
"line": 918,
|
|
26729
26402
|
"deprecated": false,
|
|
26730
26403
|
"deprecationMessage": "",
|
|
26731
26404
|
"rawdescription": "\n\nHandles clicks outside of the `Dropdown` list.\n",
|
|
@@ -26748,7 +26421,7 @@
|
|
|
26748
26421
|
"optional": false,
|
|
26749
26422
|
"returnType": "any",
|
|
26750
26423
|
"typeParameters": [],
|
|
26751
|
-
"line":
|
|
26424
|
+
"line": 898,
|
|
26752
26425
|
"deprecated": false,
|
|
26753
26426
|
"deprecationMessage": "",
|
|
26754
26427
|
"rawdescription": "\n\nDetects whether or not the `Dropdown` list is visible within all scrollable parents.\nThis can be overridden by passing in a value to the `dropUp` input.\n",
|
|
@@ -26767,7 +26440,7 @@
|
|
|
26767
26440
|
"optional": false,
|
|
26768
26441
|
"returnType": "void",
|
|
26769
26442
|
"typeParameters": [],
|
|
26770
|
-
"line":
|
|
26443
|
+
"line": 830,
|
|
26771
26444
|
"deprecated": false,
|
|
26772
26445
|
"deprecationMessage": "",
|
|
26773
26446
|
"jsdoctags": [
|
|
@@ -26795,7 +26468,7 @@
|
|
|
26795
26468
|
"optional": false,
|
|
26796
26469
|
"returnType": "void",
|
|
26797
26470
|
"typeParameters": [],
|
|
26798
|
-
"line":
|
|
26471
|
+
"line": 704,
|
|
26799
26472
|
"deprecated": false,
|
|
26800
26473
|
"deprecationMessage": "",
|
|
26801
26474
|
"modifierKind": [
|
|
@@ -26819,7 +26492,7 @@
|
|
|
26819
26492
|
"optional": false,
|
|
26820
26493
|
"returnType": "void",
|
|
26821
26494
|
"typeParameters": [],
|
|
26822
|
-
"line":
|
|
26495
|
+
"line": 738,
|
|
26823
26496
|
"deprecated": false,
|
|
26824
26497
|
"deprecationMessage": "",
|
|
26825
26498
|
"rawdescription": "\n\nCloses the dropdown and emits the close event.\n",
|
|
@@ -26841,7 +26514,7 @@
|
|
|
26841
26514
|
"optional": false,
|
|
26842
26515
|
"returnType": "void",
|
|
26843
26516
|
"typeParameters": [],
|
|
26844
|
-
"line":
|
|
26517
|
+
"line": 927,
|
|
26845
26518
|
"deprecated": false,
|
|
26846
26519
|
"deprecationMessage": "",
|
|
26847
26520
|
"jsdoctags": [
|
|
@@ -26869,7 +26542,7 @@
|
|
|
26869
26542
|
"optional": false,
|
|
26870
26543
|
"returnType": "void",
|
|
26871
26544
|
"typeParameters": [],
|
|
26872
|
-
"line":
|
|
26545
|
+
"line": 610,
|
|
26873
26546
|
"deprecated": false,
|
|
26874
26547
|
"deprecationMessage": "",
|
|
26875
26548
|
"rawdescription": "\n\nHandles `Escape/Tab` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n",
|
|
@@ -26908,7 +26581,7 @@
|
|
|
26908
26581
|
"optional": false,
|
|
26909
26582
|
"returnType": "boolean",
|
|
26910
26583
|
"typeParameters": [],
|
|
26911
|
-
"line":
|
|
26584
|
+
"line": 851,
|
|
26912
26585
|
"deprecated": false,
|
|
26913
26586
|
"deprecationMessage": "",
|
|
26914
26587
|
"modifierKind": [
|
|
@@ -26932,7 +26605,7 @@
|
|
|
26932
26605
|
"optional": false,
|
|
26933
26606
|
"returnType": "void",
|
|
26934
26607
|
"typeParameters": [],
|
|
26935
|
-
"line":
|
|
26608
|
+
"line": 674,
|
|
26936
26609
|
"deprecated": false,
|
|
26937
26610
|
"deprecationMessage": ""
|
|
26938
26611
|
},
|
|
@@ -26956,7 +26629,7 @@
|
|
|
26956
26629
|
"optional": false,
|
|
26957
26630
|
"returnType": "void",
|
|
26958
26631
|
"typeParameters": [],
|
|
26959
|
-
"line":
|
|
26632
|
+
"line": 786,
|
|
26960
26633
|
"deprecated": false,
|
|
26961
26634
|
"deprecationMessage": "",
|
|
26962
26635
|
"rawdescription": "\n\nSets the list group filter, and manages single select item selection.\n",
|
|
@@ -26999,7 +26672,7 @@
|
|
|
26999
26672
|
"optional": false,
|
|
27000
26673
|
"returnType": "void",
|
|
27001
26674
|
"typeParameters": [],
|
|
27002
|
-
"line":
|
|
26675
|
+
"line": 819,
|
|
27003
26676
|
"deprecated": false,
|
|
27004
26677
|
"deprecationMessage": "",
|
|
27005
26678
|
"rawdescription": "\n\nIntended to be used to add items to the list.\n",
|
|
@@ -27025,7 +26698,7 @@
|
|
|
27025
26698
|
"optional": false,
|
|
27026
26699
|
"returnType": "void",
|
|
27027
26700
|
"typeParameters": [],
|
|
27028
|
-
"line":
|
|
26701
|
+
"line": 752,
|
|
27029
26702
|
"deprecated": false,
|
|
27030
26703
|
"deprecationMessage": "",
|
|
27031
26704
|
"rawdescription": "\n\nOpens the dropdown.\n",
|
|
@@ -27047,7 +26720,7 @@
|
|
|
27047
26720
|
"optional": false,
|
|
27048
26721
|
"returnType": "void",
|
|
27049
26722
|
"typeParameters": [],
|
|
27050
|
-
"line":
|
|
26723
|
+
"line": 678,
|
|
27051
26724
|
"deprecated": false,
|
|
27052
26725
|
"deprecationMessage": "",
|
|
27053
26726
|
"jsdoctags": [
|
|
@@ -27075,7 +26748,7 @@
|
|
|
27075
26748
|
"optional": false,
|
|
27076
26749
|
"returnType": "void",
|
|
27077
26750
|
"typeParameters": [],
|
|
27078
|
-
"line":
|
|
26751
|
+
"line": 683,
|
|
27079
26752
|
"deprecated": false,
|
|
27080
26753
|
"deprecationMessage": "",
|
|
27081
26754
|
"jsdoctags": [
|
|
@@ -27103,7 +26776,7 @@
|
|
|
27103
26776
|
"optional": false,
|
|
27104
26777
|
"returnType": "void",
|
|
27105
26778
|
"typeParameters": [],
|
|
27106
|
-
"line":
|
|
26779
|
+
"line": 692,
|
|
27107
26780
|
"deprecated": false,
|
|
27108
26781
|
"deprecationMessage": "",
|
|
27109
26782
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the combobox.\n\nex: `this.formGroup.get(\"myCoolCombobox\").disable();`\n",
|
|
@@ -27126,7 +26799,7 @@
|
|
|
27126
26799
|
"optional": false,
|
|
27127
26800
|
"returnType": "void",
|
|
27128
26801
|
"typeParameters": [],
|
|
27129
|
-
"line":
|
|
26802
|
+
"line": 775,
|
|
27130
26803
|
"deprecated": false,
|
|
27131
26804
|
"deprecationMessage": "",
|
|
27132
26805
|
"rawdescription": "\n\nToggles the dropdown.\n",
|
|
@@ -27141,7 +26814,7 @@
|
|
|
27141
26814
|
"optional": false,
|
|
27142
26815
|
"returnType": "void",
|
|
27143
26816
|
"typeParameters": [],
|
|
27144
|
-
"line":
|
|
26817
|
+
"line": 699,
|
|
27145
26818
|
"deprecated": false,
|
|
27146
26819
|
"deprecationMessage": "",
|
|
27147
26820
|
"rawdescription": "\n\nCalled by `n-pill-input` when the selected pills have changed.\n",
|
|
@@ -27163,7 +26836,7 @@
|
|
|
27163
26836
|
"optional": false,
|
|
27164
26837
|
"returnType": "void",
|
|
27165
26838
|
"typeParameters": [],
|
|
27166
|
-
"line":
|
|
26839
|
+
"line": 640,
|
|
27167
26840
|
"deprecated": false,
|
|
27168
26841
|
"deprecationMessage": "",
|
|
27169
26842
|
"jsdoctags": [
|
|
@@ -27210,7 +26883,7 @@
|
|
|
27210
26883
|
"deprecationMessage": "",
|
|
27211
26884
|
"rawdescription": "\n\nHandles `Escape/Tab` key closing the dropdown, and arrow up/down focus to/from the dropdown list.\n",
|
|
27212
26885
|
"description": "<p>Handles <code>Escape/Tab</code> key closing the dropdown, and arrow up/down focus to/from the dropdown list.</p>\n",
|
|
27213
|
-
"line":
|
|
26886
|
+
"line": 610
|
|
27214
26887
|
}
|
|
27215
26888
|
],
|
|
27216
26889
|
"standalone": false,
|
|
@@ -27218,7 +26891,7 @@
|
|
|
27218
26891
|
"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",
|
|
27219
26892
|
"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",
|
|
27220
26893
|
"type": "component",
|
|
27221
|
-
"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\n\t\t\tclass=\"cds--list-box__wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box__wrapper--fluid': fluid,\n\t\t\t\t'cds--list-box__wrapper--fluid--invalid': fluid && invalid,\n\t\t\t\t'cds--list-box__wrapper--fluid--focus': fluid && _isFocused,\n\t\t\t\t'cds--list-box__wrapper--decorator': !!decorator\n\t\t\t}\">\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\t'cds--list-box--invalid': invalid\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(focus)=\"fluid ? handleFocus($event) : null\"\n\t\t\t\t\t\t(blur)=\"fluid ? handleFocus($event) : 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<ng-container *ngIf=\"decorator\">\n\t\t\t\t\t<div class=\"cds--list-box__inner-wrapper--decorator\">\n\t\t\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\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<hr *ngIf=\"fluid\" class=\"cds--list-box__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\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\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: 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 * Experimental: enable fluid state\n\t */\n\t@Input() fluid = 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\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\tprotected _isFocused = false;\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\tthis.closeDropdown();\n\t\t\t\t\t}\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/**\n\t\t * @todo - In next major version update to the following:\n\t\t * const selected = this.type === \"multi\" ? this.view.getSelected() : undefined;\n\t\t *\n\t\t * Previously it returned an empty array even for type === 'single'\n\t\t * Also resolve #ref-1245723\n\t\t */\n\t\t// On type=multi we just emit getSelected() (just in case there's any disabled but selected items)\n\t\tconst selected = this.view.getSelected();\n\n\t\t// in case there are disabled items they should be mapped according to itemValueKey\n\t\tif (this.itemValueKey && selected) {\n\t\t\tconst values = selected.map((item) => item[this.itemValueKey]);\n\t\t\tthis.propagateChangeCallback(values);\n\t\t} else {\n\t\t\tthis.propagateChangeCallback(selected);\n\t\t}\n\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\thandleFocus(event: FocusEvent) {\n\t\tthis._isFocused = event.type === \"focus\";\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",
|
|
26894
|
+
"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\n\t\t\tclass=\"cds--list-box__wrapper\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box__wrapper--fluid': fluid,\n\t\t\t\t'cds--list-box__wrapper--fluid--invalid': fluid && invalid,\n\t\t\t\t'cds--list-box__wrapper--fluid--focus': fluid && _isFocused,\n\t\t\t\t'cds--list-box__wrapper--decorator': !!decorator\n\t\t\t}\">\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\t'cds--list-box--invalid': invalid\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(focus)=\"fluid ? handleFocus($event) : null\"\n\t\t\t\t\t\t(blur)=\"fluid ? handleFocus($event) : 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<ng-container *ngIf=\"decorator\">\n\t\t\t\t\t<div class=\"cds--list-box__inner-wrapper--decorator\">\n\t\t\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\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<hr *ngIf=\"fluid\" class=\"cds--list-box__divider\" />\n\t\t\t<div\n\t\t\t\t*ngIf=\"helperText && !invalid && !warn && !fluid\"\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\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: 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 * Experimental: enable fluid state\n\t */\n\t@Input() fluid = 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\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\tprotected _isFocused = false;\n\n\tprivate _writtenValue: any;\n\tprivate _isUsingNgControl = false;\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._propagateChange(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._propagateChange(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._propagateChange(event.item[this.itemValueKey]);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._propagateChange(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._propagateChange(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\tthis.closeDropdown();\n\t\t\t\t\t} else if (this._isUsingNgControl) {\n\t\t\t\t\t\tthis.writeValue(this._writtenValue);\n\t\t\t\t\t}\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\tthis._writtenValue = value;\n\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._isUsingNgControl = true;\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.propagateSelected([]);\n\t\tthis.updatePills();\n\t\t/**\n\t\t * @todo - In next major version update to the following:\n\t\t * const selected = this.type === \"multi\" ? this.view.getSelected() : undefined;\n\t\t *\n\t\t * Previously it returned an empty array even for type === 'single'\n\t\t * Also resolve #ref-1245723\n\t\t */\n\t\t// On type=multi we just emit getSelected() (just in case there's any disabled but selected items)\n\t\tconst selected = this.view.getSelected();\n\n\t\t// in case there are disabled items they should be mapped according to itemValueKey\n\t\tif (this.itemValueKey && selected) {\n\t\t\tconst values = selected.map((item) => item[this.itemValueKey]);\n\t\t\tthis._propagateChange(values);\n\t\t} else {\n\t\t\tthis._propagateChange(selected);\n\t\t}\n\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\thandleFocus(event: FocusEvent) {\n\t\tthis._isFocused = event.type === \"focus\";\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\tprivate _propagateChange(value: any) {\n\t\tthis._writtenValue = value;\n\t\tthis.propagateChangeCallback(value);\n\t}\n}\n",
|
|
27222
26895
|
"assetsDirs": [],
|
|
27223
26896
|
"styleUrlsData": "",
|
|
27224
26897
|
"stylesData": "",
|
|
@@ -27247,7 +26920,7 @@
|
|
|
27247
26920
|
"deprecationMessage": ""
|
|
27248
26921
|
}
|
|
27249
26922
|
],
|
|
27250
|
-
"line":
|
|
26923
|
+
"line": 485,
|
|
27251
26924
|
"rawdescription": "\n\nCreates an instance of ComboBox.\n",
|
|
27252
26925
|
"jsdoctags": [
|
|
27253
26926
|
{
|
|
@@ -30188,7 +29861,7 @@
|
|
|
30188
29861
|
},
|
|
30189
29862
|
{
|
|
30190
29863
|
"name": "DatePicker",
|
|
30191
|
-
"id": "component-DatePicker-
|
|
29864
|
+
"id": "component-DatePicker-888a30fe120d96225c6a7fcadfcb5ba65c8e1845f4807690fca88204bfbaabaf05c65bff52447830231cc6c43a86257227c91a2554180e98ad4e4e8aedba7763",
|
|
30192
29865
|
"file": "src/datepicker/datepicker.component.ts",
|
|
30193
29866
|
"encapsulation": [
|
|
30194
29867
|
"ViewEncapsulation.None"
|
|
@@ -30906,7 +30579,7 @@
|
|
|
30906
30579
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { DatePickerModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-date-picker--single\">See demo</a></p>\n",
|
|
30907
30580
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { DatePickerModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-date-picker--single)\n",
|
|
30908
30581
|
"type": "component",
|
|
30909
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tViewEncapsulation,\n\tElementRef,\n\tOnDestroy,\n\tHostListener,\n\tTemplateRef,\n\tOnChanges,\n\tSimpleChanges,\n\tAfterViewChecked,\n\tAfterViewInit,\n\tViewChild,\n\tOnInit,\n\tSimpleChange\n} from \"@angular/core\";\nimport rangePlugin from \"flatpickr/dist/plugins/rangePlugin\";\nimport flatpickr from \"flatpickr\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { carbonFlatpickrMonthSelectPlugin } from \"./carbon-flatpickr-month-select\";\nimport * as languages from \"flatpickr/dist/l10n/index\";\nimport { Options } from \"flatpickr/dist/types/options\";\nimport { DatePickerInput } from \"carbon-components-angular/datepicker-input\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * Due to type error, we have to use square brackets property accessor\n * There is a webpack issue when attempting to access exported languages from flatpickr l10n Angular 14+ apps\n * languages.default[locale] fails in app consuming CCA library but passes in test\n * languages.default.default[locale] fails in test but works in app consuming CCA library.\n *\n * To please both scenarios, we are adding a condition to prevent tests from failing\n */\nif (languages.default?.default[\"en\"]?.weekdays) {\n\t(languages.default.default[\"en\"].weekdays.shorthand as string[]) = languages.default.default[\"en\"].weekdays.longhand.map(day => {\n\t\tif (day === \"Thursday\") {\n\t\t\treturn \"Th\";\n\t\t}\n\t\treturn day.charAt(0);\n\t});\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { DatePickerModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-date-picker--single)\n */\n@Component({\n\tselector: \"cds-date-picker, ibm-date-picker\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div\n\t\t\tclass=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--range' : range,\n\t\t\t\t'cds--date-picker--single' : !range,\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#input\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[warn]=\"warn\"\n\t\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t[decorator]=\"decorator\"\n\t\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input, $event)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\n\t\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#rangeInput\n\t\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t\t[decorator]=\"rangeDecorator\"\n\t\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput, $event)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePicker,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tencapsulation: ViewEncapsulation.None\n})\nexport class DatePicker implements\n\tOnInit,\n\tOnDestroy,\n\tOnChanges,\n\tAfterViewChecked,\n\tAfterViewInit {\n\tprivate static datePickerCount = 0;\n\n\t/**\n\t * Select calendar range mode\n\t */\n\t@Input() range = false;\n\n\t/**\n\t * Format of date\n\t *\n\t * For reference: https://flatpickr.js.org/formatting/\n\t */\n\t@Input() dateFormat = \"m/d/Y\";\n\n\t/**\n\t * Language of the flatpickr calendar.\n\t *\n\t * For reference of the possible locales:\n\t * https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\n\t */\n\t@Input() language = \"en\";\n\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label) on the range end field when `range` is `true`.\n\t */\n\t@Input() rangeDecorator: TemplateRef<any>;\n\t@Input() rangeHelperText: string | TemplateRef<any>;\n\t@Input() rangeLabel: string;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t/**\n\t * Aria label added to datepicker's calendar container.\n\t */\n\t@Input() ariaLabel = \"calendar container\";\n\n\t/**\n\t * The pattern for the underlying input element\n\t */\n\t@Input() inputPattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Input() id = `datepicker-${DatePicker.datePickerCount++}`;\n\n\t@Input() set value(v: (Date | string)[]) {\n\t\tif (!v) {\n\t\t\tv = [];\n\t\t}\n\t\tthis._value = v;\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` to display the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if datepicker 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 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\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Set to `true` to display the invalid state for the second datepicker input.\n\t */\n\t@Input() rangeInvalid = false;\n\t/**\n\t * Value displayed if the second datepicker input is in an invalid state.\n\t */\n\t@Input() rangeInvalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n\t */\n\t@Input() rangeWarn = false;\n\t/**\n\t * Sets the warning text for the second datepicker input\n\t */\n\t@Input() rangeWarnText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() plugins = [];\n\n\t@Input()\n\tset flatpickrOptions(options: Partial<Options>) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions(): Partial<Options> {\n\t\tconst plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];\n\t\tif (this.range) {\n\t\t\tplugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: \"left\" }));\n\t\t}\n\t\treturn Object.assign({}, this._flatpickrOptions, this.flatpickrBaseOptions, {\n\t\t\tmode: this.range ? \"range\" : \"single\",\n\t\t\tplugins,\n\t\t\tdateFormat: this.dateFormat,\n\t\t\tlocale: languages.default?.default[this.language] || languages.default[this.language],\n\t\t\t// Little trick force \"readonly mode\" on datepicker input.\n\t\t\t// Docs: Whether clicking on the input should open the picker.\n\t\t\t// You could disable this if you wish to open the calendar manually with.open().\n\t\t\tclickOpens: !this.readonly\n\t\t});\n\t}\n\n\t@ViewChild(\"input\", { static: true }) input: DatePickerInput;\n\t@ViewChild(\"rangeInput\") rangeInput: DatePickerInput;\n\n\t@Output() valueChange: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * We are overriding onClose event even if users pass it via flatpickr options\n\t * Emits an event when date picker closes\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter();\n\n\tprotected _value = [];\n\n\tprotected _flatpickrOptions: Partial<Options> = {\n\t\tallowInput: true\n\t};\n\n\tprotected flatpickrBaseOptions = {\n\t\tmode: \"single\",\n\t\tdateFormat: \"m/d/Y\",\n\t\tplugins: this.plugins,\n\t\tonOpen: () => {\n\t\t\tthis.updateClassNames();\n\t\t\tthis.updateAttributes();\n\t\t\tthis.updateCalendarListeners();\n\t\t},\n\t\tonClose: (date) => {\n\t\t\t// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of\n\t\t\t// the inputs when the calendar closes.\n\t\t\tif (this.range && this.flatpickrInstance) {\n\t\t\t\tconst inputValue = this.input.input.nativeElement.value;\n\t\t\t\tconst rangeInputValue = this.rangeInput.input.nativeElement.value;\n\t\t\t\tif (inputValue || rangeInputValue) {\n\t\t\t\t\tconst parseDate = (date: string) => this.flatpickrInstance.parseDate(date, this.dateFormat);\n\t\t\t\t\tthis.setDateValues([parseDate(inputValue), parseDate(rangeInputValue || inputValue)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\",\n\t\t\t\"readonly\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Opens the calendar \"properly\" when the calendar if it was already open.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput, event?: Event) {\n\t\tif (this.readonly || this.skeleton) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Skips opening when the click is on the decorator region so the AI label triggers\n\t\tif (this.isDecoratorClick(event)) {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprivate isDecoratorClick(event: Event | undefined): boolean {\n\t\tif (!event?.target) {\n\t\t\treturn false;\n\t\t}\n\t\tconst t = event.target;\n\t\tconst el = t instanceof Element ? t : (t as Node).parentElement;\n\t\treturn el?.closest(\".cds--date-picker-input-inner-wrapper--decorator\") != null;\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\t// Listeners are added just once, so a check is needed here.\n\t\t\t\tif (this.readonly) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\t\t\t\t\tconst selectedDateElem = calendarContainer && calendarContainer.querySelector(\".selected\");\n\t\t\t\t\tconst todayDateElem = calendarContainer && calendarContainer.querySelector(\".today\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\t(todayDateElem || selectedDateElem || dayElement).focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.setAttribute(\"role\", \"button\");\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"application\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n}\n",
|
|
30582
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tViewEncapsulation,\n\tElementRef,\n\tOnDestroy,\n\tHostListener,\n\tTemplateRef,\n\tOnChanges,\n\tSimpleChanges,\n\tAfterViewChecked,\n\tAfterViewInit,\n\tViewChild,\n\tOnInit,\n\tSimpleChange\n} from \"@angular/core\";\nimport rangePlugin from \"flatpickr/dist/plugins/rangePlugin\";\nimport flatpickr from \"flatpickr\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { carbonFlatpickrMonthSelectPlugin } from \"./carbon-flatpickr-month-select\";\nimport * as languages from \"flatpickr/dist/l10n/index\";\nimport { Options } from \"flatpickr/dist/types/options\";\nimport { DatePickerInput } from \"carbon-components-angular/datepicker-input\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * Due to type error, we have to use square brackets property accessor\n * There is a webpack issue when attempting to access exported languages from flatpickr l10n Angular 14+ apps\n * languages.default[locale] fails in app consuming CCA library but passes in test\n * languages.default.default[locale] fails in test but works in app consuming CCA library.\n *\n * To please both scenarios, we are adding a condition to prevent tests from failing\n */\nif (languages.default?.default[\"en\"]?.weekdays) {\n\t(languages.default.default[\"en\"].weekdays.shorthand as string[]) = languages.default.default[\"en\"].weekdays.longhand.map(day => {\n\t\tif (day === \"Thursday\") {\n\t\t\treturn \"Th\";\n\t\t}\n\t\treturn day.charAt(0);\n\t});\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { DatePickerModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-date-picker--single)\n */\n@Component({\n\tselector: \"cds-date-picker, ibm-date-picker\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div\n\t\t\tclass=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--range' : range,\n\t\t\t\t'cds--date-picker--single' : !range,\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#input\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[warn]=\"warn\"\n\t\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t[decorator]=\"decorator\"\n\t\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input, $event)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\n\t\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#rangeInput\n\t\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t\t[decorator]=\"rangeDecorator\"\n\t\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput, $event)\">\n\t\t\t\t</cds-date-picker-input>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePicker,\n\t\t\tmulti: true\n\t\t}\n\t],\n\tencapsulation: ViewEncapsulation.None\n})\nexport class DatePicker implements\n\tOnInit,\n\tOnDestroy,\n\tOnChanges,\n\tAfterViewChecked,\n\tAfterViewInit {\n\tprivate static datePickerCount = 0;\n\n\t/**\n\t * Select calendar range mode\n\t */\n\t@Input() range = false;\n\n\t/**\n\t * Format of date\n\t *\n\t * For reference: https://flatpickr.js.org/formatting/\n\t */\n\t@Input() dateFormat = \"m/d/Y\";\n\n\t/**\n\t * Language of the flatpickr calendar.\n\t *\n\t * For reference of the possible locales:\n\t * https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\n\t */\n\t@Input() language = \"en\";\n\n\t@Input() label: string | TemplateRef<any>;\n\t@Input() helperText: string | TemplateRef<any>;\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label) on the range end field when `range` is `true`.\n\t */\n\t@Input() rangeDecorator: TemplateRef<any>;\n\t@Input() rangeHelperText: string | TemplateRef<any>;\n\t@Input() rangeLabel: string;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t/**\n\t * Aria label added to datepicker's calendar container.\n\t */\n\t@Input() ariaLabel = \"calendar container\";\n\n\t/**\n\t * The pattern for the underlying input element\n\t */\n\t@Input() inputPattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Input() id = `datepicker-${DatePicker.datePickerCount++}`;\n\n\t@Input() set value(v: (Date | string)[]) {\n\t\tif (!v) {\n\t\t\tv = [];\n\t\t}\n\t\tthis._value = v;\n\t}\n\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` to display the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if datepicker 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 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\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Set to `true` to display the invalid state for the second datepicker input.\n\t */\n\t@Input() rangeInvalid = false;\n\t/**\n\t * Value displayed if the second datepicker input is in an invalid state.\n\t */\n\t@Input() rangeInvalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n\t */\n\t@Input() rangeWarn = false;\n\t/**\n\t * Sets the warning text for the second datepicker input\n\t */\n\t@Input() rangeWarnText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() plugins = [];\n\n\t@Input()\n\tset flatpickrOptions(options: Partial<Options>) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions(): Partial<Options> {\n\t\tconst plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];\n\t\tif (this.range) {\n\t\t\tplugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: \"left\" }));\n\t\t}\n\t\treturn Object.assign({}, this._flatpickrOptions, this.flatpickrBaseOptions, {\n\t\t\tmode: this.range ? \"range\" : \"single\",\n\t\t\tplugins,\n\t\t\tdateFormat: this.dateFormat,\n\t\t\tlocale: languages.default?.default[this.language] || languages.default[this.language],\n\t\t\t// Little trick force \"readonly mode\" on datepicker input.\n\t\t\t// Docs: Whether clicking on the input should open the picker.\n\t\t\t// You could disable this if you wish to open the calendar manually with.open().\n\t\t\tclickOpens: !this.readonly\n\t\t});\n\t}\n\n\t@ViewChild(\"input\", { static: true }) input: DatePickerInput;\n\t@ViewChild(\"rangeInput\") rangeInput: DatePickerInput;\n\n\t@Output() valueChange: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * We are overriding onClose event even if users pass it via flatpickr options\n\t * Emits an event when date picker closes\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter();\n\n\tprotected _value = [];\n\n\tprotected _flatpickrOptions: Partial<Options> = {\n\t\tallowInput: true\n\t};\n\n\tprotected flatpickrBaseOptions = {\n\t\tmode: \"single\",\n\t\tdateFormat: \"m/d/Y\",\n\t\tplugins: this.plugins,\n\t\tonOpen: () => {\n\t\t\tthis.updateClassNames();\n\t\t\tthis.updateAttributes();\n\t\t\tthis.updateCalendarListeners();\n\t\t},\n\t\tonClose: (date) => {\n\t\t\t// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of\n\t\t\t// the inputs when the calendar closes.\n\t\t\tif (this.range && this.flatpickrInstance) {\n\t\t\t\tconst inputValue = this.input.input.nativeElement.value;\n\t\t\t\tconst rangeInputValue = this.rangeInput.input.nativeElement.value;\n\t\t\t\tif (inputValue || rangeInputValue) {\n\t\t\t\t\tconst parseDate = (date: string) => this.flatpickrInstance.parseDate(date, this.dateFormat);\n\t\t\t\t\tthis.setDateValues([parseDate(inputValue), parseDate(rangeInputValue || inputValue)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\",\n\t\t\t\"readonly\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Opens the calendar \"properly\" when the calendar if it was already open.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput, event?: Event) {\n\t\tif (this.readonly || this.skeleton) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Skips opening when the click is on the decorator region so the AI label triggers\n\t\tif (this.isDecoratorClick(event)) {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\t// Listeners are added just once, so a check is needed here.\n\t\t\t\tif (this.readonly) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\t\t\t\t\tconst selectedDateElem = calendarContainer && calendarContainer.querySelector(\".selected\");\n\t\t\t\t\tconst todayDateElem = calendarContainer && calendarContainer.querySelector(\".today\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\t(todayDateElem || selectedDateElem || dayElement).focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.setAttribute(\"role\", \"button\");\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"application\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\tprivate isDecoratorClick(event: Event | undefined): boolean {\n\t\tif (!event?.target) {\n\t\t\treturn false;\n\t\t}\n\t\tconst t = event.target;\n\t\tconst el = t instanceof Element ? t : (t as Node).parentElement;\n\t\treturn el?.closest(\".cds--date-picker-input-inner-wrapper--decorator\") != null;\n\t}\n}\n",
|
|
30910
30583
|
"assetsDirs": [],
|
|
30911
30584
|
"styleUrlsData": "",
|
|
30912
30585
|
"stylesData": "",
|
|
@@ -32255,7 +31928,7 @@
|
|
|
32255
31928
|
},
|
|
32256
31929
|
{
|
|
32257
31930
|
"name": "Dropdown",
|
|
32258
|
-
"id": "component-Dropdown-
|
|
31931
|
+
"id": "component-Dropdown-6b9e2cdd9844cc409f8d3c73a2ead60c179267581b4417fe63c25f9f8eb69066569e9fed868dfb2e09f719807b92fd01313b7705917c25178e12a3de30f1816a",
|
|
32259
31932
|
"file": "src/dropdown/dropdown.component.ts",
|
|
32260
31933
|
"encapsulation": [],
|
|
32261
31934
|
"entryComponents": [],
|
|
@@ -32274,6 +31947,17 @@
|
|
|
32274
31947
|
"viewProviders": [],
|
|
32275
31948
|
"hostDirectives": [],
|
|
32276
31949
|
"inputsClass": [
|
|
31950
|
+
{
|
|
31951
|
+
"name": "allowNullValues",
|
|
31952
|
+
"defaultValue": "false",
|
|
31953
|
+
"deprecated": false,
|
|
31954
|
+
"deprecationMessage": "",
|
|
31955
|
+
"rawdescription": "\n\nSet to `true` to allow null values in the dropdown ListItems.\n",
|
|
31956
|
+
"description": "<p>Set to <code>true</code> to allow null values in the dropdown ListItems.</p>\n",
|
|
31957
|
+
"line": 336,
|
|
31958
|
+
"type": "boolean",
|
|
31959
|
+
"decorators": []
|
|
31960
|
+
},
|
|
32277
31961
|
{
|
|
32278
31962
|
"name": "appendInline",
|
|
32279
31963
|
"defaultValue": "null",
|
|
@@ -32281,7 +31965,7 @@
|
|
|
32281
31965
|
"deprecationMessage": "",
|
|
32282
31966
|
"rawdescription": "\n\nset to `true` to place the dropdown view inline with the component\n",
|
|
32283
31967
|
"description": "<p>set to <code>true</code> to place the dropdown view inline with the component</p>\n",
|
|
32284
|
-
"line":
|
|
31968
|
+
"line": 302,
|
|
32285
31969
|
"type": "boolean",
|
|
32286
31970
|
"decorators": []
|
|
32287
31971
|
},
|
|
@@ -32292,7 +31976,7 @@
|
|
|
32292
31976
|
"deprecationMessage": "",
|
|
32293
31977
|
"rawdescription": "\n\nSets the optional clear button tooltip text.\n",
|
|
32294
31978
|
"description": "<p>Sets the optional clear button tooltip text.</p>\n",
|
|
32295
|
-
"line":
|
|
31979
|
+
"line": 248,
|
|
32296
31980
|
"type": "string",
|
|
32297
31981
|
"decorators": []
|
|
32298
31982
|
},
|
|
@@ -32302,7 +31986,7 @@
|
|
|
32302
31986
|
"deprecationMessage": "",
|
|
32303
31987
|
"rawdescription": "\n\n**Experimental**: Optional decorator (e.g. AI label).\n",
|
|
32304
31988
|
"description": "<p><strong>Experimental</strong>: Optional decorator (e.g. AI label).</p>\n",
|
|
32305
|
-
"line":
|
|
31989
|
+
"line": 236,
|
|
32306
31990
|
"type": "TemplateRef<any>",
|
|
32307
31991
|
"decorators": []
|
|
32308
31992
|
},
|
|
@@ -32313,7 +31997,7 @@
|
|
|
32313
31997
|
"deprecationMessage": "",
|
|
32314
31998
|
"rawdescription": "\n\nSet to `true` for a dropdown without arrow key activation.\n",
|
|
32315
31999
|
"description": "<p>Set to <code>true</code> for a dropdown without arrow key activation.</p>\n",
|
|
32316
|
-
"line":
|
|
32000
|
+
"line": 282,
|
|
32317
32001
|
"type": "boolean",
|
|
32318
32002
|
"decorators": []
|
|
32319
32003
|
},
|
|
@@ -32324,7 +32008,7 @@
|
|
|
32324
32008
|
"deprecationMessage": "",
|
|
32325
32009
|
"rawdescription": "\n\nSet to `true` to disable the dropdown.\n",
|
|
32326
32010
|
"description": "<p>Set to <code>true</code> to disable the dropdown.</p>\n",
|
|
32327
|
-
"line":
|
|
32011
|
+
"line": 266,
|
|
32328
32012
|
"type": "boolean",
|
|
32329
32013
|
"decorators": []
|
|
32330
32014
|
},
|
|
@@ -32335,7 +32019,7 @@
|
|
|
32335
32019
|
"deprecationMessage": "",
|
|
32336
32020
|
"rawdescription": "\n\nThe selected value from the `Dropdown`. Can be a string or template.\n",
|
|
32337
32021
|
"description": "<p>The selected value from the <code>Dropdown</code>. Can be a string or template.</p>\n",
|
|
32338
|
-
"line":
|
|
32022
|
+
"line": 244,
|
|
32339
32023
|
"type": "string | TemplateRef<any>",
|
|
32340
32024
|
"decorators": []
|
|
32341
32025
|
},
|
|
@@ -32345,7 +32029,7 @@
|
|
|
32345
32029
|
"deprecationMessage": "",
|
|
32346
32030
|
"rawdescription": "\n\nOverrides the automatic dropUp.\n",
|
|
32347
32031
|
"description": "<p>Overrides the automatic dropUp.</p>\n",
|
|
32348
|
-
"line":
|
|
32032
|
+
"line": 332,
|
|
32349
32033
|
"type": "boolean",
|
|
32350
32034
|
"decorators": []
|
|
32351
32035
|
},
|
|
@@ -32356,7 +32040,7 @@
|
|
|
32356
32040
|
"deprecationMessage": "",
|
|
32357
32041
|
"rawdescription": "\n\nExperimental: enable fluid state\n",
|
|
32358
32042
|
"description": "<p>Experimental: enable fluid state</p>\n",
|
|
32359
|
-
"line":
|
|
32043
|
+
"line": 370,
|
|
32360
32044
|
"type": "boolean",
|
|
32361
32045
|
"decorators": []
|
|
32362
32046
|
},
|
|
@@ -32366,7 +32050,7 @@
|
|
|
32366
32050
|
"deprecationMessage": "",
|
|
32367
32051
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
32368
32052
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
32369
|
-
"line":
|
|
32053
|
+
"line": 232,
|
|
32370
32054
|
"type": "string | TemplateRef<any>",
|
|
32371
32055
|
"decorators": []
|
|
32372
32056
|
},
|
|
@@ -32377,7 +32061,7 @@
|
|
|
32377
32061
|
"deprecationMessage": "",
|
|
32378
32062
|
"rawdescription": "\n\nHide label while keeping it accessible for screen readers\n",
|
|
32379
32063
|
"description": "<p>Hide label while keeping it accessible for screen readers</p>\n",
|
|
32380
|
-
"line":
|
|
32064
|
+
"line": 228,
|
|
32381
32065
|
"type": "boolean",
|
|
32382
32066
|
"decorators": []
|
|
32383
32067
|
},
|
|
@@ -32386,7 +32070,7 @@
|
|
|
32386
32070
|
"defaultValue": "`dropdown-${Dropdown.dropdownCount++}`",
|
|
32387
32071
|
"deprecated": false,
|
|
32388
32072
|
"deprecationMessage": "",
|
|
32389
|
-
"line":
|
|
32073
|
+
"line": 220,
|
|
32390
32074
|
"type": "string",
|
|
32391
32075
|
"decorators": []
|
|
32392
32076
|
},
|
|
@@ -32397,7 +32081,7 @@
|
|
|
32397
32081
|
"deprecationMessage": "",
|
|
32398
32082
|
"rawdescription": "\n\nSet to `true` for an inline dropdown.\n",
|
|
32399
32083
|
"description": "<p>Set to <code>true</code> for an inline dropdown.</p>\n",
|
|
32400
|
-
"line":
|
|
32084
|
+
"line": 278,
|
|
32401
32085
|
"type": "boolean",
|
|
32402
32086
|
"decorators": []
|
|
32403
32087
|
},
|
|
@@ -32408,7 +32092,7 @@
|
|
|
32408
32092
|
"deprecationMessage": "",
|
|
32409
32093
|
"rawdescription": "\n\nSet to `true` for invalid state.\n",
|
|
32410
32094
|
"description": "<p>Set to <code>true</code> for invalid state.</p>\n",
|
|
32411
|
-
"line":
|
|
32095
|
+
"line": 286,
|
|
32412
32096
|
"type": "boolean",
|
|
32413
32097
|
"decorators": []
|
|
32414
32098
|
},
|
|
@@ -32418,7 +32102,7 @@
|
|
|
32418
32102
|
"deprecationMessage": "",
|
|
32419
32103
|
"rawdescription": "\n\nValue displayed if dropdown is in invalid state.\n",
|
|
32420
32104
|
"description": "<p>Value displayed if dropdown is in invalid state.</p>\n",
|
|
32421
|
-
"line":
|
|
32105
|
+
"line": 290,
|
|
32422
32106
|
"type": "string | TemplateRef<any>",
|
|
32423
32107
|
"decorators": []
|
|
32424
32108
|
},
|
|
@@ -32428,7 +32112,7 @@
|
|
|
32428
32112
|
"deprecationMessage": "",
|
|
32429
32113
|
"rawdescription": "\n\nSpecifies the property to be used as the return value to `ngModel`\n",
|
|
32430
32114
|
"description": "<p>Specifies the property to be used as the return value to <code>ngModel</code></p>\n",
|
|
32431
|
-
"line":
|
|
32115
|
+
"line": 311,
|
|
32432
32116
|
"type": "string",
|
|
32433
32117
|
"decorators": []
|
|
32434
32118
|
},
|
|
@@ -32438,7 +32122,7 @@
|
|
|
32438
32122
|
"deprecationMessage": "",
|
|
32439
32123
|
"rawdescription": "\n\nLabel for the dropdown.\n",
|
|
32440
32124
|
"description": "<p>Label for the dropdown.</p>\n",
|
|
32441
|
-
"line":
|
|
32125
|
+
"line": 224,
|
|
32442
32126
|
"type": "string | TemplateRef<any>",
|
|
32443
32127
|
"decorators": []
|
|
32444
32128
|
},
|
|
@@ -32449,7 +32133,7 @@
|
|
|
32449
32133
|
"deprecationMessage": "",
|
|
32450
32134
|
"rawdescription": "\n\nAccessible label for the button that opens the dropdown list.\nDefaults to the `DROPDOWN.OPEN` value from the i18n service.\n",
|
|
32451
32135
|
"description": "<p>Accessible label for the button that opens the dropdown list.\nDefaults to the <code>DROPDOWN.OPEN</code> value from the i18n service.</p>\n",
|
|
32452
|
-
"line":
|
|
32136
|
+
"line": 323,
|
|
32453
32137
|
"type": "any",
|
|
32454
32138
|
"decorators": []
|
|
32455
32139
|
},
|
|
@@ -32460,7 +32144,7 @@
|
|
|
32460
32144
|
"deprecationMessage": "",
|
|
32461
32145
|
"rawdescription": "\n\nValue displayed if no item is selected.\n",
|
|
32462
32146
|
"description": "<p>Value displayed if no item is selected.</p>\n",
|
|
32463
|
-
"line":
|
|
32147
|
+
"line": 240,
|
|
32464
32148
|
"type": "string",
|
|
32465
32149
|
"decorators": []
|
|
32466
32150
|
},
|
|
@@ -32471,7 +32155,7 @@
|
|
|
32471
32155
|
"deprecationMessage": "",
|
|
32472
32156
|
"rawdescription": "\n\nSet to `true` for a readonly state.\n",
|
|
32473
32157
|
"description": "<p>Set to <code>true</code> for a readonly state.</p>\n",
|
|
32474
|
-
"line":
|
|
32158
|
+
"line": 270,
|
|
32475
32159
|
"type": "boolean",
|
|
32476
32160
|
"decorators": []
|
|
32477
32161
|
},
|
|
@@ -32481,7 +32165,7 @@
|
|
|
32481
32165
|
"deprecationMessage": "",
|
|
32482
32166
|
"rawdescription": "\n\nQuery string for the element that contains the `Dropdown`.\nUsed to trigger closing the dropdown if it scrolls outside of the viewport of the `scrollableContainer`.\n",
|
|
32483
32167
|
"description": "<p>Query string for the element that contains the <code>Dropdown</code>.\nUsed to trigger closing the dropdown if it scrolls outside of the viewport of the <code>scrollableContainer</code>.</p>\n",
|
|
32484
|
-
"line":
|
|
32168
|
+
"line": 307,
|
|
32485
32169
|
"type": "string",
|
|
32486
32170
|
"decorators": []
|
|
32487
32171
|
},
|
|
@@ -32492,7 +32176,7 @@
|
|
|
32492
32176
|
"deprecationMessage": "",
|
|
32493
32177
|
"rawdescription": "\n\nProvides the label for the \"# selected\" text.\nDefaults to the `DROPDOWN.SELECTED` value from the i18n service.\n",
|
|
32494
32178
|
"description": "<p>Provides the label for the "# selected" text.\nDefaults to the <code>DROPDOWN.SELECTED</code> value from the i18n service.</p>\n",
|
|
32495
|
-
"line":
|
|
32179
|
+
"line": 328,
|
|
32496
32180
|
"type": "any",
|
|
32497
32181
|
"decorators": []
|
|
32498
32182
|
},
|
|
@@ -32503,7 +32187,7 @@
|
|
|
32503
32187
|
"deprecationMessage": "",
|
|
32504
32188
|
"rawdescription": "\n\nSpecify feedback (mode) of the selection.\n`top`: selected item jumps to top\n`fixed`: selected item stays at it's position\n`top-after-reopen`: selected item jump to top after reopen dropdown\n",
|
|
32505
32189
|
"description": "<p>Specify feedback (mode) of the selection.\n<code>top</code>: selected item jumps to top\n<code>fixed</code>: selected item stays at it's position\n<code>top-after-reopen</code>: selected item jump to top after reopen dropdown</p>\n",
|
|
32506
|
-
"line":
|
|
32190
|
+
"line": 318,
|
|
32507
32191
|
"type": "\"top\" | \"fixed\" | \"top-after-reopen\"",
|
|
32508
32192
|
"decorators": []
|
|
32509
32193
|
},
|
|
@@ -32514,7 +32198,7 @@
|
|
|
32514
32198
|
"deprecationMessage": "",
|
|
32515
32199
|
"rawdescription": "\n\nSize to render the dropdown field.\n",
|
|
32516
32200
|
"description": "<p>Size to render the dropdown field.</p>\n",
|
|
32517
|
-
"line":
|
|
32201
|
+
"line": 252,
|
|
32518
32202
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
32519
32203
|
"decorators": []
|
|
32520
32204
|
},
|
|
@@ -32525,7 +32209,7 @@
|
|
|
32525
32209
|
"deprecationMessage": "",
|
|
32526
32210
|
"rawdescription": "\n\nSet to `true` for a loading dropdown.\n",
|
|
32527
32211
|
"description": "<p>Set to <code>true</code> for a loading dropdown.</p>\n",
|
|
32528
|
-
"line":
|
|
32212
|
+
"line": 274,
|
|
32529
32213
|
"type": "boolean",
|
|
32530
32214
|
"decorators": []
|
|
32531
32215
|
},
|
|
@@ -32536,15 +32220,15 @@
|
|
|
32536
32220
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\n`light` or `dark` dropdown theme",
|
|
32537
32221
|
"jsdoctags": [
|
|
32538
32222
|
{
|
|
32539
|
-
"pos":
|
|
32540
|
-
"end":
|
|
32223
|
+
"pos": 8190,
|
|
32224
|
+
"end": 8285,
|
|
32541
32225
|
"flags": 16842752,
|
|
32542
32226
|
"modifierFlagsCache": 0,
|
|
32543
32227
|
"transformFlags": 0,
|
|
32544
32228
|
"kind": 338,
|
|
32545
32229
|
"tagName": {
|
|
32546
|
-
"pos":
|
|
32547
|
-
"end":
|
|
32230
|
+
"pos": 8191,
|
|
32231
|
+
"end": 8201,
|
|
32548
32232
|
"flags": 16842752,
|
|
32549
32233
|
"modifierFlagsCache": 0,
|
|
32550
32234
|
"transformFlags": 0,
|
|
@@ -32554,7 +32238,7 @@
|
|
|
32554
32238
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\n<code>light</code> or <code>dark</code> dropdown theme</p>\n"
|
|
32555
32239
|
}
|
|
32556
32240
|
],
|
|
32557
|
-
"line":
|
|
32241
|
+
"line": 262,
|
|
32558
32242
|
"type": "\"light\" | \"dark\"",
|
|
32559
32243
|
"decorators": []
|
|
32560
32244
|
},
|
|
@@ -32565,7 +32249,7 @@
|
|
|
32565
32249
|
"deprecationMessage": "",
|
|
32566
32250
|
"rawdescription": "\n\nDefines whether or not the `Dropdown` supports selecting multiple items as opposed to single\nitem selection.\n",
|
|
32567
32251
|
"description": "<p>Defines whether or not the <code>Dropdown</code> supports selecting multiple items as opposed to single\nitem selection.</p>\n",
|
|
32568
|
-
"line":
|
|
32252
|
+
"line": 257,
|
|
32569
32253
|
"type": "\"single\" | \"multi\"",
|
|
32570
32254
|
"decorators": []
|
|
32571
32255
|
},
|
|
@@ -32576,7 +32260,7 @@
|
|
|
32576
32260
|
"deprecationMessage": "",
|
|
32577
32261
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warningText)\n",
|
|
32578
32262
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warningText)</p>\n",
|
|
32579
|
-
"line":
|
|
32263
|
+
"line": 294,
|
|
32580
32264
|
"type": "boolean",
|
|
32581
32265
|
"decorators": []
|
|
32582
32266
|
},
|
|
@@ -32586,7 +32270,7 @@
|
|
|
32586
32270
|
"deprecationMessage": "",
|
|
32587
32271
|
"rawdescription": "\n\nSets the warning text\n",
|
|
32588
32272
|
"description": "<p>Sets the warning text</p>\n",
|
|
32589
|
-
"line":
|
|
32273
|
+
"line": 298,
|
|
32590
32274
|
"type": "string | TemplateRef<any>",
|
|
32591
32275
|
"decorators": []
|
|
32592
32276
|
}
|
|
@@ -32599,7 +32283,7 @@
|
|
|
32599
32283
|
"deprecationMessage": "",
|
|
32600
32284
|
"rawdescription": "\n\nEmits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n",
|
|
32601
32285
|
"description": "<p>Emits event notifying to other classes that the <code>Dropdown</code> has been closed (collapsed).</p>\n",
|
|
32602
|
-
"line":
|
|
32286
|
+
"line": 348,
|
|
32603
32287
|
"type": "EventEmitter<any>"
|
|
32604
32288
|
},
|
|
32605
32289
|
{
|
|
@@ -32609,7 +32293,7 @@
|
|
|
32609
32293
|
"deprecationMessage": "",
|
|
32610
32294
|
"rawdescription": "\n\nEmits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n",
|
|
32611
32295
|
"description": "<p>Emits event notifying to other classes that the <code>Dropdown</code> has been closed (collapsed).</p>\n",
|
|
32612
|
-
"line":
|
|
32296
|
+
"line": 344,
|
|
32613
32297
|
"type": "EventEmitter<any>"
|
|
32614
32298
|
},
|
|
32615
32299
|
{
|
|
@@ -32619,7 +32303,7 @@
|
|
|
32619
32303
|
"deprecationMessage": "",
|
|
32620
32304
|
"rawdescription": "\n\nEmits selection events.\n",
|
|
32621
32305
|
"description": "<p>Emits selection events.</p>\n",
|
|
32622
|
-
"line":
|
|
32306
|
+
"line": 340,
|
|
32623
32307
|
"type": "EventEmitter<Object>"
|
|
32624
32308
|
}
|
|
32625
32309
|
],
|
|
@@ -32632,7 +32316,7 @@
|
|
|
32632
32316
|
"type": "",
|
|
32633
32317
|
"optional": false,
|
|
32634
32318
|
"description": "<p>controls whether the <code>drop-up</code> class is applied</p>\n",
|
|
32635
|
-
"line":
|
|
32319
|
+
"line": 380,
|
|
32636
32320
|
"rawdescription": "\n\ncontrols whether the `drop-up` class is applied\n"
|
|
32637
32321
|
},
|
|
32638
32322
|
{
|
|
@@ -32642,7 +32326,7 @@
|
|
|
32642
32326
|
"type": "",
|
|
32643
32327
|
"optional": false,
|
|
32644
32328
|
"description": "<p>Maintains a reference to the view DOM element of the <code>Dropdown</code> button.</p>\n",
|
|
32645
|
-
"line":
|
|
32329
|
+
"line": 357,
|
|
32646
32330
|
"rawdescription": "\n\nMaintains a reference to the view DOM element of the `Dropdown` button.\n",
|
|
32647
32331
|
"decorators": [
|
|
32648
32332
|
{
|
|
@@ -32662,7 +32346,7 @@
|
|
|
32662
32346
|
"type": "number",
|
|
32663
32347
|
"optional": false,
|
|
32664
32348
|
"description": "",
|
|
32665
|
-
"line":
|
|
32349
|
+
"line": 218,
|
|
32666
32350
|
"modifierKind": [
|
|
32667
32351
|
126
|
|
32668
32352
|
]
|
|
@@ -32674,7 +32358,7 @@
|
|
|
32674
32358
|
"type": "",
|
|
32675
32359
|
"optional": false,
|
|
32676
32360
|
"description": "<p>ViewChid of the dropdown view.</p>\n",
|
|
32677
|
-
"line":
|
|
32361
|
+
"line": 361,
|
|
32678
32362
|
"rawdescription": "\n\nViewChid of the dropdown view.\n",
|
|
32679
32363
|
"decorators": [
|
|
32680
32364
|
{
|
|
@@ -32694,7 +32378,7 @@
|
|
|
32694
32378
|
"type": "",
|
|
32695
32379
|
"optional": false,
|
|
32696
32380
|
"description": "",
|
|
32697
|
-
"line":
|
|
32381
|
+
"line": 363,
|
|
32698
32382
|
"decorators": [
|
|
32699
32383
|
{
|
|
32700
32384
|
"name": "HostBinding",
|
|
@@ -32713,7 +32397,7 @@
|
|
|
32713
32397
|
"type": "",
|
|
32714
32398
|
"optional": false,
|
|
32715
32399
|
"description": "",
|
|
32716
|
-
"line":
|
|
32400
|
+
"line": 365,
|
|
32717
32401
|
"decorators": [
|
|
32718
32402
|
{
|
|
32719
32403
|
"name": "HostBinding",
|
|
@@ -32732,7 +32416,7 @@
|
|
|
32732
32416
|
"type": "",
|
|
32733
32417
|
"optional": false,
|
|
32734
32418
|
"description": "",
|
|
32735
|
-
"line":
|
|
32419
|
+
"line": 387
|
|
32736
32420
|
},
|
|
32737
32421
|
{
|
|
32738
32422
|
"name": "menuIsClosed",
|
|
@@ -32742,7 +32426,7 @@
|
|
|
32742
32426
|
"type": "",
|
|
32743
32427
|
"optional": false,
|
|
32744
32428
|
"description": "<p>Set to <code>true</code> if the dropdown is closed (not expanded).</p>\n",
|
|
32745
|
-
"line":
|
|
32429
|
+
"line": 375,
|
|
32746
32430
|
"rawdescription": "\n\nSet to `true` if the dropdown is closed (not expanded).\n"
|
|
32747
32431
|
},
|
|
32748
32432
|
{
|
|
@@ -32753,7 +32437,7 @@
|
|
|
32753
32437
|
"type": "",
|
|
32754
32438
|
"optional": false,
|
|
32755
32439
|
"description": "",
|
|
32756
|
-
"line":
|
|
32440
|
+
"line": 384
|
|
32757
32441
|
},
|
|
32758
32442
|
{
|
|
32759
32443
|
"name": "outsideClick",
|
|
@@ -32763,7 +32447,7 @@
|
|
|
32763
32447
|
"type": "",
|
|
32764
32448
|
"optional": false,
|
|
32765
32449
|
"description": "",
|
|
32766
|
-
"line":
|
|
32450
|
+
"line": 385
|
|
32767
32451
|
},
|
|
32768
32452
|
{
|
|
32769
32453
|
"name": "outsideKey",
|
|
@@ -32773,7 +32457,7 @@
|
|
|
32773
32457
|
"type": "",
|
|
32774
32458
|
"optional": false,
|
|
32775
32459
|
"description": "",
|
|
32776
|
-
"line":
|
|
32460
|
+
"line": 386
|
|
32777
32461
|
},
|
|
32778
32462
|
{
|
|
32779
32463
|
"name": "propagateChange",
|
|
@@ -32783,7 +32467,7 @@
|
|
|
32783
32467
|
"type": "",
|
|
32784
32468
|
"optional": false,
|
|
32785
32469
|
"description": "<p>function passed in by <code>registerOnChange</code></p>\n",
|
|
32786
|
-
"line":
|
|
32470
|
+
"line": 556,
|
|
32787
32471
|
"rawdescription": "\n\nfunction passed in by `registerOnChange`\n"
|
|
32788
32472
|
},
|
|
32789
32473
|
{
|
|
@@ -32793,7 +32477,7 @@
|
|
|
32793
32477
|
"type": "AbstractDropdownView",
|
|
32794
32478
|
"optional": false,
|
|
32795
32479
|
"description": "<p>Maintains a reference to the <code>AbstractDropdownView</code> object within the content DOM.</p>\n",
|
|
32796
|
-
"line":
|
|
32480
|
+
"line": 353,
|
|
32797
32481
|
"rawdescription": "\n\nMaintains a reference to the `AbstractDropdownView` object within the content DOM.\n",
|
|
32798
32482
|
"decorators": [
|
|
32799
32483
|
{
|
|
@@ -32813,7 +32497,7 @@
|
|
|
32813
32497
|
"optional": false,
|
|
32814
32498
|
"returnType": "void",
|
|
32815
32499
|
"typeParameters": [],
|
|
32816
|
-
"line":
|
|
32500
|
+
"line": 735,
|
|
32817
32501
|
"deprecated": false,
|
|
32818
32502
|
"deprecationMessage": "",
|
|
32819
32503
|
"rawdescription": "\n\nCreates the `Dropdown` list as an element that is appended to the DOM body.\n",
|
|
@@ -32825,7 +32509,7 @@
|
|
|
32825
32509
|
"optional": false,
|
|
32826
32510
|
"returnType": "void",
|
|
32827
32511
|
"typeParameters": [],
|
|
32828
|
-
"line":
|
|
32512
|
+
"line": 727,
|
|
32829
32513
|
"deprecated": false,
|
|
32830
32514
|
"deprecationMessage": "",
|
|
32831
32515
|
"rawdescription": "\n\nCreates the `Dropdown` list appending it to the dropdown parent object instead of the body.\n",
|
|
@@ -32844,7 +32528,7 @@
|
|
|
32844
32528
|
"optional": false,
|
|
32845
32529
|
"returnType": "void",
|
|
32846
32530
|
"typeParameters": [],
|
|
32847
|
-
"line":
|
|
32531
|
+
"line": 707,
|
|
32848
32532
|
"deprecated": false,
|
|
32849
32533
|
"deprecationMessage": "",
|
|
32850
32534
|
"rawdescription": "\n\nHandles keyboard events so users are controlling the `Dropdown` instead of unintentionally controlling outside elements.\n",
|
|
@@ -32867,7 +32551,7 @@
|
|
|
32867
32551
|
"optional": false,
|
|
32868
32552
|
"returnType": "void",
|
|
32869
32553
|
"typeParameters": [],
|
|
32870
|
-
"line":
|
|
32554
|
+
"line": 687,
|
|
32871
32555
|
"deprecated": false,
|
|
32872
32556
|
"deprecationMessage": ""
|
|
32873
32557
|
},
|
|
@@ -32884,7 +32568,7 @@
|
|
|
32884
32568
|
"optional": false,
|
|
32885
32569
|
"returnType": "void",
|
|
32886
32570
|
"typeParameters": [],
|
|
32887
|
-
"line":
|
|
32571
|
+
"line": 691,
|
|
32888
32572
|
"deprecated": false,
|
|
32889
32573
|
"deprecationMessage": "",
|
|
32890
32574
|
"rawdescription": "\n\nHandles clicks outside of the `Dropdown`.\n",
|
|
@@ -32914,7 +32598,7 @@
|
|
|
32914
32598
|
"optional": false,
|
|
32915
32599
|
"returnType": "void",
|
|
32916
32600
|
"typeParameters": [],
|
|
32917
|
-
"line":
|
|
32601
|
+
"line": 699,
|
|
32918
32602
|
"deprecated": false,
|
|
32919
32603
|
"deprecationMessage": "",
|
|
32920
32604
|
"jsdoctags": [
|
|
@@ -32935,7 +32619,7 @@
|
|
|
32935
32619
|
"optional": false,
|
|
32936
32620
|
"returnType": "any",
|
|
32937
32621
|
"typeParameters": [],
|
|
32938
|
-
"line":
|
|
32622
|
+
"line": 749,
|
|
32939
32623
|
"deprecated": false,
|
|
32940
32624
|
"deprecationMessage": "",
|
|
32941
32625
|
"rawdescription": "\n\nDetects whether or not the `Dropdown` list is visible within all scrollable parents.\nThis can be overridden by passing in a value to the `dropUp` input.\n",
|
|
@@ -32947,7 +32631,7 @@
|
|
|
32947
32631
|
"optional": false,
|
|
32948
32632
|
"returnType": "void",
|
|
32949
32633
|
"typeParameters": [],
|
|
32950
|
-
"line":
|
|
32634
|
+
"line": 668,
|
|
32951
32635
|
"deprecated": false,
|
|
32952
32636
|
"deprecationMessage": ""
|
|
32953
32637
|
},
|
|
@@ -32964,7 +32648,7 @@
|
|
|
32964
32648
|
"optional": false,
|
|
32965
32649
|
"returnType": "void",
|
|
32966
32650
|
"typeParameters": [],
|
|
32967
|
-
"line":
|
|
32651
|
+
"line": 608,
|
|
32968
32652
|
"deprecated": false,
|
|
32969
32653
|
"deprecationMessage": "",
|
|
32970
32654
|
"jsdoctags": [
|
|
@@ -32985,7 +32669,7 @@
|
|
|
32985
32669
|
"optional": false,
|
|
32986
32670
|
"returnType": "void",
|
|
32987
32671
|
"typeParameters": [],
|
|
32988
|
-
"line":
|
|
32672
|
+
"line": 813,
|
|
32989
32673
|
"deprecated": false,
|
|
32990
32674
|
"deprecationMessage": "",
|
|
32991
32675
|
"rawdescription": "\n\nCollapsing the dropdown menu and removing unnecessary `EventListeners`.\n",
|
|
@@ -32997,7 +32681,7 @@
|
|
|
32997
32681
|
"optional": false,
|
|
32998
32682
|
"returnType": "Observable<string>",
|
|
32999
32683
|
"typeParameters": [],
|
|
33000
|
-
"line":
|
|
32684
|
+
"line": 627,
|
|
33001
32685
|
"deprecated": false,
|
|
33002
32686
|
"deprecationMessage": "",
|
|
33003
32687
|
"rawdescription": "\n\nReturns the display value if there is a selection and displayValue is set,\nif there is just a selection the ListItem content property will be returned,\notherwise the placeholder will be returned.\n",
|
|
@@ -33009,7 +32693,7 @@
|
|
|
33009
32693
|
"optional": false,
|
|
33010
32694
|
"returnType": "{ items: any; item?: undefined; } | { item: any; items?: undefined; } | { items?: undefined; item?: undefined; }",
|
|
33011
32695
|
"typeParameters": [],
|
|
33012
|
-
"line":
|
|
32696
|
+
"line": 648,
|
|
33013
32697
|
"deprecated": false,
|
|
33014
32698
|
"deprecationMessage": ""
|
|
33015
32699
|
},
|
|
@@ -33019,7 +32703,7 @@
|
|
|
33019
32703
|
"optional": false,
|
|
33020
32704
|
"returnType": "number",
|
|
33021
32705
|
"typeParameters": [],
|
|
33022
|
-
"line":
|
|
32706
|
+
"line": 662,
|
|
33023
32707
|
"deprecated": false,
|
|
33024
32708
|
"deprecationMessage": ""
|
|
33025
32709
|
},
|
|
@@ -33036,7 +32720,7 @@
|
|
|
33036
32720
|
"optional": false,
|
|
33037
32721
|
"returnType": "void",
|
|
33038
32722
|
"typeParameters": [],
|
|
33039
|
-
"line":
|
|
32723
|
+
"line": 855,
|
|
33040
32724
|
"deprecated": false,
|
|
33041
32725
|
"deprecationMessage": "",
|
|
33042
32726
|
"jsdoctags": [
|
|
@@ -33057,7 +32741,7 @@
|
|
|
33057
32741
|
"optional": false,
|
|
33058
32742
|
"returnType": "boolean",
|
|
33059
32743
|
"typeParameters": [],
|
|
33060
|
-
"line":
|
|
32744
|
+
"line": 644,
|
|
33061
32745
|
"deprecated": false,
|
|
33062
32746
|
"deprecationMessage": ""
|
|
33063
32747
|
},
|
|
@@ -33074,7 +32758,7 @@
|
|
|
33074
32758
|
"optional": false,
|
|
33075
32759
|
"returnType": "boolean",
|
|
33076
32760
|
"typeParameters": [],
|
|
33077
|
-
"line":
|
|
32761
|
+
"line": 851,
|
|
33078
32762
|
"deprecated": false,
|
|
33079
32763
|
"deprecationMessage": "",
|
|
33080
32764
|
"modifierKind": [
|
|
@@ -33098,7 +32782,7 @@
|
|
|
33098
32782
|
"optional": false,
|
|
33099
32783
|
"returnType": "void",
|
|
33100
32784
|
"typeParameters": [],
|
|
33101
|
-
"line":
|
|
32785
|
+
"line": 537,
|
|
33102
32786
|
"deprecated": false,
|
|
33103
32787
|
"deprecationMessage": ""
|
|
33104
32788
|
},
|
|
@@ -33115,7 +32799,7 @@
|
|
|
33115
32799
|
"optional": false,
|
|
33116
32800
|
"returnType": "void",
|
|
33117
32801
|
"typeParameters": [],
|
|
33118
|
-
"line":
|
|
32802
|
+
"line": 573,
|
|
33119
32803
|
"deprecated": false,
|
|
33120
32804
|
"deprecationMessage": "",
|
|
33121
32805
|
"rawdescription": "\n\nAdds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n",
|
|
@@ -33147,7 +32831,7 @@
|
|
|
33147
32831
|
"optional": false,
|
|
33148
32832
|
"returnType": "void",
|
|
33149
32833
|
"typeParameters": [],
|
|
33150
|
-
"line":
|
|
32834
|
+
"line": 769,
|
|
33151
32835
|
"deprecated": false,
|
|
33152
32836
|
"deprecationMessage": "",
|
|
33153
32837
|
"rawdescription": "\n\nExpands the dropdown menu in the view.\n",
|
|
@@ -33166,7 +32850,7 @@
|
|
|
33166
32850
|
"optional": false,
|
|
33167
32851
|
"returnType": "void",
|
|
33168
32852
|
"typeParameters": [],
|
|
33169
|
-
"line":
|
|
32853
|
+
"line": 541,
|
|
33170
32854
|
"deprecated": false,
|
|
33171
32855
|
"deprecationMessage": "",
|
|
33172
32856
|
"jsdoctags": [
|
|
@@ -33194,7 +32878,7 @@
|
|
|
33194
32878
|
"optional": false,
|
|
33195
32879
|
"returnType": "void",
|
|
33196
32880
|
"typeParameters": [],
|
|
33197
|
-
"line":
|
|
32881
|
+
"line": 549,
|
|
33198
32882
|
"deprecated": false,
|
|
33199
32883
|
"deprecationMessage": "",
|
|
33200
32884
|
"rawdescription": "\n\nRegistering the function injected to control the touch use of the `Dropdown`.\n",
|
|
@@ -33224,7 +32908,7 @@
|
|
|
33224
32908
|
"optional": false,
|
|
33225
32909
|
"returnType": "void",
|
|
33226
32910
|
"typeParameters": [],
|
|
33227
|
-
"line":
|
|
32911
|
+
"line": 565,
|
|
33228
32912
|
"deprecated": false,
|
|
33229
32913
|
"deprecationMessage": "",
|
|
33230
32914
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the dropdown.\n\nex: `this.formGroup.get(\"myDropdown\").disable();`\n\n",
|
|
@@ -33232,8 +32916,8 @@
|
|
|
33232
32916
|
"jsdoctags": [
|
|
33233
32917
|
{
|
|
33234
32918
|
"name": {
|
|
33235
|
-
"pos":
|
|
33236
|
-
"end":
|
|
32919
|
+
"pos": 17201,
|
|
32920
|
+
"end": 17211,
|
|
33237
32921
|
"flags": 16842752,
|
|
33238
32922
|
"modifierFlagsCache": 0,
|
|
33239
32923
|
"transformFlags": 0,
|
|
@@ -33244,8 +32928,8 @@
|
|
|
33244
32928
|
"deprecated": false,
|
|
33245
32929
|
"deprecationMessage": "",
|
|
33246
32930
|
"tagName": {
|
|
33247
|
-
"pos":
|
|
33248
|
-
"end":
|
|
32931
|
+
"pos": 17195,
|
|
32932
|
+
"end": 17200,
|
|
33249
32933
|
"flags": 16842752,
|
|
33250
32934
|
"modifierFlagsCache": 0,
|
|
33251
32935
|
"transformFlags": 0,
|
|
@@ -33262,7 +32946,7 @@
|
|
|
33262
32946
|
"optional": false,
|
|
33263
32947
|
"returnType": "void",
|
|
33264
32948
|
"typeParameters": [],
|
|
33265
|
-
"line":
|
|
32949
|
+
"line": 843,
|
|
33266
32950
|
"deprecated": false,
|
|
33267
32951
|
"deprecationMessage": "",
|
|
33268
32952
|
"rawdescription": "\n\nControls toggling menu states between open/expanded and closed/collapsed.\n",
|
|
@@ -33274,7 +32958,7 @@
|
|
|
33274
32958
|
"optional": false,
|
|
33275
32959
|
"returnType": "boolean",
|
|
33276
32960
|
"typeParameters": [],
|
|
33277
|
-
"line":
|
|
32961
|
+
"line": 682,
|
|
33278
32962
|
"deprecated": false,
|
|
33279
32963
|
"deprecationMessage": "",
|
|
33280
32964
|
"rawdescription": "\n\nReturns `true` if there is a value selected.\n",
|
|
@@ -33293,7 +32977,7 @@
|
|
|
33293
32977
|
"optional": false,
|
|
33294
32978
|
"returnType": "void",
|
|
33295
32979
|
"typeParameters": [],
|
|
33296
|
-
"line":
|
|
32980
|
+
"line": 498,
|
|
33297
32981
|
"deprecated": false,
|
|
33298
32982
|
"deprecationMessage": "",
|
|
33299
32983
|
"rawdescription": "\n\nPropagates the injected `value`.\n",
|
|
@@ -33319,7 +33003,7 @@
|
|
|
33319
33003
|
"defaultValue": "true",
|
|
33320
33004
|
"deprecated": false,
|
|
33321
33005
|
"deprecationMessage": "",
|
|
33322
|
-
"line":
|
|
33006
|
+
"line": 363,
|
|
33323
33007
|
"type": "boolean",
|
|
33324
33008
|
"decorators": []
|
|
33325
33009
|
},
|
|
@@ -33328,7 +33012,7 @@
|
|
|
33328
33012
|
"defaultValue": "true",
|
|
33329
33013
|
"deprecated": false,
|
|
33330
33014
|
"deprecationMessage": "",
|
|
33331
|
-
"line":
|
|
33015
|
+
"line": 365,
|
|
33332
33016
|
"type": "boolean",
|
|
33333
33017
|
"decorators": []
|
|
33334
33018
|
},
|
|
@@ -33336,7 +33020,7 @@
|
|
|
33336
33020
|
"name": "class.cds--list-box__wrapper--decorator",
|
|
33337
33021
|
"deprecated": false,
|
|
33338
33022
|
"deprecationMessage": "",
|
|
33339
|
-
"line":
|
|
33023
|
+
"line": 203,
|
|
33340
33024
|
"type": "boolean",
|
|
33341
33025
|
"decorators": []
|
|
33342
33026
|
},
|
|
@@ -33375,7 +33059,7 @@
|
|
|
33375
33059
|
"deprecationMessage": "",
|
|
33376
33060
|
"rawdescription": "\n\nAdds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n",
|
|
33377
33061
|
"description": "<p>Adds keyboard functionality for navigation, selection and closing of the <code>Dropdown</code>.</p>\n",
|
|
33378
|
-
"line":
|
|
33062
|
+
"line": 573
|
|
33379
33063
|
}
|
|
33380
33064
|
],
|
|
33381
33065
|
"standalone": false,
|
|
@@ -33383,7 +33067,7 @@
|
|
|
33383
33067
|
"description": "<p>Drop-down lists enable users to select one or more items from a list.</p>\n<h4>Opening behavior/List DOM placement</h4>\n<p>By default the dropdown will try to figure out the best placement for the dropdown list.</p>\n<p>If it's not contained within any scrolling elements, it will open inline, if it <em>is</em>\ncontained within a scrolling container it will try to open in the body, or an <code>cds-placeholder</code>.</p>\n<p>To control this behavior you can use the <code>appendInline</code> input:</p>\n<ul>\n<li><code>[appendInline]="null"</code> is the default (auto detection)</li>\n<li><code>[appendInline]="false"</code> will always append to the body/<code>cds-placeholder</code></li>\n<li><code>[appendInline]="true"</code> will always append inline (next to the dropdown button)</li>\n</ul>\n<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { DropdownModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-dropdown--basic\">See demo</a></p>\n",
|
|
33384
33068
|
"rawdescription": "\n\nDrop-down lists enable users to select one or more items from a list.\n\n#### Opening behavior/List DOM placement\nBy default the dropdown will try to figure out the best placement for the dropdown list.\n\nIf it's not contained within any scrolling elements, it will open inline, if it _is_\ncontained within a scrolling container it will try to open in the body, or an `cds-placeholder`.\n\nTo control this behavior you can use the `appendInline` input:\n- `[appendInline]=\"null\"` is the default (auto detection)\n- `[appendInline]=\"false\"` will always append to the body/`cds-placeholder`\n- `[appendInline]=\"true\"` will always append inline (next to the dropdown button)\n\nGet started with importing the module:\n\n```typescript\nimport { DropdownModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-dropdown--basic)\n",
|
|
33385
33069
|
"type": "component",
|
|
33386
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tContentChild,\n\tOnInit,\n\tViewChild,\n\tAfterContentInit,\n\tHostListener,\n\tOnDestroy,\n\tHostBinding,\n\tTemplateRef,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n// Observable import is required here so typescript can compile correctly\nimport {\n\tObservable,\n\tof,\n\tSubscription\n} from \"rxjs\";\n\nimport { AbstractDropdownView } from \"./abstract-dropdown-view.class\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { ListItem } from \"./list-item.interface\";\nimport { DropdownService } from \"./dropdown.service\";\nimport { ElementService, getScrollableParents } from \"carbon-components-angular/utils\";\nimport { hasScrollableParents } from \"carbon-components-angular/utils\";\n\n/**\n * Drop-down lists enable users to select one or more items from a list.\n *\n * #### Opening behavior/List DOM placement\n * By default the dropdown will try to figure out the best placement for the dropdown list.\n *\n * If it's not contained within any scrolling elements, it will open inline, if it _is_\n * contained within a scrolling container it will try to open in the body, or an `cds-placeholder`.\n *\n * To control this behavior you can use the `appendInline` input:\n * - `[appendInline]=\"null\"` is the default (auto detection)\n * - `[appendInline]=\"false\"` will always append to the body/`cds-placeholder`\n * - `[appendInline]=\"true\"` will always append inline (next to the dropdown button)\n *\n * Get started with importing the module:\n *\n * ```typescript\n * import { DropdownModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-dropdown--basic)\n */\n@Component({\n\tselector: \"cds-dropdown, ibm-dropdown\",\n\ttemplate: `\n\t<label\n\t\t*ngIf=\"label && !skeleton\"\n\t\t[for]=\"id\"\n\t\tclass=\"cds--label\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--label--disabled': disabled,\n\t\t\t'cds--visually-hidden': hideLabel\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div\n\t\tclass=\"cds--list-box\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--dropdown': type !== 'multi' && !(skeleton && fluid),\n\t\t\t'cds--multiselect': type === 'multi',\n\t\t\t'cds--multi-select--selected': type === 'multi' && getSelectedCount() > 0,\n\t\t\t'cds--dropdown--light': theme === 'light',\n\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t'cds--list-box--inline': inline,\n\t\t\t'cds--skeleton': skeleton,\n\t\t\t'cds--dropdown--disabled cds--list-box--disabled': disabled,\n\t\t\t'cds--dropdown--readonly': readonly,\n\t\t\t'cds--dropdown--invalid': invalid,\n\t\t\t'cds--dropdown--warning cds--list-box--warning': warn,\n\t\t\t'cds--dropdown--sm cds--list-box--sm': size === 'sm',\n\t\t\t'cds--dropdown--md cds--list-box--md': size === 'md',\n\t\t\t'cds--dropdown--lg cds--list-box--lg': size === 'lg',\n\t\t\t'cds--list-box--expanded': !menuIsClosed,\n\t\t\t'cds--list-box--invalid': invalid\n\t\t}\"\n\t\t[attr.data-invalid]=\"invalid ? true : null\">\n\t\t<div *ngIf=\"skeleton && fluid\" class=\"cds--list-box__label\"></div>\n\t\t<button\n\t\t\t#dropdownButton\n\t\t\t[id]=\"id\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cds--list-box__field\"\n\t\t\t[ngClass]=\"{'a': !menuIsClosed}\"\n\t\t\t[attr.aria-expanded]=\"!menuIsClosed\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\taria-haspopup=\"listbox\"\n\t\t\t(click)=\"disabled || readonly ? $event.stopPropagation() : toggleMenu()\"\n\t\t\t(focus)=\"fluid ? handleFocus($event) : null\"\n\t\t\t(blur)=\"fluid ? handleFocus($event) : onBlur()\"\n\t\t\t[attr.disabled]=\"disabled ? true : null\">\n\t\t\t<div\n\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t(keydown.enter)=\"clearSelected()\"\n\t\t\t\t*ngIf=\"type === 'multi' && getSelectedCount() > 0\"\n\t\t\t\tclass=\"cds--list-box__selection cds--tag--filter cds--list-box__selection--multi\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[title]=\"clearText\">\n\t\t\t\t{{getSelectedCount()}}\n\t\t\t\t<svg\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\trole=\"img\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\twidth=\"16\"\n\t\t\t\t\theight=\"16\"\n\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\taria-hidden=\"true\">\n\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</svg>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"isRenderString()\" class=\"cds--list-box__label\">{{getDisplayStringValue() | async}}</span>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"!isRenderString()\"\n\t\t\t\t[ngTemplateOutletContext]=\"getRenderTemplateContext()\"\n\t\t\t\t[ngTemplateOutlet]=\"displayValue\">\n\t\t\t</ng-template>\n\t\t\t<span class=\"cds--list-box__menu-icon\">\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\tcdsIcon=\"chevron--down\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t[attr.aria-label]=\"menuButtonLabel\"\n\t\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': !menuIsClosed }\">\n\t\t\t\t</svg>\n\t\t\t</span>\n\t\t</button>\n\t\t<ng-container *ngIf=\"decorator\">\n\t\t\t<div class=\"cds--list-box__inner-wrapper--decorator\">\n\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<svg\n\t\t\t*ngIf=\"invalid\"\n\t\t\tclass=\"cds--list-box__invalid-icon\"\n\t\t\tcdsIcon=\"warning--filled\"\n\t\t\tsize=\"16\">\n\t\t</svg>\n\t\t<svg\n\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t</svg>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"!menuIsClosed\"></ng-content>\n\t\t</div>\n\t</div>\n\t<hr *ngIf=\"fluid\" class=\"cds--list-box__divider\" />\n\t<div\n\t\t*ngIf=\"helperText && !invalid && !warn && !skeleton && !fluid\"\n\t\tclass=\"cds--form__helper-text\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Dropdown,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Dropdown implements OnInit, AfterContentInit, AfterViewInit, OnDestroy, ControlValueAccessor {\n\tstatic dropdownCount = 0;\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid--invalid\") get fluidInvalidClass() {\n\t\treturn this.invalid && this.fluid;\n\t}\n\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid--focus\") get fluidFocusClass() {\n\t\treturn this.fluid && this._isFocused && this.menuIsClosed;\n\t}\n\n\tprotected get writtenValue() {\n\t\treturn this._writtenValue;\n\t}\n\n\tprotected set writtenValue(val: any[]) {\n\t\tif (val && val.length === 0) {\n\t\t\tthis.clearSelected();\n\t\t}\n\t\tthis._writtenValue = val;\n\t}\n\n\t@Input() id = `dropdown-${Dropdown.dropdownCount++}`;\n\t/**\n\t * Label for the dropdown.\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 * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\t/**\n\t * Value displayed if no item is selected.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * The selected value from the `Dropdown`. Can be a string or template.\n\t */\n\t@Input() displayValue: string | TemplateRef<any> = \"\";\n\t/**\n\t * Sets the optional clear button tooltip text.\n\t */\n\t@Input() clearText: string = this.i18n.get().DROPDOWN.CLEAR;\n\t/**\n\t * Size to render the dropdown field.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Defines whether or not the `Dropdown` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` dropdown theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` to disable the dropdown.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a readonly state.\n\t */\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` for a loading dropdown.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an inline dropdown.\n\t */\n\t@Input() inline = false;\n\t/**\n\t * Set to `true` for a dropdown without arrow key activation.\n\t */\n\t@Input() disableArrowKeys = false;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * 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 to `true` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline: boolean = null;\n\t/**\n\t * Query string for the element that contains the `Dropdown`.\n\t * Used to trigger closing the dropdown if it scrolls outside of the viewport of the `scrollableContainer`.\n\t */\n\t@Input() scrollableContainer: string;\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 * Specify feedback (mode) of the selection.\n\t * `top`: selected item jumps to top\n\t * `fixed`: selected item stays at it's 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 * Accessible label for the button that opens the dropdown list.\n\t * Defaults to the `DROPDOWN.OPEN` value from the i18n service.\n\t */\n\t@Input() menuButtonLabel = this.i18n.get().DROPDOWN.OPEN;\n\t/**\n\t * Provides the label for the \"# selected\" text.\n\t * Defaults to the `DROPDOWN.SELECTED` value from the i18n service.\n\t */\n\t@Input() selectedLabel = this.i18n.get().DROPDOWN.SELECTED;\n\t/**\n\t * Overrides the automatic dropUp.\n\t */\n\t@Input() dropUp: boolean;\n\t/**\n\t * Emits selection events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter<any>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() close: EventEmitter<any> = new EventEmitter<any>();\n\n\t/**\n\t * Maintains a reference to the `AbstractDropdownView` object within the content DOM.\n\t */\n\t@ContentChild(AbstractDropdownView, { static: true }) view: AbstractDropdownView;\n\t/**\n\t * Maintains a reference to the view DOM element of the `Dropdown` button.\n\t */\n\t@ViewChild(\"dropdownButton\", { static: true }) dropdownButton;\n\t/**\n\t * ViewChid of the dropdown view.\n\t */\n\t@ViewChild(\"dropdownMenu\", { static: true }) dropdownMenu;\n\n\t@HostBinding(\"class.cds--dropdown__wrapper\") hostClass = true;\n\n\t@HostBinding(\"class.cds--list-box__wrapper\") hostWrapperClass = true;\n\n\t@HostBinding(\"class.cds--list-box__wrapper--decorator\") get hasDecorator() {\n\t\treturn !!this.decorator;\n\t}\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid\") @Input() fluid = false;\n\n\t/**\n\t * Set to `true` if the dropdown is closed (not expanded).\n\t */\n\tmenuIsClosed = true;\n\n\t/**\n\t * controls whether the `drop-up` class is applied\n\t */\n\t_dropUp = false;\n\n\t// .bind creates a new function, so we declare the methods below\n\t// but .bind them up here\n\tnoop = this._noop.bind(this);\n\toutsideClick = this._outsideClick.bind(this);\n\toutsideKey = this._outsideKey.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\n\tprotected visibilitySubscription = new Subscription();\n\n\tprotected onTouchedCallback: () => void = this._noop;\n\n\tprotected _isFocused = false;\n\n\t// primarily used to capture and propagate input to `writeValue` before the content is available\n\tprivate _writtenValue: any = [];\n\n\t/**\n\t * Creates an instance of Dropdown.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n,\n\t\tprotected dropdownService: DropdownService,\n\t\tprotected elementService: ElementService) {}\n\n\t/**\n\t * Updates the `type` property in the `@ContentChild`.\n\t * The `type` property specifies whether the `Dropdown` allows single selection or multi selection.\n\t */\n\tngOnInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t}\n\t}\n\n\t/**\n\t * Initializes classes and subscribes to events for single or multi selection.\n\t */\n\tngAfterContentInit() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tif ((this.writtenValue && this.writtenValue.length) || typeof this.writtenValue === \"number\") {\n\t\t\tthis.writeValue(this.writtenValue);\n\t\t}\n\t\tthis.view.type = this.type;\n\t\tthis.view.size = this.size;\n\n\t\t// function to check if the event is organic (isUpdate === false) or programmatic\n\t\tconst isUpdate = event => event && event.isUpdate;\n\n\t\tthis.view.select.subscribe(event => {\n\t\t\tif (this.type === \"single\" && !isUpdate(event) && !Array.isArray(event)) {\n\t\t\t\tthis.closeMenu();\n\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t\tthis.propagateChange(event.item[this.itemValueKey]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.propagateChange(event.item);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.type === \"multi\" && !isUpdate(event)) {\n\t\t\t\t// if we have a `value` selector and selected items map them appropriately\n\t\t\t\tif (this.itemValueKey && this.view.getSelected()) {\n\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.itemValueKey]);\n\t\t\t\t\tthis.propagateChange(values);\n\t\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t} else {\n\t\t\t\t\tthis.propagateChange(this.view.getSelected());\n\t\t\t\t}\n\t\t\t}\n\t\t\t// only emit selected for \"organic\" selections\n\t\t\tif (!isUpdate(event)) {\n\t\t\t\tthis.checkForReorder();\n\t\t\t\tthis.selected.emit(event);\n\t\t\t}\n\t\t});\n\t}\n\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\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\tthis.checkForReorder();\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 * Propagates the injected `value`.\n\t */\n\twriteValue(value: any) {\n\t\t// cache the written value so we can use it in `AfterContentInit`\n\t\tthis.writtenValue = value;\n\t\tthis.view.onItemsReady(() => {\n\t\t\t// propagate null/falsey as an array (deselect everything)\n\t\t\tif (!value) {\n\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t} else if (this.type === \"single\") {\n\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t// clone the specified item and update its state\n\t\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.itemValueKey] === value));\n\t\t\t\t\tnewValue.selected = true;\n\t\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t\t} else {\n\t\t\t\t\t// pass the singular value as an array of ListItem\n\t\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t// clone the items and update their state based on the received value array\n\t\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\t\tlet newValues = [];\n\t\t\t\t\tfor (const v of value) {\n\t\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\t\tif (item[this.itemValueKey] === v) {\n\t\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t\t} else {\n\t\t\t\t\t// we can safely assume we're passing an array of `ListItem`s\n\t\t\t\t\tthis.view.propagateSelected(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.checkForReorder();\n\t\t});\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registering the function injected to control the touch use of the `Dropdown`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * function passed in by `registerOnChange`\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the dropdown.\n\t *\n\t * ex: `this.formGroup.get(\"myDropdown\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Adds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\tonKeyDown(event: KeyboardEvent) {\n\t\tif (this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((event.key === \"Escape\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close other widgets that listen for Escape\n\t\t}\n\t\tif (event.key === \"Escape\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (this.menuIsClosed && (event.key === \" \" || event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n\t\t\tif (this.disableArrowKeys && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tthis.openMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && event.shiftKey) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (this.type === \"multi\") { return; }\n\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.closedDropdownNavigation(event);\n\t\t}\n\t}\n\n\tclosedDropdownNavigation(event) {\n\t\tif (event.key === \"ArrowDown\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getNextItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t} else if (event.key === \"ArrowUp\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getPrevItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t}\n\t}\n\n\t/**\n\t * Returns the display value if there is a selection and displayValue is set,\n\t * if there is just a selection the ListItem content property will be returned,\n\t * otherwise the placeholder will be returned.\n\t */\n\tgetDisplayStringValue(): Observable<string> {\n\t\tif (!this.view || this.skeleton) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (selected.length && (!this.displayValue || !this.isRenderString())) {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\treturn of(this.placeholder);\n\t\t\t} else {\n\t\t\t\treturn of(selected[0].content);\n\t\t\t}\n\t\t} else if (selected.length && this.isRenderString()) {\n\t\t\treturn of(this.displayValue as string);\n\t\t}\n\t\treturn of(this.placeholder);\n\t}\n\n\tisRenderString(): boolean {\n\t\treturn typeof this.displayValue === \"string\";\n\t}\n\n\tgetRenderTemplateContext() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (this.type === \"multi\") {\n\t\t\treturn { items: selected };\n\t\t} else if (selected && selected.length > 0) {\n\t\t\treturn { item: selected[0] }; // this is to be compatible with the dropdown-list template\n\t\t} else {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tgetSelectedCount(): number {\n\t\tif (this.view.getSelected()) {\n\t\t\treturn this.view.getSelected().length;\n\t\t}\n\t}\n\n\tclearSelected() {\n\t\tif (this.disabled || this.getSelectedCount() === 0) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const item of this.view.getListItems()) {\n\t\t\titem.selected = false;\n\t\t}\n\t\tthis.selected.emit([]);\n\t\tthis.propagateChange([]);\n\t}\n\n\t/**\n\t * Returns `true` if there is a value selected.\n\t */\n\tvalueSelected(): boolean {\n\t\tif (this.view.getSelected()) { return true; }\n\t\treturn false;\n\t}\n\n\t_noop() { }\n\t/**\n\t * Handles clicks outside of the `Dropdown`.\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.closeMenu();\n\t\t}\n\t}\n\t_outsideKey(event) {\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\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.menuIsClosed) {\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.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (!this.menuIsClosed && 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.dropdownButton.nativeElement.focus();\n\t\t\tthis.dropdownButton.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", { bubbles: true, cancelable: true, key: \"Tab\" }));\n\t\t\tthis.closeMenu();\n\t\t}\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 * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tconst lightClass = this.theme === \"light\" ? \" cds--list-box--light\" : \"\";\n\t\tconst expandedClass = !this.menuIsClosed ? \" cds--list-box--expanded\" : \"\";\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.dropdownButton.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\t`${this.elementRef.nativeElement.className}${lightClass}${expandedClass}`);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"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 * Expands the dropdown menu in the view.\n\t */\n\topenMenu() {\n\t\t// prevents the dropdown from opening when list of items is empty\n\t\tif (this.view.getListItems().length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._dropUp = false;\n\t\tthis.menuIsClosed = false;\n\n\t\t// move the dropdown list to the body if we're not appending inline\n\t\t// and position it relative to the dropdown wrapper\n\t\tif (!this.appendInline) {\n\t\t\tconst target = this.dropdownButton.nativeElement;\n\t\t\tconst parent = this.elementRef.nativeElement;\n\t\t\tthis.visibilitySubscription = this.elementService\n\t\t\t\t.visibility(target, parent)\n\t\t\t\t.subscribe(value => {\n\t\t\t\t\tif (!value.visible) {\n\t\t\t\t\t\tthis.closeMenu();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\t// set the dropdown menu to drop up if it's near the bottom of the screen\n\t\t// setTimeout lets us measure after it's 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\n\t\t// we bind noop to document.body.firstElementChild to allow safari to fire events\n\t\t// from document. Then we unbind everything later to keep things light.\n\t\tdocument.body.firstElementChild.addEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.addEventListener(\"keydown\", this.noop, true);\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.addEventListener(\"keydown\", this.outsideKey, true);\n\t\tsetTimeout(() => this.view.initFocus(), 0);\n\t}\n\n\t/**\n\t * Collapsing the dropdown menu and removing unnecessary `EventListeners`.\n\t */\n\tcloseMenu() {\n\t\t// return early if the menu is already closed\n\t\tif (this.menuIsClosed) { return; }\n\t\tthis.menuIsClosed = true;\n\t\tthis.checkForReorder();\n\t\tthis.onClose.emit();\n\t\tthis.close.emit();\n\n\t\t// focus the trigger button when we close ...\n\t\tthis.dropdownButton.nativeElement.focus();\n\n\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\tif (this.view[\"disableScroll\"]) {\n\t\t\tthis.view[\"disableScroll\"]();\n\t\t}\n\n\t\t// move the list back in the component on close\n\t\tif (!this.appendInline) {\n\t\t\tthis.visibilitySubscription.unsubscribe();\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t\tdocument.body.firstElementChild.removeEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.removeEventListener(\"keydown\", this.noop, true);\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.removeEventListener(\"keydown\", this.outsideKey, true);\n\t}\n\n\t/**\n\t * Controls toggling menu states between open/expanded and closed/collapsed.\n\t */\n\ttoggleMenu() {\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.openMenu();\n\t\t} else {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tthis._isFocused = event.type === \"focus\";\n\t\tif (event.type === \"blur\") {\n\t\t\tthis.onBlur();\n\t\t}\n\t}\n\n\t/**\n\t * Controls when it's needed to apply the selection feedback\n\t */\n\tprotected checkForReorder() {\n\t\tconst topAfterReopen = this.menuIsClosed && this.selectionFeedback === \"top-after-reopen\";\n\t\tif ((this.type === \"multi\") && (topAfterReopen || this.selectionFeedback === \"top\")) {\n\t\t\tthis.view.reorderSelected();\n\t\t}\n\t}\n}\n",
|
|
33070
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tContentChild,\n\tOnInit,\n\tViewChild,\n\tAfterContentInit,\n\tHostListener,\n\tOnDestroy,\n\tHostBinding,\n\tTemplateRef,\n\tAfterViewInit\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\n\n// Observable import is required here so typescript can compile correctly\nimport {\n\tObservable,\n\tof,\n\tSubscription\n} from \"rxjs\";\nimport { isNull, isUndefined } from \"lodash-es\";\n\nimport { AbstractDropdownView } from \"./abstract-dropdown-view.class\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { ListItem } from \"./list-item.interface\";\nimport { DropdownService } from \"./dropdown.service\";\nimport { ElementService, getScrollableParents } from \"carbon-components-angular/utils\";\nimport { hasScrollableParents } from \"carbon-components-angular/utils\";\n\n/**\n * Drop-down lists enable users to select one or more items from a list.\n *\n * #### Opening behavior/List DOM placement\n * By default the dropdown will try to figure out the best placement for the dropdown list.\n *\n * If it's not contained within any scrolling elements, it will open inline, if it _is_\n * contained within a scrolling container it will try to open in the body, or an `cds-placeholder`.\n *\n * To control this behavior you can use the `appendInline` input:\n * - `[appendInline]=\"null\"` is the default (auto detection)\n * - `[appendInline]=\"false\"` will always append to the body/`cds-placeholder`\n * - `[appendInline]=\"true\"` will always append inline (next to the dropdown button)\n *\n * Get started with importing the module:\n *\n * ```typescript\n * import { DropdownModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-dropdown--basic)\n */\n@Component({\n\tselector: \"cds-dropdown, ibm-dropdown\",\n\ttemplate: `\n\t<label\n\t\t*ngIf=\"label && !skeleton\"\n\t\t[for]=\"id\"\n\t\tclass=\"cds--label\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--label--disabled': disabled,\n\t\t\t'cds--visually-hidden': hideLabel\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t</label>\n\t<div\n\t\tclass=\"cds--list-box\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--dropdown': type !== 'multi' && !(skeleton && fluid),\n\t\t\t'cds--multiselect': type === 'multi',\n\t\t\t'cds--multi-select--selected': type === 'multi' && getSelectedCount() > 0,\n\t\t\t'cds--dropdown--light': theme === 'light',\n\t\t\t'cds--list-box--light': theme === 'light',\n\t\t\t'cds--list-box--inline': inline,\n\t\t\t'cds--skeleton': skeleton,\n\t\t\t'cds--dropdown--disabled cds--list-box--disabled': disabled,\n\t\t\t'cds--dropdown--readonly': readonly,\n\t\t\t'cds--dropdown--invalid': invalid,\n\t\t\t'cds--dropdown--warning cds--list-box--warning': warn,\n\t\t\t'cds--dropdown--sm cds--list-box--sm': size === 'sm',\n\t\t\t'cds--dropdown--md cds--list-box--md': size === 'md',\n\t\t\t'cds--dropdown--lg cds--list-box--lg': size === 'lg',\n\t\t\t'cds--list-box--expanded': !menuIsClosed,\n\t\t\t'cds--list-box--invalid': invalid\n\t\t}\"\n\t\t[attr.data-invalid]=\"invalid ? true : null\">\n\t\t<div *ngIf=\"skeleton && fluid\" class=\"cds--list-box__label\"></div>\n\t\t<button\n\t\t\t#dropdownButton\n\t\t\t[id]=\"id\"\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cds--list-box__field\"\n\t\t\t[ngClass]=\"{'a': !menuIsClosed}\"\n\t\t\t[attr.aria-expanded]=\"!menuIsClosed\"\n\t\t\t[attr.aria-disabled]=\"disabled\"\n\t\t\taria-haspopup=\"listbox\"\n\t\t\t(click)=\"disabled || readonly ? $event.stopPropagation() : toggleMenu()\"\n\t\t\t(focus)=\"fluid ? handleFocus($event) : null\"\n\t\t\t(blur)=\"fluid ? handleFocus($event) : onBlur()\"\n\t\t\t[attr.disabled]=\"disabled ? true : null\">\n\t\t\t<div\n\t\t\t\t(click)=\"clearSelected()\"\n\t\t\t\t(keydown.enter)=\"clearSelected()\"\n\t\t\t\t*ngIf=\"type === 'multi' && getSelectedCount() > 0\"\n\t\t\t\tclass=\"cds--list-box__selection cds--tag--filter cds--list-box__selection--multi\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t[title]=\"clearText\">\n\t\t\t\t{{getSelectedCount()}}\n\t\t\t\t<svg\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t\tpreserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\tstyle=\"will-change: transform;\"\n\t\t\t\t\trole=\"img\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\twidth=\"16\"\n\t\t\t\t\theight=\"16\"\n\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\taria-hidden=\"true\">\n\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</svg>\n\t\t\t</div>\n\t\t\t<span *ngIf=\"isRenderString()\" class=\"cds--list-box__label\">{{getDisplayStringValue() | async}}</span>\n\t\t\t<ng-template\n\t\t\t\t*ngIf=\"!isRenderString()\"\n\t\t\t\t[ngTemplateOutletContext]=\"getRenderTemplateContext()\"\n\t\t\t\t[ngTemplateOutlet]=\"displayValue\">\n\t\t\t</ng-template>\n\t\t\t<span class=\"cds--list-box__menu-icon\">\n\t\t\t\t<svg\n\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\tcdsIcon=\"chevron--down\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t[attr.aria-label]=\"menuButtonLabel\"\n\t\t\t\t\t[ngClass]=\"{'cds--list-box__menu-icon--open': !menuIsClosed }\">\n\t\t\t\t</svg>\n\t\t\t</span>\n\t\t</button>\n\t\t<ng-container *ngIf=\"decorator\">\n\t\t\t<div class=\"cds--list-box__inner-wrapper--decorator\">\n\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t</div>\n\t\t</ng-container>\n\t\t<svg\n\t\t\t*ngIf=\"invalid\"\n\t\t\tclass=\"cds--list-box__invalid-icon\"\n\t\t\tcdsIcon=\"warning--filled\"\n\t\t\tsize=\"16\">\n\t\t</svg>\n\t\t<svg\n\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\tsize=\"16\"\n\t\t\tclass=\"cds--list-box__invalid-icon cds--list-box__invalid-icon--warning\">\n\t\t</svg>\n\t\t<div\n\t\t\t#dropdownMenu\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--list-box--up': this.dropUp !== null && this.dropUp !== undefined ? dropUp : _dropUp\n\t\t\t}\">\n\t\t\t<ng-content *ngIf=\"!menuIsClosed\"></ng-content>\n\t\t</div>\n\t</div>\n\t<hr *ngIf=\"fluid\" class=\"cds--list-box__divider\" />\n\t<div\n\t\t*ngIf=\"helperText && !invalid && !warn && !skeleton && !fluid\"\n\t\tclass=\"cds--form__helper-text\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--form__helper-text--disabled': disabled\n\t\t}\">\n\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{ invalidText }}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t</div>\n\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: Dropdown,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class Dropdown implements OnInit, AfterContentInit, AfterViewInit, OnDestroy, ControlValueAccessor {\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid--invalid\") get fluidInvalidClass() {\n\t\treturn this.invalid && this.fluid;\n\t}\n\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid--focus\") get fluidFocusClass() {\n\t\treturn this.fluid && this._isFocused && this.menuIsClosed;\n\t}\n\n\t@HostBinding(\"class.cds--list-box__wrapper--decorator\") get hasDecorator() {\n\t\treturn !!this.decorator;\n\t}\n\n\tprotected get writtenValue() {\n\t\treturn this._writtenValue;\n\t}\n\n\tprotected set writtenValue(val: any[]) {\n\t\tif (val && val.length === 0) {\n\t\t\tthis.clearSelected();\n\t\t}\n\t\tthis._writtenValue = val;\n\t}\n\n\tstatic dropdownCount = 0;\n\n\t@Input() id = `dropdown-${Dropdown.dropdownCount++}`;\n\t/**\n\t * Label for the dropdown.\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 * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\t/**\n\t * Value displayed if no item is selected.\n\t */\n\t@Input() placeholder = \"\";\n\t/**\n\t * The selected value from the `Dropdown`. Can be a string or template.\n\t */\n\t@Input() displayValue: string | TemplateRef<any> = \"\";\n\t/**\n\t * Sets the optional clear button tooltip text.\n\t */\n\t@Input() clearText: string = this.i18n.get().DROPDOWN.CLEAR;\n\t/**\n\t * Size to render the dropdown field.\n\t */\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Defines whether or not the `Dropdown` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * `light` or `dark` dropdown theme\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\t/**\n\t * Set to `true` to disable the dropdown.\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * Set to `true` for a readonly state.\n\t */\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` for a loading dropdown.\n\t */\n\t@Input() skeleton = false;\n\t/**\n\t * Set to `true` for an inline dropdown.\n\t */\n\t@Input() inline = false;\n\t/**\n\t * Set to `true` for a dropdown without arrow key activation.\n\t */\n\t@Input() disableArrowKeys = false;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * 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 to `true` to place the dropdown view inline with the component\n\t */\n\t@Input() appendInline: boolean = null;\n\t/**\n\t * Query string for the element that contains the `Dropdown`.\n\t * Used to trigger closing the dropdown if it scrolls outside of the viewport of the `scrollableContainer`.\n\t */\n\t@Input() scrollableContainer: string;\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 * Specify feedback (mode) of the selection.\n\t * `top`: selected item jumps to top\n\t * `fixed`: selected item stays at it's 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 * Accessible label for the button that opens the dropdown list.\n\t * Defaults to the `DROPDOWN.OPEN` value from the i18n service.\n\t */\n\t@Input() menuButtonLabel = this.i18n.get().DROPDOWN.OPEN;\n\t/**\n\t * Provides the label for the \"# selected\" text.\n\t * Defaults to the `DROPDOWN.SELECTED` value from the i18n service.\n\t */\n\t@Input() selectedLabel = this.i18n.get().DROPDOWN.SELECTED;\n\t/**\n\t * Overrides the automatic dropUp.\n\t */\n\t@Input() dropUp: boolean;\n\t/**\n\t * Set to `true` to allow null values in the dropdown ListItems.\n\t */\n\t@Input() allowNullValues = false;\n\t/**\n\t * Emits selection events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter<any>();\n\t/**\n\t * Emits event notifying to other classes that the `Dropdown` has been closed (collapsed).\n\t */\n\t@Output() close: EventEmitter<any> = new EventEmitter<any>();\n\n\t/**\n\t * Maintains a reference to the `AbstractDropdownView` object within the content DOM.\n\t */\n\t@ContentChild(AbstractDropdownView, { static: true }) view: AbstractDropdownView;\n\t/**\n\t * Maintains a reference to the view DOM element of the `Dropdown` button.\n\t */\n\t@ViewChild(\"dropdownButton\", { static: true }) dropdownButton;\n\t/**\n\t * ViewChid of the dropdown view.\n\t */\n\t@ViewChild(\"dropdownMenu\", { static: true }) dropdownMenu;\n\n\t@HostBinding(\"class.cds--dropdown__wrapper\") hostClass = true;\n\n\t@HostBinding(\"class.cds--list-box__wrapper\") hostWrapperClass = true;\n\n\t/**\n\t * Experimental: enable fluid state\n\t */\n\t@HostBinding(\"class.cds--list-box__wrapper--fluid\") @Input() fluid = false;\n\n\t/**\n\t * Set to `true` if the dropdown is closed (not expanded).\n\t */\n\tmenuIsClosed = true;\n\n\t/**\n\t * controls whether the `drop-up` class is applied\n\t */\n\t_dropUp = false;\n\n\t// .bind creates a new function, so we declare the methods below\n\t// but .bind them up here\n\tnoop = this._noop.bind(this);\n\toutsideClick = this._outsideClick.bind(this);\n\toutsideKey = this._outsideKey.bind(this);\n\tkeyboardNav = this._keyboardNav.bind(this);\n\n\tprotected visibilitySubscription = new Subscription();\n\n\tprotected onTouchedCallback: () => void = this._noop;\n\n\tprotected _isFocused = false;\n\n\t// primarily used to capture and propagate input to `writeValue` before the content is available\n\tprivate _writtenValue: any = [];\n\n\tprivate _isUsingNgControl = false;\n\n\tprivate selectionSubscription: Subscription;\n\n\t/**\n\t * Creates an instance of Dropdown.\n\t */\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n,\n\t\tprotected dropdownService: DropdownService,\n\t\tprotected elementService: ElementService) {}\n\n\t/**\n\t * Updates the `type` property in the `@ContentChild`.\n\t * The `type` property specifies whether the `Dropdown` allows single selection or multi selection.\n\t */\n\tngOnInit() {\n\t\tif (this.view) {\n\t\t\tthis.view.type = this.type;\n\t\t}\n\t}\n\n\t/**\n\t * Initializes classes and subscribes to events for single or multi selection.\n\t */\n\tngAfterContentInit() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.view.type = this.type;\n\t\tthis.view.size = this.size;\n\n\t\t// function to check if the event is organic (isUpdate === false) or programmatic\n\t\tconst isUpdate = event => event && event.isUpdate;\n\n\t\tthis.selectionSubscription = this.view.select.subscribe(event => {\n\t\t\tif (this.type === \"single\" && !isUpdate(event) && !Array.isArray(event)) {\n\t\t\t\tthis.closeMenu();\n\t\t\t\tif (event.item && event.item.selected) {\n\t\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t\tthis._propagateChange(event.item[this.itemValueKey]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._propagateChange(event.item);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis._propagateChange(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.type === \"multi\" && !isUpdate(event)) {\n\t\t\t\t// if we have a `value` selector and selected items map them appropriately\n\t\t\t\tif (this.itemValueKey && this.view.getSelected()) {\n\t\t\t\t\tconst values = this.view.getSelected().map(item => item[this.itemValueKey]);\n\t\t\t\t\tthis._propagateChange(values);\n\t\t\t\t\t// otherwise just pass up the values from `getSelected`\n\t\t\t\t} else {\n\t\t\t\t\tthis._propagateChange(this.view.getSelected());\n\t\t\t\t}\n\t\t\t}\n\t\t\t// only emit selected for \"organic\" selections\n\t\t\tif (!isUpdate(event)) {\n\t\t\t\tthis.checkForReorder();\n\t\t\t\tthis.selected.emit(event);\n\t\t\t} else if (this._isUsingNgControl) {\n\t\t\t\tthis.writeValue(this.writtenValue);\n\t\t\t}\n\t\t});\n\t}\n\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\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\tthis.checkForReorder();\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\n\t\tthis.visibilitySubscription?.unsubscribe();\n\t\tthis.selectionSubscription?.unsubscribe();\n\t}\n\n\t/**\n\t * Propagates the injected `value`.\n\t */\n\twriteValue(value: any) {\n\t\t// cache the written value so we can use it in `AfterContentInit`\n\t\tthis.writtenValue = value;\n\t\tthis.view.onItemsReady(() => {\n\t\t\t// propagate null/undefined as an array (deselect everything) unless `allowNullValues` is true\n\t\t\tif (isUndefined(value) || (isNull(value) && !this.allowNullValues)) {\n\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t} else if (this.type === \"single\") {\n\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t// clone the specified item and update its state\n\t\t\t\t\tconst newValue = Object.assign({}, this.view.getListItems().find(item => item[this.itemValueKey] === value));\n\t\t\t\t\tnewValue.selected = true;\n\t\t\t\t\tthis.view.propagateSelected([newValue]);\n\t\t\t\t} else {\n\t\t\t\t\t// pass the singular value as an array of ListItem\n\t\t\t\t\tthis.view.propagateSelected([value]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.itemValueKey) {\n\t\t\t\t\t// clone the items and update their state based on the received value array\n\t\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\t\tlet newValues = [];\n\t\t\t\t\tfor (const v of value) {\n\t\t\t\t\t\tfor (const item of this.view.getListItems()) {\n\t\t\t\t\t\t\tif (item[this.itemValueKey] === v) {\n\t\t\t\t\t\t\t\tnewValues.push(Object.assign({}, item, { selected: true }));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.view.propagateSelected(newValues);\n\t\t\t\t} else {\n\t\t\t\t\t// we can safely assume we're passing an array of `ListItem`s\n\t\t\t\t\tthis.view.propagateSelected(value || [value]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.checkForReorder();\n\t\t});\n\t}\n\n\tonBlur() {\n\t\tthis.onTouchedCallback();\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis._isUsingNgControl = true;\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registering the function injected to control the touch use of the `Dropdown`.\n\t */\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouchedCallback = fn;\n\t}\n\n\t/**\n\t * function passed in by `registerOnChange`\n\t */\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the dropdown.\n\t *\n\t * ex: `this.formGroup.get(\"myDropdown\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the input\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Adds keyboard functionality for navigation, selection and closing of the `Dropdown`.\n\t */\n\t@HostListener(\"keydown\", [\"$event\"])\n\tonKeyDown(event: KeyboardEvent) {\n\t\tif (this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ((event.key === \"Escape\") && !this.menuIsClosed) {\n\t\t\tevent.stopImmediatePropagation(); // don't unintentionally close other widgets that listen for Escape\n\t\t}\n\t\tif (event.key === \"Escape\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (this.menuIsClosed && (event.key === \" \" || event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n\t\t\tif (this.disableArrowKeys && (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tthis.openMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && event.shiftKey) {\n\t\t\tthis.closeMenu();\n\t\t}\n\n\t\tif (this.type === \"multi\") { return; }\n\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.closedDropdownNavigation(event);\n\t\t}\n\t}\n\n\tclosedDropdownNavigation(event) {\n\t\tif (event.key === \"ArrowDown\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getNextItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t} else if (event.key === \"ArrowUp\") {\n\t\t\tevent.preventDefault();\n\t\t\tthis.view.getCurrentItem().selected = false;\n\t\t\tlet item = this.view.getPrevItem();\n\t\t\tif (item) { item.selected = true; }\n\t\t}\n\t}\n\n\t/**\n\t * Returns the display value if there is a selection and displayValue is set,\n\t * if there is just a selection the ListItem content property will be returned,\n\t * otherwise the placeholder will be returned.\n\t */\n\tgetDisplayStringValue(): Observable<string> {\n\t\tif (!this.view || this.skeleton) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (selected.length && (!this.displayValue || !this.isRenderString())) {\n\t\t\tif (this.type === \"multi\") {\n\t\t\t\treturn of(this.placeholder);\n\t\t\t} else {\n\t\t\t\treturn of(selected[0].content);\n\t\t\t}\n\t\t} else if (selected.length && this.isRenderString()) {\n\t\t\treturn of(this.displayValue as string);\n\t\t}\n\t\treturn of(this.placeholder);\n\t}\n\n\tisRenderString(): boolean {\n\t\treturn typeof this.displayValue === \"string\";\n\t}\n\n\tgetRenderTemplateContext() {\n\t\tif (!this.view) {\n\t\t\treturn;\n\t\t}\n\t\tlet selected = this.view.getSelected();\n\t\tif (this.type === \"multi\") {\n\t\t\treturn { items: selected };\n\t\t} else if (selected && selected.length > 0) {\n\t\t\treturn { item: selected[0] }; // this is to be compatible with the dropdown-list template\n\t\t} else {\n\t\t\treturn {};\n\t\t}\n\t}\n\n\tgetSelectedCount(): number {\n\t\tif (this.view.getSelected()) {\n\t\t\treturn this.view.getSelected().length;\n\t\t}\n\t}\n\n\tclearSelected() {\n\t\tif (this.disabled || this.getSelectedCount() === 0) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const item of this.view.getListItems()) {\n\t\t\titem.selected = false;\n\t\t}\n\t\tthis.selected.emit([]);\n\t\tthis._propagateChange([]);\n\t}\n\n\t/**\n\t * Returns `true` if there is a value selected.\n\t */\n\tvalueSelected(): boolean {\n\t\tif (this.view.getSelected()) { return true; }\n\t\treturn false;\n\t}\n\n\t_noop() { }\n\t/**\n\t * Handles clicks outside of the `Dropdown`.\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.closeMenu();\n\t\t}\n\t}\n\t_outsideKey(event) {\n\t\tif (!this.menuIsClosed && event.key === \"Tab\" && this.dropdownMenu.nativeElement.contains(event.target as Node)) {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\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.menuIsClosed) {\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.closeMenu();\n\t\t\tthis.dropdownButton.nativeElement.focus();\n\t\t} else if (!this.menuIsClosed && 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.dropdownButton.nativeElement.focus();\n\t\t\tthis.dropdownButton.nativeElement.dispatchEvent(new KeyboardEvent(\"keydown\", { bubbles: true, cancelable: true, key: \"Tab\" }));\n\t\t\tthis.closeMenu();\n\t\t}\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 * Creates the `Dropdown` list as an element that is appended to the DOM body.\n\t */\n\t_appendToBody() {\n\t\tconst lightClass = this.theme === \"light\" ? \" cds--list-box--light\" : \"\";\n\t\tconst expandedClass = !this.menuIsClosed ? \" cds--list-box--expanded\" : \"\";\n\t\tthis.dropdownService.appendToBody(\n\t\t\tthis.dropdownButton.nativeElement,\n\t\t\tthis.dropdownMenu.nativeElement,\n\t\t\t`${this.elementRef.nativeElement.className}${lightClass}${expandedClass}`);\n\t\tthis.dropdownMenu.nativeElement.addEventListener(\"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 * Expands the dropdown menu in the view.\n\t */\n\topenMenu() {\n\t\t// prevents the dropdown from opening when list of items is empty\n\t\tif (this.view.getListItems().length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._dropUp = false;\n\t\tthis.menuIsClosed = false;\n\n\t\t// move the dropdown list to the body if we're not appending inline\n\t\t// and position it relative to the dropdown wrapper\n\t\tif (!this.appendInline) {\n\t\t\tconst target = this.dropdownButton.nativeElement;\n\t\t\tconst parent = this.elementRef.nativeElement;\n\t\t\tthis.visibilitySubscription = this.elementService\n\t\t\t\t.visibility(target, parent)\n\t\t\t\t.subscribe(value => {\n\t\t\t\t\tif (!value.visible) {\n\t\t\t\t\t\tthis.closeMenu();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tthis._appendToBody();\n\t\t}\n\n\t\t// set the dropdown menu to drop up if it's near the bottom of the screen\n\t\t// setTimeout lets us measure after it's 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\n\t\t// we bind noop to document.body.firstElementChild to allow safari to fire events\n\t\t// from document. Then we unbind everything later to keep things light.\n\t\tdocument.body.firstElementChild.addEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.addEventListener(\"keydown\", this.noop, true);\n\t\tdocument.addEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.addEventListener(\"keydown\", this.outsideKey, true);\n\t\tsetTimeout(() => this.view.initFocus(), 0);\n\t}\n\n\t/**\n\t * Collapsing the dropdown menu and removing unnecessary `EventListeners`.\n\t */\n\tcloseMenu() {\n\t\t// return early if the menu is already closed\n\t\tif (this.menuIsClosed) { return; }\n\t\tthis.menuIsClosed = true;\n\t\tthis.checkForReorder();\n\t\tthis.onClose.emit();\n\t\tthis.close.emit();\n\n\t\t// focus the trigger button when we close ...\n\t\tthis.dropdownButton.nativeElement.focus();\n\n\t\t// remove the conditional once this api is settled and part of abstract-dropdown-view.class\n\t\tif (this.view[\"disableScroll\"]) {\n\t\t\tthis.view[\"disableScroll\"]();\n\t\t}\n\n\t\t// move the list back in the component on close\n\t\tif (!this.appendInline) {\n\t\t\tthis.visibilitySubscription.unsubscribe();\n\t\t\tthis._appendToDropdown();\n\t\t}\n\t\tdocument.body.firstElementChild.removeEventListener(\"click\", this.noop, true);\n\t\tdocument.body.firstElementChild.removeEventListener(\"keydown\", this.noop, true);\n\t\tdocument.removeEventListener(\"click\", this.outsideClick, true);\n\t\tdocument.removeEventListener(\"keydown\", this.outsideKey, true);\n\t}\n\n\t/**\n\t * Controls toggling menu states between open/expanded and closed/collapsed.\n\t */\n\ttoggleMenu() {\n\t\tif (this.menuIsClosed) {\n\t\t\tthis.openMenu();\n\t\t} else {\n\t\t\tthis.closeMenu();\n\t\t}\n\t}\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\thandleFocus(event: FocusEvent) {\n\t\tthis._isFocused = event.type === \"focus\";\n\t\tif (event.type === \"blur\") {\n\t\t\tthis.onBlur();\n\t\t}\n\t}\n\n\t/**\n\t * Controls when it's needed to apply the selection feedback\n\t */\n\tprotected checkForReorder() {\n\t\tconst topAfterReopen = this.menuIsClosed && this.selectionFeedback === \"top-after-reopen\";\n\t\tif ((this.type === \"multi\") && (topAfterReopen || this.selectionFeedback === \"top\")) {\n\t\t\tthis.view.reorderSelected();\n\t\t}\n\t}\n\n\t// used only to update writtenValue\n\tprivate _propagateChange(value: any) {\n\t\tthis.writtenValue = value;\n\t\tthis.propagateChange(value);\n\t}\n}\n",
|
|
33387
33071
|
"assetsDirs": [],
|
|
33388
33072
|
"styleUrlsData": "",
|
|
33389
33073
|
"stylesData": "",
|
|
@@ -33418,7 +33102,7 @@
|
|
|
33418
33102
|
"deprecationMessage": ""
|
|
33419
33103
|
}
|
|
33420
33104
|
],
|
|
33421
|
-
"line":
|
|
33105
|
+
"line": 400,
|
|
33422
33106
|
"rawdescription": "\n\nCreates an instance of Dropdown.\n",
|
|
33423
33107
|
"jsdoctags": [
|
|
33424
33108
|
{
|
|
@@ -33492,14 +33176,14 @@
|
|
|
33492
33176
|
"name": "hasDecorator",
|
|
33493
33177
|
"type": "",
|
|
33494
33178
|
"returnType": "",
|
|
33495
|
-
"line":
|
|
33179
|
+
"line": 203
|
|
33496
33180
|
}
|
|
33497
33181
|
}
|
|
33498
33182
|
}
|
|
33499
33183
|
},
|
|
33500
33184
|
{
|
|
33501
33185
|
"name": "DropdownList",
|
|
33502
|
-
"id": "component-DropdownList-
|
|
33186
|
+
"id": "component-DropdownList-94f3bf70177862d120129d4920477ebd053b337114916c63546dff3586f8d1c7397a6c112defab77f84aac8636edfdf17681b7a33f6419a4aa46e0bae2ede828",
|
|
33503
33187
|
"file": "src/dropdown/list/dropdown-list.component.ts",
|
|
33504
33188
|
"encapsulation": [],
|
|
33505
33189
|
"entryComponents": [],
|
|
@@ -34206,7 +33890,7 @@
|
|
|
34206
33890
|
"args": [
|
|
34207
33891
|
{
|
|
34208
33892
|
"name": "items",
|
|
34209
|
-
"type": "",
|
|
33893
|
+
"type": "ListItem[]",
|
|
34210
33894
|
"deprecated": false,
|
|
34211
33895
|
"deprecationMessage": ""
|
|
34212
33896
|
}
|
|
@@ -34222,7 +33906,7 @@
|
|
|
34222
33906
|
"jsdoctags": [
|
|
34223
33907
|
{
|
|
34224
33908
|
"name": "items",
|
|
34225
|
-
"type": "",
|
|
33909
|
+
"type": "ListItem[]",
|
|
34226
33910
|
"deprecated": false,
|
|
34227
33911
|
"deprecationMessage": "",
|
|
34228
33912
|
"tagName": {
|
|
@@ -34241,7 +33925,7 @@
|
|
|
34241
33925
|
"description": "<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-dropdown-list [items]="listItems"></cds-dropdown-list></code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">listItems = [\n {\n content: "item one",\n selected: false\n },\n {\n content: "item two",\n selected: false,\n },\n {\n content: "item three",\n selected: false\n },\n {\n content: "item four",\n selected: false\n }\n];</code></pre></div>",
|
|
34242
33926
|
"rawdescription": "\n\n```html\n<cds-dropdown-list [items]=\"listItems\"></cds-dropdown-list>\n```\n```typescript\nlistItems = [\n\t{\n\t\tcontent: \"item one\",\n\t\tselected: false\n\t},\n\t{\n\t\tcontent: \"item two\",\n\t\tselected: false,\n\t},\n\t{\n\t\tcontent: \"item three\",\n\t\tselected: false\n\t},\n\t{\n\t\tcontent: \"item four\",\n\t\tselected: false\n\t}\n];\n```\n",
|
|
34243
33927
|
"type": "component",
|
|
34244
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tOnDestroy,\n\tEventEmitter,\n\tTemplateRef,\n\tAfterViewInit,\n\tViewChild,\n\tElementRef,\n\tViewChildren,\n\tQueryList,\n\tApplicationRef\n} from \"@angular/core\";\nimport { Observable, isObservable, Subscription, of } from \"rxjs\";\nimport { first } from \"rxjs/operators\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { AbstractDropdownView } from \"../abstract-dropdown-view.class\";\nimport { ListItem } from \"../list-item.interface\";\nimport { watchFocusJump } from \"../dropdowntools\";\nimport { ScrollCustomEvent } from \"./scroll-custom-event.interface\";\n\n\n/**\n * ```html\n * <cds-dropdown-list [items]=\"listItems\"></cds-dropdown-list>\n * ```\n * ```typescript\n * listItems = [\n * \t{\n * \t\tcontent: \"item one\",\n * \t\tselected: false\n * \t},\n * \t{\n * \t\tcontent: \"item two\",\n * \t\tselected: false,\n * \t},\n * \t{\n * \t\tcontent: \"item three\",\n * \t\tselected: false\n * \t},\n * \t{\n * \t\tcontent: \"item four\",\n * \t\tselected: false\n * \t}\n * ];\n * ```\n */\n@Component({\n\tselector: \"cds-dropdown-list, ibm-dropdown-list\",\n\ttemplate: `\n\t\t<ul\n\t\t\t#list\n\t\t\t[id]=\"listId\"\n\t\t\trole=\"listbox\"\n\t\t\tclass=\"cds--list-box__menu cds--multi-select\"\n\t\t\t(scroll)=\"emitScroll($event)\"\n\t\t\t(keydown)=\"navigateList($event)\"\n\t\t\ttabindex=\"0\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t[attr.aria-activedescendant]=\"highlightedItem\">\n\t\t\t<li\n\t\t\t\trole=\"option\"\n\t\t\t\t*ngFor=\"let item of displayItems; let i = index\"\n\t\t\t\t(click)=\"doClick($event, item)\"\n\t\t\t\tclass=\"cds--list-box__menu-item\"\n\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t[id]=\"getItemId(i)\"\n\t\t\t\t[attr.tabindex]=\"highlightedItem === getItemId(i) ? 0 : null\"\n\t\t\t\t[attr.title]=\" showTitles ? item.content : null\"\n\t\t\t\t[attr.disabled]=\"item.disabled ? true : null\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--list-box__menu-item--active': item.selected,\n\t\t\t\t\t'cds--list-box__menu-item--highlighted': highlightedItem === getItemId(i)\n\t\t\t\t}\">\n\t\t\t\t<div\n\t\t\t\t\t#listItem\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tclass=\"cds--list-box__menu-item__option\">\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"!listTpl && type === 'multi'\"\n\t\t\t\t\t\tclass=\"cds--form-item cds--checkbox-wrapper\">\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t[attr.data-contained-checkbox-state]=\"item.selected\"\n\t\t\t\t\t\t\tclass=\"cds--checkbox-label\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"cds--checkbox\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t[checked]=\"item.selected\"\n\t\t\t\t\t\t\t\t[disabled]=\"item.disabled\"\n\t\t\t\t\t\t\t\ttabindex=\"-1\">\n\t\t\t\t\t\t\t<span class=\"cds--checkbox-appearance\"></span>\n\t\t\t\t\t\t\t<span class=\"cds--checkbox-label-text\">{{item.content}}</span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ng-container *ngIf=\"!listTpl && type === 'single'\">{{item.content}}</ng-container>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"!listTpl && type === 'single'\"\n\t\t\t\t\t\tcdsIcon=\"checkmark\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__menu-item__selected-icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"listTpl\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{item: item}\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"listTpl\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ul>`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: AbstractDropdownView,\n\t\t\tuseExisting: DropdownList\n\t\t}\n\t]\n})\nexport class DropdownList implements AbstractDropdownView, AfterViewInit, OnDestroy {\n\tstatic listCount = 0;\n\t@Input() ariaLabel = this.i18n.get().DROPDOWN_LIST.LABEL;\n\t/**\n\t * The list items belonging to the `DropdownList`.\n\t */\n\t@Input() set items(value: Array<ListItem> | Observable<Array<ListItem>>) {\n\t\tif (isObservable(value)) {\n\t\t\tif (this._itemsSubscription) {\n\t\t\t\tthis._itemsSubscription.unsubscribe();\n\t\t\t}\n\t\t\tthis._itemsReady = new Observable<boolean>((observer) => {\n\t\t\t\tthis._itemsSubscription = value.subscribe(v => {\n\t\t\t\t\tthis.updateList(v);\n\t\t\t\t\tobserver.next(true);\n\t\t\t\t\tobserver.complete();\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.onItemsReady(null);\n\t\t} else {\n\t\t\tthis.updateList(value);\n\t\t}\n\t\tthis._originalItems = value;\n\t}\n\n\tget items(): Array<ListItem> | Observable<Array<ListItem>> {\n\t\treturn this._originalItems;\n\t}\n\t/**\n\t * Template to bind to items in the `DropdownList` (optional).\n\t */\n\t@Input() listTpl: string | TemplateRef<any> = null;\n\t/**\n\t * Event to emit selection of a list item within the `DropdownList`.\n\t */\n\t@Output() select: EventEmitter<{ item: ListItem, isUpdate?: boolean } | ListItem[]> = new EventEmitter();\n\t/**\n\t * Event to emit scroll event of a list within the `DropdownList`.\n\t */\n\t@Output() scroll: EventEmitter<ScrollCustomEvent> = new EventEmitter();\n\t/**\n\t * Event to suggest a blur on the view.\n\t * Emits _after_ the first/last item has been focused.\n\t * ex.\n\t * ArrowUp -> focus first item\n\t * ArrowUp -> emit event\n\t *\n\t * When this event fires focus should be placed on some element outside of the list - blurring the list as a result\n\t */\n\t@Output() blurIntent = new EventEmitter<\"top\" | \"bottom\">();\n\t/**\n\t * Maintains a reference to the view DOM element for the unordered list of items within the `DropdownList`.\n\t */\n\t@ViewChild(\"list\", { static: true }) list: ElementRef;\n\t/**\n\t * Defines whether or not the `DropdownList` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\n\t/**\n\t * Defines whether to show title attribute or not\n\t */\n\t@Input() showTitles = true;\n\n\t/**\n\t * Defines the rendering size of the `DropdownList` input component.\n\t */\n\tpublic size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\tpublic listId = `listbox-${DropdownList.listCount++}`;\n\tpublic highlightedItem = null;\n\t/**\n\t * Holds the list of items that will be displayed in the `DropdownList`.\n\t * It differs from the the complete set of items when filtering is used (but\n\t * it is always a subset of the total items in `DropdownList`).\n\t */\n\tpublic displayItems: Array<ListItem> = [];\n\t/**\n\t * Maintains the index for the selected item within the `DropdownList`.\n\t */\n\tprotected index = -1;\n\t/**\n\t * An array holding the HTML list elements in the view.\n\t */\n\t@ViewChildren(\"listItem\") protected listElementList: QueryList<ElementRef>;\n\t/**\n\t * Observable bound to keydown events to control filtering.\n\t */\n\tprotected focusJump;\n\t/**\n\t * Tracks the current (if any) subscription to the items observable so we can clean up when the input is updated.\n\t */\n\tprotected _itemsSubscription: Subscription;\n\t/**\n\t * Used to retain the original items passed to the setter.\n\t */\n\tprotected _originalItems: Array<ListItem> | Observable<Array<ListItem>>;\n\t/**\n\t * Useful representation of the items, should be accessed via `getListItems`.\n\t */\n\tprotected _items: Array<ListItem> = [];\n\t/**\n\t * Used to wait for items in case they are passed through an observable.\n\t */\n\tprotected _itemsReady: Observable<boolean>;\n\n\t/**\n\t * Creates an instance of `DropdownList`.\n\t */\n\tconstructor(public elementRef: ElementRef, protected i18n: I18n, protected appRef: ApplicationRef) {}\n\n\t/**\n\t * Retrieves array of list items and index of the selected item after view has rendered.\n\t * Additionally, any Observables for the `DropdownList` are initialized.\n\t */\n\tngAfterViewInit() {\n\t\tthis.index = this.getListItems().findIndex(item => item.selected);\n\t\tthis.setupFocusObservable();\n\t\tsetTimeout(() => {\n\t\t\tthis.doEmitSelect(true);\n\t\t});\n\t}\n\n\t/**\n\t * Removes any Observables on destruction of the component.\n\t */\n\tngOnDestroy() {\n\t\tif (this.focusJump) {\n\t\t\tthis.focusJump.unsubscribe();\n\t\t}\n\t\tif (this._itemsSubscription) {\n\t\t\tthis._itemsSubscription.unsubscribe();\n\t\t}\n\t}\n\n\tdoEmitSelect(isUpdate = true) {\n\t\tif (this.type === \"single\") {\n\t\t\tthis.select.emit({ item: this._items.find(item => item.selected), isUpdate: isUpdate });\n\t\t} else {\n\t\t\t// abuse javascripts object mutability until we can break the API and switch to\n\t\t\t// { items: [], isUpdate: true }\n\t\t\tconst selected = this.getSelected() || [];\n\t\t\tselected[\"isUpdate\"] = isUpdate;\n\t\t\tthis.select.emit(selected);\n\t\t}\n\t}\n\n\tgetItemId(index: number) {\n\t\treturn `${this.listId}-${index}`;\n\t}\n\n\t/**\n\t * Updates the displayed list of items and then retrieves the most current properties for the `DropdownList` from the DOM.\n\t */\n\tupdateList(items) {\n\t\tthis._items = items.map(item => Object.assign({}, item));\n\t\tthis.displayItems = this._items;\n\t\tthis.updateIndex();\n\t\tthis.setupFocusObservable();\n\t\tthis.doEmitSelect();\n\t}\n\n\t/**\n\t * Filters the items being displayed in the DOM list.\n\t */\n\tfilterBy(query = \"\") {\n\t\tif (query) {\n\t\t\tthis.displayItems = this.getListItems().filter(item => item.content.toLowerCase().includes(query.toLowerCase()));\n\t\t\t// Reset index if items were found\n\t\t\t// Prevent selecting index in list that are undefined.\n\t\t\tif (this.displayItems) {\n\t\t\t\tthis.index = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.displayItems = this.getListItems();\n\t\t}\n\n\t\tthis.updateIndex();\n\t}\n\n\t/**\n\t * Initializes (or re-initializes) the Observable that handles switching focus to an element based on\n\t * key input matching the first letter of the item in the list.\n\t */\n\tsetupFocusObservable() {\n\t\tif (!this.list) { return; }\n\t\tif (this.focusJump) {\n\t\t\tthis.focusJump.unsubscribe();\n\t\t}\n\t\tlet elList = Array.from(this.list.nativeElement.querySelectorAll(\"li\"));\n\t\tthis.focusJump = watchFocusJump(this.list.nativeElement, elList)\n\t\t\t.subscribe(el => {\n\t\t\t\tel.focus();\n\t\t\t});\n\t}\n\n\t/**\n\t * Returns the `ListItem` that is subsequent to the selected item in the `DropdownList`.\n\t */\n\tgetNextItem(): ListItem {\n\t\tif (this.index < this.displayItems.length - 1) {\n\t\t\tthis.index++;\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns `true` if the selected item is not the last item in the `DropdownList`.\n\t */\n\thasNextElement(): boolean {\n\t\treturn this.index < this.displayItems.length - 1 &&\n\t\t\t(!(this.index === this.displayItems.length - 2) || !this.displayItems[this.index + 1].disabled);\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that is subsequent to the selected item.\n\t */\n\tgetNextElement(): HTMLElement {\n\t\t// Only return native elements if they are rendered\n\t\tconst elemList = this.listElementList ? this.listElementList.toArray() : [];\n\t\tif (!elemList.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Start checking from next index\n\t\t * Continue looping through the list until a non disabeled element is found or\n\t\t * end of list is reached\n\t\t */\n\t\tfor (let i = this.index + 1; i < elemList.length; i++) {\n\t\t\t// If the values in the list are not disabled\n\t\t\tif (!this.displayItems[i].disabled) {\n\t\t\t\tthis.index = i;\n\t\t\t\treturn elemList[i].nativeElement;\n\t\t\t}\n\t\t}\n\n\t\treturn elemList[this.index]?.nativeElement;\n\t}\n\n\t/**\n\t * Returns the `ListItem` that precedes the selected item within `DropdownList`.\n\t */\n\tgetPrevItem(): ListItem {\n\t\tif (this.index > 0) {\n\t\t\tthis.index--;\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns `true` if the selected item is not the first in the list.\n\t */\n\thasPrevElement(): boolean {\n\t\treturn this.index > 0 && (!(this.index === 1) || !this.displayItems[0].disabled);\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that precedes the selected item.\n\t */\n\tgetPrevElement(): HTMLElement {\n\t\t// Only return native elements if they are rendered\n\t\tconst elemList = this.listElementList ? this.listElementList.toArray() : [];\n\t\tif (!elemList.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Start checking from next index\n\t\t * Continue looping through the list until a non disabeled element is found or\n\t\t * end of list is reached\n\t\t */\n\t\tfor (let i = this.index - 1; i < this.index && i >= 0; i--) {\n\t\t\t// If the values in the list are not disabled\n\t\t\tif (!this.displayItems[i].disabled) {\n\t\t\t\tthis.index = i;\n\t\t\t\treturn elemList[i].nativeElement;\n\t\t\t}\n\t\t}\n\n\t\treturn elemList[this.index].nativeElement;\n\t}\n\n\t/**\n\t * Returns the `ListItem` that is selected within `DropdownList`.\n\t */\n\tgetCurrentItem(): ListItem {\n\t\tif (this.index < 0) {\n\t\t\treturn this.displayItems[0];\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that is selected within the `DropdownList`.\n\t */\n\tgetCurrentElement(): HTMLElement {\n\t\tif (this.index < 0) {\n\t\t\treturn this.listElementList.first.nativeElement;\n\t\t}\n\t\treturn this.listElementList.toArray()[this.index].nativeElement;\n\t}\n\n\t/**\n\t * Returns the items as an Array\n\t */\n\tgetListItems(): Array<ListItem> {\n\t\treturn this._items;\n\t}\n\n\t/**\n\t * Returns a list containing the selected item(s) in the `DropdownList`.\n\t */\n\tgetSelected(): ListItem[] {\n\t\tlet selected = this.getListItems().filter(item => item.selected);\n\t\tif (selected.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\treturn selected;\n\t}\n\n\t/**\n\t * Transforms array input list of items to the correct state by updating the selected item(s).\n\t */\n\tpropagateSelected(value: Array<ListItem>): void {\n\t\t// if we get a non-array, log out an error (since it is one)\n\t\tif (!Array.isArray(value)) {\n\t\t\tconsole.error(`${this.constructor.name}.propagateSelected expects an Array<ListItem>, got ${JSON.stringify(value)}`);\n\t\t}\n\t\tthis.onItemsReady(() => {\n\t\t\tconst selectedNewItems = [];\n\t\t\tfor (let newItem of value) {\n\t\t\t\tif (newItem && newItem.selected) {\n\t\t\t\t\t// copy the item\n\t\t\t\t\tlet tempNewItem: string | ListItem = Object.assign({}, newItem);\n\t\t\t\t\t// deleted selected because it's what we _want_ to change\n\t\t\t\t\tdelete tempNewItem.selected;\n\t\t\t\t\t// stringify for compare later\n\t\t\t\t\ttempNewItem = JSON.stringify(tempNewItem);\n\t\t\t\t\t// add to the list of selected items\n\t\t\t\t\tselectedNewItems.push(tempNewItem);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// loop through the list items and update the `selected` state for matching items in `value`\n\t\t\tfor (let oldItem of this.getListItems()) {\n\t\t\t\t// fast path when no items are selected\n\t\t\t\tif (selectedNewItems.length === 0) {\n\t\t\t\t\toldItem.selected = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// copy the item\n\t\t\t\tlet tempOldItem: string | ListItem = Object.assign({}, oldItem);\n\t\t\t\t// deleted selected because it's what we _want_ to change\n\t\t\t\tdelete tempOldItem.selected;\n\t\t\t\t// stringify for compare\n\t\t\t\ttempOldItem = JSON.stringify(tempOldItem);\n\t\t\t\tfor (let selectedNewItem of selectedNewItems) {\n\t\t\t\t\t// do the compare\n\t\t\t\t\tif (tempOldItem.includes(selectedNewItem)) {\n\t\t\t\t\t\toldItem.selected = true;\n\t\t\t\t\t\t// if we've found a matching item, we can stop looping\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toldItem.selected = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Initializes focus in the list, effectively a wrapper for `getCurrentElement().focus()`\n\t */\n\tinitFocus() {\n\t\tif (this.index < 0) {\n\t\t\tthis.updateIndex();\n\t\t}\n\n\t\tthis.list.nativeElement.focus();\n\t\tsetTimeout(() => {\n\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t});\n\t}\n\n\tupdateIndex() {\n\t\t// initialize index on the first selected item or\n\t\t// on the next non disabled item if no items are selected\n\t\t// in case, if all items are disabled, the index value will remain same\n\t\tconst selected = this.getSelected();\n\t\tif (selected.length) {\n\t\t\tthis.index = this.displayItems.indexOf(selected[0]);\n\t\t} else if (this.index < 0 && this.hasNextElement()) {\n\t\t\tthis.getNextElement();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for navigation and selection within a `DropdownList`.\n\t */\n\tnavigateList(event: KeyboardEvent) {\n\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\tif (this.listElementList.some(option => option.nativeElement === event.target)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tthis.doClick(event, this.getCurrentItem());\n\t\t\t}\n\t\t} else if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n\t\t\tevent.preventDefault();\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tif (this.hasNextElement()) {\n\t\t\t\t\tthis.getNextElement()?.scrollIntoView({ block: \"end\" });\n\t\t\t\t} else {\n\t\t\t\t\tthis.blurIntent.emit(\"bottom\");\n\t\t\t\t}\n\t\t\t} else if (event.key === \"ArrowUp\") {\n\t\t\t\tif (this.hasPrevElement()) {\n\t\t\t\t\tthis.getPrevElement().scrollIntoView({ block: \"nearest\" });\n\t\t\t\t} else {\n\t\t\t\t\tthis.blurIntent.emit(\"top\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Emits the selected item or items after a mouse click event has occurred.\n\t */\n\tdoClick(event, item) {\n\t\tevent.preventDefault();\n\t\tif (item && !item.disabled) {\n\t\t\tthis.list.nativeElement.focus();\n\t\t\tif (this.type === \"single\") {\n\t\t\t\titem.selected = true;\n\t\t\t\t// reset the selection\n\t\t\t\tfor (let otherItem of this.getListItems()) {\n\t\t\t\t\tif (item !== otherItem) { otherItem.selected = false; }\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem.selected = !item.selected;\n\t\t\t}\n\t\t\tthis.index = this.displayItems.indexOf(item);\n\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\tthis.doEmitSelect(false);\n\t\t\tthis.appRef.tick();\n\t\t}\n\t}\n\n\tonItemFocus(index) {\n\t\tconst element = this.listElementList.toArray()[index].nativeElement;\n\t\telement.classList.add(\"cds--list-box__menu-item--highlighted\");\n\t\telement.tabIndex = 0;\n\t}\n\n\tonItemBlur(index) {\n\t\tconst element = this.listElementList.toArray()[index].nativeElement;\n\t\telement.classList.remove(\"cds--list-box__menu-item--highlighted\");\n\t\telement.tabIndex = -1;\n\t}\n\n\t/**\n\t * Emits the scroll event of the options list\n\t */\n\temitScroll(event) {\n\t\tconst atTop: boolean = event.srcElement.scrollTop === 0;\n\t\tconst atBottom: boolean = event.srcElement.scrollHeight - event.srcElement.scrollTop === event.srcElement.clientHeight;\n\t\tconst customScrollEvent = { atTop, atBottom, event };\n\t\tthis.scroll.emit(customScrollEvent);\n\t}\n\n\t/**\n\t * Subscribe the function passed to an internal observable that will resolve once the items are ready\n\t */\n\tonItemsReady(subcription: () => void): void {\n\t\t// this subscription will auto unsubscribe because of the `first()` pipe\n\t\t(this._itemsReady || of(true)).pipe(first()).subscribe(subcription);\n\t}\n\n\treorderSelected(moveFocus = true): void {\n\t\tthis.displayItems = [...this.getSelected(), ...this.getListItems().filter(item => !item.selected)];\n\t\tif (moveFocus) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.updateIndex();\n\t\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\t});\n\t\t}\n\t}\n}\n",
|
|
33928
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tOnDestroy,\n\tEventEmitter,\n\tTemplateRef,\n\tAfterViewInit,\n\tViewChild,\n\tElementRef,\n\tViewChildren,\n\tQueryList,\n\tApplicationRef\n} from \"@angular/core\";\nimport { Observable, isObservable, Subscription, of } from \"rxjs\";\nimport { first } from \"rxjs/operators\";\n\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { AbstractDropdownView } from \"../abstract-dropdown-view.class\";\nimport { ListItem } from \"../list-item.interface\";\nimport { watchFocusJump } from \"../dropdowntools\";\nimport { ScrollCustomEvent } from \"./scroll-custom-event.interface\";\n\n\n/**\n * ```html\n * <cds-dropdown-list [items]=\"listItems\"></cds-dropdown-list>\n * ```\n * ```typescript\n * listItems = [\n * \t{\n * \t\tcontent: \"item one\",\n * \t\tselected: false\n * \t},\n * \t{\n * \t\tcontent: \"item two\",\n * \t\tselected: false,\n * \t},\n * \t{\n * \t\tcontent: \"item three\",\n * \t\tselected: false\n * \t},\n * \t{\n * \t\tcontent: \"item four\",\n * \t\tselected: false\n * \t}\n * ];\n * ```\n */\n@Component({\n\tselector: \"cds-dropdown-list, ibm-dropdown-list\",\n\ttemplate: `\n\t\t<ul\n\t\t\t#list\n\t\t\t[id]=\"listId\"\n\t\t\trole=\"listbox\"\n\t\t\tclass=\"cds--list-box__menu cds--multi-select\"\n\t\t\t(scroll)=\"emitScroll($event)\"\n\t\t\t(keydown)=\"navigateList($event)\"\n\t\t\ttabindex=\"0\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t[attr.aria-activedescendant]=\"highlightedItem\">\n\t\t\t<li\n\t\t\t\trole=\"option\"\n\t\t\t\t*ngFor=\"let item of displayItems; let i = index\"\n\t\t\t\t(click)=\"doClick($event, item)\"\n\t\t\t\tclass=\"cds--list-box__menu-item\"\n\t\t\t\t[attr.aria-selected]=\"item.selected\"\n\t\t\t\t[id]=\"getItemId(i)\"\n\t\t\t\t[attr.tabindex]=\"highlightedItem === getItemId(i) ? 0 : null\"\n\t\t\t\t[attr.title]=\" showTitles ? item.content : null\"\n\t\t\t\t[attr.disabled]=\"item.disabled ? true : null\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--list-box__menu-item--active': item.selected,\n\t\t\t\t\t'cds--list-box__menu-item--highlighted': highlightedItem === getItemId(i)\n\t\t\t\t}\">\n\t\t\t\t<div\n\t\t\t\t\t#listItem\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tclass=\"cds--list-box__menu-item__option\">\n\t\t\t\t\t<div\n\t\t\t\t\t\t*ngIf=\"!listTpl && type === 'multi'\"\n\t\t\t\t\t\tclass=\"cds--form-item cds--checkbox-wrapper\">\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t[attr.data-contained-checkbox-state]=\"item.selected\"\n\t\t\t\t\t\t\tclass=\"cds--checkbox-label\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass=\"cds--checkbox\"\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\t[checked]=\"item.selected\"\n\t\t\t\t\t\t\t\t[disabled]=\"item.disabled\"\n\t\t\t\t\t\t\t\ttabindex=\"-1\">\n\t\t\t\t\t\t\t<span class=\"cds--checkbox-appearance\"></span>\n\t\t\t\t\t\t\t<span class=\"cds--checkbox-label-text\">{{item.content}}</span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<ng-container *ngIf=\"!listTpl && type === 'single'\">{{item.content}}</ng-container>\n\t\t\t\t\t<svg\n\t\t\t\t\t\t*ngIf=\"!listTpl && type === 'single'\"\n\t\t\t\t\t\tcdsIcon=\"checkmark\"\n\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\tclass=\"cds--list-box__menu-item__selected-icon\">\n\t\t\t\t\t</svg>\n\t\t\t\t\t<ng-template\n\t\t\t\t\t\t*ngIf=\"listTpl\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{item: item}\"\n\t\t\t\t\t\t[ngTemplateOutlet]=\"listTpl\">\n\t\t\t\t\t</ng-template>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ul>`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: AbstractDropdownView,\n\t\t\tuseExisting: DropdownList\n\t\t}\n\t]\n})\nexport class DropdownList implements AbstractDropdownView, AfterViewInit, OnDestroy {\n\tstatic listCount = 0;\n\t@Input() ariaLabel = this.i18n.get().DROPDOWN_LIST.LABEL;\n\t/**\n\t * The list items belonging to the `DropdownList`.\n\t */\n\t@Input() set items(value: Array<ListItem> | Observable<Array<ListItem>>) {\n\t\tif (isObservable(value)) {\n\t\t\tif (this._itemsSubscription) {\n\t\t\t\tthis._itemsSubscription.unsubscribe();\n\t\t\t}\n\t\t\tthis._itemsReady = new Observable<boolean>((observer) => {\n\t\t\t\tthis._itemsSubscription = value.subscribe(v => {\n\t\t\t\t\tthis.updateList(v);\n\t\t\t\t\tobserver.next(true);\n\t\t\t\t\tobserver.complete();\n\t\t\t\t});\n\t\t\t});\n\t\t\tthis.onItemsReady(null);\n\t\t} else {\n\t\t\tthis.updateList(value);\n\t\t}\n\t\tthis._originalItems = value;\n\t}\n\n\tget items(): Array<ListItem> | Observable<Array<ListItem>> {\n\t\treturn this._originalItems;\n\t}\n\t/**\n\t * Template to bind to items in the `DropdownList` (optional).\n\t */\n\t@Input() listTpl: string | TemplateRef<any> = null;\n\t/**\n\t * Event to emit selection of a list item within the `DropdownList`.\n\t */\n\t@Output() select: EventEmitter<{ item: ListItem, isUpdate?: boolean } | ListItem[]> = new EventEmitter();\n\t/**\n\t * Event to emit scroll event of a list within the `DropdownList`.\n\t */\n\t@Output() scroll: EventEmitter<ScrollCustomEvent> = new EventEmitter();\n\t/**\n\t * Event to suggest a blur on the view.\n\t * Emits _after_ the first/last item has been focused.\n\t * ex.\n\t * ArrowUp -> focus first item\n\t * ArrowUp -> emit event\n\t *\n\t * When this event fires focus should be placed on some element outside of the list - blurring the list as a result\n\t */\n\t@Output() blurIntent = new EventEmitter<\"top\" | \"bottom\">();\n\t/**\n\t * Maintains a reference to the view DOM element for the unordered list of items within the `DropdownList`.\n\t */\n\t@ViewChild(\"list\", { static: true }) list: ElementRef;\n\t/**\n\t * Defines whether or not the `DropdownList` supports selecting multiple items as opposed to single\n\t * item selection.\n\t */\n\t@Input() type: \"single\" | \"multi\" = \"single\";\n\n\t/**\n\t * Defines whether to show title attribute or not\n\t */\n\t@Input() showTitles = true;\n\n\t/**\n\t * Defines the rendering size of the `DropdownList` input component.\n\t */\n\tpublic size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\tpublic listId = `listbox-${DropdownList.listCount++}`;\n\tpublic highlightedItem = null;\n\t/**\n\t * Holds the list of items that will be displayed in the `DropdownList`.\n\t * It differs from the the complete set of items when filtering is used (but\n\t * it is always a subset of the total items in `DropdownList`).\n\t */\n\tpublic displayItems: Array<ListItem> = [];\n\t/**\n\t * Maintains the index for the selected item within the `DropdownList`.\n\t */\n\tprotected index = -1;\n\t/**\n\t * An array holding the HTML list elements in the view.\n\t */\n\t@ViewChildren(\"listItem\") protected listElementList: QueryList<ElementRef>;\n\t/**\n\t * Observable bound to keydown events to control filtering.\n\t */\n\tprotected focusJump;\n\t/**\n\t * Tracks the current (if any) subscription to the items observable so we can clean up when the input is updated.\n\t */\n\tprotected _itemsSubscription: Subscription;\n\t/**\n\t * Used to retain the original items passed to the setter.\n\t */\n\tprotected _originalItems: Array<ListItem> | Observable<Array<ListItem>>;\n\t/**\n\t * Useful representation of the items, should be accessed via `getListItems`.\n\t */\n\tprotected _items: Array<ListItem> = [];\n\t/**\n\t * Used to wait for items in case they are passed through an observable.\n\t */\n\tprotected _itemsReady: Observable<boolean>;\n\n\t/**\n\t * Creates an instance of `DropdownList`.\n\t */\n\tconstructor(public elementRef: ElementRef, protected i18n: I18n, protected appRef: ApplicationRef) {}\n\n\t/**\n\t * Retrieves array of list items and index of the selected item after view has rendered.\n\t * Additionally, any Observables for the `DropdownList` are initialized.\n\t */\n\tngAfterViewInit() {\n\t\tthis.index = this.getListItems().findIndex(item => item.selected);\n\t\tthis.setupFocusObservable();\n\t\tsetTimeout(() => {\n\t\t\tthis.doEmitSelect(true);\n\t\t});\n\t}\n\n\t/**\n\t * Removes any Observables on destruction of the component.\n\t */\n\tngOnDestroy() {\n\t\tif (this.focusJump) {\n\t\t\tthis.focusJump.unsubscribe();\n\t\t}\n\t\tif (this._itemsSubscription) {\n\t\t\tthis._itemsSubscription.unsubscribe();\n\t\t}\n\t}\n\n\tdoEmitSelect(isUpdate = true) {\n\t\tif (this.type === \"single\") {\n\t\t\tthis.select.emit({ item: this._items.find(item => item.selected), isUpdate: isUpdate });\n\t\t} else {\n\t\t\t// abuse javascripts object mutability until we can break the API and switch to\n\t\t\t// { items: [], isUpdate: true }\n\t\t\tconst selected = this.getSelected() || [];\n\t\t\tselected[\"isUpdate\"] = isUpdate;\n\t\t\tthis.select.emit(selected);\n\t\t}\n\t}\n\n\tgetItemId(index: number) {\n\t\treturn `${this.listId}-${index}`;\n\t}\n\n\t/**\n\t * Updates the displayed list of items and then retrieves the most current properties for the `DropdownList` from the DOM.\n\t */\n\tupdateList(items: ListItem[]) {\n\t\tthis._items = items.map(item => Object.assign({}, item));\n\t\tthis.displayItems = this._items;\n\t\tthis.updateIndex();\n\t\tthis.setupFocusObservable();\n\t\tthis.doEmitSelect();\n\t}\n\n\t/**\n\t * Filters the items being displayed in the DOM list.\n\t */\n\tfilterBy(query = \"\") {\n\t\tif (query) {\n\t\t\tthis.displayItems = this.getListItems().filter(item => item.content.toLowerCase().includes(query.toLowerCase()));\n\t\t\t// Reset index if items were found\n\t\t\t// Prevent selecting index in list that are undefined.\n\t\t\tif (this.displayItems) {\n\t\t\t\tthis.index = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.displayItems = this.getListItems();\n\t\t}\n\n\t\tthis.updateIndex();\n\t}\n\n\t/**\n\t * Initializes (or re-initializes) the Observable that handles switching focus to an element based on\n\t * key input matching the first letter of the item in the list.\n\t */\n\tsetupFocusObservable() {\n\t\tif (!this.list) { return; }\n\t\tif (this.focusJump) {\n\t\t\tthis.focusJump.unsubscribe();\n\t\t}\n\t\tlet elList = Array.from(this.list.nativeElement.querySelectorAll(\"li\"));\n\t\tthis.focusJump = watchFocusJump(this.list.nativeElement, elList)\n\t\t\t.subscribe(el => {\n\t\t\t\tel.focus();\n\t\t\t});\n\t}\n\n\t/**\n\t * Returns the `ListItem` that is subsequent to the selected item in the `DropdownList`.\n\t */\n\tgetNextItem(): ListItem {\n\t\tif (this.index < this.displayItems.length - 1) {\n\t\t\tthis.index++;\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns `true` if the selected item is not the last item in the `DropdownList`.\n\t */\n\thasNextElement(): boolean {\n\t\treturn this.index < this.displayItems.length - 1 &&\n\t\t\t(!(this.index === this.displayItems.length - 2) || !this.displayItems[this.index + 1].disabled);\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that is subsequent to the selected item.\n\t */\n\tgetNextElement(): HTMLElement {\n\t\t// Only return native elements if they are rendered\n\t\tconst elemList = this.listElementList ? this.listElementList.toArray() : [];\n\t\tif (!elemList.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Start checking from next index\n\t\t * Continue looping through the list until a non disabeled element is found or\n\t\t * end of list is reached\n\t\t */\n\t\tfor (let i = this.index + 1; i < elemList.length; i++) {\n\t\t\t// If the values in the list are not disabled\n\t\t\tif (!this.displayItems[i].disabled) {\n\t\t\t\tthis.index = i;\n\t\t\t\treturn elemList[i].nativeElement;\n\t\t\t}\n\t\t}\n\n\t\treturn elemList[this.index]?.nativeElement;\n\t}\n\n\t/**\n\t * Returns the `ListItem` that precedes the selected item within `DropdownList`.\n\t */\n\tgetPrevItem(): ListItem {\n\t\tif (this.index > 0) {\n\t\t\tthis.index--;\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns `true` if the selected item is not the first in the list.\n\t */\n\thasPrevElement(): boolean {\n\t\treturn this.index > 0 && (!(this.index === 1) || !this.displayItems[0].disabled);\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that precedes the selected item.\n\t */\n\tgetPrevElement(): HTMLElement {\n\t\t// Only return native elements if they are rendered\n\t\tconst elemList = this.listElementList ? this.listElementList.toArray() : [];\n\t\tif (!elemList.length) {\n\t\t\treturn null;\n\t\t}\n\n\t\t/**\n\t\t * Start checking from next index\n\t\t * Continue looping through the list until a non disabeled element is found or\n\t\t * end of list is reached\n\t\t */\n\t\tfor (let i = this.index - 1; i < this.index && i >= 0; i--) {\n\t\t\t// If the values in the list are not disabled\n\t\t\tif (!this.displayItems[i].disabled) {\n\t\t\t\tthis.index = i;\n\t\t\t\treturn elemList[i].nativeElement;\n\t\t\t}\n\t\t}\n\n\t\treturn elemList[this.index].nativeElement;\n\t}\n\n\t/**\n\t * Returns the `ListItem` that is selected within `DropdownList`.\n\t */\n\tgetCurrentItem(): ListItem {\n\t\tif (this.index < 0) {\n\t\t\treturn this.displayItems[0];\n\t\t}\n\t\treturn this.displayItems[this.index];\n\t}\n\n\t/**\n\t * Returns the `HTMLElement` for the item that is selected within the `DropdownList`.\n\t */\n\tgetCurrentElement(): HTMLElement {\n\t\tif (this.index < 0) {\n\t\t\treturn this.listElementList.first.nativeElement;\n\t\t}\n\t\treturn this.listElementList.toArray()[this.index].nativeElement;\n\t}\n\n\t/**\n\t * Returns the items as an Array\n\t */\n\tgetListItems(): Array<ListItem> {\n\t\treturn this._items;\n\t}\n\n\t/**\n\t * Returns a list containing the selected item(s) in the `DropdownList`.\n\t */\n\tgetSelected(): ListItem[] {\n\t\tlet selected = this.getListItems().filter(item => item.selected);\n\t\tif (selected.length === 0) {\n\t\t\treturn [];\n\t\t}\n\t\treturn selected;\n\t}\n\n\t/**\n\t * Transforms array input list of items to the correct state by updating the selected item(s).\n\t */\n\tpropagateSelected(value: Array<ListItem>): void {\n\t\t// if we get a non-array, log out an error (since it is one)\n\t\tif (!Array.isArray(value)) {\n\t\t\tconsole.error(`${this.constructor.name}.propagateSelected expects an Array<ListItem>, got ${JSON.stringify(value)}`);\n\t\t}\n\t\tthis.onItemsReady(() => {\n\t\t\tconst selectedNewItems = [];\n\t\t\tfor (let newItem of value) {\n\t\t\t\tif (newItem && newItem.selected) {\n\t\t\t\t\t// copy the item\n\t\t\t\t\tlet tempNewItem: string | ListItem = Object.assign({}, newItem);\n\t\t\t\t\t// deleted selected because it's what we _want_ to change\n\t\t\t\t\tdelete tempNewItem.selected;\n\t\t\t\t\t// stringify for compare later\n\t\t\t\t\ttempNewItem = JSON.stringify(tempNewItem);\n\t\t\t\t\t// add to the list of selected items\n\t\t\t\t\tselectedNewItems.push(tempNewItem);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// loop through the list items and update the `selected` state for matching items in `value`\n\t\t\tfor (let oldItem of this.getListItems()) {\n\t\t\t\t// fast path when no items are selected\n\t\t\t\tif (selectedNewItems.length === 0) {\n\t\t\t\t\toldItem.selected = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// copy the item\n\t\t\t\tlet tempOldItem: string | ListItem = Object.assign({}, oldItem);\n\t\t\t\t// deleted selected because it's what we _want_ to change\n\t\t\t\tdelete tempOldItem.selected;\n\t\t\t\t// stringify for compare\n\t\t\t\ttempOldItem = JSON.stringify(tempOldItem);\n\t\t\t\tfor (let selectedNewItem of selectedNewItems) {\n\t\t\t\t\t// do the compare\n\t\t\t\t\tif (tempOldItem.includes(selectedNewItem)) {\n\t\t\t\t\t\toldItem.selected = true;\n\t\t\t\t\t\t// if we've found a matching item, we can stop looping\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toldItem.selected = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Initializes focus in the list, effectively a wrapper for `getCurrentElement().focus()`\n\t */\n\tinitFocus() {\n\t\tif (this.index < 0) {\n\t\t\tthis.updateIndex();\n\t\t}\n\n\t\tthis.list.nativeElement.focus();\n\t\tsetTimeout(() => {\n\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t});\n\t}\n\n\tupdateIndex() {\n\t\t// initialize index on the first selected item or\n\t\t// on the next non disabled item if no items are selected\n\t\t// in case, if all items are disabled, the index value will remain same\n\t\tconst selected = this.getSelected();\n\t\tif (selected.length) {\n\t\t\tthis.index = this.displayItems.indexOf(selected[0]);\n\t\t} else if (this.index < 0 && this.hasNextElement()) {\n\t\t\tthis.getNextElement();\n\t\t}\n\t}\n\n\t/**\n\t * Manages the keyboard accessibility for navigation and selection within a `DropdownList`.\n\t */\n\tnavigateList(event: KeyboardEvent) {\n\t\tif (event.key === \"Enter\" || event.key === \" \") {\n\t\t\tif (this.listElementList.some(option => option.nativeElement === event.target)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tthis.doClick(event, this.getCurrentItem());\n\t\t\t}\n\t\t} else if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n\t\t\tevent.preventDefault();\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tif (this.hasNextElement()) {\n\t\t\t\t\tthis.getNextElement()?.scrollIntoView({ block: \"end\" });\n\t\t\t\t} else {\n\t\t\t\t\tthis.blurIntent.emit(\"bottom\");\n\t\t\t\t}\n\t\t\t} else if (event.key === \"ArrowUp\") {\n\t\t\t\tif (this.hasPrevElement()) {\n\t\t\t\t\tthis.getPrevElement().scrollIntoView({ block: \"nearest\" });\n\t\t\t\t} else {\n\t\t\t\t\tthis.blurIntent.emit(\"top\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Emits the selected item or items after a mouse click event has occurred.\n\t */\n\tdoClick(event, item) {\n\t\tevent.preventDefault();\n\t\tif (item && !item.disabled) {\n\t\t\tthis.list.nativeElement.focus();\n\t\t\tif (this.type === \"single\") {\n\t\t\t\titem.selected = true;\n\t\t\t\t// reset the selection\n\t\t\t\tfor (let otherItem of this.getListItems()) {\n\t\t\t\t\tif (item !== otherItem) { otherItem.selected = false; }\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem.selected = !item.selected;\n\t\t\t}\n\t\t\tthis.index = this.displayItems.indexOf(item);\n\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\tthis.doEmitSelect(false);\n\t\t\tthis.appRef.tick();\n\t\t}\n\t}\n\n\tonItemFocus(index) {\n\t\tconst element = this.listElementList.toArray()[index].nativeElement;\n\t\telement.classList.add(\"cds--list-box__menu-item--highlighted\");\n\t\telement.tabIndex = 0;\n\t}\n\n\tonItemBlur(index) {\n\t\tconst element = this.listElementList.toArray()[index].nativeElement;\n\t\telement.classList.remove(\"cds--list-box__menu-item--highlighted\");\n\t\telement.tabIndex = -1;\n\t}\n\n\t/**\n\t * Emits the scroll event of the options list\n\t */\n\temitScroll(event) {\n\t\tconst atTop: boolean = event.srcElement.scrollTop === 0;\n\t\tconst atBottom: boolean = event.srcElement.scrollHeight - event.srcElement.scrollTop === event.srcElement.clientHeight;\n\t\tconst customScrollEvent = { atTop, atBottom, event };\n\t\tthis.scroll.emit(customScrollEvent);\n\t}\n\n\t/**\n\t * Subscribe the function passed to an internal observable that will resolve once the items are ready\n\t */\n\tonItemsReady(subcription: () => void): void {\n\t\t// this subscription will auto unsubscribe because of the `first()` pipe\n\t\t(this._itemsReady || of(true)).pipe(first()).subscribe(subcription);\n\t}\n\n\treorderSelected(moveFocus = true): void {\n\t\tthis.displayItems = [...this.getSelected(), ...this.getListItems().filter(item => !item.selected)];\n\t\tif (moveFocus) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.updateIndex();\n\t\t\t\tthis.highlightedItem = this.getItemId(this.index);\n\t\t\t});\n\t\t}\n\t}\n}\n",
|
|
34245
33929
|
"assetsDirs": [],
|
|
34246
33930
|
"styleUrlsData": "",
|
|
34247
33931
|
"stylesData": "",
|
|
@@ -34439,7 +34123,7 @@
|
|
|
34439
34123
|
},
|
|
34440
34124
|
{
|
|
34441
34125
|
"name": "DynamicListComboBox",
|
|
34442
|
-
"id": "component-DynamicListComboBox-
|
|
34126
|
+
"id": "component-DynamicListComboBox-1c9aa4d55f79938ecc1920aa73daf986566aa07e52949d4d2cfa9bbea1a4f9b866a822a5f988a04f697ee3920fd15513a149d911e96c7ee50f08d83b89e4ae53",
|
|
34443
34127
|
"file": "src/combobox/stories/app-dynamic-list-combobox.component.ts",
|
|
34444
34128
|
"encapsulation": [],
|
|
34445
34129
|
"entryComponents": [],
|
|
@@ -34449,7 +34133,7 @@
|
|
|
34449
34133
|
"selector": "app-dynamic-list-combobox",
|
|
34450
34134
|
"styleUrls": [],
|
|
34451
34135
|
"styles": [],
|
|
34452
|
-
"template": "<cds-combo-box\n\t[(items)]=\"items\"\n\ttype=\"multi\"\n\t(selected)=\"updateSelected($event)\">\n\t<cds-dropdown-list></cds-dropdown-list>\n</cds-combo-box>\n\t",
|
|
34136
|
+
"template": "<cds-combo-box\n\t[(items)]=\"items\"\n\titemValueKey=\"content\"\n\ttype=\"multi\"\n\t(selected)=\"updateSelected($event)\">\n\t<cds-dropdown-list></cds-dropdown-list>\n</cds-combo-box>\n\t",
|
|
34453
34137
|
"templateUrl": [],
|
|
34454
34138
|
"viewProviders": [],
|
|
34455
34139
|
"hostDirectives": [],
|
|
@@ -34464,7 +34148,7 @@
|
|
|
34464
34148
|
"type": "[]",
|
|
34465
34149
|
"optional": false,
|
|
34466
34150
|
"description": "",
|
|
34467
|
-
"line":
|
|
34151
|
+
"line": 16
|
|
34468
34152
|
}
|
|
34469
34153
|
],
|
|
34470
34154
|
"methodsClass": [
|
|
@@ -34481,7 +34165,7 @@
|
|
|
34481
34165
|
"optional": false,
|
|
34482
34166
|
"returnType": "void",
|
|
34483
34167
|
"typeParameters": [],
|
|
34484
|
-
"line":
|
|
34168
|
+
"line": 31,
|
|
34485
34169
|
"deprecated": false,
|
|
34486
34170
|
"deprecationMessage": "",
|
|
34487
34171
|
"jsdoctags": [
|
|
@@ -34506,7 +34190,7 @@
|
|
|
34506
34190
|
"description": "",
|
|
34507
34191
|
"rawdescription": "\n",
|
|
34508
34192
|
"type": "component",
|
|
34509
|
-
"sourceCode": "import { Component, AfterViewInit } from \"@angular/core\";\n\n@Component({\n\tselector: \"app-dynamic-list-combobox\",\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(items)]=\"items\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"updateSelected($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})\nexport class DynamicListComboBox implements AfterViewInit {\n\titems = [\n\t\t{\n\t\t\tcontent: \"one\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"two\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"three\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"four\"\n\t\t}\n\t];\n\n\tupdateSelected(event) {\n\t\tthis.items.forEach((item: any) => {\n\t\t\tif (event.some(selectedItem => selectedItem.content === item.content)) {\n\t\t\t\titem.selected = true;\n\t\t\t} else {\n\t\t\t\titem.selected = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tconst newItems = JSON.parse(JSON.stringify(this.items));\n\t\t\tnewItems.push({ content: `New ${newItems.length}` });\n\t\t\tthis.items = newItems;\n\t\t}, 4000);\n\t}\n}\n",
|
|
34193
|
+
"sourceCode": "import { Component, AfterViewInit } from \"@angular/core\";\n\n@Component({\n\tselector: \"app-dynamic-list-combobox\",\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(items)]=\"items\"\n\t\t\titemValueKey=\"content\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"updateSelected($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})\nexport class DynamicListComboBox implements AfterViewInit {\n\titems = [\n\t\t{\n\t\t\tcontent: \"one\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"two\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"three\"\n\t\t},\n\t\t{\n\t\t\tcontent: \"four\"\n\t\t}\n\t];\n\n\tupdateSelected(event) {\n\t\tthis.items.forEach((item: any) => {\n\t\t\tif (event.some(selectedItem => selectedItem.content === item.content)) {\n\t\t\t\titem.selected = true;\n\t\t\t} else {\n\t\t\t\titem.selected = false;\n\t\t\t}\n\t\t});\n\t}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tconst newItems = JSON.parse(JSON.stringify(this.items));\n\t\t\tnewItems.push({ content: `New ${newItems.length}` });\n\t\t\tthis.items = newItems;\n\t\t}, 4000);\n\t}\n}\n",
|
|
34510
34194
|
"assetsDirs": [],
|
|
34511
34195
|
"styleUrlsData": "",
|
|
34512
34196
|
"stylesData": "",
|
|
@@ -42203,7 +41887,7 @@
|
|
|
42203
41887
|
},
|
|
42204
41888
|
{
|
|
42205
41889
|
"name": "MockQueryCombobox",
|
|
42206
|
-
"id": "component-MockQueryCombobox-
|
|
41890
|
+
"id": "component-MockQueryCombobox-fb25ff9ce1e14a38ef8cd0418b432bf10e3204ff81cc8feacc51c410e01e3ac9c3bda0e358e09da67775c8abd741f76ff9c6cd10d538ce413ca2f31d812857b8",
|
|
42207
41891
|
"file": "src/combobox/stories/app-mock-query-search.component.ts",
|
|
42208
41892
|
"encapsulation": [],
|
|
42209
41893
|
"entryComponents": [],
|
|
@@ -42213,7 +41897,7 @@
|
|
|
42213
41897
|
"selector": "app-mock-query-search",
|
|
42214
41898
|
"styleUrls": [],
|
|
42215
41899
|
"styles": [],
|
|
42216
|
-
"template": "<cds-combo-box\n\tappendInline=\"true\"\n\t[items]=\"filterItems\"\n\t(search)=\"onSearch($event)\"\n\t(selected)=\"selected($event)\">\n\t<cds-dropdown-list></cds-dropdown-list>\n</cds-combo-box>\n\t",
|
|
41900
|
+
"template": "<cds-combo-box\n\tappendInline=\"true\"\n\t[items]=\"filterItems\"\n\titemValueKey=\"content\"\n\t(search)=\"onSearch($event)\"\n\t(selected)=\"selected($event)\">\n\t<cds-dropdown-list></cds-dropdown-list>\n</cds-combo-box>\n\t",
|
|
42217
41901
|
"templateUrl": [],
|
|
42218
41902
|
"viewProviders": [],
|
|
42219
41903
|
"hostDirectives": [],
|
|
@@ -42227,7 +41911,7 @@
|
|
|
42227
41911
|
"type": "any",
|
|
42228
41912
|
"optional": false,
|
|
42229
41913
|
"description": "",
|
|
42230
|
-
"line":
|
|
41914
|
+
"line": 18
|
|
42231
41915
|
},
|
|
42232
41916
|
{
|
|
42233
41917
|
"name": "filterItems",
|
|
@@ -42237,7 +41921,7 @@
|
|
|
42237
41921
|
"type": "any",
|
|
42238
41922
|
"optional": false,
|
|
42239
41923
|
"description": "",
|
|
42240
|
-
"line":
|
|
41924
|
+
"line": 17
|
|
42241
41925
|
}
|
|
42242
41926
|
],
|
|
42243
41927
|
"methodsClass": [
|
|
@@ -42289,7 +41973,7 @@
|
|
|
42289
41973
|
"description": "",
|
|
42290
41974
|
"rawdescription": "\n",
|
|
42291
41975
|
"type": "component",
|
|
42292
|
-
"sourceCode": "import { Component } from \"@angular/core\";\n\n@Component({\n\tselector: \"app-mock-query-search\",\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\tappendInline=\"true\"\n\t\t\t[items]=\"filterItems\"\n\t\t\t(search)=\"onSearch($event)\"\n\t\t\t(selected)=\"selected($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})\nexport class MockQueryCombobox {\n\tfilterItems: any = [];\n\tcurrentlySelected: any;\n\
|
|
41976
|
+
"sourceCode": "import { Component, Input } from \"@angular/core\";\n\n@Component({\n\tselector: \"app-mock-query-search\",\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\tappendInline=\"true\"\n\t\t\t[items]=\"filterItems\"\n\t\t\titemValueKey=\"content\"\n\t\t\t(search)=\"onSearch($event)\"\n\t\t\t(selected)=\"selected($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})\nexport class MockQueryCombobox {\n\tfilterItems: any = [];\n\tcurrentlySelected: any;\n\tonSearch() {\n\t\t// Call API or search through items list\n\t\tsetTimeout(() => {\n\t\t\tconst array = [\n\t\t\t\t{ content: `Random ${Math.random()}` },\n\t\t\t\t{ content: `Random ${Math.random()}` },\n\t\t\t\t{ content: `Random ${Math.random()}` },\n\t\t\t\t{ content: `Random ${Math.random()}` }\n\t\t\t];\n\n\t\t\t// Include current selected in the list to avoid auto clear\n\t\t\tif (this.currentlySelected) {\n\t\t\t\tarray.push(this.currentlySelected);\n\t\t\t}\n\t\t\tthis.filterItems = array;\n\t\t}, 1000);\n\t}\n\n\tselected(event: any) {\n\t\t/**\n\t\t * #ref-1245723\n\t\t * Update this on major release\n\t\t */\n\t\tif (Array.isArray(event) && !event.length) {\n\t\t\tthis.currentlySelected = undefined;\n\t\t} else {\n\t\t\tthis.currentlySelected = event;\n\t\t}\n\t}\n}\n",
|
|
42293
41977
|
"assetsDirs": [],
|
|
42294
41978
|
"styleUrlsData": "",
|
|
42295
41979
|
"stylesData": "",
|
|
@@ -50141,7 +49825,7 @@
|
|
|
50141
49825
|
},
|
|
50142
49826
|
{
|
|
50143
49827
|
"name": "ProgressIndicator",
|
|
50144
|
-
"id": "component-ProgressIndicator-
|
|
49828
|
+
"id": "component-ProgressIndicator-a46722d410fe1612c8313d1b19c5e0b94e8a7cee9733cadb64b03c7327f17dc1c0feb2173b1b215e69050f1885316ea85b5eab41fa19b781919e2328cd82e999",
|
|
50145
49829
|
"file": "src/progress-indicator/progress-indicator.component.ts",
|
|
50146
49830
|
"encapsulation": [],
|
|
50147
49831
|
"entryComponents": [],
|
|
@@ -50151,7 +49835,7 @@
|
|
|
50151
49835
|
"selector": "cds-progress-indicator, ibm-progress-indicator",
|
|
50152
49836
|
"styleUrls": [],
|
|
50153
49837
|
"styles": [],
|
|
50154
|
-
"template": "<ul\n\tdata-progress\n\tdata-progress-current\n\tclass=\"cds--progress\"\n\t[ngClass]=\"{\n\t\t'cds--skeleton': skeleton,\n\t\t'cds--progress--vertical': (orientation === 'vertical'),\n\t\t'cds--progress--space-equal': spacing === 'equal' && orientation !== 'vertical'\n\t}\">\n\t<li\n\t\tclass=\"cds--progress-step\"\n\t\t*ngFor=\"let step of steps; let i = index\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--progress-step--disabled' : step.disabled,\n\t\t\t'cds--progress-step--complete' : step.complete,\n\t\t\t'cds--progress-step--incomplete' : !step.complete && i !== current,\n\t\t\t'cds--progress-step--current': i === current\n\t\t}\">\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cds--progress-step-button\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--progress-step-button--unclickable': !step.onClick || current === i\n\t\t\t}\"\n\t\t\t[disabled]=\"step.disabled\"\n\t\t\t[attr.aria-disabled]=\"step.disabled\"\n\t\t\t[tabindex]=\"(current !== i && step.onClick && !step.disabled) ? 0 : -1\"\n\t\t\t[title]=\"step.label\"\n\t\t\t(click)=\"onClick(i)\">\n\t\t\t<span class=\"cds--assistive-text\">\n\t\t\t\t{{this.translations[getCurrentState(i)?.toUpperCase()]}}\n\t\t\t</span>\n\t\t\t<svg\n\t\t\t\t[cdsIcon]=\"statusIcons[getCurrentState(i)]\"\n\t\t\t\tsize=\"16\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--progress__warning': step.invalid && i !== current\n\t\t\t\t}\">\n\t\t\t\t<title *ngIf=\"step.description\">{{step.description}}</title>\n\t\t\t</svg>\n\t\t\t<div class=\"cds--progress-text\">\n\t\t\t\t<p class=\"cds--progress-label\">{{step.label}}</p>\n\t\t\t\t<p *ngIf=\"step.secondaryLabel\" class=\"cds--progress-optional\">{{step.secondaryLabel}}</p>\n\t\t\t</div>\n\t\t\t<span class=\"cds--progress-line\"></span>\n\t\t</button>\n\t</li>\n</ul>\n",
|
|
49838
|
+
"template": "<ul\n\tdata-progress\n\tdata-progress-current\n\tclass=\"cds--progress\"\n\t[ngClass]=\"{\n\t\t'cds--skeleton': skeleton,\n\t\t'cds--progress--vertical': (orientation === 'vertical'),\n\t\t'cds--progress--space-equal': spacing === 'equal' && orientation !== 'vertical'\n\t}\">\n\t<li\n\t\tclass=\"cds--progress-step\"\n\t\t*ngFor=\"let step of steps; let i = index\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--progress-step--disabled' : step.disabled,\n\t\t\t'cds--progress-step--complete' : step.complete,\n\t\t\t'cds--progress-step--incomplete' : !step.complete && i !== current,\n\t\t\t'cds--progress-step--current': i === current\n\t\t}\">\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"cds--progress-step-button\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--progress-step-button--unclickable': !step.onClick || current === i || skeleton\n\t\t\t}\"\n\t\t\t[disabled]=\"step.disabled\"\n\t\t\t[attr.aria-disabled]=\"step.disabled\"\n\t\t\t[tabindex]=\"(current !== i && step.onClick && !step.disabled) ? 0 : -1\"\n\t\t\t[title]=\"step.label\"\n\t\t\t(click)=\"onClick(i)\">\n\t\t\t<span class=\"cds--assistive-text\">\n\t\t\t\t{{this.translations[getCurrentState(i)?.toUpperCase()]}}\n\t\t\t</span>\n\t\t\t<svg\n\t\t\t\t[cdsIcon]=\"statusIcons[getCurrentState(i)]\"\n\t\t\t\tsize=\"16\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--progress__warning': step.invalid && i !== current\n\t\t\t\t}\">\n\t\t\t\t<title *ngIf=\"step.description\">{{step.description}}</title>\n\t\t\t</svg>\n\t\t\t<div class=\"cds--progress-text\">\n\t\t\t\t<p class=\"cds--progress-label\">{{step.label}}</p>\n\t\t\t\t<p *ngIf=\"step.secondaryLabel && !skeleton\" class=\"cds--progress-optional\">{{step.secondaryLabel}}</p>\n\t\t\t</div>\n\t\t\t<span class=\"cds--progress-line\"></span>\n\t\t</button>\n\t</li>\n</ul>\n",
|
|
50155
49839
|
"templateUrl": [],
|
|
50156
49840
|
"viewProviders": [],
|
|
50157
49841
|
"hostDirectives": [],
|
|
@@ -50248,7 +49932,7 @@
|
|
|
50248
49932
|
"optional": false,
|
|
50249
49933
|
"returnType": "\"current\" | \"invalid\" | \"complete\" | \"incomplete\"",
|
|
50250
49934
|
"typeParameters": [],
|
|
50251
|
-
"line":
|
|
49935
|
+
"line": 133,
|
|
50252
49936
|
"deprecated": false,
|
|
50253
49937
|
"deprecationMessage": "",
|
|
50254
49938
|
"rawdescription": "\n\nGets current state based on weight of the state\nWeight of state goes from error, incomplete, current, and complete\n\nThis function is used to determine which icon & translation string to display\n",
|
|
@@ -50256,8 +49940,8 @@
|
|
|
50256
49940
|
"jsdoctags": [
|
|
50257
49941
|
{
|
|
50258
49942
|
"name": {
|
|
50259
|
-
"pos":
|
|
50260
|
-
"end":
|
|
49943
|
+
"pos": 3645,
|
|
49944
|
+
"end": 3650,
|
|
50261
49945
|
"flags": 16842752,
|
|
50262
49946
|
"modifierFlagsCache": 0,
|
|
50263
49947
|
"transformFlags": 0,
|
|
@@ -50268,8 +49952,8 @@
|
|
|
50268
49952
|
"deprecated": false,
|
|
50269
49953
|
"deprecationMessage": "",
|
|
50270
49954
|
"tagName": {
|
|
50271
|
-
"pos":
|
|
50272
|
-
"end":
|
|
49955
|
+
"pos": 3639,
|
|
49956
|
+
"end": 3644,
|
|
50273
49957
|
"flags": 16842752,
|
|
50274
49958
|
"modifierFlagsCache": 0,
|
|
50275
49959
|
"transformFlags": 0,
|
|
@@ -50280,8 +49964,8 @@
|
|
|
50280
49964
|
},
|
|
50281
49965
|
{
|
|
50282
49966
|
"tagName": {
|
|
50283
|
-
"pos":
|
|
50284
|
-
"end":
|
|
49967
|
+
"pos": 3663,
|
|
49968
|
+
"end": 3670,
|
|
50285
49969
|
"flags": 16842752,
|
|
50286
49970
|
"modifierFlagsCache": 0,
|
|
50287
49971
|
"transformFlags": 0,
|
|
@@ -50313,8 +49997,8 @@
|
|
|
50313
49997
|
"jsdoctags": [
|
|
50314
49998
|
{
|
|
50315
49999
|
"name": {
|
|
50316
|
-
"pos":
|
|
50317
|
-
"end":
|
|
50000
|
+
"pos": 3152,
|
|
50001
|
+
"end": 3157,
|
|
50318
50002
|
"flags": 16842752,
|
|
50319
50003
|
"modifierFlagsCache": 0,
|
|
50320
50004
|
"transformFlags": 0,
|
|
@@ -50325,8 +50009,8 @@
|
|
|
50325
50009
|
"deprecated": false,
|
|
50326
50010
|
"deprecationMessage": "",
|
|
50327
50011
|
"tagName": {
|
|
50328
|
-
"pos":
|
|
50329
|
-
"end":
|
|
50012
|
+
"pos": 3146,
|
|
50013
|
+
"end": 3151,
|
|
50330
50014
|
"flags": 16842752,
|
|
50331
50015
|
"modifierFlagsCache": 0,
|
|
50332
50016
|
"transformFlags": 0,
|
|
@@ -50378,7 +50062,7 @@
|
|
|
50378
50062
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { ProgressIndicatorModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-progress-indicator--basic\">See demo</a></p>\n",
|
|
50379
50063
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { ProgressIndicatorModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-progress-indicator--basic)\n",
|
|
50380
50064
|
"type": "component",
|
|
50381
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Step } from \"./progress-indicator-step.interface\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ProgressIndicatorModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-progress-indicator--basic)\n */\n@Component({\n\tselector: \"cds-progress-indicator, ibm-progress-indicator\",\n\ttemplate: `\n\t<ul\n\t\tdata-progress\n\t\tdata-progress-current\n\t\tclass=\"cds--progress\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--skeleton': skeleton,\n\t\t\t'cds--progress--vertical': (orientation === 'vertical'),\n\t\t\t'cds--progress--space-equal': spacing === 'equal' && orientation !== 'vertical'\n\t\t}\">\n\t\t<li\n\t\t\tclass=\"cds--progress-step\"\n\t\t\t*ngFor=\"let step of steps; let i = index\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--progress-step--disabled' : step.disabled,\n\t\t\t\t'cds--progress-step--complete' : step.complete,\n\t\t\t\t'cds--progress-step--incomplete' : !step.complete && i !== current,\n\t\t\t\t'cds--progress-step--current': i === current\n\t\t\t}\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cds--progress-step-button\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--progress-step-button--unclickable': !step.onClick || current === i\n\t\t\t\t}\"\n\t\t\t\t[disabled]=\"step.disabled\"\n\t\t\t\t[attr.aria-disabled]=\"step.disabled\"\n\t\t\t\t[tabindex]=\"(current !== i && step.onClick && !step.disabled) ? 0 : -1\"\n\t\t\t\t[title]=\"step.label\"\n\t\t\t\t(click)=\"onClick(i)\">\n\t\t\t\t<span class=\"cds--assistive-text\">\n\t\t\t\t\t{{this.translations[getCurrentState(i)?.toUpperCase()]}}\n\t\t\t\t</span>\n\t\t\t\t<svg\n\t\t\t\t\t[cdsIcon]=\"statusIcons[getCurrentState(i)]\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--progress__warning': step.invalid && i !== current\n\t\t\t\t\t}\">\n\t\t\t\t\t<title *ngIf=\"step.description\">{{step.description}}</title>\n\t\t\t\t</svg>\n\t\t\t\t<div class=\"cds--progress-text\">\n\t\t\t\t\t<p class=\"cds--progress-label\">{{step.label}}</p>\n\t\t\t\t\t<p *ngIf=\"step.secondaryLabel\" class=\"cds--progress-optional\">{{step.secondaryLabel}}</p>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"cds--progress-line\"></span>\n\t\t\t</button>\n\t\t</li>\n\t</ul>\n\t`\n})\nexport class ProgressIndicator {\n\t@Input() get current() {\n\t\treturn this._current;\n\t}\n\tset current(current: number) {\n\t\tthis._current = current;\n\t\tthis.setProgressIndicatorStates();\n\t}\n\tstatic skeletonSteps(stepCount: number) {\n\t\tconst steps = [];\n\t\tfor (let i = 0; i < stepCount; i++) {\n\t\t\tsteps.push({ complete: false });\n\t\t}\n\n\t\treturn steps;\n\t}\n\n\t@Input() steps: Array<Step>;\n\t@Output() stepSelected = new EventEmitter<{ step: Step, index: number }>();\n\n\t@Input() translations = this.i18n.get().PROGRESS_INDICATOR;\n\t@Input() orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\t@Input() skeleton = false;\n\t@Input() spacing: \"default\" | \"equal\" = \"default\";\n\n\t// Get icon names based for each status\n\treadonly statusIcons = {\n\t\tcurrent: \"incomplete\",\n\t\tcomplete: \"checkmark--outline\",\n\t\tinvalid: \"warning\",\n\t\tincomplete: \"circle-dash\"\n\t};\n\n\tprivate _current: number;\n\n\tconstructor(protected i18n: I18n) { }\n\n\t/**\n\t * Executes click function if `onClick` exists for step\n\t * `Current` step functions will not be executed\n\t * @param index number\n\t */\n\tonClick(index: number) {\n\t\tif (index !== this.current && typeof this.steps[index].onClick === \"function\") {\n\t\t\tthis.steps[index].onClick();\n\t\t}\n\t\tthis.stepSelected.emit({ step: this.steps[index], index });\n\t}\n\n\t/**\n\t * Gets current state based on weight of the state\n\t * Weight of state goes from error, incomplete, current, and complete\n\t *\n\t * This function is used to determine which icon & translation string to display\n\t * @param index number\n\t * @returns string\n\t */\n\tgetCurrentState(index: number) {\n\t\tif (index === this.current) {\n\t\t\treturn \"current\";\n\t\t} else if (this.steps[index].invalid) {\n\t\t\treturn \"invalid\";\n\t\t} else if (this.steps[index].complete) {\n\t\t\treturn \"complete\";\n\t\t}\n\n\t\treturn \"incomplete\";\n\t}\n\n\tprivate setProgressIndicatorStates() {\n\t\tif (this.steps === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Set all preceding steps to `complete` & following to `incomplete`\n\t\tthis.steps.forEach((step: Step, index) => {\n\t\t\tif (index < this.current) {\n\t\t\t\tstep.complete = true;\n\t\t\t} else {\n\t\t\t\tstep.complete = false;\n\t\t\t}\n\t\t});\n\t}\n}\n",
|
|
50065
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { Step } from \"./progress-indicator-step.interface\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { ProgressIndicatorModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-progress-indicator--basic)\n */\n@Component({\n\tselector: \"cds-progress-indicator, ibm-progress-indicator\",\n\ttemplate: `\n\t<ul\n\t\tdata-progress\n\t\tdata-progress-current\n\t\tclass=\"cds--progress\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--skeleton': skeleton,\n\t\t\t'cds--progress--vertical': (orientation === 'vertical'),\n\t\t\t'cds--progress--space-equal': spacing === 'equal' && orientation !== 'vertical'\n\t\t}\">\n\t\t<li\n\t\t\tclass=\"cds--progress-step\"\n\t\t\t*ngFor=\"let step of steps; let i = index\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--progress-step--disabled' : step.disabled,\n\t\t\t\t'cds--progress-step--complete' : step.complete,\n\t\t\t\t'cds--progress-step--incomplete' : !step.complete && i !== current,\n\t\t\t\t'cds--progress-step--current': i === current\n\t\t\t}\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cds--progress-step-button\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'cds--progress-step-button--unclickable': !step.onClick || current === i || skeleton\n\t\t\t\t}\"\n\t\t\t\t[disabled]=\"step.disabled\"\n\t\t\t\t[attr.aria-disabled]=\"step.disabled\"\n\t\t\t\t[tabindex]=\"(current !== i && step.onClick && !step.disabled) ? 0 : -1\"\n\t\t\t\t[title]=\"step.label\"\n\t\t\t\t(click)=\"onClick(i)\">\n\t\t\t\t<span class=\"cds--assistive-text\">\n\t\t\t\t\t{{this.translations[getCurrentState(i)?.toUpperCase()]}}\n\t\t\t\t</span>\n\t\t\t\t<svg\n\t\t\t\t\t[cdsIcon]=\"statusIcons[getCurrentState(i)]\"\n\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--progress__warning': step.invalid && i !== current\n\t\t\t\t\t}\">\n\t\t\t\t\t<title *ngIf=\"step.description\">{{step.description}}</title>\n\t\t\t\t</svg>\n\t\t\t\t<div class=\"cds--progress-text\">\n\t\t\t\t\t<p class=\"cds--progress-label\">{{step.label}}</p>\n\t\t\t\t\t<p *ngIf=\"step.secondaryLabel && !skeleton\" class=\"cds--progress-optional\">{{step.secondaryLabel}}</p>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"cds--progress-line\"></span>\n\t\t\t</button>\n\t\t</li>\n\t</ul>\n\t`\n})\nexport class ProgressIndicator {\n\t@Input() get current() {\n\t\treturn this._current;\n\t}\n\tset current(current: number) {\n\t\tthis._current = current;\n\t\tthis.setProgressIndicatorStates();\n\t}\n\tstatic skeletonSteps(stepCount: number) {\n\t\tconst steps = [];\n\t\tfor (let i = 0; i < stepCount; i++) {\n\t\t\tsteps.push({ complete: false });\n\t\t}\n\n\t\treturn steps;\n\t}\n\n\t@Input() steps: Array<Step>;\n\t@Output() stepSelected = new EventEmitter<{ step: Step, index: number }>();\n\n\t@Input() translations = this.i18n.get().PROGRESS_INDICATOR;\n\t@Input() orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\t@Input() skeleton = false;\n\t@Input() spacing: \"default\" | \"equal\" = \"default\";\n\n\t// Get icon names based for each status\n\treadonly statusIcons = {\n\t\tcurrent: \"incomplete\",\n\t\tcomplete: \"checkmark--outline\",\n\t\tinvalid: \"warning\",\n\t\tincomplete: \"circle-dash\"\n\t};\n\n\tprivate _current: number;\n\n\tconstructor(protected i18n: I18n) { }\n\n\t/**\n\t * Executes click function if `onClick` exists for step\n\t * `Current` step functions will not be executed\n\t * @param index number\n\t */\n\tonClick(index: number) {\n\t\tif (this.skeleton) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (index !== this.current && typeof this.steps[index].onClick === \"function\") {\n\t\t\tthis.steps[index].onClick();\n\t\t}\n\t\tthis.stepSelected.emit({ step: this.steps[index], index });\n\t}\n\n\t/**\n\t * Gets current state based on weight of the state\n\t * Weight of state goes from error, incomplete, current, and complete\n\t *\n\t * This function is used to determine which icon & translation string to display\n\t * @param index number\n\t * @returns string\n\t */\n\tgetCurrentState(index: number) {\n\t\tif (index === this.current) {\n\t\t\treturn \"current\";\n\t\t} else if (this.steps[index].invalid) {\n\t\t\treturn \"invalid\";\n\t\t} else if (this.steps[index].complete) {\n\t\t\treturn \"complete\";\n\t\t}\n\n\t\treturn \"incomplete\";\n\t}\n\n\tprivate setProgressIndicatorStates() {\n\t\tif (this.steps === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Set all preceding steps to `complete` & following to `incomplete`\n\t\tthis.steps.forEach((step: Step, index) => {\n\t\t\tif (index < this.current) {\n\t\t\t\tstep.complete = true;\n\t\t\t} else {\n\t\t\t\tstep.complete = false;\n\t\t\t}\n\t\t});\n\t}\n}\n",
|
|
50382
50066
|
"assetsDirs": [],
|
|
50383
50067
|
"styleUrlsData": "",
|
|
50384
50068
|
"stylesData": "",
|
|
@@ -50894,7 +50578,7 @@
|
|
|
50894
50578
|
},
|
|
50895
50579
|
{
|
|
50896
50580
|
"name": "RadioGroup",
|
|
50897
|
-
"id": "component-RadioGroup-
|
|
50581
|
+
"id": "component-RadioGroup-92514bdc3aa775d3809e06446501d9657c9db475411b6b0fcaa3bb9d65834e99f5d85390904ce04db7a3bbe711fdc8ab8be4170b6359aade0105f30dbeea32cb",
|
|
50898
50582
|
"file": "src/radio/radio-group.component.ts",
|
|
50899
50583
|
"encapsulation": [],
|
|
50900
50584
|
"entryComponents": [],
|
|
@@ -50919,7 +50603,7 @@
|
|
|
50919
50603
|
"deprecationMessage": "",
|
|
50920
50604
|
"rawdescription": "\n\nUsed to set the `aria-label` attribute on the radio group element.\n",
|
|
50921
50605
|
"description": "<p>Used to set the <code>aria-label</code> attribute on the radio group element.</p>\n",
|
|
50922
|
-
"line":
|
|
50606
|
+
"line": 224,
|
|
50923
50607
|
"type": "string",
|
|
50924
50608
|
"decorators": []
|
|
50925
50609
|
},
|
|
@@ -50929,7 +50613,7 @@
|
|
|
50929
50613
|
"deprecationMessage": "",
|
|
50930
50614
|
"rawdescription": "\n\nUsed to set the `aria-labelledby` attribute on the radio group element.\n",
|
|
50931
50615
|
"description": "<p>Used to set the <code>aria-labelledby</code> attribute on the radio group element.</p>\n",
|
|
50932
|
-
"line":
|
|
50616
|
+
"line": 229,
|
|
50933
50617
|
"type": "string",
|
|
50934
50618
|
"decorators": []
|
|
50935
50619
|
},
|
|
@@ -50939,7 +50623,7 @@
|
|
|
50939
50623
|
"deprecationMessage": "",
|
|
50940
50624
|
"rawdescription": "\n\n**Experimental**: Optional decorator (e.g. AI label).\n",
|
|
50941
50625
|
"description": "<p><strong>Experimental</strong>: Optional decorator (e.g. AI label).</p>\n",
|
|
50942
|
-
"line":
|
|
50626
|
+
"line": 219,
|
|
50943
50627
|
"type": "TemplateRef<any>",
|
|
50944
50628
|
"decorators": []
|
|
50945
50629
|
},
|
|
@@ -50949,7 +50633,7 @@
|
|
|
50949
50633
|
"deprecationMessage": "",
|
|
50950
50634
|
"rawdescription": "\n\nSet to true to disable the whole radio group\n",
|
|
50951
50635
|
"description": "<p>Set to true to disable the whole radio group</p>\n",
|
|
50952
|
-
"line":
|
|
50636
|
+
"line": 179,
|
|
50953
50637
|
"type": "boolean",
|
|
50954
50638
|
"decorators": []
|
|
50955
50639
|
},
|
|
@@ -50959,7 +50643,7 @@
|
|
|
50959
50643
|
"deprecationMessage": "",
|
|
50960
50644
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
50961
50645
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
50962
|
-
"line":
|
|
50646
|
+
"line": 234,
|
|
50963
50647
|
"type": "string | TemplateRef<any>",
|
|
50964
50648
|
"decorators": []
|
|
50965
50649
|
},
|
|
@@ -50970,7 +50654,7 @@
|
|
|
50970
50654
|
"deprecationMessage": "",
|
|
50971
50655
|
"rawdescription": "\n\nSet to `true` to show the invalid state.\n",
|
|
50972
50656
|
"description": "<p>Set to <code>true</code> to show the invalid state.</p>\n",
|
|
50973
|
-
"line":
|
|
50657
|
+
"line": 239,
|
|
50974
50658
|
"type": "boolean",
|
|
50975
50659
|
"decorators": []
|
|
50976
50660
|
},
|
|
@@ -50980,7 +50664,7 @@
|
|
|
50980
50664
|
"deprecationMessage": "",
|
|
50981
50665
|
"rawdescription": "\n\nValue displayed if combobox is in an invalid state.\n",
|
|
50982
50666
|
"description": "<p>Value displayed if combobox is in an invalid state.</p>\n",
|
|
50983
|
-
"line":
|
|
50667
|
+
"line": 244,
|
|
50984
50668
|
"type": "string | TemplateRef<any>",
|
|
50985
50669
|
"decorators": []
|
|
50986
50670
|
},
|
|
@@ -50989,7 +50673,7 @@
|
|
|
50989
50673
|
"defaultValue": "\"right\"",
|
|
50990
50674
|
"deprecated": false,
|
|
50991
50675
|
"deprecationMessage": "",
|
|
50992
|
-
"line":
|
|
50676
|
+
"line": 212,
|
|
50993
50677
|
"type": "\"right\" | \"left\"",
|
|
50994
50678
|
"decorators": []
|
|
50995
50679
|
},
|
|
@@ -50997,7 +50681,7 @@
|
|
|
50997
50681
|
"name": "legend",
|
|
50998
50682
|
"deprecated": false,
|
|
50999
50683
|
"deprecationMessage": "",
|
|
51000
|
-
"line":
|
|
50684
|
+
"line": 214,
|
|
51001
50685
|
"type": "string | TemplateRef<any>",
|
|
51002
50686
|
"decorators": []
|
|
51003
50687
|
},
|
|
@@ -51007,7 +50691,7 @@
|
|
|
51007
50691
|
"deprecationMessage": "",
|
|
51008
50692
|
"rawdescription": "\n\nReplaces the name associated with the `RadioGroup` with the provided parameter.\n",
|
|
51009
50693
|
"description": "<p>Replaces the name associated with the <code>RadioGroup</code> with the provided parameter.</p>\n",
|
|
51010
|
-
"line":
|
|
50694
|
+
"line": 164,
|
|
51011
50695
|
"type": "string",
|
|
51012
50696
|
"decorators": []
|
|
51013
50697
|
},
|
|
@@ -51016,7 +50700,7 @@
|
|
|
51016
50700
|
"defaultValue": "\"horizontal\"",
|
|
51017
50701
|
"deprecated": false,
|
|
51018
50702
|
"deprecationMessage": "",
|
|
51019
|
-
"line":
|
|
50703
|
+
"line": 210,
|
|
51020
50704
|
"type": "\"horizontal\" | \"vertical\"",
|
|
51021
50705
|
"decorators": []
|
|
51022
50706
|
},
|
|
@@ -51026,7 +50710,7 @@
|
|
|
51026
50710
|
"deprecationMessage": "",
|
|
51027
50711
|
"rawdescription": "\n\nSets the passed in `Radio` item as the selected input within the `RadioGroup`.\n",
|
|
51028
50712
|
"description": "<p>Sets the passed in <code>Radio</code> item as the selected input within the <code>RadioGroup</code>.</p>\n",
|
|
51029
|
-
"line":
|
|
50713
|
+
"line": 118,
|
|
51030
50714
|
"type": "Radio | null",
|
|
51031
50715
|
"decorators": []
|
|
51032
50716
|
},
|
|
@@ -51036,7 +50720,7 @@
|
|
|
51036
50720
|
"deprecationMessage": "",
|
|
51037
50721
|
"rawdescription": "\n\nReturns the skeleton value in the `RadioGroup` if there is one.\n",
|
|
51038
50722
|
"description": "<p>Returns the skeleton value in the <code>RadioGroup</code> if there is one.</p>\n",
|
|
51039
|
-
"line":
|
|
50723
|
+
"line": 194,
|
|
51040
50724
|
"type": "any",
|
|
51041
50725
|
"decorators": []
|
|
51042
50726
|
},
|
|
@@ -51046,7 +50730,7 @@
|
|
|
51046
50730
|
"deprecationMessage": "",
|
|
51047
50731
|
"rawdescription": "\n\nSets the value/state of the selected `Radio` within the `RadioGroup` to the passed in value.\n",
|
|
51048
50732
|
"description": "<p>Sets the value/state of the selected <code>Radio</code> within the <code>RadioGroup</code> to the passed in value.</p>\n",
|
|
51049
|
-
"line":
|
|
50733
|
+
"line": 144,
|
|
51050
50734
|
"type": "any",
|
|
51051
50735
|
"decorators": []
|
|
51052
50736
|
},
|
|
@@ -51057,7 +50741,7 @@
|
|
|
51057
50741
|
"deprecationMessage": "",
|
|
51058
50742
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warnText)\n",
|
|
51059
50743
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warnText)</p>\n",
|
|
51060
|
-
"line":
|
|
50744
|
+
"line": 249,
|
|
51061
50745
|
"type": "boolean",
|
|
51062
50746
|
"decorators": []
|
|
51063
50747
|
},
|
|
@@ -51067,7 +50751,7 @@
|
|
|
51067
50751
|
"deprecationMessage": "",
|
|
51068
50752
|
"rawdescription": "\n\nSets the warning text\n",
|
|
51069
50753
|
"description": "<p>Sets the warning text</p>\n",
|
|
51070
|
-
"line":
|
|
50754
|
+
"line": 254,
|
|
51071
50755
|
"type": "string | TemplateRef<any>",
|
|
51072
50756
|
"decorators": []
|
|
51073
50757
|
}
|
|
@@ -51080,7 +50764,7 @@
|
|
|
51080
50764
|
"deprecationMessage": "",
|
|
51081
50765
|
"rawdescription": "\n\nEmits event notifying other classes of a change using a `RadioChange` class.\n",
|
|
51082
50766
|
"description": "<p>Emits event notifying other classes of a change using a <code>RadioChange</code> class.</p>\n",
|
|
51083
|
-
"line":
|
|
50767
|
+
"line": 259,
|
|
51084
50768
|
"type": "EventEmitter<RadioChange>"
|
|
51085
50769
|
}
|
|
51086
50770
|
],
|
|
@@ -51093,7 +50777,7 @@
|
|
|
51093
50777
|
"type": "function",
|
|
51094
50778
|
"optional": false,
|
|
51095
50779
|
"description": "<p>Needed to properly implement ControlValueAccessor.</p>\n",
|
|
51096
|
-
"line":
|
|
50780
|
+
"line": 428,
|
|
51097
50781
|
"rawdescription": "\n\nNeeded to properly implement ControlValueAccessor.\n"
|
|
51098
50782
|
},
|
|
51099
50783
|
{
|
|
@@ -51104,7 +50788,7 @@
|
|
|
51104
50788
|
"type": "",
|
|
51105
50789
|
"optional": false,
|
|
51106
50790
|
"description": "<p>Method set in registerOnChange to propagate changes back to the form.</p>\n",
|
|
51107
|
-
"line":
|
|
50791
|
+
"line": 433,
|
|
51108
50792
|
"rawdescription": "\n\nMethod set in registerOnChange to propagate changes back to the form.\n"
|
|
51109
50793
|
},
|
|
51110
50794
|
{
|
|
@@ -51115,7 +50799,7 @@
|
|
|
51115
50799
|
"type": "",
|
|
51116
50800
|
"optional": false,
|
|
51117
50801
|
"description": "<p>Binds 'cds--form-item' value to the class for <code>RadioGroup</code>.</p>\n",
|
|
51118
|
-
"line":
|
|
50802
|
+
"line": 270,
|
|
51119
50803
|
"rawdescription": "\n\nBinds 'cds--form-item' value to the class for `RadioGroup`.\n",
|
|
51120
50804
|
"decorators": [
|
|
51121
50805
|
{
|
|
@@ -51135,7 +50819,7 @@
|
|
|
51135
50819
|
"type": "number",
|
|
51136
50820
|
"optional": false,
|
|
51137
50821
|
"description": "<p>Used for creating the <code>RadioGroup</code> 'name' property dynamically.</p>\n",
|
|
51138
|
-
"line":
|
|
50822
|
+
"line": 208,
|
|
51139
50823
|
"rawdescription": "\n\nUsed for creating the `RadioGroup` 'name' property dynamically.\n",
|
|
51140
50824
|
"modifierKind": [
|
|
51141
50825
|
126
|
|
@@ -51148,7 +50832,7 @@
|
|
|
51148
50832
|
"type": "QueryList<Radio>",
|
|
51149
50833
|
"optional": false,
|
|
51150
50834
|
"description": "<p>The <code>Radio</code> input items in the <code>RadioGroup</code>.</p>\n",
|
|
51151
|
-
"line":
|
|
50835
|
+
"line": 265,
|
|
51152
50836
|
"rawdescription": "\n\nThe `Radio` input items in the `RadioGroup`.\n",
|
|
51153
50837
|
"decorators": [
|
|
51154
50838
|
{
|
|
@@ -51168,7 +50852,7 @@
|
|
|
51168
50852
|
"optional": false,
|
|
51169
50853
|
"returnType": "void",
|
|
51170
50854
|
"typeParameters": [],
|
|
51171
|
-
"line":
|
|
50855
|
+
"line": 302,
|
|
51172
50856
|
"deprecated": false,
|
|
51173
50857
|
"deprecationMessage": "",
|
|
51174
50858
|
"rawdescription": "\n\nUpdates the selected `Radio` to be checked (selected).\n",
|
|
@@ -51187,7 +50871,7 @@
|
|
|
51187
50871
|
"optional": false,
|
|
51188
50872
|
"returnType": "void",
|
|
51189
50873
|
"typeParameters": [],
|
|
51190
|
-
"line":
|
|
50874
|
+
"line": 343,
|
|
51191
50875
|
"deprecated": false,
|
|
51192
50876
|
"deprecationMessage": "",
|
|
51193
50877
|
"rawdescription": "\n\nCreates a class of `RadioChange` to emit the change in the `RadioGroup`.\n",
|
|
@@ -51210,7 +50894,7 @@
|
|
|
51210
50894
|
"optional": false,
|
|
51211
50895
|
"returnType": "void",
|
|
51212
50896
|
"typeParameters": [],
|
|
51213
|
-
"line":
|
|
50897
|
+
"line": 421,
|
|
51214
50898
|
"deprecated": false,
|
|
51215
50899
|
"deprecationMessage": "",
|
|
51216
50900
|
"decorators": [
|
|
@@ -51236,7 +50920,7 @@
|
|
|
51236
50920
|
"optional": false,
|
|
51237
50921
|
"returnType": "boolean",
|
|
51238
50922
|
"typeParameters": [],
|
|
51239
|
-
"line":
|
|
50923
|
+
"line": 435,
|
|
51240
50924
|
"deprecated": false,
|
|
51241
50925
|
"deprecationMessage": "",
|
|
51242
50926
|
"modifierKind": [
|
|
@@ -51267,7 +50951,7 @@
|
|
|
51267
50951
|
"optional": false,
|
|
51268
50952
|
"returnType": "void",
|
|
51269
50953
|
"typeParameters": [],
|
|
51270
|
-
"line":
|
|
50954
|
+
"line": 408,
|
|
51271
50955
|
"deprecated": false,
|
|
51272
50956
|
"deprecationMessage": "",
|
|
51273
50957
|
"rawdescription": "\n\nUsed to set method to propagate changes back to the form.\n",
|
|
@@ -51300,7 +50984,7 @@
|
|
|
51300
50984
|
"optional": false,
|
|
51301
50985
|
"returnType": "void",
|
|
51302
50986
|
"typeParameters": [],
|
|
51303
|
-
"line":
|
|
50987
|
+
"line": 416,
|
|
51304
50988
|
"deprecated": false,
|
|
51305
50989
|
"deprecationMessage": "",
|
|
51306
50990
|
"rawdescription": "\n\nRegisters a callback to be triggered when the control has been touched.\n",
|
|
@@ -51311,8 +50995,8 @@
|
|
|
51311
50995
|
"jsdoctags": [
|
|
51312
50996
|
{
|
|
51313
50997
|
"name": {
|
|
51314
|
-
"pos":
|
|
51315
|
-
"end":
|
|
50998
|
+
"pos": 10139,
|
|
50999
|
+
"end": 10141,
|
|
51316
51000
|
"flags": 16842752,
|
|
51317
51001
|
"modifierFlagsCache": 0,
|
|
51318
51002
|
"transformFlags": 0,
|
|
@@ -51323,8 +51007,8 @@
|
|
|
51323
51007
|
"deprecated": false,
|
|
51324
51008
|
"deprecationMessage": "",
|
|
51325
51009
|
"tagName": {
|
|
51326
|
-
"pos":
|
|
51327
|
-
"end":
|
|
51010
|
+
"pos": 10133,
|
|
51011
|
+
"end": 10138,
|
|
51328
51012
|
"flags": 16842752,
|
|
51329
51013
|
"modifierFlagsCache": 0,
|
|
51330
51014
|
"transformFlags": 0,
|
|
@@ -51348,7 +51032,7 @@
|
|
|
51348
51032
|
"optional": false,
|
|
51349
51033
|
"returnType": "void",
|
|
51350
51034
|
"typeParameters": [],
|
|
51351
|
-
"line":
|
|
51035
|
+
"line": 336,
|
|
51352
51036
|
"deprecated": false,
|
|
51353
51037
|
"deprecationMessage": "",
|
|
51354
51038
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the `RadioGroup`.\n\nex: `this.formGroup.get(\"myRadioGroup\").disable();`\n\n",
|
|
@@ -51356,8 +51040,8 @@
|
|
|
51356
51040
|
"jsdoctags": [
|
|
51357
51041
|
{
|
|
51358
51042
|
"name": {
|
|
51359
|
-
"pos":
|
|
51360
|
-
"end":
|
|
51043
|
+
"pos": 8519,
|
|
51044
|
+
"end": 8529,
|
|
51361
51045
|
"flags": 16842752,
|
|
51362
51046
|
"modifierFlagsCache": 0,
|
|
51363
51047
|
"transformFlags": 0,
|
|
@@ -51368,8 +51052,8 @@
|
|
|
51368
51052
|
"deprecated": false,
|
|
51369
51053
|
"deprecationMessage": "",
|
|
51370
51054
|
"tagName": {
|
|
51371
|
-
"pos":
|
|
51372
|
-
"end":
|
|
51055
|
+
"pos": 8513,
|
|
51056
|
+
"end": 8518,
|
|
51373
51057
|
"flags": 16842752,
|
|
51374
51058
|
"modifierFlagsCache": 0,
|
|
51375
51059
|
"transformFlags": 0,
|
|
@@ -51386,7 +51070,7 @@
|
|
|
51386
51070
|
"optional": false,
|
|
51387
51071
|
"returnType": "void",
|
|
51388
51072
|
"typeParameters": [],
|
|
51389
|
-
"line":
|
|
51073
|
+
"line": 352,
|
|
51390
51074
|
"deprecated": false,
|
|
51391
51075
|
"deprecationMessage": "",
|
|
51392
51076
|
"rawdescription": "\n\nSynchronizes radio properties.\n",
|
|
@@ -51398,7 +51082,7 @@
|
|
|
51398
51082
|
"optional": false,
|
|
51399
51083
|
"returnType": "void",
|
|
51400
51084
|
"typeParameters": [],
|
|
51401
|
-
"line":
|
|
51085
|
+
"line": 311,
|
|
51402
51086
|
"deprecated": false,
|
|
51403
51087
|
"deprecationMessage": "",
|
|
51404
51088
|
"rawdescription": "\n\nUse the value of the `RadioGroup` to update the selected radio to the right state (selected state).\n",
|
|
@@ -51417,7 +51101,7 @@
|
|
|
51417
51101
|
"optional": false,
|
|
51418
51102
|
"returnType": "void",
|
|
51419
51103
|
"typeParameters": [],
|
|
51420
|
-
"line":
|
|
51104
|
+
"line": 369,
|
|
51421
51105
|
"deprecated": false,
|
|
51422
51106
|
"deprecationMessage": "",
|
|
51423
51107
|
"rawdescription": "\n\nUpdates the value of the `RadioGroup` using the provided parameter.\n",
|
|
@@ -51445,7 +51129,7 @@
|
|
|
51445
51129
|
"deprecationMessage": "",
|
|
51446
51130
|
"rawdescription": "\n\nBinds 'cds--form-item' value to the class for `RadioGroup`.\n",
|
|
51447
51131
|
"description": "<p>Binds 'cds--form-item' value to the class for <code>RadioGroup</code>.</p>\n",
|
|
51448
|
-
"line":
|
|
51132
|
+
"line": 270,
|
|
51449
51133
|
"type": "boolean",
|
|
51450
51134
|
"decorators": []
|
|
51451
51135
|
}
|
|
@@ -51457,7 +51141,7 @@
|
|
|
51457
51141
|
"argsDecorator": [],
|
|
51458
51142
|
"deprecated": false,
|
|
51459
51143
|
"deprecationMessage": "",
|
|
51460
|
-
"line":
|
|
51144
|
+
"line": 421
|
|
51461
51145
|
}
|
|
51462
51146
|
],
|
|
51463
51147
|
"standalone": false,
|
|
@@ -51465,7 +51149,7 @@
|
|
|
51465
51149
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { RadioModule } from 'carbon-components-angular';</code></pre></div><p>Ex:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-html\"><cds-radio-group [(ngModel)]="radio">\n <cds-radio *ngFor="let one of manyRadios" [value]="one">\n Radio {{one}}\n </cds-radio>\n</cds-radio-group>\n\nRadio selected: {{radio}}</code></pre></div><b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-ts\"> const manyRadios = ["one", "two", "three", "four", "five", "six"];</code></pre></div><p><a href=\"../../?path=/story/components-radio--basic\">See demo</a></p>\n",
|
|
51466
51150
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { RadioModule } from 'carbon-components-angular';\n```\n\nEx:\n\n```html\n<cds-radio-group [(ngModel)]=\"radio\">\n\t<cds-radio *ngFor=\"let one of manyRadios\" [value]=\"one\">\n\t\tRadio {{one}}\n\t</cds-radio>\n</cds-radio-group>\n\nRadio selected: {{radio}}\n```\n\n```ts\n\tconst manyRadios = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\"];\n```\n\n[See demo](../../?path=/story/components-radio--basic)\n",
|
|
51467
51151
|
"type": "component",
|
|
51468
|
-
"sourceCode": "import {\n\tAfterContentInit,\n\tContentChildren,\n\tComponent,\n\tEventEmitter,\n\tforwardRef,\n\tInput,\n\tOutput,\n\tQueryList,\n\tHostBinding,\n\tAfterViewInit,\n\tHostListener,\n\tTemplateRef\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { Radio } from \"./radio.component\";\nimport { RadioChange } from \"./radio-change.class\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { RadioModule } from 'carbon-components-angular';\n * ```\n *\n * Ex:\n *\n * ```html\n * <cds-radio-group [(ngModel)]=\"radio\">\n * \t<cds-radio *ngFor=\"let one of manyRadios\" [value]=\"one\">\n *\t\tRadio {{one}}\n * \t</cds-radio>\n * </cds-radio-group>\n *\n * Radio selected: {{radio}}\n * ```\n *\n * ```ts\n *\tconst manyRadios = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\"];\n * ```\n *\n * [See demo](../../?path=/story/components-radio--basic)\n */\n@Component({\n\tselector: \"cds-radio-group, ibm-radio-group\",\n\ttemplate: `\n\t\t<fieldset\n\t\t\tclass=\"cds--radio-button-group\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--radio-button-group--vertical': orientation === 'vertical',\n\t\t\t\t'cds--radio-button-group--label-left': labelPlacement === 'left',\n\t\t\t\t'cds--radio-button-group--invalid': invalid,\n\t\t\t\t'cds--radio-button-group--warning': !invalid && warn,\n\t\t\t\t'cds--radio-button-group--decorator': !!decorator\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"invalid ? true : null\">\n\t\t\t<legend *ngIf=\"legend\" class=\"cds--label\">\n\t\t\t\t<ng-template *ngIf=\"isTemplate(legend); else legendLabel;\" [ngTemplateOutlet]=\"legend\"></ng-template>\n\t\t\t\t<ng-template #legendLabel>{{legend}}</ng-template>\n\t\t\t\t<ng-container *ngIf=\"decorator\">\n\t\t\t\t\t<div class=\"cds--radio-button-group-inner--decorator\">\n\t\t\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t</legend>\n\t\t\t<ng-content></ng-content>\n\t\t</fieldset>\n\t\t<div class=\"cds--radio-button__validation-msg\">\n\t\t\t<ng-container *ngIf=\"invalid\">\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--radio-button__invalid-icon\">\n\t\t\t\t</svg>\n\t\t\t\t<div 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</ng-container>\n\t\t\t<ng-container *ngIf=\"!invalid && warn\">\n\t\t\t\t<svg\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tclass=\"cds--radio-button__invalid-icon cds--radio-button__invalid-icon--warning\"\n\t\t\t\t\tsize=\"16\">\n\t\t\t\t</svg>\n\t\t\t\t<div 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</div>\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`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RadioGroup,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class RadioGroup implements AfterContentInit, AfterViewInit, ControlValueAccessor {\n\n\t/**\n\t * Sets the passed in `Radio` item as the selected input within the `RadioGroup`.\n\t */\n\t@Input()\n\tset selected(selected: Radio | null) {\n\t\tconst alreadySelected = (this._selected && this._selected.value) === (selected && selected.value);\n\t\tif (alreadySelected) {\n\t\t\t// no need to redo\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._selected) {\n\t\t\tthis._selected.checked = false;\n\t\t}\n\t\tthis._selected = selected;\n\t\tthis.value = selected ? selected.value : null;\n\t\tthis.checkSelectedRadio();\n\t}\n\n\t/**\n\t * Returns the `Radio` that is selected within the `RadioGroup`.\n\t */\n\tget selected() {\n\t\treturn this._selected;\n\t}\n\n\t/**\n\t * Sets the value/state of the selected `Radio` within the `RadioGroup` to the passed in value.\n\t */\n\t@Input()\n\tset value(newValue: any) {\n\t\tif (this._value !== newValue) {\n\t\t\tthis._value = newValue;\n\n\t\t\tthis.updateSelectedRadioFromValue();\n\t\t\tthis.checkSelectedRadio();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the value/state of the selected `Radio` within the `RadioGroup`.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Replaces the name associated with the `RadioGroup` with the provided parameter.\n\t */\n\t@Input()\n\tset name(name: string) {\n\t\tthis._name = name;\n\t\tthis.updateRadios();\n\t}\n\t/**\n\t * Returns the associated name of the `RadioGroup`.\n\t */\n\tget name() {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Set to true to disable the whole radio group\n\t */\n\t@Input()\n\tset disabled(disabled: boolean) {\n\t\tthis._disabled = disabled;\n\t\tthis.updateRadios();\n\t}\n\t/**\n\t * Returns the disabled value for the `RadioGroup`.\n\t */\n\tget disabled(): boolean {\n\t\treturn this._disabled;\n\t}\n\n\t/**\n\t * Returns the skeleton value in the `RadioGroup` if there is one.\n\t */\n\t@Input()\n\tget skeleton(): any {\n\t\treturn this._skeleton;\n\t}\n\n\t/**\n\t * Sets the skeleton value for all `Radio` to the skeleton value of `RadioGroup`.\n\t */\n\tset skeleton(value: any) {\n\t\tthis._skeleton = value;\n\t\tthis.updateChildren();\n\t}\n\t/**\n\t * Used for creating the `RadioGroup` 'name' property dynamically.\n\t */\n\tstatic radioGroupCount = 0;\n\n\t@Input() orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\n\t@Input() labelPlacement: \"right\" | \"left\" = \"right\";\n\n\t@Input() legend: string | TemplateRef<any>;\n\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\n\t/**\n\t * Used to set the `aria-label` attribute on the radio group element.\n\t */\n\t@Input() ariaLabel: string;\n\n\t/**\n\t * Used to set the `aria-labelledby` attribute on the radio group element.\n\t */\n\t@Input() ariaLabelledby: string;\n\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t/**\n\t * Set to `true` to show the invalid state.\n\t */\n\t@Input() invalid = false;\n\n\t/**\n\t * Value displayed if combobox is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\n\t/**\n\t* Set to `true` to show a warning (contents set by warnText)\n\t*/\n\t@Input() warn = false;\n\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Emits event notifying other classes of a change using a `RadioChange` class.\n\t */\n\t@Output() change: EventEmitter<RadioChange> = new EventEmitter<RadioChange>();\n\n\t/**\n\t * The `Radio` input items in the `RadioGroup`.\n\t */\n\t// tslint:disable-next-line:no-forward-ref\n\t@ContentChildren(forwardRef(() => Radio)) radios: QueryList<Radio>;\n\n\t/**\n\t * Binds 'cds--form-item' value to the class for `RadioGroup`.\n\t */\n\t@HostBinding(\"class.cds--form-item\") radioButtonGroupClass = true;\n\n\t/**\n\t * To track whether the `RadioGroup` has been initialized.\n\t */\n\tprotected isInitialized = false;\n\t/**\n\t * Reflects whether or not the input is disabled and cannot be selected.\n\t */\n\tprotected _disabled = false;\n\t/**\n\t * Reflects whether or not the dropdown is loading.\n\t */\n\tprotected _skeleton = false;\n\t/**\n\t * The value of the selected option within the `RadioGroup`.\n\t */\n\tprotected _value: any = null;\n\t/**\n\t * The `Radio` within the `RadioGroup` that is selected.\n\t */\n\tprotected _selected: Radio = null;\n\t/**\n\t * The name attribute associated with the `RadioGroup`.\n\t */\n\tprotected _name = `radio-group-${RadioGroup.radioGroupCount++}`;\n\n\t/**\n\t * Updates the selected `Radio` to be checked (selected).\n\t */\n\tcheckSelectedRadio() {\n\t\tif (this.selected && !this._selected.checked) {\n\t\t\tthis.selected.checked = true;\n\t\t}\n\t}\n\n\t/**\n\t * Use the value of the `RadioGroup` to update the selected radio to the right state (selected state).\n\t */\n\tupdateSelectedRadioFromValue() {\n\t\tlet alreadySelected = this._selected != null && this._selected.value === this._value;\n\t\tif (this.radios && !alreadySelected) {\n\t\t\tif (this.selected && this.value) {\n\t\t\t\tthis.selected.checked = false;\n\t\t\t}\n\t\t\tthis._selected = null;\n\t\t\tthis.radios.forEach(radio => {\n\t\t\t\tif (radio.checked || radio.value === this._value) {\n\t\t\t\t\tthis._selected = radio;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (this.selected && !this.value) {\n\t\t\t\tthis._value = this.selected.value;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the `RadioGroup`.\n\t *\n\t * ex: `this.formGroup.get(\"myRadioGroup\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the inputs\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Creates a class of `RadioChange` to emit the change in the `RadioGroup`.\n\t */\n\temitChangeEvent(event: RadioChange) {\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(event.value);\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Synchronizes radio properties.\n\t */\n\tupdateRadios() {\n\t\tif (this.radios) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.radios.forEach(radio => {\n\t\t\t\t\tradio.name = this.name;\n\t\t\t\t\tradio.setDisabledFromGroup(this.disabled);\n\t\t\t\t\tif (this.labelPlacement === \"left\") {\n\t\t\t\t\t\tradio.labelPlacement = \"left\";\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the value of the `RadioGroup` using the provided parameter.\n\t */\n\twriteValue(value: any) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tthis.updateSelectedRadioFromValue();\n\t\t\tthis.checkSelectedRadio();\n\t\t});\n\t}\n\n\tngAfterContentInit() {\n\t\tthis.radios.changes.subscribe(() => {\n\t\t\tthis.updateRadios();\n\t\t\tthis.updateRadioChangeHandler();\n\t\t});\n\n\t\tthis.updateChildren();\n\t\tthis.updateRadioChangeHandler();\n\t}\n\n\tngAfterViewInit() {\n\t\tthis.updateRadios();\n\t}\n\n\t/**\n\t * Used to set method to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the checkbox is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Needed to properly implement ControlValueAccessor.\n\t */\n\tonTouched: () => any = () => {};\n\n\t/**\n\t * Method set in registerOnChange to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => {};\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tprotected updateChildren() {\n\t\tif (this.radios) {\n\t\t\tthis.radios.forEach(child => child.skeleton = this.skeleton);\n\t\t}\n\t}\n\n\tprotected updateRadioChangeHandler() {\n\t\tthis.radios.forEach(radio => {\n\t\t\tradio.registerRadioChangeHandler((event: RadioChange) => {\n\t\t\t\tif ((this.selected && this.selected.value) === event.value) {\n\t\t\t\t\t// no need to redo\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// deselect previous radio\n\t\t\t\tif (this.selected) {\n\t\t\t\t\tthis.selected.checked = false;\n\t\t\t\t}\n\t\t\t\t// update selected and value from the event\n\t\t\t\tthis._selected = event.source;\n\t\t\t\tthis._value = event.value;\n\t\t\t\t// bubble the event\n\t\t\t\tthis.emitChangeEvent(event);\n\t\t\t});\n\t\t});\n\t}\n}\n",
|
|
51152
|
+
"sourceCode": "import {\n\tAfterContentInit,\n\tContentChildren,\n\tComponent,\n\tEventEmitter,\n\tforwardRef,\n\tInput,\n\tOutput,\n\tQueryList,\n\tHostBinding,\n\tAfterViewInit,\n\tHostListener,\n\tTemplateRef,\n\tOnDestroy\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from \"@angular/forms\";\nimport { Radio } from \"./radio.component\";\nimport { RadioChange } from \"./radio-change.class\";\nimport { Subscription } from \"rxjs/internal/Subscription\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { RadioModule } from 'carbon-components-angular';\n * ```\n *\n * Ex:\n *\n * ```html\n * <cds-radio-group [(ngModel)]=\"radio\">\n * \t<cds-radio *ngFor=\"let one of manyRadios\" [value]=\"one\">\n *\t\tRadio {{one}}\n * \t</cds-radio>\n * </cds-radio-group>\n *\n * Radio selected: {{radio}}\n * ```\n *\n * ```ts\n *\tconst manyRadios = [\"one\", \"two\", \"three\", \"four\", \"five\", \"six\"];\n * ```\n *\n * [See demo](../../?path=/story/components-radio--basic)\n */\n@Component({\n\tselector: \"cds-radio-group, ibm-radio-group\",\n\ttemplate: `\n\t\t<fieldset\n\t\t\tclass=\"cds--radio-button-group\"\n\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--radio-button-group--vertical': orientation === 'vertical',\n\t\t\t\t'cds--radio-button-group--label-left': labelPlacement === 'left',\n\t\t\t\t'cds--radio-button-group--invalid': invalid,\n\t\t\t\t'cds--radio-button-group--warning': !invalid && warn,\n\t\t\t\t'cds--radio-button-group--decorator': !!decorator\n\t\t\t}\"\n\t\t\t[attr.data-invalid]=\"invalid ? true : null\">\n\t\t\t<legend *ngIf=\"legend\" class=\"cds--label\">\n\t\t\t\t<ng-template *ngIf=\"isTemplate(legend); else legendLabel;\" [ngTemplateOutlet]=\"legend\"></ng-template>\n\t\t\t\t<ng-template #legendLabel>{{legend}}</ng-template>\n\t\t\t\t<ng-container *ngIf=\"decorator\">\n\t\t\t\t\t<div class=\"cds--radio-button-group-inner--decorator\">\n\t\t\t\t\t\t<ng-template [ngTemplateOutlet]=\"decorator\"></ng-template>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t</legend>\n\t\t\t<ng-content></ng-content>\n\t\t</fieldset>\n\t\t<div class=\"cds--radio-button__validation-msg\">\n\t\t\t<ng-container *ngIf=\"invalid\">\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--radio-button__invalid-icon\">\n\t\t\t\t</svg>\n\t\t\t\t<div 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</ng-container>\n\t\t\t<ng-container *ngIf=\"!invalid && warn\">\n\t\t\t\t<svg\n\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\tclass=\"cds--radio-button__invalid-icon cds--radio-button__invalid-icon--warning\"\n\t\t\t\t\tsize=\"16\">\n\t\t\t\t</svg>\n\t\t\t\t<div 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</div>\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`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RadioGroup,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class RadioGroup implements AfterContentInit, AfterViewInit, OnDestroy, ControlValueAccessor {\n\n\t/**\n\t * Sets the passed in `Radio` item as the selected input within the `RadioGroup`.\n\t */\n\t@Input()\n\tset selected(selected: Radio | null) {\n\t\tconst alreadySelected = (this._selected && this._selected.value) === (selected && selected.value);\n\t\tif (alreadySelected) {\n\t\t\t// no need to redo\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._selected) {\n\t\t\tthis._selected.checked = false;\n\t\t}\n\t\tthis._selected = selected;\n\t\tthis.value = selected ? selected.value : null;\n\t\tthis.checkSelectedRadio();\n\t}\n\n\t/**\n\t * Returns the `Radio` that is selected within the `RadioGroup`.\n\t */\n\tget selected() {\n\t\treturn this._selected;\n\t}\n\n\t/**\n\t * Sets the value/state of the selected `Radio` within the `RadioGroup` to the passed in value.\n\t */\n\t@Input()\n\tset value(newValue: any) {\n\t\tif (this._value !== newValue) {\n\t\t\tthis._value = newValue;\n\n\t\t\tthis.updateSelectedRadioFromValue();\n\t\t\tthis.checkSelectedRadio();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the value/state of the selected `Radio` within the `RadioGroup`.\n\t */\n\tget value() {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Replaces the name associated with the `RadioGroup` with the provided parameter.\n\t */\n\t@Input()\n\tset name(name: string) {\n\t\tthis._name = name;\n\t\tthis.updateRadios();\n\t}\n\t/**\n\t * Returns the associated name of the `RadioGroup`.\n\t */\n\tget name() {\n\t\treturn this._name;\n\t}\n\n\t/**\n\t * Set to true to disable the whole radio group\n\t */\n\t@Input()\n\tset disabled(disabled: boolean) {\n\t\tthis._disabled = disabled;\n\t\tthis.updateRadios();\n\t}\n\t/**\n\t * Returns the disabled value for the `RadioGroup`.\n\t */\n\tget disabled(): boolean {\n\t\treturn this._disabled;\n\t}\n\n\t/**\n\t * Returns the skeleton value in the `RadioGroup` if there is one.\n\t */\n\t@Input()\n\tget skeleton(): any {\n\t\treturn this._skeleton;\n\t}\n\n\t/**\n\t * Sets the skeleton value for all `Radio` to the skeleton value of `RadioGroup`.\n\t */\n\tset skeleton(value: any) {\n\t\tthis._skeleton = value;\n\t\tthis.updateChildren();\n\t}\n\t/**\n\t * Used for creating the `RadioGroup` 'name' property dynamically.\n\t */\n\tstatic radioGroupCount = 0;\n\n\t@Input() orientation: \"horizontal\" | \"vertical\" = \"horizontal\";\n\n\t@Input() labelPlacement: \"right\" | \"left\" = \"right\";\n\n\t@Input() legend: string | TemplateRef<any>;\n\n\t/**\n\t * **Experimental**: Optional decorator (e.g. AI label).\n\t */\n\t@Input() decorator: TemplateRef<any>;\n\n\t/**\n\t * Used to set the `aria-label` attribute on the radio group element.\n\t */\n\t@Input() ariaLabel: string;\n\n\t/**\n\t * Used to set the `aria-labelledby` attribute on the radio group element.\n\t */\n\t@Input() ariaLabelledby: string;\n\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t/**\n\t * Set to `true` to show the invalid state.\n\t */\n\t@Input() invalid = false;\n\n\t/**\n\t * Value displayed if combobox is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\n\t/**\n\t* Set to `true` to show a warning (contents set by warnText)\n\t*/\n\t@Input() warn = false;\n\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Emits event notifying other classes of a change using a `RadioChange` class.\n\t */\n\t@Output() change: EventEmitter<RadioChange> = new EventEmitter<RadioChange>();\n\n\t/**\n\t * The `Radio` input items in the `RadioGroup`.\n\t */\n\t// tslint:disable-next-line:no-forward-ref\n\t@ContentChildren(forwardRef(() => Radio)) radios: QueryList<Radio>;\n\n\t/**\n\t * Binds 'cds--form-item' value to the class for `RadioGroup`.\n\t */\n\t@HostBinding(\"class.cds--form-item\") radioButtonGroupClass = true;\n\n\t/**\n\t * To track whether the `RadioGroup` has been initialized.\n\t */\n\tprotected isInitialized = false;\n\t/**\n\t * Reflects whether or not the input is disabled and cannot be selected.\n\t */\n\tprotected _disabled = false;\n\t/**\n\t * Reflects whether or not the dropdown is loading.\n\t */\n\tprotected _skeleton = false;\n\t/**\n\t * The value of the selected option within the `RadioGroup`.\n\t */\n\tprotected _value: any = null;\n\t/**\n\t * The `Radio` within the `RadioGroup` that is selected.\n\t */\n\tprotected _selected: Radio = null;\n\t/**\n\t * The name attribute associated with the `RadioGroup`.\n\t */\n\tprotected _name = `radio-group-${RadioGroup.radioGroupCount++}`;\n\n\tprivate subscription = new Subscription();\n\n\t/**\n\t * Updates the selected `Radio` to be checked (selected).\n\t */\n\tcheckSelectedRadio() {\n\t\tif (this.selected && !this._selected.checked) {\n\t\t\tthis.selected.checked = true;\n\t\t}\n\t}\n\n\t/**\n\t * Use the value of the `RadioGroup` to update the selected radio to the right state (selected state).\n\t */\n\tupdateSelectedRadioFromValue() {\n\t\tlet alreadySelected = this._selected != null && this._selected.value === this._value;\n\t\tif (this.radios && !alreadySelected) {\n\t\t\tif (this.selected && this.value) {\n\t\t\t\tthis.selected.checked = false;\n\t\t\t}\n\t\t\tthis._selected = null;\n\t\t\tthis.radios.forEach(radio => {\n\t\t\t\tif (radio.checked || radio.value === this._value) {\n\t\t\t\t\tthis._selected = radio;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (this.selected && !this.value) {\n\t\t\t\tthis._value = this.selected.value;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the `RadioGroup`.\n\t *\n\t * ex: `this.formGroup.get(\"myRadioGroup\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the inputs\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t/**\n\t * Creates a class of `RadioChange` to emit the change in the `RadioGroup`.\n\t */\n\temitChangeEvent(event: RadioChange) {\n\t\tthis.change.emit(event);\n\t\tthis.propagateChange(event.value);\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Synchronizes radio properties.\n\t */\n\tupdateRadios() {\n\t\tif (this.radios) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.radios.forEach(radio => {\n\t\t\t\t\tradio.name = this.name;\n\t\t\t\t\tradio.setDisabledFromGroup(this.disabled);\n\t\t\t\t\tif (this.labelPlacement === \"left\") {\n\t\t\t\t\t\tradio.labelPlacement = \"left\";\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Updates the value of the `RadioGroup` using the provided parameter.\n\t */\n\twriteValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\tngAfterContentInit() {\n\t\tthis.subscription.add(\n\t\t\tthis.radios.changes.subscribe(() => {\n\t\t\t\tif (this.value) {\n\t\t\t\t\tif (this.selected) {\n\t\t\t\t\t\tthis._selected = null;\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateSelectedRadioFromValue();\n\t\t\t\t\tthis.checkSelectedRadio();\n\t\t\t\t}\n\t\t\t\tthis.updateRadios();\n\t\t\t\tthis.updateRadioChangeHandler();\n\t\t\t})\n\t\t);\n\n\t\tif (this.value) {\n\t\t\tthis.updateSelectedRadioFromValue();\n\t\t\tthis.checkSelectedRadio();\n\t\t}\n\n\t\tthis.updateChildren();\n\t\tthis.updateRadioChangeHandler();\n\t}\n\n\tngAfterViewInit() {\n\t\tthis.updateRadios();\n\t}\n\n\tngOnDestroy() {\n\t\tthis.subscription.unsubscribe();\n\t}\n\n\t/**\n\t * Used to set method to propagate changes back to the form.\n\t */\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\t/**\n\t * Registers a callback to be triggered when the control has been touched.\n\t * @param fn Callback to be triggered when the checkbox is touched.\n\t */\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\t@HostListener(\"focusout\")\n\tfocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Needed to properly implement ControlValueAccessor.\n\t */\n\tonTouched: () => any = () => {};\n\n\t/**\n\t * Method set in registerOnChange to propagate changes back to the form.\n\t */\n\tpropagateChange = (_: any) => {};\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\tprotected updateChildren() {\n\t\tif (this.radios) {\n\t\t\tthis.radios.forEach(child => child.skeleton = this.skeleton);\n\t\t}\n\t}\n\n\tprotected updateRadioChangeHandler() {\n\t\tthis.radios.forEach(radio => {\n\t\t\tradio.registerRadioChangeHandler((event: RadioChange) => {\n\t\t\t\tif ((this.selected && this.selected.value) === event.value) {\n\t\t\t\t\t// no need to redo\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// deselect previous radio\n\t\t\t\tif (this.selected) {\n\t\t\t\t\tthis.selected.checked = false;\n\t\t\t\t}\n\t\t\t\t// update selected and value from the event\n\t\t\t\tthis._selected = event.source;\n\t\t\t\tthis._value = event.value;\n\t\t\t\t// bubble the event\n\t\t\t\tthis.emitChangeEvent(event);\n\t\t\t});\n\t\t});\n\t}\n}\n",
|
|
51469
51153
|
"assetsDirs": [],
|
|
51470
51154
|
"styleUrlsData": "",
|
|
51471
51155
|
"stylesData": "",
|
|
@@ -51473,6 +51157,7 @@
|
|
|
51473
51157
|
"implements": [
|
|
51474
51158
|
"AfterContentInit",
|
|
51475
51159
|
"AfterViewInit",
|
|
51160
|
+
"OnDestroy",
|
|
51476
51161
|
"ControlValueAccessor"
|
|
51477
51162
|
],
|
|
51478
51163
|
"accessors": {
|
|
@@ -51492,7 +51177,7 @@
|
|
|
51492
51177
|
}
|
|
51493
51178
|
],
|
|
51494
51179
|
"returnType": "void",
|
|
51495
|
-
"line":
|
|
51180
|
+
"line": 118,
|
|
51496
51181
|
"rawdescription": "\n\nSets the passed in `Radio` item as the selected input within the `RadioGroup`.\n",
|
|
51497
51182
|
"description": "<p>Sets the passed in <code>Radio</code> item as the selected input within the <code>RadioGroup</code>.</p>\n",
|
|
51498
51183
|
"jsdoctags": [
|
|
@@ -51511,7 +51196,7 @@
|
|
|
51511
51196
|
"name": "selected",
|
|
51512
51197
|
"type": "",
|
|
51513
51198
|
"returnType": "",
|
|
51514
|
-
"line":
|
|
51199
|
+
"line": 136,
|
|
51515
51200
|
"rawdescription": "\n\nReturns the `Radio` that is selected within the `RadioGroup`.\n",
|
|
51516
51201
|
"description": "<p>Returns the <code>Radio</code> that is selected within the <code>RadioGroup</code>.</p>\n"
|
|
51517
51202
|
}
|
|
@@ -51532,7 +51217,7 @@
|
|
|
51532
51217
|
}
|
|
51533
51218
|
],
|
|
51534
51219
|
"returnType": "void",
|
|
51535
|
-
"line":
|
|
51220
|
+
"line": 144,
|
|
51536
51221
|
"rawdescription": "\n\nSets the value/state of the selected `Radio` within the `RadioGroup` to the passed in value.\n",
|
|
51537
51222
|
"description": "<p>Sets the value/state of the selected <code>Radio</code> within the <code>RadioGroup</code> to the passed in value.</p>\n",
|
|
51538
51223
|
"jsdoctags": [
|
|
@@ -51551,7 +51236,7 @@
|
|
|
51551
51236
|
"name": "value",
|
|
51552
51237
|
"type": "",
|
|
51553
51238
|
"returnType": "",
|
|
51554
|
-
"line":
|
|
51239
|
+
"line": 156,
|
|
51555
51240
|
"rawdescription": "\n\nReturns the value/state of the selected `Radio` within the `RadioGroup`.\n",
|
|
51556
51241
|
"description": "<p>Returns the value/state of the selected <code>Radio</code> within the <code>RadioGroup</code>.</p>\n"
|
|
51557
51242
|
}
|
|
@@ -51572,7 +51257,7 @@
|
|
|
51572
51257
|
}
|
|
51573
51258
|
],
|
|
51574
51259
|
"returnType": "void",
|
|
51575
|
-
"line":
|
|
51260
|
+
"line": 164,
|
|
51576
51261
|
"rawdescription": "\n\nReplaces the name associated with the `RadioGroup` with the provided parameter.\n",
|
|
51577
51262
|
"description": "<p>Replaces the name associated with the <code>RadioGroup</code> with the provided parameter.</p>\n",
|
|
51578
51263
|
"jsdoctags": [
|
|
@@ -51591,7 +51276,7 @@
|
|
|
51591
51276
|
"name": "name",
|
|
51592
51277
|
"type": "",
|
|
51593
51278
|
"returnType": "",
|
|
51594
|
-
"line":
|
|
51279
|
+
"line": 171,
|
|
51595
51280
|
"rawdescription": "\n\nReturns the associated name of the `RadioGroup`.\n",
|
|
51596
51281
|
"description": "<p>Returns the associated name of the <code>RadioGroup</code>.</p>\n"
|
|
51597
51282
|
}
|
|
@@ -51612,7 +51297,7 @@
|
|
|
51612
51297
|
}
|
|
51613
51298
|
],
|
|
51614
51299
|
"returnType": "void",
|
|
51615
|
-
"line":
|
|
51300
|
+
"line": 179,
|
|
51616
51301
|
"rawdescription": "\n\nSet to true to disable the whole radio group\n",
|
|
51617
51302
|
"description": "<p>Set to true to disable the whole radio group</p>\n",
|
|
51618
51303
|
"jsdoctags": [
|
|
@@ -51631,7 +51316,7 @@
|
|
|
51631
51316
|
"name": "disabled",
|
|
51632
51317
|
"type": "boolean",
|
|
51633
51318
|
"returnType": "boolean",
|
|
51634
|
-
"line":
|
|
51319
|
+
"line": 186,
|
|
51635
51320
|
"rawdescription": "\n\nReturns the disabled value for the `RadioGroup`.\n",
|
|
51636
51321
|
"description": "<p>Returns the disabled value for the <code>RadioGroup</code>.</p>\n"
|
|
51637
51322
|
}
|
|
@@ -51652,7 +51337,7 @@
|
|
|
51652
51337
|
}
|
|
51653
51338
|
],
|
|
51654
51339
|
"returnType": "void",
|
|
51655
|
-
"line":
|
|
51340
|
+
"line": 201,
|
|
51656
51341
|
"rawdescription": "\n\nSets the skeleton value for all `Radio` to the skeleton value of `RadioGroup`.\n",
|
|
51657
51342
|
"description": "<p>Sets the skeleton value for all <code>Radio</code> to the skeleton value of <code>RadioGroup</code>.</p>\n",
|
|
51658
51343
|
"jsdoctags": [
|
|
@@ -51671,7 +51356,7 @@
|
|
|
51671
51356
|
"name": "skeleton",
|
|
51672
51357
|
"type": "any",
|
|
51673
51358
|
"returnType": "any",
|
|
51674
|
-
"line":
|
|
51359
|
+
"line": 194,
|
|
51675
51360
|
"rawdescription": "\n\nReturns the skeleton value in the `RadioGroup` if there is one.\n",
|
|
51676
51361
|
"description": "<p>Returns the skeleton value in the <code>RadioGroup</code> if there is one.</p>\n"
|
|
51677
51362
|
}
|
|
@@ -51680,7 +51365,7 @@
|
|
|
51680
51365
|
},
|
|
51681
51366
|
{
|
|
51682
51367
|
"name": "ReactiveFormsCombobox",
|
|
51683
|
-
"id": "component-ReactiveFormsCombobox-
|
|
51368
|
+
"id": "component-ReactiveFormsCombobox-9f2cbdf9b54c8033cabf6aa1f6ddd138e0797c6146ab99c0334d15f4cdf9539f5795e50bdb5fbf2bb4815c6aae3d0b82135d120f91b5f9db40313d0cae3aa73e",
|
|
51684
51369
|
"file": "src/combobox/stories/app-reactive-combobox.component.ts",
|
|
51685
51370
|
"encapsulation": [],
|
|
51686
51371
|
"entryComponents": [],
|
|
@@ -51690,7 +51375,7 @@
|
|
|
51690
51375
|
"selector": "app-reactive-combobox",
|
|
51691
51376
|
"styleUrls": [],
|
|
51692
51377
|
"styles": [],
|
|
51693
|
-
"template": "<form [formGroup]=\"sampleForm\" (ngSubmit)=\"onSubmit(sampleForm)\">\n\t<cds-combo-box\n\t\tformControlName=\"combobox\"\n\t\t[size]=\"size\"\n\t\t[label]=\"label\"\n\t\t[helperText]=\"helperText\"\n\t\
|
|
51378
|
+
"template": "<form [formGroup]=\"sampleForm\" (ngSubmit)=\"onSubmit(sampleForm)\">\n\t<cds-combo-box\n\t\tformControlName=\"combobox\"\n\t\t[size]=\"size\"\n\t\t[label]=\"label\"\n\t\t[helperText]=\"helperText\"\n\t\t[itemValueKey]=\"itemValueKey\"\n\t\t[theme]=\"theme\"\n\t\t[invalid]=\"invalid\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\"\n\t\t[items]=\"_items\">\n\t\t<cds-dropdown-list></cds-dropdown-list>\n\t</cds-combo-box>\n\tselected: {{ sampleForm.get(\"combobox\").value | json }}\n\t<cds-combo-box\n\t\tstyle=\"margin-top: 40px\"\n\t\tformControlName=\"multibox\"\n\t\t[label]=\"label\"\n\t\t[size]=\"size\"\n\t\t[itemValueKey]=\"itemValueKey\"\n\t\t[helperText]=\"helperText\"\n\t\ttype=\"multi\"\n\t\t[invalid]=\"invalid\"\n\t\t[invalidText]=\"invalidText\"\n\t\t[warn]=\"warn\"\n\t\t[warnText]=\"warnText\"\n\t\t[items]=\"_items\">\n\t\t<cds-dropdown-list></cds-dropdown-list>\n\t</cds-combo-box>\n\tselected: {{ sampleForm.get(\"multibox\").value | json }}\n</form>\n\t",
|
|
51694
51379
|
"templateUrl": [],
|
|
51695
51380
|
"viewProviders": [],
|
|
51696
51381
|
"hostDirectives": [],
|
|
@@ -51699,7 +51384,7 @@
|
|
|
51699
51384
|
"name": "disabled",
|
|
51700
51385
|
"deprecated": false,
|
|
51701
51386
|
"deprecationMessage": "",
|
|
51702
|
-
"line":
|
|
51387
|
+
"line": 70,
|
|
51703
51388
|
"type": "boolean",
|
|
51704
51389
|
"decorators": []
|
|
51705
51390
|
},
|
|
@@ -51734,10 +51419,19 @@
|
|
|
51734
51419
|
"name": "items",
|
|
51735
51420
|
"deprecated": false,
|
|
51736
51421
|
"deprecationMessage": "",
|
|
51737
|
-
"line":
|
|
51422
|
+
"line": 62,
|
|
51738
51423
|
"type": "Array<any>",
|
|
51739
51424
|
"decorators": []
|
|
51740
51425
|
},
|
|
51426
|
+
{
|
|
51427
|
+
"name": "itemValueKey",
|
|
51428
|
+
"defaultValue": "\"\"",
|
|
51429
|
+
"deprecated": false,
|
|
51430
|
+
"deprecationMessage": "",
|
|
51431
|
+
"line": 61,
|
|
51432
|
+
"type": "string",
|
|
51433
|
+
"decorators": []
|
|
51434
|
+
},
|
|
51741
51435
|
{
|
|
51742
51436
|
"name": "label",
|
|
51743
51437
|
"defaultValue": "\"\"",
|
|
@@ -51794,7 +51488,7 @@
|
|
|
51794
51488
|
"type": "any[]",
|
|
51795
51489
|
"optional": false,
|
|
51796
51490
|
"description": "",
|
|
51797
|
-
"line":
|
|
51491
|
+
"line": 80
|
|
51798
51492
|
},
|
|
51799
51493
|
{
|
|
51800
51494
|
"name": "sampleForm",
|
|
@@ -51819,7 +51513,7 @@
|
|
|
51819
51513
|
"description": "",
|
|
51820
51514
|
"rawdescription": "\n",
|
|
51821
51515
|
"type": "component",
|
|
51822
|
-
"sourceCode": "import {\n\tFormGroup,\n\tFormBuilder,\n\tFormControl\n} from \"@angular/forms\";\nimport {\n\tComponent,\n\tOnInit,\n\tInput\n} from \"@angular/core\";\nimport isEqual from \"lodash-es/isEqual\";\n\n@Component({\n\tselector: \"app-reactive-combobox\",\n\ttemplate: `\n\t\t<form [formGroup]=\"sampleForm\" (ngSubmit)=\"onSubmit(sampleForm)\">\n\t\t\t<cds-combo-box\n\t\t\t\tformControlName=\"combobox\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\
|
|
51516
|
+
"sourceCode": "import {\n\tFormGroup,\n\tFormBuilder,\n\tFormControl\n} from \"@angular/forms\";\nimport {\n\tComponent,\n\tOnInit,\n\tInput\n} from \"@angular/core\";\nimport isEqual from \"lodash-es/isEqual\";\n\n@Component({\n\tselector: \"app-reactive-combobox\",\n\ttemplate: `\n\t\t<form [formGroup]=\"sampleForm\" (ngSubmit)=\"onSubmit(sampleForm)\">\n\t\t\t<cds-combo-box\n\t\t\t\tformControlName=\"combobox\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[items]=\"_items\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t\tselected: {{ sampleForm.get(\"combobox\").value | json }}\n\t\t\t<cds-combo-box\n\t\t\t\tstyle=\"margin-top: 40px\"\n\t\t\t\tformControlName=\"multibox\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\ttype=\"multi\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[items]=\"_items\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t\tselected: {{ sampleForm.get(\"multibox\").value | json }}\n\t\t</form>\n\t`\n})\nexport class ReactiveFormsCombobox implements OnInit {\n\tpublic sampleForm: FormGroup;\n\t@Input() invalid = false;\n\t@Input() invalidText = \"\";\n\t@Input() warn = false;\n\t@Input() warnText = \"\";\n\t@Input() label = \"\";\n\t@Input() helperText = \"\";\n\t@Input() size = \"md\";\n\t@Input() theme = \"dark\";\n\t@Input() itemValueKey = \"\";\n\t@Input() set items(newItems: Array<any>) {\n\t\tif (!newItems.length) {\n\t\t\tnewItems = [];\n\t\t}\n\t\tif (!isEqual(this._items, newItems)) {\n\t\t\tthis._items = newItems;\n\t\t}\n\t}\n\t@Input() set disabled(isDisabled: boolean) {\n\t\tif (this.sampleForm) {\n\t\t\tif (isDisabled) {\n\t\t\t\tthis.sampleForm.disable();\n\t\t\t} else {\n\t\t\t\tthis.sampleForm.enable();\n\t\t\t}\n\t\t}\n\t}\n\n\t_items: any[] = [];\n\n\tconstructor(private fb: FormBuilder) {}\n\n\tngOnInit() {\n\t\tthis.sampleForm = this.fb.group({\n\t\t\tcombobox: new FormControl,\n\t\t\tmultibox: new FormControl\n\t\t});\n\n\t\tthis.sampleForm.get(\"combobox\")?.setValue(\"four\");\n\t\tthis.sampleForm.get(\"multibox\")?.setValue([\"four\", \"two\"]);\n\t}\n}\n",
|
|
51823
51517
|
"assetsDirs": [],
|
|
51824
51518
|
"styleUrlsData": "",
|
|
51825
51519
|
"stylesData": "",
|
|
@@ -51836,7 +51530,7 @@
|
|
|
51836
51530
|
"deprecationMessage": ""
|
|
51837
51531
|
}
|
|
51838
51532
|
],
|
|
51839
|
-
"line":
|
|
51533
|
+
"line": 80,
|
|
51840
51534
|
"jsdoctags": [
|
|
51841
51535
|
{
|
|
51842
51536
|
"name": "fb",
|
|
@@ -51870,7 +51564,7 @@
|
|
|
51870
51564
|
}
|
|
51871
51565
|
],
|
|
51872
51566
|
"returnType": "void",
|
|
51873
|
-
"line":
|
|
51567
|
+
"line": 62,
|
|
51874
51568
|
"jsdoctags": [
|
|
51875
51569
|
{
|
|
51876
51570
|
"name": "newItems",
|
|
@@ -51900,7 +51594,7 @@
|
|
|
51900
51594
|
}
|
|
51901
51595
|
],
|
|
51902
51596
|
"returnType": "void",
|
|
51903
|
-
"line":
|
|
51597
|
+
"line": 70,
|
|
51904
51598
|
"jsdoctags": [
|
|
51905
51599
|
{
|
|
51906
51600
|
"name": "isDisabled",
|
|
@@ -52104,7 +51798,7 @@
|
|
|
52104
51798
|
},
|
|
52105
51799
|
{
|
|
52106
51800
|
"name": "ReactiveFormsStory",
|
|
52107
|
-
"id": "component-ReactiveFormsStory-
|
|
51801
|
+
"id": "component-ReactiveFormsStory-22fea6f676798dd7aad8e8be5239ab157a6fa134f2a45d66b63a6bc1084e1a6be9e4f085c4c4b5c638c4ce42d9bea1f7f8c03d93809bc2818358d2ffeda37f6b-1",
|
|
52108
51802
|
"file": "src/dropdown/stories/app-reactive-forms.component.ts",
|
|
52109
51803
|
"encapsulation": [],
|
|
52110
51804
|
"entryComponents": [],
|
|
@@ -52114,7 +51808,7 @@
|
|
|
52114
51808
|
"selector": "app-reactive-forms",
|
|
52115
51809
|
"styleUrls": [],
|
|
52116
51810
|
"styles": [],
|
|
52117
|
-
"template": "<form [formGroup]=\"formGroup\">\n\t<div style=\"width: 300px\">\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\tplaceholder=\"Multi-select\"\n\t\t\tvalue=\"oid\"\n\t\t\t(selected)=\"selected.emit($event)\"\n\t\t\t(onClose)=\"onClose.emit($event)\"\n\t\t\tformControlName=\"roles\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t</div>\n</form>\n<br>\n<code>{{ formGroup.get(\"roles\").value | json }}</code>\n\t",
|
|
51811
|
+
"template": "<form [formGroup]=\"formGroup\">\n\t<div style=\"width: 300px\">\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\tplaceholder=\"Multi-select\"\n\t\t\tvalue=\"oid\"\n\t\t\t(selected)=\"selected.emit($event)\"\n\t\t\t(onClose)=\"onClose.emit($event)\"\n\t\t\tformControlName=\"roles\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t</div>\n</form>\n<br>\n<code>{{ formGroup.get(\"roles\").value | json }}</code>\n\t",
|
|
52118
51812
|
"templateUrl": [],
|
|
52119
51813
|
"viewProviders": [],
|
|
52120
51814
|
"hostDirectives": [],
|
|
@@ -52123,7 +51817,7 @@
|
|
|
52123
51817
|
"name": "disabled",
|
|
52124
51818
|
"deprecated": false,
|
|
52125
51819
|
"deprecationMessage": "",
|
|
52126
|
-
"line":
|
|
51820
|
+
"line": 52,
|
|
52127
51821
|
"type": "boolean",
|
|
52128
51822
|
"decorators": []
|
|
52129
51823
|
},
|
|
@@ -52132,7 +51826,7 @@
|
|
|
52132
51826
|
"defaultValue": "\"\"",
|
|
52133
51827
|
"deprecated": false,
|
|
52134
51828
|
"deprecationMessage": "",
|
|
52135
|
-
"line":
|
|
51829
|
+
"line": 47,
|
|
52136
51830
|
"type": "string",
|
|
52137
51831
|
"decorators": []
|
|
52138
51832
|
},
|
|
@@ -52141,7 +51835,7 @@
|
|
|
52141
51835
|
"defaultValue": "false",
|
|
52142
51836
|
"deprecated": false,
|
|
52143
51837
|
"deprecationMessage": "",
|
|
52144
|
-
"line":
|
|
51838
|
+
"line": 46,
|
|
52145
51839
|
"type": "boolean",
|
|
52146
51840
|
"decorators": []
|
|
52147
51841
|
},
|
|
@@ -52150,7 +51844,7 @@
|
|
|
52150
51844
|
"defaultValue": "false",
|
|
52151
51845
|
"deprecated": false,
|
|
52152
51846
|
"deprecationMessage": "",
|
|
52153
|
-
"line":
|
|
51847
|
+
"line": 48,
|
|
52154
51848
|
"type": "boolean",
|
|
52155
51849
|
"decorators": []
|
|
52156
51850
|
},
|
|
@@ -52159,7 +51853,7 @@
|
|
|
52159
51853
|
"defaultValue": "\"\"",
|
|
52160
51854
|
"deprecated": false,
|
|
52161
51855
|
"deprecationMessage": "",
|
|
52162
|
-
"line":
|
|
51856
|
+
"line": 49,
|
|
52163
51857
|
"type": "string",
|
|
52164
51858
|
"decorators": []
|
|
52165
51859
|
},
|
|
@@ -52168,16 +51862,25 @@
|
|
|
52168
51862
|
"defaultValue": "[]",
|
|
52169
51863
|
"deprecated": false,
|
|
52170
51864
|
"deprecationMessage": "",
|
|
52171
|
-
"line":
|
|
51865
|
+
"line": 44,
|
|
52172
51866
|
"type": "{}",
|
|
52173
51867
|
"decorators": []
|
|
52174
51868
|
},
|
|
51869
|
+
{
|
|
51870
|
+
"name": "itemValueKey",
|
|
51871
|
+
"defaultValue": "\"\"",
|
|
51872
|
+
"deprecated": false,
|
|
51873
|
+
"deprecationMessage": "",
|
|
51874
|
+
"line": 51,
|
|
51875
|
+
"type": "string",
|
|
51876
|
+
"decorators": []
|
|
51877
|
+
},
|
|
52175
51878
|
{
|
|
52176
51879
|
"name": "label",
|
|
52177
51880
|
"defaultValue": "\"\"",
|
|
52178
51881
|
"deprecated": false,
|
|
52179
51882
|
"deprecationMessage": "",
|
|
52180
|
-
"line":
|
|
51883
|
+
"line": 45,
|
|
52181
51884
|
"type": "string",
|
|
52182
51885
|
"decorators": []
|
|
52183
51886
|
},
|
|
@@ -52186,7 +51889,7 @@
|
|
|
52186
51889
|
"defaultValue": "\"top-after-reopen\"",
|
|
52187
51890
|
"deprecated": false,
|
|
52188
51891
|
"deprecationMessage": "",
|
|
52189
|
-
"line":
|
|
51892
|
+
"line": 50,
|
|
52190
51893
|
"type": "string",
|
|
52191
51894
|
"decorators": []
|
|
52192
51895
|
}
|
|
@@ -52197,7 +51900,7 @@
|
|
|
52197
51900
|
"defaultValue": "new EventEmitter()",
|
|
52198
51901
|
"deprecated": false,
|
|
52199
51902
|
"deprecationMessage": "",
|
|
52200
|
-
"line":
|
|
51903
|
+
"line": 61,
|
|
52201
51904
|
"type": "EventEmitter"
|
|
52202
51905
|
},
|
|
52203
51906
|
{
|
|
@@ -52205,7 +51908,7 @@
|
|
|
52205
51908
|
"defaultValue": "new EventEmitter()",
|
|
52206
51909
|
"deprecated": false,
|
|
52207
51910
|
"deprecationMessage": "",
|
|
52208
|
-
"line":
|
|
51911
|
+
"line": 60,
|
|
52209
51912
|
"type": "EventEmitter"
|
|
52210
51913
|
}
|
|
52211
51914
|
],
|
|
@@ -52217,7 +51920,7 @@
|
|
|
52217
51920
|
"type": "FormGroup",
|
|
52218
51921
|
"optional": false,
|
|
52219
51922
|
"description": "",
|
|
52220
|
-
"line":
|
|
51923
|
+
"line": 42,
|
|
52221
51924
|
"modifierKind": [
|
|
52222
51925
|
125
|
|
52223
51926
|
]
|
|
@@ -52233,7 +51936,7 @@
|
|
|
52233
51936
|
"description": "",
|
|
52234
51937
|
"rawdescription": "\n",
|
|
52235
51938
|
"type": "component",
|
|
52236
|
-
"sourceCode": "import {\n\tComponent,\n\tOnInit,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport {\n\tFormBuilder,\n\tFormGroup,\n\tFormControl\n} from \"@angular/forms\";\n\n@Component({\n\tselector: \"app-reactive-forms\",\n\ttemplate: `\n\t\t<form [formGroup]=\"formGroup\">\n\t\t\t<div style=\"width: 300px\">\n\t\t\t\t<cds-dropdown\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[theme]=\"theme\"\n\t\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t\tplaceholder=\"Multi-select\"\n\t\t\t\t\tvalue=\"oid\"\n\t\t\t\t\t(selected)=\"selected.emit($event)\"\n\t\t\t\t\t(onClose)=\"onClose.emit($event)\"\n\t\t\t\t\tformControlName=\"roles\">\n\t\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t\t</cds-dropdown>\n\t\t\t</div>\n\t\t</form>\n\t\t<br>\n\t\t<code>{{ formGroup.get(\"roles\").value | json }}</code>\n\t`\n})\nexport class ReactiveFormsStory implements OnInit {\n\tpublic formGroup: FormGroup;\n\n\t@Input() items = [];\n\t@Input() label = \"\";\n\t@Input() hideLabel = false;\n\t@Input() helperText = \"\";\n\t@Input() invalid = false;\n\t@Input() invalidText = \"\";\n\t@Input() selectionFeedback = \"top-after-reopen\";\n\t@Input() set disabled(value: boolean) {\n\t\tif (!this.formGroup) { return; }\n\t\tif (value) {\n\t\t\tthis.formGroup.get(\"roles\")?.disable();\n\t\t} else {\n\t\t\tthis.formGroup.get(\"roles\")?.enable();\n\t\t}\n\t}\n\t@Output() selected = new EventEmitter();\n\t@Output() onClose = new EventEmitter();\n\n\tconstructor(protected formBuilder: FormBuilder) { }\n\n\tngOnInit() {\n\t\tthis.formGroup = this.formBuilder.group({\n\t\t\troles: new FormControl()\n\t\t});\n\t\tthis.selectRoles();\n\t}\n\n\tprivate selectRoles() {\n\t\tthis.formGroup.get(\"roles\")?.setValue(
|
|
51939
|
+
"sourceCode": "import {\n\tComponent,\n\tOnInit,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport {\n\tFormBuilder,\n\tFormGroup,\n\tFormControl\n} from \"@angular/forms\";\n\n@Component({\n\tselector: \"app-reactive-forms\",\n\ttemplate: `\n\t\t<form [formGroup]=\"formGroup\">\n\t\t\t<div style=\"width: 300px\">\n\t\t\t\t<cds-dropdown\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[theme]=\"theme\"\n\t\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t\tplaceholder=\"Multi-select\"\n\t\t\t\t\tvalue=\"oid\"\n\t\t\t\t\t(selected)=\"selected.emit($event)\"\n\t\t\t\t\t(onClose)=\"onClose.emit($event)\"\n\t\t\t\t\tformControlName=\"roles\">\n\t\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t\t</cds-dropdown>\n\t\t\t</div>\n\t\t</form>\n\t\t<br>\n\t\t<code>{{ formGroup.get(\"roles\").value | json }}</code>\n\t`\n})\nexport class ReactiveFormsStory implements OnInit {\n\tpublic formGroup: FormGroup;\n\n\t@Input() items = [];\n\t@Input() label = \"\";\n\t@Input() hideLabel = false;\n\t@Input() helperText = \"\";\n\t@Input() invalid = false;\n\t@Input() invalidText = \"\";\n\t@Input() selectionFeedback = \"top-after-reopen\";\n\t@Input() itemValueKey = \"\";\n\t@Input() set disabled(value: boolean) {\n\t\tif (!this.formGroup) { return; }\n\t\tif (value) {\n\t\t\tthis.formGroup.get(\"roles\")?.disable();\n\t\t} else {\n\t\t\tthis.formGroup.get(\"roles\")?.enable();\n\t\t}\n\t}\n\t@Output() selected = new EventEmitter();\n\t@Output() onClose = new EventEmitter();\n\n\tconstructor(protected formBuilder: FormBuilder) { }\n\n\tngOnInit() {\n\t\tthis.formGroup = this.formBuilder.group({\n\t\t\troles: new FormControl()\n\t\t});\n\t\tthis.selectRoles();\n\t}\n\n\tprivate selectRoles() {\n\t\tthis.formGroup.get(\"roles\")?.setValue(\"one\");\n\t}\n}\n",
|
|
52237
51940
|
"assetsDirs": [],
|
|
52238
51941
|
"styleUrlsData": "",
|
|
52239
51942
|
"stylesData": "",
|
|
@@ -52250,7 +51953,7 @@
|
|
|
52250
51953
|
"deprecationMessage": ""
|
|
52251
51954
|
}
|
|
52252
51955
|
],
|
|
52253
|
-
"line":
|
|
51956
|
+
"line": 61,
|
|
52254
51957
|
"jsdoctags": [
|
|
52255
51958
|
{
|
|
52256
51959
|
"name": "formBuilder",
|
|
@@ -52284,7 +51987,7 @@
|
|
|
52284
51987
|
}
|
|
52285
51988
|
],
|
|
52286
51989
|
"returnType": "void",
|
|
52287
|
-
"line":
|
|
51990
|
+
"line": 52,
|
|
52288
51991
|
"jsdoctags": [
|
|
52289
51992
|
{
|
|
52290
51993
|
"name": "value",
|
|
@@ -85933,16 +85636,6 @@
|
|
|
85933
85636
|
"type": "",
|
|
85934
85637
|
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-tabs type=\"contained\">\n\t\t\t<cds-tab heading=\"Engage\" secondaryLabel=\"(21/25)\">Tab Content 1</cds-tab>\n\t\t\t<cds-tab heading=\"Analyze\" secondaryLabel=\"(12/16)\">Tab Content 2</cds-tab>\n\t\t\t<cds-tab heading=\"Remediate\" secondaryLabel=\"(0/7)\">Tab Content 3</cds-tab>\n\t\t\t<cds-tab heading=\"Assets\" secondaryLabel=\"(4/12)\">Tab Content 4</cds-tab>\n\t\t\t<cds-tab heading=\"Monitoring\" secondaryLabel=\"(0/10)\" [disabled]=\"true\">Tab Content 5</cds-tab>\n\t\t</cds-tabs>\n\t`\n})"
|
|
85935
85638
|
},
|
|
85936
|
-
{
|
|
85937
|
-
"name": "context",
|
|
85938
|
-
"ctype": "miscellaneous",
|
|
85939
|
-
"subtype": "variable",
|
|
85940
|
-
"file": "src/test.ts",
|
|
85941
|
-
"deprecated": false,
|
|
85942
|
-
"deprecationMessage": "",
|
|
85943
|
-
"type": "",
|
|
85944
|
-
"defaultValue": "require.context(\"./\", true, /\\.spec\\.ts$/)"
|
|
85945
|
-
},
|
|
85946
85639
|
{
|
|
85947
85640
|
"name": "createBreadcrumbItems",
|
|
85948
85641
|
"ctype": "miscellaneous",
|
|
@@ -86135,16 +85828,6 @@
|
|
|
86135
85828
|
"type": "object",
|
|
86136
85829
|
"defaultValue": "{ top: 0, left: 0 }"
|
|
86137
85830
|
},
|
|
86138
|
-
{
|
|
86139
|
-
"name": "defaults",
|
|
86140
|
-
"ctype": "miscellaneous",
|
|
86141
|
-
"subtype": "variable",
|
|
86142
|
-
"file": "src/checkbox/checkbox-exported-tests.ts",
|
|
86143
|
-
"deprecated": false,
|
|
86144
|
-
"deprecationMessage": "",
|
|
86145
|
-
"type": "object",
|
|
86146
|
-
"defaultValue": "{\n\tselectors: {\n\t\troot: \"cds-checkbox\",\n\t\tinput: \"input\"\n\t}\n}"
|
|
86147
|
-
},
|
|
86148
85831
|
{
|
|
86149
85832
|
"name": "DEMO_ROWS",
|
|
86150
85833
|
"ctype": "miscellaneous",
|
|
@@ -87359,7 +87042,7 @@
|
|
|
87359
87042
|
"deprecated": false,
|
|
87360
87043
|
"deprecationMessage": "",
|
|
87361
87044
|
"type": "",
|
|
87362
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\ttype=\"multi\"\n\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
87045
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\ttype=\"multi\"\n\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
87363
87046
|
},
|
|
87364
87047
|
{
|
|
87365
87048
|
"name": "MultiStep",
|
|
@@ -87389,7 +87072,7 @@
|
|
|
87389
87072
|
"deprecated": false,
|
|
87390
87073
|
"deprecationMessage": "",
|
|
87391
87074
|
"type": "",
|
|
87392
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
87075
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
87393
87076
|
},
|
|
87394
87077
|
{
|
|
87395
87078
|
"name": "MultiTemplate",
|
|
@@ -87399,7 +87082,7 @@
|
|
|
87399
87082
|
"deprecated": false,
|
|
87400
87083
|
"deprecationMessage": "",
|
|
87401
87084
|
"type": "",
|
|
87402
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\ttype=\"multi\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
87085
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\ttype=\"multi\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
87403
87086
|
},
|
|
87404
87087
|
{
|
|
87405
87088
|
"name": "MultiTemplate",
|
|
@@ -87499,7 +87182,7 @@
|
|
|
87499
87182
|
"deprecated": false,
|
|
87500
87183
|
"deprecationMessage": "",
|
|
87501
87184
|
"type": "",
|
|
87502
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[displayValue]=\"dropdownRenderer\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\" [listTpl]=\"dropdownRenderer\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<ng-template #dropdownRenderer let-item=\"item\">\n\t\t\t<div *ngIf=\"item && item.content\" style=\"font-size: 14px;\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" style=\"will-change: transform;\">\n\t\t\t\t\t<path d=\"M9.3 3.7l3.8 3.8H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z\"></path>\n\t\t\t\t</svg>\n\t\t\t\t {{item.content}}\n\t\t\t</div>\n\t\t</ng-template>\n\t`\n})"
|
|
87185
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[displayValue]=\"dropdownRenderer\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\" [listTpl]=\"dropdownRenderer\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<ng-template #dropdownRenderer let-item=\"item\">\n\t\t\t<div *ngIf=\"item && item.content\" style=\"font-size: 14px;\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" style=\"will-change: transform;\">\n\t\t\t\t\t<path d=\"M9.3 3.7l3.8 3.8H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z\"></path>\n\t\t\t\t</svg>\n\t\t\t\t {{item.content}}\n\t\t\t</div>\n\t\t</ng-template>\n\t`\n})"
|
|
87503
87186
|
},
|
|
87504
87187
|
{
|
|
87505
87188
|
"name": "NoDataTemplate",
|
|
@@ -87799,7 +87482,7 @@
|
|
|
87799
87482
|
"deprecated": false,
|
|
87800
87483
|
"deprecationMessage": "",
|
|
87801
87484
|
"type": "",
|
|
87802
|
-
"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/combobox/stories/app-reactive-combobox.component.ts\n\t\t-->\n\t\t<app-reactive-combobox\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\">\n\t\t</app-reactive-combobox>\n\t`\n})"
|
|
87485
|
+
"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/combobox/stories/app-reactive-combobox.component.ts\n\t\t-->\n\t\t<app-reactive-combobox\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[itemValueKey]=\"itemValueKey\">\n\t\t</app-reactive-combobox>\n\t`\n})"
|
|
87803
87486
|
},
|
|
87804
87487
|
{
|
|
87805
87488
|
"name": "ReactiveTemplate",
|
|
@@ -87809,7 +87492,7 @@
|
|
|
87809
87492
|
"deprecated": false,
|
|
87810
87493
|
"deprecationMessage": "",
|
|
87811
87494
|
"type": "",
|
|
87812
|
-
"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/dropdown/stories/app-reactive-forms.component.ts\n\t\t-->\n\t\t<app-reactive-forms\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[items]=\"items\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t</app-reactive-forms>\n\t`\n})"
|
|
87495
|
+
"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/dropdown/stories/app-reactive-forms.component.ts\n\t\t-->\n\t\t<app-reactive-forms\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[items]=\"items\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t</app-reactive-forms>\n\t`\n})"
|
|
87813
87496
|
},
|
|
87814
87497
|
{
|
|
87815
87498
|
"name": "ReactiveTemplate",
|
|
@@ -87855,15 +87538,6 @@
|
|
|
87855
87538
|
"rawdescription": "Takes the `Observable` returned from `i18n.get` and an object of variables to replace.\n\nThe keys specify the variable name in the string.\n\nExample:\n```typescript\nservice.set({ \"TEST\": \"{{foo}} {{bar}}\" });\n\nservice.replace(service.get(\"TEST\"), { foo: \"test\", bar: \"asdf\" })\n```\n\nProduces: `\"test asdf\"`",
|
|
87856
87539
|
"description": "<p>Takes the <code>Observable</code> returned from <code>i18n.get</code> and an object of variables to replace.</p>\n<p>The keys specify the variable name in the string.</p>\n<p>Example:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">service.set({ "TEST": "{{foo}} {{bar}}" });\n\nservice.replace(service.get("TEST"), { foo: "test", bar: "asdf" })</code></pre></div><p>Produces: <code>"test asdf"</code></p>\n"
|
|
87857
87540
|
},
|
|
87858
|
-
{
|
|
87859
|
-
"name": "require",
|
|
87860
|
-
"ctype": "miscellaneous",
|
|
87861
|
-
"subtype": "variable",
|
|
87862
|
-
"file": "src/test.ts",
|
|
87863
|
-
"deprecated": false,
|
|
87864
|
-
"deprecationMessage": "",
|
|
87865
|
-
"type": "any"
|
|
87866
|
-
},
|
|
87867
87541
|
{
|
|
87868
87542
|
"name": "Responsive",
|
|
87869
87543
|
"ctype": "miscellaneous",
|
|
@@ -88604,7 +88278,7 @@
|
|
|
88604
88278
|
"deprecated": false,
|
|
88605
88279
|
"deprecationMessage": "",
|
|
88606
88280
|
"type": "",
|
|
88607
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
88281
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
88608
88282
|
},
|
|
88609
88283
|
{
|
|
88610
88284
|
"name": "Template",
|
|
@@ -88644,7 +88318,7 @@
|
|
|
88644
88318
|
"deprecated": false,
|
|
88645
88319
|
"deprecationMessage": "",
|
|
88646
88320
|
"type": "",
|
|
88647
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t`\n})"
|
|
88321
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t`\n})"
|
|
88648
88322
|
},
|
|
88649
88323
|
{
|
|
88650
88324
|
"name": "Template",
|
|
@@ -89516,7 +89190,7 @@
|
|
|
89516
89190
|
"deprecated": false,
|
|
89517
89191
|
"deprecationMessage": "",
|
|
89518
89192
|
"type": "",
|
|
89519
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-combo-box\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[items]=\"items\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(submit)=\"submit($event)\"\n\t\t\t\t(search)=\"search($event)\"\n\t\t\t\t(clear)=\"clear($event)\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
89193
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-combo-box\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[items]=\"items\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(submit)=\"submit($event)\"\n\t\t\t\t(search)=\"search($event)\"\n\t\t\t\t(clear)=\"clear($event)\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
89520
89194
|
},
|
|
89521
89195
|
{
|
|
89522
89196
|
"name": "withAILabelTemplate",
|
|
@@ -89536,7 +89210,7 @@
|
|
|
89536
89210
|
"deprecated": false,
|
|
89537
89211
|
"deprecationMessage": "",
|
|
89538
89212
|
"type": "",
|
|
89539
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
89213
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
89540
89214
|
},
|
|
89541
89215
|
{
|
|
89542
89216
|
"name": "withAILabelTemplate",
|
|
@@ -90806,34 +90480,6 @@
|
|
|
90806
90480
|
}
|
|
90807
90481
|
]
|
|
90808
90482
|
},
|
|
90809
|
-
{
|
|
90810
|
-
"name": "isObject",
|
|
90811
|
-
"file": "src/exported-tests/component-tests.ts",
|
|
90812
|
-
"ctype": "miscellaneous",
|
|
90813
|
-
"subtype": "function",
|
|
90814
|
-
"deprecated": false,
|
|
90815
|
-
"deprecationMessage": "",
|
|
90816
|
-
"description": "",
|
|
90817
|
-
"args": [
|
|
90818
|
-
{
|
|
90819
|
-
"name": "val",
|
|
90820
|
-
"type": "",
|
|
90821
|
-
"deprecated": false,
|
|
90822
|
-
"deprecationMessage": ""
|
|
90823
|
-
}
|
|
90824
|
-
],
|
|
90825
|
-
"jsdoctags": [
|
|
90826
|
-
{
|
|
90827
|
-
"name": "val",
|
|
90828
|
-
"type": "",
|
|
90829
|
-
"deprecated": false,
|
|
90830
|
-
"deprecationMessage": "",
|
|
90831
|
-
"tagName": {
|
|
90832
|
-
"text": "param"
|
|
90833
|
-
}
|
|
90834
|
-
}
|
|
90835
|
-
]
|
|
90836
|
-
},
|
|
90837
90483
|
{
|
|
90838
90484
|
"name": "isVisible",
|
|
90839
90485
|
"file": "src/common/tab.service.ts",
|
|
@@ -93645,7 +93291,7 @@
|
|
|
93645
93291
|
"deprecated": false,
|
|
93646
93292
|
"deprecationMessage": "",
|
|
93647
93293
|
"type": "",
|
|
93648
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
93294
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[appendInline]=\"false\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\ttype=\"multi\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t`\n})"
|
|
93649
93295
|
},
|
|
93650
93296
|
{
|
|
93651
93297
|
"name": "ReactiveForms",
|
|
@@ -93665,7 +93311,7 @@
|
|
|
93665
93311
|
"deprecated": false,
|
|
93666
93312
|
"deprecationMessage": "",
|
|
93667
93313
|
"type": "",
|
|
93668
|
-
"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/combobox/stories/app-reactive-combobox.component.ts\n\t\t-->\n\t\t<app-reactive-combobox\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\">\n\t\t</app-reactive-combobox>\n\t`\n})"
|
|
93314
|
+
"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/combobox/stories/app-reactive-combobox.component.ts\n\t\t-->\n\t\t<app-reactive-combobox\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[itemValueKey]=\"itemValueKey\">\n\t\t</app-reactive-combobox>\n\t`\n})"
|
|
93669
93315
|
},
|
|
93670
93316
|
{
|
|
93671
93317
|
"name": "Template",
|
|
@@ -93675,7 +93321,7 @@
|
|
|
93675
93321
|
"deprecated": false,
|
|
93676
93322
|
"deprecationMessage": "",
|
|
93677
93323
|
"type": "",
|
|
93678
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
93324
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-combo-box\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[size]=\"size\"\n\t\t\t[appendInline]=\"appendInline\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[items]=\"items\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(submit)=\"submit($event)\"\n\t\t\t(search)=\"search($event)\"\n\t\t\t(clear)=\"clear($event)\">\n\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t</cds-combo-box>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
93679
93325
|
},
|
|
93680
93326
|
{
|
|
93681
93327
|
"name": "withAILabel",
|
|
@@ -93695,7 +93341,7 @@
|
|
|
93695
93341
|
"deprecated": false,
|
|
93696
93342
|
"deprecationMessage": "",
|
|
93697
93343
|
"type": "",
|
|
93698
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-combo-box\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[items]=\"items\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(submit)=\"submit($event)\"\n\t\t\t\t(search)=\"search($event)\"\n\t\t\t\t(clear)=\"clear($event)\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93344
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-combo-box\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[items]=\"items\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(submit)=\"submit($event)\"\n\t\t\t\t(search)=\"search($event)\"\n\t\t\t\t(clear)=\"clear($event)\">\n\t\t\t\t<cds-dropdown-list></cds-dropdown-list>\n\t\t\t</cds-combo-box>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93699
93345
|
}
|
|
93700
93346
|
],
|
|
93701
93347
|
"src/content-switcher/content-switcher.stories.ts": [
|
|
@@ -93893,7 +93539,7 @@
|
|
|
93893
93539
|
"deprecated": false,
|
|
93894
93540
|
"deprecationMessage": "",
|
|
93895
93541
|
"type": "",
|
|
93896
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\ttype=\"multi\"\n\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93542
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\ttype=\"multi\"\n\t\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t\t[(ngModel)]=\"model\"\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[dropUp]=\"dropUp\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[fluid]=\"fluid\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93897
93543
|
},
|
|
93898
93544
|
{
|
|
93899
93545
|
"name": "MultiTemplate",
|
|
@@ -93903,7 +93549,7 @@
|
|
|
93903
93549
|
"deprecated": false,
|
|
93904
93550
|
"deprecationMessage": "",
|
|
93905
93551
|
"type": "",
|
|
93906
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\ttype=\"multi\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
93552
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\ttype=\"multi\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[(ngModel)]=\"model\"\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<span>{{model | json}}</span>\n\t`\n})"
|
|
93907
93553
|
},
|
|
93908
93554
|
{
|
|
93909
93555
|
"name": "NgTemplate",
|
|
@@ -93913,7 +93559,7 @@
|
|
|
93913
93559
|
"deprecated": false,
|
|
93914
93560
|
"deprecationMessage": "",
|
|
93915
93561
|
"type": "",
|
|
93916
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[displayValue]=\"dropdownRenderer\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\" [listTpl]=\"dropdownRenderer\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<ng-template #dropdownRenderer let-item=\"item\">\n\t\t\t<div *ngIf=\"item && item.content\" style=\"font-size: 14px;\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" style=\"will-change: transform;\">\n\t\t\t\t\t<path d=\"M9.3 3.7l3.8 3.8H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z\"></path>\n\t\t\t\t</svg>\n\t\t\t\t {{item.content}}\n\t\t\t</div>\n\t\t</ng-template>\n\t`\n})"
|
|
93562
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[displayValue]=\"dropdownRenderer\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\" [listTpl]=\"dropdownRenderer\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t\t<ng-template #dropdownRenderer let-item=\"item\">\n\t\t\t<div *ngIf=\"item && item.content\" style=\"font-size: 14px;\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden=\"true\" style=\"will-change: transform;\">\n\t\t\t\t\t<path d=\"M9.3 3.7l3.8 3.8H1v1h12.1l-3.8 3.8.7.7 5-5-5-5z\"></path>\n\t\t\t\t</svg>\n\t\t\t\t {{item.content}}\n\t\t\t</div>\n\t\t</ng-template>\n\t`\n})"
|
|
93917
93563
|
},
|
|
93918
93564
|
{
|
|
93919
93565
|
"name": "ReactiveForms",
|
|
@@ -93933,7 +93579,7 @@
|
|
|
93933
93579
|
"deprecated": false,
|
|
93934
93580
|
"deprecationMessage": "",
|
|
93935
93581
|
"type": "",
|
|
93936
|
-
"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/dropdown/stories/app-reactive-forms.component.ts\n\t\t-->\n\t\t<app-reactive-forms\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[items]=\"items\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t</app-reactive-forms>\n\t`\n})"
|
|
93582
|
+
"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/dropdown/stories/app-reactive-forms.component.ts\n\t\t-->\n\t\t<app-reactive-forms\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[items]=\"items\"\n\t\t\t[selectionFeedback]=\"selectionFeedback\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t</app-reactive-forms>\n\t`\n})"
|
|
93937
93583
|
},
|
|
93938
93584
|
{
|
|
93939
93585
|
"name": "Template",
|
|
@@ -93943,7 +93589,7 @@
|
|
|
93943
93589
|
"deprecated": false,
|
|
93944
93590
|
"deprecationMessage": "",
|
|
93945
93591
|
"type": "",
|
|
93946
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t`\n})"
|
|
93592
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-dropdown\n\t\t\t[label]=\"label\"\n\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[helperText]=\"helperText\"\n\t\t\t[size]=\"size\"\n\t\t\t[dropUp]=\"dropUp\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[theme]=\"theme\"\n\t\t\tplaceholder=\"Select\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[fluid]=\"fluid\"\n\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t(selected)=\"selected($event)\"\n\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t</cds-dropdown>\n\t`\n})"
|
|
93947
93593
|
},
|
|
93948
93594
|
{
|
|
93949
93595
|
"name": "withAILabel",
|
|
@@ -93963,7 +93609,7 @@
|
|
|
93963
93609
|
"deprecated": false,
|
|
93964
93610
|
"deprecationMessage": "",
|
|
93965
93611
|
"type": "",
|
|
93966
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93612
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\tstyles: AI_LABEL_STORY_STYLES,\n\ttemplate: `\n\t\t<div style=\"width: 400px\">\n\t\t\t<cds-dropdown\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[hideLabel]=\"hideLabel\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[theme]=\"theme\"\n\t\t\t\tplaceholder=\"Select\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[dropUp]=\"false\"\n\t\t\t\t[decorator]=\"decoratorTpl\"\n\t\t\t\t[itemValueKey]=\"itemValueKey\"\n\t\t\t\t(selected)=\"selected($event)\"\n\t\t\t\t(onClose)=\"onClose($event)\">\n\t\t\t\t<cds-dropdown-list [items]=\"items\"></cds-dropdown-list>\n\t\t\t</cds-dropdown>\n\t\t</div>\n\t\t<ng-template #decoratorTpl>\n\t\t\t<cds-ai-label\n\t\t\t\tclass=\"ai-label-container\"\n\t\t\t\tkind=\"default\"\n\t\t\t\tsize=\"mini\"\n\t\t\t\t[autoAlign]=\"true\"\n\t\t\t\taiText=\"AI\"\n\t\t\t\tariaLabel=\"Show information\">\n\t\t\t\t` + AI_LABEL_INNER + `\n\t\t\t</cds-ai-label>\n\t\t</ng-template>\n\t`\n})"
|
|
93967
93613
|
},
|
|
93968
93614
|
{
|
|
93969
93615
|
"name": "WithTemplate",
|
|
@@ -96540,27 +96186,6 @@
|
|
|
96540
96186
|
"defaultValue": "new InjectionToken<CheckboxGroupHost | null>(\"CheckboxGroupHost\")"
|
|
96541
96187
|
}
|
|
96542
96188
|
],
|
|
96543
|
-
"src/test.ts": [
|
|
96544
|
-
{
|
|
96545
|
-
"name": "context",
|
|
96546
|
-
"ctype": "miscellaneous",
|
|
96547
|
-
"subtype": "variable",
|
|
96548
|
-
"file": "src/test.ts",
|
|
96549
|
-
"deprecated": false,
|
|
96550
|
-
"deprecationMessage": "",
|
|
96551
|
-
"type": "",
|
|
96552
|
-
"defaultValue": "require.context(\"./\", true, /\\.spec\\.ts$/)"
|
|
96553
|
-
},
|
|
96554
|
-
{
|
|
96555
|
-
"name": "require",
|
|
96556
|
-
"ctype": "miscellaneous",
|
|
96557
|
-
"subtype": "variable",
|
|
96558
|
-
"file": "src/test.ts",
|
|
96559
|
-
"deprecated": false,
|
|
96560
|
-
"deprecationMessage": "",
|
|
96561
|
-
"type": "any"
|
|
96562
|
-
}
|
|
96563
|
-
],
|
|
96564
96189
|
"src/aspect-ratio/aspect-ratio.stories.ts": [
|
|
96565
96190
|
{
|
|
96566
96191
|
"name": "Default",
|
|
@@ -96609,18 +96234,6 @@
|
|
|
96609
96234
|
"defaultValue": "{ top: 0, left: 0 }"
|
|
96610
96235
|
}
|
|
96611
96236
|
],
|
|
96612
|
-
"src/checkbox/checkbox-exported-tests.ts": [
|
|
96613
|
-
{
|
|
96614
|
-
"name": "defaults",
|
|
96615
|
-
"ctype": "miscellaneous",
|
|
96616
|
-
"subtype": "variable",
|
|
96617
|
-
"file": "src/checkbox/checkbox-exported-tests.ts",
|
|
96618
|
-
"deprecated": false,
|
|
96619
|
-
"deprecationMessage": "",
|
|
96620
|
-
"type": "object",
|
|
96621
|
-
"defaultValue": "{\n\tselectors: {\n\t\troot: \"cds-checkbox\",\n\t\tinput: \"input\"\n\t}\n}"
|
|
96622
|
-
}
|
|
96623
|
-
],
|
|
96624
96237
|
"src/table/stories/app-table-ai-label.component.ts": [
|
|
96625
96238
|
{
|
|
96626
96239
|
"name": "DEMO_ROWS",
|
|
@@ -98169,36 +97782,6 @@
|
|
|
98169
97782
|
]
|
|
98170
97783
|
}
|
|
98171
97784
|
],
|
|
98172
|
-
"src/exported-tests/component-tests.ts": [
|
|
98173
|
-
{
|
|
98174
|
-
"name": "isObject",
|
|
98175
|
-
"file": "src/exported-tests/component-tests.ts",
|
|
98176
|
-
"ctype": "miscellaneous",
|
|
98177
|
-
"subtype": "function",
|
|
98178
|
-
"deprecated": false,
|
|
98179
|
-
"deprecationMessage": "",
|
|
98180
|
-
"description": "",
|
|
98181
|
-
"args": [
|
|
98182
|
-
{
|
|
98183
|
-
"name": "val",
|
|
98184
|
-
"type": "",
|
|
98185
|
-
"deprecated": false,
|
|
98186
|
-
"deprecationMessage": ""
|
|
98187
|
-
}
|
|
98188
|
-
],
|
|
98189
|
-
"jsdoctags": [
|
|
98190
|
-
{
|
|
98191
|
-
"name": "val",
|
|
98192
|
-
"type": "",
|
|
98193
|
-
"deprecated": false,
|
|
98194
|
-
"deprecationMessage": "",
|
|
98195
|
-
"tagName": {
|
|
98196
|
-
"text": "param"
|
|
98197
|
-
}
|
|
98198
|
-
}
|
|
98199
|
-
]
|
|
98200
|
-
}
|
|
98201
|
-
],
|
|
98202
97785
|
"src/placeholder/placeholder.module.ts": [
|
|
98203
97786
|
{
|
|
98204
97787
|
"name": "PLACEHOLDER_SERVICE_PROVIDER_FACTORY",
|
|
@@ -99647,25 +99230,6 @@
|
|
|
99647
99230
|
"coverageCount": "0/1",
|
|
99648
99231
|
"status": "low"
|
|
99649
99232
|
},
|
|
99650
|
-
{
|
|
99651
|
-
"filePath": "src/checkbox/checkbox-exported-tests.ts",
|
|
99652
|
-
"type": "class",
|
|
99653
|
-
"linktype": "classe",
|
|
99654
|
-
"name": "CheckboxExportedTests",
|
|
99655
|
-
"coveragePercent": 0,
|
|
99656
|
-
"coverageCount": "0/8",
|
|
99657
|
-
"status": "low"
|
|
99658
|
-
},
|
|
99659
|
-
{
|
|
99660
|
-
"filePath": "src/checkbox/checkbox-exported-tests.ts",
|
|
99661
|
-
"type": "variable",
|
|
99662
|
-
"linktype": "miscellaneous",
|
|
99663
|
-
"linksubtype": "variable",
|
|
99664
|
-
"name": "defaults",
|
|
99665
|
-
"coveragePercent": 0,
|
|
99666
|
-
"coverageCount": "0/1",
|
|
99667
|
-
"status": "low"
|
|
99668
|
-
},
|
|
99669
99233
|
{
|
|
99670
99234
|
"filePath": "src/checkbox/checkbox-group-host.ts",
|
|
99671
99235
|
"type": "interface",
|
|
@@ -100143,7 +99707,7 @@
|
|
|
100143
99707
|
"linktype": "component",
|
|
100144
99708
|
"name": "ReactiveFormsCombobox",
|
|
100145
99709
|
"coveragePercent": 0,
|
|
100146
|
-
"coverageCount": "0/
|
|
99710
|
+
"coverageCount": "0/15",
|
|
100147
99711
|
"status": "low"
|
|
100148
99712
|
},
|
|
100149
99713
|
{
|
|
@@ -100928,7 +100492,7 @@
|
|
|
100928
100492
|
"linktype": "component",
|
|
100929
100493
|
"name": "Dropdown",
|
|
100930
100494
|
"coveragePercent": 67,
|
|
100931
|
-
"coverageCount": "
|
|
100495
|
+
"coverageCount": "53/78",
|
|
100932
100496
|
"status": "good"
|
|
100933
100497
|
},
|
|
100934
100498
|
{
|
|
@@ -101142,7 +100706,7 @@
|
|
|
101142
100706
|
"linktype": "component",
|
|
101143
100707
|
"name": "ReactiveFormsStory",
|
|
101144
100708
|
"coveragePercent": 0,
|
|
101145
|
-
"coverageCount": "0/
|
|
100709
|
+
"coverageCount": "0/14",
|
|
101146
100710
|
"status": "low"
|
|
101147
100711
|
},
|
|
101148
100712
|
{
|
|
@@ -101183,25 +100747,6 @@
|
|
|
101183
100747
|
"coverageCount": "1/2",
|
|
101184
100748
|
"status": "medium"
|
|
101185
100749
|
},
|
|
101186
|
-
{
|
|
101187
|
-
"filePath": "src/exported-tests/component-tests.ts",
|
|
101188
|
-
"type": "class",
|
|
101189
|
-
"linktype": "classe",
|
|
101190
|
-
"name": "ComponentTests",
|
|
101191
|
-
"coveragePercent": 0,
|
|
101192
|
-
"coverageCount": "0/7",
|
|
101193
|
-
"status": "low"
|
|
101194
|
-
},
|
|
101195
|
-
{
|
|
101196
|
-
"filePath": "src/exported-tests/component-tests.ts",
|
|
101197
|
-
"type": "function",
|
|
101198
|
-
"linktype": "miscellaneous",
|
|
101199
|
-
"linksubtype": "function",
|
|
101200
|
-
"name": "isObject",
|
|
101201
|
-
"coveragePercent": 0,
|
|
101202
|
-
"coverageCount": "0/1",
|
|
101203
|
-
"status": "low"
|
|
101204
|
-
},
|
|
101205
100750
|
{
|
|
101206
100751
|
"filePath": "src/file-uploader/file-item.interface.ts",
|
|
101207
100752
|
"type": "interface",
|
|
@@ -105970,26 +105515,6 @@
|
|
|
105970
105515
|
"coverageCount": "0/1",
|
|
105971
105516
|
"status": "low"
|
|
105972
105517
|
},
|
|
105973
|
-
{
|
|
105974
|
-
"filePath": "src/test.ts",
|
|
105975
|
-
"type": "variable",
|
|
105976
|
-
"linktype": "miscellaneous",
|
|
105977
|
-
"linksubtype": "variable",
|
|
105978
|
-
"name": "context",
|
|
105979
|
-
"coveragePercent": 0,
|
|
105980
|
-
"coverageCount": "0/1",
|
|
105981
|
-
"status": "low"
|
|
105982
|
-
},
|
|
105983
|
-
{
|
|
105984
|
-
"filePath": "src/test.ts",
|
|
105985
|
-
"type": "variable",
|
|
105986
|
-
"linktype": "miscellaneous",
|
|
105987
|
-
"linksubtype": "variable",
|
|
105988
|
-
"name": "require",
|
|
105989
|
-
"coveragePercent": 0,
|
|
105990
|
-
"coverageCount": "0/1",
|
|
105991
|
-
"status": "low"
|
|
105992
|
-
},
|
|
105993
105518
|
{
|
|
105994
105519
|
"filePath": "src/theme/theme.directive.ts",
|
|
105995
105520
|
"type": "directive",
|