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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (542) 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-6d736902.js} +27 -4
  5. package/dist/cjs/helpers-6d736902.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 +18 -17
  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 +41 -86
  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 +25 -2
  23. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  25. package/dist/cjs/ic-data-table.cjs.entry.js +43 -308
  26. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-date-input.cjs.entry.js +1108 -0
  28. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -0
  29. package/dist/cjs/ic-date-picker.cjs.entry.js +1053 -0
  30. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -0
  31. package/dist/cjs/ic-dialog.cjs.entry.js +14 -4
  32. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  33. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  34. package/dist/cjs/ic-empty-state.cjs.entry.js +38 -0
  35. package/dist/cjs/ic-empty-state.cjs.entry.js.map +1 -0
  36. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +150 -0
  42. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -0
  43. package/dist/cjs/ic-link.cjs.entry.js +33 -15
  44. package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
  45. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -1
  49. package/dist/cjs/{ic-input-component-container_3.cjs.entry.js → ic-menu.cjs.entry.js} +5 -69
  50. package/dist/cjs/ic-menu.cjs.entry.js.map +1 -0
  51. package/dist/cjs/ic-navigation-button.cjs.entry.js +26 -5
  52. package/dist/cjs/ic-navigation-button.cjs.entry.js.map +1 -1
  53. package/dist/cjs/ic-navigation-group.cjs.entry.js +16 -13
  54. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  55. package/dist/cjs/ic-navigation-item.cjs.entry.js +29 -33
  56. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  57. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  58. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  59. package/dist/cjs/{ic-empty-state_2.cjs.entry.js → ic-pagination-bar.cjs.entry.js} +4 -34
  60. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -0
  61. package/dist/cjs/ic-pagination_4.cjs.entry.js +53 -16
  62. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-radio-group.cjs.entry.js +40 -26
  65. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  66. package/dist/cjs/ic-radio-option.cjs.entry.js +9 -4
  67. package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
  68. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-select-with-multi.cjs.entry.js +6 -19
  70. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -1
  71. package/dist/cjs/ic-side-navigation.cjs.entry.js +2 -2
  72. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  73. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  74. package/dist/cjs/ic-step.cjs.entry.js +5 -2
  75. package/dist/cjs/ic-step.cjs.entry.js.map +1 -1
  76. package/dist/cjs/ic-stepper.cjs.entry.js +2 -1
  77. package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
  78. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  79. package/dist/cjs/ic-tab-context.cjs.entry.js +18 -2
  80. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  81. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  82. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  83. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  84. package/dist/cjs/ic-theme.cjs.entry.js +3 -10
  85. package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
  86. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  87. package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
  88. package/dist/cjs/ic-top-navigation.cjs.entry.js +46 -60
  89. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  90. package/dist/cjs/ic-typography.cjs.entry.js +11 -35
  91. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  92. package/dist/cjs/index-4cf27b16.js +18 -10
  93. package/dist/cjs/loader.cjs.js +1 -1
  94. package/dist/collection/assets/calendar.svg +3 -0
  95. package/dist/collection/collection-manifest.json +2 -1
  96. package/dist/collection/components/ic-data-table/ic-data-table.css +7 -82
  97. package/dist/collection/components/ic-data-table/ic-data-table.js +44 -535
  98. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  99. package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
  100. package/dist/collection/components/ic-data-table/story-data.js +11 -386
  101. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  102. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +0 -319
  103. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
  104. package/dist/collection/components/ic-date-input/ic-date-input.css +560 -0
  105. package/dist/collection/components/ic-date-input/ic-date-input.js +1737 -0
  106. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -0
  107. package/dist/collection/components/ic-date-input/story-data.js +28 -0
  108. package/dist/collection/components/ic-date-input/story-data.js.map +1 -0
  109. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +1142 -0
  110. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -0
  111. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +42 -0
  112. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -0
  113. package/dist/collection/components/ic-date-picker/ic-date-picker.css +878 -0
  114. package/dist/collection/components/ic-date-picker/ic-date-picker.js +1512 -0
  115. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -0
  116. package/dist/collection/components/ic-date-picker/ic-day-button.js +36 -0
  117. package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -0
  118. package/dist/collection/components/ic-date-picker/ic-month-picker.js +29 -0
  119. package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -0
  120. package/dist/collection/components/ic-date-picker/ic-year-picker.js +39 -0
  121. package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -0
  122. package/dist/collection/components/ic-date-picker/story-data.js +148 -0
  123. package/dist/collection/components/ic-date-picker/story-data.js.map +1 -0
  124. 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
  125. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +1 -0
  126. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +207 -0
  127. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +1 -0
  128. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +991 -0
  129. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -0
  130. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +2 -2
  131. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -1
  132. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +1 -1
  133. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
  134. package/dist/collection/components/ic-select-with-multi/ic-select.js +2 -2
  135. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -1
  136. package/dist/collection/utils/constants.js +55 -0
  137. package/dist/collection/utils/constants.js.map +1 -1
  138. package/dist/collection/utils/date-helpers.js +133 -0
  139. package/dist/collection/utils/date-helpers.js.map +1 -0
  140. package/dist/collection/utils/helpers.js +272 -42
  141. package/dist/collection/utils/helpers.js.map +1 -1
  142. package/dist/collection/utils/types.js +45 -0
  143. package/dist/collection/utils/types.js.map +1 -1
  144. package/dist/components/helpers.js +26 -3
  145. package/dist/components/helpers.js.map +1 -1
  146. package/dist/components/helpers2.js +91 -45
  147. package/dist/components/helpers2.js.map +1 -1
  148. package/dist/components/ic-accordion-group.js +14 -4
  149. package/dist/components/ic-accordion-group.js.map +1 -1
  150. package/dist/components/ic-badge.js +18 -17
  151. package/dist/components/ic-badge.js.map +1 -1
  152. package/dist/components/ic-button2.js +43 -86
  153. package/dist/components/ic-button2.js.map +1 -1
  154. package/dist/components/ic-card.js +1 -1
  155. package/dist/components/ic-checkbox-group.js +1 -1
  156. package/dist/components/ic-checkbox.js +1 -1
  157. package/dist/components/ic-chip.js +29 -3
  158. package/dist/components/ic-chip.js.map +1 -1
  159. package/dist/components/ic-data-table.js +49 -334
  160. package/dist/components/ic-data-table.js.map +1 -1
  161. package/dist/components/{ic-data-table-title-bar.d.ts → ic-date-input.d.ts} +4 -4
  162. package/dist/components/ic-date-input.js +8 -0
  163. package/dist/components/ic-date-input.js.map +1 -0
  164. package/dist/components/ic-date-input2.js +1340 -0
  165. package/dist/components/ic-date-input2.js.map +1 -0
  166. package/dist/components/ic-date-picker.d.ts +11 -0
  167. package/dist/components/ic-date-picker.js +1175 -0
  168. package/dist/components/ic-date-picker.js.map +1 -0
  169. package/dist/components/ic-dialog.js +13 -3
  170. package/dist/components/ic-dialog.js.map +1 -1
  171. package/dist/components/ic-empty-state.js +57 -1
  172. package/dist/components/ic-empty-state.js.map +1 -1
  173. package/dist/components/ic-input-component-container2.js +1 -1
  174. package/dist/components/ic-input-component-container2.js.map +1 -1
  175. package/dist/components/ic-link2.js +34 -16
  176. package/dist/components/ic-link2.js.map +1 -1
  177. package/dist/components/ic-loading-indicator2.js +1 -1
  178. package/dist/components/ic-loading-indicator2.js.map +1 -1
  179. package/dist/components/ic-menu-item2.js +1 -1
  180. package/dist/components/ic-menu2.js +2 -2
  181. package/dist/components/ic-menu2.js.map +1 -1
  182. package/dist/components/ic-menu3.js +1 -1
  183. package/dist/components/ic-menu3.js.map +1 -1
  184. package/dist/components/ic-navigation-button.js +26 -5
  185. package/dist/components/ic-navigation-button.js.map +1 -1
  186. package/dist/components/ic-navigation-group.js +15 -12
  187. package/dist/components/ic-navigation-group.js.map +1 -1
  188. package/dist/components/ic-navigation-item.js +29 -33
  189. package/dist/components/ic-navigation-item.js.map +1 -1
  190. package/dist/components/ic-pagination-bar2.js +1 -1
  191. package/dist/components/ic-pagination-bar2.js.map +1 -1
  192. package/dist/components/ic-pagination-item2.js +1 -1
  193. package/dist/components/ic-pagination2.js +5 -5
  194. package/dist/components/ic-pagination2.js.map +1 -1
  195. package/dist/components/ic-radio-group.js +40 -26
  196. package/dist/components/ic-radio-group.js.map +1 -1
  197. package/dist/components/ic-radio-option.js +11 -5
  198. package/dist/components/ic-radio-option.js.map +1 -1
  199. package/dist/components/ic-search-bar.js +1 -1
  200. package/dist/components/ic-select-with-multi.js +1 -14
  201. package/dist/components/ic-select-with-multi.js.map +1 -1
  202. package/dist/components/ic-select2.js +25 -7
  203. package/dist/components/ic-select2.js.map +1 -1
  204. package/dist/components/ic-side-navigation.js +1 -1
  205. package/dist/components/ic-side-navigation.js.map +1 -1
  206. package/dist/components/ic-step.js +4 -1
  207. package/dist/components/ic-step.js.map +1 -1
  208. package/dist/components/ic-stepper.js +2 -0
  209. package/dist/components/ic-stepper.js.map +1 -1
  210. package/dist/components/ic-switch.js +1 -1
  211. package/dist/components/ic-tab-context.js +18 -2
  212. package/dist/components/ic-tab-context.js.map +1 -1
  213. package/dist/components/ic-tab.js +1 -1
  214. package/dist/components/ic-text-field2.js +27 -8
  215. package/dist/components/ic-text-field2.js.map +1 -1
  216. package/dist/components/ic-theme.js +3 -10
  217. package/dist/components/ic-theme.js.map +1 -1
  218. package/dist/components/ic-toggle-button.js +1 -1
  219. package/dist/components/ic-top-navigation.js +47 -61
  220. package/dist/components/ic-top-navigation.js.map +1 -1
  221. package/dist/components/ic-typography2.js +12 -38
  222. package/dist/components/ic-typography2.js.map +1 -1
  223. package/dist/core/core.css +1 -1
  224. package/dist/core/core.esm.js +1 -1
  225. package/dist/core/core.esm.js.map +1 -1
  226. package/dist/core/{p-869954a2.entry.js → p-00bd7919.entry.js} +2 -2
  227. package/dist/core/p-00c5639e.entry.js +2 -0
  228. package/dist/core/{p-db9c03c0.entry.js.map → p-00c5639e.entry.js.map} +1 -1
  229. package/dist/core/p-06c27edb.entry.js +2 -0
  230. package/dist/core/p-06c27edb.entry.js.map +1 -0
  231. package/dist/core/{p-a0f8efb2.entry.js → p-0af27517.entry.js} +2 -2
  232. package/dist/core/p-0af27517.entry.js.map +1 -0
  233. package/dist/core/p-162f3e36.entry.js +2 -0
  234. package/dist/core/{p-624d4f5f.entry.js.map → p-162f3e36.entry.js.map} +1 -1
  235. package/dist/core/p-19c1e271.entry.js +2 -0
  236. package/dist/core/p-19c1e271.entry.js.map +1 -0
  237. package/dist/core/{p-a50c3b9e.entry.js → p-1a91e842.entry.js} +2 -2
  238. package/dist/core/{p-76915584.entry.js → p-1c3bd46d.entry.js} +2 -2
  239. package/dist/core/p-1c3bd46d.entry.js.map +1 -0
  240. package/dist/core/p-2c9d6334.entry.js +2 -0
  241. package/dist/core/p-2c9d6334.entry.js.map +1 -0
  242. package/dist/core/p-33dd24eb.js +2 -0
  243. package/dist/core/p-33dd24eb.js.map +1 -0
  244. package/dist/core/p-3dcc61cc.entry.js +2 -0
  245. package/dist/core/p-3dcc61cc.entry.js.map +1 -0
  246. package/dist/core/p-3e9a8977.entry.js +2 -0
  247. package/dist/core/{p-595be57d.entry.js.map → p-3e9a8977.entry.js.map} +1 -1
  248. package/dist/core/{p-f3c840cd.entry.js → p-41b682dc.entry.js} +2 -2
  249. package/dist/core/p-494c3cbe.entry.js +2 -0
  250. package/dist/core/p-494c3cbe.entry.js.map +1 -0
  251. package/dist/core/p-4ad3012a.entry.js +2 -0
  252. package/dist/core/p-4ad3012a.entry.js.map +1 -0
  253. package/dist/core/p-4bd13376.entry.js +2 -0
  254. package/dist/core/p-4bd13376.entry.js.map +1 -0
  255. package/dist/core/p-4fd58768.entry.js +2 -0
  256. package/dist/core/p-4fd58768.entry.js.map +1 -0
  257. package/dist/core/{p-8b08d8fe.entry.js → p-6dce8e88.entry.js} +2 -2
  258. package/dist/core/{p-1ca332ca.entry.js → p-6eb58b0a.entry.js} +2 -2
  259. package/dist/core/p-730f058b.entry.js +2 -0
  260. package/dist/core/p-730f058b.entry.js.map +1 -0
  261. package/dist/core/p-7f53d1be.entry.js +2 -0
  262. package/dist/core/p-7f53d1be.entry.js.map +1 -0
  263. package/dist/core/{p-5ae93c16.entry.js → p-7fda2f94.entry.js} +2 -2
  264. package/dist/core/p-843bdaae.entry.js +2 -0
  265. package/dist/core/p-843bdaae.entry.js.map +1 -0
  266. package/dist/core/p-849f43c3.entry.js +2 -0
  267. package/dist/core/p-849f43c3.entry.js.map +1 -0
  268. package/dist/core/{p-c34848da.entry.js → p-8b1f9648.entry.js} +2 -2
  269. package/dist/core/{p-a434c3d4.entry.js → p-8b820365.entry.js} +2 -2
  270. package/dist/core/p-940de102.entry.js +2 -0
  271. package/dist/core/p-940de102.entry.js.map +1 -0
  272. package/dist/core/{p-2eac7dcc.entry.js → p-946625a3.entry.js} +2 -2
  273. package/dist/core/{p-7ef8d616.entry.js → p-9528b29e.entry.js} +2 -2
  274. package/dist/core/{p-a43c12cd.entry.js → p-9567c117.entry.js} +2 -2
  275. package/dist/core/{p-b82dcc29.entry.js → p-957de939.entry.js} +2 -2
  276. package/dist/core/{p-045359e1.entry.js → p-99bf38e3.entry.js} +2 -2
  277. package/dist/core/{p-81ddc39d.entry.js → p-9d8883d7.entry.js} +2 -2
  278. package/dist/core/{p-b6639e4a.entry.js → p-9e3178e8.entry.js} +2 -2
  279. package/dist/core/{p-b6639e4a.entry.js.map → p-9e3178e8.entry.js.map} +1 -1
  280. package/dist/core/p-a05755b1.entry.js +2 -0
  281. package/dist/core/p-a05755b1.entry.js.map +1 -0
  282. package/dist/core/{p-e834344e.entry.js → p-a1556d97.entry.js} +2 -2
  283. package/dist/core/{p-f843da01.entry.js → p-a2dc10d8.entry.js} +2 -2
  284. package/dist/core/{p-ab09986c.entry.js → p-a8c15117.entry.js} +2 -2
  285. package/dist/core/p-aabab75f.entry.js +2 -0
  286. package/dist/core/p-aabab75f.entry.js.map +1 -0
  287. package/dist/core/{p-f7a14c01.entry.js → p-c14a897d.entry.js} +2 -2
  288. package/dist/core/p-c621d6b0.entry.js +2 -0
  289. package/dist/core/p-c621d6b0.entry.js.map +1 -0
  290. package/dist/core/p-c7590421.entry.js +2 -0
  291. package/dist/core/p-c7590421.entry.js.map +1 -0
  292. package/dist/core/p-c953edb9.entry.js +2 -0
  293. package/dist/core/p-c953edb9.entry.js.map +1 -0
  294. package/dist/core/p-cca482e2.entry.js +2 -0
  295. package/dist/core/p-cca482e2.entry.js.map +1 -0
  296. package/dist/core/p-cd799087.js +2 -0
  297. package/dist/core/p-cd799087.js.map +1 -0
  298. package/dist/core/{p-e3997d60.entry.js → p-d2d63a61.entry.js} +2 -2
  299. package/dist/core/p-d32d331b.entry.js +2 -0
  300. package/dist/core/p-d32d331b.entry.js.map +1 -0
  301. package/dist/core/{p-4f413fc0.entry.js → p-db3a35fb.entry.js} +2 -2
  302. package/dist/core/p-dc5e1f8f.entry.js +2 -0
  303. package/dist/core/{p-6933f8e9.entry.js.map → p-dc5e1f8f.entry.js.map} +1 -1
  304. package/dist/core/{p-204ace96.entry.js → p-e16f73ba.entry.js} +2 -2
  305. package/dist/core/p-e189f1d0.entry.js +2 -0
  306. package/dist/core/p-e189f1d0.entry.js.map +1 -0
  307. package/dist/core/{p-917c5721.entry.js → p-e1963c78.entry.js} +2 -2
  308. package/dist/core/p-e1963c78.entry.js.map +1 -0
  309. package/dist/core/{p-f14454b1.entry.js → p-e8151d13.entry.js} +2 -2
  310. package/dist/core/p-ee765ad5.js +2 -0
  311. package/dist/core/p-ee765ad5.js.map +1 -0
  312. package/dist/core/{p-fc5611e2.entry.js → p-f2147136.entry.js} +2 -2
  313. package/dist/core/p-f2147136.entry.js.map +1 -0
  314. package/dist/core/{p-5e0c830b.entry.js → p-f8f36680.entry.js} +2 -2
  315. package/dist/core/{p-5e0c830b.entry.js.map → p-f8f36680.entry.js.map} +1 -1
  316. package/dist/core/p-fca46bd9.entry.js +2 -0
  317. package/dist/core/p-fca46bd9.entry.js.map +1 -0
  318. package/dist/core/{p-a31031a5.entry.js → p-ff3a01f3.entry.js} +2 -2
  319. package/dist/core/{p-75dac3d1.entry.js → p-ff6f1e3a.entry.js} +2 -2
  320. package/dist/esm/core.js +1 -1
  321. package/dist/esm/date-helpers-0e5e32a7.js +136 -0
  322. package/dist/esm/date-helpers-0e5e32a7.js.map +1 -0
  323. package/dist/esm/{helpers-12b4266a.js → helpers-c34e4042.js} +27 -4
  324. package/dist/esm/helpers-c34e4042.js.map +1 -0
  325. package/dist/esm/{helpers-1f07eb61.js → helpers-f328a7b6.js} +92 -46
  326. package/dist/esm/helpers-f328a7b6.js.map +1 -0
  327. package/dist/esm/ic-accordion-group.entry.js +11 -2
  328. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  329. package/dist/esm/ic-accordion.entry.js +1 -1
  330. package/dist/esm/ic-alert.entry.js +1 -1
  331. package/dist/esm/ic-back-to-top.entry.js +1 -1
  332. package/dist/esm/ic-badge.entry.js +18 -17
  333. package/dist/esm/ic-badge.entry.js.map +1 -1
  334. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  335. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  336. package/dist/esm/ic-button_3.entry.js +41 -86
  337. package/dist/esm/ic-button_3.entry.js.map +1 -1
  338. package/dist/esm/ic-card.entry.js +1 -1
  339. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  340. package/dist/esm/ic-checkbox.entry.js +1 -1
  341. package/dist/esm/ic-chip.entry.js +25 -2
  342. package/dist/esm/ic-chip.entry.js.map +1 -1
  343. package/dist/esm/ic-data-row.entry.js +1 -1
  344. package/dist/esm/ic-data-table.entry.js +44 -309
  345. package/dist/esm/ic-data-table.entry.js.map +1 -1
  346. package/dist/esm/ic-date-input.entry.js +1104 -0
  347. package/dist/esm/ic-date-input.entry.js.map +1 -0
  348. package/dist/esm/ic-date-picker.entry.js +1049 -0
  349. package/dist/esm/ic-date-picker.entry.js.map +1 -0
  350. package/dist/esm/ic-dialog.entry.js +14 -4
  351. package/dist/esm/ic-dialog.entry.js.map +1 -1
  352. package/dist/esm/ic-divider.entry.js +1 -1
  353. package/dist/{components/ic-empty-state2.js → esm/ic-empty-state.entry.js} +11 -38
  354. package/dist/esm/ic-empty-state.entry.js.map +1 -0
  355. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  356. package/dist/esm/ic-footer-link.entry.js +1 -1
  357. package/dist/esm/ic-footer.entry.js +1 -1
  358. package/dist/esm/ic-hero.entry.js +1 -1
  359. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  360. package/dist/esm/ic-input-component-container_4.entry.js +143 -0
  361. package/dist/esm/ic-input-component-container_4.entry.js.map +1 -0
  362. package/dist/esm/ic-link.entry.js +34 -16
  363. package/dist/esm/ic-link.entry.js.map +1 -1
  364. package/dist/esm/ic-menu-group.entry.js +1 -1
  365. package/dist/esm/ic-menu-item.entry.js +1 -1
  366. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  367. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -1
  368. package/dist/esm/{ic-input-component-container_3.entry.js → ic-menu.entry.js} +7 -69
  369. package/dist/esm/ic-menu.entry.js.map +1 -0
  370. package/dist/esm/ic-navigation-button.entry.js +27 -6
  371. package/dist/esm/ic-navigation-button.entry.js.map +1 -1
  372. package/dist/esm/ic-navigation-group.entry.js +16 -13
  373. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  374. package/dist/esm/ic-navigation-item.entry.js +29 -33
  375. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  376. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  377. package/dist/esm/ic-page-header.entry.js +1 -1
  378. package/dist/esm/{ic-empty-state_2.entry.js → ic-pagination-bar.entry.js} +5 -34
  379. package/dist/esm/ic-pagination-bar.entry.js.map +1 -0
  380. package/dist/esm/ic-pagination_4.entry.js +54 -17
  381. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  382. package/dist/esm/ic-popover-menu.entry.js +1 -1
  383. package/dist/esm/ic-radio-group.entry.js +40 -26
  384. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  385. package/dist/esm/ic-radio-option.entry.js +9 -4
  386. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  387. package/dist/esm/ic-search-bar.entry.js +1 -1
  388. package/dist/esm/ic-select-with-multi.entry.js +1 -14
  389. package/dist/esm/ic-select-with-multi.entry.js.map +1 -1
  390. package/dist/esm/ic-side-navigation.entry.js +2 -2
  391. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  392. package/dist/esm/ic-status-tag.entry.js +1 -1
  393. package/dist/esm/ic-step.entry.js +5 -2
  394. package/dist/esm/ic-step.entry.js.map +1 -1
  395. package/dist/esm/ic-stepper.entry.js +2 -1
  396. package/dist/esm/ic-stepper.entry.js.map +1 -1
  397. package/dist/esm/ic-switch.entry.js +1 -1
  398. package/dist/esm/ic-tab-context.entry.js +18 -2
  399. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  400. package/dist/esm/ic-tab-group.entry.js +1 -1
  401. package/dist/esm/ic-tab-panel.entry.js +1 -1
  402. package/dist/esm/ic-tab.entry.js +1 -1
  403. package/dist/esm/ic-theme.entry.js +3 -10
  404. package/dist/esm/ic-theme.entry.js.map +1 -1
  405. package/dist/esm/ic-toast.entry.js +1 -1
  406. package/dist/esm/ic-toggle-button.entry.js +1 -1
  407. package/dist/esm/ic-top-navigation.entry.js +46 -60
  408. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  409. package/dist/esm/ic-typography.entry.js +12 -36
  410. package/dist/esm/ic-typography.entry.js.map +1 -1
  411. package/dist/esm/index-93509377.js +18 -10
  412. package/dist/esm/loader.js +1 -1
  413. package/dist/esm/polyfills/core-js.js +0 -0
  414. package/dist/esm/polyfills/dom.js +0 -0
  415. package/dist/esm/polyfills/es5-html-element.js +0 -0
  416. package/dist/esm/polyfills/index.js +0 -0
  417. package/dist/esm/polyfills/system.js +0 -0
  418. package/dist/types/components/ic-data-table/ic-data-table.d.ts +1 -96
  419. package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +0 -11
  420. package/dist/types/components/ic-data-table/story-data.d.ts +0 -99
  421. package/dist/types/components/ic-date-input/ic-date-input.d.ts +251 -0
  422. package/dist/types/components/ic-date-input/story-data.d.ts +1 -0
  423. package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +23 -0
  424. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +231 -0
  425. package/dist/types/components/ic-date-picker/ic-day-button.d.ts +16 -0
  426. package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +14 -0
  427. package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +16 -0
  428. package/dist/types/components/ic-date-picker/story-data.d.ts +22 -0
  429. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +2 -2
  430. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +2 -2
  431. package/dist/types/components.d.ts +390 -141
  432. package/dist/types/utils/constants.d.ts +37 -0
  433. package/dist/types/utils/date-helpers.d.ts +22 -0
  434. package/dist/types/utils/helpers.d.ts +84 -16
  435. package/dist/types/utils/types.d.ts +92 -1
  436. package/hydrate/index.js +3275 -1148
  437. package/package.json +4 -3
  438. package/dist/cjs/helpers-b525d45a.js.map +0 -1
  439. package/dist/cjs/helpers-c4444a7e.js.map +0 -1
  440. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +0 -57
  441. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +0 -1
  442. package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +0 -1
  443. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +0 -1
  444. package/dist/cjs/ic-input-label_2.cjs.entry.js +0 -86
  445. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +0 -1
  446. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js +0 -217
  447. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js.map +0 -1
  448. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.css +0 -87
  449. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +0 -160
  450. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +0 -1
  451. package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js.map +0 -1
  452. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js +0 -70
  453. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js.map +0 -1
  454. package/dist/components/ic-data-table-title-bar.js +0 -136
  455. package/dist/components/ic-data-table-title-bar.js.map +0 -1
  456. package/dist/components/ic-empty-state2.js.map +0 -1
  457. package/dist/core/p-10fb4c46.entry.js +0 -2
  458. package/dist/core/p-10fb4c46.entry.js.map +0 -1
  459. package/dist/core/p-169bfa51.entry.js +0 -2
  460. package/dist/core/p-169bfa51.entry.js.map +0 -1
  461. package/dist/core/p-1e91f540.entry.js +0 -2
  462. package/dist/core/p-1e91f540.entry.js.map +0 -1
  463. package/dist/core/p-347e8dab.entry.js +0 -2
  464. package/dist/core/p-347e8dab.entry.js.map +0 -1
  465. package/dist/core/p-3803a5b5.entry.js +0 -2
  466. package/dist/core/p-3803a5b5.entry.js.map +0 -1
  467. package/dist/core/p-4753bac8.entry.js +0 -2
  468. package/dist/core/p-4753bac8.entry.js.map +0 -1
  469. package/dist/core/p-4baa0916.entry.js +0 -2
  470. package/dist/core/p-4baa0916.entry.js.map +0 -1
  471. package/dist/core/p-5171169f.entry.js +0 -2
  472. package/dist/core/p-5171169f.entry.js.map +0 -1
  473. package/dist/core/p-595be57d.entry.js +0 -2
  474. package/dist/core/p-5ee4319c.entry.js +0 -2
  475. package/dist/core/p-5ee4319c.entry.js.map +0 -1
  476. package/dist/core/p-5f4e96ec.entry.js +0 -2
  477. package/dist/core/p-5f4e96ec.entry.js.map +0 -1
  478. package/dist/core/p-624d4f5f.entry.js +0 -2
  479. package/dist/core/p-6933f8e9.entry.js +0 -2
  480. package/dist/core/p-6c3044b6.entry.js +0 -2
  481. package/dist/core/p-6c3044b6.entry.js.map +0 -1
  482. package/dist/core/p-7267fe19.entry.js +0 -2
  483. package/dist/core/p-7267fe19.entry.js.map +0 -1
  484. package/dist/core/p-76915584.entry.js.map +0 -1
  485. package/dist/core/p-88d54b72.entry.js +0 -2
  486. package/dist/core/p-88d54b72.entry.js.map +0 -1
  487. package/dist/core/p-917c5721.entry.js.map +0 -1
  488. package/dist/core/p-942282cd.entry.js +0 -2
  489. package/dist/core/p-942282cd.entry.js.map +0 -1
  490. package/dist/core/p-96b3e7e2.js +0 -2
  491. package/dist/core/p-96b3e7e2.js.map +0 -1
  492. package/dist/core/p-9caf19eb.js +0 -2
  493. package/dist/core/p-9caf19eb.js.map +0 -1
  494. package/dist/core/p-a0f8efb2.entry.js.map +0 -1
  495. package/dist/core/p-aac4185b.entry.js +0 -2
  496. package/dist/core/p-aac4185b.entry.js.map +0 -1
  497. package/dist/core/p-b2aa3d7c.entry.js +0 -2
  498. package/dist/core/p-b2aa3d7c.entry.js.map +0 -1
  499. package/dist/core/p-ba86928c.entry.js +0 -2
  500. package/dist/core/p-ba86928c.entry.js.map +0 -1
  501. package/dist/core/p-d8469ac0.entry.js +0 -2
  502. package/dist/core/p-d8469ac0.entry.js.map +0 -1
  503. package/dist/core/p-db9c03c0.entry.js +0 -2
  504. package/dist/core/p-f6888309.entry.js +0 -2
  505. package/dist/core/p-f6888309.entry.js.map +0 -1
  506. package/dist/core/p-f74a8752.entry.js +0 -2
  507. package/dist/core/p-f74a8752.entry.js.map +0 -1
  508. package/dist/core/p-fc5611e2.entry.js.map +0 -1
  509. package/dist/esm/helpers-12b4266a.js.map +0 -1
  510. package/dist/esm/helpers-1f07eb61.js.map +0 -1
  511. package/dist/esm/ic-data-table-title-bar.entry.js +0 -53
  512. package/dist/esm/ic-data-table-title-bar.entry.js.map +0 -1
  513. package/dist/esm/ic-empty-state_2.entry.js.map +0 -1
  514. package/dist/esm/ic-input-component-container_3.entry.js.map +0 -1
  515. package/dist/esm/ic-input-label_2.entry.js +0 -81
  516. package/dist/esm/ic-input-label_2.entry.js.map +0 -1
  517. package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.d.ts +0 -36
  518. /package/dist/core/{p-869954a2.entry.js.map → p-00bd7919.entry.js.map} +0 -0
  519. /package/dist/core/{p-a50c3b9e.entry.js.map → p-1a91e842.entry.js.map} +0 -0
  520. /package/dist/core/{p-f3c840cd.entry.js.map → p-41b682dc.entry.js.map} +0 -0
  521. /package/dist/core/{p-8b08d8fe.entry.js.map → p-6dce8e88.entry.js.map} +0 -0
  522. /package/dist/core/{p-1ca332ca.entry.js.map → p-6eb58b0a.entry.js.map} +0 -0
  523. /package/dist/core/{p-5ae93c16.entry.js.map → p-7fda2f94.entry.js.map} +0 -0
  524. /package/dist/core/{p-c34848da.entry.js.map → p-8b1f9648.entry.js.map} +0 -0
  525. /package/dist/core/{p-a434c3d4.entry.js.map → p-8b820365.entry.js.map} +0 -0
  526. /package/dist/core/{p-2eac7dcc.entry.js.map → p-946625a3.entry.js.map} +0 -0
  527. /package/dist/core/{p-7ef8d616.entry.js.map → p-9528b29e.entry.js.map} +0 -0
  528. /package/dist/core/{p-a43c12cd.entry.js.map → p-9567c117.entry.js.map} +0 -0
  529. /package/dist/core/{p-b82dcc29.entry.js.map → p-957de939.entry.js.map} +0 -0
  530. /package/dist/core/{p-045359e1.entry.js.map → p-99bf38e3.entry.js.map} +0 -0
  531. /package/dist/core/{p-81ddc39d.entry.js.map → p-9d8883d7.entry.js.map} +0 -0
  532. /package/dist/core/{p-e834344e.entry.js.map → p-a1556d97.entry.js.map} +0 -0
  533. /package/dist/core/{p-f843da01.entry.js.map → p-a2dc10d8.entry.js.map} +0 -0
  534. /package/dist/core/{p-ab09986c.entry.js.map → p-a8c15117.entry.js.map} +0 -0
  535. /package/dist/core/{p-f7a14c01.entry.js.map → p-c14a897d.entry.js.map} +0 -0
  536. /package/dist/core/{p-e3997d60.entry.js.map → p-d2d63a61.entry.js.map} +0 -0
  537. /package/dist/core/{p-4f413fc0.entry.js.map → p-db3a35fb.entry.js.map} +0 -0
  538. /package/dist/core/{p-204ace96.entry.js.map → p-e16f73ba.entry.js.map} +0 -0
  539. /package/dist/core/{p-f14454b1.entry.js.map → p-e8151d13.entry.js.map} +0 -0
  540. /package/dist/core/{p-a31031a5.entry.js.map → p-ff3a01f3.entry.js.map} +0 -0
  541. /package/dist/core/{p-75dac3d1.entry.js.map → p-ff6f1e3a.entry.js.map} +0 -0
  542. /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,1737 @@
