@ukic/canary-web-components 2.0.0-canary.12 → 2.0.0-canary.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (496) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/date-helpers-c9551119.js +150 -0
  3. package/dist/cjs/date-helpers-c9551119.js.map +1 -0
  4. package/dist/cjs/{helpers-b525d45a.js → helpers-6acbb97e.js} +15 -3
  5. package/dist/cjs/helpers-6acbb97e.js.map +1 -0
  6. package/dist/cjs/{helpers-c4444a7e.js → helpers-f75cf7cf.js} +94 -48
  7. package/dist/cjs/helpers-f75cf7cf.js.map +1 -0
  8. package/dist/cjs/ic-accordion-group.cjs.entry.js +11 -2
  9. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-badge.cjs.entry.js +16 -8
  14. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-button_3.cjs.entry.js +8 -2
  18. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-card.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-data-table.cjs.entry.js +43 -308
  25. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-date-input.cjs.entry.js +1108 -0
  27. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -0
  28. package/dist/cjs/ic-date-picker.cjs.entry.js +1053 -0
  29. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -0
  30. package/dist/cjs/ic-dialog.cjs.entry.js +14 -4
  31. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  32. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-empty-state.cjs.entry.js +38 -0
  34. package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -0
  35. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +150 -0
  41. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -0
  42. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -1
  47. package/dist/cjs/{ic-input-component-container_3.cjs.entry.js → ic-menu.cjs.entry.js} +5 -69
  48. package/dist/cjs/ic-menu.cjs.entry.js.map +1 -0
  49. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-navigation-group.cjs.entry.js +16 -13
  51. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  52. package/dist/cjs/ic-navigation-item.cjs.entry.js +29 -33
  53. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  54. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  56. package/dist/cjs/{ic-empty-state_2.cjs.entry.js → ic-pagination-bar.cjs.entry.js} +4 -34
  57. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -0
  58. package/dist/cjs/ic-pagination_4.cjs.entry.js +5 -5
  59. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  60. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  62. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  63. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-select-with-multi.cjs.entry.js +6 -19
  65. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -1
  66. package/dist/cjs/ic-side-navigation.cjs.entry.js +2 -2
  67. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  68. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-tab-context.cjs.entry.js +18 -2
  73. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  74. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  75. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  76. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  77. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  78. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  79. package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
  80. package/dist/cjs/ic-top-navigation.cjs.entry.js +46 -60
  81. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  82. package/dist/cjs/ic-typography.cjs.entry.js +11 -35
  83. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  84. package/dist/cjs/index-4cf27b16.js +18 -10
  85. package/dist/cjs/loader.cjs.js +1 -1
  86. package/dist/collection/assets/calendar.svg +3 -0
  87. package/dist/collection/collection-manifest.json +2 -1
  88. package/dist/collection/components/ic-data-table/ic-data-table.css +7 -82
  89. package/dist/collection/components/ic-data-table/ic-data-table.js +44 -535
  90. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  91. package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
  92. package/dist/collection/components/ic-data-table/story-data.js +11 -386
  93. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  94. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +0 -319
  95. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
  96. package/dist/collection/components/ic-date-input/ic-date-input.css +560 -0
  97. package/dist/collection/components/ic-date-input/ic-date-input.js +1737 -0
  98. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -0
  99. package/dist/collection/components/ic-date-input/story-data.js +28 -0
  100. package/dist/collection/components/ic-date-input/story-data.js.map +1 -0
  101. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +1142 -0
  102. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -0
  103. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +42 -0
  104. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -0
  105. package/dist/collection/components/ic-date-picker/ic-date-picker.css +878 -0
  106. package/dist/collection/components/ic-date-picker/ic-date-picker.js +1512 -0
  107. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -0
  108. package/dist/collection/components/ic-date-picker/ic-day-button.js +36 -0
  109. package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -0
  110. package/dist/collection/components/ic-date-picker/ic-month-picker.js +29 -0
  111. package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -0
  112. package/dist/collection/components/ic-date-picker/ic-year-picker.js +39 -0
  113. package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -0
  114. package/dist/collection/components/ic-date-picker/story-data.js +148 -0
  115. package/dist/collection/components/ic-date-picker/story-data.js.map +1 -0
  116. package/dist/collection/components/{ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js → ic-date-picker/test/a11y/ic-date-picker.test.a11y.js} +5 -3
  117. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +1 -0
  118. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +207 -0
  119. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +1 -0
  120. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +991 -0
  121. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -0
  122. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +2 -2
  123. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -1
  124. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +1 -1
  125. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
  126. package/dist/collection/components/ic-select-with-multi/ic-select.js +2 -2
  127. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -1
  128. package/dist/collection/utils/constants.js +55 -0
  129. package/dist/collection/utils/constants.js.map +1 -1
  130. package/dist/collection/utils/date-helpers.js +133 -0
  131. package/dist/collection/utils/date-helpers.js.map +1 -0
  132. package/dist/collection/utils/helpers.js +272 -42
  133. package/dist/collection/utils/helpers.js.map +1 -1
  134. package/dist/collection/utils/types.js +45 -0
  135. package/dist/collection/utils/types.js.map +1 -1
  136. package/dist/components/helpers.js +15 -3
  137. package/dist/components/helpers.js.map +1 -1
  138. package/dist/components/helpers2.js +91 -45
  139. package/dist/components/helpers2.js.map +1 -1
  140. package/dist/components/ic-accordion-group.js +14 -4
  141. package/dist/components/ic-accordion-group.js.map +1 -1
  142. package/dist/components/ic-badge.js +16 -8
  143. package/dist/components/ic-badge.js.map +1 -1
  144. package/dist/components/ic-button2.js +11 -3
  145. package/dist/components/ic-button2.js.map +1 -1
  146. package/dist/components/ic-card.js +1 -1
  147. package/dist/components/ic-checkbox-group.js +1 -1
  148. package/dist/components/ic-checkbox.js +1 -1
  149. package/dist/components/ic-chip.js +1 -1
  150. package/dist/components/ic-data-table.js +49 -334
  151. package/dist/components/ic-data-table.js.map +1 -1
  152. package/dist/components/{ic-data-table-title-bar.d.ts → ic-date-input.d.ts} +4 -4
  153. package/dist/components/ic-date-input.js +8 -0
  154. package/dist/components/ic-date-input.js.map +1 -0
  155. package/dist/components/ic-date-input2.js +1340 -0
  156. package/dist/components/ic-date-input2.js.map +1 -0
  157. package/dist/components/ic-date-picker.d.ts +11 -0
  158. package/dist/components/ic-date-picker.js +1175 -0
  159. package/dist/components/ic-date-picker.js.map +1 -0
  160. package/dist/components/ic-dialog.js +13 -3
  161. package/dist/components/ic-dialog.js.map +1 -1
  162. package/dist/components/ic-empty-state.js +57 -1
  163. package/dist/components/ic-empty-state.js.map +1 -1
  164. package/dist/components/ic-input-component-container2.js +1 -1
  165. package/dist/components/ic-input-component-container2.js.map +1 -1
  166. package/dist/components/ic-link2.js +1 -1
  167. package/dist/components/ic-menu-item2.js +1 -1
  168. package/dist/components/ic-menu2.js +2 -2
  169. package/dist/components/ic-menu2.js.map +1 -1
  170. package/dist/components/ic-menu3.js +1 -1
  171. package/dist/components/ic-menu3.js.map +1 -1
  172. package/dist/components/ic-navigation-button.js +1 -1
  173. package/dist/components/ic-navigation-group.js +15 -12
  174. package/dist/components/ic-navigation-group.js.map +1 -1
  175. package/dist/components/ic-navigation-item.js +29 -33
  176. package/dist/components/ic-navigation-item.js.map +1 -1
  177. package/dist/components/ic-pagination-bar2.js +1 -1
  178. package/dist/components/ic-pagination-bar2.js.map +1 -1
  179. package/dist/components/ic-pagination-item2.js +1 -1
  180. package/dist/components/ic-pagination2.js +5 -5
  181. package/dist/components/ic-pagination2.js.map +1 -1
  182. package/dist/components/ic-radio-group.js +1 -1
  183. package/dist/components/ic-radio-option.js +1 -1
  184. package/dist/components/ic-search-bar.js +1 -1
  185. package/dist/components/ic-select-with-multi.js +1 -14
  186. package/dist/components/ic-select-with-multi.js.map +1 -1
  187. package/dist/components/ic-select2.js +1 -1
  188. package/dist/components/ic-side-navigation.js +1 -1
  189. package/dist/components/ic-side-navigation.js.map +1 -1
  190. package/dist/components/ic-switch.js +1 -1
  191. package/dist/components/ic-tab-context.js +18 -2
  192. package/dist/components/ic-tab-context.js.map +1 -1
  193. package/dist/components/ic-tab.js +1 -1
  194. package/dist/components/ic-text-field2.js +1 -1
  195. package/dist/components/ic-toggle-button.js +1 -1
  196. package/dist/components/ic-top-navigation.js +47 -61
  197. package/dist/components/ic-top-navigation.js.map +1 -1
  198. package/dist/components/ic-typography2.js +12 -38
  199. package/dist/components/ic-typography2.js.map +1 -1
  200. package/dist/core/core.css +1 -1
  201. package/dist/core/core.esm.js +1 -1
  202. package/dist/core/core.esm.js.map +1 -1
  203. package/dist/core/{p-917c5721.entry.js → p-04f46dac.entry.js} +2 -2
  204. package/dist/core/{p-204ace96.entry.js → p-05d0ac42.entry.js} +2 -2
  205. package/dist/core/{p-a50c3b9e.entry.js → p-0707f2fc.entry.js} +2 -2
  206. package/dist/core/{p-6933f8e9.entry.js → p-094a0455.entry.js} +2 -2
  207. package/dist/core/{p-a434c3d4.entry.js → p-1170c02d.entry.js} +2 -2
  208. package/dist/core/{p-869954a2.entry.js → p-169dcfdd.entry.js} +2 -2
  209. package/dist/core/{p-f7a14c01.entry.js → p-1a4bce88.entry.js} +2 -2
  210. package/dist/core/{p-76915584.entry.js → p-1c3bd46d.entry.js} +2 -2
  211. package/dist/core/p-1c3bd46d.entry.js.map +1 -0
  212. package/dist/core/{p-4baa0916.entry.js → p-28bddd8d.entry.js} +2 -2
  213. package/dist/core/{p-a43c12cd.entry.js → p-2ec33c00.entry.js} +2 -2
  214. package/dist/core/p-31800427.entry.js +2 -0
  215. package/dist/core/{p-045359e1.entry.js.map → p-31800427.entry.js.map} +1 -1
  216. package/dist/core/p-33dd24eb.js +2 -0
  217. package/dist/core/p-33dd24eb.js.map +1 -0
  218. package/dist/core/p-3b0caac0.js +2 -0
  219. package/dist/core/p-3b0caac0.js.map +1 -0
  220. package/dist/core/{p-f843da01.entry.js → p-3d0185a4.entry.js} +2 -2
  221. package/dist/core/{p-f3c840cd.entry.js → p-3f4c408a.entry.js} +2 -2
  222. package/dist/core/{p-e834344e.entry.js → p-4020d7f7.entry.js} +2 -2
  223. package/dist/core/p-402fd288.entry.js +2 -0
  224. package/dist/core/p-402fd288.entry.js.map +1 -0
  225. package/dist/core/{p-88d54b72.entry.js → p-49449a2d.entry.js} +2 -2
  226. package/dist/core/{p-db9c03c0.entry.js → p-4a30b0fc.entry.js} +2 -2
  227. package/dist/core/{p-a31031a5.entry.js → p-4b361789.entry.js} +2 -2
  228. package/dist/core/p-50cfc2bb.entry.js +2 -0
  229. package/dist/core/{p-ba86928c.entry.js.map → p-50cfc2bb.entry.js.map} +1 -1
  230. package/dist/core/{p-624d4f5f.entry.js → p-55d819a6.entry.js} +2 -2
  231. package/dist/core/{p-10fb4c46.entry.js → p-58c87b3d.entry.js} +2 -2
  232. package/dist/core/p-623f911f.entry.js +2 -0
  233. package/dist/core/p-623f911f.entry.js.map +1 -0
  234. package/dist/core/p-66b8f0a7.entry.js +2 -0
  235. package/dist/core/p-66b8f0a7.entry.js.map +1 -0
  236. package/dist/core/p-6b68ee01.entry.js +2 -0
  237. package/dist/core/p-6b68ee01.entry.js.map +1 -0
  238. package/dist/core/{p-595be57d.entry.js → p-7c8f85fd.entry.js} +2 -2
  239. package/dist/core/{p-d8469ac0.entry.js → p-7d1381ef.entry.js} +2 -2
  240. package/dist/core/p-849f43c3.entry.js +2 -0
  241. package/dist/core/p-849f43c3.entry.js.map +1 -0
  242. package/dist/core/{p-e3997d60.entry.js → p-8b1d128c.entry.js} +2 -2
  243. package/dist/core/{p-81ddc39d.entry.js → p-8ef85b15.entry.js} +2 -2
  244. package/dist/core/p-925da2d2.entry.js +2 -0
  245. package/dist/core/p-925da2d2.entry.js.map +1 -0
  246. package/dist/core/p-940de102.entry.js +2 -0
  247. package/dist/core/p-940de102.entry.js.map +1 -0
  248. package/dist/core/p-981b6f12.entry.js +2 -0
  249. package/dist/core/p-981b6f12.entry.js.map +1 -0
  250. package/dist/core/{p-b6639e4a.entry.js → p-9e3178e8.entry.js} +2 -2
  251. package/dist/core/{p-b6639e4a.entry.js.map → p-9e3178e8.entry.js.map} +1 -1
  252. package/dist/core/{p-a0f8efb2.entry.js → p-a9ed6a71.entry.js} +2 -2
  253. package/dist/core/p-aabab75f.entry.js +2 -0
  254. package/dist/core/p-aabab75f.entry.js.map +1 -0
  255. package/dist/core/{p-ab09986c.entry.js → p-b3d21d06.entry.js} +2 -2
  256. package/dist/core/p-b612d68b.entry.js +2 -0
  257. package/dist/core/p-b612d68b.entry.js.map +1 -0
  258. package/dist/core/p-b8a3b16d.entry.js +2 -0
  259. package/dist/core/p-b8a3b16d.entry.js.map +1 -0
  260. package/dist/core/{p-b82dcc29.entry.js → p-bbcd6d06.entry.js} +2 -2
  261. package/dist/core/{p-1ca332ca.entry.js → p-bcfbd465.entry.js} +2 -2
  262. package/dist/core/{p-5ae93c16.entry.js → p-bf316546.entry.js} +2 -2
  263. package/dist/core/{p-fc5611e2.entry.js → p-c51496ee.entry.js} +2 -2
  264. package/dist/core/p-c51496ee.entry.js.map +1 -0
  265. package/dist/core/p-c7590421.entry.js +2 -0
  266. package/dist/core/p-c7590421.entry.js.map +1 -0
  267. package/dist/core/{p-4f413fc0.entry.js → p-c7b52046.entry.js} +2 -2
  268. package/dist/core/p-cd799087.js +2 -0
  269. package/dist/core/p-cd799087.js.map +1 -0
  270. package/dist/core/{p-7ef8d616.entry.js → p-da578abf.entry.js} +2 -2
  271. package/dist/core/p-dae1779d.entry.js +2 -0
  272. package/dist/core/{p-f14454b1.entry.js.map → p-dae1779d.entry.js.map} +1 -1
  273. package/dist/core/{p-8b08d8fe.entry.js → p-e0e26834.entry.js} +2 -2
  274. package/dist/core/p-e189f1d0.entry.js +2 -0
  275. package/dist/core/p-e189f1d0.entry.js.map +1 -0
  276. package/dist/core/p-e30f2623.entry.js +2 -0
  277. package/dist/core/p-e30f2623.entry.js.map +1 -0
  278. package/dist/core/p-e676069e.entry.js +2 -0
  279. package/dist/core/p-e676069e.entry.js.map +1 -0
  280. package/dist/core/{p-75dac3d1.entry.js → p-ed7379e3.entry.js} +2 -2
  281. package/dist/core/{p-c34848da.entry.js → p-f4965c26.entry.js} +2 -2
  282. package/dist/core/{p-6c3044b6.entry.js → p-f9ee48f7.entry.js} +2 -2
  283. package/dist/core/{p-2eac7dcc.entry.js → p-f9fcdd21.entry.js} +2 -2
  284. package/dist/core/p-fdd8f3a5.entry.js +2 -0
  285. package/dist/core/p-fdd8f3a5.entry.js.map +1 -0
  286. package/dist/core/{p-5e0c830b.entry.js → p-ffa94639.entry.js} +2 -2
  287. package/dist/core/{p-5e0c830b.entry.js.map → p-ffa94639.entry.js.map} +1 -1
  288. package/dist/esm/core.js +1 -1
  289. package/dist/esm/date-helpers-0e5e32a7.js +136 -0
  290. package/dist/esm/date-helpers-0e5e32a7.js.map +1 -0
  291. package/dist/esm/{helpers-12b4266a.js → helpers-451953f9.js} +16 -4
  292. package/dist/esm/helpers-451953f9.js.map +1 -0
  293. package/dist/esm/{helpers-1f07eb61.js → helpers-f328a7b6.js} +92 -46
  294. package/dist/esm/helpers-f328a7b6.js.map +1 -0
  295. package/dist/esm/ic-accordion-group.entry.js +11 -2
  296. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  297. package/dist/esm/ic-accordion.entry.js +1 -1
  298. package/dist/esm/ic-alert.entry.js +1 -1
  299. package/dist/esm/ic-back-to-top.entry.js +1 -1
  300. package/dist/esm/ic-badge.entry.js +16 -8
  301. package/dist/esm/ic-badge.entry.js.map +1 -1
  302. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  303. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  304. package/dist/esm/ic-button_3.entry.js +8 -2
  305. package/dist/esm/ic-button_3.entry.js.map +1 -1
  306. package/dist/esm/ic-card.entry.js +1 -1
  307. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  308. package/dist/esm/ic-checkbox.entry.js +1 -1
  309. package/dist/esm/ic-chip.entry.js +1 -1
  310. package/dist/esm/ic-data-row.entry.js +1 -1
  311. package/dist/esm/ic-data-table.entry.js +44 -309
  312. package/dist/esm/ic-data-table.entry.js.map +1 -1
  313. package/dist/esm/ic-date-input.entry.js +1104 -0
  314. package/dist/esm/ic-date-input.entry.js.map +1 -0
  315. package/dist/esm/ic-date-picker.entry.js +1049 -0
  316. package/dist/esm/ic-date-picker.entry.js.map +1 -0
  317. package/dist/esm/ic-dialog.entry.js +14 -4
  318. package/dist/esm/ic-dialog.entry.js.map +1 -1
  319. package/dist/esm/ic-divider.entry.js +1 -1
  320. package/dist/{components/ic-empty-state2.js → esm/ic-empty-state.entry.js} +11 -38
  321. package/dist/esm/ic-empty-state.entry.js.map +1 -0
  322. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  323. package/dist/esm/ic-footer-link.entry.js +1 -1
  324. package/dist/esm/ic-footer.entry.js +1 -1
  325. package/dist/esm/ic-hero.entry.js +1 -1
  326. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  327. package/dist/esm/ic-input-component-container_4.entry.js +143 -0
  328. package/dist/esm/ic-input-component-container_4.entry.js.map +1 -0
  329. package/dist/esm/ic-link.entry.js +1 -1
  330. package/dist/esm/ic-menu-group.entry.js +1 -1
  331. package/dist/esm/ic-menu-item.entry.js +1 -1
  332. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  333. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -1
  334. package/dist/esm/{ic-input-component-container_3.entry.js → ic-menu.entry.js} +7 -69
  335. package/dist/esm/ic-menu.entry.js.map +1 -0
  336. package/dist/esm/ic-navigation-button.entry.js +1 -1
  337. package/dist/esm/ic-navigation-group.entry.js +16 -13
  338. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  339. package/dist/esm/ic-navigation-item.entry.js +29 -33
  340. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  341. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  342. package/dist/esm/ic-page-header.entry.js +1 -1
  343. package/dist/esm/{ic-empty-state_2.entry.js → ic-pagination-bar.entry.js} +5 -34
  344. package/dist/esm/ic-pagination-bar.entry.js.map +1 -0
  345. package/dist/esm/ic-pagination_4.entry.js +5 -5
  346. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  347. package/dist/esm/ic-popover-menu.entry.js +1 -1
  348. package/dist/esm/ic-radio-group.entry.js +1 -1
  349. package/dist/esm/ic-radio-option.entry.js +1 -1
  350. package/dist/esm/ic-search-bar.entry.js +1 -1
  351. package/dist/esm/ic-select-with-multi.entry.js +1 -14
  352. package/dist/esm/ic-select-with-multi.entry.js.map +1 -1
  353. package/dist/esm/ic-side-navigation.entry.js +2 -2
  354. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  355. package/dist/esm/ic-status-tag.entry.js +1 -1
  356. package/dist/esm/ic-step.entry.js +1 -1
  357. package/dist/esm/ic-stepper.entry.js +1 -1
  358. package/dist/esm/ic-switch.entry.js +1 -1
  359. package/dist/esm/ic-tab-context.entry.js +18 -2
  360. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  361. package/dist/esm/ic-tab-group.entry.js +1 -1
  362. package/dist/esm/ic-tab-panel.entry.js +1 -1
  363. package/dist/esm/ic-tab.entry.js +1 -1
  364. package/dist/esm/ic-theme.entry.js +1 -1
  365. package/dist/esm/ic-toast.entry.js +1 -1
  366. package/dist/esm/ic-toggle-button.entry.js +1 -1
  367. package/dist/esm/ic-top-navigation.entry.js +46 -60
  368. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  369. package/dist/esm/ic-typography.entry.js +12 -36
  370. package/dist/esm/ic-typography.entry.js.map +1 -1
  371. package/dist/esm/index-93509377.js +18 -10
  372. package/dist/esm/loader.js +1 -1
  373. package/dist/esm/polyfills/core-js.js +0 -0
  374. package/dist/esm/polyfills/dom.js +0 -0
  375. package/dist/esm/polyfills/es5-html-element.js +0 -0
  376. package/dist/esm/polyfills/index.js +0 -0
  377. package/dist/esm/polyfills/system.js +0 -0
  378. package/dist/types/components/ic-data-table/ic-data-table.d.ts +1 -96
  379. package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +0 -11
  380. package/dist/types/components/ic-data-table/story-data.d.ts +0 -99
  381. package/dist/types/components/ic-date-input/ic-date-input.d.ts +251 -0
  382. package/dist/types/components/ic-date-input/story-data.d.ts +1 -0
  383. package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +23 -0
  384. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +231 -0
  385. package/dist/types/components/ic-date-picker/ic-day-button.d.ts +16 -0
  386. package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +14 -0
  387. package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +16 -0
  388. package/dist/types/components/ic-date-picker/story-data.d.ts +22 -0
  389. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +2 -2
  390. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +2 -2
  391. package/dist/types/components.d.ts +390 -141
  392. package/dist/types/utils/constants.d.ts +37 -0
  393. package/dist/types/utils/date-helpers.d.ts +22 -0
  394. package/dist/types/utils/helpers.d.ts +84 -16
  395. package/dist/types/utils/types.d.ts +92 -1
  396. package/hydrate/index.js +3026 -950
  397. package/package.json +4 -3
  398. package/dist/cjs/helpers-b525d45a.js.map +0 -1
  399. package/dist/cjs/helpers-c4444a7e.js.map +0 -1
  400. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +0 -57
  401. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +0 -1
  402. package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +0 -1
  403. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +0 -1
  404. package/dist/cjs/ic-input-label_2.cjs.entry.js +0 -86
  405. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +0 -1
  406. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js +0 -217
  407. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js.map +0 -1
  408. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.css +0 -87
  409. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +0 -160
  410. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +0 -1
  411. package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js.map +0 -1
  412. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js +0 -70
  413. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js.map +0 -1
  414. package/dist/components/ic-data-table-title-bar.js +0 -136
  415. package/dist/components/ic-data-table-title-bar.js.map +0 -1
  416. package/dist/components/ic-empty-state2.js.map +0 -1
  417. package/dist/core/p-045359e1.entry.js +0 -2
  418. package/dist/core/p-169bfa51.entry.js +0 -2
  419. package/dist/core/p-169bfa51.entry.js.map +0 -1
  420. package/dist/core/p-1e91f540.entry.js +0 -2
  421. package/dist/core/p-1e91f540.entry.js.map +0 -1
  422. package/dist/core/p-347e8dab.entry.js +0 -2
  423. package/dist/core/p-347e8dab.entry.js.map +0 -1
  424. package/dist/core/p-3803a5b5.entry.js +0 -2
  425. package/dist/core/p-3803a5b5.entry.js.map +0 -1
  426. package/dist/core/p-4753bac8.entry.js +0 -2
  427. package/dist/core/p-4753bac8.entry.js.map +0 -1
  428. package/dist/core/p-5171169f.entry.js +0 -2
  429. package/dist/core/p-5171169f.entry.js.map +0 -1
  430. package/dist/core/p-5ee4319c.entry.js +0 -2
  431. package/dist/core/p-5ee4319c.entry.js.map +0 -1
  432. package/dist/core/p-5f4e96ec.entry.js +0 -2
  433. package/dist/core/p-5f4e96ec.entry.js.map +0 -1
  434. package/dist/core/p-7267fe19.entry.js +0 -2
  435. package/dist/core/p-7267fe19.entry.js.map +0 -1
  436. package/dist/core/p-76915584.entry.js.map +0 -1
  437. package/dist/core/p-942282cd.entry.js +0 -2
  438. package/dist/core/p-942282cd.entry.js.map +0 -1
  439. package/dist/core/p-96b3e7e2.js +0 -2
  440. package/dist/core/p-96b3e7e2.js.map +0 -1
  441. package/dist/core/p-9caf19eb.js +0 -2
  442. package/dist/core/p-9caf19eb.js.map +0 -1
  443. package/dist/core/p-aac4185b.entry.js +0 -2
  444. package/dist/core/p-aac4185b.entry.js.map +0 -1
  445. package/dist/core/p-b2aa3d7c.entry.js +0 -2
  446. package/dist/core/p-b2aa3d7c.entry.js.map +0 -1
  447. package/dist/core/p-ba86928c.entry.js +0 -2
  448. package/dist/core/p-f14454b1.entry.js +0 -2
  449. package/dist/core/p-f6888309.entry.js +0 -2
  450. package/dist/core/p-f6888309.entry.js.map +0 -1
  451. package/dist/core/p-f74a8752.entry.js +0 -2
  452. package/dist/core/p-f74a8752.entry.js.map +0 -1
  453. package/dist/core/p-fc5611e2.entry.js.map +0 -1
  454. package/dist/esm/helpers-12b4266a.js.map +0 -1
  455. package/dist/esm/helpers-1f07eb61.js.map +0 -1
  456. package/dist/esm/ic-data-table-title-bar.entry.js +0 -53
  457. package/dist/esm/ic-data-table-title-bar.entry.js.map +0 -1
  458. package/dist/esm/ic-empty-state_2.entry.js.map +0 -1
  459. package/dist/esm/ic-input-component-container_3.entry.js.map +0 -1
  460. package/dist/esm/ic-input-label_2.entry.js +0 -81
  461. package/dist/esm/ic-input-label_2.entry.js.map +0 -1
  462. package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.d.ts +0 -36
  463. /package/dist/core/{p-917c5721.entry.js.map → p-04f46dac.entry.js.map} +0 -0
  464. /package/dist/core/{p-204ace96.entry.js.map → p-05d0ac42.entry.js.map} +0 -0
  465. /package/dist/core/{p-a50c3b9e.entry.js.map → p-0707f2fc.entry.js.map} +0 -0
  466. /package/dist/core/{p-6933f8e9.entry.js.map → p-094a0455.entry.js.map} +0 -0
  467. /package/dist/core/{p-a434c3d4.entry.js.map → p-1170c02d.entry.js.map} +0 -0
  468. /package/dist/core/{p-869954a2.entry.js.map → p-169dcfdd.entry.js.map} +0 -0
  469. /package/dist/core/{p-f7a14c01.entry.js.map → p-1a4bce88.entry.js.map} +0 -0
  470. /package/dist/core/{p-4baa0916.entry.js.map → p-28bddd8d.entry.js.map} +0 -0
  471. /package/dist/core/{p-a43c12cd.entry.js.map → p-2ec33c00.entry.js.map} +0 -0
  472. /package/dist/core/{p-f843da01.entry.js.map → p-3d0185a4.entry.js.map} +0 -0
  473. /package/dist/core/{p-f3c840cd.entry.js.map → p-3f4c408a.entry.js.map} +0 -0
  474. /package/dist/core/{p-e834344e.entry.js.map → p-4020d7f7.entry.js.map} +0 -0
  475. /package/dist/core/{p-88d54b72.entry.js.map → p-49449a2d.entry.js.map} +0 -0
  476. /package/dist/core/{p-db9c03c0.entry.js.map → p-4a30b0fc.entry.js.map} +0 -0
  477. /package/dist/core/{p-a31031a5.entry.js.map → p-4b361789.entry.js.map} +0 -0
  478. /package/dist/core/{p-624d4f5f.entry.js.map → p-55d819a6.entry.js.map} +0 -0
  479. /package/dist/core/{p-10fb4c46.entry.js.map → p-58c87b3d.entry.js.map} +0 -0
  480. /package/dist/core/{p-595be57d.entry.js.map → p-7c8f85fd.entry.js.map} +0 -0
  481. /package/dist/core/{p-d8469ac0.entry.js.map → p-7d1381ef.entry.js.map} +0 -0
  482. /package/dist/core/{p-e3997d60.entry.js.map → p-8b1d128c.entry.js.map} +0 -0
  483. /package/dist/core/{p-81ddc39d.entry.js.map → p-8ef85b15.entry.js.map} +0 -0
  484. /package/dist/core/{p-a0f8efb2.entry.js.map → p-a9ed6a71.entry.js.map} +0 -0
  485. /package/dist/core/{p-ab09986c.entry.js.map → p-b3d21d06.entry.js.map} +0 -0
  486. /package/dist/core/{p-b82dcc29.entry.js.map → p-bbcd6d06.entry.js.map} +0 -0
  487. /package/dist/core/{p-1ca332ca.entry.js.map → p-bcfbd465.entry.js.map} +0 -0
  488. /package/dist/core/{p-5ae93c16.entry.js.map → p-bf316546.entry.js.map} +0 -0
  489. /package/dist/core/{p-4f413fc0.entry.js.map → p-c7b52046.entry.js.map} +0 -0
  490. /package/dist/core/{p-7ef8d616.entry.js.map → p-da578abf.entry.js.map} +0 -0
  491. /package/dist/core/{p-8b08d8fe.entry.js.map → p-e0e26834.entry.js.map} +0 -0
  492. /package/dist/core/{p-75dac3d1.entry.js.map → p-ed7379e3.entry.js.map} +0 -0
  493. /package/dist/core/{p-c34848da.entry.js.map → p-f4965c26.entry.js.map} +0 -0
  494. /package/dist/core/{p-6c3044b6.entry.js.map → p-f9ee48f7.entry.js.map} +0 -0
  495. /package/dist/core/{p-2eac7dcc.entry.js.map → p-f9fcdd21.entry.js.map} +0 -0
  496. /package/dist/types/components/{ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.d.ts → ic-date-picker/test/a11y/ic-date-picker.test.a11y.d.ts} +0 -0
