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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (474) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-7a069459.js → helpers-b525d45a.js} +2 -7
  3. package/dist/cjs/helpers-b525d45a.js.map +1 -0
  4. package/dist/cjs/{helpers-f75cf7cf.js → helpers-c4444a7e.js} +48 -94
  5. package/dist/cjs/helpers-c4444a7e.js.map +1 -0
  6. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  7. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  8. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-badge.cjs.entry.js +8 -16
  10. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-button_3.cjs.entry.js +2 -8
  14. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-card.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  18. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  19. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +57 -0
  21. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js.map +1 -0
  22. package/dist/cjs/ic-data-table.cjs.entry.js +308 -43
  23. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-dialog.cjs.entry.js +2 -3
  25. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  27. package/dist/cjs/{ic-pagination-bar.cjs.entry.js → ic-empty-state_2.cjs.entry.js} +34 -4
  28. package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -0
  29. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  30. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  31. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  34. package/dist/cjs/{ic-menu.cjs.entry.js → ic-input-component-container_3.cjs.entry.js} +69 -5
  35. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -0
  36. package/dist/cjs/ic-input-label_2.cjs.entry.js +86 -0
  37. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -0
  38. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  42. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -1
  43. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-navigation-group.cjs.entry.js +13 -16
  45. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  46. package/dist/cjs/ic-navigation-item.cjs.entry.js +32 -28
  47. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  48. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-pagination_4.cjs.entry.js +5 -5
  51. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  52. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  55. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-select-with-multi.cjs.entry.js +19 -6
  57. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  59. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  60. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  62. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  63. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  65. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  66. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-top-navigation.cjs.entry.js +60 -46
  70. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  71. package/dist/cjs/ic-typography.cjs.entry.js +35 -11
  72. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  73. package/dist/cjs/index-4cf27b16.js +10 -18
  74. package/dist/cjs/loader.cjs.js +1 -1
  75. package/dist/collection/collection-manifest.json +1 -2
  76. package/dist/collection/components/ic-data-table/ic-data-table.css +82 -7
  77. package/dist/collection/components/ic-data-table/ic-data-table.js +535 -44
  78. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  79. package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
  80. package/dist/collection/components/ic-data-table/story-data.js +386 -11
  81. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  82. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js +217 -0
  83. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.e2e.js.map +1 -0
  84. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +319 -0
  85. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
  86. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.css +87 -0
  87. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js +160 -0
  88. package/dist/collection/components/ic-data-table-title-bar/ic-data-table-title-bar.js.map +1 -0
  89. package/dist/collection/components/{ic-date-picker/test/a11y/ic-date-picker.test.a11y.js → ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js} +3 -5
  90. package/dist/collection/components/ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.js.map +1 -0
  91. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js +70 -0
  92. package/dist/collection/components/ic-data-table-title-bar/test/basic/ic-data-table-title-bar.spec.js.map +1 -0
  93. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +2 -2
  94. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -1
  95. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +1 -1
  96. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
  97. package/dist/collection/components/ic-select-with-multi/ic-select.js +2 -2
  98. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -1
  99. package/dist/collection/utils/constants.js +0 -55
  100. package/dist/collection/utils/constants.js.map +1 -1
  101. package/dist/collection/utils/helpers.js +42 -272
  102. package/dist/collection/utils/helpers.js.map +1 -1
  103. package/dist/collection/utils/types.js +0 -45
  104. package/dist/collection/utils/types.js.map +1 -1
  105. package/dist/components/helpers.js +2 -7
  106. package/dist/components/helpers.js.map +1 -1
  107. package/dist/components/helpers2.js +45 -91
  108. package/dist/components/helpers2.js.map +1 -1
  109. package/dist/components/ic-badge.js +8 -16
  110. package/dist/components/ic-badge.js.map +1 -1
  111. package/dist/components/ic-button2.js +3 -11
  112. package/dist/components/ic-button2.js.map +1 -1
  113. package/dist/components/ic-card.js +1 -1
  114. package/dist/components/ic-checkbox-group.js +1 -1
  115. package/dist/components/ic-checkbox.js +1 -1
  116. package/dist/components/ic-chip.js +1 -1
  117. package/dist/components/{ic-date-input.d.ts → ic-data-table-title-bar.d.ts} +4 -4
  118. package/dist/components/ic-data-table-title-bar.js +136 -0
  119. package/dist/components/ic-data-table-title-bar.js.map +1 -0
  120. package/dist/components/ic-data-table.js +334 -49
  121. package/dist/components/ic-data-table.js.map +1 -1
  122. package/dist/components/ic-dialog.js +1 -2
  123. package/dist/components/ic-dialog.js.map +1 -1
  124. package/dist/components/ic-empty-state.js +1 -57
  125. package/dist/components/ic-empty-state.js.map +1 -1
  126. package/dist/{esm/ic-empty-state.entry.js → components/ic-empty-state2.js} +38 -11
  127. package/dist/components/ic-empty-state2.js.map +1 -0
  128. package/dist/components/ic-input-component-container2.js +1 -1
  129. package/dist/components/ic-input-component-container2.js.map +1 -1
  130. package/dist/components/ic-link2.js +1 -1
  131. package/dist/components/ic-menu-item2.js +1 -1
  132. package/dist/components/ic-menu2.js +2 -2
  133. package/dist/components/ic-menu2.js.map +1 -1
  134. package/dist/components/ic-menu3.js +1 -1
  135. package/dist/components/ic-menu3.js.map +1 -1
  136. package/dist/components/ic-navigation-button.js +1 -1
  137. package/dist/components/ic-navigation-group.js +12 -15
  138. package/dist/components/ic-navigation-group.js.map +1 -1
  139. package/dist/components/ic-navigation-item.js +32 -28
  140. package/dist/components/ic-navigation-item.js.map +1 -1
  141. package/dist/components/ic-pagination-bar2.js +1 -1
  142. package/dist/components/ic-pagination-bar2.js.map +1 -1
  143. package/dist/components/ic-pagination-item2.js +1 -1
  144. package/dist/components/ic-pagination2.js +5 -5
  145. package/dist/components/ic-pagination2.js.map +1 -1
  146. package/dist/components/ic-radio-group.js +1 -1
  147. package/dist/components/ic-radio-option.js +1 -1
  148. package/dist/components/ic-search-bar.js +1 -1
  149. package/dist/components/ic-select-with-multi.js +14 -1
  150. package/dist/components/ic-select-with-multi.js.map +1 -1
  151. package/dist/components/ic-select2.js +1 -1
  152. package/dist/components/ic-switch.js +1 -1
  153. package/dist/components/ic-tab.js +1 -1
  154. package/dist/components/ic-text-field2.js +1 -1
  155. package/dist/components/ic-toggle-button.js +1 -1
  156. package/dist/components/ic-top-navigation.js +61 -47
  157. package/dist/components/ic-top-navigation.js.map +1 -1
  158. package/dist/components/ic-typography2.js +38 -12
  159. package/dist/components/ic-typography2.js.map +1 -1
  160. package/dist/core/core.css +1 -1
  161. package/dist/core/core.esm.js +1 -1
  162. package/dist/core/core.esm.js.map +1 -1
  163. package/dist/core/p-045359e1.entry.js +2 -0
  164. package/dist/core/{p-b1e3f20a.entry.js.map → p-045359e1.entry.js.map} +1 -1
  165. package/dist/core/{p-e9e7a7f9.entry.js → p-10fb4c46.entry.js} +2 -2
  166. package/dist/core/p-169bfa51.entry.js +2 -0
  167. package/dist/core/p-169bfa51.entry.js.map +1 -0
  168. package/dist/core/{p-21da96a9.entry.js → p-1ca332ca.entry.js} +2 -2
  169. package/dist/core/p-1e91f540.entry.js +2 -0
  170. package/dist/core/p-1e91f540.entry.js.map +1 -0
  171. package/dist/core/{p-170f6408.entry.js → p-204ace96.entry.js} +2 -2
  172. package/dist/core/{p-2f31bb92.entry.js → p-2eac7dcc.entry.js} +2 -2
  173. package/dist/core/p-347e8dab.entry.js +2 -0
  174. package/dist/core/p-347e8dab.entry.js.map +1 -0
  175. package/dist/core/p-3803a5b5.entry.js +2 -0
  176. package/dist/core/p-3803a5b5.entry.js.map +1 -0
  177. package/dist/core/p-4753bac8.entry.js +2 -0
  178. package/dist/core/p-4753bac8.entry.js.map +1 -0
  179. package/dist/core/{p-a16c6ff3.entry.js → p-4baa0916.entry.js} +2 -2
  180. package/dist/core/{p-655df7fe.entry.js → p-4f413fc0.entry.js} +2 -2
  181. package/dist/core/p-5171169f.entry.js +2 -0
  182. package/dist/core/p-5171169f.entry.js.map +1 -0
  183. package/dist/core/{p-56d01bdb.entry.js → p-595be57d.entry.js} +2 -2
  184. package/dist/core/{p-23a13636.entry.js → p-5ae93c16.entry.js} +2 -2
  185. package/dist/core/{p-0b32ba5b.entry.js → p-5e0c830b.entry.js} +2 -2
  186. package/dist/core/p-5ee4319c.entry.js +2 -0
  187. package/dist/core/p-5ee4319c.entry.js.map +1 -0
  188. package/dist/core/p-5f4e96ec.entry.js +2 -0
  189. package/dist/core/p-5f4e96ec.entry.js.map +1 -0
  190. package/dist/core/{p-95374ba1.entry.js → p-624d4f5f.entry.js} +2 -2
  191. package/dist/core/{p-df63896a.entry.js → p-6933f8e9.entry.js} +2 -2
  192. package/dist/core/{p-70b48a14.entry.js → p-6c3044b6.entry.js} +2 -2
  193. package/dist/core/p-7267fe19.entry.js +2 -0
  194. package/dist/core/p-7267fe19.entry.js.map +1 -0
  195. package/dist/core/{p-02d0ecd2.entry.js → p-75dac3d1.entry.js} +2 -2
  196. package/dist/core/{p-a6e9a8e7.entry.js → p-7ef8d616.entry.js} +2 -2
  197. package/dist/core/{p-0388b484.entry.js → p-81ddc39d.entry.js} +2 -2
  198. package/dist/core/{p-6e32683c.entry.js → p-869954a2.entry.js} +2 -2
  199. package/dist/core/{p-e2155d7f.entry.js → p-88d54b72.entry.js} +2 -2
  200. package/dist/core/{p-98c8d46a.entry.js → p-8b08d8fe.entry.js} +2 -2
  201. package/dist/core/{p-0080bbce.entry.js → p-917c5721.entry.js} +2 -2
  202. package/dist/core/p-942282cd.entry.js +2 -0
  203. package/dist/core/p-942282cd.entry.js.map +1 -0
  204. package/dist/core/p-96b3e7e2.js +2 -0
  205. package/dist/core/p-96b3e7e2.js.map +1 -0
  206. package/dist/core/p-9caf19eb.js +2 -0
  207. package/dist/core/p-9caf19eb.js.map +1 -0
  208. package/dist/core/{p-7373beb0.entry.js → p-a0f8efb2.entry.js} +2 -2
  209. package/dist/core/{p-1f1b4b8b.entry.js → p-a31031a5.entry.js} +2 -2
  210. package/dist/core/{p-221d03e1.entry.js → p-a434c3d4.entry.js} +2 -2
  211. package/dist/core/{p-25a458bf.entry.js → p-a43c12cd.entry.js} +2 -2
  212. package/dist/core/{p-31fdb740.entry.js → p-a50c3b9e.entry.js} +2 -2
  213. package/dist/core/p-aac4185b.entry.js +2 -0
  214. package/dist/core/p-aac4185b.entry.js.map +1 -0
  215. package/dist/core/{p-65a8c1d6.entry.js → p-ab09986c.entry.js} +2 -2
  216. package/dist/core/{p-9e3178e8.entry.js → p-b6639e4a.entry.js} +2 -2
  217. package/dist/core/{p-9e3178e8.entry.js.map → p-b6639e4a.entry.js.map} +1 -1
  218. package/dist/core/{p-e21083c8.entry.js → p-b82dcc29.entry.js} +2 -2
  219. package/dist/core/p-ba86928c.entry.js +2 -0
  220. package/dist/core/{p-4f0178a7.entry.js.map → p-ba86928c.entry.js.map} +1 -1
  221. package/dist/core/{p-b3ce9fe4.entry.js → p-c34848da.entry.js} +2 -2
  222. package/dist/core/{p-8f1aa87d.entry.js → p-d8469ac0.entry.js} +2 -2
  223. package/dist/core/{p-75a2cdac.entry.js → p-db9c03c0.entry.js} +2 -2
  224. package/dist/core/{p-fb58d1d1.entry.js → p-e3997d60.entry.js} +2 -2
  225. package/dist/core/{p-06aef486.entry.js → p-e834344e.entry.js} +2 -2
  226. package/dist/core/p-f14454b1.entry.js +2 -0
  227. package/dist/core/{p-9f9b3151.entry.js.map → p-f14454b1.entry.js.map} +1 -1
  228. package/dist/core/{p-ee09f1b3.entry.js → p-f3c840cd.entry.js} +2 -2
  229. package/dist/core/p-f6888309.entry.js +2 -0
  230. package/dist/core/p-f6888309.entry.js.map +1 -0
  231. package/dist/core/p-f74a8752.entry.js +2 -0
  232. package/dist/core/p-f74a8752.entry.js.map +1 -0
  233. package/dist/core/{p-b1e646e4.entry.js → p-f7a14c01.entry.js} +2 -2
  234. package/dist/core/{p-ce898d90.entry.js → p-f843da01.entry.js} +2 -2
  235. package/dist/core/p-fc5611e2.entry.js +2 -0
  236. package/dist/core/p-fc5611e2.entry.js.map +1 -0
  237. package/dist/esm/core.js +1 -1
  238. package/dist/esm/{helpers-b5f64263.js → helpers-12b4266a.js} +3 -8
  239. package/dist/esm/helpers-12b4266a.js.map +1 -0
  240. package/dist/esm/{helpers-f328a7b6.js → helpers-1f07eb61.js} +46 -92
  241. package/dist/esm/helpers-1f07eb61.js.map +1 -0
  242. package/dist/esm/ic-accordion.entry.js +1 -1
  243. package/dist/esm/ic-alert.entry.js +1 -1
  244. package/dist/esm/ic-back-to-top.entry.js +1 -1
  245. package/dist/esm/ic-badge.entry.js +8 -16
  246. package/dist/esm/ic-badge.entry.js.map +1 -1
  247. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  248. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  249. package/dist/esm/ic-button_3.entry.js +2 -8
  250. package/dist/esm/ic-button_3.entry.js.map +1 -1
  251. package/dist/esm/ic-card.entry.js +1 -1
  252. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  253. package/dist/esm/ic-checkbox.entry.js +1 -1
  254. package/dist/esm/ic-chip.entry.js +1 -1
  255. package/dist/esm/ic-data-row.entry.js +1 -1
  256. package/dist/esm/ic-data-table-title-bar.entry.js +53 -0
  257. package/dist/esm/ic-data-table-title-bar.entry.js.map +1 -0
  258. package/dist/esm/ic-data-table.entry.js +309 -44
  259. package/dist/esm/ic-data-table.entry.js.map +1 -1
  260. package/dist/esm/ic-dialog.entry.js +2 -3
  261. package/dist/esm/ic-dialog.entry.js.map +1 -1
  262. package/dist/esm/ic-divider.entry.js +1 -1
  263. package/dist/esm/{ic-pagination-bar.entry.js → ic-empty-state_2.entry.js} +34 -5
  264. package/dist/esm/ic-empty-state_2.entry.js.map +1 -0
  265. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  266. package/dist/esm/ic-footer-link.entry.js +1 -1
  267. package/dist/esm/ic-footer.entry.js +1 -1
  268. package/dist/esm/ic-hero.entry.js +1 -1
  269. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  270. package/dist/esm/{ic-menu.entry.js → ic-input-component-container_3.entry.js} +69 -7
  271. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -0
  272. package/dist/esm/ic-input-label_2.entry.js +81 -0
  273. package/dist/esm/ic-input-label_2.entry.js.map +1 -0
  274. package/dist/esm/ic-link.entry.js +1 -1
  275. package/dist/esm/ic-menu-group.entry.js +1 -1
  276. package/dist/esm/ic-menu-item.entry.js +1 -1
  277. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  278. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -1
  279. package/dist/esm/ic-navigation-button.entry.js +1 -1
  280. package/dist/esm/ic-navigation-group.entry.js +13 -16
  281. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  282. package/dist/esm/ic-navigation-item.entry.js +32 -28
  283. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  284. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  285. package/dist/esm/ic-page-header.entry.js +1 -1
  286. package/dist/esm/ic-pagination_4.entry.js +5 -5
  287. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  288. package/dist/esm/ic-popover-menu.entry.js +1 -1
  289. package/dist/esm/ic-radio-group.entry.js +1 -1
  290. package/dist/esm/ic-radio-option.entry.js +1 -1
  291. package/dist/esm/ic-search-bar.entry.js +1 -1
  292. package/dist/esm/ic-select-with-multi.entry.js +14 -1
  293. package/dist/esm/ic-select-with-multi.entry.js.map +1 -1
  294. package/dist/esm/ic-side-navigation.entry.js +1 -1
  295. package/dist/esm/ic-status-tag.entry.js +1 -1
  296. package/dist/esm/ic-step.entry.js +1 -1
  297. package/dist/esm/ic-stepper.entry.js +1 -1
  298. package/dist/esm/ic-switch.entry.js +1 -1
  299. package/dist/esm/ic-tab-group.entry.js +1 -1
  300. package/dist/esm/ic-tab-panel.entry.js +1 -1
  301. package/dist/esm/ic-tab.entry.js +1 -1
  302. package/dist/esm/ic-theme.entry.js +1 -1
  303. package/dist/esm/ic-toast.entry.js +1 -1
  304. package/dist/esm/ic-toggle-button.entry.js +1 -1
  305. package/dist/esm/ic-top-navigation.entry.js +60 -46
  306. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  307. package/dist/esm/ic-typography.entry.js +36 -12
  308. package/dist/esm/ic-typography.entry.js.map +1 -1
  309. package/dist/esm/index-93509377.js +10 -18
  310. package/dist/esm/loader.js +1 -1
  311. package/dist/esm/polyfills/core-js.js +0 -0
  312. package/dist/esm/polyfills/dom.js +0 -0
  313. package/dist/esm/polyfills/es5-html-element.js +0 -0
  314. package/dist/esm/polyfills/index.js +0 -0
  315. package/dist/esm/polyfills/system.js +0 -0
  316. package/dist/types/components/ic-data-table/ic-data-table.d.ts +96 -1
  317. package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +11 -0
  318. package/dist/types/components/ic-data-table/story-data.d.ts +99 -0
  319. package/dist/types/components/ic-data-table-title-bar/ic-data-table-title-bar.d.ts +36 -0
  320. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +2 -2
  321. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +2 -2
  322. package/dist/types/components.d.ts +141 -390
  323. package/dist/types/utils/constants.d.ts +0 -37
  324. package/dist/types/utils/helpers.d.ts +16 -84
  325. package/dist/types/utils/types.d.ts +1 -92
  326. package/hydrate/index.js +952 -2965
  327. package/package.json +3 -4
  328. package/dist/cjs/date-helpers-c9551119.js +0 -150
  329. package/dist/cjs/date-helpers-c9551119.js.map +0 -1
  330. package/dist/cjs/helpers-7a069459.js.map +0 -1
  331. package/dist/cjs/helpers-f75cf7cf.js.map +0 -1
  332. package/dist/cjs/ic-date-input.cjs.entry.js +0 -1089
  333. package/dist/cjs/ic-date-input.cjs.entry.js.map +0 -1
  334. package/dist/cjs/ic-date-picker.cjs.entry.js +0 -1050
  335. package/dist/cjs/ic-date-picker.cjs.entry.js.map +0 -1
  336. package/dist/cjs/ic-empty-state.cjs.entry.js +0 -38
  337. package/dist/cjs/ic-empty-state.cjs.entry.js.map +0 -1
  338. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +0 -150
  339. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +0 -1
  340. package/dist/cjs/ic-menu.cjs.entry.js.map +0 -1
  341. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +0 -1
  342. package/dist/collection/assets/calendar.svg +0 -3
  343. package/dist/collection/components/ic-date-input/ic-date-input.css +0 -560
  344. package/dist/collection/components/ic-date-input/ic-date-input.js +0 -1712
  345. package/dist/collection/components/ic-date-input/ic-date-input.js.map +0 -1
  346. package/dist/collection/components/ic-date-input/story-data.js +0 -28
  347. package/dist/collection/components/ic-date-input/story-data.js.map +0 -1
  348. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +0 -1139
  349. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +0 -1
  350. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +0 -42
  351. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +0 -1
  352. package/dist/collection/components/ic-date-picker/ic-date-picker.css +0 -878
  353. package/dist/collection/components/ic-date-picker/ic-date-picker.js +0 -1506
  354. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +0 -1
  355. package/dist/collection/components/ic-date-picker/ic-day-button.js +0 -36
  356. package/dist/collection/components/ic-date-picker/ic-day-button.js.map +0 -1
  357. package/dist/collection/components/ic-date-picker/ic-month-picker.js +0 -29
  358. package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +0 -1
  359. package/dist/collection/components/ic-date-picker/ic-year-picker.js +0 -39
  360. package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +0 -1
  361. package/dist/collection/components/ic-date-picker/story-data.js +0 -148
  362. package/dist/collection/components/ic-date-picker/story-data.js.map +0 -1
  363. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +0 -1
  364. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +0 -207
  365. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +0 -1
  366. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +0 -962
  367. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +0 -1
  368. package/dist/collection/utils/date-helpers.js +0 -133
  369. package/dist/collection/utils/date-helpers.js.map +0 -1
  370. package/dist/components/ic-date-input.js +0 -8
  371. package/dist/components/ic-date-input.js.map +0 -1
  372. package/dist/components/ic-date-input2.js +0 -1318
  373. package/dist/components/ic-date-input2.js.map +0 -1
  374. package/dist/components/ic-date-picker.d.ts +0 -11
  375. package/dist/components/ic-date-picker.js +0 -1171
  376. package/dist/components/ic-date-picker.js.map +0 -1
  377. package/dist/core/p-1857e9a7.entry.js +0 -2
  378. package/dist/core/p-1857e9a7.entry.js.map +0 -1
  379. package/dist/core/p-2c3cdfa3.js +0 -2
  380. package/dist/core/p-2c3cdfa3.js.map +0 -1
  381. package/dist/core/p-33dd24eb.js +0 -2
  382. package/dist/core/p-33dd24eb.js.map +0 -1
  383. package/dist/core/p-40ba5a51.entry.js +0 -2
  384. package/dist/core/p-40ba5a51.entry.js.map +0 -1
  385. package/dist/core/p-4f0178a7.entry.js +0 -2
  386. package/dist/core/p-5d6750ea.entry.js +0 -2
  387. package/dist/core/p-5d6750ea.entry.js.map +0 -1
  388. package/dist/core/p-7c0f24b6.entry.js +0 -2
  389. package/dist/core/p-7c0f24b6.entry.js.map +0 -1
  390. package/dist/core/p-9f9b3151.entry.js +0 -2
  391. package/dist/core/p-a22fd338.entry.js +0 -2
  392. package/dist/core/p-a22fd338.entry.js.map +0 -1
  393. package/dist/core/p-aabab75f.entry.js +0 -2
  394. package/dist/core/p-aabab75f.entry.js.map +0 -1
  395. package/dist/core/p-b1e3f20a.entry.js +0 -2
  396. package/dist/core/p-c680c7f9.entry.js +0 -2
  397. package/dist/core/p-c680c7f9.entry.js.map +0 -1
  398. package/dist/core/p-c7590421.entry.js +0 -2
  399. package/dist/core/p-c7590421.entry.js.map +0 -1
  400. package/dist/core/p-cd799087.js +0 -2
  401. package/dist/core/p-cd799087.js.map +0 -1
  402. package/dist/core/p-d184d9e2.entry.js +0 -2
  403. package/dist/core/p-d184d9e2.entry.js.map +0 -1
  404. package/dist/core/p-df5d7aa4.entry.js +0 -2
  405. package/dist/core/p-df5d7aa4.entry.js.map +0 -1
  406. package/dist/core/p-e189f1d0.entry.js +0 -2
  407. package/dist/core/p-e189f1d0.entry.js.map +0 -1
  408. package/dist/core/p-e33bdca9.entry.js +0 -2
  409. package/dist/core/p-e33bdca9.entry.js.map +0 -1
  410. package/dist/core/p-eeacd610.entry.js +0 -2
  411. package/dist/core/p-eeacd610.entry.js.map +0 -1
  412. package/dist/core/p-f24c9356.entry.js +0 -2
  413. package/dist/core/p-f24c9356.entry.js.map +0 -1
  414. package/dist/core/p-f5d5f0be.entry.js +0 -2
  415. package/dist/core/p-f5d5f0be.entry.js.map +0 -1
  416. package/dist/core/p-f62cd6d2.entry.js +0 -2
  417. package/dist/core/p-f62cd6d2.entry.js.map +0 -1
  418. package/dist/esm/date-helpers-0e5e32a7.js +0 -136
  419. package/dist/esm/date-helpers-0e5e32a7.js.map +0 -1
  420. package/dist/esm/helpers-b5f64263.js.map +0 -1
  421. package/dist/esm/helpers-f328a7b6.js.map +0 -1
  422. package/dist/esm/ic-date-input.entry.js +0 -1085
  423. package/dist/esm/ic-date-input.entry.js.map +0 -1
  424. package/dist/esm/ic-date-picker.entry.js +0 -1046
  425. package/dist/esm/ic-date-picker.entry.js.map +0 -1
  426. package/dist/esm/ic-empty-state.entry.js.map +0 -1
  427. package/dist/esm/ic-input-component-container_4.entry.js +0 -143
  428. package/dist/esm/ic-input-component-container_4.entry.js.map +0 -1
  429. package/dist/esm/ic-menu.entry.js.map +0 -1
  430. package/dist/esm/ic-pagination-bar.entry.js.map +0 -1
  431. package/dist/types/components/ic-date-input/ic-date-input.d.ts +0 -248
  432. package/dist/types/components/ic-date-input/story-data.d.ts +0 -1
  433. package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +0 -23
  434. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +0 -251
  435. package/dist/types/components/ic-date-picker/ic-day-button.d.ts +0 -16
  436. package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +0 -14
  437. package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +0 -16
  438. package/dist/types/components/ic-date-picker/story-data.d.ts +0 -22
  439. package/dist/types/utils/date-helpers.d.ts +0 -22
  440. /package/dist/core/{p-e9e7a7f9.entry.js.map → p-10fb4c46.entry.js.map} +0 -0
  441. /package/dist/core/{p-21da96a9.entry.js.map → p-1ca332ca.entry.js.map} +0 -0
  442. /package/dist/core/{p-170f6408.entry.js.map → p-204ace96.entry.js.map} +0 -0
  443. /package/dist/core/{p-2f31bb92.entry.js.map → p-2eac7dcc.entry.js.map} +0 -0
  444. /package/dist/core/{p-a16c6ff3.entry.js.map → p-4baa0916.entry.js.map} +0 -0
  445. /package/dist/core/{p-655df7fe.entry.js.map → p-4f413fc0.entry.js.map} +0 -0
  446. /package/dist/core/{p-56d01bdb.entry.js.map → p-595be57d.entry.js.map} +0 -0
  447. /package/dist/core/{p-23a13636.entry.js.map → p-5ae93c16.entry.js.map} +0 -0
  448. /package/dist/core/{p-0b32ba5b.entry.js.map → p-5e0c830b.entry.js.map} +0 -0
  449. /package/dist/core/{p-95374ba1.entry.js.map → p-624d4f5f.entry.js.map} +0 -0
  450. /package/dist/core/{p-df63896a.entry.js.map → p-6933f8e9.entry.js.map} +0 -0
  451. /package/dist/core/{p-70b48a14.entry.js.map → p-6c3044b6.entry.js.map} +0 -0
  452. /package/dist/core/{p-02d0ecd2.entry.js.map → p-75dac3d1.entry.js.map} +0 -0
  453. /package/dist/core/{p-a6e9a8e7.entry.js.map → p-7ef8d616.entry.js.map} +0 -0
  454. /package/dist/core/{p-0388b484.entry.js.map → p-81ddc39d.entry.js.map} +0 -0
  455. /package/dist/core/{p-6e32683c.entry.js.map → p-869954a2.entry.js.map} +0 -0
  456. /package/dist/core/{p-e2155d7f.entry.js.map → p-88d54b72.entry.js.map} +0 -0
  457. /package/dist/core/{p-98c8d46a.entry.js.map → p-8b08d8fe.entry.js.map} +0 -0
  458. /package/dist/core/{p-0080bbce.entry.js.map → p-917c5721.entry.js.map} +0 -0
  459. /package/dist/core/{p-7373beb0.entry.js.map → p-a0f8efb2.entry.js.map} +0 -0
  460. /package/dist/core/{p-1f1b4b8b.entry.js.map → p-a31031a5.entry.js.map} +0 -0
  461. /package/dist/core/{p-221d03e1.entry.js.map → p-a434c3d4.entry.js.map} +0 -0
  462. /package/dist/core/{p-25a458bf.entry.js.map → p-a43c12cd.entry.js.map} +0 -0
  463. /package/dist/core/{p-31fdb740.entry.js.map → p-a50c3b9e.entry.js.map} +0 -0
  464. /package/dist/core/{p-65a8c1d6.entry.js.map → p-ab09986c.entry.js.map} +0 -0
  465. /package/dist/core/{p-e21083c8.entry.js.map → p-b82dcc29.entry.js.map} +0 -0
  466. /package/dist/core/{p-b3ce9fe4.entry.js.map → p-c34848da.entry.js.map} +0 -0
  467. /package/dist/core/{p-8f1aa87d.entry.js.map → p-d8469ac0.entry.js.map} +0 -0
  468. /package/dist/core/{p-75a2cdac.entry.js.map → p-db9c03c0.entry.js.map} +0 -0
  469. /package/dist/core/{p-fb58d1d1.entry.js.map → p-e3997d60.entry.js.map} +0 -0
  470. /package/dist/core/{p-06aef486.entry.js.map → p-e834344e.entry.js.map} +0 -0
  471. /package/dist/core/{p-ee09f1b3.entry.js.map → p-f3c840cd.entry.js.map} +0 -0
  472. /package/dist/core/{p-b1e646e4.entry.js.map → p-f7a14c01.entry.js.map} +0 -0
  473. /package/dist/core/{p-ce898d90.entry.js.map → p-f843da01.entry.js.map} +0 -0
  474. /package/dist/types/components/{ic-date-picker/test/a11y/ic-date-picker.test.a11y.d.ts → ic-data-table-title-bar/test/a11y/ic-data-table-title-bar.test.a11y.d.ts} +0 -0
