carbon-components-angular 5.20.3 → 5.21.1

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.
Files changed (73) hide show
  1. package/datepicker/datepicker.component.d.ts +4 -39
  2. package/docs/documentation/components/DatePicker.html +108 -103
  3. package/docs/documentation/components/Hamburger.html +92 -20
  4. package/docs/documentation/coverage.html +3 -3
  5. package/docs/documentation/js/search/search_index.js +2 -2
  6. package/docs/documentation/modules/ComboBoxModule/dependencies.svg +4 -4
  7. package/docs/documentation/modules/ComboBoxModule.html +4 -4
  8. package/docs/documentation/modules/ContentSwitcherModule/dependencies.svg +4 -4
  9. package/docs/documentation/modules/ContentSwitcherModule.html +4 -4
  10. package/docs/documentation/modules/DatePickerInputModule/dependencies.svg +7 -7
  11. package/docs/documentation/modules/DatePickerInputModule.html +7 -7
  12. package/docs/documentation/modules/DatePickerModule/dependencies.svg +57 -53
  13. package/docs/documentation/modules/DatePickerModule.html +57 -53
  14. package/docs/documentation/modules/DialogModule/dependencies.svg +34 -34
  15. package/docs/documentation/modules/DialogModule.html +34 -34
  16. package/docs/documentation/modules/GridModule/dependencies.svg +60 -60
  17. package/docs/documentation/modules/GridModule.html +60 -60
  18. package/docs/documentation/modules/LoadingModule/dependencies.svg +4 -4
  19. package/docs/documentation/modules/LoadingModule.html +4 -4
  20. package/docs/documentation/modules/NFormsModule/dependencies.svg +4 -4
  21. package/docs/documentation/modules/NFormsModule.html +4 -4
  22. package/docs/documentation/modules/NumberModule/dependencies.svg +4 -4
  23. package/docs/documentation/modules/NumberModule.html +4 -4
  24. package/docs/documentation/modules/ProgressIndicatorModule/dependencies.svg +4 -4
  25. package/docs/documentation/modules/ProgressIndicatorModule.html +4 -4
  26. package/docs/documentation/modules/RadioModule/dependencies.svg +4 -4
  27. package/docs/documentation/modules/RadioModule.html +4 -4
  28. package/docs/documentation/modules/SearchModule/dependencies.svg +4 -4
  29. package/docs/documentation/modules/SearchModule.html +4 -4
  30. package/docs/documentation/modules/SelectModule/dependencies.svg +58 -58
  31. package/docs/documentation/modules/SelectModule.html +58 -58
  32. package/docs/documentation/modules/SliderModule/dependencies.svg +4 -4
  33. package/docs/documentation/modules/SliderModule.html +4 -4
  34. package/docs/documentation/modules/StructuredListModule/dependencies.svg +66 -66
  35. package/docs/documentation/modules/StructuredListModule.html +66 -66
  36. package/docs/documentation/modules/TabsModule/dependencies.svg +69 -69
  37. package/docs/documentation/modules/TabsModule.html +69 -69
  38. package/docs/documentation/modules/TagModule/dependencies.svg +4 -4
  39. package/docs/documentation/modules/TagModule.html +4 -4
  40. package/docs/documentation/modules/ThemeModule/dependencies.svg +4 -4
  41. package/docs/documentation/modules/ThemeModule.html +4 -4
  42. package/docs/documentation/modules/TilesModule/dependencies.svg +4 -4
  43. package/docs/documentation/modules/TilesModule.html +4 -4
  44. package/docs/documentation/modules/TimePickerModule/dependencies.svg +4 -4
  45. package/docs/documentation/modules/TimePickerModule.html +4 -4
  46. package/docs/documentation/modules/TimePickerSelectModule/dependencies.svg +42 -46
  47. package/docs/documentation/modules/TimePickerSelectModule.html +42 -46
  48. package/docs/documentation/modules/ToggleModule/dependencies.svg +20 -20
  49. package/docs/documentation/modules/ToggleModule.html +20 -20
  50. package/docs/documentation/modules/ToggletipModule/dependencies.svg +4 -4
  51. package/docs/documentation/modules/ToggletipModule.html +4 -4
  52. package/docs/documentation/modules/TooltipModule/dependencies.svg +28 -28
  53. package/docs/documentation/modules/TooltipModule.html +28 -28
  54. package/docs/documentation/modules/TreeviewModule/dependencies.svg +34 -34
  55. package/docs/documentation/modules/TreeviewModule.html +34 -34
  56. package/docs/documentation.json +98 -76
  57. package/docs/storybook/3348.35ca85d6.iframe.bundle.js +1 -0
  58. package/docs/storybook/iframe.html +2 -2
  59. package/docs/storybook/main.503cfdea.iframe.bundle.js +1 -0
  60. package/docs/storybook/project.json +1 -1
  61. package/docs/storybook/{runtime~main.a91352e8.iframe.bundle.js → runtime~main.386e82b8.iframe.bundle.js} +1 -1
  62. package/esm2020/datepicker/datepicker.component.mjs +1 -1
  63. package/esm2020/ui-shell/header/hamburger.component.mjs +19 -15
  64. package/fesm2015/carbon-components-angular-datepicker.mjs.map +1 -1
  65. package/fesm2015/carbon-components-angular-ui-shell.mjs +18 -14
  66. package/fesm2015/carbon-components-angular-ui-shell.mjs.map +1 -1
  67. package/fesm2020/carbon-components-angular-datepicker.mjs.map +1 -1
  68. package/fesm2020/carbon-components-angular-ui-shell.mjs +18 -14
  69. package/fesm2020/carbon-components-angular-ui-shell.mjs.map +1 -1
  70. package/package.json +1 -1
  71. package/ui-shell/header/hamburger.component.d.ts +9 -1
  72. package/docs/storybook/3348.65c12f97.iframe.bundle.js +0 -1
  73. package/docs/storybook/main.939e2f87.iframe.bundle.js +0 -1
@@ -25300,7 +25300,7 @@
25300
25300
  },
25301
25301
  {
25302
25302
  "name": "DatePicker",
25303
- "id": "component-DatePicker-1725045e700be17edf7bf7d8a40a8c9c210d2bb0213f874cbd88b0d4c2f36846d0491ff32f0a8c567b7f7ae4aa2bb15823fca28523744262f985fc77c55735f0",
25303
+ "id": "component-DatePicker-a0acdcd291094fa05e95aec1ac1063610bdca7b867bd0cd327320cae558fcba75a6e639fc0b87bf879dff2d0ac3560ca8671a8273adfc73866db2b4c16f15b89",
25304
25304
  "file": "src/datepicker/datepicker.component.ts",
25305
25305
  "encapsulation": [
25306
25306
  "ViewEncapsulation.None"
@@ -25328,7 +25328,7 @@
25328
25328
  "deprecationMessage": "",
25329
25329
  "rawdescription": "\n\nAria label added to datepicker's calendar container.\n",
25330
25330
  "description": "<p>Aria label added to datepicker&#39;s calendar container.</p>\n",
25331
- "line": 158,
25331
+ "line": 159,
25332
25332
  "type": "string",
25333
25333
  "decorators": []
25334
25334
  },
@@ -25339,7 +25339,7 @@
25339
25339
  "deprecationMessage": "",
25340
25340
  "rawdescription": "\n\nFormat of date\n\nFor reference: https://flatpickr.js.org/formatting/\n",
25341
25341
  "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",
25342
- "line": 138,
25342
+ "line": 139,
25343
25343
  "type": "string",
25344
25344
  "decorators": []
25345
25345
  },