@@ -0,0 +1,1108 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-4cf27b16.js');
6
+ const helpers = require('./helpers-f75cf7cf.js');
7
+ const dateHelpers = require('./date-helpers-c9551119.js');
8
+
9
+ const Clear = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="M15.8327 5.34199L14.6577 4.16699L9.99935 8.82533L5.34102 4.16699L4.16602 5.34199L8.82435 10.0003L4.16602 14.6587L5.34102 15.8337L9.99935 11.1753L14.6577 15.8337L15.8327 14.6587L11.1743 10.0003L15.8327 5.34199Z" fill="currentColor"/>
11
+ </svg>
12
+ `;
13
+
14
+ const Calendar = `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
15
+ <path d="M16.6667 2.50004H15.8334V0.833374H14.1667V2.50004H5.83342V0.833374H4.16675V2.50004H3.33341C2.41675 2.50004 1.66675 3.25004 1.66675 4.16671V17.5C1.66675 18.4167 2.41675 19.1667 3.33341 19.1667H16.6667C17.5834 19.1667 18.3334 18.4167 18.3334 17.5V4.16671C18.3334 3.25004 17.5834 2.50004 16.6667 2.50004ZM16.6667 17.5H3.33341V6.66671H16.6667V17.5Z" fill="currentColor"/>
16
+ </svg>`;
17
+
18
+ const icDateInputCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}input{border:0;height:100%;padding:0;outline:none;background:none;-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}ic-input-component-container{cursor:text}ic-input-component-container,ic-input-component-container:hover{color:var(--ic-color-tertiary-text)}.focus-indicator{padding:var(--ic-space-xxxs) var(--ic-space-xs);align-items:center}.day-input{width:1.438rem}.month-input{width:1.813rem}.year-input,.year-input.fit-to-value{width:2.313rem}.fit-to-value{width:1.25rem}.sr-only{position:absolute;left:-9999px}.input-container{width:100%;display:flex;justify-content:space-between;align-items:center;position:relative}.action-buttons{display:flex;align-items:center}.show-calendar-button-wrapper{display:flex;justify-content:center;align-items:center}.clear-button,.calendar-button{border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);margin:0}.clear-button.hidden{display:none}.clear-button:focus,.calendar-button:focus,.clear-button:active,.calendar-button:active{background-color:var(--ic-focus-blue) !important;box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow) !important;border-radius:0.25rem}.clear-button:focus,.calendar-button:focus,.clear-button:active *,.calendar-button:active *{fill:var(--ic-architectural-white)}.divider{margin:0 var(--ic-space-xxs);width:var(--ic-space-1px);background-color:var(--ic-architectural-400);border-radius:var(--ic-space-1px)}.divider.small{height:var(--ic-space-md)}.divider.default{height:calc(var(--ic-space-sm) + var(--ic-space-xs))}.divider.large{height:var(--ic-space-lg)}";
19
+
20
+ let inputIds = 0;
21
+ const DateInput = class {
22
+ constructor(hostRef) {
23
+ index.registerInstance(this, hostRef);
24
+ this.calendarButtonClicked = index.createEvent(this, "calendarButtonClicked", 7);
25
+ this.icBlur = index.createEvent(this, "icBlur", 7);
26
+ this.icChange = index.createEvent(this, "icChange", 7);
27
+ this.icFocus = index.createEvent(this, "icFocus", 7);
28
+ this.ARIA_INVALID = "aria-invalid";
29
+ this.ARIA_LABEL = "aria-label";
30
+ this.ARIA_LABELLED_BY = "aria-labelledby";
31
+ this.EVENT_OBJECT_STRING = "[object Event]";
32
+ this.FIT_TO_VALUE = "fit-to-value";
33
+ this.initialValue = this.value;
34
+ this.INPUT_EVENT_OBJECT_STRING = "[object InputEvent]";
35
+ this.inputsInOrder = [];
36
+ this.isAfterMax = false;
37
+ this.isBeforeMin = false;
38
+ this.isDateSetFromKeyboardEvent = false;
39
+ this.isDisabledDate = false;
40
+ this.isValidDay = true;
41
+ this.isValidMonth = true;
42
+ this.isValidDate = true;
43
+ this.isZuluTime = false;
44
+ this.KEYBOARD_EVENT_OBJECT_STRING = "[object KeyboardEvent]";
45
+ this.MAX_DAY = 31;
46
+ this.MAX_MONTH = 12;
47
+ this.previousEmittedDate = undefined;
48
+ this.previousSelectedDate = null;
49
+ this.selectedDate = null;
50
+ this.setInputPasteValue = (input, pastedValue) => {
51
+ const inputEl = input;
52
+ inputEl.value = pastedValue;
53
+ inputEl.classList.add(this.FIT_TO_VALUE);
54
+ };
55
+ this.checkSingleCopiedValueIsValid = (input, pastedValue) => {
56
+ let isValid = false;
57
+ const value = Number(pastedValue);
58
+ switch (input) {
59
+ case this.dayInputEl:
60
+ isValid = value >= 1 && value <= this.MAX_DAY;
61
+ break;
62
+ case this.monthInputEl:
63
+ isValid = value >= 1 && value <= this.MAX_MONTH;
64
+ break;
65
+ case this.yearInputEl:
66
+ isValid = true;
67
+ break;
68
+ default:
69
+ isValid = false;
70
+ break;
71
+ }
72
+ return isValid;
73
+ };
74
+ /**
75
+ * Using Object.prototype.string to determine type if event from user
76
+ * @param event - event object used to differentiate keyboard, generic or input event
77
+ * @returns boolean
78
+ */
79
+ this.isKeyboardOrEvent = (event) => {
80
+ return (Object.prototype.toString.call(event) === this.EVENT_OBJECT_STRING ||
81
+ Object.prototype.toString.call(event) ===
82
+ this.KEYBOARD_EVENT_OBJECT_STRING);
83
+ };
84
+ this.setDateValidity = () => {
85
+ if (!helpers.isEmptyString(this.day)) {
86
+ this.isValidDay = +this.day > this.MAX_DAY ? false : true;
87
+ }
88
+ else {
89
+ this.isValidDay = true;
90
+ }
91
+ if (!helpers.isEmptyString(this.month)) {
92
+ this.isValidMonth = +this.month > this.MAX_MONTH ? false : true;
93
+ }
94
+ else {
95
+ this.isValidMonth = true;
96
+ }
97
+ };
98
+ this.handleInput = (event) => {
99
+ const inputEvent = event;
100
+ const input = event.target;
101
+ if (input !== this.yearInputEl) {
102
+ // Only auto-format if input event is not a character being deleted
103
+ // and not as user is changing value using up / down keys
104
+ if (inputEvent.inputType !== "deleteContentBackward" &&
105
+ !this.preventAutoFormatting) {
106
+ if (input.value.length === 1 &&
107
+ ((input === this.dayInputEl && +input.value >= 4) ||
108
+ (input === this.monthInputEl && +input.value >= 2)) &&
109
+ +input.value <= 9) {
110
+ this.setInputValue(input);
111
+ this.notifyScreenReader(input, event);
112
+ this.moveToNextInput(input);
113
+ }
114
+ if (input.value.length === 2) {
115
+ if (+input.value === 0) {
116
+ input.value = "01";
117
+ }
118
+ this.setInputValue(input);
119
+ this.setPreventInput(input, true);
120
+ this.notifyScreenReader(input, event);
121
+ this.moveToNextInput(input);
122
+ }
123
+ else {
124
+ this.setPreventInput(input, false);
125
+ }
126
+ }
127
+ else if (this.preventAutoFormatting) {
128
+ /**
129
+ * Using arrow keys prevents auto formatting so need to deal with
130
+ * switching from arrow keys to inputting numbers
131
+ **/
132
+ if (input.value.length === 2 && !this.isKeyboardOrEvent(event)) {
133
+ this.setInputValue(input);
134
+ this.setPreventInput(input, true);
135
+ this.moveToNextInput(input);
136
+ }
137
+ else {
138
+ this.setInputValue(input);
139
+ }
140
+ }
141
+ if (input.value.length !== 2) {
142
+ this.setPreventInput(input, false);
143
+ }
144
+ }
145
+ else {
146
+ if (input.value.length === 4) {
147
+ this.setInputValue(input);
148
+ if (Object.prototype.toString.call(event) !== this.EVENT_OBJECT_STRING) {
149
+ this.moveToNextInput(input);
150
+ }
151
+ this.setPreventInput(input, true);
152
+ }
153
+ else {
154
+ this.setInputValue(input, true);
155
+ this.setPreventInput(input, false);
156
+ }
157
+ }
158
+ // Add / remove class to make input width match size of value i.e. 2 digits' width for day / month, 4 for year
159
+ this.setFitToValueStyling(input);
160
+ if (input.value.length === 0) {
161
+ this.setInputValue(input, true);
162
+ this.setValidationMessage();
163
+ }
164
+ this.notifyScreenReader(input, event);
165
+ };
166
+ this.handleKeyDown = (event, isInputPrevented) => {
167
+ const input = event.target;
168
+ const eventKey = event.key.toLowerCase();
169
+ // Regex required due to FF allowing all characters as values for number text field.
170
+ const regex = /-?\d*\.?\d+(e[-+]?\d+)?|[/-]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;
171
+ if (!regex.test(eventKey) &&
172
+ !((event.ctrlKey || event.metaKey) &&
173
+ (eventKey === "v" || eventKey === "c"))) {
174
+ event.preventDefault();
175
+ }
176
+ switch (eventKey) {
177
+ case "/":
178
+ case "-":
179
+ case ".":
180
+ event.preventDefault();
181
+ this.setPasteInvalidText();
182
+ this.moveToNextInput(input);
183
+ break;
184
+ case "arrowright":
185
+ case "arrowleft":
186
+ event.preventDefault();
187
+ this.handleLeftRightArrowKeyPress(input, eventKey);
188
+ break;
189
+ case "arrowup":
190
+ case "arrowdown":
191
+ this.preventAutoFormatting = true;
192
+ this.handleUpDownArrowKeyPress(input, event);
193
+ break;
194
+ }
195
+ this.preventInput(event, isInputPrevented);
196
+ this.isDateSetFromKeyboardEvent = true;
197
+ };
198
+ this.handleFocus = (event) => {
199
+ // Highlight / select all characters in input for easy replacement
200
+ const input = event.target;
201
+ input.select();
202
+ };
203
+ this.handleBlur = (event) => {
204
+ const input = event.target;
205
+ this.setPasteInvalidText();
206
+ this.autocompleteInput(input);
207
+ };
208
+ this.handleLeftRightArrowKeyPress = (input, key) => {
209
+ if (key === "arrowright") {
210
+ this.moveToNextInput(input);
211
+ }
212
+ else {
213
+ this.moveToPreviousInput(input);
214
+ }
215
+ this.setPasteInvalidText();
216
+ };
217
+ this.notifyScreenReaderSelectedDate = () => {
218
+ const dayNames = helpers.stringEnumToArray(helpers.IcDayNames);
219
+ const months = helpers.stringEnumToArray(helpers.IcDateInputMonths);
220
+ this.selectedDateInfoEl.textContent = `Selected date: ${dayNames[this.selectedDate.getDay()]}, ${this.selectedDate.getDate()} ${months[this.selectedDate.getMonth()]} ${this.selectedDate.getFullYear()}`;
221
+ };
222
+ this.handleUpDownArrowKeyPress = (input, event) => {
223
+ const minValue = input === this.yearInputEl ? 0 : 1;
224
+ let maxValue;
225
+ switch (input) {
226
+ case this.dayInputEl:
227
+ maxValue = this.MAX_DAY;
228
+ break;
229
+ case this.monthInputEl:
230
+ maxValue = this.MAX_MONTH;
231
+ break;
232
+ case this.yearInputEl:
233
+ maxValue = 9999;
234
+ }
235
+ // Make value loop round when min / max reached
236
+ if (input === null || input === void 0 ? void 0 : input.value) {
237
+ if (event.key === "ArrowUp") {
238
+ if (+input.value === maxValue) {
239
+ event.preventDefault();
240
+ input.value = `0${minValue}`;
241
+ }
242
+ else {
243
+ input.value =
244
+ +input.value + 1 < 10
245
+ ? `0${+input.value + 1}`
246
+ : (+input.value + 1).toString();
247
+ }
248
+ this.notifyScreenReader(input, event);
249
+ }
250
+ if (event.key === "ArrowDown") {
251
+ if (+input.value === minValue) {
252
+ event.preventDefault();
253
+ input.value = maxValue.toString();
254
+ }
255
+ else {
256
+ input.value =
257
+ +input.value - 1 < 10
258
+ ? `0${+input.value - 1}`
259
+ : (+input.value - 1).toString();
260
+ }
261
+ this.notifyScreenReader(input, event);
262
+ }
263
+ }
264
+ else {
265
+ if (event.key === "ArrowDown") {
266
+ event.preventDefault();
267
+ if (input === this.yearInputEl) {
268
+ input.value = new Date().getFullYear().toString();
269
+ }
270
+ else {
271
+ input.value = maxValue.toString();
272
+ }
273
+ this.notifyScreenReader(input, event);
274
+ }
275
+ else if (event.key === "ArrowUp") {
276
+ event.preventDefault();
277
+ if (input === this.yearInputEl) {
278
+ input.value = new Date().getFullYear().toString();
279
+ }
280
+ else {
281
+ input.value = `0${minValue}`;
282
+ }
283
+ this.notifyScreenReader(input, event);
284
+ }
285
+ }
286
+ this.setInputValue(input);
287
+ this.setFitToValueStyling(input);
288
+ };
289
+ this.handleDateChange = (force) => {
290
+ // Prevent icChange being emitted when each individual input is changed
291
+ // This method is used within componentWillUpdate instead of using @Watch('value');
292
+ if (force || !dateHelpers.dateMatches(this.selectedDate, this.previousSelectedDate)) {
293
+ if (this.value) {
294
+ this.inputsInOrder.forEach((input) => {
295
+ input.classList.add(this.FIT_TO_VALUE);
296
+ });
297
+ }
298
+ if (this.day && this.month && this.year && this.invalidDateText === "") {
299
+ this.setValueAndEmitChange(this.selectedDate);
300
+ this.notifyScreenReaderSelectedDate();
301
+ }
302
+ else if (!(this.selectedDate === null && this.previousSelectedDate === null)) {
303
+ this.setValueAndEmitChange(null);
304
+ this.selectedDateInfoEl.textContent = "";
305
+ }
306
+ this.previousSelectedDate = this.selectedDate;
307
+ if (!this.isDateSetFromKeyboardEvent) {
308
+ this.updateInputValues(this.day, this.month, this.year);
309
+ }
310
+ }
311
+ };
312
+ this.slicePastedDate = (valueLength, datePart) => {
313
+ return datePart.length > valueLength
314
+ ? datePart.slice(0, valueLength)
315
+ : datePart;
316
+ };
317
+ this.isPastedStringDateValid = (value) => {
318
+ if (/\d+-\d+-\d+$/.test(value) ||
319
+ /\d+\/\d+\/\d+/.test(value) ||
320
+ /\d+\.\d+\.\d+/.test(value)) {
321
+ return true;
322
+ }
323
+ if (/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\.\d+)?)?Z/.test(value)) {
324
+ this.isZuluTime = true;
325
+ return true;
326
+ }
327
+ return false;
328
+ };
329
+ // Set value of each input to value of pasted date part
330
+ // Allows formats separated by '-' or '/'
331
+ this.handlePaste = (event) => {
332
+ event.preventDefault();
333
+ const pastedValue = event.clipboardData.getData("Text");
334
+ const isValidDate = this.isPastedStringDateValid(pastedValue);
335
+ this.setPastedValueAndValidation(isValidDate, pastedValue, event);
336
+ };
337
+ this.setDate = (date) => {
338
+ if (date === null || date === "" || date === undefined) {
339
+ this.day = null;
340
+ this.month = null;
341
+ this.year = null;
342
+ this.inputsInOrder.forEach((input) => {
343
+ input.classList.remove(this.FIT_TO_VALUE);
344
+ this.setPreventInput(input, false);
345
+ });
346
+ this.handleDateChange(true);
347
+ }
348
+ else {
349
+ if (dateHelpers.isDateOrEpoch(date)) {
350
+ let newDate;
351
+ if (typeof date === "string") {
352
+ // Checking if epoch date time
353
+ newDate = new Date(+date);
354
+ }
355
+ else {
356
+ newDate = date;
357
+ }
358
+ this.day = dateHelpers.convertToDoubleDigits(newDate.getDate());
359
+ this.month = dateHelpers.convertToDoubleDigits(newDate.getMonth() + 1);
360
+ this.year = newDate.getFullYear().toString();
361
+ }
362
+ else if (typeof date === "string") {
363
+ const defaultDateArray = dateHelpers.splitStringDate(date, this.dateFormat);
364
+ this.year = defaultDateArray[0];
365
+ this.month = defaultDateArray[1];
366
+ this.day = defaultDateArray[2];
367
+ }
368
+ }
369
+ this.setValidationMessage();
370
+ };
371
+ this.formatMinMax = (date) => {
372
+ let formattedDate;
373
+ const day = dateHelpers.convertToDoubleDigits(date.getDate());
374
+ const month = dateHelpers.convertToDoubleDigits(date.getMonth() + 1);
375
+ const year = date.getFullYear();
376
+ switch (this.dateFormat) {
377
+ case "DD/MM/YYYY":
378
+ formattedDate = `${day}/${month}/${year}`;
379
+ break;
380
+ case "MM/DD/YYYY":
381
+ formattedDate = `${month}/${day}/${year}`;
382
+ break;
383
+ case "YYYY/MM/DD":
384
+ formattedDate = `${year}/${month}/${day}`;
385
+ break;
386
+ }
387
+ return formattedDate;
388
+ };
389
+ this.updateInputValues = (day, month, year) => {
390
+ this.dayInputEl.value = day;
391
+ this.monthInputEl.value = month;
392
+ this.yearInputEl.value = year;
393
+ };
394
+ // Set value in state based on input
395
+ this.setInputValue = (input, clear = false) => {
396
+ const newValue = clear ? "" : input.value;
397
+ switch (input) {
398
+ case this.dayInputEl:
399
+ this.day = newValue;
400
+ break;
401
+ case this.monthInputEl:
402
+ this.month = newValue;
403
+ break;
404
+ case this.yearInputEl:
405
+ if (this.year !== newValue) {
406
+ this.year = newValue;
407
+ }
408
+ }
409
+ this.setValidationMessage();
410
+ };
411
+ this.setValidationMessage = () => {
412
+ this.setDateValidity();
413
+ if (!helpers.isEmptyString(this.day) &&
414
+ !helpers.isEmptyString(this.month) &&
415
+ !helpers.isEmptyString(this.year)) {
416
+ // Check whether date actually exists
417
+ // (used https://www.hectane.com/blog/javascript-date-validation-with-leap-year)
418
+ this.selectedDate = this.convertToDate(this.year, this.month, this.day);
419
+ this.isValidDate =
420
+ +this.selectedDate !== 0 && this.selectedDate.getDate() == +this.day;
421
+ this.isDisabledDate = this.isSelectedDateDisabled();
422
+ if (!this.isValidDate || this.isDisabledDate) {
423
+ this.inputsInOrder.forEach((input) => input.setAttribute(this.ARIA_INVALID, "true"));
424
+ }
425
+ else {
426
+ this.inputsInOrder.forEach((input) => input.removeAttribute(this.ARIA_INVALID));
427
+ }
428
+ }
429
+ else {
430
+ this.selectedDate = null;
431
+ }
432
+ if (!(this.isValidDay && this.isValidMonth && this.isValidDate)) {
433
+ this.invalidDateText = "Please enter a valid date.";
434
+ }
435
+ else if (this.isDisabledDate && this.selectedDate !== null) {
436
+ if (this.isBeforeMin) {
437
+ if (this.disablePast) {
438
+ this.invalidDateText = this.disablePastMessage;
439
+ }
440
+ else {
441
+ this.invalidDateText = `Please enter a date after ${this.formatMinMax(this.minDate)}.`;
442
+ }
443
+ }
444
+ else if (this.isAfterMax) {
445
+ if (this.disableFuture) {
446
+ this.invalidDateText = this.disableFutureMessage;
447
+ }
448
+ else {
449
+ this.invalidDateText = `Please enter a date before ${this.formatMinMax(this.maxDate)}.`;
450
+ }
451
+ }
452
+ else if (this.disableDays.length !== 0) {
453
+ this.invalidDateText = this.disableDaysMessage;
454
+ }
455
+ else {
456
+ if (this.disablePast) {
457
+ this.invalidDateText = this.disablePastMessage;
458
+ }
459
+ if (this.disableFuture) {
460
+ this.invalidDateText = this.disableFutureMessage;
461
+ }
462
+ }
463
+ }
464
+ else {
465
+ this.invalidDateText = "";
466
+ }
467
+ };
468
+ // Set refs to the input elements in the order they are displayed (based on the dateFormat)
469
+ this.setInputsInOrder = () => {
470
+ const inputs = this.el.shadowRoot.querySelectorAll("input");
471
+ inputs.forEach((input) => this.inputsInOrder.push(input));
472
+ };
473
+ // Includes text usually added using aria-describedby
474
+ // (which doesn't work on input component container)
475
+ this.setAriaLabelledBy = () => {
476
+ var _a;
477
+ if (this.disabled &&
478
+ !helpers.isEmptyString((_a = this.inputCompContainerEl) === null || _a === void 0 ? void 0 : _a.getAttribute(this.ARIA_LABELLED_BY))) {
479
+ this.removeAriaLabelledBy();
480
+ return;
481
+ }
482
+ if (this.disabled) {
483
+ return;
484
+ }
485
+ const labelEl = this.el.shadowRoot.querySelector("label");
486
+ const labelId = `${this.inputId}-label`;
487
+ if (labelEl !== null && labelEl !== undefined) {
488
+ labelEl.id = labelId;
489
+ const hasValidation = (!helpers.isEmptyString(this.validationStatus) &&
490
+ !helpers.isEmptyString(this.validationText)) ||
491
+ !helpers.isEmptyString(this.invalidDateText);
492
+ const labelledBy = `${labelId} ${this.screenReaderInfoId} ${helpers.getInputDescribedByText(this.inputId, this.helperText !== "" && this.helperText !== this.defaultHelperText, hasValidation)} ${this.selectedDate ? this.selectedDateInfoId : ""} ${this.assistiveHintId}`;
493
+ this.inputCompContainerEl.setAttribute(this.ARIA_LABELLED_BY, labelledBy);
494
+ }
495
+ };
496
+ // Sets boolean for each input, used to limit the number of characters within each field (2 for day / month, 4 for year)
497
+ this.setPreventInput = (input, isPrevented) => {
498
+ switch (input) {
499
+ case this.dayInputEl:
500
+ this.preventDayInput = isPrevented;
501
+ break;
502
+ case this.monthInputEl:
503
+ this.preventMonthInput = isPrevented;
504
+ break;
505
+ case this.yearInputEl:
506
+ this.preventYearInput = isPrevented;
507
+ }
508
+ };
509
+ // Get input based on letter representing each date part ("D", "M" or "Y")
510
+ // (retrieved from dateFormat)
511
+ this.getInputFromDatePart = (datePart) => {
512
+ const dayInput = (index.h("input", { class: "day-input", id: "day-input", ref: (el) => (this.dayInputEl = el), "aria-label": "day", placeholder: "DD", disabled: this.disabled, onPaste: this.handlePaste, inputmode: "number", pattern: "[0-9]*", onKeyDown: (event) => this.handleKeyDown(event, this.preventDayInput) }));
513
+ const monthInput = (index.h("input", { id: "month-input", class: "month-input", ref: (el) => (this.monthInputEl = el), "aria-label": "month", placeholder: "MM", disabled: this.disabled, onPaste: this.handlePaste, inputmode: "number", pattern: "[0-9]*", onKeyDown: (event) => this.handleKeyDown(event, this.preventMonthInput) }));
514
+ const yearInput = (index.h("input", { id: "year-input", class: "year-input", ref: (el) => (this.yearInputEl = el), "aria-label": "year", placeholder: "YYYY", maxLength: 4, disabled: this.disabled, onPaste: this.handlePaste, inputmode: "number", pattern: "[0-9]*", onKeyDown: (event) => this.handleKeyDown(event, this.preventYearInput) }));
515
+ let input;
516
+ switch (datePart) {
517
+ case "D":
518
+ input = dayInput;
519
+ break;
520
+ case "M":
521
+ input = monthInput;
522
+ break;
523
+ case "Y":
524
+ input = yearInput;
525
+ }
526
+ return input;
527
+ };
528
+ // Get input elements in order of chosen date format
529
+ this.getInputsInOrder = () => {
530
+ const dateParts = this.dateFormat.split("/");
531
+ const inputsInOrder = [];
532
+ dateParts.forEach((part) => {
533
+ inputsInOrder.push(this.getInputFromDatePart(part.substring(0, 1)));
534
+ });
535
+ return inputsInOrder;
536
+ };
537
+ // To add to the end of assistive hint to make it clearer that each date part has its own input
538
+ // that can be changed individually
539
+ this.getDescOfInputsOrder = () => {
540
+ let description;
541
+ switch (this.dateFormat) {
542
+ case "DD/MM/YYYY":
543
+ description = "day, month, and year";
544
+ break;
545
+ case "MM/DD/YYYY":
546
+ description = "month, day, and year";
547
+ break;
548
+ case "YYYY/MM/DD":
549
+ description = "year, month, and day";
550
+ }
551
+ return description;
552
+ };
553
+ // Add 'required' or 'invalid data' to span used in aria-labelledby
554
+ // Many ARIA attributes aren't read out by screen reader when on the input component container
555
+ this.getScreenReaderInfo = (validationStatus) => {
556
+ let inputDescriptors = "";
557
+ if (this.required) {
558
+ inputDescriptors += "required";
559
+ }
560
+ if (validationStatus === helpers.IcInformationStatus.Error) {
561
+ inputDescriptors += " invalid data";
562
+ }
563
+ return inputDescriptors === "" ? "" : inputDescriptors + ", ";
564
+ };
565
+ // Prevent non-number characters being entered
566
+ // ('e' or '.' - which are usually allowed in <input type="number">)
567
+ // And limit the number of characters within each field (2 for day / month, 4 for year)
568
+ // (because 'maxlength' doesn't work on <input type="number">)
569
+ this.preventInput = (event, isInputPrevented) => {
570
+ const key = event.key;
571
+ const input = event.target;
572
+ let selectedString;
573
+ if (input) {
574
+ selectedString = input.value.substring(input.selectionStart, input.selectionEnd);
575
+ }
576
+ if (key === "e" ||
577
+ key === "." ||
578
+ key === "-" ||
579
+ (event.key >= "0" &&
580
+ event.key <= "9" &&
581
+ isInputPrevented &&
582
+ !selectedString)) {
583
+ event.preventDefault();
584
+ }
585
+ };
586
+ // Get whether date has been disabled using disableFuture or disablePast prop, but always allow current day
587
+ // Consider using dateClamp and inDateRange
588
+ this.isSelectedDateDisabled = () => {
589
+ const currentDate = new Date();
590
+ this.isAfterMax = false;
591
+ this.isBeforeMin = false;
592
+ let disabled = false;
593
+ const isNotToday = this.selectedDate.toDateString() !== currentDate.toDateString();
594
+ if (this.minDate && this.selectedDate < this.minDate && isNotToday) {
595
+ this.isBeforeMin = true;
596
+ disabled = true;
597
+ }
598
+ if (this.maxDate && this.selectedDate > this.maxDate && isNotToday) {
599
+ this.isAfterMax = true;
600
+ disabled = true;
601
+ }
602
+ if (this.disableDays.includes(this.selectedDate.getDay())) {
603
+ disabled = true;
604
+ }
605
+ if (((this.disablePast && this.selectedDate < currentDate) ||
606
+ (this.disableFuture && this.selectedDate > currentDate)) &&
607
+ isNotToday) {
608
+ disabled = true;
609
+ }
610
+ return disabled;
611
+ };
612
+ this.moveToNextInput = (currentInput) => {
613
+ const currentInputPos = this.inputsInOrder.findIndex((input) => input === currentInput);
614
+ const nextInput = this.inputsInOrder[currentInputPos + 1];
615
+ this.preventAutoFormatting = false;
616
+ if (nextInput) {
617
+ nextInput.focus();
618
+ }
619
+ };
620
+ this.moveToPreviousInput = (currentInput) => {
621
+ const currentInputPos = this.inputsInOrder.findIndex((input) => input === currentInput);
622
+ this.preventAutoFormatting = false;
623
+ if (this.inputsInOrder[currentInputPos - 1]) {
624
+ this.inputsInOrder[currentInputPos - 1].focus();
625
+ }
626
+ };
627
+ this.autocompleteInput = (input) => {
628
+ if (input === this.yearInputEl) {
629
+ this.autocompleteYear();
630
+ }
631
+ else {
632
+ const inputValue = input.value;
633
+ // Autocomplete input as 2 characters (leading zero) when only 1 character entered (for day and month)
634
+ if (inputValue.length === 1) {
635
+ if (+inputValue === 0) {
636
+ input.value = "01";
637
+ }
638
+ else {
639
+ input.value = `0${inputValue}`;
640
+ }
641
+ }
642
+ }
643
+ if (input.value) {
644
+ this.setInputValue(input);
645
+ }
646
+ };
647
+ // Autocomplete year as current millennium when fewer than 4 characters entered
648
+ this.autocompleteYear = () => {
649
+ const inputValue = this.yearInputEl.value;
650
+ const yearNumbers = ["2", "0", "0"];
651
+ let autocompletedInput = "";
652
+ if (inputValue) {
653
+ yearNumbers.forEach((number, index) => {
654
+ if (inputValue.length + index <= 3) {
655
+ autocompletedInput += number;
656
+ }
657
+ });
658
+ this.yearInputEl.value = `${autocompletedInput}${inputValue}`;
659
+ }
660
+ };
661
+ this.convertToDate = (year, month, day) => {
662
+ if (!helpers.isEmptyString(year) && !helpers.isEmptyString(month) && !helpers.isEmptyString(day)) {
663
+ return new Date(+year, +month - 1, +day);
664
+ }
665
+ else {
666
+ return null;
667
+ }
668
+ };
669
+ this.handleHostBlur = () => {
670
+ this.removeLabelledBy = false;
671
+ this.icBlur.emit({ value: this.selectedDate });
672
+ };
673
+ this.handleHostFocus = () => {
674
+ var _a;
675
+ if ((_a = this.el.shadowRoot.activeElement) === null || _a === void 0 ? void 0 : _a.id.match(/(day|month|year)-input$/)) {
676
+ this.removeLabelledBy = false;
677
+ }
678
+ else {
679
+ this.removeLabelledBy = true;
680
+ }
681
+ this.icFocus.emit({ value: this.selectedDate });
682
+ };
683
+ this.handleFormReset = () => {
684
+ // Get the initial value and populate day, month and year again.
685
+ this.setDate(this.initialValue);
686
+ this.setValidationMessage();
687
+ this.handleDateChange(false);
688
+ };
689
+ this.getAriaLabel = (input) => {
690
+ return input.getAttribute(this.ARIA_LABEL);
691
+ };
692
+ this.notifyScreenReaderArrowKeys = (input) => {
693
+ const liveRegion = this.el.shadowRoot.querySelector("#live-region");
694
+ let announcement = "";
695
+ const ariaLabel = this.getAriaLabel(input);
696
+ if (liveRegion && input.value) {
697
+ if (input === this.monthInputEl &&
698
+ !!helpers.IcDateInputMonths[+input.value - 1]) {
699
+ announcement = `${input.value} - ${helpers.IcDateInputMonths[+input.value - 1]}, ${ariaLabel}`;
700
+ }
701
+ if (input === this.dayInputEl || input === this.yearInputEl) {
702
+ announcement = `${input.value}, ${ariaLabel}`;
703
+ }
704
+ liveRegion.textContent = announcement;
705
+ }
706
+ };
707
+ this.notifyScreenReaderInput = (input, liveRegion) => {
708
+ let announcement = "";
709
+ const ariaLabel = this.getAriaLabel(input);
710
+ if (input === this.dayInputEl || input === this.monthInputEl) {
711
+ if (input.value.length === 2) {
712
+ if (input === this.monthInputEl &&
713
+ !!helpers.IcDateInputMonths[+input.value - 1] &&
714
+ this.isValidMonth) {
715
+ announcement = `${input.value} - ${helpers.IcDateInputMonths[+input.value - 1]}, ${ariaLabel}`;
716
+ }
717
+ if (input === this.dayInputEl && this.isValidDay) {
718
+ announcement = `${input.value}, ${ariaLabel}`;
719
+ }
720
+ }
721
+ else {
722
+ announcement = "";
723
+ }
724
+ }
725
+ else {
726
+ if (input.value.length === 4) {
727
+ announcement = `${input.value}, ${ariaLabel}`;
728
+ }
729
+ else {
730
+ announcement = "";
731
+ }
732
+ }
733
+ liveRegion.textContent = announcement;
734
+ };
735
+ this.setFitToValueStyling = (input) => {
736
+ if (input.value) {
737
+ input.classList.add(this.FIT_TO_VALUE);
738
+ }
739
+ else {
740
+ input.classList.remove(this.FIT_TO_VALUE);
741
+ }
742
+ };
743
+ this.setAriaInvalid = (validDay, validMonth, validDate, disabledDate) => {
744
+ if (this.inputsInOrder.length) {
745
+ this.inputsInOrder.forEach((input) => {
746
+ input.removeAttribute(this.ARIA_INVALID);
747
+ });
748
+ if (!validDay) {
749
+ this.dayInputEl.setAttribute(this.ARIA_INVALID, "true");
750
+ }
751
+ if (!validMonth) {
752
+ this.monthInputEl.setAttribute(this.ARIA_INVALID, "true");
753
+ }
754
+ if (!validDate || disabledDate) {
755
+ this.inputsInOrder.forEach((input) => {
756
+ input.setAttribute(this.ARIA_INVALID, "true");
757
+ });
758
+ }
759
+ }
760
+ };
761
+ this.handleClear = () => {
762
+ this.inputsInOrder.forEach((input) => {
763
+ input.classList.remove(this.FIT_TO_VALUE);
764
+ this.setInputValue(input, true);
765
+ this.setPreventInput(input, false);
766
+ });
767
+ this.isDateSetFromKeyboardEvent = false;
768
+ this.setValidationMessage();
769
+ this.handleDateChange(true);
770
+ this.inputsInOrder[0].focus();
771
+ };
772
+ this.handleCalendarOpen = (ev) => {
773
+ var _a, _b;
774
+ ev.stopImmediatePropagation();
775
+ (_a = this.calendarButtonEl) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);
776
+ this.calendarButtonClicked.emit({ value: this.selectedDate });
777
+ (_b = this.calendarButtonEl) === null || _b === void 0 ? void 0 : _b.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);
778
+ this.isDateSetFromKeyboardEvent = false;
779
+ };
780
+ this.setValueAndEmitChange = (value) => {
781
+ if (!dateHelpers.dateMatches(new Date(this.value), value)) {
782
+ this.emitIcChange(value);
783
+ this.value = value;
784
+ }
785
+ };
786
+ this.handleCalendarFocus = () => {
787
+ this.calendarFocused = true;
788
+ };
789
+ this.handleCalendarBlur = () => {
790
+ this.calendarFocused = false;
791
+ };
792
+ this.handleClearFocus = () => {
793
+ this.removeLabelledBy = true;
794
+ this.clearButtonFocused = true;
795
+ };
796
+ this.handleClearBlur = (ev) => {
797
+ var _a;
798
+ this.clearButtonFocused = false;
799
+ if ((_a = ev.relatedTarget) === null || _a === void 0 ? void 0 : _a.id.match(/(day|year)-input$/)) {
800
+ this.removeLabelledBy = false;
801
+ return;
802
+ }
803
+ this.removeLabelledBy = true;
804
+ };
805
+ this.emitIcChange = (d) => {
806
+ if (!(d === null && this.previousEmittedDate === null) &&
807
+ !dateHelpers.dateMatches(d, this.previousEmittedDate)) {
808
+ this.previousEmittedDate = d;
809
+ this.icChange.emit({ value: d });
810
+ }
811
+ };
812
+ this.day = "";
813
+ this.invalidDateText = undefined;
814
+ this.maxDate = undefined;
815
+ this.minDate = undefined;
816
+ this.month = "";
817
+ this.year = "";
818
+ this.calendarFocused = false;
819
+ this.clearButtonFocused = false;
820
+ this.removeLabelledBy = false;
821
+ this.dateFormat = "DD/MM/YYYY";
822
+ this.disabled = false;
823
+ this.disableDays = [];
824
+ this.disableDaysMessage = "The date you have selected is on a day of the week that is not allowed. Please select another date.";
825
+ this.disableFuture = false;
826
+ this.disableFutureMessage = "Dates in the future are not allowed. Please select a date in the past.";
827
+ this.disablePast = false;
828
+ this.disablePastMessage = "Dates in the past are not allowed. Please select a date in the future.";
829
+ this.helperText = undefined;
830
+ this.inputId = `ic-date-input-${inputIds++}`;
831
+ this.label = undefined;
832
+ this.max = "";
833
+ this.min = "";
834
+ this.name = this.inputId;
835
+ this.required = false;
836
+ this.showCalendarButton = false;
837
+ this.showClearButton = true;
838
+ this.size = "default";
839
+ this.value = "";
840
+ this.validationStatus = "";
841
+ this.validationText = "";
842
+ }
843
+ watchDisableFutureHandler() {
844
+ this.watchMaxHandler();
845
+ }
846
+ watchDisablePastHandler() {
847
+ this.watchMinHandler();
848
+ }
849
+ watchMaxHandler() {
850
+ if (this.disableFuture) {
851
+ this.maxDate = new Date();
852
+ }
853
+ else {
854
+ this.maxDate = dateHelpers.createDate(this.max, this.dateFormat);
855
+ }
856
+ }
857
+ watchMinHandler() {
858
+ if (this.disablePast) {
859
+ this.minDate = new Date();
860
+ }
861
+ else {
862
+ this.minDate = dateHelpers.createDate(this.min, this.dateFormat);
863
+ }
864
+ }
865
+ watchRequiredHandler() {
866
+ // Prevent asterisk being read out after the label by screen reader (by applying aria-hidden)
867
+ // Needed because label is included in 'aria-labelledby' instead of using 'aria-label'
868
+ const labelEl = this.el.shadowRoot.querySelector("label");
869
+ if (this.required) {
870
+ const asteriskSpan = document.createElement("span");
871
+ asteriskSpan.setAttribute("id", "asterisk-span");
872
+ asteriskSpan.setAttribute("aria-hidden", "true");
873
+ asteriskSpan.textContent = " *";
874
+ labelEl === null || labelEl === void 0 ? void 0 : labelEl.appendChild(asteriskSpan);
875
+ }
876
+ else {
877
+ const asteriskSpan = this.el.shadowRoot.querySelector("#asterisk-span");
878
+ if (asteriskSpan) {
879
+ asteriskSpan.remove();
880
+ }
881
+ }
882
+ }
883
+ disconnectedCallback() {
884
+ helpers.removeFormResetListener(this.el, this.handleFormReset);
885
+ }
886
+ componentWillLoad() {
887
+ this.defaultHelperText = `Use format ${this.dateFormat}`;
888
+ if (helpers.isEmptyString(this.helperText)) {
889
+ this.helperText = this.defaultHelperText;
890
+ }
891
+ this.watchMinHandler();
892
+ this.watchMaxHandler();
893
+ if (this.value) {
894
+ this.setDate(this.value);
895
+ this.previousEmittedDate = this.selectedDate;
896
+ }
897
+ else {
898
+ this.previousEmittedDate = null;
899
+ }
900
+ this.screenReaderInfoId = `${this.inputId}-screen-reader-info`;
901
+ this.assistiveHintId = `${this.inputId}-assistive-hint`;
902
+ this.selectedDateInfoId = `${this.inputId}-selected-date-info`;
903
+ helpers.addFormResetListener(this.el, this.handleFormReset);
904
+ }
905
+ componentDidLoad() {
906
+ this.setInputsInOrder();
907
+ helpers.onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Date Input");
908
+ if (this.value) {
909
+ this.updateInputValues(this.day, this.month, this.year);
910
+ this.inputsInOrder.forEach((input) => {
911
+ input.classList.add(this.FIT_TO_VALUE);
912
+ });
913
+ }
914
+ this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
915
+ if (this.value) {
916
+ this.notifyScreenReaderSelectedDate();
917
+ }
918
+ this.inputsInOrder.forEach((input) => {
919
+ input.addEventListener("input", this.handleInput);
920
+ input.addEventListener("focus", this.handleFocus);
921
+ input.addEventListener("blur", this.handleBlur);
922
+ });
923
+ this.watchRequiredHandler();
924
+ }
925
+ componentWillUpdate() {
926
+ if (!this.isDateSetFromKeyboardEvent) {
927
+ this.setDate(this.value);
928
+ }
929
+ this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
930
+ this.handleDateChange(false);
931
+ this.isDateSetFromKeyboardEvent = false;
932
+ }
933
+ componentDidRender() {
934
+ if (this.removeLabelledBy) {
935
+ this.removeAriaLabelledBy();
936
+ return;
937
+ }
938
+ this.setAriaLabelledBy();
939
+ }
940
+ /**
941
+ * Returns the value as a Date object
942
+ * @returns Date
943
+ */
944
+ async getDate() {
945
+ return this.selectedDate;
946
+ }
947
+ /**
948
+ * @internal Sets focus on the calendar button.
949
+ */
950
+ async setCalendarFocus() {
951
+ if (this.calendarButtonEl) {
952
+ this.calendarButtonEl.focus();
953
+ }
954
+ }
955
+ /**
956
+ * @internal Used to pass disabledDays from parent component.
957
+ */
958
+ async setDisableDays(days) {
959
+ this.disableDays = days;
960
+ }
961
+ /**
962
+ * @internal Used to enable other components to invoke an IcChange event from the input.
963
+ */
964
+ async triggerIcChange(d) {
965
+ this.emitIcChange(d);
966
+ }
967
+ removeAriaLabelledBy() {
968
+ this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY);
969
+ }
970
+ setPastedValueAndValidation(isValidDate, pastedValue, event) {
971
+ switch (true) {
972
+ case isValidDate: {
973
+ const nextParsedValue = this.isZuluTime
974
+ ? dateHelpers.extractDateFromZuluDateTime(pastedValue)
975
+ : pastedValue;
976
+ const dateParts = nextParsedValue.split(/-|\/|\./);
977
+ this.inputsInOrder.forEach((input, index) => {
978
+ input.classList.add(this.FIT_TO_VALUE);
979
+ if (this.isZuluTime) {
980
+ this.pasteZuluDateTime(dateParts, index);
981
+ }
982
+ else {
983
+ let dateValue;
984
+ if (input === this.dayInputEl || input === this.monthInputEl) {
985
+ dateValue = this.slicePastedDate(2, dateParts[index]);
986
+ }
987
+ else {
988
+ dateValue = this.slicePastedDate(4, dateParts[index]);
989
+ }
990
+ input.value = dateValue;
991
+ this.setInputValue(input);
992
+ this.autocompleteInput(input);
993
+ }
994
+ });
995
+ this.isZuluTime = false;
996
+ break;
997
+ }
998
+ case (pastedValue.length === 1 ||
999
+ pastedValue.length === 2 ||
1000
+ pastedValue.length === 4) &&
1001
+ helpers.isNumeric(pastedValue):
1002
+ if (this.checkSingleCopiedValueIsValid(event.target, pastedValue)) {
1003
+ // Check if copied value can be pasted into input
1004
+ this.setInputPasteValue(event.target, pastedValue);
1005
+ this.setInputValue(event.target);
1006
+ }
1007
+ else {
1008
+ this.displayPastedValidation(event);
1009
+ }
1010
+ break;
1011
+ case pastedValue.length === 3 && helpers.isNumeric(pastedValue):
1012
+ if (event.target !== this.yearInputEl) {
1013
+ this.displayPastedValidation(event);
1014
+ }
1015
+ else {
1016
+ this.setInputPasteValue(event.target, pastedValue);
1017
+ this.setInputValue(event.target);
1018
+ }
1019
+ break;
1020
+ case pastedValue.length >= 5 && helpers.isNumeric(pastedValue):
1021
+ this.displayPastedValidation(event);
1022
+ }
1023
+ }
1024
+ pasteZuluDateTime(dateParts, index) {
1025
+ // ['YYYY', 'MM', 'DD']
1026
+ if (index === 0) {
1027
+ const dateValue = this.slicePastedDate(4, dateParts[index]);
1028
+ this.yearInputEl.value = dateValue;
1029
+ this.setInputValue(this.yearInputEl);
1030
+ }
1031
+ else if (index === 1) {
1032
+ // The month value is the second item in the array
1033
+ const dateValue = this.slicePastedDate(2, dateParts[index]);
1034
+ this.monthInputEl.value = dateValue;
1035
+ this.setInputValue(this.monthInputEl);
1036
+ }
1037
+ else {
1038
+ const dateValue = this.slicePastedDate(2, dateParts[index]);
1039
+ this.dayInputEl.value = dateValue;
1040
+ this.setInputValue(this.dayInputEl);
1041
+ }
1042
+ }
1043
+ displayPastedValidation(event) {
1044
+ var _a;
1045
+ if (((_a = this.invalidDateText) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1046
+ this.previousInvalidDateTest = this.invalidDateText;
1047
+ }
1048
+ this.invalidDateText = `Please paste a valid ${this.getAriaLabel(event.target)}`;
1049
+ this.validationStatus = helpers.IcInformationStatus.Error;
1050
+ this.isPasteValidationDisplayed = true;
1051
+ }
1052
+ setPasteInvalidText() {
1053
+ var _a;
1054
+ if (this.isPasteValidationDisplayed) {
1055
+ this.invalidDateText = (_a = this.previousInvalidDateTest) !== null && _a !== void 0 ? _a : "";
1056
+ this.isPasteValidationDisplayed = false;
1057
+ // This is to prevent setDate from triggering within componentWillUpdate
1058
+ this.isDateSetFromKeyboardEvent = true;
1059
+ }
1060
+ }
1061
+ notifyScreenReader(input, event) {
1062
+ const liveRegion = this.el.shadowRoot.querySelector("#live-region");
1063
+ if (liveRegion) {
1064
+ if (this.isKeyboardOrEvent(event)) {
1065
+ this.notifyScreenReaderArrowKeys(input);
1066
+ }
1067
+ else if (Object.prototype.toString.call(event) === this.INPUT_EVENT_OBJECT_STRING) {
1068
+ this.notifyScreenReaderInput(input, liveRegion);
1069
+ }
1070
+ }
1071
+ }
1072
+ render() {
1073
+ const { inputId, label, disabled, helperText, showClearButton, showCalendarButton, size, } = this;
1074
+ const hasCustomValidation = !helpers.isEmptyString(this.validationStatus) &&
1075
+ !helpers.isEmptyString(this.validationText);
1076
+ const validationStatus = hasCustomValidation
1077
+ ? this.validationStatus
1078
+ : !helpers.isEmptyString(this.invalidDateText)
1079
+ ? helpers.IcInformationStatus.Error
1080
+ : "";
1081
+ const assistiveHint = `Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;
1082
+ helpers.renderHiddenInput(true, this.el, this.name, this.convertToDate(this.year, this.month, this.day), this.disabled);
1083
+ return (index.h(index.Host, { onBlur: this.handleHostBlur, onFocus: this.handleHostFocus }, index.h("ic-input-container", { disabled: disabled }, index.h("ic-input-label", { for: inputId, label: label, helperText: helperText, disabled: disabled }), index.h("span", { id: this.screenReaderInfoId, class: "sr-only", "aria-hidden": "true" }, this.getScreenReaderInfo(validationStatus), `${this.defaultHelperText}.`), index.h("span", { id: this.assistiveHintId, class: "sr-only", "aria-hidden": "true" }, assistiveHint), index.h("span", { id: "live-region", "aria-live": "assertive", class: "sr-only" }), index.h("ic-input-component-container", { id: inputId, ref: (el) => (this.inputCompContainerEl = el), disabled: disabled, validationStatus: validationStatus, size: size, role: "group" }, index.h("div", { class: "input-container" }, index.h("div", { class: "date-inputs" }, this.getInputsInOrder()[0], "/", this.getInputsInOrder()[1], "/", this.getInputsInOrder()[2]), index.h("div", { class: "action-buttons" }, showClearButton && (index.h("ic-button", { id: "clear-button", "aria-label": "Clear input", class: {
1084
+ ["clear-button"]: true,
1085
+ ["hidden"]: helpers.isEmptyString(this.day) &&
1086
+ helpers.isEmptyString(this.month) &&
1087
+ helpers.isEmptyString(this.year),
1088
+ }, disabled: this.disabled, innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearFocus, onBlur: this.handleClearBlur, variant: "icon", appearance: this.clearButtonFocused
1089
+ ? helpers.IcThemeForegroundEnum.Light
1090
+ : helpers.IcThemeForegroundEnum.Dark, size: size })), showCalendarButton && (index.h("div", { class: "show-calendar-button-wrapper" }, index.h("div", { class: { divider: true, [size]: true } }), index.h("ic-button", { id: "calendar-button", ref: (el) => (this.calendarButtonEl = el), "aria-label": "Display calendar", "aria-haspopup": "dialog", class: "calendar-button", disabled: this.disabled, innerHTML: Calendar, onClick: this.handleCalendarOpen, variant: "icon", size: size, onFocus: this.handleCalendarFocus, onBlur: this.handleCalendarBlur, appearance: this.calendarFocused
1091
+ ? helpers.IcThemeForegroundEnum.Light
1092
+ : helpers.IcThemeForegroundEnum.Default })))))), index.h("span", { id: this.selectedDateInfoId, class: "sr-only", "aria-live": "polite" }, index.h("span", { ref: (el) => (this.selectedDateInfoEl = el), role: "status" })), (hasCustomValidation || !helpers.isEmptyString(this.invalidDateText)) && (index.h("ic-input-validation", { status: validationStatus, message: hasCustomValidation ? this.validationText : this.invalidDateText, for: inputId })))));
1093
+ }
1094
+ static get delegatesFocus() { return true; }
1095
+ get el() { return index.getElement(this); }
1096
+ static get watchers() { return {
1097
+ "disableFuture": ["watchDisableFutureHandler"],
1098
+ "disablePast": ["watchDisablePastHandler"],
1099
+ "max": ["watchMaxHandler"],
1100
+ "min": ["watchMinHandler"],
1101
+ "required": ["watchRequiredHandler"]
1102
+ }; }
1103
+ };
1104
+ DateInput.style = icDateInputCss;
1105
+
1106
+ exports.ic_date_input = DateInput;
1107
+
1108
+ //# sourceMappingURL=ic-date-input.cjs.entry.js.map