@@ -1,1712 +0,0 @@
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
- watchMaxHandler() {
830
- if (this.disableFuture) {
831
- this.maxDate = new Date();
832
- }
833
- else {
834
- this.maxDate = createDate(this.max, this.dateFormat);
835
- }
836
- }
837
- watchMinHandler() {
838
- if (this.disablePast) {
839
- this.minDate = new Date();
840
- }
841
- else {
842
- this.minDate = createDate(this.min, this.dateFormat);
843
- }
844
- }
845
- disconnectedCallback() {
846
- removeFormResetListener(this.el, this.handleFormReset);
847
- }
848
- componentWillLoad() {
849
- this.defaultHelperText = `Use format ${this.dateFormat}`;
850
- if (isEmptyString(this.helperText)) {
851
- this.helperText = this.defaultHelperText;
852
- }
853
- this.watchMinHandler();
854
- this.watchMaxHandler();
855
- if (this.value) {
856
- this.setDate(this.value);
857
- this.previousEmittedDate = this.selectedDate;
858
- }
859
- else {
860
- this.previousEmittedDate = null;
861
- }
862
- this.screenReaderInfoId = `${this.inputId}-screen-reader-info`;
863
- this.assistiveHintId = `${this.inputId}-assistive-hint`;
864
- this.selectedDateInfoId = `${this.inputId}-selected-date-info`;
865
- addFormResetListener(this.el, this.handleFormReset);
866
- }
867
- componentDidLoad() {
868
- this.setInputsInOrder();
869
- onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Date Input");
870
- if (this.value) {
871
- this.updateInputValues(this.day, this.month, this.year);
872
- this.inputsInOrder.forEach((input) => {
873
- input.classList.add(this.FIT_TO_VALUE);
874
- });
875
- }
876
- this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
877
- if (this.value) {
878
- this.notifyScreenReaderSelectedDate();
879
- }
880
- this.inputsInOrder.forEach((input) => {
881
- input.addEventListener("input", this.handleInput);
882
- input.addEventListener("focus", this.handleFocus);
883
- input.addEventListener("blur", this.handleBlur);
884
- });
885
- // Prevent asterisk being read out after the label by screen reader (by applying aria-hidden)
886
- // Needed because label is included in 'aria-labelledby' instead of using 'aria-label'
887
- const labelEl = this.el.shadowRoot.querySelector("label");
888
- if (this.required) {
889
- const asteriskSpan = document.createElement("span");
890
- asteriskSpan.setAttribute("aria-hidden", "true");
891
- asteriskSpan.textContent = " *";
892
- labelEl === null || labelEl === void 0 ? void 0 : labelEl.appendChild(asteriskSpan);
893
- }
894
- }
895
- componentWillUpdate() {
896
- if (!this.isDateSetFromKeyboardEvent) {
897
- this.setDate(this.value);
898
- }
899
- this.setAriaInvalid(this.isValidDay, this.isValidMonth, this.isValidDate, this.isDisabledDate);
900
- this.handleDateChange(false);
901
- this.isDateSetFromKeyboardEvent = false;
902
- }
903
- componentDidRender() {
904
- if (this.removeLabelledBy) {
905
- this.removeAriaLabelledBy();
906
- return;
907
- }
908
- this.setAriaLabelledBy();
909
- }
910
- /**
911
- * Returns the value as a Date object
912
- * @returns Date
913
- */
914
- async getDate() {
915
- return this.selectedDate;
916
- }
917
- /**
918
- * @internal Sets focus on the calendar button.
919
- */
920
- async setCalendarFocus() {
921
- if (this.calendarButtonEl) {
922
- this.calendarButtonEl.focus();
923
- }
924
- }
925
- /**
926
- * @internal Used to pass disabledDays from parent component.
927
- */
928
- async setDisableDays(days) {
929
- this.disableDays = days;
930
- }
931
- /**
932
- * @internal Used to enable other components to invoke an IcChange event from the input.
933
- */
934
- async triggerIcChange(d) {
935
- this.emitIcChange(d);
936
- }
937
- removeAriaLabelledBy() {
938
- this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY);
939
- }
940
- setPastedValueAndValidation(isValidDate, pastedValue, event) {
941
- switch (true) {
942
- case isValidDate: {
943
- const nextParsedValue = this.isZuluTime
944
- ? extractDateFromZuluDateTime(pastedValue)
945
- : pastedValue;
946
- const dateParts = nextParsedValue.split(/-|\/|\./);
947
- this.inputsInOrder.forEach((input, index) => {
948
- input.classList.add(this.FIT_TO_VALUE);
949
- if (this.isZuluTime) {
950
- this.pasteZuluDateTime(dateParts, index);
951
- }
952
- else {
953
- let dateValue;
954
- if (input === this.dayInputEl || input === this.monthInputEl) {
955
- dateValue = this.slicePastedDate(2, dateParts[index]);
956
- }
957
- else {
958
- dateValue = this.slicePastedDate(4, dateParts[index]);
959
- }
960
- input.value = dateValue;
961
- this.setInputValue(input);
962
- this.autocompleteInput(input);
963
- }
964
- });
965
- this.isZuluTime = false;
966
- break;
967
- }
968
- case (pastedValue.length === 1 ||
969
- pastedValue.length === 2 ||
970
- pastedValue.length === 4) &&
971
- isNumeric(pastedValue):
972
- if (this.checkSingleCopiedValueIsValid(event.target, pastedValue)) {
973
- // Check if copied value can be pasted into input
974
- this.setInputPasteValue(event.target, pastedValue);
975
- this.setInputValue(event.target);
976
- }
977
- else {
978
- this.displayPastedValidation(event);
979
- }
980
- break;
981
- case pastedValue.length === 3 && isNumeric(pastedValue):
982
- if (event.target !== this.yearInputEl) {
983
- this.displayPastedValidation(event);
984
- }
985
- else {
986
- this.setInputPasteValue(event.target, pastedValue);
987
- this.setInputValue(event.target);
988
- }
989
- break;
990
- case pastedValue.length >= 5 && isNumeric(pastedValue):
991
- this.displayPastedValidation(event);
992
- }
993
- }
994
- pasteZuluDateTime(dateParts, index) {
995
- // ['YYYY', 'MM', 'DD']
996
- if (index === 0) {
997
- const dateValue = this.slicePastedDate(4, dateParts[index]);
998
- this.yearInputEl.value = dateValue;
999
- this.setInputValue(this.yearInputEl);
1000
- }
1001
- else if (index === 1) {
1002
- // The month value is the second item in the array
1003
- const dateValue = this.slicePastedDate(2, dateParts[index]);
1004
- this.monthInputEl.value = dateValue;
1005
- this.setInputValue(this.monthInputEl);
1006
- }
1007
- else {
1008
- const dateValue = this.slicePastedDate(2, dateParts[index]);
1009
- this.dayInputEl.value = dateValue;
1010
- this.setInputValue(this.dayInputEl);
1011
- }
1012
- }
1013
- displayPastedValidation(event) {
1014
- var _a;
1015
- if (((_a = this.invalidDateText) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1016
- this.previousInvalidDateTest = this.invalidDateText;
1017
- }
1018
- this.invalidDateText = `Please paste a valid ${this.getAriaLabel(event.target)}`;
1019
- this.validationStatus = IcInformationStatus.Error;
1020
- this.isPasteValidationDisplayed = true;
1021
- }
1022
- setPasteInvalidText() {
1023
- var _a;
1024
- if (this.isPasteValidationDisplayed) {
1025
- this.invalidDateText = (_a = this.previousInvalidDateTest) !== null && _a !== void 0 ? _a : "";
1026
- this.isPasteValidationDisplayed = false;
1027
- // This is to prevent setDate from triggering within componentWillUpdate
1028
- this.isDateSetFromKeyboardEvent = true;
1029
- }
1030
- }
1031
- notifyScreenReader(input, event) {
1032
- const liveRegion = this.el.shadowRoot.querySelector("#live-region");
1033
- if (liveRegion) {
1034
- if (this.isKeyboardOrEvent(event)) {
1035
- this.notifyScreenReaderArrowKeys(input);
1036
- }
1037
- else if (Object.prototype.toString.call(event) === this.INPUT_EVENT_OBJECT_STRING) {
1038
- this.notifyScreenReaderInput(input, liveRegion);
1039
- }
1040
- }
1041
- }
1042
- render() {
1043
- const { inputId, label, disabled, helperText, showClearButton, showCalendarButton, size, } = this;
1044
- const hasCustomValidation = !isEmptyString(this.validationStatus) &&
1045
- !isEmptyString(this.validationText);
1046
- const validationStatus = hasCustomValidation
1047
- ? this.validationStatus
1048
- : !isEmptyString(this.invalidDateText)
1049
- ? IcInformationStatus.Error
1050
- : "";
1051
- const assistiveHint = `Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;
1052
- renderHiddenInput(true, this.el, this.name, this.convertToDate(this.year, this.month, this.day), this.disabled);
1053
- 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: {
1054
- ["clear-button"]: true,
1055
- ["hidden"]: isEmptyString(this.day) &&
1056
- isEmptyString(this.month) &&
1057
- isEmptyString(this.year),
1058
- }, disabled: this.disabled, innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearFocus, onBlur: this.handleClearBlur, variant: "icon", appearance: this.clearButtonFocused
1059
- ? IcThemeForegroundEnum.Light
1060
- : 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
1061
- ? IcThemeForegroundEnum.Light
1062
- : 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 })))));
1063
- }
1064
- static get is() { return "ic-date-input"; }
1065
- static get encapsulation() { return "shadow"; }
1066
- static get delegatesFocus() { return true; }
1067
- static get originalStyleUrls() {
1068
- return {
1069
- "$": ["ic-date-input.css"]
1070
- };
1071
- }
1072
- static get styleUrls() {
1073
- return {
1074
- "$": ["ic-date-input.css"]
1075
- };
1076
- }
1077
- static get properties() {
1078
- return {
1079
- "dateFormat": {
1080
- "type": "string",
1081
- "mutable": false,
1082
- "complexType": {
1083
- "original": "IcDateFormat",
1084
- "resolved": "\"DD/MM/YYYY\" | \"MM/DD/YYYY\" | \"YYYY/MM/DD\"",
1085
- "references": {
1086
- "IcDateFormat": {
1087
- "location": "import",
1088
- "path": "../../utils/types",
1089
- "id": "src/utils/types.ts::IcDateFormat"
1090
- }
1091
- }
1092
- },
1093
- "required": false,
1094
- "optional": true,
1095
- "docs": {
1096
- "tags": [],
1097
- "text": "The format in which the date will be displayed."
1098
- },
1099
- "attribute": "date-format",
1100
- "reflect": false,
1101
- "defaultValue": "\"DD/MM/YYYY\""
1102
- },
1103
- "disabled": {
1104
- "type": "boolean",
1105
- "mutable": false,
1106
- "complexType": {
1107
- "original": "boolean",
1108
- "resolved": "boolean",
1109
- "references": {}
1110
- },
1111
- "required": false,
1112
- "optional": true,
1113
- "docs": {
1114
- "tags": [],
1115
- "text": "If `true`, the disabled state will be set."
1116
- },
1117
- "attribute": "disabled",
1118
- "reflect": false,
1119
- "defaultValue": "false"
1120
- },
1121
- "disableDays": {
1122
- "type": "unknown",
1123
- "mutable": true,
1124
- "complexType": {
1125
- "original": "IcWeekDays[]",
1126
- "resolved": "IcWeekDays[]",
1127
- "references": {
1128
- "IcWeekDays": {
1129
- "location": "import",
1130
- "path": "../../utils/types",
1131
- "id": "src/utils/types.ts::IcWeekDays"
1132
- }
1133
- }
1134
- },
1135
- "required": false,
1136
- "optional": true,
1137
- "docs": {
1138
- "tags": [],
1139
- "text": "The days of the week to disable."
1140
- },
1141
- "defaultValue": "[]"
1142
- },
1143
- "disableDaysMessage": {
1144
- "type": "string",
1145
- "mutable": false,
1146
- "complexType": {
1147
- "original": "string",
1148
- "resolved": "string",
1149
- "references": {}
1150
- },
1151
- "required": false,
1152
- "optional": true,
1153
- "docs": {
1154
- "tags": [],
1155
- "text": "The text to display as the validation message when `disableDays` is set and a disabled date is entered."
1156
- },
1157
- "attribute": "disable-days-message",
1158
- "reflect": false,
1159
- "defaultValue": "\"The date you have selected is on a day of the week that is not allowed. Please select another date.\""
1160
- },
1161
- "disableFuture": {
1162
- "type": "boolean",
1163
- "mutable": false,
1164
- "complexType": {
1165
- "original": "boolean",
1166
- "resolved": "boolean",
1167
- "references": {}
1168
- },
1169
- "required": false,
1170
- "optional": true,
1171
- "docs": {
1172
- "tags": [],
1173
- "text": "If `true`, dates in the future are not allowed. A validation message will appear if a date in the future is entered."
1174
- },
1175
- "attribute": "disable-future",
1176
- "reflect": false,
1177
- "defaultValue": "false"
1178
- },
1179
- "disableFutureMessage": {
1180
- "type": "string",
1181
- "mutable": false,
1182
- "complexType": {
1183
- "original": "string",
1184
- "resolved": "string",
1185
- "references": {}
1186
- },
1187
- "required": false,
1188
- "optional": true,
1189
- "docs": {
1190
- "tags": [],
1191
- "text": "The text to display as the validation message when `disableFuture` is true and a date in the future is entered."
1192
- },
1193
- "attribute": "disable-future-message",
1194
- "reflect": false,
1195
- "defaultValue": "\"Dates in the future are not allowed. Please select a date in the past.\""
1196
- },
1197
- "disablePast": {
1198
- "type": "boolean",
1199
- "mutable": false,
1200
- "complexType": {
1201
- "original": "boolean",
1202
- "resolved": "boolean",
1203
- "references": {}
1204
- },
1205
- "required": false,
1206
- "optional": true,
1207
- "docs": {
1208
- "tags": [],
1209
- "text": "If `true`, dates in the past are not allowed. A validation message will appear if a date in the past is entered."
1210
- },
1211
- "attribute": "disable-past",
1212
- "reflect": false,
1213
- "defaultValue": "false"
1214
- },
1215
- "disablePastMessage": {
1216
- "type": "string",
1217
- "mutable": false,
1218
- "complexType": {
1219
- "original": "string",
1220
- "resolved": "string",
1221
- "references": {}
1222
- },
1223
- "required": false,
1224
- "optional": true,
1225
- "docs": {
1226
- "tags": [],
1227
- "text": "The text to display as the validation message when `disablePast` is true and a date in the past is entered."
1228
- },
1229
- "attribute": "disable-past-message",
1230
- "reflect": false,
1231
- "defaultValue": "\"Dates in the past are not allowed. Please select a date in the future.\""
1232
- },
1233
- "helperText": {
1234
- "type": "string",
1235
- "mutable": true,
1236
- "complexType": {
1237
- "original": "string",
1238
- "resolved": "string",
1239
- "references": {}
1240
- },
1241
- "required": false,
1242
- "optional": true,
1243
- "docs": {
1244
- "tags": [],
1245
- "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."
1246
- },
1247
- "attribute": "helper-text",
1248
- "reflect": false
1249
- },
1250
- "inputId": {
1251
- "type": "string",
1252
- "mutable": false,
1253
- "complexType": {
1254
- "original": "string",
1255
- "resolved": "string",
1256
- "references": {}
1257
- },
1258
- "required": false,
1259
- "optional": true,
1260
- "docs": {
1261
- "tags": [],
1262
- "text": "The ID for the input."
1263
- },
1264
- "attribute": "input-id",
1265
- "reflect": false,
1266
- "defaultValue": "`ic-date-input-${inputIds++}`"
1267
- },
1268
- "label": {
1269
- "type": "string",
1270
- "mutable": false,
1271
- "complexType": {
1272
- "original": "string",
1273
- "resolved": "string",
1274
- "references": {}
1275
- },
1276
- "required": true,
1277
- "optional": false,
1278
- "docs": {
1279
- "tags": [],
1280
- "text": "The label for the date input."
1281
- },
1282
- "attribute": "label",
1283
- "reflect": false
1284
- },
1285
- "max": {
1286
- "type": "string",
1287
- "mutable": false,
1288
- "complexType": {
1289
- "original": "string | Date",
1290
- "resolved": "Date | string",
1291
- "references": {
1292
- "Date": {
1293
- "location": "global",
1294
- "id": "global::Date"
1295
- }
1296
- }
1297
- },
1298
- "required": false,
1299
- "optional": true,
1300
- "docs": {
1301
- "tags": [],
1302
- "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`."
1303
- },
1304
- "attribute": "max",
1305
- "reflect": false,
1306
- "defaultValue": "\"\""
1307
- },
1308
- "min": {
1309
- "type": "string",
1310
- "mutable": false,
1311
- "complexType": {
1312
- "original": "string | Date",
1313
- "resolved": "Date | string",
1314
- "references": {
1315
- "Date": {
1316
- "location": "global",
1317
- "id": "global::Date"
1318
- }
1319
- }
1320
- },
1321
- "required": false,
1322
- "optional": true,
1323
- "docs": {
1324
- "tags": [],
1325
- "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`."
1326
- },
1327
- "attribute": "min",
1328
- "reflect": false,
1329
- "defaultValue": "\"\""
1330
- },
1331
- "name": {
1332
- "type": "string",
1333
- "mutable": false,
1334
- "complexType": {
1335
- "original": "string",
1336
- "resolved": "string",
1337
- "references": {}
1338
- },
1339
- "required": false,
1340
- "optional": false,
1341
- "docs": {
1342
- "tags": [],
1343
- "text": "The name of the control, which is submitted with the form data."
1344
- },
1345
- "attribute": "name",
1346
- "reflect": false,
1347
- "defaultValue": "this.inputId"
1348
- },
1349
- "required": {
1350
- "type": "boolean",
1351
- "mutable": false,
1352
- "complexType": {
1353
- "original": "boolean",
1354
- "resolved": "boolean",
1355
- "references": {}
1356
- },
1357
- "required": false,
1358
- "optional": true,
1359
- "docs": {
1360
- "tags": [],
1361
- "text": "If `true`, the input will require a value."
1362
- },
1363
- "attribute": "required",
1364
- "reflect": false,
1365
- "defaultValue": "false"
1366
- },
1367
- "showCalendarButton": {
1368
- "type": "boolean",
1369
- "mutable": false,
1370
- "complexType": {
1371
- "original": "boolean",
1372
- "resolved": "boolean",
1373
- "references": {}
1374
- },
1375
- "required": false,
1376
- "optional": true,
1377
- "docs": {
1378
- "tags": [{
1379
- "name": "internal",
1380
- "text": "If `true`, a button which displays the calendar view when clicked will be displayed."
1381
- }],
1382
- "text": ""
1383
- },
1384
- "attribute": "show-calendar-button",
1385
- "reflect": false,
1386
- "defaultValue": "false"
1387
- },
1388
- "showClearButton": {
1389
- "type": "boolean",
1390
- "mutable": false,
1391
- "complexType": {
1392
- "original": "boolean",
1393
- "resolved": "boolean",
1394
- "references": {}
1395
- },
1396
- "required": false,
1397
- "optional": true,
1398
- "docs": {
1399
- "tags": [],
1400
- "text": "If `true`, a button which clears the date input when clicked will be displayed."
1401
- },
1402
- "attribute": "show-clear-button",
1403
- "reflect": false,
1404
- "defaultValue": "true"
1405
- },
1406
- "size": {
1407
- "type": "string",
1408
- "mutable": false,
1409
- "complexType": {
1410
- "original": "IcSizes",
1411
- "resolved": "\"default\" | \"large\" | \"small\"",
1412
- "references": {
1413
- "IcSizes": {
1414
- "location": "import",
1415
- "path": "../../utils/types",
1416
- "id": "src/utils/types.ts::IcSizes"
1417
- }
1418
- }
1419
- },
1420
- "required": false,
1421
- "optional": true,
1422
- "docs": {
1423
- "tags": [],
1424
- "text": "The size of the date input to be displayed."
1425
- },
1426
- "attribute": "size",
1427
- "reflect": false,
1428
- "defaultValue": "\"default\""
1429
- },
1430
- "value": {
1431
- "type": "string",
1432
- "mutable": true,
1433
- "complexType": {
1434
- "original": "string | Date | null | undefined",
1435
- "resolved": "Date | string",
1436
- "references": {
1437
- "Date": {
1438
- "location": "global",
1439
- "id": "global::Date"
1440
- }
1441
- }
1442
- },
1443
- "required": false,
1444
- "optional": true,
1445
- "docs": {
1446
- "tags": [],
1447
- "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."
1448
- },
1449
- "attribute": "value",
1450
- "reflect": false,
1451
- "defaultValue": "\"\""
1452
- },
1453
- "validationStatus": {
1454
- "type": "string",
1455
- "mutable": true,
1456
- "complexType": {
1457
- "original": "IcInformationStatusOrEmpty",
1458
- "resolved": "\"\" | \"error\" | \"success\" | \"warning\"",
1459
- "references": {
1460
- "IcInformationStatusOrEmpty": {
1461
- "location": "import",
1462
- "path": "../../utils/types",
1463
- "id": "src/utils/types.ts::IcInformationStatusOrEmpty"
1464
- }
1465
- }
1466
- },
1467
- "required": false,
1468
- "optional": true,
1469
- "docs": {
1470
- "tags": [],
1471
- "text": "The validation status - e.g. 'error' | 'warning' | 'success'. This will override the built-in date validation."
1472
- },
1473
- "attribute": "validation-status",
1474
- "reflect": false,
1475
- "defaultValue": "\"\""
1476
- },
1477
- "validationText": {
1478
- "type": "string",
1479
- "mutable": false,
1480
- "complexType": {
1481
- "original": "string",
1482
- "resolved": "string",
1483
- "references": {}
1484
- },
1485
- "required": false,
1486
- "optional": true,
1487
- "docs": {
1488
- "tags": [],
1489
- "text": "The text to display as the validation message. This will override the built-in date validation."
1490
- },
1491
- "attribute": "validation-text",
1492
- "reflect": false,
1493
- "defaultValue": "\"\""
1494
- }
1495
- };
1496
- }
1497
- static get states() {
1498
- return {
1499
- "day": {},
1500
- "invalidDateText": {},
1501
- "maxDate": {},
1502
- "minDate": {},
1503
- "month": {},
1504
- "year": {},
1505
- "calendarFocused": {},
1506
- "clearButtonFocused": {},
1507
- "removeLabelledBy": {}
1508
- };
1509
- }
1510
- static get events() {
1511
- return [{
1512
- "method": "calendarButtonClicked",
1513
- "name": "calendarButtonClicked",
1514
- "bubbles": true,
1515
- "cancelable": true,
1516
- "composed": true,
1517
- "docs": {
1518
- "tags": [{
1519
- "name": "internal",
1520
- "text": "Emitted when the calendar is opened."
1521
- }],
1522
- "text": ""
1523
- },
1524
- "complexType": {
1525
- "original": "{ value: Date }",
1526
- "resolved": "{ value: Date; }",
1527
- "references": {
1528
- "Date": {
1529
- "location": "global",
1530
- "id": "global::Date"
1531
- }
1532
- }
1533
- }
1534
- }, {
1535
- "method": "icBlur",
1536
- "name": "icBlur",
1537
- "bubbles": true,
1538
- "cancelable": true,
1539
- "composed": true,
1540
- "docs": {
1541
- "tags": [],
1542
- "text": "Emitted when the input loses focus."
1543
- },
1544
- "complexType": {
1545
- "original": "{ value: Date }",
1546
- "resolved": "{ value: Date; }",
1547
- "references": {
1548
- "Date": {
1549
- "location": "global",
1550
- "id": "global::Date"
1551
- }
1552
- }
1553
- }
1554
- }, {
1555
- "method": "icChange",
1556
- "name": "icChange",
1557
- "bubbles": true,
1558
- "cancelable": true,
1559
- "composed": true,
1560
- "docs": {
1561
- "tags": [],
1562
- "text": "Emitted when the value has changed."
1563
- },
1564
- "complexType": {
1565
- "original": "{ value: Date }",
1566
- "resolved": "{ value: Date; }",
1567
- "references": {
1568
- "Date": {
1569
- "location": "global",
1570
- "id": "global::Date"
1571
- }
1572
- }
1573
- }
1574
- }, {
1575
- "method": "icFocus",
1576
- "name": "icFocus",
1577
- "bubbles": true,
1578
- "cancelable": true,
1579
- "composed": true,
1580
- "docs": {
1581
- "tags": [],
1582
- "text": "Emitted when the input gains focus."
1583
- },
1584
- "complexType": {
1585
- "original": "{ value: Date }",
1586
- "resolved": "{ value: Date; }",
1587
- "references": {
1588
- "Date": {
1589
- "location": "global",
1590
- "id": "global::Date"
1591
- }
1592
- }
1593
- }
1594
- }];
1595
- }
1596
- static get methods() {
1597
- return {
1598
- "getDate": {
1599
- "complexType": {
1600
- "signature": "() => Promise<Date>",
1601
- "parameters": [],
1602
- "references": {
1603
- "Promise": {
1604
- "location": "global",
1605
- "id": "global::Promise"
1606
- },
1607
- "Date": {
1608
- "location": "global",
1609
- "id": "global::Date"
1610
- }
1611
- },
1612
- "return": "Promise<Date>"
1613
- },
1614
- "docs": {
1615
- "text": "Returns the value as a Date object",
1616
- "tags": [{
1617
- "name": "returns",
1618
- "text": "Date"
1619
- }]
1620
- }
1621
- },
1622
- "setCalendarFocus": {
1623
- "complexType": {
1624
- "signature": "() => Promise<void>",
1625
- "parameters": [],
1626
- "references": {
1627
- "Promise": {
1628
- "location": "global",
1629
- "id": "global::Promise"
1630
- }
1631
- },
1632
- "return": "Promise<void>"
1633
- },
1634
- "docs": {
1635
- "text": "",
1636
- "tags": [{
1637
- "name": "internal",
1638
- "text": "Sets focus on the calendar button."
1639
- }]
1640
- }
1641
- },
1642
- "setDisableDays": {
1643
- "complexType": {
1644
- "signature": "(days: IcWeekDays[]) => Promise<void>",
1645
- "parameters": [{
1646
- "name": "days",
1647
- "type": "IcWeekDays[]",
1648
- "docs": ""
1649
- }],
1650
- "references": {
1651
- "Promise": {
1652
- "location": "global",
1653
- "id": "global::Promise"
1654
- },
1655
- "IcWeekDays": {
1656
- "location": "import",
1657
- "path": "../../utils/types",
1658
- "id": "src/utils/types.ts::IcWeekDays"
1659
- }
1660
- },
1661
- "return": "Promise<void>"
1662
- },
1663
- "docs": {
1664
- "text": "",
1665
- "tags": [{
1666
- "name": "internal",
1667
- "text": "Used to pass disabledDays from parent component."
1668
- }]
1669
- }
1670
- },
1671
- "triggerIcChange": {
1672
- "complexType": {
1673
- "signature": "(d: Date) => Promise<void>",
1674
- "parameters": [{
1675
- "name": "d",
1676
- "type": "Date",
1677
- "docs": ""
1678
- }],
1679
- "references": {
1680
- "Promise": {
1681
- "location": "global",
1682
- "id": "global::Promise"
1683
- },
1684
- "Date": {
1685
- "location": "global",
1686
- "id": "global::Date"
1687
- }
1688
- },
1689
- "return": "Promise<void>"
1690
- },
1691
- "docs": {
1692
- "text": "",
1693
- "tags": [{
1694
- "name": "internal",
1695
- "text": "Used to enable other components to invoke an IcChange event from the input."
1696
- }]
1697
- }
1698
- }
1699
- };
1700
- }
1701
- static get elementRef() { return "el"; }
1702
- static get watchers() {
1703
- return [{
1704
- "propName": "max",
1705
- "methodName": "watchMaxHandler"
1706
- }, {
1707
- "propName": "min",
1708
- "methodName": "watchMinHandler"
1709
- }];
1710
- }
1711
- }
1712
- //# sourceMappingURL=ic-date-input.js.map