carbon-components-angular 5.35.0 → 5.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/datepicker/datepicker.component.d.ts +2 -1
- package/datepicker-input/datepicker-input.component.d.ts +2 -1
- package/docs/documentation/components/DatePicker.html +147 -100
- package/docs/documentation/components/DatePickerInput.html +66 -33
- package/docs/documentation/coverage.html +4 -4
- package/docs/documentation/js/search/search_index.js +2 -2
- package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ComboBoxModule.html +4 -4
- package/docs/documentation/modules/ContentSwitcherModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
- package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +37 -41
- package/docs/documentation/modules/DatePickerInputModule.html +37 -41
- package/docs/documentation/modules/DatePickerModule/dependencies.svg +38 -38
- package/docs/documentation/modules/DatePickerModule.html +38 -38
- package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
- package/docs/documentation/modules/GridModule.html +60 -60
- package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
- package/docs/documentation/modules/LoadingModule.html +4 -4
- package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NFormsModule.html +4 -4
- package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
- package/docs/documentation/modules/NumberModule.html +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
- package/docs/documentation/modules/RadioModule/dependencies.svg +4 -4
- package/docs/documentation/modules/RadioModule.html +4 -4
- package/docs/documentation/modules/SelectModule/dependencies.svg +58 -58
- package/docs/documentation/modules/SelectModule.html +58 -58
- package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
- package/docs/documentation/modules/SliderModule.html +4 -4
- package/docs/documentation/modules/TableModule/dependencies.svg +216 -216
- package/docs/documentation/modules/TableModule.html +216 -216
- package/docs/documentation/modules/TabsModule/dependencies.svg +69 -69
- package/docs/documentation/modules/TabsModule.html +69 -69
- package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
- package/docs/documentation/modules/ThemeModule.html +4 -4
- package/docs/documentation/modules/TilesModule/dependencies.svg +76 -76
- package/docs/documentation/modules/TilesModule.html +76 -76
- package/docs/documentation/modules/TimePickerModule/dependencies.svg +38 -42
- package/docs/documentation/modules/TimePickerModule.html +38 -42
- package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TimePickerSelectModule.html +4 -4
- package/docs/documentation/modules/ToggleModule/dependencies.svg +45 -41
- package/docs/documentation/modules/ToggleModule.html +45 -41
- package/docs/documentation/modules/ToggletipModule/dependencies.svg +37 -37
- package/docs/documentation/modules/ToggletipModule.html +37 -37
- package/docs/documentation/modules/TooltipModule/dependencies.svg +4 -4
- package/docs/documentation/modules/TooltipModule.html +4 -4
- 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 +124 -106
- package/docs/storybook/datepicker-datepicker-stories.fb6b3054.iframe.bundle.js +1 -0
- package/docs/storybook/iframe.html +2 -2
- package/docs/storybook/main.e57ae153.iframe.bundle.js +1 -0
- package/docs/storybook/project.json +1 -1
- package/docs/storybook/{runtime~main.2666a44e.iframe.bundle.js → runtime~main.58219115.iframe.bundle.js} +1 -1
- package/esm2020/datepicker/datepicker.component.mjs +23 -5
- package/esm2020/datepicker-input/datepicker-input.component.mjs +7 -2
- package/fesm2015/carbon-components-angular-datepicker-input.mjs +6 -1
- package/fesm2015/carbon-components-angular-datepicker-input.mjs.map +1 -1
- package/fesm2015/carbon-components-angular-datepicker.mjs +22 -4
- package/fesm2015/carbon-components-angular-datepicker.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker-input.mjs +6 -1
- package/fesm2020/carbon-components-angular-datepicker-input.mjs.map +1 -1
- package/fesm2020/carbon-components-angular-datepicker.mjs +22 -4
- package/fesm2020/carbon-components-angular-datepicker.mjs.map +1 -1
- package/package.json +1 -1
- package/docs/storybook/datepicker-datepicker-stories.45228636.iframe.bundle.js +0 -1
- package/docs/storybook/main.233cfcc5.iframe.bundle.js +0 -1
package/docs/documentation.json
CHANGED
|
@@ -26045,7 +26045,7 @@
|
|
|
26045
26045
|
},
|
|
26046
26046
|
{
|
|
26047
26047
|
"name": "DatePicker",
|
|
26048
|
-
"id": "component-DatePicker-
|
|
26048
|
+
"id": "component-DatePicker-a9892d8a02464586f07b4c2b78c2482ae7fe6d9db953c263c2f379ab12c68c16c76ee8f303712657ca74313707b1e06a6cd1787fae617ab5ac2b67a09e1ada08",
|
|
26049
26049
|
"file": "src/datepicker/datepicker.component.ts",
|
|
26050
26050
|
"encapsulation": [
|
|
26051
26051
|
"ViewEncapsulation.None"
|
|
@@ -26061,7 +26061,7 @@
|
|
|
26061
26061
|
"selector": "cds-date-picker, ibm-date-picker",
|
|
26062
26062
|
"styleUrls": [],
|
|
26063
26063
|
"styles": [],
|
|
26064
|
-
"template": "<div class=\"cds--form-item\">\n\t<div\n\t\tclass=\"cds--date-picker\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--date-picker--range' : range,\n\t\t\t'cds--date-picker--single' : !range,\n\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t'cds--skeleton' : skeleton\n\t\t}\">\n\t\t<div class=\"cds--date-picker-container\">\n\t\t\t<cds-date-picker-input\n\t\t\t\t#input\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t(click)=\"openCalendar(input)\">\n\t\t\t</cds-date-picker-input>\n\t\t</div>\n\n\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t<cds-date-picker-input\n\t\t\t\t#rangeInput\n\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t(click)=\"openCalendar(rangeInput)\">\n\t\t\t</cds-date-picker-input>\n\t\t</div>\n\t</div>\n</div>\n",
|
|
26064
|
+
"template": "<div class=\"cds--form-item\">\n\t<div\n\t\tclass=\"cds--date-picker\"\n\t\t[ngClass]=\"{\n\t\t\t'cds--date-picker--range' : range,\n\t\t\t'cds--date-picker--single' : !range,\n\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t'cds--skeleton' : skeleton\n\t\t}\">\n\t\t<div class=\"cds--date-picker-container\">\n\t\t\t<cds-date-picker-input\n\t\t\t\t#input\n\t\t\t\t[label]=\"label\"\n\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t[warn]=\"warn\"\n\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t(valueChange)=\"onValueChange($event)\"\n\t\t\t\t(click)=\"openCalendar(input)\">\n\t\t\t</cds-date-picker-input>\n\t\t</div>\n\n\t\t<div *ngIf=\"range\" class=\"cds--date-picker-container\">\n\t\t\t<cds-date-picker-input\n\t\t\t\t#rangeInput\n\t\t\t\t[label]=\"rangeLabel\"\n\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t[id]=\"id + '-rangeInput'\"\n\t\t\t\t[size]=\"size\"\n\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t[hasIcon]=\"(range ? true : null)\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t(valueChange)=\"onRangeValueChange($event)\"\n\t\t\t\t(click)=\"openCalendar(rangeInput)\">\n\t\t\t</cds-date-picker-input>\n\t\t</div>\n\t</div>\n</div>\n",
|
|
26065
26065
|
"templateUrl": [],
|
|
26066
26066
|
"viewProviders": [],
|
|
26067
26067
|
"hostDirectives": [],
|
|
@@ -26073,7 +26073,7 @@
|
|
|
26073
26073
|
"deprecationMessage": "",
|
|
26074
26074
|
"rawdescription": "\n\nAria label added to datepicker's calendar container.\n",
|
|
26075
26075
|
"description": "<p>Aria label added to datepicker's calendar container.</p>\n",
|
|
26076
|
-
"line":
|
|
26076
|
+
"line": 161,
|
|
26077
26077
|
"type": "string",
|
|
26078
26078
|
"decorators": []
|
|
26079
26079
|
},
|
|
@@ -26084,7 +26084,7 @@
|
|
|
26084
26084
|
"deprecationMessage": "",
|
|
26085
26085
|
"rawdescription": "\n\nFormat of date\n\nFor reference: https://flatpickr.js.org/formatting/\n",
|
|
26086
26086
|
"description": "<p>Format of date</p>\n<p>For reference: <a href=\"https://flatpickr.js.org/formatting/\">https://flatpickr.js.org/formatting/</a></p>\n",
|
|
26087
|
-
"line":
|
|
26087
|
+
"line": 141,
|
|
26088
26088
|
"type": "string",
|
|
26089
26089
|
"decorators": []
|
|
26090
26090
|
},
|
|
@@ -26093,7 +26093,7 @@
|
|
|
26093
26093
|
"defaultValue": "false",
|
|
26094
26094
|
"deprecated": false,
|
|
26095
26095
|
"deprecationMessage": "",
|
|
26096
|
-
"line":
|
|
26096
|
+
"line": 187,
|
|
26097
26097
|
"type": "boolean",
|
|
26098
26098
|
"decorators": []
|
|
26099
26099
|
},
|
|
@@ -26101,7 +26101,7 @@
|
|
|
26101
26101
|
"name": "flatpickrOptions",
|
|
26102
26102
|
"deprecated": false,
|
|
26103
26103
|
"deprecationMessage": "",
|
|
26104
|
-
"line":
|
|
26104
|
+
"line": 230,
|
|
26105
26105
|
"type": "Partial<Options>",
|
|
26106
26106
|
"decorators": []
|
|
26107
26107
|
},
|
|
@@ -26109,7 +26109,7 @@
|
|
|
26109
26109
|
"name": "helperText",
|
|
26110
26110
|
"deprecated": false,
|
|
26111
26111
|
"deprecationMessage": "",
|
|
26112
|
-
"line":
|
|
26112
|
+
"line": 152,
|
|
26113
26113
|
"type": "string | TemplateRef<any>",
|
|
26114
26114
|
"decorators": []
|
|
26115
26115
|
},
|
|
@@ -26118,7 +26118,7 @@
|
|
|
26118
26118
|
"defaultValue": "`datepicker-${DatePicker.datePickerCount++}`",
|
|
26119
26119
|
"deprecated": false,
|
|
26120
26120
|
"deprecationMessage": "",
|
|
26121
|
-
"line":
|
|
26121
|
+
"line": 168,
|
|
26122
26122
|
"type": "string",
|
|
26123
26123
|
"decorators": []
|
|
26124
26124
|
},
|
|
@@ -26129,7 +26129,7 @@
|
|
|
26129
26129
|
"deprecationMessage": "",
|
|
26130
26130
|
"rawdescription": "\n\nThe pattern for the underlying input element\n",
|
|
26131
26131
|
"description": "<p>The pattern for the underlying input element</p>\n",
|
|
26132
|
-
"line":
|
|
26132
|
+
"line": 166,
|
|
26133
26133
|
"type": "string",
|
|
26134
26134
|
"decorators": []
|
|
26135
26135
|
},
|
|
@@ -26140,7 +26140,7 @@
|
|
|
26140
26140
|
"deprecationMessage": "",
|
|
26141
26141
|
"rawdescription": "\n\nSet to `true` to display the invalid state.\n",
|
|
26142
26142
|
"description": "<p>Set to <code>true</code> to display the invalid state.</p>\n",
|
|
26143
|
-
"line":
|
|
26143
|
+
"line": 193,
|
|
26144
26144
|
"type": "boolean",
|
|
26145
26145
|
"decorators": []
|
|
26146
26146
|
},
|
|
@@ -26150,7 +26150,7 @@
|
|
|
26150
26150
|
"deprecationMessage": "",
|
|
26151
26151
|
"rawdescription": "\n\nValue displayed if datepicker is in an invalid state.\n",
|
|
26152
26152
|
"description": "<p>Value displayed if datepicker is in an invalid state.</p>\n",
|
|
26153
|
-
"line":
|
|
26153
|
+
"line": 197,
|
|
26154
26154
|
"type": "string | TemplateRef<any>",
|
|
26155
26155
|
"decorators": []
|
|
26156
26156
|
},
|
|
@@ -26158,7 +26158,7 @@
|
|
|
26158
26158
|
"name": "label",
|
|
26159
26159
|
"deprecated": false,
|
|
26160
26160
|
"deprecationMessage": "",
|
|
26161
|
-
"line":
|
|
26161
|
+
"line": 151,
|
|
26162
26162
|
"type": "string | TemplateRef<any>",
|
|
26163
26163
|
"decorators": []
|
|
26164
26164
|
},
|
|
@@ -26169,7 +26169,7 @@
|
|
|
26169
26169
|
"deprecationMessage": "",
|
|
26170
26170
|
"rawdescription": "\n\nLanguage of the flatpickr calendar.\n\nFor reference of the possible locales:\nhttps://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\n",
|
|
26171
26171
|
"description": "<p>Language of the flatpickr calendar.</p>\n<p>For reference of the possible locales:\n<a href=\"https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts\">https://github.com/flatpickr/flatpickr/blob/master/src/l10n/index.ts</a></p>\n",
|
|
26172
|
-
"line":
|
|
26172
|
+
"line": 149,
|
|
26173
26173
|
"type": "string",
|
|
26174
26174
|
"decorators": []
|
|
26175
26175
|
},
|
|
@@ -26178,7 +26178,7 @@
|
|
|
26178
26178
|
"defaultValue": "\"mm/dd/yyyy\"",
|
|
26179
26179
|
"deprecated": false,
|
|
26180
26180
|
"deprecationMessage": "",
|
|
26181
|
-
"line":
|
|
26181
|
+
"line": 156,
|
|
26182
26182
|
"type": "string",
|
|
26183
26183
|
"decorators": []
|
|
26184
26184
|
},
|
|
@@ -26187,7 +26187,7 @@
|
|
|
26187
26187
|
"defaultValue": "[]",
|
|
26188
26188
|
"deprecated": false,
|
|
26189
26189
|
"deprecationMessage": "",
|
|
26190
|
-
"line":
|
|
26190
|
+
"line": 227,
|
|
26191
26191
|
"type": "{}",
|
|
26192
26192
|
"decorators": []
|
|
26193
26193
|
},
|
|
@@ -26198,7 +26198,7 @@
|
|
|
26198
26198
|
"deprecationMessage": "",
|
|
26199
26199
|
"rawdescription": "\n\nSelect calendar range mode\n",
|
|
26200
26200
|
"description": "<p>Select calendar range mode</p>\n",
|
|
26201
|
-
"line":
|
|
26201
|
+
"line": 134,
|
|
26202
26202
|
"type": "boolean",
|
|
26203
26203
|
"decorators": []
|
|
26204
26204
|
},
|
|
@@ -26206,7 +26206,7 @@
|
|
|
26206
26206
|
"name": "rangeHelperText",
|
|
26207
26207
|
"deprecated": false,
|
|
26208
26208
|
"deprecationMessage": "",
|
|
26209
|
-
"line":
|
|
26209
|
+
"line": 153,
|
|
26210
26210
|
"type": "string | TemplateRef<any>",
|
|
26211
26211
|
"decorators": []
|
|
26212
26212
|
},
|
|
@@ -26217,7 +26217,7 @@
|
|
|
26217
26217
|
"deprecationMessage": "",
|
|
26218
26218
|
"rawdescription": "\n\nSet to `true` to display the invalid state for the second datepicker input.\n",
|
|
26219
26219
|
"description": "<p>Set to <code>true</code> to display the invalid state for the second datepicker input.</p>\n",
|
|
26220
|
-
"line":
|
|
26220
|
+
"line": 211,
|
|
26221
26221
|
"type": "boolean",
|
|
26222
26222
|
"decorators": []
|
|
26223
26223
|
},
|
|
@@ -26227,7 +26227,7 @@
|
|
|
26227
26227
|
"deprecationMessage": "",
|
|
26228
26228
|
"rawdescription": "\n\nValue displayed if the second datepicker input is in an invalid state.\n",
|
|
26229
26229
|
"description": "<p>Value displayed if the second datepicker input is in an invalid state.</p>\n",
|
|
26230
|
-
"line":
|
|
26230
|
+
"line": 215,
|
|
26231
26231
|
"type": "string | TemplateRef<any>",
|
|
26232
26232
|
"decorators": []
|
|
26233
26233
|
},
|
|
@@ -26235,7 +26235,7 @@
|
|
|
26235
26235
|
"name": "rangeLabel",
|
|
26236
26236
|
"deprecated": false,
|
|
26237
26237
|
"deprecationMessage": "",
|
|
26238
|
-
"line":
|
|
26238
|
+
"line": 154,
|
|
26239
26239
|
"type": "string",
|
|
26240
26240
|
"decorators": []
|
|
26241
26241
|
},
|
|
@@ -26246,7 +26246,7 @@
|
|
|
26246
26246
|
"deprecationMessage": "",
|
|
26247
26247
|
"rawdescription": "\n\nSet to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n",
|
|
26248
26248
|
"description": "<p>Set to <code>true</code> to show a warning in the second datepicker input (contents set by rangeWarningText)</p>\n",
|
|
26249
|
-
"line":
|
|
26249
|
+
"line": 219,
|
|
26250
26250
|
"type": "boolean",
|
|
26251
26251
|
"decorators": []
|
|
26252
26252
|
},
|
|
@@ -26256,16 +26256,25 @@
|
|
|
26256
26256
|
"deprecationMessage": "",
|
|
26257
26257
|
"rawdescription": "\n\nSets the warning text for the second datepicker input\n",
|
|
26258
26258
|
"description": "<p>Sets the warning text for the second datepicker input</p>\n",
|
|
26259
|
-
"line":
|
|
26259
|
+
"line": 223,
|
|
26260
26260
|
"type": "string | TemplateRef<any>",
|
|
26261
26261
|
"decorators": []
|
|
26262
26262
|
},
|
|
26263
|
+
{
|
|
26264
|
+
"name": "readonly",
|
|
26265
|
+
"defaultValue": "false",
|
|
26266
|
+
"deprecated": false,
|
|
26267
|
+
"deprecationMessage": "",
|
|
26268
|
+
"line": 189,
|
|
26269
|
+
"type": "boolean",
|
|
26270
|
+
"decorators": []
|
|
26271
|
+
},
|
|
26263
26272
|
{
|
|
26264
26273
|
"name": "size",
|
|
26265
26274
|
"defaultValue": "\"md\"",
|
|
26266
26275
|
"deprecated": false,
|
|
26267
26276
|
"deprecationMessage": "",
|
|
26268
|
-
"line":
|
|
26277
|
+
"line": 207,
|
|
26269
26278
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
26270
26279
|
"decorators": []
|
|
26271
26280
|
},
|
|
@@ -26274,7 +26283,7 @@
|
|
|
26274
26283
|
"defaultValue": "false",
|
|
26275
26284
|
"deprecated": false,
|
|
26276
26285
|
"deprecationMessage": "",
|
|
26277
|
-
"line":
|
|
26286
|
+
"line": 225,
|
|
26278
26287
|
"type": "boolean",
|
|
26279
26288
|
"decorators": []
|
|
26280
26289
|
},
|
|
@@ -26285,15 +26294,15 @@
|
|
|
26285
26294
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\nSet to `\"light\"` to apply the light style",
|
|
26286
26295
|
"jsdoctags": [
|
|
26287
26296
|
{
|
|
26288
|
-
"pos":
|
|
26289
|
-
"end":
|
|
26297
|
+
"pos": 4637,
|
|
26298
|
+
"end": 4741,
|
|
26290
26299
|
"flags": 16842752,
|
|
26291
26300
|
"modifierFlagsCache": 0,
|
|
26292
26301
|
"transformFlags": 0,
|
|
26293
26302
|
"kind": 338,
|
|
26294
26303
|
"tagName": {
|
|
26295
|
-
"pos":
|
|
26296
|
-
"end":
|
|
26304
|
+
"pos": 4638,
|
|
26305
|
+
"end": 4648,
|
|
26297
26306
|
"flags": 16842752,
|
|
26298
26307
|
"modifierFlagsCache": 0,
|
|
26299
26308
|
"transformFlags": 0,
|
|
@@ -26303,7 +26312,7 @@
|
|
|
26303
26312
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\nSet to <code>"light"</code> to apply the light style</p>\n"
|
|
26304
26313
|
}
|
|
26305
26314
|
],
|
|
26306
|
-
"line":
|
|
26315
|
+
"line": 185,
|
|
26307
26316
|
"type": "\"light\" | \"dark\"",
|
|
26308
26317
|
"decorators": []
|
|
26309
26318
|
},
|
|
@@ -26311,7 +26320,7 @@
|
|
|
26311
26320
|
"name": "value",
|
|
26312
26321
|
"deprecated": false,
|
|
26313
26322
|
"deprecationMessage": "",
|
|
26314
|
-
"line":
|
|
26323
|
+
"line": 170,
|
|
26315
26324
|
"type": "[]",
|
|
26316
26325
|
"decorators": []
|
|
26317
26326
|
},
|
|
@@ -26322,7 +26331,7 @@
|
|
|
26322
26331
|
"deprecationMessage": "",
|
|
26323
26332
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warningText)\n",
|
|
26324
26333
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warningText)</p>\n",
|
|
26325
|
-
"line":
|
|
26334
|
+
"line": 201,
|
|
26326
26335
|
"type": "boolean",
|
|
26327
26336
|
"decorators": []
|
|
26328
26337
|
},
|
|
@@ -26332,7 +26341,7 @@
|
|
|
26332
26341
|
"deprecationMessage": "",
|
|
26333
26342
|
"rawdescription": "\n\nSets the warning text\n",
|
|
26334
26343
|
"description": "<p>Sets the warning text</p>\n",
|
|
26335
|
-
"line":
|
|
26344
|
+
"line": 205,
|
|
26336
26345
|
"type": "string | TemplateRef<any>",
|
|
26337
26346
|
"decorators": []
|
|
26338
26347
|
}
|
|
@@ -26345,7 +26354,7 @@
|
|
|
26345
26354
|
"deprecationMessage": "",
|
|
26346
26355
|
"rawdescription": "\n\nWe are overriding onClose event even if users pass it via flatpickr options\nEmits an event when date picker closes\n",
|
|
26347
26356
|
"description": "<p>We are overriding onClose event even if users pass it via flatpickr options\nEmits an event when date picker closes</p>\n",
|
|
26348
|
-
"line":
|
|
26357
|
+
"line": 258,
|
|
26349
26358
|
"type": "EventEmitter<any>"
|
|
26350
26359
|
},
|
|
26351
26360
|
{
|
|
@@ -26353,7 +26362,7 @@
|
|
|
26353
26362
|
"defaultValue": "new EventEmitter()",
|
|
26354
26363
|
"deprecated": false,
|
|
26355
26364
|
"deprecationMessage": "",
|
|
26356
|
-
"line":
|
|
26365
|
+
"line": 252,
|
|
26357
26366
|
"type": "EventEmitter<any>"
|
|
26358
26367
|
}
|
|
26359
26368
|
],
|
|
@@ -26365,7 +26374,7 @@
|
|
|
26365
26374
|
"type": "DatePickerInput",
|
|
26366
26375
|
"optional": false,
|
|
26367
26376
|
"description": "",
|
|
26368
|
-
"line":
|
|
26377
|
+
"line": 249,
|
|
26369
26378
|
"decorators": [
|
|
26370
26379
|
{
|
|
26371
26380
|
"name": "ViewChild",
|
|
@@ -26384,7 +26393,7 @@
|
|
|
26384
26393
|
"type": "function",
|
|
26385
26394
|
"optional": false,
|
|
26386
26395
|
"description": "",
|
|
26387
|
-
"line":
|
|
26396
|
+
"line": 413
|
|
26388
26397
|
},
|
|
26389
26398
|
{
|
|
26390
26399
|
"name": "propagateChange",
|
|
@@ -26394,7 +26403,7 @@
|
|
|
26394
26403
|
"type": "",
|
|
26395
26404
|
"optional": false,
|
|
26396
26405
|
"description": "",
|
|
26397
|
-
"line":
|
|
26406
|
+
"line": 415
|
|
26398
26407
|
},
|
|
26399
26408
|
{
|
|
26400
26409
|
"name": "rangeInput",
|
|
@@ -26403,7 +26412,7 @@
|
|
|
26403
26412
|
"type": "DatePickerInput",
|
|
26404
26413
|
"optional": false,
|
|
26405
26414
|
"description": "",
|
|
26406
|
-
"line":
|
|
26415
|
+
"line": 250,
|
|
26407
26416
|
"decorators": [
|
|
26408
26417
|
{
|
|
26409
26418
|
"name": "ViewChild",
|
|
@@ -26422,7 +26431,7 @@
|
|
|
26422
26431
|
"optional": false,
|
|
26423
26432
|
"returnType": "void",
|
|
26424
26433
|
"typeParameters": [],
|
|
26425
|
-
"line":
|
|
26434
|
+
"line": 362,
|
|
26426
26435
|
"deprecated": false,
|
|
26427
26436
|
"deprecationMessage": "",
|
|
26428
26437
|
"decorators": [
|
|
@@ -26441,7 +26450,7 @@
|
|
|
26441
26450
|
"optional": false,
|
|
26442
26451
|
"returnType": "void",
|
|
26443
26452
|
"typeParameters": [],
|
|
26444
|
-
"line":
|
|
26453
|
+
"line": 377,
|
|
26445
26454
|
"deprecated": false,
|
|
26446
26455
|
"deprecationMessage": "",
|
|
26447
26456
|
"decorators": [
|
|
@@ -26467,7 +26476,7 @@
|
|
|
26467
26476
|
"optional": false,
|
|
26468
26477
|
"returnType": "void",
|
|
26469
26478
|
"typeParameters": [],
|
|
26470
|
-
"line":
|
|
26479
|
+
"line": 443,
|
|
26471
26480
|
"deprecated": false,
|
|
26472
26481
|
"deprecationMessage": "",
|
|
26473
26482
|
"rawdescription": "\n\nHandles the `valueChange` event from the range input\n",
|
|
@@ -26497,7 +26506,7 @@
|
|
|
26497
26506
|
"optional": false,
|
|
26498
26507
|
"returnType": "void",
|
|
26499
26508
|
"typeParameters": [],
|
|
26500
|
-
"line":
|
|
26509
|
+
"line": 428,
|
|
26501
26510
|
"deprecated": false,
|
|
26502
26511
|
"deprecationMessage": "",
|
|
26503
26512
|
"rawdescription": "\n\nHandles the `valueChange` event from the primary/single input\n",
|
|
@@ -26527,7 +26536,7 @@
|
|
|
26527
26536
|
"optional": false,
|
|
26528
26537
|
"returnType": "void",
|
|
26529
26538
|
"typeParameters": [],
|
|
26530
|
-
"line":
|
|
26539
|
+
"line": 454,
|
|
26531
26540
|
"deprecated": false,
|
|
26532
26541
|
"deprecationMessage": "",
|
|
26533
26542
|
"rawdescription": "\n\nHandles opening the calendar \"properly\" when the calendar icon is clicked.\n",
|
|
@@ -26557,7 +26566,7 @@
|
|
|
26557
26566
|
"optional": false,
|
|
26558
26567
|
"returnType": "void",
|
|
26559
26568
|
"typeParameters": [],
|
|
26560
|
-
"line":
|
|
26569
|
+
"line": 405,
|
|
26561
26570
|
"deprecated": false,
|
|
26562
26571
|
"deprecationMessage": "",
|
|
26563
26572
|
"jsdoctags": [
|
|
@@ -26585,7 +26594,7 @@
|
|
|
26585
26594
|
"optional": false,
|
|
26586
26595
|
"returnType": "void",
|
|
26587
26596
|
"typeParameters": [],
|
|
26588
|
-
"line":
|
|
26597
|
+
"line": 409,
|
|
26589
26598
|
"deprecated": false,
|
|
26590
26599
|
"deprecationMessage": "",
|
|
26591
26600
|
"jsdoctags": [
|
|
@@ -26613,7 +26622,7 @@
|
|
|
26613
26622
|
"optional": false,
|
|
26614
26623
|
"returnType": "void",
|
|
26615
26624
|
"typeParameters": [],
|
|
26616
|
-
"line":
|
|
26625
|
+
"line": 401,
|
|
26617
26626
|
"deprecated": false,
|
|
26618
26627
|
"deprecationMessage": "",
|
|
26619
26628
|
"rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the DatePicker.\n\nex: `this.formGroup.get(\"myDatePicker\").disable();`\n\n",
|
|
@@ -26621,8 +26630,8 @@
|
|
|
26621
26630
|
"jsdoctags": [
|
|
26622
26631
|
{
|
|
26623
26632
|
"name": {
|
|
26624
|
-
"pos":
|
|
26625
|
-
"end":
|
|
26633
|
+
"pos": 11430,
|
|
26634
|
+
"end": 11440,
|
|
26626
26635
|
"flags": 16842752,
|
|
26627
26636
|
"modifierFlagsCache": 0,
|
|
26628
26637
|
"transformFlags": 0,
|
|
@@ -26633,8 +26642,8 @@
|
|
|
26633
26642
|
"deprecated": false,
|
|
26634
26643
|
"deprecationMessage": "",
|
|
26635
26644
|
"tagName": {
|
|
26636
|
-
"pos":
|
|
26637
|
-
"end":
|
|
26645
|
+
"pos": 11424,
|
|
26646
|
+
"end": 11429,
|
|
26638
26647
|
"flags": 16842752,
|
|
26639
26648
|
"modifierFlagsCache": 0,
|
|
26640
26649
|
"transformFlags": 0,
|
|
@@ -26658,7 +26667,7 @@
|
|
|
26658
26667
|
"optional": false,
|
|
26659
26668
|
"returnType": "void",
|
|
26660
26669
|
"typeParameters": [],
|
|
26661
|
-
"line":
|
|
26670
|
+
"line": 385,
|
|
26662
26671
|
"deprecated": false,
|
|
26663
26672
|
"deprecationMessage": "",
|
|
26664
26673
|
"rawdescription": "\n\nWrites a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n",
|
|
@@ -26666,8 +26675,8 @@
|
|
|
26666
26675
|
"jsdoctags": [
|
|
26667
26676
|
{
|
|
26668
26677
|
"name": {
|
|
26669
|
-
"pos":
|
|
26670
|
-
"end":
|
|
26678
|
+
"pos": 11029,
|
|
26679
|
+
"end": 11034,
|
|
26671
26680
|
"flags": 16842752,
|
|
26672
26681
|
"modifierFlagsCache": 0,
|
|
26673
26682
|
"transformFlags": 0,
|
|
@@ -26678,8 +26687,8 @@
|
|
|
26678
26687
|
"deprecated": false,
|
|
26679
26688
|
"deprecationMessage": "",
|
|
26680
26689
|
"tagName": {
|
|
26681
|
-
"pos":
|
|
26682
|
-
"end":
|
|
26690
|
+
"pos": 11023,
|
|
26691
|
+
"end": 11028,
|
|
26683
26692
|
"flags": 16842752,
|
|
26684
26693
|
"modifierFlagsCache": 0,
|
|
26685
26694
|
"transformFlags": 0,
|
|
@@ -26701,7 +26710,7 @@
|
|
|
26701
26710
|
"argsDecorator": [],
|
|
26702
26711
|
"deprecated": false,
|
|
26703
26712
|
"deprecationMessage": "",
|
|
26704
|
-
"line":
|
|
26713
|
+
"line": 362
|
|
26705
26714
|
},
|
|
26706
26715
|
{
|
|
26707
26716
|
"name": "focusout",
|
|
@@ -26709,7 +26718,7 @@
|
|
|
26709
26718
|
"argsDecorator": [],
|
|
26710
26719
|
"deprecated": false,
|
|
26711
26720
|
"deprecationMessage": "",
|
|
26712
|
-
"line":
|
|
26721
|
+
"line": 377
|
|
26713
26722
|
}
|
|
26714
26723
|
],
|
|
26715
26724
|
"standalone": false,
|
|
@@ -26717,7 +26726,7 @@
|
|
|
26717
26726
|
"description": "<p>Get started with importing the module:</p>\n<b>Example :</b><div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { DatePickerModule } from 'carbon-components-angular';</code></pre></div><p><a href=\"../../?path=/story/components-date-picker--single\">See demo</a></p>\n",
|
|
26718
26727
|
"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",
|
|
26719
26728
|
"type": "component",
|
|
26720
|
-
"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\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * 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",
|
|
26729
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tViewEncapsulation,\n\tElementRef,\n\tOnDestroy,\n\tHostListener,\n\tTemplateRef,\n\tOnChanges,\n\tSimpleChanges,\n\tAfterViewChecked,\n\tAfterViewInit,\n\tViewChild,\n\tOnInit,\n\tSimpleChange\n} from \"@angular/core\";\nimport rangePlugin from \"flatpickr/dist/plugins/rangePlugin\";\nimport flatpickr from \"flatpickr\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { carbonFlatpickrMonthSelectPlugin } from \"./carbon-flatpickr-month-select\";\nimport * as languages from \"flatpickr/dist/l10n/index\";\nimport { Options } from \"flatpickr/dist/types/options\";\nimport { DatePickerInput } from \"carbon-components-angular/datepicker-input\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * Due to type error, we have to use square brackets property accessor\n * There is a webpack issue when attempting to access exported languages from flatpickr l10n Angular 14+ apps\n * languages.default[locale] fails in app consuming CCA library but passes in test\n * languages.default.default[locale] fails in test but works in app consuming CCA library.\n *\n * To please both scenarios, we are adding a condition to prevent tests from failing\n */\nif (languages.default?.default[\"en\"]?.weekdays) {\n\t(languages.default.default[\"en\"].weekdays.shorthand as string[]) = languages.default.default[\"en\"].weekdays.longhand.map(day => {\n\t\tif (day === \"Thursday\") {\n\t\t\treturn \"Th\";\n\t\t}\n\t\treturn day.charAt(0);\n\t});\n}\n\n/**\n * Get started with importing the module:\n *\n * ```typescript\n * import { DatePickerModule } from 'carbon-components-angular';\n * ```\n *\n * [See demo](../../?path=/story/components-date-picker--single)\n */\n@Component({\n\tselector: \"cds-date-picker, ibm-date-picker\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div\n\t\t\tclass=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--range' : range,\n\t\t\t\t'cds--date-picker--single' : !range,\n\t\t\t\t'cds--date-picker--light' : theme === 'light',\n\t\t\t\t'cds--skeleton' : skeleton\n\t\t\t}\">\n\t\t\t<div class=\"cds--date-picker-container\">\n\t\t\t\t<cds-date-picker-input\n\t\t\t\t\t#input\n\t\t\t\t\t[label]=\"label\"\n\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t[pattern]=\"inputPattern\"\n\t\t\t\t\t[id]=\"id + '-input'\"\n\t\t\t\t\t[size]=\"size\"\n\t\t\t\t\t[type]=\"(range ? 'range' : 'single')\"\n\t\t\t\t\t[hasIcon]=\"(range ? false : true)\"\n\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"invalid\"\n\t\t\t\t\t[invalidText]=\"invalidText\"\n\t\t\t\t\t[warn]=\"warn\"\n\t\t\t\t\t[warnText]=\"warnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"helperText\"\n\t\t\t\t\t(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[readonly]=\"readonly\"\n\t\t\t\t\t[invalid]=\"rangeInvalid\"\n\t\t\t\t\t[invalidText]=\"rangeInvalidText\"\n\t\t\t\t\t[warn]=\"rangeWarn\"\n\t\t\t\t\t[warnText]=\"rangeWarnText\"\n\t\t\t\t\t[skeleton]=\"skeleton\"\n\t\t\t\t\t[helperText]=\"rangeHelperText\"\n\t\t\t\t\t(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\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` to display the invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if datepicker is in an invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning (contents set by warningText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\t/**\n\t * Set to `true` to display the invalid state for the second datepicker input.\n\t */\n\t@Input() rangeInvalid = false;\n\t/**\n\t * Value displayed if the second datepicker input is in an invalid state.\n\t */\n\t@Input() rangeInvalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n\t */\n\t@Input() rangeWarn = false;\n\t/**\n\t * Sets the warning text for the second datepicker input\n\t */\n\t@Input() rangeWarnText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() plugins = [];\n\n\t@Input()\n\tset flatpickrOptions(options: Partial<Options>) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions(): Partial<Options> {\n\t\tconst plugins = [...this.plugins, carbonFlatpickrMonthSelectPlugin];\n\t\tif (this.range) {\n\t\t\tplugins.push(rangePlugin({ input: `#${this.id}-rangeInput`, position: \"left\" }));\n\t\t}\n\t\treturn Object.assign({}, this._flatpickrOptions, this.flatpickrBaseOptions, {\n\t\t\tmode: this.range ? \"range\" : \"single\",\n\t\t\tplugins,\n\t\t\tdateFormat: this.dateFormat,\n\t\t\tlocale: languages.default?.default[this.language] || languages.default[this.language],\n\t\t\t// Little trick force \"readonly mode\" on datepicker input.\n\t\t\t// Docs: Whether clicking on the input should open the picker. You could disable this if you wish to open the calendar manually with.open().\n\t\t\tclickOpens: !this.readonly\n\t\t});\n\t}\n\n\t@ViewChild(\"input\", { static: true }) input: DatePickerInput;\n\t@ViewChild(\"rangeInput\") rangeInput: DatePickerInput;\n\n\t@Output() valueChange: EventEmitter<any> = new EventEmitter();\n\n\t/**\n\t * We are overriding onClose event even if users pass it via flatpickr options\n\t * Emits an event when date picker closes\n\t */\n\t@Output() onClose: EventEmitter<any> = new EventEmitter();\n\n\tprotected _value = [];\n\n\tprotected _flatpickrOptions: Partial<Options> = {\n\t\tallowInput: true\n\t};\n\n\tprotected flatpickrBaseOptions = {\n\t\tmode: \"single\",\n\t\tdateFormat: \"m/d/Y\",\n\t\tplugins: this.plugins,\n\t\tonOpen: () => {\n\t\t\tthis.updateClassNames();\n\t\t\tthis.updateAttributes();\n\t\t\tthis.updateCalendarListeners();\n\t\t},\n\t\tonClose: (date) => {\n\t\t\t// This makes sure that the `flatpickrInstance selectedDates` are in sync with the values of\n\t\t\t// the inputs when the calendar closes.\n\t\t\tif (this.range && this.flatpickrInstance) {\n\t\t\t\tconst inputValue = this.input.input.nativeElement.value;\n\t\t\t\tconst rangeInputValue = this.rangeInput.input.nativeElement.value;\n\t\t\t\tif (inputValue || rangeInputValue) {\n\t\t\t\t\tconst parseDate = (date: string) => this.flatpickrInstance.parseDate(date, this.dateFormat);\n\t\t\t\t\tthis.setDateValues([parseDate(inputValue), parseDate(rangeInputValue || inputValue)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\",\n\t\t\t\"readonly\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tif (!this.skeleton) {\n\t\t\tthis.input.input.nativeElement.value = this._value[0] ?? \"\";\n\t\t\tif (this.range) {\n\t\t\t\tthis.rangeInput.input.nativeElement.value = this._value[1] ?? \"\";\n\t\t\t}\n\t\t}\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\n\t\tif (this.readonly) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\t// Listeners are added just once, so a check is needed here.\n\t\t\t\tif (this.readonly) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\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",
|
|
26721
26730
|
"assetsDirs": [],
|
|
26722
26731
|
"styleUrlsData": "",
|
|
26723
26732
|
"stylesData": "",
|
|
@@ -26740,7 +26749,7 @@
|
|
|
26740
26749
|
"deprecationMessage": ""
|
|
26741
26750
|
}
|
|
26742
26751
|
],
|
|
26743
|
-
"line":
|
|
26752
|
+
"line": 297,
|
|
26744
26753
|
"jsdoctags": [
|
|
26745
26754
|
{
|
|
26746
26755
|
"name": "elementRef",
|
|
@@ -26787,7 +26796,7 @@
|
|
|
26787
26796
|
}
|
|
26788
26797
|
],
|
|
26789
26798
|
"returnType": "void",
|
|
26790
|
-
"line":
|
|
26799
|
+
"line": 170,
|
|
26791
26800
|
"jsdoctags": [
|
|
26792
26801
|
{
|
|
26793
26802
|
"name": "v",
|
|
@@ -26804,7 +26813,7 @@
|
|
|
26804
26813
|
"name": "value",
|
|
26805
26814
|
"type": "",
|
|
26806
26815
|
"returnType": "",
|
|
26807
|
-
"line":
|
|
26816
|
+
"line": 177
|
|
26808
26817
|
}
|
|
26809
26818
|
},
|
|
26810
26819
|
"flatpickrOptions": {
|
|
@@ -26823,7 +26832,7 @@
|
|
|
26823
26832
|
}
|
|
26824
26833
|
],
|
|
26825
26834
|
"returnType": "void",
|
|
26826
|
-
"line":
|
|
26835
|
+
"line": 230,
|
|
26827
26836
|
"jsdoctags": [
|
|
26828
26837
|
{
|
|
26829
26838
|
"name": "options",
|
|
@@ -26840,14 +26849,14 @@
|
|
|
26840
26849
|
"name": "flatpickrOptions",
|
|
26841
26850
|
"type": "",
|
|
26842
26851
|
"returnType": "Partial<Options>",
|
|
26843
|
-
"line":
|
|
26852
|
+
"line": 233
|
|
26844
26853
|
}
|
|
26845
26854
|
}
|
|
26846
26855
|
}
|
|
26847
26856
|
},
|
|
26848
26857
|
{
|
|
26849
26858
|
"name": "DatePickerInput",
|
|
26850
|
-
"id": "component-DatePickerInput-
|
|
26859
|
+
"id": "component-DatePickerInput-3a48d21e0039648f1b99f5ad5a3cd64f15f09e2656dd2bca5c3b5318467036c5fa88a6d885535f00f6478bbd2891e3c97531850c7abeb79b75339a532f6b0cc3",
|
|
26851
26860
|
"file": "src/datepicker-input/datepicker-input.component.ts",
|
|
26852
26861
|
"encapsulation": [],
|
|
26853
26862
|
"entryComponents": [],
|
|
@@ -26861,7 +26870,7 @@
|
|
|
26861
26870
|
"selector": "cds-date-picker-input, ibm-date-picker-input",
|
|
26862
26871
|
"styleUrls": [],
|
|
26863
26872
|
"styles": [],
|
|
26864
|
-
"template": "\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === '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<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t",
|
|
26873
|
+
"template": "\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === '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<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t",
|
|
26865
26874
|
"templateUrl": [],
|
|
26866
26875
|
"viewProviders": [],
|
|
26867
26876
|
"hostDirectives": [],
|
|
@@ -26871,7 +26880,7 @@
|
|
|
26871
26880
|
"defaultValue": "false",
|
|
26872
26881
|
"deprecated": false,
|
|
26873
26882
|
"deprecationMessage": "",
|
|
26874
|
-
"line":
|
|
26883
|
+
"line": 131,
|
|
26875
26884
|
"type": "boolean",
|
|
26876
26885
|
"decorators": []
|
|
26877
26886
|
},
|
|
@@ -26880,7 +26889,7 @@
|
|
|
26880
26889
|
"defaultValue": "false",
|
|
26881
26890
|
"deprecated": false,
|
|
26882
26891
|
"deprecationMessage": "",
|
|
26883
|
-
"line":
|
|
26892
|
+
"line": 115,
|
|
26884
26893
|
"type": "boolean",
|
|
26885
26894
|
"decorators": []
|
|
26886
26895
|
},
|
|
@@ -26890,7 +26899,7 @@
|
|
|
26890
26899
|
"deprecationMessage": "",
|
|
26891
26900
|
"rawdescription": "\n\nSets the optional helper text.\n",
|
|
26892
26901
|
"description": "<p>Sets the optional helper text.</p>\n",
|
|
26893
|
-
"line":
|
|
26902
|
+
"line": 154,
|
|
26894
26903
|
"type": "string | TemplateRef<any>",
|
|
26895
26904
|
"decorators": []
|
|
26896
26905
|
},
|
|
@@ -26899,7 +26908,7 @@
|
|
|
26899
26908
|
"defaultValue": "`datepicker-${DatePickerInput.datePickerCount++}`",
|
|
26900
26909
|
"deprecated": false,
|
|
26901
26910
|
"deprecationMessage": "",
|
|
26902
|
-
"line":
|
|
26911
|
+
"line": 113,
|
|
26903
26912
|
"type": "string",
|
|
26904
26913
|
"decorators": []
|
|
26905
26914
|
},
|
|
@@ -26910,7 +26919,7 @@
|
|
|
26910
26919
|
"deprecationMessage": "",
|
|
26911
26920
|
"rawdescription": "\n\nSet to `true` for invalid state.\n",
|
|
26912
26921
|
"description": "<p>Set to <code>true</code> for invalid state.</p>\n",
|
|
26913
|
-
"line":
|
|
26922
|
+
"line": 137,
|
|
26914
26923
|
"type": "boolean",
|
|
26915
26924
|
"decorators": []
|
|
26916
26925
|
},
|
|
@@ -26920,7 +26929,7 @@
|
|
|
26920
26929
|
"deprecationMessage": "",
|
|
26921
26930
|
"rawdescription": "\n\nValue displayed if dropdown is in invalid state.\n",
|
|
26922
26931
|
"description": "<p>Value displayed if dropdown is in invalid state.</p>\n",
|
|
26923
|
-
"line":
|
|
26932
|
+
"line": 141,
|
|
26924
26933
|
"type": "string | TemplateRef<any>",
|
|
26925
26934
|
"decorators": []
|
|
26926
26935
|
},
|
|
@@ -26928,7 +26937,7 @@
|
|
|
26928
26937
|
"name": "label",
|
|
26929
26938
|
"deprecated": false,
|
|
26930
26939
|
"deprecationMessage": "",
|
|
26931
|
-
"line":
|
|
26940
|
+
"line": 117,
|
|
26932
26941
|
"type": "string | TemplateRef<any>",
|
|
26933
26942
|
"decorators": []
|
|
26934
26943
|
},
|
|
@@ -26937,7 +26946,7 @@
|
|
|
26937
26946
|
"defaultValue": "\"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\"",
|
|
26938
26947
|
"deprecated": false,
|
|
26939
26948
|
"deprecationMessage": "",
|
|
26940
|
-
"line":
|
|
26949
|
+
"line": 121,
|
|
26941
26950
|
"type": "string",
|
|
26942
26951
|
"decorators": []
|
|
26943
26952
|
},
|
|
@@ -26946,16 +26955,25 @@
|
|
|
26946
26955
|
"defaultValue": "\"mm/dd/yyyy\"",
|
|
26947
26956
|
"deprecated": false,
|
|
26948
26957
|
"deprecationMessage": "",
|
|
26949
|
-
"line":
|
|
26958
|
+
"line": 119,
|
|
26950
26959
|
"type": "string",
|
|
26951
26960
|
"decorators": []
|
|
26952
26961
|
},
|
|
26962
|
+
{
|
|
26963
|
+
"name": "readonly",
|
|
26964
|
+
"defaultValue": "false",
|
|
26965
|
+
"deprecated": false,
|
|
26966
|
+
"deprecationMessage": "",
|
|
26967
|
+
"line": 133,
|
|
26968
|
+
"type": "boolean",
|
|
26969
|
+
"decorators": []
|
|
26970
|
+
},
|
|
26953
26971
|
{
|
|
26954
26972
|
"name": "size",
|
|
26955
26973
|
"defaultValue": "\"md\"",
|
|
26956
26974
|
"deprecated": false,
|
|
26957
26975
|
"deprecationMessage": "",
|
|
26958
|
-
"line":
|
|
26976
|
+
"line": 160,
|
|
26959
26977
|
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
26960
26978
|
"decorators": []
|
|
26961
26979
|
},
|
|
@@ -26964,7 +26982,7 @@
|
|
|
26964
26982
|
"defaultValue": "false",
|
|
26965
26983
|
"deprecated": false,
|
|
26966
26984
|
"deprecationMessage": "",
|
|
26967
|
-
"line":
|
|
26985
|
+
"line": 156,
|
|
26968
26986
|
"type": "boolean",
|
|
26969
26987
|
"decorators": []
|
|
26970
26988
|
},
|
|
@@ -26975,15 +26993,15 @@
|
|
|
26975
26993
|
"deprecationMessage": "since v5 - Use `cdsLayer` directive instead\nSet to `\"light\"` to apply the light style",
|
|
26976
26994
|
"jsdoctags": [
|
|
26977
26995
|
{
|
|
26978
|
-
"pos":
|
|
26979
|
-
"end":
|
|
26996
|
+
"pos": 3712,
|
|
26997
|
+
"end": 3816,
|
|
26980
26998
|
"flags": 16842752,
|
|
26981
26999
|
"modifierFlagsCache": 0,
|
|
26982
27000
|
"transformFlags": 0,
|
|
26983
27001
|
"kind": 338,
|
|
26984
27002
|
"tagName": {
|
|
26985
|
-
"pos":
|
|
26986
|
-
"end":
|
|
27003
|
+
"pos": 3713,
|
|
27004
|
+
"end": 3723,
|
|
26987
27005
|
"flags": 16842752,
|
|
26988
27006
|
"modifierFlagsCache": 0,
|
|
26989
27007
|
"transformFlags": 0,
|
|
@@ -26993,7 +27011,7 @@
|
|
|
26993
27011
|
"comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\nSet to <code>"light"</code> to apply the light style</p>\n"
|
|
26994
27012
|
}
|
|
26995
27013
|
],
|
|
26996
|
-
"line":
|
|
27014
|
+
"line": 129,
|
|
26997
27015
|
"type": "\"light\" | \"dark\"",
|
|
26998
27016
|
"decorators": []
|
|
26999
27017
|
},
|
|
@@ -27004,7 +27022,7 @@
|
|
|
27004
27022
|
"deprecationMessage": "",
|
|
27005
27023
|
"rawdescription": "\n\nSelect a calendar type for the `model`.\nInternal purposes only.\n",
|
|
27006
27024
|
"description": "<p>Select a calendar type for the <code>model</code>.\nInternal purposes only.</p>\n",
|
|
27007
|
-
"line":
|
|
27025
|
+
"line": 111,
|
|
27008
27026
|
"type": "\"simple\" | \"single\" | \"range\"",
|
|
27009
27027
|
"decorators": []
|
|
27010
27028
|
},
|
|
@@ -27013,7 +27031,7 @@
|
|
|
27013
27031
|
"defaultValue": "\"\"",
|
|
27014
27032
|
"deprecated": false,
|
|
27015
27033
|
"deprecationMessage": "",
|
|
27016
|
-
"line":
|
|
27034
|
+
"line": 158,
|
|
27017
27035
|
"type": "string",
|
|
27018
27036
|
"decorators": []
|
|
27019
27037
|
},
|
|
@@ -27024,7 +27042,7 @@
|
|
|
27024
27042
|
"deprecationMessage": "",
|
|
27025
27043
|
"rawdescription": "\n\nSet to `true` to show a warning (contents set by warnText)\n",
|
|
27026
27044
|
"description": "<p>Set to <code>true</code> to show a warning (contents set by warnText)</p>\n",
|
|
27027
|
-
"line":
|
|
27045
|
+
"line": 145,
|
|
27028
27046
|
"type": "boolean",
|
|
27029
27047
|
"decorators": []
|
|
27030
27048
|
},
|
|
@@ -27034,7 +27052,7 @@
|
|
|
27034
27052
|
"deprecationMessage": "",
|
|
27035
27053
|
"rawdescription": "\n\nSets the warning text\n",
|
|
27036
27054
|
"description": "<p>Sets the warning text</p>\n",
|
|
27037
|
-
"line":
|
|
27055
|
+
"line": 149,
|
|
27038
27056
|
"type": "string | TemplateRef<any>",
|
|
27039
27057
|
"decorators": []
|
|
27040
27058
|
}
|
|
@@ -27045,7 +27063,7 @@
|
|
|
27045
27063
|
"defaultValue": "new EventEmitter()",
|
|
27046
27064
|
"deprecated": false,
|
|
27047
27065
|
"deprecationMessage": "",
|
|
27048
|
-
"line":
|
|
27066
|
+
"line": 123,
|
|
27049
27067
|
"type": "EventEmitter<string>"
|
|
27050
27068
|
}
|
|
27051
27069
|
],
|
|
@@ -27057,7 +27075,7 @@
|
|
|
27057
27075
|
"type": "ElementRef",
|
|
27058
27076
|
"optional": false,
|
|
27059
27077
|
"description": "",
|
|
27060
|
-
"line":
|
|
27078
|
+
"line": 162,
|
|
27061
27079
|
"decorators": [
|
|
27062
27080
|
{
|
|
27063
27081
|
"name": "ViewChild",
|
|
@@ -27076,7 +27094,7 @@
|
|
|
27076
27094
|
"type": "function",
|
|
27077
27095
|
"optional": false,
|
|
27078
27096
|
"description": "",
|
|
27079
|
-
"line":
|
|
27097
|
+
"line": 185
|
|
27080
27098
|
},
|
|
27081
27099
|
{
|
|
27082
27100
|
"name": "propagateChange",
|
|
@@ -27086,7 +27104,7 @@
|
|
|
27086
27104
|
"type": "",
|
|
27087
27105
|
"optional": false,
|
|
27088
27106
|
"description": "",
|
|
27089
|
-
"line":
|
|
27107
|
+
"line": 187
|
|
27090
27108
|
}
|
|
27091
27109
|
],
|
|
27092
27110
|
"methodsClass": [
|
|
@@ -27103,7 +27121,7 @@
|
|
|
27103
27121
|
"optional": false,
|
|
27104
27122
|
"returnType": "boolean",
|
|
27105
27123
|
"typeParameters": [],
|
|
27106
|
-
"line":
|
|
27124
|
+
"line": 189,
|
|
27107
27125
|
"deprecated": false,
|
|
27108
27126
|
"deprecationMessage": "",
|
|
27109
27127
|
"modifierKind": [
|
|
@@ -27134,7 +27152,7 @@
|
|
|
27134
27152
|
"optional": false,
|
|
27135
27153
|
"returnType": "void",
|
|
27136
27154
|
"typeParameters": [],
|
|
27137
|
-
"line":
|
|
27155
|
+
"line": 166,
|
|
27138
27156
|
"deprecated": false,
|
|
27139
27157
|
"deprecationMessage": "",
|
|
27140
27158
|
"jsdoctags": [
|
|
@@ -27162,7 +27180,7 @@
|
|
|
27162
27180
|
"optional": false,
|
|
27163
27181
|
"returnType": "void",
|
|
27164
27182
|
"typeParameters": [],
|
|
27165
|
-
"line":
|
|
27183
|
+
"line": 177,
|
|
27166
27184
|
"deprecated": false,
|
|
27167
27185
|
"deprecationMessage": "",
|
|
27168
27186
|
"modifierKind": [
|
|
@@ -27193,7 +27211,7 @@
|
|
|
27193
27211
|
"optional": false,
|
|
27194
27212
|
"returnType": "void",
|
|
27195
27213
|
"typeParameters": [],
|
|
27196
|
-
"line":
|
|
27214
|
+
"line": 181,
|
|
27197
27215
|
"deprecated": false,
|
|
27198
27216
|
"deprecationMessage": "",
|
|
27199
27217
|
"modifierKind": [
|
|
@@ -27224,7 +27242,7 @@
|
|
|
27224
27242
|
"optional": false,
|
|
27225
27243
|
"returnType": "void",
|
|
27226
27244
|
"typeParameters": [],
|
|
27227
|
-
"line":
|
|
27245
|
+
"line": 173,
|
|
27228
27246
|
"deprecated": false,
|
|
27229
27247
|
"deprecationMessage": "",
|
|
27230
27248
|
"modifierKind": [
|
|
@@ -27252,7 +27270,7 @@
|
|
|
27252
27270
|
"description": "",
|
|
27253
27271
|
"rawdescription": "\n",
|
|
27254
27272
|
"type": "component",
|
|
27255
|
-
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\n@Component({\n\tselector: \"cds-date-picker-input, ibm-date-picker-input\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === '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<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePickerInput,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class DatePickerInput {\n\tprivate static datePickerCount = 0;\n\t/**\n\t * Select a calendar type for the `model`.\n\t * Internal purposes only.\n\t */\n\t@Input() type: \"simple\" | \"single\" | \"range\" = \"simple\";\n\n\t@Input() id = `datepicker-${DatePickerInput.datePickerCount++}`;\n\n\t@Input() hasIcon = false;\n\n\t@Input() label: string | TemplateRef<any>;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t@Input() pattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Output() valueChange: EventEmitter<string> = new EventEmitter();\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` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning (contents set by warnText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() value = \"\";\n\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n\t@ViewChild(\"input\") input: ElementRef;\n\n\tconstructor(protected elementRef: ElementRef) { }\n\n\tonChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.valueChange.emit(this.value);\n\t\tthis.propagateChange(this.value);\n\t\tthis.onTouched();\n\t}\n\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
27273
|
+
"sourceCode": "import {\n\tComponent,\n\tInput,\n\tOutput,\n\tEventEmitter,\n\tElementRef,\n\tTemplateRef,\n\tViewChild\n} from \"@angular/core\";\nimport { NG_VALUE_ACCESSOR } from \"@angular/forms\";\n\n@Component({\n\tselector: \"cds-date-picker-input, ibm-date-picker-input\",\n\ttemplate: `\n\t<div class=\"cds--form-item\">\n\t\t<div class=\"cds--date-picker\"\n\t\t\t[ngClass]=\"{\n\t\t\t\t'cds--date-picker--simple' : type === 'simple',\n\t\t\t\t'cds--date-picker--single' : type === 'single',\n\t\t\t\t'cds--date-picker--range' : type === '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<label\n\t\t\t\t\t*ngIf=\"label\"\n\t\t\t\t\t[for]=\"id\"\n\t\t\t\t\tclass=\"cds--label\"\n\t\t\t\t\t[ngClass]=\"{'cds--label--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(label)\">{{label}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(label)\" [ngTemplateOutlet]=\"label\"></ng-template>\n\t\t\t\t</label>\n\t\t\t\t<div class=\"cds--date-picker-input__wrapper\"\n\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--invalid': invalid,\n\t\t\t\t\t\t'cds--date-picker-input__wrapper--warn': warn\n\t\t\t\t\t}\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t#input\n\t\t\t\t\t\t*ngIf=\"!skeleton\"\n\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tclass=\"cds--date-picker__input\"\n\t\t\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t\t\t'cds--date-picker__input--sm': size === 'sm',\n\t\t\t\t\t\t\t'cds--date-picker__input--md': size === 'md',\n\t\t\t\t\t\t\t'cds--date-picker__input--lg': size === 'lg'\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t[attr.data-invalid]=\"invalid ? true : undefined\"\n\t\t\t\t\t\t[value]=\"value\"\n\t\t\t\t\t\t[pattern]=\"pattern\"\n\t\t\t\t\t\t[placeholder]=\"placeholder\"\n\t\t\t\t\t\t[id]= \"id\"\n\t\t\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t\t\t[readonly]=\"readonly\"\n\t\t\t\t\t\t\t(change)=\"onChange($event)\"/>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"type !== 'simple' && !warn && !invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"calendar\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"invalid\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--invalid\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t*ngIf=\"!invalid && warn\"\n\t\t\t\t\t\t\t\tcdsIcon=\"warning--alt--filled\"\n\t\t\t\t\t\t\t\tsize=\"16\"\n\t\t\t\t\t\t\t\tclass=\"cds--date-picker__icon cds--date-picker__icon--warn\">\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\t*ngIf=\"helperText && !invalid && !warn\"\n\t\t\t\t\tclass=\"cds--form__helper-text\"\n\t\t\t\t\t[ngClass]=\"{'cds--form__helper-text--disabled': disabled}\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(helperText)\">{{helperText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(helperText)\" [ngTemplateOutlet]=\"helperText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"invalid\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(invalidText)\">{{invalidText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(invalidText)\" [ngTemplateOutlet]=\"invalidText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t\t<div *ngIf=\"!invalid && warn\" class=\"cds--form-requirement\">\n\t\t\t\t\t<ng-container *ngIf=\"!isTemplate(warnText)\">{{warnText}}</ng-container>\n\t\t\t\t\t<ng-template *ngIf=\"isTemplate(warnText)\" [ngTemplateOutlet]=\"warnText\"></ng-template>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n</div>\n\t`,\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: DatePickerInput,\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class DatePickerInput {\n\tprivate static datePickerCount = 0;\n\t/**\n\t * Select a calendar type for the `model`.\n\t * Internal purposes only.\n\t */\n\t@Input() type: \"simple\" | \"single\" | \"range\" = \"simple\";\n\n\t@Input() id = `datepicker-${DatePickerInput.datePickerCount++}`;\n\n\t@Input() hasIcon = false;\n\n\t@Input() label: string | TemplateRef<any>;\n\n\t@Input() placeholder = \"mm/dd/yyyy\";\n\n\t@Input() pattern = \"^\\\\d{1,2}/\\\\d{1,2}/\\\\d{4}$\";\n\n\t@Output() valueChange: EventEmitter<string> = new EventEmitter();\n\n\t/**\n\t * @deprecated since v5 - Use `cdsLayer` directive instead\n\t * Set to `\"light\"` to apply the light style\n\t */\n\t@Input() theme: \"light\" | \"dark\" = \"dark\";\n\n\t@Input() disabled = false;\n\n\t@Input() readonly = false;\n\t/**\n\t * Set to `true` for invalid state.\n\t */\n\t@Input() invalid = false;\n\t/**\n\t * Value displayed if dropdown is in invalid state.\n\t */\n\t@Input() invalidText: string | TemplateRef<any>;\n\t/**\n\t * Set to `true` to show a warning (contents set by warnText)\n\t */\n\t@Input() warn = false;\n\t/**\n\t * Sets the warning text\n\t */\n\t@Input() warnText: string | TemplateRef<any>;\n\n\t/**\n\t * Sets the optional helper text.\n\t */\n\t@Input() helperText: string | TemplateRef<any>;\n\n\t@Input() skeleton = false;\n\n\t@Input() value = \"\";\n\n\t@Input() size: \"sm\" | \"md\" | \"lg\" = \"md\";\n\n\t@ViewChild(\"input\") input: ElementRef;\n\n\tconstructor(protected elementRef: ElementRef) { }\n\n\tonChange(event) {\n\t\tthis.value = event.target.value;\n\t\tthis.valueChange.emit(this.value);\n\t\tthis.propagateChange(this.value);\n\t\tthis.onTouched();\n\t}\n\n\tpublic writeValue(value: any) {\n\t\tthis.value = value;\n\t}\n\n\tpublic registerOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tpublic registerOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\tpublic isTemplate(value) {\n\t\treturn value instanceof TemplateRef;\n\t}\n}\n",
|
|
27256
27274
|
"assetsDirs": [],
|
|
27257
27275
|
"styleUrlsData": "",
|
|
27258
27276
|
"stylesData": "",
|
|
@@ -27269,7 +27287,7 @@
|
|
|
27269
27287
|
"deprecationMessage": ""
|
|
27270
27288
|
}
|
|
27271
27289
|
],
|
|
27272
|
-
"line":
|
|
27290
|
+
"line": 162,
|
|
27273
27291
|
"jsdoctags": [
|
|
27274
27292
|
{
|
|
27275
27293
|
"name": "elementRef",
|
|
@@ -73150,7 +73168,7 @@
|
|
|
73150
73168
|
"deprecated": false,
|
|
73151
73169
|
"deprecationMessage": "",
|
|
73152
73170
|
"type": "",
|
|
73153
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\tid=\"initial-value-range-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeInvalid]=\"invalid\"\n\t\t\t[rangeInvalidText]=\"invalidText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t[value]=\"value\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\t[language]=\"language\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeWarn]=\"warn\"\n\t\t\t[rangeWarnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
73171
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\tid=\"initial-value-range-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeInvalid]=\"invalid\"\n\t\t\t[rangeInvalidText]=\"invalidText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t[value]=\"value\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\t[language]=\"language\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeWarn]=\"warn\"\n\t\t\t[rangeWarnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
73154
73172
|
},
|
|
73155
73173
|
{
|
|
73156
73174
|
"name": "RangeTemplate",
|
|
@@ -73565,7 +73583,7 @@
|
|
|
73565
73583
|
"deprecated": false,
|
|
73566
73584
|
"deprecationMessage": "",
|
|
73567
73585
|
"type": "",
|
|
73568
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\tid=\"initial-value-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[value]=\"value\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
73586
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\tid=\"initial-value-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[value]=\"value\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
73569
73587
|
},
|
|
73570
73588
|
{
|
|
73571
73589
|
"name": "Skeleton",
|
|
@@ -74005,7 +74023,7 @@
|
|
|
74005
74023
|
"deprecated": false,
|
|
74006
74024
|
"deprecationMessage": "",
|
|
74007
74025
|
"type": "",
|
|
74008
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-date-picker-input\n\t\t\t[theme]=\"theme\"\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker-input>\n\t`\n})"
|
|
74026
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-date-picker-input\n\t\t\t[theme]=\"theme\"\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker-input>\n\t`\n})"
|
|
74009
74027
|
},
|
|
74010
74028
|
{
|
|
74011
74029
|
"name": "Template",
|
|
@@ -78245,7 +78263,7 @@
|
|
|
78245
78263
|
"deprecated": false,
|
|
78246
78264
|
"deprecationMessage": "",
|
|
78247
78265
|
"type": "",
|
|
78248
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\tid=\"initial-value-range-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeInvalid]=\"invalid\"\n\t\t\t[rangeInvalidText]=\"invalidText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t[value]=\"value\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\t[language]=\"language\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeWarn]=\"warn\"\n\t\t\t[rangeWarnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
78266
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\tid=\"initial-value-range-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeInvalid]=\"invalid\"\n\t\t\t[rangeInvalidText]=\"invalidText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t[value]=\"value\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[rangeLabel]=\"label\"\n\t\t\t[size]=\"size\"\n\t\t\trange=\"true\"\n\t\t\t[language]=\"language\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[rangeWarn]=\"warn\"\n\t\t\t[rangeWarnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\"\n\t\t\t[helperText]=\"helperText\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
78249
78267
|
},
|
|
78250
78268
|
{
|
|
78251
78269
|
"name": "Single",
|
|
@@ -78265,7 +78283,7 @@
|
|
|
78265
78283
|
"deprecated": false,
|
|
78266
78284
|
"deprecationMessage": "",
|
|
78267
78285
|
"type": "",
|
|
78268
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\tid=\"initial-value-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[value]=\"value\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
78286
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<p>With initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\tid=\"initial-value-datepicker\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[value]=\"value\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t\t<p style=\"margin-top: 20px;\">Without initial value</p>\n\t\t<cds-date-picker\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[language]=\"language\"\n\t\t\t[size]=\"size\"\n\t\t\t[theme]=\"theme\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t[dateFormat]=\"dateFormat\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker>\n\t`\n})"
|
|
78269
78287
|
},
|
|
78270
78288
|
{
|
|
78271
78289
|
"name": "Skeleton",
|
|
@@ -78295,7 +78313,7 @@
|
|
|
78295
78313
|
"deprecated": false,
|
|
78296
78314
|
"deprecationMessage": "",
|
|
78297
78315
|
"type": "",
|
|
78298
|
-
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-date-picker-input\n\t\t\t[theme]=\"theme\"\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker-input>\n\t`\n})"
|
|
78316
|
+
"defaultValue": "(args) => ({\n\tprops: args,\n\ttemplate: `\n\t\t<cds-date-picker-input\n\t\t\t[theme]=\"theme\"\n\t\t\t[label]=\"label\"\n\t\t\t[placeholder]=\"placeholder\"\n\t\t\t[disabled]=\"disabled\"\n\t\t\t[readonly]=\"readonly\"\n\t\t\t[size]=\"size\"\n\t\t\t[invalid]=\"invalid\"\n\t\t\t[invalidText]=\"invalidText\"\n\t\t\t[warn]=\"warn\"\n\t\t\t[warnText]=\"warnText\"\n\t\t\t(valueChange)=\"valueChange($event)\">\n\t\t</cds-date-picker-input>\n\t`\n})"
|
|
78299
78317
|
}
|
|
78300
78318
|
],
|
|
78301
78319
|
"src/dropdown/dropdown.stories.ts": [
|
|
@@ -83843,8 +83861,8 @@
|
|
|
83843
83861
|
"type": "component",
|
|
83844
83862
|
"linktype": "component",
|
|
83845
83863
|
"name": "DatePickerInput",
|
|
83846
|
-
"coveragePercent":
|
|
83847
|
-
"coverageCount": "6/
|
|
83864
|
+
"coveragePercent": 21,
|
|
83865
|
+
"coverageCount": "6/28",
|
|
83848
83866
|
"status": "low"
|
|
83849
83867
|
},
|
|
83850
83868
|
{
|
|
@@ -83882,8 +83900,8 @@
|
|
|
83882
83900
|
"type": "component",
|
|
83883
83901
|
"linktype": "component",
|
|
83884
83902
|
"name": "DatePicker",
|
|
83885
|
-
"coveragePercent":
|
|
83886
|
-
"coverageCount": "20/
|
|
83903
|
+
"coveragePercent": 43,
|
|
83904
|
+
"coverageCount": "20/46",
|
|
83887
83905
|
"status": "medium"
|
|
83888
83906
|
},
|
|
83889
83907
|
{
|