@@ -25348,7 +25348,7 @@
25348
25348
  "defaultValue": "false",
25349
25349
  "deprecated": false,
25350
25350
  "deprecationMessage": "",
25351
- "line": 184,
25351
+ "line": 185,
25352
25352
  "type": "boolean",
25353
25353
  "decorators": []
25354
25354
  },
@@ -25356,15 +25356,15 @@
25356
25356
  "name": "flatpickrOptions",
25357
25357
  "deprecated": false,
25358
25358
  "deprecationMessage": "",
25359
- "line": 225,
25360
- "type": "any",
25359
+ "line": 226,
25360
+ "type": "Partial<Options>",
25361
25361
  "decorators": []
25362
25362
  },
25363
25363
  {
25364
25364
  "name": "helperText",
25365
25365
  "deprecated": false,
25366
25366
  "deprecationMessage": "",
25367
- "line": 149,
25367
+ "line": 150,
25368
25368
  "type": "string | TemplateRef<any>",
25369
25369
  "decorators": []
25370
25370
  },
@@ -25373,7 +25373,7 @@
25373
25373
  "defaultValue": "`datepicker-${DatePicker.datePickerCount++}`",
25374
25374
  "deprecated": false,
25375
25375
  "deprecationMessage": "",
25376
- "line": 165,
25376
+ "line": 166,
25377
25377
  "type": "string",
25378
25378
  "decorators": []
25379
25379
  },
@@ -25384,7 +25384,7 @@
25384
25384
  "deprecationMessage": "",
25385
25385
  "rawdescription": "\n\nThe pattern for the underlying input element\n",
25386
25386
  "description": "<p>The pattern for the underlying input element</p>\n",
25387
- "line": 163,
25387
+ "line": 164,
25388
25388
  "type": "string",
25389
25389
  "decorators": []
25390
25390
  },
@@ -25395,7 +25395,7 @@
25395
25395
  "deprecationMessage": "",
25396
25396
  "rawdescription": "\n\nSet to `true` to display the invalid state.\n",
25397
25397
  "description": "<p>Set to <code>true</code> to display the invalid state.</p>\n",
25398
- "line": 188,
25398
+ "line": 189,
25399
25399
  "type": "boolean",
25400
25400
  "decorators": []
25401
25401
  },
@@ -25405,7 +25405,7 @@
25405
25405
  "deprecationMessage": "",
25406
25406
  "rawdescription": "\n\nValue displayed if datepicker is in an invalid state.\n",
25407
25407
  "description": "<p>Value displayed if datepicker is in an invalid state.</p>\n",
25408
- "line": 192,
25408
+ "line": 193,
25409
25409
  "type": "string | TemplateRef<any>",
25410
25410
  "decorators": []
25411
25411
  },
@@ -25413,7 +25413,7 @@
25413
25413
  "name": "label",
25414
25414
  "deprecated": false,
25415
25415
  "deprecationMessage": "",
25416
- "line": 148,
25416
+ "line": 149,
25417
25417
  "type": "string | TemplateRef<any>",
25418
25418
  "decorators": []
25419
25419
  },
@@ -25424,7 +25424,7 @@
25424
25424
  "deprecationMessage": "",
25425
25425
  "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",
25426
25426
  "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",
25427
- "line": 146,
25427
+ "line": 147,
25428
25428
  "type": "string",
25429
25429
  "decorators": []
25430
25430
  },
@@ -25433,7 +25433,7 @@
25433
25433
  "defaultValue": "\"mm/dd/yyyy\"",
25434
25434
  "deprecated": false,
25435
25435
  "deprecationMessage": "",
25436
- "line": 153,
25436
+ "line": 154,
25437
25437
  "type": "string",
25438
25438
  "decorators": []
25439
25439
  },
@@ -25442,7 +25442,7 @@
25442
25442
  "defaultValue": "[]",
25443
25443
  "deprecated": false,
25444
25444
  "deprecationMessage": "",
25445
- "line": 222,
25445
+ "line": 223,
25446
25446
  "type": "{}",
25447
25447
  "decorators": []
25448
25448
  },
@@ -25453,7 +25453,7 @@
25453
25453
  "deprecationMessage": "",
25454
25454
  "rawdescription": "\n\nSelect calendar range mode\n",
25455
25455
  "description": "<p>Select calendar range mode</p>\n",
25456
- "line": 131,
25456
+ "line": 132,
25457
25457
  "type": "boolean",
25458
25458
  "decorators": []
25459
25459
  },
@@ -25461,7 +25461,7 @@
25461
25461
  "name": "rangeHelperText",
25462
25462
  "deprecated": false,
25463
25463
  "deprecationMessage": "",
25464
- "line": 150,
25464
+ "line": 151,
25465
25465
  "type": "string | TemplateRef<any>",
25466
25466
  "decorators": []
25467
25467
  },
@@ -25472,7 +25472,7 @@
25472
25472
  "deprecationMessage": "",
25473
25473
  "rawdescription": "\n\nSet to `true` to display the invalid state for the second datepicker input.\n",
25474
25474
  "description": "<p>Set to <code>true</code> to display the invalid state for the second datepicker input.</p>\n",
25475
- "line": 206,
25475
+ "line": 207,
25476
25476
  "type": "boolean",
25477
25477
  "decorators": []
25478
25478
  },
@@ -25482,7 +25482,7 @@
25482
25482
  "deprecationMessage": "",
25483
25483
  "rawdescription": "\n\nValue displayed if the second datepicker input is in an invalid state.\n",
25484
25484
  "description": "<p>Value displayed if the second datepicker input is in an invalid state.</p>\n",
25485
- "line": 210,
25485
+ "line": 211,
25486
25486
  "type": "string | TemplateRef<any>",
25487
25487
  "decorators": []
25488
25488
  },
@@ -25490,7 +25490,7 @@
25490
25490
  "name": "rangeLabel",
25491
25491
  "deprecated": false,
25492
25492
  "deprecationMessage": "",
25493
- "line": 151,
25493
+ "line": 152,
25494
25494
  "type": "string",
25495
25495
  "decorators": []
25496
25496
  },
@@ -25501,7 +25501,7 @@
25501
25501
  "deprecationMessage": "",