1
+ import { h, Host, } from "@stencil/core";
2
+ import { IcInformationStatus, IcThemeForegroundEnum, IcDateInputMonths, IcDayNames, } from "../../utils/types";
3
+ import { convertToDoubleDigits, createDate, dateMatches, extractDateFromZuluDateTime, isDateOrEpoch, splitStringDate, } from "../../utils/date-helpers";
4
+ import { addFormResetListener, getInputDescribedByText, isEmptyString, isNumeric, onComponentRequiredPropUndefined, removeFormResetListener, renderHiddenInput, stringEnumToArray, } from "../../utils/helpers";
5
+ import Clear from "../../assets/clear-icon.svg";
6
+ import Calendar from "../../assets/calendar.svg";
7
+ let inputIds = 0;
8
+ export class DateInput {
9
+ constructor() {
10
+ this.ARIA_INVALID = "aria-invalid";
11
+ this.ARIA_LABEL = "aria-label";
12
+ this.ARIA_LABELLED_BY = "aria-labelledby";
13
+ this.EVENT_OBJECT_STRING = "[object Event]";
14
+ this.FIT_TO_VALUE = "fit-to-value";
15
+ this.initialValue = this.value;
16
+ this.INPUT_EVENT_OBJECT_STRING = "[object InputEvent]";
17
+ this.inputsInOrder = [];
18
+ this.isAfterMax = false;
19
+ this.isBeforeMin = false;
20
+ this.isDateSetFromKeyboardEvent = false;
21
+ this.isDisabledDate = false;
22
+ this.isValidDay = true;
23
+ this.isValidMonth = true;
24
+ this.isValidDate = true;
25
+ this.isZuluTime = false;
26
+ this.KEYBOARD_EVENT_OBJECT_STRING = "[object KeyboardEvent]";
27
+ this.MAX_DAY = 31;
28
+ this.MAX_MONTH = 12;
29
+ this.previousEmittedDate = undefined;
30
+ this.previousSelectedDate = null;
31
+ this.selectedDate = null;
32
+ this.setInputPasteValue = (input, pastedValue) => {
33
+ const inputEl = input;
34
+ inputEl.value = pastedValue;
35
+ inputEl.classList.add(this.FIT_TO_VALUE);
36
+ };
37
+ this.checkSingleCopiedValueIsValid = (input, pastedValue) => {
38
+ let isValid = false;
39
+ const value = Number(pastedValue);
40
+ switch (input) {
41
+ case this.dayInputEl:
42
+ isValid = value >= 1 && value <= this.MAX_DAY;
43
+ break;
44
+ case this.monthInputEl:
45
+ isValid = value >= 1 && value <= this.MAX_MONTH;
46
+ break;
47
+ case this.yearInputEl:
48
+ isValid = true;
49
+ break;
50
+ default:
51
+ isValid = false;
52
+ break;
53
+ }
54
+ return isValid;
55
+ };
56
+ /**
57
+ * Using Object.prototype.string to determine type if event from user
58
+ * @param event - event object used to differentiate keyboard, generic or input event
59
+ * @returns boolean
60
+ */
61
+ this.isKeyboardOrEvent = (event) => {
62
+ return (Object.prototype.toString.call(event) === this.EVENT_OBJECT_STRING ||
63
+ Object.prototype.toString.call(event) ===
64
+ this.KEYBOARD_EVENT_OBJECT_STRING);
65
+ };
66
+ this.setDateValidity = () => {
67
+ if (!isEmptyString(this.day)) {
68
+ this.isValidDay = +this.day > this.MAX_DAY ? false : true;
69
+ }
70
+ else {
71
+ this.isValidDay = true;
72
+ }
73
+ if (!isEmptyString(this.month)) {
74
+ this.isValidMonth = +this.month > this.MAX_MONTH ? false : true;
75
+ }
76
+ else {
77
+ this.isValidMonth = true;
78
+ }
79
+ };
80
+ this.handleInput = (event) => {
81
+ const inputEvent = event;
82
+ const input = event.target;
83
+ if (input !== this.yearInputEl) {
84
+ // Only auto-format if input event is not a character being deleted
85
+ // and not as user is changing value using up / down keys
86
+ if (inputEvent.inputType !== "deleteContentBackward" &&
87
+ !this.preventAutoFormatting) {
88
+ if (input.value.length === 1 &&
89
+ ((input === this.dayInputEl && +input.value >= 4) ||
90
+ (input === this.monthInputEl && +input.value >= 2)) &&
91
+ +input.value <= 9) {
92
+ this.setInputValue(input);
93
+ this.notifyScreenReader(input, event);
94
+ this.moveToNextInput(input);
95
+ }
96
+ if (input.value.length === 2) {
97
+ if (+input.value === 0) {
98
+ input.value = "01";
99
+ }
100
+ this.setInputValue(input);
101
+ this.setPreventInput(input, true);
102
+ this.notifyScreenReader(input, event);
103
+ this.moveToNextInput(input);
104
+ }
105
+ else {
106
+ this.setPreventInput(input, false);
107
+ }
108
+ }
109
+ else if (this.preventAutoFormatting) {
110
+ /**
111
+ * Using arrow keys prevents auto formatting so need to deal with
112
+ * switching from arrow keys to inputting numbers
113
+ **/
114
+ if (input.value.length === 2 && !this.isKeyboardOrEvent(event)) {
115
+ this.setInputValue(input);
116
+ this.setPreventInput(input, true);
117
+ this.moveToNextInput(input);
118
+ }
119
+ else {
120
+ this.setInputValue(input);
121
+ }
122
+ }
123
+ if (input.value.length !== 2) {
124
+ this.setPreventInput(input, false);
125
+ }
126
+ }
127
+ else {
128
+ if (input.value.length === 4) {
129
+ this.setInputValue(input);
130
+ if (Object.prototype.toString.call(event) !== this.EVENT_OBJECT_STRING) {
131
+ this.moveToNextInput(input);
132
+ }
133
+ this.setPreventInput(input, true);
134
+ }
135
+ else {
136
+ this.setInputValue(input, true);
137
+ this.setPreventInput(input, false);
138
+ }
139
+ }
140
+ // Add / remove class to make input width match size of value i.e. 2 digits' width for day / month, 4 for year
141
+ this.setFitToValueStyling(input);
142
+ if (input.value.length === 0) {
143
+ this.setInputValue(input, true);
144
+ this.setValidationMessage();
145
+ }
146
+ this.notifyScreenReader(input, event);
147
+ };
148
+ this.handleKeyDown = (event, isInputPrevented) => {
149
+ const input = event.target;
150
+ const eventKey = event.key.toLowerCase();
151
+ // Regex required due to FF allowing all characters as values for number text field.
152
+ const regex = /-?\d*\.?\d+(e[-+]?\d+)?|[/-]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;
153
+ if (!regex.test(eventKey) &&
154
+ !((event.ctrlKey || event.metaKey) &&
155
+ (eventKey === "v" || eventKey === "c"))) {
156
+ event.preventDefault();
157
+ }
158
+ switch (eventKey) {
159
+ case "/":
160
+ case "-":
161
+ case ".":
162
+ event.preventDefault();
163
+ this.setPasteInvalidText();
164
+ this.moveToNextInput(input);
165
+ break;
166
+ case "arrowright":
167
+ case "arrowleft":
168
+ event.preventDefault();
169
+ this.handleLeftRightArrowKeyPress(input, eventKey);
170
+ break;
171
+ case "arrowup":
172
+ case "arrowdown":
173
+ this.preventAutoFormatting = true;
174
+ this.handleUpDownArrowKeyPress(input, event);
175
+ break;
176
+ default:
177
+ break;
178
+ }
179
+ this.preventInput(event, isInputPrevented);
180
+ this.isDateSetFromKeyboardEvent = true;
181
+ };
182
+ this.handleFocus = (event) => {
183
+ // Highlight / select all characters in input for easy replacement
184
+ const input = event.target;
185
+ input.select();
186
+ };
187
+ this.handleBlur = (event) => {
188
+ const input = event.target;
189
+ this.setPasteInvalidText();
190
+ this.autocompleteInput(input);
191
+ };
192
+ this.handleLeftRightArrowKeyPress = (input, key) => {
193
+ if (key === "arrowright") {
194
+ this.moveToNextInput(input);
195
+ }
196
+ else {
197
+ this.moveToPreviousInput(input);
198
+ }
199
+ this.setPasteInvalidText();
200
+ };
201
+ this.notifyScreenReaderSelectedDate = () => {
202
+ const dayNames = stringEnumToArray(IcDayNames);
203
+ const months = stringEnumToArray(IcDateInputMonths);
204
+ this.selectedDateInfoEl.textContent = `Selected date: ${dayNames[this.selectedDate.getDay()]}, ${this.selectedDate.getDate()} ${months[this.selectedDate.getMonth()]} ${this.selectedDate.getFullYear()}`;
205
+ };
206
+ this.handleUpDownArrowKeyPress = (input, event) => {
207
+ const minValue = input === this.yearInputEl ? 0 : 1;
208
+ let maxValue;
209
+ switch (input) {
210
+ case this.dayInputEl:
211
+ maxValue = this.MAX_DAY;
212
+ break;
213
+ case this.monthInputEl:
214
+ maxValue = this.MAX_MONTH;
215
+ break;
216
+ case this.yearInputEl:
217
+ maxValue = 9999;
218
+ }
219
+ // Make value loop round when min / max reached
220
+ if (input === null || input === void 0 ? void 0 : input.value) {
221
+ if (event.key === "ArrowUp") {
222
+ if (+input.value === maxValue) {
223
+ event.preventDefault();
224
+ input.value = `0${minValue}`;
225
+ }
226
+ else {
227
+ input.value =
228
+ +input.value + 1 < 10
229
+ ? `0${+input.value + 1}`
230
+ : (+input.value + 1).toString();
231
+ }
232
+ this.notifyScreenReader(input, event);
233
+ }
234
+ if (event.key === "ArrowDown") {
235
+ if (+input.value === minValue) {
236
+ event.preventDefault();
237
+ input.value = maxValue.toString();
238
+ }
239
+ else {
240
+ input.value =
241
+ +input.value - 1 < 10
242
+ ? `0${+input.value - 1}`
243
+ : (+input.value - 1).toString();
244
+ }
245
+ this.notifyScreenReader(input, event);
246
+ }
247
+ }
248
+ else {
249
+ if (event.key === "ArrowDown") {
250
+ event.preventDefault();
251
+ if (input === this.yearInputEl) {
252
+ input.value = new Date().getFullYear().toString();
253
+ }
254
+ else {
255
+ input.value = maxValue.toString();
256
+ }
257
+ this.notifyScreenReader(input, event);
258
+ }
259
+ else if (event.key === "ArrowUp") {
260
+ event.preventDefault();
261
+ if (input === this.yearInputEl) {
262
+ input.value = new Date().getFullYear().toString();
263
+ }
264
+ else {
265
+ input.value = `0${minValue}`;
266
+ }
267
+ this.notifyScreenReader(input, event);
268
+ }
269
+ }
270
+ this.setInputValue(input);
271
+ this.setFitToValueStyling(input);
272
+ };
273
+ this.handleDateChange = (force) => {
274
+ // Prevent icChange being emitted when each individual input is changed
275
+ // This method is used within componentWillUpdate instead of using @Watch('value');
276
+ if (force || !dateMatches(this.selectedDate, this.previousSelectedDate)) {
277
+ if (this.value) {
278
+ this.inputsInOrder.forEach((input) => {
279
+ input.classList.add(this.FIT_TO_VALUE);
280
+ });
281
+ }
282
+ if (this.day && this.month && this.year && this.invalidDateText === "") {
283
+ this.setValueAndEmitChange(this.selectedDate);
284
+ this.notifyScreenReaderSelectedDate();
285
+ }
286
+ else if (!(this.selectedDate === null && this.previousSelectedDate === null)) {
287
+ this.setValueAndEmitChange(null);
288
+ this.selectedDateInfoEl.textContent = "";
289
+ }
290
+ this.previousSelectedDate = this.selectedDate;
291
+ if (!this.isDateSetFromKeyboardEvent) {
292
+ this.updateInputValues(this.day, this.month, this.year);
293
+ }
294
+ }
295
+ };
296
+ this.slicePastedDate = (valueLength, datePart) => {
297
+ return datePart.length > valueLength
298
+ ? datePart.slice(0, valueLength)
299
+ : datePart;
300
+ };
301
+ this.isPastedStringDateValid = (value) => {
302
+ if (/\d+-\d+-\d+$/.test(value) ||
303
+ /\d+\/\d+\/\d+/.test(value) ||
304
+ /\d+\.\d+\.\d+/.test(value)) {
305
+ return true;
306
+ }
307
+ if (/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\.\d+)?)?Z/.test(value)) {
308
+ this.isZuluTime = true;
309
+ return true;
310
+ }
311
+ return false;
312
+ };
313
+ // Set value of each input to value of pasted date part
314
+ // Allows formats separated by '-' or '/'
315
+ this.handlePaste = (event) => {
316
+ event.preventDefault();
317
+ const pastedValue = event.clipboardData.getData("Text");
318
+ const isValidDate = this.isPastedStringDateValid(pastedValue);
319
+ this.setPastedValueAndValidation(isValidDate, pastedValue, event);
320
+ };
321
+ this.setDate = (date) => {
322
+ if (date === null || date === "" || date === undefined) {
323
+ this.day = null;
324
+ this.month = null;
325
+ this.year = null;
326
+ this.inputsInOrder.forEach((input) => {
327
+ input.classList.remove(this.FIT_TO_VALUE);
328
+ this.setPreventInput(input, false);
329
+ });
330
+ this.handleDateChange(true);
331
+ }
332
+ else {
333
+ if (isDateOrEpoch(date)) {
334
+ let newDate;
335
+ if (typeof date === "string") {
336
+ // Checking if epoch date time
337
+ newDate = new Date(+date);
338
+ }
339
+ else {
340
+ newDate = date;
341
+ }
342
+ this.day = convertToDoubleDigits(newDate.getDate());
343
+ this.month = convertToDoubleDigits(newDate.getMonth() + 1);
344
+ this.year = newDate.getFullYear().toString();
345
+ }
346
+ else if (typeof date === "string") {
347
+ const defaultDateArray = splitStringDate(date, this.dateFormat);
348
+ this.year = defaultDateArray[0];
349
+ this.month = defaultDateArray[1];
350
+ this.day = defaultDateArray[2];
351
+ }
352
+ }
353
+ this.setValidationMessage();
354
+ };
355
+ this.formatMinMax = (date) => {
356
+ let formattedDate;
357
+ const day = convertToDoubleDigits(date.getDate());
358
+ const month = convertToDoubleDigits(date.getMonth() + 1);
359
+ const year = date.getFullYear();
360
+ switch (this.dateFormat) {
361
+ case "DD/MM/YYYY":
362
+ formattedDate = `${day}/${month}/${year}`;
363
+ break;
364
+ case "MM/DD/YYYY":
365
+ formattedDate = `${month}/${day}/${year}`;
366
+ break;
367
+ case "YYYY/MM/DD":
368
+ formattedDate = `${year}/${month}/${day}`;
369
+ break;
370
+ default:
371
+ break;
372
+ }
373
+ return formattedDate;
374
+ };
375
+ this.updateInputValues = (day, month, year) => {
376
+ this.dayInputEl.value = day;
377
+ this.monthInputEl.value = month;
378
+ this.yearInputEl.value = year;
379
+ };
380
+ // Set value in state based on input
381
+ this.setInputValue = (input, clear = false) => {
382
+ const newValue = clear ? "" : input.value;
383
+ switch (input) {
384
+ case this.dayInputEl:
385
+ this.day = newValue;
386
+ break;
387
+ case this.monthInputEl:
388
+ this.month = newValue;
389
+ break;
390
+ case this.yearInputEl:
391
+ if (this.year !== newValue) {
392
+ this.year = newValue;
393
+ }
394
+ }
395
+ this.setValidationMessage();
396
+ };
397
+ this.setValidationMessage = () => {
398
+ this.setDateValidity();
399
+ if (!isEmptyString(this.day) &&
400
+ !isEmptyString(this.month) &&
401
+ !isEmptyString(this.year)) {
402
+ // Check whether date actually exists
403
+ // (used https://www.hectane.com/blog/javascript-date-validation-with-leap-year)
404
+ this.selectedDate = this.convertToDate(this.year, this.month, this.day);
405
+ this.isValidDate =
406
+ +this.selectedDate !== 0 && this.selectedDate.getDate() == +this.day;
407
+ this.isDisabledDate = this.isSelectedDateDisabled();
408
+ if (!this.isValidDate || this.isDisabledDate) {
409
+ this.inputsInOrder.forEach((input) => input.setAttribute(this.ARIA_INVALID, "true"));
410
+ }
411
+ else {
412
+ this.inputsInOrder.forEach((input) => input.removeAttribute(this.ARIA_INVALID));
413
+ }
414
+ }
415
+ else {
416
+ this.selectedDate = null;
417
+ }
418
+ if (!(this.isValidDay && this.isValidMonth && this.isValidDate)) {
419
+ this.invalidDateText = "Please enter a valid date.";
420
+ }
421
+ else if (this.isDisabledDate && this.selectedDate !== null) {
422
+ if (this.isBeforeMin) {
423
+ if (this.disablePast) {
424
+ this.invalidDateText = this.disablePastMessage;
425
+ }
426
+ else {
427
+ this.invalidDateText = `Please enter a date after ${this.formatMinMax(this.minDate)}.`;
428
+ }
429
+ }
430
+ else if (this.isAfterMax) {
431
+ if (this.disableFuture) {
432
+ this.invalidDateText = this.disableFutureMessage;
433
+ }
434
+ else {
435
+ this.invalidDateText = `Please enter a date before ${this.formatMinMax(this.maxDate)}.`;
436
+ }
437
+ }
438
+ else if (this.disableDays.length !== 0) {
439
+ this.invalidDateText = this.disableDaysMessage;
440
+ }
441
+ else {
442
+ if (this.disablePast) {
443
+ this.invalidDateText = this.disablePastMessage;
444
+ }
445
+ if (this.disableFuture) {
446
+ this.invalidDateText = this.disableFutureMessage;
447
+ }
448
+ }
449
+ }
450
+ else {
451
+ this.invalidDateText = "";
452
+ }
453
+ };
454
+ // Set refs to the input elements in the order they are displayed (based on the dateFormat)
455
+ this.setInputsInOrder = () => {
456
+ const inputs = this.el.shadowRoot.querySelectorAll("input");
457
+ inputs.forEach((input) => this.inputsInOrder.push(input));
458
+ };
459
+ // Includes text usually added using aria-describedby
460
+ // (which doesn't work on input component container)
461
+ this.setAriaLabelledBy = () => {
462
+ var _a;
463
+ if (this.disabled &&
464
+ !isEmptyString((_a = this.inputCompContainerEl) === null || _a === void 0 ? void 0 : _a.getAttribute(this.ARIA_LABELLED_BY))) {
465
+ this.removeAriaLabelledBy();
466
+ return;
467
+ }
468
+ if (this.disabled) {
469
+ return;
470
+ }
471
+ const labelEl = this.el.shadowRoot.querySelector("label");
472
+ const labelId = `${this.inputId}-label`;
473
+ if (labelEl !== null && labelEl !== undefined) {
474
+ labelEl.id = labelId;
475
+ const hasValidation = (!isEmptyString(this.validationStatus) &&
476
+ !isEmptyString(this.validationText)) ||
477
+ !isEmptyString(this.invalidDateText);
478
+ const labelledBy = `${labelId} ${this.screenReaderInfoId} ${getInputDescribedByText(this.inputId, this.helperText !== "" && this.helperText !== this.defaultHelperText, hasValidation)} ${this.selectedDate ? this.selectedDateInfoId : ""} ${this.assistiveHintId}`;
479
+ this.inputCompContainerEl.setAttribute(this.ARIA_LABELLED_BY, labelledBy);
480
+ }
481
+ };
482
+ // Sets boolean for each input, used to limit the number of characters within each field (2 for day / month, 4 for year)
483
+ this.setPreventInput = (input, isPrevented) => {
484
+ switch (input) {
485
+ case this.dayInputEl:
486
+ this.preventDayInput = isPrevented;
487
+ break;
488
+ case this.monthInputEl:
489
+ this.preventMonthInput = isPrevented;
490
+ break;
491
+ case this.yearInputEl:
492
+ this.preventYearInput = isPrevented;
493
+ }
494
+ };
495
+ // Get input based on letter representing each date part ("D", "M" or "Y")
496
+ // (retrieved from dateFormat)
497
+ this.getInputFromDatePart = (datePart) => {
498
+ const dayInput = (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) }));
499
+ const monthInput = (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) }));
500
+ const yearInput = (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) }));
501
+ let input;
502
+ switch (datePart) {
503
+ case "D":
504
+ input = dayInput;
505
+ break;
506
+ case "M":
507
+ input = monthInput;
508
+ break;
509
+ case "Y":
510
+ input = yearInput;
511
+ }
512
+ return input;
513
+ };
514
+ // Get input elements in order of chosen date format
515
+ this.getInputsInOrder = () => {
516
+ const dateParts = this.dateFormat.split("/");
517
+ const inputsInOrder = [];
518
+ dateParts.forEach((part) => {
519
+ inputsInOrder.push(this.getInputFromDatePart(part.substring(0, 1)));
520
+ });
521
+ return inputsInOrder;
522
+ };
523
+ // To add to the end of assistive hint to make it clearer that each date part has its own input
524
+ // that can be changed individually
525
+ this.getDescOfInputsOrder = () => {
526
+ let description;
527
+ switch (this.dateFormat) {
528
+ case "DD/MM/YYYY":
529
+ description = "day, month, and year";
530
+ break;
531
+ case "MM/DD/YYYY":
532
+ description = "month, day, and year";
533
+ break;
534
+ case "YYYY/MM/DD":
535
+ description = "year, month, and day";
536
+ }
537
+ return description;
538
+ };
539
+ // Add 'required' or 'invalid data' to span used in aria-labelledby
540
+ // Many ARIA attributes aren't read out by screen reader when on the input component container
541
+ this.getScreenReaderInfo = (validationStatus) => {
542
+ let inputDescriptors = "";
543
+ if (this.required) {
544
+ inputDescriptors += "required";
545
+ }
546
+ if (validationStatus === IcInformationStatus.Error) {
547
+ inputDescriptors += " invalid data";
548
+ }
549
+ return inputDescriptors === "" ? "" : inputDescriptors + ", ";
550
+ };
551
+ // Prevent non-number characters being entered
552
+ // ('e' or '.' - which are usually allowed in <input type="number">)
553
+ // And limit the number of characters within each field (2 for day / month, 4 for year)
554
+ // (because 'maxlength' doesn't work on <input type="number">)
555
+ this.preventInput = (event, isInputPrevented) => {
556
+ const key = event.key;
557
+ const input = event.target;
558
+ let selectedString;
559
+ if (input) {
560
+ selectedString = input.value.substring(input.selectionStart, input.selectionEnd);
561
+ }
562
+ if (key === "e" ||
563
+ key === "." ||
564
+ key === "-" ||
565
+ (event.key >= "0" &&
566
+ event.key <= "9" &&
567
+ isInputPrevented &&
568
+ !selectedString)) {
569
+ event.preventDefault();
570
+ }
571
+ };
572
+ // Get whether date has been disabled using disableFuture or disablePast prop, but always allow current day
573
+ // Consider using dateClamp and inDateRange
574
+ this.isSelectedDateDisabled = () => {
575
+ const currentDate = new Date();
576
+ this.isAfterMax = false;
577
+ this.isBeforeMin = false;
578
+ let disabled = false;
579
+ const isNotToday = this.selectedDate.toDateString() !== currentDate.toDateString();
580
+ if (this.minDate && this.selectedDate < this.minDate && isNotToday) {
581
+ this.isBeforeMin = true;
582
+ disabled = true;
583
+ }
584
+ if (this.maxDate && this.selectedDate > this.maxDate && isNotToday) {
585
+ this.isAfterMax = true;
586
+ disabled = true;
587
+ }
588
+ if (this.disableDays.includes(this.selectedDate.getDay())) {
589
+ disabled = true;
590
+ }
591
+ if (((this.disablePast && this.selectedDate < currentDate) ||
592
+ (this.disableFuture && this.selectedDate > currentDate)) &&
593
+ isNotToday) {
594
+ disabled = true;
595
+ }
596
+ return disabled;
597
+ };
598
+ this.moveToNextInput = (currentInput) => {
599
+ const currentInputPos = this.inputsInOrder.findIndex((input) => input === currentInput);
600
+ const nextInput = this.inputsInOrder[currentInputPos + 1];
601
+ this.preventAutoFormatting = false;
602
+ if (nextInput) {
603
+ nextInput.focus();
604
+ }
605
+ };
606
+ this.moveToPreviousInput = (currentInput) => {
607
+ const currentInputPos = this.inputsInOrder.findIndex((input) => input === currentInput);
608
+ this.preventAutoFormatting = false;
609
+ if (this.inputsInOrder[currentInputPos - 1]) {
610
+ this.inputsInOrder[currentInputPos - 1].focus();
611
+ }
612
+ };
613
+ this.autocompleteInput = (input) => {
614
+ if (input === this.yearInputEl) {
615
+ this.autocompleteYear();
616
+ }
617
+ else {
618
+ const inputValue = input.value;
619
+ // Autocomplete input as 2 characters (leading zero) when only 1 character entered (for day and month)
620
+ if (inputValue.length === 1) {
621
+ if (+inputValue === 0) {
622
+ input.value = "01";
623
+ }
624
+ else {
625
+ input.value = `0${inputValue}`;
626
+ }
627
+ }
628
+ }
629
+ if (input.value) {
630
+ this.setInputValue(input);
631
+ }
632
+ };
633
+ // Autocomplete year as current millennium when fewer than 4 characters entered
634
+ this.autocompleteYear = () => {
635
+ const inputValue = this.yearInputEl.value;
636
+ const yearNumbers = ["2", "0", "0"];
637
+ let autocompletedInput = "";
638
+ if (inputValue) {
639
+ yearNumbers.forEach((number, index) => {
640
+ if (inputValue.length + index <= 3) {
641
+ autocompletedInput += number;
642
+ }
643
+ });
644
+ this.yearInputEl.value = `${autocompletedInput}${inputValue}`;
645
+ }
646
+ };
647
+ this.convertToDate = (year, month, day) => {
648
+ if (!isEmptyString(year) && !isEmptyString(month) && !isEmptyString(day)) {
649
+ return new Date(+year, +month - 1, +day);
650
+ }
651
+ else {
652
+ return null;
653
+ }
654
+ };
655
+ this.handleHostBlur = () => {
656
+ this.removeLabelledBy = false;
657
+ this.icBlur.emit({ value: this.selectedDate });
658
+ };
659
+ this.handleHostFocus = () => {
660
+ var _a;
661
+ if ((_a = this.el.shadowRoot.activeElement) === null || _a === void 0 ? void 0 : _a.id.match(/(day|month|year)-input$/)) {
662
+ this.removeLabelledBy = false;
663
+ }
664
+ else {
665
+ this.removeLabelledBy = true;
666
+ }
667
+ this.icFocus.emit({ value: this.selectedDate });
668
+ };
669
+ this.handleFormReset = () => {
670
+ // Get the initial value and populate day, month and year again.
671
+ this.setDate(this.initialValue);
672
+ this.setValidationMessage();
673
+ this.handleDateChange(false);
674
+ };
675
+ this.getAriaLabel = (input) => {
676
+ return input.getAttribute(this.ARIA_LABEL);
677
+ };
678
+ this.notifyScreenReaderArrowKeys = (input) => {
679
+ const liveRegion = this.el.shadowRoot.querySelector("#live-region");
680
+ let announcement = "";
681
+ const ariaLabel = this.getAriaLabel(input);
682
+ if (liveRegion && input.value) {
683
+ if (input === this.monthInputEl &&
684
+ !!IcDateInputMonths[+input.value - 1]) {
685
+ announcement = `${input.value} - ${IcDateInputMonths[+input.value - 1]}, ${ariaLabel}`;
686
+ }
687
+ if (input === this.dayInputEl || input === this.yearInputEl) {
688
+ announcement = `${input.value}, ${ariaLabel}`;
689
+ }
690
+ liveRegion.textContent = announcement;
691
+ }
692
+ };
693
+ this.notifyScreenReaderInput = (input, liveRegion) => {
694
+ let announcement = "";
695
+ const ariaLabel = this.getAriaLabel(input);
696
+ if (input === this.dayInputEl || input === this.monthInputEl) {
697
+ if (input.value.length === 2) {
698
+ if (input === this.monthInputEl &&
699
+ !!IcDateInputMonths[+input.value - 1] &&
700
+ this.isValidMonth) {
701
+ announcement = `${input.value} - ${IcDateInputMonths[+input.value - 1]}, ${ariaLabel}`;
702
+ }
703
+ if (input === this.dayInputEl && this.isValidDay) {
704
+ announcement = `${input.value}, ${ariaLabel}`;
705
+ }
706
+ }
707
+ else {
708
+ announcement = "";
709
+ }
710
+ }
711
+ else {
712
+ if (input.value.length === 4) {
713
+ announcement = `${input.value}, ${ariaLabel}`;
714
+ }
715
+ else {
716
+ announcement = "";
717
+ }
718
+ }
719
+ liveRegion.textContent = announcement;
720
+ };
721
+ this.setFitToValueStyling = (input) => {
722
+ if (input.value) {
723
+ input.classList.add(this.FIT_TO_VALUE);
724
+ }
725
+ else {
726
+ input.classList.remove(this.FIT_TO_VALUE);
727
+ }
728
+ };
729
+ this.setAriaInvalid = (validDay, validMonth, validDate, disabledDate) => {
730
+ if (this.inputsInOrder.length) {
731
+ this.inputsInOrder.forEach((input) => {
732
+ input.removeAttribute(this.ARIA_INVALID);
733
+ });
734
+ if (!validDay) {
735
+ this.dayInputEl.setAttribute(this.ARIA_INVALID, "true");
736
+ }
737
+ if (!validMonth) {
738
+ this.monthInputEl.setAttribute(this.ARIA_INVALID, "true");
739
+ }
740
+ if (!validDate || disabledDate) {
741
+ this.inputsInOrder.forEach((input) => {
742
+ input.setAttribute(this.ARIA_INVALID, "true");
743
+ });
744
+ }
745
+ }
746
+ };
747
+ this.handleClear = () => {
748
+ this.inputsInOrder.forEach((input) => {
749
+ input.classList.remove(this.FIT_TO_VALUE);
750
+ this.setInputValue(input, true);
751
+ this.setPreventInput(input, false);
752
+ });
753
+ this.isDateSetFromKeyboardEvent = false;
754
+ this.setValidationMessage();
755
+ this.handleDateChange(true);
756
+ this.inputsInOrder[0].focus();
757
+ };
758
+ this.handleCalendarOpen = (ev) => {
759
+ var _a, _b;
760
+ ev.stopImmediatePropagation();
761
+ (_a = this.calendarButtonEl) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);
762
+ this.calendarButtonClicked.emit({ value: this.selectedDate });
763
+ (_b = this.calendarButtonEl) === null || _b === void 0 ? void 0 : _b.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);
764
+ this.isDateSetFromKeyboardEvent = false;
765
+ };
766
+ this.setValueAndEmitChange = (value) => {
767
+ if (!dateMatches(new Date(this.value), value)) {
768
+ this.emitIcChange(value);
769
+ this.value = value;
770
+ }
771
+ };
772
+ this.handleCalendarFocus = () => {
773
+ this.calendarFocused = true;
774
+ };
775
+ this.handleCalendarBlur = () => {
776
+ this.calendarFocused = false;
777
+ };
778
+ this.handleClearFocus = () => {
779
+ this.removeLabelledBy = true;
780
+ this.clearButtonFocused = true;
781
+ };
782
+ this.handleClearBlur = (ev) => {
783
+ var _a;
784
+ this.clearButtonFocused = false;
785
+ if ((_a = ev.relatedTarget) === null || _a === void 0 ? void 0 : _a.id.match(/(day|year)-input$/)) {
786
+ this.removeLabelledBy = false;
787
+ return;
788
+ }
789
+ this.removeLabelledBy = true;
790
+ };
791
+ this.emitIcChange = (d) => {
792
+ if (!(d === null && this.previousEmittedDate === null) &&
793
+ !dateMatches(d, this.previousEmittedDate)) {
794
+ this.previousEmittedDate = d;
795
+ this.icChange.emit({ value: d });
796
+ }
797
+ };
798
+ this.day = "";
799
+ this.invalidDateText = undefined;
800
+ this.maxDate = undefined;
801
+ this.minDate = undefined;
802
+ this.month = "";
803
+ this.year = "";
804
+ this.calendarFocused = false;
805
+ this.clearButtonFocused = false;
806
+ this.removeLabelledBy = false;
807
+ this.dateFormat = "DD/MM/YYYY";
808
+ this.disabled = false;
809
+ this.disableDays = [];
810
+ this.disableDaysMessage = "The date you have selected is on a day of the week that is not allowed. Please select another date.";
811
+ this.disableFuture = false;
812
+ this.disableFutureMessage = "Dates in the future are not allowed. Please select a date in the past.";
813
+ this.disablePast = false;
814
+ this.disablePastMessage = "Dates in the past are not allowed. Please select a date in the future.";
815
+ this.helperText = undefined;
816
+ this.inputId = `ic-date-input-${inputIds++}`;
817
+ this.label = undefined;
818
+ this.max = "";
819
+ this.min = "";
820
+ this.name = this.inputId;
821
+ this.required = false;
822
+ this.showCalendarButton = false;
823
+ this.showClearButton = true;
824
+ this.size = "default";
825
+ this.value = "";
826
+ this.validationStatus = "";
827
+ this.validationText = "";
828
+ }
829
+ watchDisableFutureHandler() {
830
+ this.watchMaxHandler();
831
+ }
832
+ watchDisablePastHandler() {
833
+ this.watchMinHandler();
834
+ }
835
+ watchMaxHandler() {
836
+ if (this.disableFuture) {
837
+ this.maxDate = new Date();
838
+ }
839
+ else {
840
+ this.maxDate = createDate(this.max, this.dateFormat);
841
+ }
842
+ }
843
+ watchMinHandler() {
844
+ if (this.disablePast) {
845
+ this.minDate = new Date();
846
+ }
847
+ else {
848
+ this.minDate = createDate(this.min, this.dateFormat);
849
+ }
850
+ }
851
+ watchRequiredHandler() {
852
+ // Prevent asterisk being read out after the label by screen reader (by applying aria-hidden)
853
+ // Needed because label is included in 'aria-labelledby' instead of using 'aria-label'
854
+ const labelEl = this.el.shadowRoot.querySelector("label");
855
+ if (this.required) {
856
+ const asteriskSpan = document.createElement("span");
857
+ asteriskSpan.setAttribute("id", "asterisk-span");
858
+ asteriskSpan.setAttribute("aria-hidden", "true");
859
+ asteriskSpan.textContent = " *";
860
+ labelEl === null || labelEl === void 0 ? void 0 : labelEl.appendChild(asteriskSpan);
861
+ }
862
+ else {
863
+ const asteriskSpan = this.el.shadowRoot.querySelector("#asterisk-span");
864
+ if (asteriskSpan) {
865
+ asteriskSpan.remove();
866
+ }
867
+ }
868
+ }
869
+ disconnectedCallback() {
870
+ removeFormResetListener(this.el, this.handleFormReset);
871
+ }
872
+ componentWillLoad() {
873
+ this.defaultHelperText = `Use format ${this.dateFormat}`;
874
+ if (isEmptyString(this.helperText))
875
+ this.helperText = this.defaultHelperText;
876
+ this.watchMinHandler();
877
+ this.watchMaxHandler();
878
+ if (this.value) {
879
+ this.setDate(this.value);
880
+ this.previousEmittedDate = this.selectedDate;
881
+ }
882
+ else {
883
+ this.previousEmittedDate = null;
884
+ }
885
+ this.screenReaderInfoId = `${this.inputId}-screen-reader-info`;
886
+ this.assistiveHintId = `${this.inputId}-assistive-hint`;
887
+ this.selectedDateInfoId = `${this.inputId}-selected-date-info`;
888
+ addFormResetListener(this.el, this.handleFormReset);
889
+ }
890
+ componentDidLoad() {
891
+ this.setInputsInOrder();
892
+ onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Date Input");
893
+ if (this.value) {
894
+ this.updateInputValues(this.day, this.month, this.year);
895
+ this.inputsInOrder.forEach((input) => {
896
+ input.classList.add(this.FIT_TO_VALUE);
897
+ });
898
+ }
899
+ this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
900
+ if (this.value) {
901
+ this.notifyScreenReaderSelectedDate();
902
+ }
903
+ this.inputsInOrder.forEach((input) => {
904
+ input.addEventListener("input", this.handleInput);
905
+ input.addEventListener("focus", this.handleFocus);
906
+ input.addEventListener("blur", this.handleBlur);
907
+ });
908
+ this.watchRequiredHandler();
909
+ }
910
+ componentWillUpdate() {
911
+ if (isEmptyString(this.helperText))
912
+ this.helperText = this.defaultHelperText;
913
+ if (!this.isDateSetFromKeyboardEvent)
914
+ this.setDate(this.value);
915
+ this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
916
+ this.handleDateChange(false);
917
+ this.isDateSetFromKeyboardEvent = false;
918
+ }
919
+ componentDidRender() {
920
+ if (this.removeLabelledBy) {
921
+ this.removeAriaLabelledBy();
922
+ return;
923
+ }
924
+ this.setAriaLabelledBy();
925
+ }
926
+ /**
927
+ * Returns the value as a Date object
928
+ * @returns Date
929
+ */
930
+ async getDate() {
931
+ return this.selectedDate;
932
+ }
933
+ /**
934
+ * @internal Sets focus on the calendar button.
935
+ */
936
+ async setCalendarFocus() {
937
+ if (this.calendarButtonEl) {
938
+ this.calendarButtonEl.focus();
939
+ }
940
+ }
941
+ /**
942
+ * @internal Used to pass disabledDays from parent component.
943
+ */
944
+ async setDisableDays(days) {
945
+ this.disableDays = days;
946
+ }
947
+ /**
948
+ * @internal Used to enable other components to invoke an IcChange event from the input.
949
+ */
950
+ async triggerIcChange(d) {
951
+ this.emitIcChange(d);
952
+ }
953
+ removeAriaLabelledBy() {
954
+ this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY);
955
+ }
956
+ setPastedValueAndValidation(isValidDate, pastedValue, event) {
957
+ switch (true) {
958
+ case isValidDate: {
959
+ const nextParsedValue = this.isZuluTime
960
+ ? extractDateFromZuluDateTime(pastedValue)
961
+ : pastedValue;
962
+ const dateParts = nextParsedValue.split(/-|\/|\./);
963
+ this.inputsInOrder.forEach((input, index) => {
964
+ input.classList.add(this.FIT_TO_VALUE);
965
+ if (this.isZuluTime) {
966
+ this.pasteZuluDateTime(dateParts, index);
967
+ }
968
+ else {
969
+ let dateValue;
970
+ if (input === this.dayInputEl || input === this.monthInputEl) {
971
+ dateValue = this.slicePastedDate(2, dateParts[index]);
972
+ }
973
+ else {
974
+ dateValue = this.slicePastedDate(4, dateParts[index]);
975
+ }
976
+ input.value = dateValue;
977
+ this.setInputValue(input);
978
+ this.autocompleteInput(input);
979
+ }
980
+ });
981
+ this.isZuluTime = false;
982
+ break;
983
+ }
984
+ case (pastedValue.length === 1 ||
985
+ pastedValue.length === 2 ||
986
+ pastedValue.length === 4) &&
987
+ isNumeric(pastedValue):
988
+ if (this.checkSingleCopiedValueIsValid(event.target, pastedValue)) {
989
+ // Check if copied value can be pasted into input
990
+ this.setInputPasteValue(event.target, pastedValue);
991
+ this.setInputValue(event.target);
992
+ }
993
+ else {
994
+ this.displayPastedValidation(event);
995
+ }
996
+ break;
997
+ case pastedValue.length === 3 && isNumeric(pastedValue):
998
+ if (event.target !== this.yearInputEl) {
999
+ this.displayPastedValidation(event);
1000
+ }
1001
+ else {
1002
+ this.setInputPasteValue(event.target, pastedValue);
1003
+ this.setInputValue(event.target);
1004
+ }
1005
+ break;
1006
+ case pastedValue.length >= 5 && isNumeric(pastedValue):
1007
+ this.displayPastedValidation(event);
1008
+ }
1009
+ }
1010
+ pasteZuluDateTime(dateParts, index) {
1011
+ // ['YYYY', 'MM', 'DD']
1012
+ if (index === 0) {
1013
+ const dateValue = this.slicePastedDate(4, dateParts[index]);
1014
+ this.yearInputEl.value = dateValue;
1015
+ this.setInputValue(this.yearInputEl);
1016
+ }
1017
+ else if (index === 1) {
1018
+ // The month value is the second item in the array
1019
+ const dateValue = this.slicePastedDate(2, dateParts[index]);
1020
+ this.monthInputEl.value = dateValue;
1021
+ this.setInputValue(this.monthInputEl);
1022
+ }
1023
+ else {
1024
+ const dateValue = this.slicePastedDate(2, dateParts[index]);
1025
+ this.dayInputEl.value = dateValue;
1026
+ this.setInputValue(this.dayInputEl);
1027
+ }
1028
+ }
1029
+ displayPastedValidation(event) {
1030
+ var _a;
1031
+ if (((_a = this.invalidDateText) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1032
+ this.previousInvalidDateTest = this.invalidDateText;
1033
+ }
1034
+ this.invalidDateText = `Please paste a valid ${this.getAriaLabel(event.target)}`;
1035
+ this.validationStatus = IcInformationStatus.Error;
1036
+ this.isPasteValidationDisplayed = true;
1037
+ }
1038
+ setPasteInvalidText() {
1039
+ var _a;
1040
+ if (this.isPasteValidationDisplayed) {
1041
+ this.invalidDateText = (_a = this.previousInvalidDateTest) !== null && _a !== void 0 ? _a : "";
1042
+ this.isPasteValidationDisplayed = false;
1043
+ // This is to prevent setDate from triggering within componentWillUpdate
1044
+ this.isDateSetFromKeyboardEvent = true;
1045
+ }
1046
+ }
1047
+ notifyScreenReader(input, event) {
1048
+ const liveRegion = this.el.shadowRoot.querySelector("#live-region");
1049
+ if (liveRegion) {
1050
+ if (this.isKeyboardOrEvent(event)) {
1051
+ this.notifyScreenReaderArrowKeys(input);
1052
+ }
1053
+ else if (Object.prototype.toString.call(event) === this.INPUT_EVENT_OBJECT_STRING) {
1054
+ this.notifyScreenReaderInput(input, liveRegion);
1055
+ }
1056
+ }
1057
+ }
1058
+ render() {
1059
+ const { inputId, label, disabled, helperText, showClearButton, showCalendarButton, size, } = this;
1060
+ const hasCustomValidation = !isEmptyString(this.validationStatus) &&
1061
+ !isEmptyString(this.validationText);
1062
+ const validationStatus = hasCustomValidation
1063
+ ? this.validationStatus
1064
+ : !isEmptyString(this.invalidDateText)
1065
+ ? IcInformationStatus.Error
1066
+ : "";
1067
+ const assistiveHint = `Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;
1068
+ renderHiddenInput(true, this.el, this.name, this.convertToDate(this.year, this.month, this.day), this.disabled);
1069
+ return (h(Host, { onBlur: this.handleHostBlur, onFocus: this.handleHostFocus }, h("ic-input-container", { disabled: disabled }, h("ic-input-label", { for: inputId, label: label, helperText: helperText, disabled: disabled }), h("span", { id: this.screenReaderInfoId, class: "sr-only", "aria-hidden": "true" }, this.getScreenReaderInfo(validationStatus), `${this.defaultHelperText}.`), h("span", { id: this.assistiveHintId, class: "sr-only", "aria-hidden": "true" }, assistiveHint), h("span", { id: "live-region", "aria-live": "assertive", class: "sr-only" }), h("ic-input-component-container", { id: inputId, ref: (el) => (this.inputCompContainerEl = el), disabled: disabled, validationStatus: validationStatus, size: size, role: "group" }, h("div", { class: "input-container" }, h("div", { class: "date-inputs" }, this.getInputsInOrder()[0], "/", this.getInputsInOrder()[1], "/", this.getInputsInOrder()[2]), h("div", { class: "action-buttons" }, showClearButton && (h("ic-button", { id: "clear-button", "aria-label": "Clear input", class: {
1070
+ ["clear-button"]: true,
1071
+ ["hidden"]: isEmptyString(this.day) &&
1072
+ isEmptyString(this.month) &&
1073
+ isEmptyString(this.year),
1074
+ }, disabled: this.disabled, innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearFocus, onBlur: this.handleClearBlur, variant: "icon", appearance: this.clearButtonFocused
1075
+ ? IcThemeForegroundEnum.Light
1076
+ : IcThemeForegroundEnum.Dark, size: size })), showCalendarButton && (h("div", { class: "show-calendar-button-wrapper" }, h("div", { class: { divider: true, [size]: true } }), 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
1077
+ ? IcThemeForegroundEnum.Light
1078
+ : IcThemeForegroundEnum.Default })))))), h("span", { id: this.selectedDateInfoId, class: "sr-only", "aria-live": "polite" }, h("span", { ref: (el) => (this.selectedDateInfoEl = el), role: "status" })), (hasCustomValidation || !isEmptyString(this.invalidDateText)) && (h("ic-input-validation", { status: validationStatus, message: hasCustomValidation ? this.validationText : this.invalidDateText, for: inputId })))));
1079
+ }
1080
+ static get is() { return "ic-date-input"; }
1081
+ static get encapsulation() { return "shadow"; }
1082
+ static get delegatesFocus() { return true; }
1083
+ static get originalStyleUrls() {
1084
+ return {
1085
+ "$": ["ic-date-input.css"]
1086
+ };
1087
+ }
1088
+ static get styleUrls() {
1089
+ return {
1090
+ "$": ["ic-date-input.css"]
1091
+ };
1092
+ }
1093
+ static get properties() {
1094
+ return {
1095
+ "dateFormat": {
1096
+ "type": "string",
1097
+ "mutable": false,
1098
+ "complexType": {
1099
+ "original": "IcDateFormat",
1100
+ "resolved": "\"DD/MM/YYYY\" | \"MM/DD/YYYY\" | \"YYYY/MM/DD\"",
1101
+ "references": {
1102
+ "IcDateFormat": {
1103
+ "location": "import",
1104
+ "path": "../../utils/types",
1105
+ "id": "src/utils/types.ts::IcDateFormat"
1106
+ }
1107
+ }
1108
+ },
1109
+ "required": false,
1110
+ "optional": true,
1111
+ "docs": {
1112
+ "tags": [],
1113
+ "text": "The format in which the date will be displayed."
1114
+ },
1115
+ "attribute": "date-format",
1116
+ "reflect": false,
1117
+ "defaultValue": "\"DD/MM/YYYY\""
1118
+ },
1119
+ "disabled": {
1120
+ "type": "boolean",
1121
+ "mutable": false,
1122
+ "complexType": {
1123
+ "original": "boolean",
1124
+ "resolved": "boolean",
1125
+ "references": {}
1126
+ },
1127
+ "required": false,
1128
+ "optional": true,
1129
+ "docs": {
1130
+ "tags": [],
1131
+ "text": "If `true`, the disabled state will be set."
1132
+ },
1133
+ "attribute": "disabled",
1134
+ "reflect": false,
1135
+ "defaultValue": "false"
1136
+ },
1137
+ "disableDays": {
1138
+ "type": "unknown",
1139
+ "mutable": true,
1140
+ "complexType": {
1141
+ "original": "IcWeekDays[]",
1142
+ "resolved": "IcWeekDays[]",
1143
+ "references": {
1144
+ "IcWeekDays": {
1145
+ "location": "import",
1146
+ "path": "../../utils/types",
1147
+ "id": "src/utils/types.ts::IcWeekDays"
1148
+ }
1149
+ }
1150
+ },
1151
+ "required": false,
1152
+ "optional": true,
1153
+ "docs": {
1154
+ "tags": [],
1155
+ "text": "The days of the week to disable."
1156
+ },
1157
+ "defaultValue": "[]"
1158
+ },
1159
+ "disableDaysMessage": {
1160
+ "type": "string",
1161
+ "mutable": false,
1162
+ "complexType": {
1163
+ "original": "string",
1164
+ "resolved": "string",
1165
+ "references": {}
1166
+ },
1167
+ "required": false,
1168
+ "optional": true,
1169
+ "docs": {
1170
+ "tags": [],
1171
+ "text": "The text to display as the validation message when `disableDays` is set and a disabled date is entered."
1172
+ },
1173
+ "attribute": "disable-days-message",
1174
+ "reflect": false,
1175
+ "defaultValue": "\"The date you have selected is on a day of the week that is not allowed. Please select another date.\""
1176
+ },
1177
+ "disableFuture": {
1178
+ "type": "boolean",
1179
+ "mutable": false,
1180
+ "complexType": {
1181
+ "original": "boolean",
1182
+ "resolved": "boolean",
1183
+ "references": {}
1184
+ },
1185
+ "required": false,
1186
+ "optional": true,
1187
+ "docs": {
1188
+ "tags": [],
1189
+ "text": "If `true`, dates in the future are not allowed. A validation message will appear if a date in the future is entered."
1190
+ },
1191
+ "attribute": "disable-future",
1192
+ "reflect": false,
1193
+ "defaultValue": "false"
1194
+ },
1195
+ "disableFutureMessage": {
1196
+ "type": "string",
1197
+ "mutable": false,
1198
+ "complexType": {
1199
+ "original": "string",
1200
+ "resolved": "string",
1201
+ "references": {}
1202
+ },
1203
+ "required": false,
1204
+ "optional": true,
1205
+ "docs": {
1206
+ "tags": [],
1207
+ "text": "The text to display as the validation message when `disableFuture` is true and a date in the future is entered."
1208
+ },
1209
+ "attribute": "disable-future-message",
1210
+ "reflect": false,
1211
+ "defaultValue": "\"Dates in the future are not allowed. Please select a date in the past.\""
1212
+ },
1213
+ "disablePast": {
1214
+ "type": "boolean",
1215
+ "mutable": false,
1216
+ "complexType": {
1217
+ "original": "boolean",
1218
+ "resolved": "boolean",
1219
+ "references": {}
1220
+ },
1221
+ "required": false,
1222
+ "optional": true,
1223
+ "docs": {
1224
+ "tags": [],
1225
+ "text": "If `true`, dates in the past are not allowed. A validation message will appear if a date in the past is entered."
1226
+ },
1227
+ "attribute": "disable-past",
1228
+ "reflect": false,
1229
+ "defaultValue": "false"
1230
+ },
1231
+ "disablePastMessage": {
1232
+ "type": "string",
1233
+ "mutable": false,
1234
+ "complexType": {
1235
+ "original": "string",
1236
+ "resolved": "string",
1237
+ "references": {}
1238
+ },
1239
+ "required": false,
1240
+ "optional": true,
1241
+ "docs": {
1242
+ "tags": [],
1243
+ "text": "The text to display as the validation message when `disablePast` is true and a date in the past is entered."
1244
+ },
1245
+ "attribute": "disable-past-message",
1246
+ "reflect": false,
1247
+ "defaultValue": "\"Dates in the past are not allowed. Please select a date in the future.\""
1248
+ },
1249
+ "helperText": {
1250
+ "type": "string",
1251
+ "mutable": true,
1252
+ "complexType": {
1253
+ "original": "string",
1254
+ "resolved": "string",
1255
+ "references": {}
1256
+ },
1257
+ "required": false,
1258
+ "optional": true,
1259
+ "docs": {
1260
+ "tags": [],
1261
+ "text": "The helper text that will be displayed for additional field guidance. This will default to the text \"Use format\" along with the `dateFormat` value."
1262
+ },
1263
+ "attribute": "helper-text",
1264
+ "reflect": false
1265
+ },
1266
+ "inputId": {
1267
+ "type": "string",
1268
+ "mutable": false,
1269
+ "complexType": {
1270
+ "original": "string",
1271
+ "resolved": "string",
1272
+ "references": {}
1273
+ },
1274
+ "required": false,
1275
+ "optional": true,
1276
+ "docs": {
1277
+ "tags": [],
1278
+ "text": "The ID for the input."
1279
+ },
1280
+ "attribute": "input-id",
1281
+ "reflect": false,
1282
+ "defaultValue": "`ic-date-input-${inputIds++}`"
1283
+ },
1284
+ "label": {
1285
+ "type": "string",
1286
+ "mutable": false,
1287
+ "complexType": {
1288
+ "original": "string",
1289
+ "resolved": "string",
1290
+ "references": {}
1291
+ },
1292
+ "required": true,
1293
+ "optional": false,
1294
+ "docs": {
1295
+ "tags": [],
1296
+ "text": "The label for the date input."
1297
+ },
1298
+ "attribute": "label",
1299
+ "reflect": false
1300
+ },
1301
+ "max": {
1302
+ "type": "string",
1303
+ "mutable": false,
1304
+ "complexType": {
1305
+ "original": "string | Date",
1306
+ "resolved": "Date | string",
1307
+ "references": {
1308
+ "Date": {
1309
+ "location": "global",
1310
+ "id": "global::Date"
1311
+ }
1312
+ }
1313
+ },
1314
+ "required": false,
1315
+ "optional": true,
1316
+ "docs": {
1317
+ "tags": [],
1318
+ "text": "The latest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\nThe value of this prop is ignored if `disableFuture` is set to `true`."
1319
+ },
1320
+ "attribute": "max",
1321
+ "reflect": false,
1322
+ "defaultValue": "\"\""
1323
+ },
1324
+ "min": {
1325
+ "type": "string",
1326
+ "mutable": false,
1327
+ "complexType": {
1328
+ "original": "string | Date",
1329
+ "resolved": "Date | string",
1330
+ "references": {
1331
+ "Date": {
1332
+ "location": "global",
1333
+ "id": "global::Date"
1334
+ }
1335
+ }
1336
+ },
1337
+ "required": false,
1338
+ "optional": true,
1339
+ "docs": {
1340
+ "tags": [],
1341
+ "text": "The earliest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\nThe value of this prop is ignored if `disablePast` is set to `true`."
1342
+ },
1343
+ "attribute": "min",
1344
+ "reflect": false,
1345
+ "defaultValue": "\"\""
1346
+ },
1347
+ "name": {
1348
+ "type": "string",
1349
+ "mutable": false,
1350
+ "complexType": {
1351
+ "original": "string",
1352
+ "resolved": "string",
1353
+ "references": {}
1354
+ },
1355
+ "required": false,
1356
+ "optional": false,
1357
+ "docs": {
1358
+ "tags": [],
1359
+ "text": "The name of the control, which is submitted with the form data."
1360
+ },
1361
+ "attribute": "name",
1362
+ "reflect": false,
1363
+ "defaultValue": "this.inputId"
1364
+ },
1365
+ "required": {
1366
+ "type": "boolean",
1367
+ "mutable": false,
1368
+ "complexType": {
1369
+ "original": "boolean",
1370
+ "resolved": "boolean",
1371
+ "references": {}
1372
+ },
1373
+ "required": false,
1374
+ "optional": true,
1375
+ "docs": {
1376
+ "tags": [],
1377
+ "text": "If `true`, the input will require a value."
1378
+ },
1379
+ "attribute": "required",
1380
+ "reflect": false,
1381
+ "defaultValue": "false"
1382
+ },
1383
+ "showCalendarButton": {
1384
+ "type": "boolean",
1385
+ "mutable": false,
1386
+ "complexType": {
1387
+ "original": "boolean",
1388
+ "resolved": "boolean",
1389
+ "references": {}
1390
+ },
1391
+ "required": false,
1392
+ "optional": true,
1393
+ "docs": {
1394
+ "tags": [{
1395
+ "name": "internal",
1396
+ "text": "If `true`, a button which displays the calendar view when clicked will be displayed."
1397
+ }],
1398
+ "text": ""
1399
+ },
1400
+ "attribute": "show-calendar-button",
1401
+ "reflect": false,
1402
+ "defaultValue": "false"
1403
+ },
1404
+ "showClearButton": {
1405
+ "type": "boolean",
1406
+ "mutable": false,
1407
+ "complexType": {
1408
+ "original": "boolean",
1409
+ "resolved": "boolean",
1410
+ "references": {}
1411
+ },
1412
+ "required": false,
1413
+ "optional": true,
1414
+ "docs": {
1415
+ "tags": [],
1416
+ "text": "If `true`, a button which clears the date input when clicked will be displayed."
1417
+ },
1418
+ "attribute": "show-clear-button",
1419
+ "reflect": false,
1420
+ "defaultValue": "true"
1421
+ },
1422
+ "size": {
1423
+ "type": "string",
1424
+ "mutable": false,
1425
+ "complexType": {
1426
+ "original": "IcSizes",
1427
+ "resolved": "\"default\" | \"large\" | \"small\"",
1428
+ "references": {
1429
+ "IcSizes": {
1430
+ "location": "import",
1431
+ "path": "../../utils/types",
1432
+ "id": "src/utils/types.ts::IcSizes"
1433
+ }
1434
+ }
1435
+ },
1436
+ "required": false,
1437
+ "optional": true,
1438
+ "docs": {
1439
+ "tags": [],
1440
+ "text": "The size of the date input to be displayed."
1441
+ },
1442
+ "attribute": "size",
1443
+ "reflect": false,
1444
+ "defaultValue": "\"default\""
1445
+ },
1446
+ "value": {
1447
+ "type": "string",
1448
+ "mutable": true,
1449
+ "complexType": {
1450
+ "original": "string | Date | null | undefined",
1451
+ "resolved": "Date | string",
1452
+ "references": {
1453
+ "Date": {
1454
+ "location": "global",
1455
+ "id": "global::Date"
1456
+ }
1457
+ }
1458
+ },
1459
+ "required": false,
1460
+ "optional": true,
1461
+ "docs": {
1462
+ "tags": [],
1463
+ "text": "The value of the date input. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object."
1464
+ },
1465
+ "attribute": "value",
1466
+ "reflect": false,
1467
+ "defaultValue": "\"\""
1468
+ },
1469
+ "validationStatus": {
1470
+ "type": "string",
1471
+ "mutable": true,
1472
+ "complexType": {
1473
+ "original": "IcInformationStatusOrEmpty",
1474
+ "resolved": "\"\" | \"error\" | \"success\" | \"warning\"",
1475
+ "references": {
1476
+ "IcInformationStatusOrEmpty": {
1477
+ "location": "import",
1478
+ "path": "../../utils/types",
1479
+ "id": "src/utils/types.ts::IcInformationStatusOrEmpty"
1480
+ }
1481
+ }
1482
+ },
1483
+ "required": false,
1484
+ "optional": true,
1485
+ "docs": {
1486
+ "tags": [],
1487
+ "text": "The validation status - e.g. 'error' | 'warning' | 'success'. This will override the built-in date validation."
1488
+ },
1489
+ "attribute": "validation-status",
1490
+ "reflect": false,
1491
+ "defaultValue": "\"\""
1492
+ },
1493
+ "validationText": {
1494
+ "type": "string",
1495
+ "mutable": false,
1496
+ "complexType": {
1497
+ "original": "string",
1498
+ "resolved": "string",
1499
+ "references": {}
1500
+ },
1501
+ "required": false,
1502
+ "optional": true,
1503
+ "docs": {
1504
+ "tags": [],
1505
+ "text": "The text to display as the validation message. This will override the built-in date validation."
1506
+ },
1507
+ "attribute": "validation-text",
1508
+ "reflect": false,
1509
+ "defaultValue": "\"\""
1510
+ }
1511
+ };
1512
+ }
1513
+ static get states() {
1514
+ return {
1515
+ "day": {},
1516
+ "invalidDateText": {},
1517
+ "maxDate": {},
1518
+ "minDate": {},
1519
+ "month": {},
1520
+ "year": {},
1521
+ "calendarFocused": {},
1522
+ "clearButtonFocused": {},
1523
+ "removeLabelledBy": {}
1524
+ };
1525
+ }
1526
+ static get events() {
1527
+ return [{
1528
+ "method": "calendarButtonClicked",
1529
+ "name": "calendarButtonClicked",
1530
+ "bubbles": true,
1531
+ "cancelable": true,
1532
+ "composed": true,
1533
+ "docs": {
1534
+ "tags": [{
1535
+ "name": "internal",
1536
+ "text": "Emitted when the calendar is opened."
1537
+ }],
1538
+ "text": ""
1539
+ },
1540
+ "complexType": {
1541
+ "original": "{ value: Date }",
1542
+ "resolved": "{ value: Date; }",
1543
+ "references": {
1544
+ "Date": {
1545
+ "location": "global",
1546
+ "id": "global::Date"
1547
+ }
1548
+ }
1549
+ }
1550
+ }, {
1551
+ "method": "icBlur",
1552
+ "name": "icBlur",
1553
+ "bubbles": true,
1554
+ "cancelable": true,
1555
+ "composed": true,
1556
+ "docs": {
1557
+ "tags": [],
1558
+ "text": "Emitted when the input loses focus."
1559
+ },
1560
+ "complexType": {
1561
+ "original": "{ value: Date }",
1562
+ "resolved": "{ value: Date; }",
1563
+ "references": {
1564
+ "Date": {
1565
+ "location": "global",
1566
+ "id": "global::Date"
1567
+ }
1568
+ }
1569
+ }
1570
+ }, {
1571
+ "method": "icChange",
1572
+ "name": "icChange",
1573
+ "bubbles": true,
1574
+ "cancelable": true,
1575
+ "composed": true,
1576
+ "docs": {
1577
+ "tags": [],
1578
+ "text": "Emitted when the value has changed."
1579
+ },
1580
+ "complexType": {
1581
+ "original": "{ value: Date }",
1582
+ "resolved": "{ value: Date; }",
1583
+ "references": {
1584
+ "Date": {
1585
+ "location": "global",
1586
+ "id": "global::Date"
1587
+ }
1588
+ }
1589
+ }
1590
+ }, {
1591
+ "method": "icFocus",
1592
+ "name": "icFocus",
1593
+ "bubbles": true,
1594
+ "cancelable": true,
1595
+ "composed": true,
1596
+ "docs": {
1597
+ "tags": [],
1598
+ "text": "Emitted when the input gains focus."
1599
+ },
1600
+ "complexType": {
1601
+ "original": "{ value: Date }",
1602
+ "resolved": "{ value: Date; }",
1603
+ "references": {
1604
+ "Date": {
1605
+ "location": "global",
1606
+ "id": "global::Date"
1607
+ }
1608
+ }
1609
+ }
1610
+ }];
1611
+ }
1612
+ static get methods() {
1613
+ return {
1614
+ "getDate": {
1615
+ "complexType": {
1616
+ "signature": "() => Promise<Date>",
1617
+ "parameters": [],
1618
+ "references": {
1619
+ "Promise": {
1620
+ "location": "global",
1621
+ "id": "global::Promise"
1622
+ },
1623
+ "Date": {
1624
+ "location": "global",
1625
+ "id": "global::Date"
1626
+ }
1627
+ },
1628
+ "return": "Promise<Date>"
1629
+ },
1630
+ "docs": {
1631
+ "text": "Returns the value as a Date object",
1632
+ "tags": [{
1633
+ "name": "returns",
1634
+ "text": "Date"
1635
+ }]
1636
+ }
1637
+ },
1638
+ "setCalendarFocus": {
1639
+ "complexType": {
1640
+ "signature": "() => Promise<void>",
1641
+ "parameters": [],
1642
+ "references": {
1643
+ "Promise": {
1644
+ "location": "global",
1645
+ "id": "global::Promise"
1646
+ }
1647
+ },
1648
+ "return": "Promise<void>"
1649
+ },
1650
+ "docs": {
1651
+ "text": "",
1652
+ "tags": [{
1653
+ "name": "internal",
1654
+ "text": "Sets focus on the calendar button."
1655
+ }]
1656
+ }
1657
+ },
1658
+ "setDisableDays": {
1659
+ "complexType": {
1660
+ "signature": "(days: IcWeekDays[]) => Promise<void>",
1661
+ "parameters": [{
1662
+ "name": "days",
1663
+ "type": "IcWeekDays[]",
1664
+ "docs": ""
1665
+ }],
1666
+ "references": {
1667
+ "Promise": {
1668
+ "location": "global",
1669
+ "id": "global::Promise"
1670
+ },
1671
+ "IcWeekDays": {
1672
+ "location": "import",
1673
+ "path": "../../utils/types",
1674
+ "id": "src/utils/types.ts::IcWeekDays"
1675
+ }
1676
+ },
1677
+ "return": "Promise<void>"
1678
+ },
1679
+ "docs": {
1680
+ "text": "",
1681
+ "tags": [{
1682
+ "name": "internal",
1683
+ "text": "Used to pass disabledDays from parent component."
1684
+ }]
1685
+ }
1686
+ },
1687
+ "triggerIcChange": {
1688
+ "complexType": {
1689
+ "signature": "(d: Date) => Promise<void>",
1690
+ "parameters": [{
1691
+ "name": "d",
1692
+ "type": "Date",
1693
+ "docs": ""
1694
+ }],
1695
+ "references": {
1696
+ "Promise": {
1697
+ "location": "global",
1698
+ "id": "global::Promise"
1699
+ },
1700
+ "Date": {
1701
+ "location": "global",
1702
+ "id": "global::Date"
1703
+ }
1704
+ },
1705
+ "return": "Promise<void>"
1706
+ },
1707
+ "docs": {
1708
+ "text": "",
1709
+ "tags": [{
1710
+ "name": "internal",
1711
+ "text": "Used to enable other components to invoke an IcChange event from the input."
1712
+ }]
1713
+ }
1714
+ }
1715
+ };
1716
+ }
1717
+ static get elementRef() { return "el"; }
1718
+ static get watchers() {
1719
+ return [{
1720
+ "propName": "disableFuture",
1721
+ "methodName": "watchDisableFutureHandler"
1722
+ }, {
1723
+ "propName": "disablePast",
1724
+ "methodName": "watchDisablePastHandler"
1725
+ }, {
1726
+ "propName": "max",
1727
+ "methodName": "watchMaxHandler"
1728
+ }, {
1729
+ "propName": "min",
1730
+ "methodName": "watchMinHandler"
1731
+ }, {
1732
+ "propName": "required",
1733
+ "methodName": "watchRequiredHandler"
1734
+ }];
1735
+ }
1736
+ }
1737
+ //# sourceMappingURL=ic-date-input.js.map