carbon-components-angular 5.24.5 → 5.24.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/documentation/components/DatePicker.html +55 -51
- package/docs/documentation/components/TableHead.html +42 -44
- package/docs/documentation/components/TableRadio.html +179 -16
- package/docs/documentation/components/Tooltip.html +148 -117
- package/docs/documentation/coverage.html +3 -3
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ThemeModule/dependencies.svg +13 -13
- package/docs/documentation/modules/ThemeModule.html +13 -13
- package/docs/documentation/modules/TilesModule/dependencies.svg +98 -98
- package/docs/documentation/modules/TilesModule.html +98 -98
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +41 -45
- package/docs/documentation/modules/TimePickerModule.html +41 -45
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +40 -44
- package/docs/documentation/modules/TimePickerSelectModule.html +40 -44
- package/docs/documentation/modules/ToggleModule/dependencies.svg +42 -46
- package/docs/documentation/modules/ToggleModule.html +42 -46
- package/docs/documentation/modules/TooltipModule/dependencies.svg +29 -29
- package/docs/documentation/modules/TooltipModule.html +29 -29
- package/docs/documentation/modules/TreeviewModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TreeviewModule.html +4 -4
- package/docs/documentation/modules/UIShellModule/dependencies.svg +4 -4
- package/docs/documentation/modules/UIShellModule.html +4 -4
- package/docs/documentation.json +241 -182
- package/docs/storybook/1895.172bd8b0.iframe.bundle.js +1 -0
- package/docs/storybook/5868.4bc19136.iframe.bundle.js +1 -0
- package/docs/storybook/6702.8b6fb391.iframe.bundle.js +1 -0
- package/docs/storybook/901.adc28b35.iframe.bundle.js +1 -0
- package/docs/storybook/button-button-set-stories.ad7233ba.iframe.bundle.js +1 -0
- package/docs/storybook/button-button-stories.19d4c798.iframe.bundle.js +1 -0
- package/docs/storybook/button-icon-button-stories.4b2fc4a6.iframe.bundle.js +1 -0
- package/docs/storybook/code-snippet-code-snippet-stories.19e4b78a.iframe.bundle.js +1 -0
- package/docs/storybook/contained-list-contained-list-stories.d8456cd4.iframe.bundle.js +1 -0
- package/docs/storybook/datepicker-datepicker-stories.d5770b7c.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/index-stories.bdb87ad2.iframe.bundle.js +1 -0
- package/docs/storybook/main.83dfce65.iframe.bundle.js +1 -0
- package/docs/storybook/patterns-forms-multi-step-form-stories.a9142797.iframe.bundle.js +1 -0
- package/docs/storybook/patterns-loading-large-loading-stories.f776e3ae.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.54ad6862.iframe.bundle.js → runtime~main.cb1f9895.iframe.bundle.js} +1 -1
- package/docs/storybook/tiles-expandable-tile-stories.97c48cb1.iframe.bundle.js +1 -0
- package/docs/storybook/toggletip-toggletip-stories.93f48d46.iframe.bundle.js +1 -0
- package/docs/storybook/tooltip-definition-tooptip-stories.60d42e1c.iframe.bundle.js +1 -0
- package/docs/storybook/tooltip-tooltip-stories.eb2e347f.iframe.bundle.js +1 -0
- package/docs/storybook/ui-shell-ui-shell-stories.6be7cb97.iframe.bundle.js +1 -0
- package/esm2020/datepicker/datepicker.component.mjs +5 -1
- package/esm2020/table/cell/table-radio.component.mjs +11 -3
- package/esm2020/table/head/table-head.component.mjs +1 -3
- package/esm2020/tooltip/tooltip.component.mjs +26 -2
- package/fesm2015/carbon-components-angular-datepicker.mjs +5 -0
- package/fesm2015/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-table.mjs +9 -3
- package/fesm2015/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-tooltip.mjs +25 -1
- package/fesm2015/carbon-components-angular-tooltip.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker.mjs +4 -0
- package/fesm2020/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-table.mjs +9 -3
- package/fesm2020/carbon-components-angular-table.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-tooltip.mjs +25 -1
- package/fesm2020/carbon-components-angular-tooltip.mjs.map +1 -1
- package/package.json +1 -1
- package/table/cell/table-radio.component.d.ts +2 -0
- package/tooltip/tooltip.component.d.ts +7 -2
- package/docs/storybook/1895.0331c090.iframe.bundle.js +0 -1
- package/docs/storybook/4578.65805869.iframe.bundle.js +0 -1
- package/docs/storybook/5868.9e6e15e4.iframe.bundle.js +0 -1
- package/docs/storybook/901.292c1079.iframe.bundle.js +0 -1
- package/docs/storybook/button-button-set-stories.d561d04b.iframe.bundle.js +0 -1
- package/docs/storybook/button-button-stories.1b5d80b7.iframe.bundle.js +0 -1
- package/docs/storybook/button-icon-button-stories.59d7496a.iframe.bundle.js +0 -1
- package/docs/storybook/code-snippet-code-snippet-stories.d9a3162d.iframe.bundle.js +0 -1
- package/docs/storybook/contained-list-contained-list-stories.2887855a.iframe.bundle.js +0 -1
- package/docs/storybook/datepicker-datepicker-stories.1d3d1000.iframe.bundle.js +0 -1
- package/docs/storybook/index-stories.70809ec7.iframe.bundle.js +0 -1
- package/docs/storybook/main.c4f854e5.iframe.bundle.js +0 -1
- package/docs/storybook/patterns-forms-multi-step-form-stories.89086fc2.iframe.bundle.js +0 -1
- package/docs/storybook/patterns-loading-large-loading-stories.699b1e1b.iframe.bundle.js +0 -1
- package/docs/storybook/tiles-expandable-tile-stories.209d7ef2.iframe.bundle.js +0 -1
- package/docs/storybook/toggletip-toggletip-stories.7265233d.iframe.bundle.js +0 -1
- package/docs/storybook/tooltip-definition-tooptip-stories.d6e8ec29.iframe.bundle.js +0 -1
- package/docs/storybook/tooltip-tooltip-stories.79853bfa.iframe.bundle.js +0 -1
- package/docs/storybook/ui-shell-ui-shell-stories.a1fb87a2.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -25402,7 +25402,7 @@
|
|
|
25402
25402
|
},
|
|
25403
25403
|
{
|
|
25404
25404
|
"name": "DatePicker",
|
|
25405
|
-
"id": "component-DatePicker-
|
|
25405
|
+
"id": "component-DatePicker-d295ff1ef16790bb751b53dd85141be6bf7ed89d4b550cc01bdaf6a34b65528f4f455d3912bb47f3eeaf2d39e24ac9814ea3a005fe4fca7ea284cf121a6c2ffe",
|
|
25406
25406
|
"file": "src/datepicker/datepicker.component.ts",
|
|
25407
25407
|
"encapsulation": [
|
|
25408
25408
|
"ViewEncapsulation.None"
|
|
@@ -25741,7 +25741,7 @@
|
|
|
25741
25741
|
"type": "function",
|
|
25742
25742
|
"optional": false,
|
|
25743
25743
|
"description": "",
|
|
25744
|
-
"line":
|
|
25744
|
+
"line": 403
|
|
25745
25745
|
},
|
|
25746
25746
|
{
|
|
25747
25747
|
"name": "propagateChange",
|
|
@@ -25751,7 +25751,7 @@
|
|
|
25751
25751
|
"type": "",
|
|
25752
25752
|
"optional": false,
|
|
25753
25753
|
"description": "",
|
|
25754
|
-
"line":
|
|
25754
|
+
"line": 405
|
|
25755
25755
|
},
|
|
25756
25756
|
{
|
|
25757
25757
|
"name": "rangeInput",
|
|
@@ -25779,7 +25779,7 @@
|
|
|
25779
25779
|
"optional": false,
|
|
25780
25780
|
"returnType": "void",
|
|
25781
25781
|
"typeParameters": [],
|
|
25782
|
-
"line":
|
|
25782
|
+
"line": 352,
|
|
25783
25783
|
"deprecated": false,
|
|
25784
25784
|
"deprecationMessage": "",
|
|
25785
25785
|
"decorators": [
|
|
@@ -25798,7 +25798,7 @@
|
|
|
25798
25798
|
"optional": false,
|
|
25799
25799
|
"returnType": "void",
|
|
25800
25800
|
"typeParameters": [],
|
|
25801
|
-
"line":
|
|
25801
|
+
"line": 367,
|
|
25802
25802
|
"deprecated": false,
|
|
25803
25803
|
"deprecationMessage": "",
|
|
25804
25804
|
"decorators": [
|
|
@@ -25824,7 +25824,7 @@
|
|
|
25824
25824
|
"optional": false,
|
|
25825
25825
|
"returnType": "void",
|
|
25826
25826
|
"typeParameters": [],
|
|
25827
|
-
"line":
|
|
25827
|
+
"line": 433,
|
|
25828
25828
|
"deprecated": false,
|
|
25829
25829
|
"deprecationMessage": "",
|
|
25830
25830
|
"rawdescription": "\n\nHandles the `valueChange` event from the range input\n",
|
|
@@ -25854,7 +25854,7 @@
|
|
|
25854
25854
|
"optional": false,
|
|
25855
25855
|
"returnType": "void",
|
|
25856
25856
|
"typeParameters": [],
|
|
25857
|
-
"line":
|
|
25857
|
+
"line": 418,
|
|
25858
25858
|
"deprecated": false,
|
|
25859
25859
|
"deprecationMessage": "",
|
|
25860
25860
|
"rawdescription": "\n\nHandles the `valueChange` event from the primary/single input\n",
|
|
@@ -25884,7 +25884,7 @@
|
|
|
25884
25884
|
"optional": false,
|
|
25885
25885
|
"returnType": "void",
|
|
25886
25886
|
"typeParameters": [],
|
|
25887
|
-
"line":
|
|
25887
|
+
"line": 444,
|
|
25888
25888
|
"deprecated": false,
|
|
25889
25889
|
"deprecationMessage": "",
|
|
25890
25890
|
"rawdescription": "\n\nHandles opening the calendar \"properly\" when the calendar icon is clicked.\n",
|
|
@@ -25914,7 +25914,7 @@
|
|
|
25914
25914
|
"optional": false,
|
|
25915
25915
|
"returnType": "void",
|
|
25916
25916
|
"typeParameters": [],
|
|
25917
|
-
"line":
|
|
25917
|
+
"line": 395,
|
|
25918
25918
|
"deprecated": false,
|
|
25919
25919
|
"deprecationMessage": "",
|
|
25920
25920
|
"jsdoctags": [
|
|
@@ -25942,7 +25942,7 @@
|
|
|
25942
25942
|
"optional": false,
|
|
25943
25943
|
"returnType": "void",
|
|
25944
25944
|
"typeParameters": [],
|
|
25945
|
-
"line":
|
|
25945
|
+
"line": 399,
|
|
25946
25946
|
"deprecated": false,
|
|
25947
25947
|
"deprecationMessage": "",
|
|
25948
25948
|
"jsdoctags": [
|
|
@@ -25970,7 +25970,7 @@
|
|
|
25970
25970
|
"optional": false,
|
|
25971
25971
|
"returnType": "void",
|
|
25972
25972
|
"typeParameters": [],
|
|
25973
|
-
"line":
|
|
25973
|
+
"line": 391,
|
|
25974
25974
|
"deprecated": false,
|
|
25975
25975
|
"deprecationMessage": "",
|
|
25976
25976
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the DatePicker.\n\nex: `this.formGroup.get(\"myDatePicker\").disable();`\n\n",
|
|
@@ -25978,8 +25978,8 @@
|
|
|
25978
25978
|
"jsdoctags": [
|
|
25979
25979
|
{
|
|
25980
25980
|
"name": {
|
|
25981
|
-
"pos":
|
|
25982
|
-
"end":
|
|
25981
|
+
"pos": 11063,
|
|
25982
|
+
"end": 11073,
|
|
25983
25983
|
"flags": 8421376,
|
|
25984
25984
|
"modifierFlagsCache": 0,
|
|
25985
25985
|
"transformFlags": 0,
|
|
@@ -25990,8 +25990,8 @@
|
|
|
25990
25990
|
"deprecated": false,
|
|
25991
25991
|
"deprecationMessage": "",
|
|
25992
25992
|
"tagName": {
|
|
25993
|
-
"pos":
|
|
25994
|
-
"end":
|
|
25993
|
+
"pos": 11057,
|
|
25994
|
+
"end": 11062,
|
|
25995
25995
|
"flags": 8421376,
|
|
25996
25996
|
"modifierFlagsCache": 0,
|
|
25997
25997
|
"transformFlags": 0,
|
|
@@ -26015,7 +26015,7 @@
|
|
|
26015
26015
|
"optional": false,
|
|
26016
26016
|
"returnType": "void",
|
|
26017
26017
|
"typeParameters": [],
|
|
26018
|
-
"line":
|
|
26018
|
+
"line": 375,
|
|
26019
26019
|
"deprecated": false,
|
|
26020
26020
|
"deprecationMessage": "",
|
|
26021
26021
|
"rawdescription": "\n\nWrites a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n",
|
|
@@ -26023,8 +26023,8 @@
|
|
|
26023
26023
|
"jsdoctags": [
|
|
26024
26024
|
{
|
|
26025
26025
|
"name": {
|
|
26026
|
-
"pos":
|
|
26027
|
-
"end":
|
|
26026
|
+
"pos": 10662,
|
|
26027
|
+
"end": 10667,
|
|
26028
26028
|
"flags": 8421376,
|
|
26029
26029
|
"modifierFlagsCache": 0,
|
|
26030
26030
|
"transformFlags": 0,
|
|
@@ -26035,8 +26035,8 @@
|
|
|
26035
26035
|
"deprecated": false,
|
|
26036
26036
|
"deprecationMessage": "",
|
|
26037
26037
|
"tagName": {
|
|
26038
|
-
"pos":
|
|
26039
|
-
"end":
|
|
26038
|
+
"pos": 10656,
|
|
26039
|
+
"end": 10661,
|
|
26040
26040
|
"flags": 8421376,
|
|
26041
26041
|
"modifierFlagsCache": 0,
|
|
26042
26042
|
"transformFlags": 0,
|
|
@@ -26058,7 +26058,7 @@
|
|
|
26058
26058
|
"argsDecorator": [],
|
|
26059
26059
|
"deprecated": false,
|
|
26060
26060
|
"deprecationMessage": "",
|
|
26061
|
-
"line":
|
|
26061
|
+
"line": 352
|
|
26062
26062
|
},
|
|
26063
26063
|
{
|
|
26064
26064
|
"name": "focusout",
|
|
@@ -26066,7 +26066,7 @@
|
|
|
26066
26066
|
"argsDecorator": [],
|
|
26067
26067
|
"deprecated": false,
|
|
26068
26068
|
"deprecationMessage": "",
|
|
26069
|
-
"line":
|
|
26069
|
+
"line": 367
|
|
26070
26070
|
}
|
|
26071
26071
|
],
|
|
26072
26072
|
"standalone": false,
|
|
@@ -26074,7 +26074,7 @@
|
|
|
26074
26074
|
"description": "<p>Get started with importing the module:</p>\n<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",
|
|
26075
26075
|
"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",
|
|
26076
26076
|
"type": "component",
|
|
26077
|
-
"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[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(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input)\">\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[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(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput)\">\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@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\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});\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];\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\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 * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\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\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\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.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.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\", \"region\");\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",
|
|
26077
|
+
"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[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(valueChange)=\"onValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(input)\">\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[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(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t\t(click)=\"openCalendar(rangeInput)\">\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@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\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});\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];\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\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\tif (this.range) {\n\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\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 * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\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\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\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.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.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\", \"region\");\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",
|
|
26078
26078
|
"assetsDirs": [],
|
|
26079
26079
|
"styleUrlsData": "",
|
|
26080
26080
|
"stylesData": "",
|
|
@@ -54796,7 +54796,7 @@
|
|
|
54796
54796
|
},
|
|
54797
54797
|
{
|
|
54798
54798
|
"name": "TableHead",
|
|
54799
|
-
"id": "component-TableHead-
|
|
54799
|
+
"id": "component-TableHead-2d68f7b9140d6b32f7f6cf1233835b396303e5a0283e237c8dc738c2262fafb8471a7499ed5c748c6c3b9942511775108a574ef38bbcb582b73fb3da583576b5",
|
|
54800
54800
|
"file": "src/table/head/table-head.component.ts",
|
|
54801
54801
|
"encapsulation": [],
|
|
54802
54802
|
"entryComponents": [],
|
|
@@ -54808,7 +54808,7 @@
|
|
|
54808
54808
|
"styles": [
|
|
54809
54809
|
"\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t"
|
|
54810
54810
|
],
|
|
54811
|
-
"template": "<ng-container *ngIf=\"model\">\n\t<tr>\n\t\t<th\n\t\t\tcdsTableHeadExpand\n\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\tscope=\"col\"\n\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t[id]=\"model.getId('expand')\">\n\t\t</th>\n\t\t<th\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\
|
|
54811
|
+
"template": "<ng-container *ngIf=\"model\">\n\t<tr>\n\t\t<th\n\t\t\tcdsTableHeadExpand\n\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\tscope=\"col\"\n\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t[id]=\"model.getId('expand')\">\n\t\t</th>\n\t\t<th\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t</th>\n\t\t<th\n\t\t\tcdsTableHeadCheckbox\n\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\tscope=\"col\"\n\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t[skeleton]=\"skeleton\"\n\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t[id]=\"model.getId('select')\">\n\t\t</th>\n\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t<th\n\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\tcdsTableHeadCell\n\t\t\t\tscope=\"col\"\n\t\t\t\t[class]=\"column.className\"\n\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t[column]=\"column\"\n\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t</th>\n\t\t</ng-container>\n\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\tscope=\"col\"\n\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t<!--\n\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t-->\n\t\t</th>\n\t</tr>\n</ng-container>\n<ng-content></ng-content>\n",
|
|
54812
54812
|
"templateUrl": [],
|
|
54813
54813
|
"viewProviders": [],
|
|
54814
54814
|
"hostDirectives": [],
|
|
@@ -54817,7 +54817,7 @@
|
|
|
54817
54817
|
"name": "checkboxHeaderLabel",
|
|
54818
54818
|
"deprecated": false,
|
|
54819
54819
|
"deprecationMessage": "",
|
|
54820
|
-
"line":
|
|
54820
|
+
"line": 112,
|
|
54821
54821
|
"type": "string | Observable",
|
|
54822
54822
|
"decorators": []
|
|
54823
54823
|
},
|
|
@@ -54826,7 +54826,7 @@
|
|
|
54826
54826
|
"defaultValue": "false",
|
|
54827
54827
|
"deprecated": false,
|
|
54828
54828
|
"deprecationMessage": "",
|
|
54829
|
-
"line":
|
|
54829
|
+
"line": 95,
|
|
54830
54830
|
"type": "boolean",
|
|
54831
54831
|
"decorators": []
|
|
54832
54832
|
},
|
|
@@ -54834,7 +54834,7 @@
|
|
|
54834
54834
|
"name": "filterTitle",
|
|
54835
54835
|
"deprecated": false,
|
|
54836
54836
|
"deprecationMessage": "",
|
|
54837
|
-
"line":
|
|
54837
|
+
"line": 139,
|
|
54838
54838
|
"type": "string | Observable",
|
|
54839
54839
|
"decorators": []
|
|
54840
54840
|
},
|
|
@@ -54842,7 +54842,7 @@
|
|
|
54842
54842
|
"name": "model",
|
|
54843
54843
|
"deprecated": false,
|
|
54844
54844
|
"deprecationMessage": "",
|
|
54845
|
-
"line":
|
|
54845
|
+
"line": 91,
|
|
54846
54846
|
"type": "TableModel",
|
|
54847
54847
|
"decorators": []
|
|
54848
54848
|
},
|
|
@@ -54851,7 +54851,7 @@
|
|
|
54851
54851
|
"defaultValue": "false",
|
|
54852
54852
|
"deprecated": false,
|
|
54853
54853
|
"deprecationMessage": "",
|
|
54854
|
-
"line":
|
|
54854
|
+
"line": 99,
|
|
54855
54855
|
"type": "boolean",
|
|
54856
54856
|
"decorators": []
|
|
54857
54857
|
},
|
|
@@ -54860,7 +54860,7 @@
|
|
|
54860
54860
|
"defaultValue": "false",
|
|
54861
54861
|
"deprecated": false,
|
|
54862
54862
|
"deprecationMessage": "",
|
|
54863
|
-
"line":
|
|
54863
|
+
"line": 97,
|
|
54864
54864
|
"type": "boolean",
|
|
54865
54865
|
"decorators": []
|
|
54866
54866
|
},
|
|
@@ -54869,7 +54869,7 @@
|
|
|
54869
54869
|
"defaultValue": "true",
|
|
54870
54870
|
"deprecated": false,
|
|
54871
54871
|
"deprecationMessage": "",
|
|
54872
|
-
"line":
|
|
54872
|
+
"line": 93,
|
|
54873
54873
|
"type": "boolean",
|
|
54874
54874
|
"decorators": []
|
|
54875
54875
|
},
|
|
@@ -54878,7 +54878,7 @@
|
|
|
54878
54878
|
"defaultValue": "false",
|
|
54879
54879
|
"deprecated": false,
|
|
54880
54880
|
"deprecationMessage": "",
|
|
54881
|
-
"line":
|
|
54881
|
+
"line": 101,
|
|
54882
54882
|
"type": "boolean",
|
|
54883
54883
|
"decorators": []
|
|
54884
54884
|
},
|
|
@@ -54889,7 +54889,7 @@
|
|
|
54889
54889
|
"deprecationMessage": "",
|
|
54890
54890
|
"rawdescription": "\n\nSetting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.\n",
|
|
54891
54891
|
"description": "<p>Setting sortable to false will disable all headers including headers which are sortable. Is is\npossible to set the sortable state on the header item to disable/enable sorting for only some headers.</p>\n",
|
|
54892
|
-
"line":
|
|
54892
|
+
"line": 109,
|
|
54893
54893
|
"type": "boolean",
|
|
54894
54894
|
"decorators": []
|
|
54895
54895
|
},
|
|
@@ -54897,7 +54897,7 @@
|
|
|
54897
54897
|
"name": "sortAscendingLabel",
|
|
54898
54898
|
"deprecated": false,
|
|
54899
54899
|
"deprecationMessage": "",
|
|
54900
|
-
"line":
|
|
54900
|
+
"line": 130,
|
|
54901
54901
|
"type": "string | Observable",
|
|
54902
54902
|
"decorators": []
|
|
54903
54903
|
},
|
|
@@ -54905,7 +54905,7 @@
|
|
|
54905
54905
|
"name": "sortDescendingLabel",
|
|
54906
54906
|
"deprecated": false,
|
|
54907
54907
|
"deprecationMessage": "",
|
|
54908
|
-
"line":
|
|
54908
|
+
"line": 121,
|
|
54909
54909
|
"type": "string | Observable",
|
|
54910
54910
|
"decorators": []
|
|
54911
54911
|
},
|
|
@@ -54914,7 +54914,7 @@
|
|
|
54914
54914
|
"defaultValue": "false",
|
|
54915
54915
|
"deprecated": false,
|
|
54916
54916
|
"deprecationMessage": "",
|
|
54917
|
-
"line":
|
|
54917
|
+
"line": 103,
|
|
54918
54918
|
"type": "boolean",
|
|
54919
54919
|
"decorators": []
|
|
54920
54920
|
}
|
|
@@ -54929,15 +54929,15 @@
|
|
|
54929
54929
|
"description": "<p>Emits if all rows are deselected.</p>\n",
|
|
54930
54930
|
"jsdoctags": [
|
|
54931
54931
|
{
|
|
54932
|
-
"pos":
|
|
54933
|
-
"end":
|
|
54932
|
+
"pos": 4026,
|
|
54933
|
+
"end": 4041,
|
|
54934
54934
|
"flags": 8421376,
|
|
54935
54935
|
"modifierFlagsCache": 0,
|
|
54936
54936
|
"transformFlags": 0,
|
|
54937
54937
|
"kind": 344,
|
|
54938
54938
|
"tagName": {
|
|
54939
|
-
"pos":
|
|
54940
|
-
"end":
|
|
54939
|
+
"pos": 4027,
|
|
54940
|
+
"end": 4032,
|
|
54941
54941
|
"flags": 8421376,
|
|
54942
54942
|
"modifierFlagsCache": 0,
|
|
54943
54943
|
"transformFlags": 0,
|
|
@@ -54946,8 +54946,8 @@
|
|
|
54946
54946
|
},
|
|
54947
54947
|
"comment": "",
|
|
54948
54948
|
"name": {
|
|
54949
|
-
"pos":
|
|
54950
|
-
"end":
|
|
54949
|
+
"pos": 4033,
|
|
54950
|
+
"end": 4038,
|
|
54951
54951
|
"flags": 8421376,
|
|
54952
54952
|
"modifierFlagsCache": 0,
|
|
54953
54953
|
"transformFlags": 0,
|
|
@@ -54958,7 +54958,7 @@
|
|
|
54958
54958
|
"isBracketed": false
|
|
54959
54959
|
}
|
|
54960
54960
|
],
|
|
54961
|
-
"line":
|
|
54961
|
+
"line": 162,
|
|
54962
54962
|
"type": "EventEmitter"
|
|
54963
54963
|
},
|
|
54964
54964
|
{
|
|
@@ -54970,15 +54970,15 @@
|
|
|
54970
54970
|
"description": "<p>Emits if all rows are selected.</p>\n",
|
|
54971
54971
|
"jsdoctags": [
|
|
54972
54972
|
{
|
|
54973
|
-
"pos":
|
|
54974
|
-
"end":
|
|
54973
|
+
"pos": 3902,
|
|
54974
|
+
"end": 3917,
|
|
54975
54975
|
"flags": 8421376,
|
|
54976
54976
|
"modifierFlagsCache": 0,
|
|
54977
54977
|
"transformFlags": 0,
|
|
54978
54978
|
"kind": 344,
|
|
54979
54979
|
"tagName": {
|
|
54980
|
-
"pos":
|
|
54981
|
-
"end":
|
|
54980
|
+
"pos": 3903,
|
|
54981
|
+
"end": 3908,
|
|
54982
54982
|
"flags": 8421376,
|
|
54983
54983
|
"modifierFlagsCache": 0,
|
|
54984
54984
|
"transformFlags": 0,
|
|
@@ -54987,8 +54987,8 @@
|
|
|
54987
54987
|
},
|
|
54988
54988
|
"comment": "",
|
|
54989
54989
|
"name": {
|
|
54990
|
-
"pos":
|
|
54991
|
-
"end":
|
|
54990
|
+
"pos": 3909,
|
|
54991
|
+
"end": 3914,
|
|
54992
54992
|
"flags": 8421376,
|
|
54993
54993
|
"modifierFlagsCache": 0,
|
|
54994
54994
|
"transformFlags": 0,
|
|
@@ -54999,7 +54999,7 @@
|
|
|
54999
54999
|
"isBracketed": false
|
|
55000
55000
|
}
|
|
55001
55001
|
],
|
|
55002
|
-
"line":
|
|
55002
|
+
"line": 156,
|
|
55003
55003
|
"type": "EventEmitter"
|
|
55004
55004
|
},
|
|
55005
55005
|
{
|
|
@@ -55009,7 +55009,7 @@
|
|
|
55009
55009
|
"deprecationMessage": "",
|
|
55010
55010
|
"rawdescription": "\n\nEmits an index of the column that wants to be sorted.\n",
|
|
55011
55011
|
"description": "<p>Emits an index of the column that wants to be sorted.</p>\n",
|
|
55012
|
-
"line":
|
|
55012
|
+
"line": 150,
|
|
55013
55013
|
"type": "EventEmitter"
|
|
55014
55014
|
}
|
|
55015
55015
|
],
|
|
@@ -55022,7 +55022,7 @@
|
|
|
55022
55022
|
"type": "number",
|
|
55023
55023
|
"optional": false,
|
|
55024
55024
|
"description": "",
|
|
55025
|
-
"line":
|
|
55025
|
+
"line": 164,
|
|
55026
55026
|
"modifierKind": [
|
|
55027
55027
|
123
|
|
55028
55028
|
]
|
|
@@ -55035,7 +55035,7 @@
|
|
|
55035
55035
|
"optional": false,
|
|
55036
55036
|
"returnType": "Observable<string>",
|
|
55037
55037
|
"typeParameters": [],
|
|
55038
|
-
"line":
|
|
55038
|
+
"line": 187,
|
|
55039
55039
|
"deprecated": false,
|
|
55040
55040
|
"deprecationMessage": ""
|
|
55041
55041
|
},
|
|
@@ -55045,7 +55045,7 @@
|
|
|
55045
55045
|
"optional": false,
|
|
55046
55046
|
"returnType": "Observable<string>",
|
|
55047
55047
|
"typeParameters": [],
|
|
55048
|
-
"line":
|
|
55048
|
+
"line": 199,
|
|
55049
55049
|
"deprecated": false,
|
|
55050
55050
|
"deprecationMessage": ""
|
|
55051
55051
|
},
|
|
@@ -55055,7 +55055,7 @@
|
|
|
55055
55055
|
"optional": false,
|
|
55056
55056
|
"returnType": "Observable<string>",
|
|
55057
55057
|
"typeParameters": [],
|
|
55058
|
-
"line":
|
|
55058
|
+
"line": 195,
|
|
55059
55059
|
"deprecated": false,
|
|
55060
55060
|
"deprecationMessage": ""
|
|
55061
55061
|
},
|
|
@@ -55065,7 +55065,7 @@
|
|
|
55065
55065
|
"optional": false,
|
|
55066
55066
|
"returnType": "Observable<string>",
|
|
55067
55067
|
"typeParameters": [],
|
|
55068
|
-
"line":
|
|
55068
|
+
"line": 191,
|
|
55069
55069
|
"deprecated": false,
|
|
55070
55070
|
"deprecationMessage": ""
|
|
55071
55071
|
},
|
|
@@ -55075,7 +55075,7 @@
|
|
|
55075
55075
|
"optional": false,
|
|
55076
55076
|
"returnType": "void",
|
|
55077
55077
|
"typeParameters": [],
|
|
55078
|
-
"line":
|
|
55078
|
+
"line": 179,
|
|
55079
55079
|
"deprecated": false,
|
|
55080
55080
|
"deprecationMessage": ""
|
|
55081
55081
|
}
|
|
@@ -55089,7 +55089,7 @@
|
|
|
55089
55089
|
"description": "<p>A subcomponent that creates the thead of the table</p>\n<h2>Basic usage</h2>\n<div><pre class=\"line-numbers\"><code class=\"language-html\"> <thead cdsTableHead [model]="model"></thead></code></pre></div>",
|
|
55090
55090
|
"rawdescription": "\n\nA subcomponent that creates the thead of the table\n\n## Basic usage\n\n```html\n\t<thead cdsTableHead [model]=\"model\"></thead>\n```\n",
|
|
55091
55091
|
"type": "component",
|
|
55092
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tAfterViewInit\n} from \"@angular/core\";\n\nimport { TableModel } from \"../table-model.class\";\nimport { getScrollbarWidth } from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\nimport { TableRowSize } from \"../table.types\";\n\n/**\n * A subcomponent that creates the thead of the table\n *\n * ## Basic usage\n *\n * ```html\n * \t<thead cdsTableHead [model]=\"model\"></thead>\n * ```\n */\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: \"[cdsTableHead], [ibmTableHead]\",\n\ttemplate: `\n\t<ng-container *ngIf=\"model\">\n\t\t<tr>\n\t\t\t<th\n\t\t\t\tcdsTableHeadExpand\n\t\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t\t[id]=\"model.getId('expand')\">\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\
|
|
55092
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tAfterViewInit\n} from \"@angular/core\";\n\nimport { TableModel } from \"../table-model.class\";\nimport { getScrollbarWidth } from \"carbon-components-angular/utils\";\nimport { I18n, Overridable } from \"carbon-components-angular/i18n\";\nimport { Observable } from \"rxjs\";\nimport { TableRowSize } from \"../table.types\";\n\n/**\n * A subcomponent that creates the thead of the table\n *\n * ## Basic usage\n *\n * ```html\n * \t<thead cdsTableHead [model]=\"model\"></thead>\n * ```\n */\n@Component({\n\t// tslint:disable-next-line:component-selector\n\tselector: \"[cdsTableHead], [ibmTableHead]\",\n\ttemplate: `\n\t<ng-container *ngIf=\"model\">\n\t\t<tr>\n\t\t\t<th\n\t\t\t\tcdsTableHeadExpand\n\t\t\t\t*ngIf=\"model.hasExpandableRows()\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngClass]=\"{'cds--table-expand-v2': stickyHeader}\"\n\t\t\t\t[id]=\"model.getId('expand')\">\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t\t<!-- add width 0; since the carbon styles don't seem to constrain this headers width -->\n\t\t\t</th>\n\t\t\t<th\n\t\t\t\tcdsTableHeadCheckbox\n\t\t\t\t*ngIf=\"!skeleton && showSelectionColumn && !enableSingleSelect\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[checked]=\"selectAllCheckbox\"\n\t\t\t\t[indeterminate]=\"selectAllCheckboxSomeSelected\"\n\t\t\t\t[ariaLabel]=\"getCheckboxHeaderLabel()\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[name]=\"model.getHeaderId('select')\"\n\t\t\t\t(change)=\"onSelectAllCheckboxChange()\"\n\t\t\t\t[id]=\"model.getId('select')\">\n\t\t\t</th>\n\t\t\t<ng-container *ngFor=\"let column of model.header; let i = index\">\n\t\t\t\t<th\n\t\t\t\t\t*ngIf=\"column && column.visible\"\n\t\t\t\t\t[ngStyle]=\"column.style\"\n\t\t\t\t\tcdsTableHeadCell\n\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t[class]=\"column.className\"\n\t\t\t\t\t[sortable]=\"sortable\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[id]=\"model.getId(i)\"\n\t\t\t\t\t[column]=\"column\"\n\t\t\t\t\t[filterTitle]=\"getFilterTitle()\"\n\t\t\t\t\t[attr.colspan]=\"column.colSpan\"\n\t\t\t\t\t[attr.rowspan]=\"column.rowSpan\"\n\t\t\t\t\t(sort)=\"sort.emit(i)\">\n\t\t\t\t</th>\n\t\t\t</ng-container>\n\t\t\t<th *ngIf=\"!skeleton && stickyHeader && scrollbarWidth\"\n\t\t\t\tscope=\"col\"\n\t\t\t\t[ngStyle]=\"{'width': scrollbarWidth + 'px', 'padding': 0, 'border': 0}\">\n\t\t\t\t<!--\n\t\t\t\t\tScrollbar pushes body to the left so this header column is added to push\n\t\t\t\t\tthe title bar the same amount and keep the header and body columns aligned.\n\t\t\t\t-->\n\t\t\t</th>\n\t\t</tr>\n\t</ng-container>\n\t<ng-content></ng-content>\n\t`,\n\tstyles: [`\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t`]\n})\nexport class TableHead implements AfterViewInit {\n\t@Input() model: TableModel;\n\n\t@Input() showSelectionColumn = true;\n\n\t@Input() enableSingleSelect = false;\n\n\t@Input() selectAllCheckboxSomeSelected = false;\n\n\t@Input() selectAllCheckbox = false;\n\n\t@Input() skeleton = false;\n\n\t@Input() stickyHeader = false;\n\n\t/**\n\t * Setting sortable to false will disable all headers including headers which are sortable. Is is\n\t * possible to set the sortable state on the header item to disable/enable sorting for only some headers.\n\t */\n\t@Input() sortable = true;\n\n\t@Input()\n\tset checkboxHeaderLabel(value: string | Observable<string>) {\n\t\tthis._checkboxHeaderLabel.override(value);\n\t}\n\n\tget checkboxHeaderLabel() {\n\t\treturn this._checkboxHeaderLabel.value;\n\t}\n\n\t@Input()\n\tset sortDescendingLabel(value: string | Observable<string>) {\n\t\tthis._sortDescendingLabel.override(value);\n\t}\n\n\tget sortDescendingLabel() {\n\t\treturn this._sortDescendingLabel.value;\n\t}\n\n\t@Input()\n\tset sortAscendingLabel(value: string | Observable<string>) {\n\t\tthis._sortAscendingLabel.override(value);\n\t}\n\n\tget sortAscendingLabel() {\n\t\treturn this._sortAscendingLabel.value;\n\t}\n\n\t@Input()\n\tset filterTitle(value: string | Observable<string>) {\n\t\tthis._filterTitle.override(value);\n\t}\n\n\tget filterTitle() {\n\t\treturn this._filterTitle.value;\n\t}\n\n\t/**\n\t * Emits an index of the column that wants to be sorted.\n\t */\n\t@Output() sort = new EventEmitter<number>();\n\t/**\n\t * Emits if all rows are selected.\n\t *\n\t * @param model\n\t */\n\t@Output() selectAll = new EventEmitter<TableModel>();\n\t/**\n\t * Emits if all rows are deselected.\n\t *\n\t * @param model\n\t */\n\t@Output() deselectAll = new EventEmitter<TableModel>();\n\n\tpublic scrollbarWidth = 0;\n\n\tprotected _checkboxHeaderLabel = this.i18n.getOverridable(\"TABLE.CHECKBOX_HEADER\");\n\tprotected _sortDescendingLabel = this.i18n.getOverridable(\"TABLE.SORT_DESCENDING\");\n\tprotected _sortAscendingLabel = this.i18n.getOverridable(\"TABLE.SORT_ASCENDING\");\n\tprotected _filterTitle = this.i18n.getOverridable(\"TABLE.FILTER\");\n\n\tconstructor(protected i18n: I18n) {}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.scrollbarWidth = getScrollbarWidth();\n\t\t});\n\t}\n\n\tonSelectAllCheckboxChange() {\n\t\tif (!this.selectAllCheckbox && !this.selectAllCheckboxSomeSelected) {\n\t\t\tthis.selectAll.emit(this.model);\n\t\t} else {\n\t\t\tthis.deselectAll.emit(this.model);\n\t\t}\n\t}\n\n\tgetCheckboxHeaderLabel(): Observable<string> {\n\t\treturn this._checkboxHeaderLabel.subject;\n\t}\n\n\tgetSortDescendingLabel(): Observable<string> {\n\t\treturn this._sortDescendingLabel.subject;\n\t}\n\n\tgetSortAscendingLabel(): Observable<string> {\n\t\treturn this._sortAscendingLabel.subject;\n\t}\n\n\tgetFilterTitle(): Observable<string> {\n\t\treturn this._filterTitle.subject;\n\t}\n}\n",
|
|
55093
55093
|
"assetsDirs": [],
|
|
55094
55094
|
"styleUrlsData": "",
|
|
55095
55095
|
"stylesData": "\n\t\t.cds--table-expand-v2 {\n\t\t\tpadding-left: 2.5rem;\n\t\t}\n\t\n",
|
|
@@ -55106,7 +55106,7 @@
|
|
|
55106
55106
|
"deprecationMessage": ""
|
|
55107
55107
|
}
|
|
55108
55108
|
],
|
|
55109
|
-
"line":
|
|
55109
|
+
"line": 169,
|
|
55110
55110
|
"jsdoctags": [
|
|
55111
55111
|
{
|
|
55112
55112
|
"name": "i18n",
|
|
@@ -55139,7 +55139,7 @@
|
|
|
55139
55139
|
}
|
|
55140
55140
|
],
|
|
55141
55141
|
"returnType": "void",
|
|
55142
|
-
"line":
|
|
55142
|
+
"line": 112,
|
|
55143
55143
|
"jsdoctags": [
|
|
55144
55144
|
{
|
|
55145
55145
|
"name": "value",
|
|
@@ -55156,7 +55156,7 @@
|
|
|
55156
55156
|
"name": "checkboxHeaderLabel",
|
|
55157
55157
|
"type": "",
|
|
55158
55158
|
"returnType": "",
|
|
55159
|
-
"line":
|
|
55159
|
+
"line": 116
|
|
55160
55160
|
}
|
|
55161
55161
|
},
|
|
55162
55162
|
"sortDescendingLabel": {
|
|
@@ -55175,7 +55175,7 @@
|
|
|
55175
55175
|
}
|
|
55176
55176
|
],
|
|
55177
55177
|
"returnType": "void",
|
|
55178
|
-
"line":
|
|
55178
|
+
"line": 121,
|
|
55179
55179
|
"jsdoctags": [
|
|
55180
55180
|
{
|
|
55181
55181
|
"name": "value",
|
|
@@ -55192,7 +55192,7 @@
|
|
|
55192
55192
|
"name": "sortDescendingLabel",
|
|
55193
55193
|
"type": "",
|
|
55194
55194
|
"returnType": "",
|
|
55195
|
-
"line":
|
|
55195
|
+
"line": 125
|
|
55196
55196
|
}
|
|
55197
55197
|
},
|
|
55198
55198
|
"sortAscendingLabel": {
|
|
@@ -55211,7 +55211,7 @@
|
|
|
55211
55211
|
}
|
|
55212
55212
|
],
|
|
55213
55213
|
"returnType": "void",
|
|
55214
|
-
"line":
|
|
55214
|
+
"line": 130,
|
|
55215
55215
|
"jsdoctags": [
|
|
55216
55216
|
{
|
|
55217
55217
|
"name": "value",
|
|
@@ -55228,7 +55228,7 @@
|
|
|
55228
55228
|
"name": "sortAscendingLabel",
|
|
55229
55229
|
"type": "",
|
|
55230
55230
|
"returnType": "",
|
|
55231
|
-
"line":
|
|
55231
|
+
"line": 134
|
|
55232
55232
|
}
|
|
55233
55233
|
},
|
|
55234
55234
|
"filterTitle": {
|
|
@@ -55247,7 +55247,7 @@
|
|
|
55247
55247
|
}
|
|
55248
55248
|
],
|
|
55249
55249
|
"returnType": "void",
|
|
55250
|
-
"line":
|
|
55250
|
+
"line": 139,
|
|
55251
55251
|
"jsdoctags": [
|
|
55252
55252
|
{
|
|
55253
55253
|
"name": "value",
|
|
@@ -55264,7 +55264,7 @@
|
|
|
55264
55264
|
"name": "filterTitle",
|
|
55265
55265
|
"type": "",
|
|
55266
55266
|
"returnType": "",
|
|
55267
|
-
"line":
|
|
55267
|
+
"line": 143
|
|
55268
55268
|
}
|
|
55269
55269
|
}
|
|
55270
55270
|
}
|
|
@@ -56020,7 +56020,7 @@
|
|
|
56020
56020
|
},
|
|
56021
56021
|
{
|
|
56022
56022
|
"name": "TableRadio",
|
|
56023
|
-
"id": "component-TableRadio-
|
|
56023
|
+
"id": "component-TableRadio-3efc3af9bbed3a84b40694053282346adf91a4efa2ce1669f7f10a66099534fdcf49a3fd05e094ddced37922d206fa5c0b75f0503428860d737373f03eccd698",
|
|
56024
56024
|
"file": "src/table/cell/table-radio.component.ts",
|
|
56025
56025
|
"encapsulation": [],
|
|
56026
56026
|
"entryComponents": [],
|
|
@@ -56039,7 +56039,7 @@
|
|
|
56039
56039
|
"name": "label",
|
|
56040
56040
|
"deprecated": false,
|
|
56041
56041
|
"deprecationMessage": "",
|
|
56042
|
-
"line":
|
|
56042
|
+
"line": 33,
|
|
56043
56043
|
"type": "string | Observable",
|
|
56044
56044
|
"decorators": []
|
|
56045
56045
|
},
|
|
@@ -56047,7 +56047,7 @@
|
|
|
56047
56047
|
"name": "row",
|
|
56048
56048
|
"deprecated": false,
|
|
56049
56049
|
"deprecationMessage": "",
|
|
56050
|
-
"line":
|
|
56050
|
+
"line": 28,
|
|
56051
56051
|
"type": "any[]",
|
|
56052
56052
|
"decorators": []
|
|
56053
56053
|
},
|
|
@@ -56056,7 +56056,7 @@
|
|
|
56056
56056
|
"defaultValue": "false",
|
|
56057
56057
|
"deprecated": false,
|
|
56058
56058
|
"deprecationMessage": "",
|
|
56059
|
-
"line":
|
|
56059
|
+
"line": 30,
|
|
56060
56060
|
"type": "boolean",
|
|
56061
56061
|
"decorators": []
|
|
56062
56062
|
},
|
|
@@ -56066,7 +56066,7 @@
|
|
|
56066
56066
|
"deprecationMessage": "",
|
|
56067
56067
|
"rawdescription": "\n\nUsed to populate the row selection checkbox label with a useful value if set.\n\nExample:\n```\n<cds-table [selectionLabelColumn]=\"0\"></cds-table>\n<!-- results in aria-label=\"Select first column value\"\n(where \"first column value\" is the value of the first column in the row -->\n```\n",
|
|
56068
56068
|
"description": "<p>Used to populate the row selection checkbox label with a useful value if set.</p>\n<p>Example:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-none\"><cds-table [selectionLabelColumn]="0"></cds-table>\n<!-- results in aria-label="Select first column value"\n(where "first column value" is the value of the first column in the row --></code></pre></div>",
|
|
56069
|
-
"line":
|
|
56069
|
+
"line": 58,
|
|
56070
56070
|
"type": "number",
|
|
56071
56071
|
"decorators": []
|
|
56072
56072
|
},
|
|
@@ -56075,7 +56075,7 @@
|
|
|
56075
56075
|
"defaultValue": "false",
|
|
56076
56076
|
"deprecated": false,
|
|
56077
56077
|
"deprecationMessage": "",
|
|
56078
|
-
"line":
|
|
56078
|
+
"line": 60,
|
|
56079
56079
|
"type": "boolean",
|
|
56080
56080
|
"decorators": []
|
|
56081
56081
|
}
|
|
@@ -56088,11 +56088,50 @@
|
|
|
56088
56088
|
"deprecationMessage": "",
|
|
56089
56089
|
"rawdescription": "\n\nEmits if a single row is selected.\n",
|
|
56090
56090
|
"description": "<p>Emits if a single row is selected.</p>\n",
|
|
56091
|
-
"line":
|
|
56091
|
+
"line": 65,
|
|
56092
56092
|
"type": "EventEmitter"
|
|
56093
56093
|
}
|
|
56094
56094
|
],
|
|
56095
|
-
"propertiesClass": [
|
|
56095
|
+
"propertiesClass": [
|
|
56096
|
+
{
|
|
56097
|
+
"name": "radioColumn",
|
|
56098
|
+
"defaultValue": "true",
|
|
56099
|
+
"deprecated": false,
|
|
56100
|
+
"deprecationMessage": "",
|
|
56101
|
+
"type": "",
|
|
56102
|
+
"optional": false,
|
|
56103
|
+
"description": "",
|
|
56104
|
+
"line": 45,
|
|
56105
|
+
"decorators": [
|
|
56106
|
+
{
|
|
56107
|
+
"name": "HostBinding",
|
|
56108
|
+
"stringifiedArguments": "'class.cds--table-column-radio'"
|
|
56109
|
+
}
|
|
56110
|
+
],
|
|
56111
|
+
"modifierKind": [
|
|
56112
|
+
167
|
|
56113
|
+
]
|
|
56114
|
+
},
|
|
56115
|
+
{
|
|
56116
|
+
"name": "selectableColumn",
|
|
56117
|
+
"defaultValue": "true",
|
|
56118
|
+
"deprecated": false,
|
|
56119
|
+
"deprecationMessage": "",
|
|
56120
|
+
"type": "",
|
|
56121
|
+
"optional": false,
|
|
56122
|
+
"description": "",
|
|
56123
|
+
"line": 46,
|
|
56124
|
+
"decorators": [
|
|
56125
|
+
{
|
|
56126
|
+
"name": "HostBinding",
|
|
56127
|
+
"stringifiedArguments": "'class.cds--table-column-checkbox'"
|
|
56128
|
+
}
|
|
56129
|
+
],
|
|
56130
|
+
"modifierKind": [
|
|
56131
|
+
167
|
|
56132
|
+
]
|
|
56133
|
+
}
|
|
56134
|
+
],
|
|
56096
56135
|
"methodsClass": [
|
|
56097
56136
|
{
|
|
56098
56137
|
"name": "getLabel",
|
|
@@ -56100,7 +56139,7 @@
|
|
|
56100
56139
|
"optional": false,
|
|
56101
56140
|
"returnType": "Observable<string>",
|
|
56102
56141
|
"typeParameters": [],
|
|
56103
|
-
"line":
|
|
56142
|
+
"line": 78,
|
|
56104
56143
|
"deprecated": false,
|
|
56105
56144
|
"deprecationMessage": ""
|
|
56106
56145
|
},
|
|
@@ -56117,7 +56156,7 @@
|
|
|
56117
56156
|
"optional": false,
|
|
56118
56157
|
"returnType": "{ value: any; }",
|
|
56119
56158
|
"typeParameters": [],
|
|
56120
|
-
"line":
|
|
56159
|
+
"line": 71,
|
|
56121
56160
|
"deprecated": false,
|
|
56122
56161
|
"deprecationMessage": "",
|
|
56123
56162
|
"jsdoctags": [
|
|
@@ -56135,14 +56174,33 @@
|
|
|
56135
56174
|
],
|
|
56136
56175
|
"deprecated": false,
|
|
56137
56176
|
"deprecationMessage": "",
|
|
56138
|
-
"hostBindings": [
|
|
56177
|
+
"hostBindings": [
|
|
56178
|
+
{
|
|
56179
|
+
"name": "class.cds--table-column-checkbox",
|
|
56180
|
+
"defaultValue": "true",
|
|
56181
|
+
"deprecated": false,
|
|
56182
|
+
"deprecationMessage": "",
|
|
56183
|
+
"line": 46,
|
|
56184
|
+
"type": "boolean",
|
|
56185
|
+
"decorators": []
|
|
56186
|
+
},
|
|
56187
|
+
{
|
|
56188
|
+
"name": "class.cds--table-column-radio",
|
|
56189
|
+
"defaultValue": "true",
|
|
56190
|
+
"deprecated": false,
|
|
56191
|
+
"deprecationMessage": "",
|
|
56192
|
+
"line": 45,
|
|
56193
|
+
"type": "boolean",
|
|
56194
|
+
"decorators": []
|
|
56195
|
+
}
|
|
56196
|
+
],
|
|
56139
56197
|
"hostListeners": [],
|
|
56140
56198
|
"standalone": false,
|
|
56141
56199
|
"imports": [],
|
|
56142
56200
|
"description": "",
|
|
56143
56201
|
"rawdescription": "\n",
|
|
56144
56202
|
"type": "component",
|
|
56145
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableRow } from \"../table-row.class\";\nimport { Observable } from \"rxjs\";\n\n@Component({\n\t// tslint:disable-next-line: component-selector\n\tselector: \"[cdsTableRadio], [ibmTableRadio]\",\n\ttemplate: `\n\t\t<cds-radio\n\t\t\t*ngIf=\"!skeleton\"\n\t\t\t[attr.aria-label]=\"getLabel() | i18nReplace:getSelectionLabelValue(row) | async\"\n\t\t\t[ariaLabel]=\"getLabel() | i18nReplace:getSelectionLabelValue(row) | async\"\n\t\t\t[checked]=\"selected\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(change)=\"change.emit()\">\n\t\t</cds-radio>\n\t`\n})\nexport class TableRadio {\n\t@Input() row: any[];\n\n\t@Input() selected = false;\n\n\t@Input()\n\tset label(value: string | Observable<string>) {\n\t\tthis._label.override(value);\n\t}\n\n\tget label() {\n\t\treturn this._label.value;\n\t}\n\n\tget disabled(): boolean {\n\t\treturn this.row ? !!(this.row as TableRow).disabled : false;\n\t}\n\n\t/**\n\t * Used to populate the row selection checkbox label with a useful value if set.\n\t *\n\t * Example:\n\t * ```\n\t * <cds-table [selectionLabelColumn]=\"0\"></cds-table>\n\t * <!-- results in aria-label=\"Select first column value\"\n\t * (where \"first column value\" is the value of the first column in the row -->\n\t * ```\n\t */\n\t@Input() selectionLabelColumn: number;\n\n\t@Input() skeleton = false;\n\n\t/**\n\t * Emits if a single row is selected.\n\t */\n\t@Output() change = new EventEmitter();\n\n\tprotected _label = this.i18n.getOverridable(\"TABLE.CHECKBOX_ROW\");\n\n\tconstructor(protected i18n: I18n) { }\n\n\tgetSelectionLabelValue(row: TableItem[]) {\n\t\tif (!this.selectionLabelColumn) {\n\t\t\treturn { value: this.i18n.get().TABLE.ROW };\n\t\t}\n\t\treturn { value: row[this.selectionLabelColumn].data };\n\t}\n\n\tgetLabel(): Observable<string> {\n\t\treturn this._label.subject;\n\t}\n}\n",
|
|
56203
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tHostBinding\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\nimport { TableItem } from \"../table-item.class\";\nimport { TableRow } from \"../table-row.class\";\nimport { Observable } from \"rxjs\";\n\n@Component({\n\t// tslint:disable-next-line: component-selector\n\tselector: \"[cdsTableRadio], [ibmTableRadio]\",\n\ttemplate: `\n\t\t<cds-radio\n\t\t\t*ngIf=\"!skeleton\"\n\t\t\t[attr.aria-label]=\"getLabel() | i18nReplace:getSelectionLabelValue(row) | async\"\n\t\t\t[ariaLabel]=\"getLabel() | i18nReplace:getSelectionLabelValue(row) | async\"\n\t\t\t[checked]=\"selected\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(change)=\"change.emit()\">\n\t\t</cds-radio>\n\t`\n})\nexport class TableRadio {\n\t@Input() row: any[];\n\n\t@Input() selected = false;\n\n\t@Input()\n\tset label(value: string | Observable<string>) {\n\t\tthis._label.override(value);\n\t}\n\n\tget label() {\n\t\treturn this._label.value;\n\t}\n\n\tget disabled(): boolean {\n\t\treturn this.row ? !!(this.row as TableRow).disabled : false;\n\t}\n\n\t@HostBinding(\"class.cds--table-column-radio\") radioColumn = true;\n\t@HostBinding(\"class.cds--table-column-checkbox\") selectableColumn = true;\n\n\t/**\n\t * Used to populate the row selection checkbox label with a useful value if set.\n\t *\n\t * Example:\n\t * ```\n\t * <cds-table [selectionLabelColumn]=\"0\"></cds-table>\n\t * <!-- results in aria-label=\"Select first column value\"\n\t * (where \"first column value\" is the value of the first column in the row -->\n\t * ```\n\t */\n\t@Input() selectionLabelColumn: number;\n\n\t@Input() skeleton = false;\n\n\t/**\n\t * Emits if a single row is selected.\n\t */\n\t@Output() change = new EventEmitter();\n\n\tprotected _label = this.i18n.getOverridable(\"TABLE.CHECKBOX_ROW\");\n\n\tconstructor(protected i18n: I18n) { }\n\n\tgetSelectionLabelValue(row: TableItem[]) {\n\t\tif (!this.selectionLabelColumn) {\n\t\t\treturn { value: this.i18n.get().TABLE.ROW };\n\t\t}\n\t\treturn { value: row[this.selectionLabelColumn].data };\n\t}\n\n\tgetLabel(): Observable<string> {\n\t\treturn this._label.subject;\n\t}\n}\n",
|
|
56146
56204
|
"assetsDirs": [],
|
|
56147
56205
|
"styleUrlsData": "",
|
|
56148
56206
|
"stylesData": "",
|
|
@@ -56159,7 +56217,7 @@
|
|
|
56159
56217
|
"deprecationMessage": ""
|
|
56160
56218
|
}
|
|
56161
56219
|
],
|
|
56162
|
-
"line":
|
|
56220
|
+
"line": 67,
|
|
56163
56221
|
"jsdoctags": [
|
|
56164
56222
|
{
|
|
56165
56223
|
"name": "i18n",
|
|
@@ -56189,7 +56247,7 @@
|
|
|
56189
56247
|
}
|
|
56190
56248
|
],
|
|
56191
56249
|
"returnType": "void",
|
|
56192
|
-
"line":
|
|
56250
|
+
"line": 33,
|
|
56193
56251
|
"jsdoctags": [
|
|
56194
56252
|
{
|
|
56195
56253
|
"name": "value",
|
|
@@ -56206,7 +56264,7 @@
|
|
|
56206
56264
|
"name": "label",
|
|
56207
56265
|
"type": "",
|
|
56208
56266
|
"returnType": "",
|
|
56209
|
-
"line":
|
|
56267
|
+
"line": 37
|
|
56210
56268
|
}
|
|
56211
56269
|
},
|
|
56212
56270
|
"disabled": {
|
|
@@ -56215,7 +56273,7 @@
|
|
|
56215
56273
|
"name": "disabled",
|
|
56216
56274
|
"type": "boolean",
|
|
56217
56275
|
"returnType": "boolean",
|
|
56218
|
-
"line":
|
|
56276
|
+
"line": 41
|
|
56219
56277
|
}
|
|
56220
56278
|
}
|
|
56221
56279
|
}
|
|
@@ -63255,7 +63313,7 @@
|
|
|
63255
63313
|
},
|
|
63256
63314
|
{
|
|
63257
63315
|
"name": "Tooltip",
|
|
63258
|
-
"id": "component-Tooltip-
|
|
63316
|
+
"id": "component-Tooltip-b1c765352454aad4aa181bda82fd5c2d5a69acf9bd79cc37cbda796d8f519aa54531712a1d07777e2d2491a211e42f7701143e25fa6d1eef15b960750fafe21b",
|
|
63259
63317
|
"file": "src/tooltip/tooltip.component.ts",
|
|
63260
63318
|
"changeDetection": "ChangeDetectionStrategy.OnPush",
|
|
63261
63319
|
"encapsulation": [],
|
|
@@ -63277,7 +63335,7 @@
|
|
|
63277
63335
|
"deprecationMessage": "",
|
|
63278
63336
|
"rawdescription": "\n\nThe string or template content to be exposed by the tooltip.\n",
|
|
63279
63337
|
"description": "<p>The string or template content to be exposed by the tooltip.</p>\n",
|
|
63280
|
-
"line":
|
|
63338
|
+
"line": 73,
|
|
63281
63339
|
"type": "string | TemplateRef<any>",
|
|
63282
63340
|
"decorators": []
|
|
63283
63341
|
},
|
|
@@ -63288,7 +63346,7 @@
|
|
|
63288
63346
|
"deprecationMessage": "",
|
|
63289
63347
|
"rawdescription": "\n\nPrevent tooltip from showing, used by icon button\n",
|
|
63290
63348
|
"description": "<p>Prevent tooltip from showing, used by icon button</p>\n",
|
|
63291
|
-
"line":
|
|
63349
|
+
"line": 69,
|
|
63292
63350
|
"type": "boolean",
|
|
63293
63351
|
"decorators": []
|
|
63294
63352
|
},
|
|
@@ -63299,7 +63357,7 @@
|
|
|
63299
63357
|
"deprecationMessage": "",
|
|
63300
63358
|
"rawdescription": "\n\nSet delay before tooltip is shown\n",
|
|
63301
63359
|
"description": "<p>Set delay before tooltip is shown</p>\n",
|
|
63302
|
-
"line":
|
|
63360
|
+
"line": 61,
|
|
63303
63361
|
"type": "number",
|
|
63304
63362
|
"decorators": []
|
|
63305
63363
|
},
|
|
@@ -63308,7 +63366,7 @@
|
|
|
63308
63366
|
"defaultValue": "`tooltip-${Tooltip.tooltipCount++}`",
|
|
63309
63367
|
"deprecated": false,
|
|
63310
63368
|
"deprecationMessage": "",
|
|
63311
|
-
"line":
|
|
63369
|
+
"line": 57,
|
|
63312
63370
|
"type": "string",
|
|
63313
63371
|
"decorators": []
|
|
63314
63372
|
},
|
|
@@ -63319,7 +63377,7 @@
|
|
|
63319
63377
|
"deprecationMessage": "",
|
|
63320
63378
|
"rawdescription": "\n\nSet delay when tooltip disappears\n",
|
|
63321
63379
|
"description": "<p>Set delay when tooltip disappears</p>\n",
|
|
63322
|
-
"line":
|
|
63380
|
+
"line": 65,
|
|
63323
63381
|
"type": "number",
|
|
63324
63382
|
"decorators": []
|
|
63325
63383
|
},
|
|
@@ -63329,7 +63387,7 @@
|
|
|
63329
63387
|
"deprecationMessage": "",
|
|
63330
63388
|
"rawdescription": "\n\nOptional data for templates passed as implicit context\n",
|
|
63331
63389
|
"description": "<p>Optional data for templates passed as implicit context</p>\n",
|
|
63332
|
-
"line":
|
|
63390
|
+
"line": 77,
|
|
63333
63391
|
"type": "any",
|
|
63334
63392
|
"decorators": []
|
|
63335
63393
|
},
|
|
@@ -63465,7 +63523,7 @@
|
|
|
63465
63523
|
"type": "",
|
|
63466
63524
|
"optional": false,
|
|
63467
63525
|
"description": "",
|
|
63468
|
-
"line":
|
|
63526
|
+
"line": 55,
|
|
63469
63527
|
"decorators": [
|
|
63470
63528
|
{
|
|
63471
63529
|
"name": "HostBinding",
|
|
@@ -63484,7 +63542,7 @@
|
|
|
63484
63542
|
"type": "number",
|
|
63485
63543
|
"optional": false,
|
|
63486
63544
|
"description": "",
|
|
63487
|
-
"line":
|
|
63545
|
+
"line": 53,
|
|
63488
63546
|
"modifierKind": [
|
|
63489
63547
|
124
|
|
63490
63548
|
]
|
|
@@ -63496,7 +63554,7 @@
|
|
|
63496
63554
|
"type": "ElementRef<HTMLSpanElement>",
|
|
63497
63555
|
"optional": false,
|
|
63498
63556
|
"description": "",
|
|
63499
|
-
"line":
|
|
63557
|
+
"line": 79,
|
|
63500
63558
|
"decorators": [
|
|
63501
63559
|
{
|
|
63502
63560
|
"name": "ViewChild",
|
|
@@ -63573,7 +63631,7 @@
|
|
|
63573
63631
|
"optional": false,
|
|
63574
63632
|
"returnType": "void",
|
|
63575
63633
|
"typeParameters": [],
|
|
63576
|
-
"line":
|
|
63634
|
+
"line": 124,
|
|
63577
63635
|
"deprecated": false,
|
|
63578
63636
|
"deprecationMessage": "",
|
|
63579
63637
|
"decorators": [
|
|
@@ -63610,7 +63668,7 @@
|
|
|
63610
63668
|
"optional": false,
|
|
63611
63669
|
"returnType": "void",
|
|
63612
63670
|
"typeParameters": [],
|
|
63613
|
-
"line":
|
|
63671
|
+
"line": 129,
|
|
63614
63672
|
"deprecated": false,
|
|
63615
63673
|
"deprecationMessage": "",
|
|
63616
63674
|
"decorators": [
|
|
@@ -63647,7 +63705,7 @@
|
|
|
63647
63705
|
"optional": false,
|
|
63648
63706
|
"returnType": "void",
|
|
63649
63707
|
"typeParameters": [],
|
|
63650
|
-
"line":
|
|
63708
|
+
"line": 115,
|
|
63651
63709
|
"deprecated": false,
|
|
63652
63710
|
"deprecationMessage": "",
|
|
63653
63711
|
"decorators": [
|
|
@@ -63684,7 +63742,7 @@
|
|
|
63684
63742
|
"optional": false,
|
|
63685
63743
|
"returnType": "boolean",
|
|
63686
63744
|
"typeParameters": [],
|
|
63687
|
-
"line":
|
|
63745
|
+
"line": 133,
|
|
63688
63746
|
"deprecated": false,
|
|
63689
63747
|
"deprecationMessage": "",
|
|
63690
63748
|
"jsdoctags": [
|
|
@@ -63712,7 +63770,7 @@
|
|
|
63712
63770
|
"optional": false,
|
|
63713
63771
|
"returnType": "void",
|
|
63714
63772
|
"typeParameters": [],
|
|
63715
|
-
"line":
|
|
63773
|
+
"line": 95,
|
|
63716
63774
|
"deprecated": false,
|
|
63717
63775
|
"deprecationMessage": "",
|
|
63718
63776
|
"decorators": [
|
|
@@ -63749,7 +63807,7 @@
|
|
|
63749
63807
|
"optional": false,
|
|
63750
63808
|
"returnType": "void",
|
|
63751
63809
|
"typeParameters": [],
|
|
63752
|
-
"line":
|
|
63810
|
+
"line": 105,
|
|
63753
63811
|
"deprecated": false,
|
|
63754
63812
|
"deprecationMessage": "",
|
|
63755
63813
|
"decorators": [
|
|
@@ -64001,7 +64059,7 @@
|
|
|
64001
64059
|
"defaultValue": "true",
|
|
64002
64060
|
"deprecated": false,
|
|
64003
64061
|
"deprecationMessage": "",
|
|
64004
|
-
"line":
|
|
64062
|
+
"line": 55,
|
|
64005
64063
|
"type": "boolean",
|
|
64006
64064
|
"decorators": []
|
|
64007
64065
|
},
|
|
@@ -64034,7 +64092,7 @@
|
|
|
64034
64092
|
],
|
|
64035
64093
|
"deprecated": false,
|
|
64036
64094
|
"deprecationMessage": "",
|
|
64037
|
-
"line":
|
|
64095
|
+
"line": 124
|
|
64038
64096
|
},
|
|
64039
64097
|
{
|
|
64040
64098
|
"name": "focusout",
|
|
@@ -64051,7 +64109,7 @@
|
|
|
64051
64109
|
],
|
|
64052
64110
|
"deprecated": false,
|
|
64053
64111
|
"deprecationMessage": "",
|
|
64054
|
-
"line":
|
|
64112
|
+
"line": 129
|
|
64055
64113
|
},
|
|
64056
64114
|
{
|
|
64057
64115
|
"name": "keyup",
|
|
@@ -64068,7 +64126,7 @@
|
|
|
64068
64126
|
],
|
|
64069
64127
|
"deprecated": false,
|
|
64070
64128
|
"deprecationMessage": "",
|
|
64071
|
-
"line":
|
|
64129
|
+
"line": 115
|
|
64072
64130
|
},
|
|
64073
64131
|
{
|
|
64074
64132
|
"name": "mouseenter",
|
|
@@ -64085,7 +64143,7 @@
|
|
|
64085
64143
|
],
|
|
64086
64144
|
"deprecated": false,
|
|
64087
64145
|
"deprecationMessage": "",
|
|
64088
|
-
"line":
|
|
64146
|
+
"line": 95
|
|
64089
64147
|
},
|
|
64090
64148
|
{
|
|
64091
64149
|
"name": "mouseleave",
|
|
@@ -64102,7 +64160,7 @@
|
|
|
64102
64160
|
],
|
|
64103
64161
|
"deprecated": false,
|
|
64104
64162
|
"deprecationMessage": "",
|
|
64105
|
-
"line":
|
|
64163
|
+
"line": 105
|
|
64106
64164
|
}
|
|
64107
64165
|
],
|
|
64108
64166
|
"standalone": false,
|
|
@@ -64110,7 +64168,7 @@
|
|
|
64110
64168
|
"description": "<p>Get started with importing the module:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { TooltipModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-tooltip--basic\">See demo</a></p>\n",
|
|
64111
64169
|
"rawdescription": "\n\nGet started with importing the module:\n\n```typescript\nimport { TooltipModule } from 'carbon-components-angular';\n```\n\n[See demo](../../?path=/story/components-tooltip--basic)\n",
|
|
64112
64170
|
"type": "component",
|
|
64113
|
-
"sourceCode": "import {\n\tAfterContentChecked,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tHostBinding,\n\tHostListener,\n\tInput,\n\tNgZone,\n\tRenderer2,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { PopoverContainer } from \"carbon-components-angular/popover\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TooltipModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tooltip--basic)\n */\n@Component({\n\tselector: \"cds-tooltip, ibm-tooltip\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `\n\t\t<span #contentWrapper>\n\t\t\t<ng-content></ng-content>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"description\"\n\t\t\tclass=\"cds--popover\"\n\t\t\t[id]=\"id\"\n\t\t\t[attr.aria-hidden]=\"!isOpen\"\n\t\t\trole=\"tooltip\">\n\t\t\t<ng-container *ngIf=\"!disabled\">\n\t\t\t\t<span class=\"cds--popover-content cds--tooltip-content\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(description)\">{{description}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(description)\" [ngTemplateOutlet]=\"description\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\"></ng-template>\n\t\t\t\t\t<span *ngIf=\"autoAlign\" class=\"cds--popover-caret cds--popover--auto-align\"></span>\n\t\t\t\t</span>\n\t\t\t\t<span *ngIf=\"!autoAlign\" class=\"cds--popover-caret\"></span>\n\t\t\t</ng-container>\n\t\t</span>\n\t`\n})\nexport class Tooltip extends PopoverContainer implements AfterContentChecked {\n\tstatic tooltipCount = 0;\n\n\t@HostBinding(\"class.cds--tooltip\") tooltipClass = true;\n\n\t@Input() id = `tooltip-${Tooltip.tooltipCount++}`;\n\t/**\n\t * Set delay before tooltip is shown\n\t */\n\t@Input() enterDelayMs = 100;\n\t/**\n\t * Set delay when tooltip disappears\n\t */\n\t@Input() leaveDelayMs = 300;\n\t/**\n\t * Prevent tooltip from showing, used by icon button\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * The string or template content to be exposed by the tooltip.\n\t */\n\t@Input() description: string | TemplateRef<any>;\n\t/**\n\t * Optional data for templates passed as implicit context\n\t */\n\t@Input() templateContext: any;\n\n\t@ViewChild(\"contentWrapper\") wrapper: ElementRef<HTMLSpanElement>;\n\n\tprivate timeoutId: any; // it should be number, but setTimeout below is matching the NodeJs type instead of the JS type\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected ngZone: NgZone,\n\t\tprotected renderer: Renderer2,\n\t\tprotected changeDetectorRef: ChangeDetectorRef\n\t) {\n\t\tsuper(elementRef, ngZone, renderer, changeDetectorRef);\n\t\tthis.highContrast = true;\n\t\tthis.dropShadow = false;\n\t}\n\n\t@HostListener(\"mouseenter\", [\"$event\"])\n\tmouseenter(event) {\n\t\t// If a mouseleave is triggered before the tooltip is displayed (before setTimeout of mouseenter completes)\n\t\t// we trigger the mouseleave only avoiding having to unecessary show the tooltip\n\t\tclearTimeout(this.timeoutId);\n\t\tthis.timeoutId = setTimeout(() => {\n\t\t\tthis.handleChange(true, event);\n\t\t}, this.enterDelayMs);\n\t}\n\n\t@HostListener(\"mouseleave\", [\"$event\"])\n\tmouseleave(event) {\n\t\t// If a mouseleave is triggered before the tooltip is displayed (before setTimeout of mouseenter completes)\n\t\t// we trigger the mouseleave only avoiding having to unecessary show the tooltip\n\t\tclearTimeout(this.timeoutId);\n\t\tthis.timeoutId = setTimeout(() => {\n\t\t\tthis.handleChange(false, event);\n\t\t}, this.leaveDelayMs);\n\t}\n\n\t@HostListener(\"keyup\", [\"$event\"])\n\thostkeys(event: KeyboardEvent) {\n\t\tif (open && event.key === \"Escape\") {\n\t\t\tevent.stopPropagation();\n\t\t\tthis.handleChange(false, event);\n\t\t}\n\t}\n\n\t// We are not focusing on entire popover, only the trigger\n\t@HostListener(\"focusin\", [\"$event\"])\n\thandleFocus(event: Event) {\n\t\tthis.handleChange(true, event);\n\t}\n\n\t@HostListener(\"focusout\", [\"$event\"])\n\thandleFocusOut(event: Event) {\n\t\tthis.handleChange(false, event);\n\t}\n\n\tisTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Check for any changes in the projected content & apply accessibility attribute if needed\n\t */\n\tngAfterContentChecked() {\n\t\tif (this.wrapper) {\n\t\t\tconst buttonElement = this.wrapper.nativeElement.querySelector(\"button\");\n\t\t\tif (buttonElement && !buttonElement.getAttribute(\"aria-labelledby\")) {\n\t\t\t\tbuttonElement.setAttribute(\"aria-labelledby\", this.id);\n\t\t\t}\n\t\t}\n\t}\n}\n",
|
|
64171
|
+
"sourceCode": "import {\n\tAfterContentChecked,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tHostBinding,\n\tHostListener,\n\tInput,\n\tNgZone,\n\tOnChanges,\n\tRenderer2,\n\tSimpleChanges,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { PopoverContainer } from \"carbon-components-angular/popover\";\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { TooltipModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-tooltip--basic)\n */\n@Component({\n\tselector: \"cds-tooltip, ibm-tooltip\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\ttemplate: `\n\t\t<span #contentWrapper>\n\t\t\t<ng-content></ng-content>\n\t\t</span>\n\t\t<span\n\t\t\t*ngIf=\"description\"\n\t\t\tclass=\"cds--popover\"\n\t\t\t[id]=\"id\"\n\t\t\t[attr.aria-hidden]=\"!isOpen\"\n\t\t\trole=\"tooltip\">\n\t\t\t<ng-container *ngIf=\"!disabled\">\n\t\t\t\t<span class=\"cds--popover-content cds--tooltip-content\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(description)\">{{description}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(description)\" [ngTemplateOutlet]=\"description\" [ngTemplateOutletContext]=\"{ $implicit: templateContext }\"></ng-template>\n\t\t\t\t\t<span *ngIf=\"autoAlign\" class=\"cds--popover-caret cds--popover--auto-align\"></span>\n\t\t\t\t</span>\n\t\t\t\t<span *ngIf=\"!autoAlign\" class=\"cds--popover-caret\"></span>\n\t\t\t</ng-container>\n\t\t</span>\n\t`\n})\nexport class Tooltip extends PopoverContainer implements OnChanges, AfterContentChecked {\n\tstatic tooltipCount = 0;\n\n\t@HostBinding(\"class.cds--tooltip\") tooltipClass = true;\n\n\t@Input() id = `tooltip-${Tooltip.tooltipCount++}`;\n\t/**\n\t * Set delay before tooltip is shown\n\t */\n\t@Input() enterDelayMs = 100;\n\t/**\n\t * Set delay when tooltip disappears\n\t */\n\t@Input() leaveDelayMs = 300;\n\t/**\n\t * Prevent tooltip from showing, used by icon button\n\t */\n\t@Input() disabled = false;\n\t/**\n\t * The string or template content to be exposed by the tooltip.\n\t */\n\t@Input() description: string | TemplateRef<any>;\n\t/**\n\t * Optional data for templates passed as implicit context\n\t */\n\t@Input() templateContext: any;\n\n\t@ViewChild(\"contentWrapper\") wrapper: ElementRef<HTMLSpanElement>;\n\n\tprivate timeoutId: any; // it should be number, but setTimeout below is matching the NodeJs type instead of the JS type\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected ngZone: NgZone,\n\t\tprotected renderer: Renderer2,\n\t\tprotected changeDetectorRef: ChangeDetectorRef\n\t) {\n\t\tsuper(elementRef, ngZone, renderer, changeDetectorRef);\n\t\tthis.highContrast = true;\n\t\tthis.dropShadow = false;\n\t}\n\n\t@HostListener(\"mouseenter\", [\"$event\"])\n\tmouseenter(event) {\n\t\t// If a mouseleave is triggered before the tooltip is displayed (before setTimeout of mouseenter completes)\n\t\t// we trigger the mouseleave only avoiding having to unecessary show the tooltip\n\t\tclearTimeout(this.timeoutId);\n\t\tthis.timeoutId = setTimeout(() => {\n\t\t\tthis.handleChange(true, event);\n\t\t}, this.enterDelayMs);\n\t}\n\n\t@HostListener(\"mouseleave\", [\"$event\"])\n\tmouseleave(event) {\n\t\t// If a mouseleave is triggered before the tooltip is displayed (before setTimeout of mouseenter completes)\n\t\t// we trigger the mouseleave only avoiding having to unecessary show the tooltip\n\t\tclearTimeout(this.timeoutId);\n\t\tthis.timeoutId = setTimeout(() => {\n\t\t\tthis.handleChange(false, event);\n\t\t}, this.leaveDelayMs);\n\t}\n\n\t@HostListener(\"keyup\", [\"$event\"])\n\thostkeys(event: KeyboardEvent) {\n\t\tif (open && event.key === \"Escape\") {\n\t\t\tevent.stopPropagation();\n\t\t\tthis.handleChange(false, event);\n\t\t}\n\t}\n\n\t// We are not focusing on entire popover, only the trigger\n\t@HostListener(\"focusin\", [\"$event\"])\n\thandleFocus(event: Event) {\n\t\tthis.handleChange(true, event);\n\t}\n\n\t@HostListener(\"focusout\", [\"$event\"])\n\thandleFocusOut(event: Event) {\n\t\tthis.handleChange(false, event);\n\t}\n\n\tisTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n\n\t/**\n\t * Close the popover and reopen it with updated values without emitting an event\n\t * @param changes\n\t */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\t// Close and reopen the popover, handle alignment/programmatic open/close\n\t\tconst originalState = this.isOpen;\n\t\tthis.handleChange(false);\n\n\t\t// Ignore first change since content is not initialized\n\t\tif ((changes.autoAlign && !changes.autoAlign.firstChange)\n\t\t\t|| (changes.disabled && !changes.disabled.firstChange && !changes.disabled.currentValue)) {\n\t\t\t/**\n\t\t\t * When `disabled` is `true`, popover content node is removed. So when re-enabling `disabled`,\n\t\t\t * we manually update view so querySelector can detect the popover content node.\n\t\t\t * Otherwise, the position of the popover will be incorrect when autoAlign is enabled.\n\t\t\t */\n\t\t\tthis.changeDetectorRef.detectChanges();\n\n\t\t\t// Reset the inline styles\n\t\t\tthis.popoverContentRef = this.elementRef.nativeElement.querySelector(\".cds--popover-content\");\n\t\t\tthis.popoverContentRef.setAttribute(\"style\", \"\");\n\t\t\tthis.caretRef = this.elementRef.nativeElement.querySelector(\"span.cds--popover-caret\");\n\t\t}\n\n\t\tthis.handleChange(originalState);\n\t}\n\n\t/**\n\t * Check for any changes in the projected content & apply accessibility attribute if needed\n\t */\n\tngAfterContentChecked() {\n\t\tif (this.wrapper) {\n\t\t\tconst buttonElement = this.wrapper.nativeElement.querySelector(\"button\");\n\t\t\tif (buttonElement && !buttonElement.getAttribute(\"aria-labelledby\")) {\n\t\t\t\tbuttonElement.setAttribute(\"aria-labelledby\", this.id);\n\t\t\t}\n\t\t}\n\t}\n}\n",
|
|
64114
64172
|
"assetsDirs": [],
|
|
64115
64173
|
"styleUrlsData": "",
|
|
64116
64174
|
"stylesData": "",
|
|
@@ -64145,7 +64203,7 @@
|
|
|
64145
64203
|
"deprecationMessage": ""
|
|
64146
64204
|
}
|
|
64147
64205
|
],
|
|
64148
|
-
"line":
|
|
64206
|
+
"line": 81,
|
|
64149
64207
|
"jsdoctags": [
|
|
64150
64208
|
{
|
|
64151
64209
|
"name": "elementRef",
|
|
@@ -64187,6 +64245,7 @@
|
|
|
64187
64245
|
},
|
|
64188
64246
|
"extends": "PopoverContainer",
|
|
64189
64247
|
"implements": [
|
|
64248
|
+
"OnChanges",
|
|
64190
64249
|
"AfterContentChecked"
|
|
64191
64250
|
]
|
|
64192
64251
|
},
|
|
@@ -69455,7 +69514,7 @@
|
|
|
69455
69514
|
"deprecated": false,
|
|
69456
69515
|
"deprecationMessage": "",
|
|
69457
69516
|
"type": "",
|
|
69458
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"height:3000px\">\n\t\t\tScrolling will update the position of the tooltip:\n\t\t\t<div style=\"position: absolute; top: 500px; left: 500px;\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tbuttonId=\"icon-btn1\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[kind]=\"kind\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t\t\t[
|
|
69517
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"height:3000px\">\n\t\t\tScrolling will update the position of the tooltip:\n\t\t\t<div style=\"position: absolute; top: 500px; left: 500px;\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tbuttonId=\"icon-btn1\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[kind]=\"kind\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[description]=\"description\"\n\t\t\t\t\t(click)=\"onClick($event)\"\n\t\t\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t\t\t</cds-icon-button>\n\t\t\t</div>\n\t\t</div>\n\t`\n})"
|
|
69459
69518
|
},
|
|
69460
69519
|
{
|
|
69461
69520
|
"name": "AutoAlignTemplate",
|
|
@@ -69521,7 +69580,7 @@
|
|
|
69521
69580
|
"name": "Basic",
|
|
69522
69581
|
"ctype": "miscellaneous",
|
|
69523
69582
|
"subtype": "variable",
|
|
69524
|
-
"file": "src/
|
|
69583
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
69525
69584
|
"deprecated": false,
|
|
69526
69585
|
"deprecationMessage": "",
|
|
69527
69586
|
"type": "",
|
|
@@ -69531,7 +69590,7 @@
|
|
|
69531
69590
|
"name": "Basic",
|
|
69532
69591
|
"ctype": "miscellaneous",
|
|
69533
69592
|
"subtype": "variable",
|
|
69534
|
-
"file": "src/button/button.stories.ts",
|
|
69593
|
+
"file": "src/button/button-set.stories.ts",
|
|
69535
69594
|
"deprecated": false,
|
|
69536
69595
|
"deprecationMessage": "",
|
|
69537
69596
|
"type": "",
|
|
@@ -69541,7 +69600,7 @@
|
|
|
69541
69600
|
"name": "Basic",
|
|
69542
69601
|
"ctype": "miscellaneous",
|
|
69543
69602
|
"subtype": "variable",
|
|
69544
|
-
"file": "src/button/
|
|
69603
|
+
"file": "src/button/button.stories.ts",
|
|
69545
69604
|
"deprecated": false,
|
|
69546
69605
|
"deprecationMessage": "",
|
|
69547
69606
|
"type": "",
|
|
@@ -69551,7 +69610,7 @@
|
|
|
69551
69610
|
"name": "Basic",
|
|
69552
69611
|
"ctype": "miscellaneous",
|
|
69553
69612
|
"subtype": "variable",
|
|
69554
|
-
"file": "src/
|
|
69613
|
+
"file": "src/button/icon-button.stories.ts",
|
|
69555
69614
|
"deprecated": false,
|
|
69556
69615
|
"deprecationMessage": "",
|
|
69557
69616
|
"type": "",
|
|
@@ -72203,41 +72262,41 @@
|
|
|
72203
72262
|
"name": "Template",
|
|
72204
72263
|
"ctype": "miscellaneous",
|
|
72205
72264
|
"subtype": "variable",
|
|
72206
|
-
"file": "src/
|
|
72265
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
72207
72266
|
"deprecated": false,
|
|
72208
72267
|
"deprecationMessage": "",
|
|
72209
72268
|
"type": "",
|
|
72210
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
72269
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
72211
72270
|
},
|
|
72212
72271
|
{
|
|
72213
72272
|
"name": "Template",
|
|
72214
72273
|
"ctype": "miscellaneous",
|
|
72215
72274
|
"subtype": "variable",
|
|
72216
|
-
"file": "src/button/button.stories.ts",
|
|
72275
|
+
"file": "src/button/button-set.stories.ts",
|
|
72217
72276
|
"deprecated": false,
|
|
72218
72277
|
"deprecationMessage": "",
|
|
72219
72278
|
"type": "",
|
|
72220
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button
|
|
72279
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
72221
72280
|
},
|
|
72222
72281
|
{
|
|
72223
72282
|
"name": "Template",
|
|
72224
72283
|
"ctype": "miscellaneous",
|
|
72225
72284
|
"subtype": "variable",
|
|
72226
|
-
"file": "src/button/
|
|
72285
|
+
"file": "src/button/button.stories.ts",
|
|
72227
72286
|
"deprecated": false,
|
|
72228
72287
|
"deprecationMessage": "",
|
|
72229
72288
|
"type": "",
|
|
72230
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
72289
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
72231
72290
|
},
|
|
72232
72291
|
{
|
|
72233
72292
|
"name": "Template",
|
|
72234
72293
|
"ctype": "miscellaneous",
|
|
72235
72294
|
"subtype": "variable",
|
|
72236
|
-
"file": "src/
|
|
72295
|
+
"file": "src/button/icon-button.stories.ts",
|
|
72237
72296
|
"deprecated": false,
|
|
72238
72297
|
"deprecationMessage": "",
|
|
72239
72298
|
"type": "",
|
|
72240
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-
|
|
72299
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-icon-button\n\t\t\tbuttonId=\"icon-btn1\"\n\t\t\ttype=\"button\"\n\t\t\t[kind]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[align]=\"align\"\n\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t[buttonAttributes]=\"buttonAttributes\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\tdescription=\"Icon Description\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t</cds-icon-button>\n\t`\n})"
|
|
72241
72300
|
},
|
|
72242
72301
|
{
|
|
72243
72302
|
"name": "Template",
|
|
@@ -75518,7 +75577,7 @@
|
|
|
75518
75577
|
"deprecated": false,
|
|
75519
75578
|
"deprecationMessage": "",
|
|
75520
75579
|
"type": "",
|
|
75521
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"height:3000px\">\n\t\t\tScrolling will update the position of the tooltip:\n\t\t\t<div style=\"position: absolute; top: 500px; left: 500px;\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tbuttonId=\"icon-btn1\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[kind]=\"kind\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t\t\t[
|
|
75580
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"height:3000px\">\n\t\t\tScrolling will update the position of the tooltip:\n\t\t\t<div style=\"position: absolute; top: 500px; left: 500px;\">\n\t\t\t\t<cds-icon-button\n\t\t\t\t\tbuttonId=\"icon-btn1\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t[kind]=\"kind\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[align]=\"align\"\n\t\t\t\t\t[autoAlign]=\"autoAlign\"\n\t\t\t\t\t[isOpen]=\"isOpen\"\n\t\t\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[description]=\"description\"\n\t\t\t\t\t(click)=\"onClick($event)\"\n\t\t\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t\t\t</cds-icon-button>\n\t\t\t</div>\n\t\t</div>\n\t`\n})"
|
|
75522
75581
|
},
|
|
75523
75582
|
{
|
|
75524
75583
|
"name": "Basic",
|
|
@@ -75538,7 +75597,7 @@
|
|
|
75538
75597
|
"deprecated": false,
|
|
75539
75598
|
"deprecationMessage": "",
|
|
75540
75599
|
"type": "",
|
|
75541
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-icon-button\n\t\t\tbuttonId=\"icon-btn1\"\n\t\t\ttype=\"button\"\n\t\t\t[kind]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[align]=\"align\"\n\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t[buttonAttributes]=\"buttonAttributes\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\tdescription=\"Icon Description\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"
|
|
75600
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-icon-button\n\t\t\tbuttonId=\"icon-btn1\"\n\t\t\ttype=\"button\"\n\t\t\t[kind]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[align]=\"align\"\n\t\t\t[buttonNgClass]=\"buttonNgClass\"\n\t\t\t[buttonAttributes]=\"buttonAttributes\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\tdescription=\"Icon Description\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"copy\" size=\"16\"></svg>\n\t\t</cds-icon-button>\n\t`\n})"
|
|
75542
75601
|
},
|
|
75543
75602
|
{
|
|
75544
75603
|
"name": "WithAutoAlign",
|
|
@@ -75993,199 +76052,199 @@
|
|
|
75993
76052
|
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<div style=\"width: 500px\">\n\t\t\t<cds-accordion>\n\t\t\t\t<cds-accordion-item [title]=\"title\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t\t<cds-accordion-item [title]=\"titleWithContext\" [context]=\"{ index: 2 }\" (selected)=\"selected($event)\">\n\t\t\t\t\tLorem ipsum dolor sit amet, \\\n\t\t\t\t\tconsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore \\\n\t\t\t\t\tet dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation \\\n\t\t\t\t\tullamco laboris nisi ut aliquip ex ea commodo consequat.\n\t\t\t\t</cds-accordion-item>\n\t\t\t</cds-accordion>\n\t\t</div>\n\t\t<ng-template #title>\n\t\t\t<p class=\"cds--accordion__title\">Section 1 title</p>\n\t\t</ng-template>\n\t\t<ng-template #titleWithContext let-index=\"index\">\n\t\t\t<p class=\"cds--accordion__title\">Section {{ index }} title</p>\n\t\t</ng-template>\n\t`\n})"
|
|
75994
76053
|
}
|
|
75995
76054
|
],
|
|
75996
|
-
"src/
|
|
76055
|
+
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
75997
76056
|
{
|
|
75998
76057
|
"name": "Basic",
|
|
75999
76058
|
"ctype": "miscellaneous",
|
|
76000
76059
|
"subtype": "variable",
|
|
76001
|
-
"file": "src/
|
|
76060
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76002
76061
|
"deprecated": false,
|
|
76003
76062
|
"deprecationMessage": "",
|
|
76004
76063
|
"type": "",
|
|
76005
76064
|
"defaultValue": "Template.bind({})"
|
|
76006
76065
|
},
|
|
76007
76066
|
{
|
|
76008
|
-
"name": "
|
|
76067
|
+
"name": "breadcrumbItems",
|
|
76009
76068
|
"ctype": "miscellaneous",
|
|
76010
76069
|
"subtype": "variable",
|
|
76011
|
-
"file": "src/
|
|
76070
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76012
76071
|
"deprecated": false,
|
|
76013
76072
|
"deprecationMessage": "",
|
|
76014
|
-
"type": ""
|
|
76015
|
-
|
|
76016
|
-
}
|
|
76017
|
-
],
|
|
76018
|
-
"src/button/button.stories.ts": [
|
|
76073
|
+
"type": ""
|
|
76074
|
+
},
|
|
76019
76075
|
{
|
|
76020
|
-
"name": "
|
|
76076
|
+
"name": "createBreadcrumbItems",
|
|
76021
76077
|
"ctype": "miscellaneous",
|
|
76022
76078
|
"subtype": "variable",
|
|
76023
|
-
"file": "src/
|
|
76079
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76024
76080
|
"deprecated": false,
|
|
76025
76081
|
"deprecationMessage": "",
|
|
76026
76082
|
"type": "",
|
|
76027
|
-
"defaultValue": "
|
|
76083
|
+
"defaultValue": "(count: number, content = \"Breadcrumb\"): Array<BreadcrumbItem> => {\n\tif (breadcrumbItems && count === breadcrumbItems.length) {\n\t\treturn breadcrumbItems;\n\t}\n\tbreadcrumbItems = Array(count).fill(0).map((x, i) => ({\n\t\tcontent: `${content} ${i + 1}`,\n\t\thref: \"#\" + (i + 1)\n\t}));\n\treturn breadcrumbItems;\n}"
|
|
76028
76084
|
},
|
|
76029
76085
|
{
|
|
76030
|
-
"name": "
|
|
76086
|
+
"name": "CurrentPage",
|
|
76031
76087
|
"ctype": "miscellaneous",
|
|
76032
76088
|
"subtype": "variable",
|
|
76033
|
-
"file": "src/
|
|
76089
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76034
76090
|
"deprecated": false,
|
|
76035
76091
|
"deprecationMessage": "",
|
|
76036
76092
|
"type": "",
|
|
76037
|
-
"defaultValue": "(
|
|
76093
|
+
"defaultValue": "CurrentPageTemplate.bind({})"
|
|
76038
76094
|
},
|
|
76039
76095
|
{
|
|
76040
|
-
"name": "
|
|
76096
|
+
"name": "CurrentPageTemplate",
|
|
76041
76097
|
"ctype": "miscellaneous",
|
|
76042
76098
|
"subtype": "variable",
|
|
76043
|
-
"file": "src/
|
|
76099
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76044
76100
|
"deprecated": false,
|
|
76045
76101
|
"deprecationMessage": "",
|
|
76046
76102
|
"type": "",
|
|
76047
|
-
"defaultValue": "
|
|
76103
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item current=\"true\" href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
76048
76104
|
},
|
|
76049
76105
|
{
|
|
76050
|
-
"name": "
|
|
76106
|
+
"name": "Model",
|
|
76051
76107
|
"ctype": "miscellaneous",
|
|
76052
76108
|
"subtype": "variable",
|
|
76053
|
-
"file": "src/
|
|
76109
|
+
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76054
76110
|
"deprecated": false,
|
|
76055
76111
|
"deprecationMessage": "",
|
|
76056
76112
|
"type": "",
|
|
76057
|
-
"defaultValue": "(
|
|
76058
|
-
}
|
|
76059
|
-
],
|
|
76060
|
-
"src/breadcrumb/breadcrumb.stories.ts": [
|
|
76113
|
+
"defaultValue": "ModelTemplate.bind({})"
|
|
76114
|
+
},
|
|
76061
76115
|
{
|
|
76062
|
-
"name": "
|
|
76116
|
+
"name": "ModelTemplate",
|
|
76063
76117
|
"ctype": "miscellaneous",
|
|
76064
76118
|
"subtype": "variable",
|
|
76065
76119
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76066
76120
|
"deprecated": false,
|
|
76067
76121
|
"deprecationMessage": "",
|
|
76068
76122
|
"type": "",
|
|
76069
|
-
"defaultValue": "
|
|
76123
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems\n\t},\n\ttemplate: `\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"createBreadcrumbItems(itemCount, content)\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
76070
76124
|
},
|
|
76071
76125
|
{
|
|
76072
|
-
"name": "
|
|
76126
|
+
"name": "ModelWithTemplate",
|
|
76073
76127
|
"ctype": "miscellaneous",
|
|
76074
76128
|
"subtype": "variable",
|
|
76075
76129
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76076
76130
|
"deprecated": false,
|
|
76077
76131
|
"deprecationMessage": "",
|
|
76078
|
-
"type": ""
|
|
76132
|
+
"type": "",
|
|
76133
|
+
"defaultValue": "ModelWTemplate.bind({})"
|
|
76079
76134
|
},
|
|
76080
76135
|
{
|
|
76081
|
-
"name": "
|
|
76136
|
+
"name": "ModelWTemplate",
|
|
76082
76137
|
"ctype": "miscellaneous",
|
|
76083
76138
|
"subtype": "variable",
|
|
76084
76139
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76085
76140
|
"deprecated": false,
|
|
76086
76141
|
"deprecationMessage": "",
|
|
76087
76142
|
"type": "",
|
|
76088
|
-
"defaultValue": "(
|
|
76143
|
+
"defaultValue": "(args) => ({\n\tprops: {\n\t\t...args,\n\t\tcreateBreadcrumbItems,\n\t\twithTemplate\n\t},\n\ttemplate: `\n\t\t<ng-template #breadcrumbTemplate let-item>\n\t\t\t{{ templateContent }}{{ item.content }}\n\t\t</ng-template>\n\t\t<cds-breadcrumb\n\t\t\t[noTrailingSlash]=\"noTrailingSlash\"\n\t\t\t[threshold]=\"threshold\"\n\t\t\t[items]=\"withTemplate(breadcrumbTemplate, createBreadcrumbItems(itemCount, content))\">\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
76089
76144
|
},
|
|
76090
76145
|
{
|
|
76091
|
-
"name": "
|
|
76146
|
+
"name": "Skeleton",
|
|
76092
76147
|
"ctype": "miscellaneous",
|
|
76093
76148
|
"subtype": "variable",
|
|
76094
76149
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76095
76150
|
"deprecated": false,
|
|
76096
76151
|
"deprecationMessage": "",
|
|
76097
76152
|
"type": "",
|
|
76098
|
-
"defaultValue": "
|
|
76153
|
+
"defaultValue": "WithSkeleton.bind({})"
|
|
76099
76154
|
},
|
|
76100
76155
|
{
|
|
76101
|
-
"name": "
|
|
76156
|
+
"name": "Template",
|
|
76102
76157
|
"ctype": "miscellaneous",
|
|
76103
76158
|
"subtype": "variable",
|
|
76104
76159
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76105
76160
|
"deprecated": false,
|
|
76106
76161
|
"deprecationMessage": "",
|
|
76107
76162
|
"type": "",
|
|
76108
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb>\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item
|
|
76163
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item href=\"#1\">\n\t\t\t\tBreadcrumb 1\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#2\">\n\t\t\t\tBreadcrumb 2\n\t\t\t</cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item href=\"#3\">\n\t\t\t\tBreadcrumb 3\n\t\t\t</cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
76109
76164
|
},
|
|
76110
76165
|
{
|
|
76111
|
-
"name": "
|
|
76166
|
+
"name": "WithSkeleton",
|
|
76112
76167
|
"ctype": "miscellaneous",
|
|
76113
76168
|
"subtype": "variable",
|
|
76114
76169
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76115
76170
|
"deprecated": false,
|
|
76116
76171
|
"deprecationMessage": "",
|
|
76117
76172
|
"type": "",
|
|
76118
|
-
"defaultValue": "
|
|
76173
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-breadcrumb skeleton=\"true\" [noTrailingSlash]=\"noTrailingSlash\">\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t\t<cds-breadcrumb-item></cds-breadcrumb-item>\n\t\t</cds-breadcrumb>\n\t`\n})"
|
|
76119
76174
|
},
|
|
76120
76175
|
{
|
|
76121
|
-
"name": "
|
|
76176
|
+
"name": "withTemplate",
|
|
76122
76177
|
"ctype": "miscellaneous",
|
|
76123
76178
|
"subtype": "variable",
|
|
76124
76179
|
"file": "src/breadcrumb/breadcrumb.stories.ts",
|
|
76125
76180
|
"deprecated": false,
|
|
76126
76181
|
"deprecationMessage": "",
|
|
76127
76182
|
"type": "",
|
|
76128
|
-
"defaultValue": "(
|
|
76129
|
-
}
|
|
76183
|
+
"defaultValue": "(templateRef, items) => items.map(item => Object.assign(item, { template: templateRef }))"
|
|
76184
|
+
}
|
|
76185
|
+
],
|
|
76186
|
+
"src/button/button-set.stories.ts": [
|
|
76130
76187
|
{
|
|
76131
|
-
"name": "
|
|
76188
|
+
"name": "Basic",
|
|
76132
76189
|
"ctype": "miscellaneous",
|
|
76133
76190
|
"subtype": "variable",
|
|
76134
|
-
"file": "src/
|
|
76191
|
+
"file": "src/button/button-set.stories.ts",
|
|
76135
76192
|
"deprecated": false,
|
|
76136
76193
|
"deprecationMessage": "",
|
|
76137
76194
|
"type": "",
|
|
76138
|
-
"defaultValue": "
|
|
76195
|
+
"defaultValue": "Template.bind({})"
|
|
76139
76196
|
},
|
|
76140
76197
|
{
|
|
76141
|
-
"name": "
|
|
76198
|
+
"name": "Template",
|
|
76142
76199
|
"ctype": "miscellaneous",
|
|
76143
76200
|
"subtype": "variable",
|
|
76144
|
-
"file": "src/
|
|
76201
|
+
"file": "src/button/button-set.stories.ts",
|
|
76145
76202
|
"deprecated": false,
|
|
76146
76203
|
"deprecationMessage": "",
|
|
76147
76204
|
"type": "",
|
|
76148
|
-
"defaultValue": "(args) => ({\n\tprops:
|
|
76149
|
-
}
|
|
76205
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-button-set>\n\t\t\t<button cdsButton=\"secondary\" [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t\t<button cdsButton [size]=\"size\" [isExpressive]=\"isExpressive\">Button</button>\n\t\t</cds-button-set>\n\t`\n})"
|
|
76206
|
+
}
|
|
76207
|
+
],
|
|
76208
|
+
"src/button/button.stories.ts": [
|
|
76150
76209
|
{
|
|
76151
|
-
"name": "
|
|
76210
|
+
"name": "Basic",
|
|
76152
76211
|
"ctype": "miscellaneous",
|
|
76153
76212
|
"subtype": "variable",
|
|
76154
|
-
"file": "src/
|
|
76213
|
+
"file": "src/button/button.stories.ts",
|
|
76155
76214
|
"deprecated": false,
|
|
76156
76215
|
"deprecationMessage": "",
|
|
76157
76216
|
"type": "",
|
|
76158
|
-
"defaultValue": "
|
|
76217
|
+
"defaultValue": "Template.bind({})"
|
|
76159
76218
|
},
|
|
76160
76219
|
{
|
|
76161
76220
|
"name": "Template",
|
|
76162
76221
|
"ctype": "miscellaneous",
|
|
76163
76222
|
"subtype": "variable",
|
|
76164
|
-
"file": "src/
|
|
76223
|
+
"file": "src/button/button.stories.ts",
|
|
76165
76224
|
"deprecated": false,
|
|
76166
76225
|
"deprecationMessage": "",
|
|
76167
76226
|
"type": "",
|
|
76168
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<
|
|
76227
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseLeave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tButton\n\t\t</button>\n\t`\n})"
|
|
76169
76228
|
},
|
|
76170
76229
|
{
|
|
76171
|
-
"name": "
|
|
76230
|
+
"name": "WithIcon",
|
|
76172
76231
|
"ctype": "miscellaneous",
|
|
76173
76232
|
"subtype": "variable",
|
|
76174
|
-
"file": "src/
|
|
76233
|
+
"file": "src/button/button.stories.ts",
|
|
76175
76234
|
"deprecated": false,
|
|
76176
76235
|
"deprecationMessage": "",
|
|
76177
76236
|
"type": "",
|
|
76178
|
-
"defaultValue": "(
|
|
76237
|
+
"defaultValue": "WithIconTemplate.bind({})"
|
|
76179
76238
|
},
|
|
76180
76239
|
{
|
|
76181
|
-
"name": "
|
|
76240
|
+
"name": "WithIconTemplate",
|
|
76182
76241
|
"ctype": "miscellaneous",
|
|
76183
76242
|
"subtype": "variable",
|
|
76184
|
-
"file": "src/
|
|
76243
|
+
"file": "src/button/button.stories.ts",
|
|
76185
76244
|
"deprecated": false,
|
|
76186
76245
|
"deprecationMessage": "",
|
|
76187
76246
|
"type": "",
|
|
76188
|
-
"defaultValue": "(
|
|
76247
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<button\n\t\t\t[cdsButton]=\"kind\"\n\t\t\t[size]=\"size\"\n\t\t\t[isExpressive]=\"isExpressive\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t(click)=\"onClick($event)\"\n\t\t\t(mouseenter)=\"onMouseEnter($event)\"\n\t\t\t(mouseleave)=\"onMouseleave($event)\"\n\t\t\t(focus)=\"onFocus($event)\"\n\t\t\t(blur)=\"onBlur($event)\">\n\t\t\tWith icon\n\t\t\t<svg class=\"cds--btn__icon\" cdsIcon=\"add\" size=\"16\"></svg>\n\t\t</button>\n\t`\n})"
|
|
76189
76248
|
}
|
|
76190
76249
|
],
|
|
76191
76250
|
"src/checkbox/checkbox.stories.ts": [
|
|
@@ -85363,8 +85422,8 @@
|
|
|
85363
85422
|
"type": "component",
|
|
85364
85423
|
"linktype": "component",
|
|
85365
85424
|
"name": "TableRadio",
|
|
85366
|
-
"coveragePercent":
|
|
85367
|
-
"coverageCount": "2/
|
|
85425
|
+
"coveragePercent": 14,
|
|
85426
|
+
"coverageCount": "2/14",
|
|
85368
85427
|
"status": "low"
|
|
85369
85428
|
},
|
|
85370
85429
|
{
|