25502
25502
  "rawdescription": "\n\nSet to `true` to show a warning in the second datepicker input (contents set by rangeWarningText)\n",
25503
25503
  "description": "<p>Set to <code>true</code> to show a warning in the second datepicker input (contents set by rangeWarningText)</p>\n",
25504
- "line": 214,
25504
+ "line": 215,
25505
25505
  "type": "boolean",
25506
25506
  "decorators": []
25507
25507
  },
@@ -25511,7 +25511,7 @@
25511
25511
  "deprecationMessage": "",
25512
25512
  "rawdescription": "\n\nSets the warning text for the second datepicker input\n",
25513
25513
  "description": "<p>Sets the warning text for the second datepicker input</p>\n",
25514
- "line": 218,
25514
+ "line": 219,
25515
25515
  "type": "string | TemplateRef<any>",
25516
25516
  "decorators": []
25517
25517
  },
@@ -25520,7 +25520,7 @@
25520
25520
  "defaultValue": "\"md\"",
25521
25521
  "deprecated": false,
25522
25522
  "deprecationMessage": "",
25523
- "line": 202,
25523
+ "line": 203,
25524
25524
  "type": "\"sm\" | \"md\" | \"lg\"",
25525
25525
  "decorators": []
25526
25526
  },
@@ -25529,7 +25529,7 @@
25529
25529
  "defaultValue": "false",
25530
25530
  "deprecated": false,
25531
25531
  "deprecationMessage": "",
25532
- "line": 220,
25532
+ "line": 221,
25533
25533
  "type": "boolean",
25534
25534
  "decorators": []
25535
25535
  },
@@ -25540,15 +25540,15 @@
25540
25540
  "deprecationMessage": "since v5 - Use `cdsLayer` directive instead\nSet to `\"light\"` to apply the light style",
25541
25541
  "jsdoctags": [
25542
25542
  {
25543
- "pos": 4527,
25544
- "end": 4631,
25543
+ "pos": 4583,
25544
+ "end": 4687,
25545
25545
  "flags": 8421376,
25546
25546
  "modifierFlagsCache": 0,
25547
25547
  "transformFlags": 0,
25548
25548
  "kind": 334,
25549
25549
  "tagName": {
25550
- "pos": 4528,
25551
- "end": 4538,
25550
+ "pos": 4584,
25551
+ "end": 4594,
25552
25552
  "flags": 8421376,
25553
25553
  "modifierFlagsCache": 0,
25554
25554
  "transformFlags": 0,
@@ -25558,7 +25558,7 @@
25558
25558
  "comment": "<p>since v5 - Use <code>cdsLayer</code> directive instead\nSet to <code>&quot;light&quot;</code> to apply the light style</p>\n"
25559
25559
  }
25560
25560
  ],
25561
- "line": 182,
25561
+ "line": 183,
25562
25562
  "type": "\"light\" | \"dark\"",
25563
25563
  "decorators": []
25564
25564
  },
@@ -25566,7 +25566,7 @@
25566
25566
  "name": "value",
25567
25567
  "deprecated": false,
25568
25568
  "deprecationMessage": "",
25569
- "line": 167,
25569
+ "line": 168,
25570
25570
  "type": "[]",
25571
25571
  "decorators": []
25572
25572
  },
@@ -25577,7 +25577,7 @@
25577
25577
  "deprecationMessage": "",
25578
25578
  "rawdescription": "\n\nSet to `true` to show a warning (contents set by warningText)\n",
25579
25579
  "description": "<p>Set to <code>true</code> to show a warning (contents set by warningText)</p>\n",
25580
- "line": 196,
25580
+ "line": 197,
25581
25581
  "type": "boolean",
25582
25582
  "decorators": []
25583
25583
  },
@@ -25587,7 +25587,7 @@
25587
25587
  "deprecationMessage": "",
25588
25588
  "rawdescription": "\n\nSets the warning text\n",
25589
25589
  "description": "<p>Sets the warning text</p>\n",
25590
- "line": 200,
25590
+ "line": 201,
25591
25591
  "type": "string | TemplateRef<any>",
25592
25592
  "decorators": []
25593
25593
  }
@@ -25600,7 +25600,7 @@
25600
25600
  "deprecationMessage": "",
25601
25601
  "rawdescription": "\n\nWe are overriding onClose event even if users pass it via flatpickr options\nEmits an event when date picker closes\n",
25602
25602
  "description": "<p>We are overriding onClose event even if users pass it via flatpickr options\nEmits an event when date picker closes</p>\n",
25603
- "line": 250,
25603
+ "line": 251,
25604
25604
  "type": "EventEmitter<any>"
25605
25605
  },
25606
25606
  {
@@ -25608,7 +25608,7 @@
25608
25608
  "defaultValue": "new EventEmitter()",
25609
25609
  "deprecated": false,
25610
25610
  "deprecationMessage": "",
25611
- "line": 244,
25611
+ "line": 245,
25612
25612
  "type": "EventEmitter<any>"
25613
25613
  }
25614
25614
  ],
@@ -25620,7 +25620,7 @@
25620
25620
  "type": "DatePickerInput",
25621
25621
  "optional": false,
25622
25622
  "description": "",
25623
- "line": 241,
25623
+ "line": 242,
25624
25624
  "decorators": [
25625
25625
  {
25626
25626
  "name": "ViewChild",
@@ -25639,7 +25639,7 @@
25639
25639
  "type": "function",
25640
25640
  "optional": false,
25641
25641
  "description": "",
25642
- "line": 405
25642
+ "line": 406
25643
25643
  },
25644
25644
  {
25645
25645
  "name": "propagateChange",
@@ -25649,7 +25649,7 @@
25649
25649
  "type": "",
25650
25650
  "optional": false,
25651
25651
  "description": "",
25652
- "line": 407
25652
+ "line": 408
25653
25653
  },
25654
25654
  {
25655
25655
  "name": "rangeInput",
@@ -25658,7 +25658,7 @@
25658
25658
  "type": "DatePickerInput",
25659
25659
  "optional": false,
25660
25660
  "description": "",
25661
- "line": 242,
25661
+ "line": 243,
25662
25662
  "decorators": [
25663
25663
  {
25664
25664
  "name": "ViewChild",
@@ -25677,7 +25677,7 @@
25677
25677
  "optional": false,
25678
25678
  "returnType": "void",
25679
25679
  "typeParameters": [],
25680
- "line": 354,
25680
+ "line": 355,
25681
25681
  "deprecated": false,
25682
25682
  "deprecationMessage": "",
25683
25683
  "decorators": [
@@ -25696,7 +25696,7 @@
25696
25696
  "optional": false,
25697
25697
  "returnType": "void",
25698
25698
  "typeParameters": [],
25699
- "line": 369,
25699
+ "line": 370,
25700
25700
  "deprecated": false,
25701
25701
  "deprecationMessage": "",
25702
25702
  "decorators": [
@@ -25722,7 +25722,7 @@
25722
25722
  "optional": false,
25723
25723
  "returnType": "void",
25724
25724
  "typeParameters": [],
25725
- "line": 435,
25725
+ "line": 436,
25726
25726
  "deprecated": false,
25727
25727
  "deprecationMessage": "",
25728
25728
  "rawdescription": "\n\nHandles the `valueChange` event from the range input\n",
@@ -25752,7 +25752,7 @@
25752
25752
  "optional": false,
25753
25753
  "returnType": "void",
25754
25754
  "typeParameters": [],
25755
- "line": 420,
25755
+ "line": 421,
25756
25756
  "deprecated": false,
25757
25757
  "deprecationMessage": "",
25758
25758
  "rawdescription": "\n\nHandles the `valueChange` event from the primary/single input\n",
@@ -25782,7 +25782,7 @@
25782
25782
  "optional": false,
25783
25783
  "returnType": "void",
25784
25784
  "typeParameters": [],
25785
- "line": 446,
25785
+ "line": 447,
25786
25786
  "deprecated": false,
25787
25787
  "deprecationMessage": "",
25788
25788
  "rawdescription": "\n\nHandles opening the calendar \"properly\" when the calendar icon is clicked.\n",
@@ -25812,7 +25812,7 @@
25812
25812
  "optional": false,
25813
25813
  "returnType": "void",
25814
25814
  "typeParameters": [],
25815
- "line": 397,
25815
+ "line": 398,
25816
25816
  "deprecated": false,
25817
25817
  "deprecationMessage": "",
25818
25818
  "jsdoctags": [
@@ -25840,7 +25840,7 @@
25840
25840
  "optional": false,
25841
25841
  "returnType": "void",
25842
25842
  "typeParameters": [],
25843
- "line": 401,
25843
+ "line": 402,
25844
25844
  "deprecated": false,
25845
25845
  "deprecationMessage": "",
25846
25846
  "jsdoctags": [
@@ -25868,7 +25868,7 @@
25868
25868
  "optional": false,
25869
25869
  "returnType": "void",
25870
25870
  "typeParameters": [],
25871
- "line": 393,
25871
+ "line": 394,
25872
25872
  "deprecated": false,
25873
25873
  "deprecationMessage": "",
25874
25874
  "rawdescription": "\n\n`ControlValueAccessor` method to programmatically disable the DatePicker.\n\nex: `this.formGroup.get(\"myDatePicker\").disable();`\n\n",
@@ -25876,8 +25876,8 @@
25876
25876
  "jsdoctags": [
25877
25877
  {
25878
25878
  "name": {
25879
- "pos": 11055,
25880
- "end": 11065,
25879
+ "pos": 11165,
25880
+ "end": 11175,
25881
25881
  "flags": 8421376,
25882
25882
  "modifierFlagsCache": 0,
25883
25883
  "transformFlags": 0,
@@ -25888,8 +25888,8 @@
25888
25888
  "deprecated": false,
25889
25889
  "deprecationMessage": "",
25890
25890
  "tagName": {
25891
- "pos": 11049,
25892
- "end": 11054,
25891
+ "pos": 11159,
25892
+ "end": 11164,
25893
25893
  "flags": 8421376,
25894
25894
  "modifierFlagsCache": 0,
25895
25895
  "transformFlags": 0,
@@ -25913,7 +25913,7 @@
25913
25913
  "optional": false,
25914
25914
  "returnType": "void",
25915
25915
  "typeParameters": [],
25916
- "line": 377,
25916
+ "line": 378,
25917
25917
  "deprecated": false,
25918
25918
  "deprecationMessage": "",
25919
25919
  "rawdescription": "\n\nWrites a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n",
@@ -25921,8 +25921,8 @@
25921
25921
  "jsdoctags": [
25922
25922
  {
25923
25923
  "name": {
25924
- "pos": 10654,
25925
- "end": 10659,
25924
+ "pos": 10764,
25925
+ "end": 10769,
25926
25926
  "flags": 8421376,
25927
25927
  "modifierFlagsCache": 0,
25928
25928
  "transformFlags": 0,
@@ -25933,8 +25933,8 @@
25933
25933
  "deprecated": false,
25934
25934
  "deprecationMessage": "",
25935
25935
  "tagName": {
25936
- "pos": 10648,
25937
- "end": 10653,
25936
+ "pos": 10758,
25937
+ "end": 10763,
25938
25938
  "flags": 8421376,
25939
25939
  "modifierFlagsCache": 0,
25940
25940
  "transformFlags": 0,
@@ -25956,7 +25956,7 @@
25956
25956
  "argsDecorator": [],
25957
25957
  "deprecated": false,
25958
25958
  "deprecationMessage": "",
25959
- "line": 354
25959
+ "line": 355
25960
25960
  },
25961
25961
  {
25962
25962
  "name": "focusout",
@@ -25964,7 +25964,7 @@
25964
25964
  "argsDecorator": [],
25965
25965
  "deprecated": false,
25966
25966
  "deprecationMessage": "",
25967
- "line": 369
25967
+ "line": 370
25968
25968
  }
25969
25969
  ],
25970
25970
  "standalone": false,
@@ -25972,7 +25972,7 @@
25972
25972
  "description": "<p>Get started with importing the module:</p>\n<div><pre class=\"line-numbers\"><code class=\"language-typescript\">import { DatePickerModule } from &#39;carbon-components-angular&#39;;</code></pre></div><p><a href=\"../../?path=/story/components-date-picker--single\">See demo</a></p>\n",
25973
25973
  "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",
25974
25974
  "type": "component",
25975
- "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 { 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) {\n\t\tthis._flatpickrOptions = Object.assign({}, this._flatpickrOptions, options);\n\t}\n\tget flatpickrOptions() {\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 = {\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\tif (this.flatpickrInstance.selectedDates.length !== 2) {\n\t\t\t\t\t// we could `this.flatpickrInstance.clear()` but it insists on opening the second picker\n\t\t\t\t\t// in some cases, so instead we do this\n\t\t\t\t\tthis.setDateValues([]);\n\t\t\t\t\tthis.doSelect([]);\n\t\t\t\t\treturn;\n\t\t\t\t}\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)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"region\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n}\n",
25975
+ "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\tif (this.flatpickrInstance.selectedDates.length !== 2) {\n\t\t\t\t\t// we could `this.flatpickrInstance.clear()` but it insists on opening the second picker\n\t\t\t\t\t// in some cases, so instead we do this\n\t\t\t\t\tthis.setDateValues([]);\n\t\t\t\t\tthis.doSelect([]);\n\t\t\t\t\treturn;\n\t\t\t\t}\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)]);\n\t\t\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.onClose.emit(date);\n\t\t},\n\t\tonDayCreate: (_dObj, _dStr, _fp, dayElem) => {\n\t\t\tdayElem.classList.add(\"cds--date-picker__day\");\n\t\t},\n\t\tnextArrow: this.rightArrowHTML(),\n\t\tprevArrow: this.leftArrowHTML(),\n\t\tvalue: this.value\n\t};\n\n\tprotected flatpickrInstance = null;\n\n\tconstructor(\n\t\tprotected elementRef: ElementRef,\n\t\tprotected i18n: I18n\n\t) { }\n\n\tngOnInit() {\n\t\t// if i18n is set to anything other than en we'll want to change the language\n\t\t// otherwise we'll just use the local setting\n\t\tif (this.i18n.getLocale() !== \"en\") {\n\t\t\tthis.i18n.getLocaleObservable().subscribe(locale => {\n\t\t\t\tthis.language = locale;\n\t\t\t\tthis.resetFlatpickrInstance();\n\t\t\t});\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges) {\n\t\t// Reset the flatpickr instance on input changes that affect flatpickr.\n\t\tconst flatpickrChangeKeys = [\n\t\t\t\"range\",\n\t\t\t\"dateFormat\",\n\t\t\t\"language\",\n\t\t\t\"id\",\n\t\t\t\"value\",\n\t\t\t\"plugins\",\n\t\t\t\"flatpickrOptions\"\n\t\t];\n\t\tconst changeKeys = Object.keys(changes);\n\t\tif (changeKeys.some(key => flatpickrChangeKeys.includes(key))) {\n\t\t\tthis.resetFlatpickrInstance(changes.value);\n\t\t}\n\t}\n\n\tngAfterViewInit() {\n\t\tsetTimeout(() => {\n\t\t\tthis.addInputListeners();\n\t\t}, 0);\n\t}\n\n\t// because the actual view may be delayed in loading (think projection into a tab pane)\n\t// and because we rely on a library that operates outside the Angular view of the world\n\t// we need to keep trying to load the library, until the relevant DOM is actually live\n\tngAfterViewChecked() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\t// if (and only if) the initialization succeeded, we can set the date values\n\t\t\tif (this.isFlatpickrLoaded()) {\n\t\t\t\tif (this.value.length > 0) {\n\t\t\t\t\tthis.setDateValues(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusin\")\n\tonFocus() {\n\t\t// Updates the month manually when calendar mode is range because month\n\t\t// will not update properly without manually updating them on focus.\n\t\tif (this.range) {\n\t\t\tif (this.rangeInput.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[1].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t} else if (this.input.input.nativeElement === document.activeElement && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t@HostListener(\"focusout\")\n\tonFocusOut() {\n\t\tthis.onTouched();\n\t}\n\n\t/**\n\t * Writes a value from the model to the component. Expects the value to be `null` or `(Date | string)[]`\n\t * @param value value received from the model\n\t */\n\twriteValue(value: (Date | string)[]) {\n\t\tthis.value = value;\n\t\tsetTimeout(() => {\n\t\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.config) {\n\t\t\t\tthis.setDateValues(this.value);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * `ControlValueAccessor` method to programmatically disable the DatePicker.\n\t *\n\t * ex: `this.formGroup.get(\"myDatePicker\").disable();`\n\t *\n\t * @param isDisabled `true` to disable the DatePicker\n\t */\n\tsetDisabledState(isDisabled: boolean) {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\tregisterOnChange(fn: any) {\n\t\tthis.propagateChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any) {\n\t\tthis.onTouched = fn;\n\t}\n\n\tonTouched: () => any = () => { };\n\n\tpropagateChange = (_: any) => { };\n\n\t/**\n\t * Cleans up our flatpickr instance\n\t */\n\tngOnDestroy() {\n\t\tif (!this.isFlatpickrLoaded()) { return; }\n\t\tthis.flatpickrInstance.destroy();\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the primary/single input\n\t */\n\tonValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tif (this.range) {\n\t\t\t\tthis.setDateValues([date, this.flatpickrInstance.selectedDates[1]]);\n\t\t\t} else {\n\t\t\t\tthis.setDateValues([date]);\n\t\t\t}\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `valueChange` event from the range input\n\t */\n\tonRangeValueChange(event: string) {\n\t\tif (this.isFlatpickrLoaded() && this.flatpickrInstance.isOpen) {\n\t\t\tconst date = this.flatpickrInstance.parseDate(event, this.dateFormat);\n\t\t\tthis.setDateValues([this.flatpickrInstance.selectedDates[0], date]);\n\t\t\tthis.doSelect(this.flatpickrInstance.selectedDates);\n\t\t}\n\t}\n\n\t/**\n\t * Handles opening the calendar \"properly\" when the calendar icon is clicked.\n\t */\n\topenCalendar(datepickerInput: DatePickerInput) {\n\t\tif (this.range) {\n\t\t\tdatepickerInput.input.nativeElement.click();\n\n\t\t\t// If the first input's calendar icon is clicked when calendar is in range mode, then\n\t\t\t// the month and year needs to be manually changed to the current selected month and\n\t\t\t// year otherwise the calendar view will not be updated upon opening.\n\t\t\tif (datepickerInput === this.input && this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t\tthis.flatpickrInstance.currentYear = this.flatpickrInstance.selectedDates[0].getFullYear();\n\t\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single-mode flatpickr handles mousedown but not click, so nativeElement.click() won't\n\t\t\t// work when the calendar icon is clicked. In this case we simply use flatpickr.open().\n\t\t\tthis.flatpickrInstance.open();\n\t\t}\n\t}\n\n\tprotected updateCalendarListeners() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.removeEventListener(\"click\", this.preventCalendarClose);\n\t\t\tcalendar.addEventListener(\"click\", this.preventCalendarClose);\n\t\t});\n\t}\n\n\t/**\n\t * Handles the initialization of event listeners for the datepicker input and range input fields.\n\t */\n\tprotected addInputListeners() {\n\t\tif (!this.isFlatpickrLoaded()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows focus transition from the datepicker input or range input field to\n\t\t// flatpickr calendar using a keyboard.\n\t\tconst addFocusCalendarListener = (element: HTMLInputElement) => {\n\t\t\telement.addEventListener(\"keydown\", (event: KeyboardEvent) => {\n\t\t\t\tif (event.key === \"Escape\") {\n\t\t\t\t\tthis.flatpickrInstance.close();\n\t\t\t\t}\n\t\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\t\tif (!this.flatpickrInstance.isOpen) {\n\t\t\t\t\t\tthis.flatpickrInstance.open();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst calendarContainer = this.flatpickrInstance.calendarContainer;\n\t\t\t\t\tconst dayElement = calendarContainer && calendarContainer.querySelector(\".flatpickr-day[tabindex]\");\n\n\t\t\t\t\tif (dayElement) {\n\t\t\t\t\t\tdayElement.focus();\n\n\t\t\t\t\t\t// If the user manually inputs a value into the date field and presses arrow down,\n\t\t\t\t\t\t// datepicker input onchange will be triggered when focus is removed from it and\n\t\t\t\t\t\t// `flatpickrInstance.setDate` and `flatpickrInstance.changeMonth` will be invoked\n\t\t\t\t\t\t// which will automatically change focus to the beginning of the document.\n\t\t\t\t\t\tif (document.activeElement !== dayElement && this.flatpickrInstance.selectedDateElem) {\n\t\t\t\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\tif (this.input && this.input.input) {\n\t\t\taddFocusCalendarListener(this.input.input.nativeElement);\n\t\t}\n\n\t\tif (this.rangeInput && this.rangeInput.input) {\n\t\t\taddFocusCalendarListener(this.rangeInput.input.nativeElement);\n\t\t}\n\t}\n\n\t/**\n\t * Resets the flatpickr instance while keeping the date values (or updating them if newDates is provided)\n\t *\n\t * Used to pick up input changes or locale changes.\n\t *\n\t * @param newDates An optional SimpleChange of date values\n\t */\n\tprotected resetFlatpickrInstance(newDates?: SimpleChange) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tlet dates = this.flatpickrInstance.selectedDates;\n\t\t\tif (newDates && this.didDateValueChange(newDates.currentValue, newDates.previousValue)) {\n\t\t\t\tdates = newDates.currentValue;\n\t\t\t}\n\t\t\t// only reset the flatpickr instance on Input changes\n\t\t\t// @ts-ignore ts is unhappy with the below call to `flatpickr`\n\t\t\tthis.flatpickrInstance = flatpickr(`#${this.id}-input`, this.flatpickrOptions);\n\t\t\tthis.setDateValues(dates);\n\t\t}\n\t}\n\n\t/**\n\t * Carbon uses a number of specific classnames for parts of the flatpickr - this idempotent method applies them if needed.\n\t */\n\tprotected updateClassNames() {\n\t\tif (!this.elementRef) { return; }\n\t\t// get all the possible flatpickrs in the document - we need to add classes to (potentially) all of them\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tconst monthContainer = document.querySelectorAll(\".flatpickr-month\");\n\t\tconst weekdaysContainer = document.querySelectorAll(\".flatpickr-weekdays\");\n\t\tconst weekdayContainer = document.querySelectorAll(\".flatpickr-weekday\");\n\t\tconst daysContainer = document.querySelectorAll(\".flatpickr-days\");\n\t\tconst dayContainer = document.querySelectorAll(\".flatpickr-day\");\n\n\t\t// add classes to lists of elements\n\t\tconst addClassIfNotExists = (classname: string, elementList: NodeListOf<Element>) => {\n\t\t\tArray.from(elementList).forEach(element => {\n\t\t\t\tif (!element.classList.contains(classname)) {\n\t\t\t\t\telement.classList.add(classname);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// add classes (but only if they don't exist, small perf win)\n\t\taddClassIfNotExists(\"cds--date-picker__calendar\", calendarContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__month\", monthContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__weekdays\", weekdaysContainer);\n\t\taddClassIfNotExists(\"cds--date-picker__days\", daysContainer);\n\n\t\t// add weekday classes and format the text\n\t\tArray.from(weekdayContainer).forEach(element => {\n\t\t\telement.innerHTML = element.innerHTML.replace(/\\s+/g, \"\");\n\t\t\telement.classList.add(\"cds--date-picker__weekday\");\n\t\t});\n\n\t\t// add day classes and special case the \"today\" element based on `this.value`\n\t\tArray.from(dayContainer).forEach(element => {\n\t\t\telement.classList.add(\"cds--date-picker__day\");\n\t\t\tif (!this.value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (element.classList.contains(\"today\") && this.value.length > 0) {\n\t\t\t\telement.classList.add(\"no-border\");\n\t\t\t} else if (element.classList.contains(\"today\") && this.value.length === 0) {\n\t\t\t\telement.classList.remove(\"no-border\");\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected updateAttributes() {\n\t\tconst calendarContainer = document.querySelectorAll(\".flatpickr-calendar\");\n\t\tArray.from(calendarContainer).forEach(calendar => {\n\t\t\tcalendar.setAttribute(\"role\", \"region\");\n\t\t\tcalendar.setAttribute(\"aria-label\", this.ariaLabel);\n\t\t});\n\t}\n\n\t/**\n\t * Applies the given date value array to both the flatpickr instance and the `input`(s)\n\t * @param dates the date values to apply\n\t */\n\tprotected setDateValues(dates: (Date | string)[]) {\n\t\tif (this.isFlatpickrLoaded()) {\n\t\t\tconst singleInput = this.elementRef.nativeElement.querySelector(`#${this.id}-input`);\n\t\t\tconst rangeInput = this.elementRef.nativeElement.querySelector(`#${this.id}-rangeInput`);\n\n\t\t\t// `flatpickrInstance.setDate` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.setDate` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\t// set the date on the instance\n\t\t\tthis.flatpickrInstance.setDate(dates);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\tlet singleDate = \"\";\n\t\t\t// if date is a string, parse and format\n\t\t\tif (typeof this.flatpickrInstance.selectedDates[0] === \"string\") {\n\t\t\t\tsingleDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(singleDate, this.dateFormat);\n\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t} else if (!!this.flatpickrInstance.selectedDates[0]) {\n\t\t\t\tsingleDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[0], this.dateFormat);\n\t\t\t}\n\n\t\t\tif (rangeInput) {\n\t\t\t\t// we can either set a date value or an empty string, so we start with an empty string\n\t\t\t\tlet rangeDate = \"\";\n\t\t\t\t// if date is a string, parse and format\n\t\t\t\tif (typeof this.flatpickrInstance.selectedDates[1] === \"string\") {\n\t\t\t\t\trangeDate = this.flatpickrInstance.parseDate(this.flatpickrInstance.selectedDates[1].toString(), this.dateFormat);\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(rangeDate, this.dateFormat);\n\t\t\t\t// if date is not a string we can assume it's a Date and we should format\n\t\t\t\t} else if (!!this.flatpickrInstance.selectedDates[1]) {\n\t\t\t\t\trangeDate = this.flatpickrInstance.formatDate(this.flatpickrInstance.selectedDates[1], this.dateFormat);\n\t\t\t\t}\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t// apply the values\n\t\t\t\t\trangeInput.value = rangeDate;\n\t\t\t\t\tsingleInput.value = singleDate;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected preventCalendarClose = event => event.stopPropagation();\n\n\tprotected doSelect(selectedValue: (Date | string)[]) {\n\t\t// In range mode, if a date is selected from the first calendar that is from the previous month,\n\t\t// the month will not be updated on the calendar until the calendar is re-opened.\n\t\t// This will make sure the calendar is updated with the correct month.\n\t\tif (this.range && this.flatpickrInstance.selectedDates[0]) {\n\t\t\tconst currentMonth = this.flatpickrInstance.selectedDates[0].getMonth();\n\n\t\t\t// `flatpickrInstance.changeMonth` removes the focus on the selected date element and will\n\t\t\t// automatically change focus to the beginning of the document. If a selected date is\n\t\t\t// focused before `flatpickrInstance.changeMonth` is invoked then it should remain focused.\n\t\t\tlet shouldRefocusDateElement = this.flatpickrInstance.selectedDateElem === document.activeElement;\n\n\t\t\tthis.flatpickrInstance.changeMonth(currentMonth, false);\n\n\t\t\tif (shouldRefocusDateElement) {\n\t\t\t\tthis.flatpickrInstance.selectedDateElem.focus();\n\t\t\t}\n\n\t\t}\n\t\tthis.valueChange.emit(selectedValue);\n\t\tthis.propagateChange(selectedValue);\n\t}\n\n\tprotected didDateValueChange(currentValue, previousValue) {\n\t\treturn currentValue[0] !== previousValue[0] || currentValue[1] !== previousValue[1];\n\t}\n\n\t/**\n\t * More advanced checking of the loaded state of flatpickr\n\t */\n\tprotected isFlatpickrLoaded() {\n\t\t// cast the instance to a boolean, and some method that has to exist for the library to be loaded in this case `setDate`\n\t\treturn !!this.flatpickrInstance && !!this.flatpickrInstance.setDate;\n\t}\n\n\t/**\n\t * Right arrow HTML passed to flatpickr\n\t */\n\tprotected rightArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n\n\t/**\n\t * Left arrow HTML passed to flatpickr\n\t */\n\tprotected leftArrowHTML() {\n\t\treturn `\n\t\t\t<svg width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\">\n\t\t\t\t<polygon points=\"5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 \"/>\n\t\t\t\t<rect width=\"16\" height=\"16\" style=\"fill:none\" />\n\t\t\t</svg>`;\n\t}\n}\n",
25976
25976
  "assetsDirs": [],
25977
25977
  "styleUrlsData": "",
25978
25978
  "stylesData": "",
@@ -25995,7 +25995,7 @@
25995
25995
  "deprecationMessage": ""
25996
25996
  }
25997
25997
  ],
25998
- "line": 296,
25998
+ "line": 297,
25999
25999
  "jsdoctags": [
26000
26000
  {
26001
26001
  "name": "elementRef",
@@ -26041,7 +26041,7 @@
26041
26041
  }
26042
26042
  ],
26043
26043
  "returnType": "void",
26044
- "line": 167,
26044
+ "line": 168,
26045
26045
  "jsdoctags": [
26046
26046
  {
26047
26047
  "name": "v",
@@ -26058,7 +26058,7 @@
26058
26058
  "name": "value",
26059
26059
  "type": "",
26060
26060
  "returnType": "",
26061
- "line": 174
26061
+ "line": 175
26062
26062
  }
26063
26063
  },
26064
26064
  "flatpickrOptions": {
@@ -26071,17 +26071,17 @@
26071
26071
  "args": [
26072
26072
  {
26073
26073
  "name": "options",
26074
- "type": "",
26074
+ "type": "Partial<Options>",
26075
26075
  "deprecated": false,
26076
26076
  "deprecationMessage": ""
26077
26077
  }
26078
26078
  ],
26079
26079
  "returnType": "void",
26080
- "line": 225,
26080
+ "line": 226,
26081
26081
  "jsdoctags": [
26082
26082
  {
26083
26083
  "name": "options",
26084
- "type": "",
26084
+ "type": "Partial<Options>",
26085
26085
  "deprecated": false,
26086
26086
  "deprecationMessage": "",
26087
26087
  "tagName": {
@@ -26093,8 +26093,8 @@
26093
26093
  "getSignature": {
26094
26094
  "name": "flatpickrOptions",
26095
26095
  "type": "",
26096
- "returnType": "",
26097
- "line": 228
26096
+ "returnType": "Partial<Options>",
26097
+ "line": 229
26098
26098
  }
26099
26099
  }
26100
26100
  }
@@ -31643,7 +31643,7 @@
31643
31643
  },
31644
31644
  {
31645
31645
  "name": "Hamburger",
31646
- "id": "component-Hamburger-3eb24e9eb1124c8246337e3ebe12e8bafa9fa945597fb3d82dbe6808fda6b5a61f077633036672d3577775a91b861f62e1736697a099514a0a823f329c32a395",
31646
+ "id": "component-Hamburger-ee42e761f8e5ddaa77ba0ce22087ef43711640c0f5c17eb6e91d38d90844446256c784045c38a10b865260759eb8e19a21c2c41b2325ff77d606fe6b6350b9b1",
31647
31647
  "file": "src/ui-shell/header/hamburger.component.ts",
31648
31648
  "encapsulation": [],
31649
31649
  "entryComponents": [],
@@ -31653,7 +31653,7 @@
31653
31653
  "selector": "cds-hamburger, ibm-hamburger",
31654
31654
  "styleUrls": [],
31655
31655
  "styles": [],
31656
- "template": "<button\n\ttype=\"button\"\n\t(click)=\"doClick()\"\n\t[ngClass]=\"{'cds--header__action--active': active}\"\n\tclass=\"cds--header__menu-trigger cds--header__action cds--header__menu-toggle\"\n\t[attr.aria-label]=\"active\n\t\t? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)\n\t\t: (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)\"\n\t[attr.title]=\"active\n\t\t? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)\n\t\t: (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)\">\n\t<svg *ngIf=\"!active\" cdsIcon=\"menu\" size=\"20\"></svg>\n\t<svg *ngIf=\"active\" cdsIcon=\"close\" size=\"20\"></svg>\n</button>\n\t",
31656
+ "template": "<button\n\ttype=\"button\"\n\t(click)=\"doClick()\"\n\t[ngClass]=\"{'cds--header__action--active': active}\"\n\tclass=\"cds--header__menu-trigger cds--header__action cds--header__menu-toggle\"\n\t[attr.aria-label]=\"active ? activeTitle : inactiveTitle\"\n\t[attr.title]=\"active ? activeTitle : inactiveTitle\">\n\t<svg *ngIf=\"!active\" cdsIcon=\"menu\" size=\"20\"></svg>\n\t<svg *ngIf=\"active\" cdsIcon=\"close\" size=\"20\"></svg>\n</button>\n\t",
31657
31657
  "templateUrl": [],
31658
31658
  "viewProviders": [],
31659
31659
  "hostDirectives": [],
@@ -31665,9 +31665,31 @@
31665
31665
  "deprecationMessage": "",
31666
31666
  "rawdescription": "\n\nControls the active/selected state for the `Hamburger` menu.\n",
31667
31667
  "description": "<p>Controls the active/selected state for the <code>Hamburger</code> menu.</p>\n",
31668
- "line": 35,
31668
+ "line": 31,
31669
31669
  "type": "boolean",
31670
31670
  "decorators": []
31671
+ },
31672
+ {
31673
+ "name": "activeTitle",
31674
+ "defaultValue": "this.i18n.get().UI_SHELL.HEADER.CLOSE_MENU",
31675
+ "deprecated": false,
31676
+ "deprecationMessage": "",
31677
+ "rawdescription": "\n\nSet the title text when the hamburger is active\n",
31678
+ "description": "<p>Set the title text when the hamburger is active</p>\n",
31679
+ "line": 36,
31680
+ "type": "any",
31681
+ "decorators": []
31682
+ },
31683
+ {
31684
+ "name": "inactiveTitle",
31685
+ "defaultValue": "this.i18n.get().UI_SHELL.HEADER.OPEN_MENU",
31686
+ "deprecated": false,
31687
+ "deprecationMessage": "",
31688
+ "rawdescription": "\n\nSet the title text when the hamburger is inactive\n",
31689
+ "description": "<p>Set the title text when the hamburger is inactive</p>\n",
31690
+ "line": 41,
31691
+ "type": "any",
31692
+ "decorators": []
31671
31693
  }
31672
31694
  ],
31673
31695
  "outputsClass": [
@@ -31678,7 +31700,7 @@
31678
31700
  "deprecationMessage": "",
31679
31701
  "rawdescription": "\n\n`EventEmitter` to notify parent components of menu click events.\n",
31680
31702
  "description": "<p><code>EventEmitter</code> to notify parent components of menu click events.</p>\n",
31681
- "line": 40,
31703
+ "line": 46,
31682
31704
  "type": "EventEmitter<Object>"
31683
31705
  }
31684
31706
  ],
@@ -31690,7 +31712,7 @@
31690
31712
  "type": "I18n",
31691
31713
  "optional": false,
31692
31714
  "description": "",
31693
- "line": 42,
31715
+ "line": 48,
31694
31716
  "modifierKind": [
31695
31717
  123
31696
31718
  ]
@@ -31703,7 +31725,7 @@
31703
31725
  "optional": false,
31704
31726
  "returnType": "void",
31705
31727
  "typeParameters": [],
31706
- "line": 47,
31728
+ "line": 53,
31707
31729
  "deprecated": false,
31708
31730
  "deprecationMessage": "",
31709
31731
  "rawdescription": "\n\nEmit the Hamburger click event upwards.\n",
@@ -31722,7 +31744,7 @@
31722
31744
  "description": "<p>A toggle for the side navigation</p>\n",
31723
31745
  "rawdescription": "\n\nA toggle for the side navigation\n",
31724
31746
  "type": "component",
31725
- "sourceCode": "import {\n\tComponent,\n\tOutput,\n\tEventEmitter,\n\tInput\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * A toggle for the side navigation\n */\n@Component({\n\tselector: \"cds-hamburger, ibm-hamburger\",\n\ttemplate: `\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\t(click)=\"doClick()\"\n\t\t\t[ngClass]=\"{'cds--header__action--active': active}\"\n\t\t\tclass=\"cds--header__menu-trigger cds--header__action cds--header__menu-toggle\"\n\t\t\t[attr.aria-label]=\"active\n\t\t\t\t? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)\n\t\t\t\t: (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)\"\n\t\t\t[attr.title]=\"active\n\t\t\t\t? (i18n.get('UI_SHELL.HEADER.CLOSE_MENU') | async)\n\t\t\t\t: (i18n.get('UI_SHELL.HEADER.OPEN_MENU') | async)\">\n\t\t\t<svg *ngIf=\"!active\" cdsIcon=\"menu\" size=\"20\"></svg>\n\t\t\t<svg *ngIf=\"active\" cdsIcon=\"close\" size=\"20\"></svg>\n\t\t</button>\n\t`\n})\nexport class Hamburger {\n\t/**\n\t * Controls the active/selected state for the `Hamburger` menu.\n\t */\n\t@Input() active = false;\n\n\t/**\n\t * `EventEmitter` to notify parent components of menu click events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\n\tconstructor(public i18n: I18n) { }\n\n\t/**\n\t * Emit the Hamburger click event upwards.\n\t */\n\tpublic doClick() {\n\t\tthis.selected.emit(this.active);\n\t}\n}\n",
31747
+ "sourceCode": "import {\n\tComponent,\n\tOutput,\n\tEventEmitter,\n\tInput\n} from \"@angular/core\";\nimport { I18n } from \"carbon-components-angular/i18n\";\n\n/**\n * A toggle for the side navigation\n */\n@Component({\n\tselector: \"cds-hamburger, ibm-hamburger\",\n\ttemplate: `\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\t(click)=\"doClick()\"\n\t\t\t[ngClass]=\"{'cds--header__action--active': active}\"\n\t\t\tclass=\"cds--header__menu-trigger cds--header__action cds--header__menu-toggle\"\n\t\t\t[attr.aria-label]=\"active ? activeTitle : inactiveTitle\"\n\t\t\t[attr.title]=\"active ? activeTitle : inactiveTitle\">\n\t\t\t<svg *ngIf=\"!active\" cdsIcon=\"menu\" size=\"20\"></svg>\n\t\t\t<svg *ngIf=\"active\" cdsIcon=\"close\" size=\"20\"></svg>\n\t\t</button>\n\t`\n})\nexport class Hamburger {\n\t/**\n\t * Controls the active/selected state for the `Hamburger` menu.\n\t */\n\t@Input() active = false;\n\n\t/**\n\t * Set the title text when the hamburger is active\n\t */\n\t@Input() activeTitle = this.i18n.get().UI_SHELL.HEADER.CLOSE_MENU;\n\n\t/**\n\t * Set the title text when the hamburger is inactive\n\t */\n\t@Input() inactiveTitle = this.i18n.get().UI_SHELL.HEADER.OPEN_MENU;\n\n\t/**\n\t * `EventEmitter` to notify parent components of menu click events.\n\t */\n\t@Output() selected: EventEmitter<Object> = new EventEmitter<Object>();\n\n\tconstructor(public i18n: I18n) {}\n\n\t/**\n\t * Emit the Hamburger click event upwards.\n\t */\n\tpublic doClick() {\n\t\tthis.selected.emit(this.active);\n\t}\n}\n",
31726
31748
  "assetsDirs": [],
31727
31749
  "styleUrlsData": "",
31728
31750
  "stylesData": "",
@@ -31739,7 +31761,7 @@
31739
31761
  "deprecationMessage": ""
31740
31762
  }
31741
31763
  ],
31742
- "line": 40,
31764
+ "line": 46,
31743
31765
  "jsdoctags": [
31744
31766
  {
31745
31767
  "name": "i18n",
@@ -85998,8 +86020,8 @@
85998
86020
  "type": "component",
85999
86021
  "linktype": "component",
86000
86022
  "name": "Hamburger",
86001
- "coveragePercent": 66,
86002
- "coverageCount": "4/6",
86023
+ "coveragePercent": 75,
86024
+ "coverageCount": "6/8",
86003
86025
  "status": "good"
86004
86026
  },
86005
86027
  {