@ukic/canary-web-components 2.0.0-canary.7 → 2.0.0-canary.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (449) 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-00b08718.js → helpers-7a069459.js} +8 -3
  5. package/dist/cjs/helpers-7a069459.js.map +1 -0
  6. package/dist/cjs/helpers-f75cf7cf.js +280 -0
  7. package/dist/cjs/helpers-f75cf7cf.js.map +1 -0
  8. package/dist/cjs/ic-accordion-group.cjs.entry.js +6 -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 +4 -3
  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 +29 -12
  18. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-card.cjs.entry.js +5 -6
  20. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  21. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-data-entity.cjs.entry.js +3 -6
  25. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-data-row.cjs.entry.js +21 -35
  27. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  28. package/dist/cjs/ic-date-input.cjs.entry.js +1073 -0
  29. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -0
  30. package/dist/cjs/ic-date-picker.cjs.entry.js +1043 -0
  31. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -0
  32. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  34. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +150 -0
  41. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -0
  42. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +2599 -0
  46. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -0
  47. package/dist/cjs/{ic-input-component-container_3.cjs.entry.js → ic-menu.cjs.entry.js} +8 -70
  48. package/dist/cjs/ic-menu.cjs.entry.js.map +1 -0
  49. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  50. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  51. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-pagination-bar.cjs.entry.js +2 -18
  55. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -1
  56. package/dist/cjs/ic-pagination_4.cjs.entry.js +21 -13
  57. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  60. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  62. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  63. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  64. package/dist/cjs/ic-select-with-multi.cjs.entry.js +824 -0
  65. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -0
  66. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  73. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  74. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  75. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  76. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +184 -0
  77. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -0
  78. package/dist/cjs/ic-toggle-button.cjs.entry.js +6 -3
  79. package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
  80. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  81. package/dist/cjs/ic-typography.cjs.entry.js +1 -1
  82. package/dist/cjs/index-4cf27b16.js +24 -4
  83. package/dist/cjs/loader.cjs.js +1 -1
  84. package/dist/collection/assets/calendar.svg +3 -0
  85. package/dist/collection/collection-manifest.json +6 -1
  86. package/dist/collection/components/ic-date-input/ic-date-input.css +560 -0
  87. package/dist/collection/components/ic-date-input/ic-date-input.js +1668 -0
  88. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -0
  89. package/dist/collection/components/ic-date-input/story-data.js +28 -0
  90. package/dist/collection/components/ic-date-input/story-data.js.map +1 -0
  91. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +1156 -0
  92. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -0
  93. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js +42 -0
  94. package/dist/collection/components/ic-date-input/test/helpers/ic-date-input.js.map +1 -0
  95. package/dist/collection/components/ic-date-picker/ic-date-picker.css +878 -0
  96. package/dist/collection/components/ic-date-picker/ic-date-picker.js +1499 -0
  97. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -0
  98. package/dist/collection/components/ic-date-picker/ic-day-button.js +36 -0
  99. package/dist/collection/components/ic-date-picker/ic-day-button.js.map +1 -0
  100. package/dist/collection/components/ic-date-picker/ic-month-picker.js +29 -0
  101. package/dist/collection/components/ic-date-picker/ic-month-picker.js.map +1 -0
  102. package/dist/collection/components/ic-date-picker/ic-year-picker.js +39 -0
  103. package/dist/collection/components/ic-date-picker/ic-year-picker.js.map +1 -0
  104. package/dist/collection/components/ic-date-picker/story-data.js +143 -0
  105. package/dist/collection/components/ic-date-picker/story-data.js.map +1 -0
  106. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js +13 -0
  107. package/dist/collection/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.js.map +1 -0
  108. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js +207 -0
  109. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker-utils.spec.js.map +1 -0
  110. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +962 -0
  111. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -0
  112. package/dist/collection/components/ic-menu-with-multi/ic-menu.css +701 -0
  113. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +1458 -0
  114. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -0
  115. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +880 -0
  116. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -0
  117. package/dist/collection/components/ic-select-with-multi/assets/Check.svg +3 -0
  118. package/dist/collection/components/ic-select-with-multi/assets/Clear.svg +3 -0
  119. package/dist/collection/components/ic-select-with-multi/assets/Expand.svg +3 -0
  120. package/dist/collection/components/ic-select-with-multi/ic-select.css +693 -0
  121. package/dist/collection/components/ic-select-with-multi/ic-select.js +1649 -0
  122. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -0
  123. package/dist/collection/components/ic-select-with-multi/story-data.js +216 -0
  124. package/dist/collection/components/ic-select-with-multi/story-data.js.map +1 -0
  125. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js +146 -0
  126. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js.map +1 -0
  127. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js +2040 -0
  128. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js.map +1 -0
  129. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js +1518 -0
  130. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js.map +1 -0
  131. package/dist/collection/utils/constants.js +83 -0
  132. package/dist/collection/utils/constants.js.map +1 -0
  133. package/dist/collection/utils/date-helpers.js +133 -0
  134. package/dist/collection/utils/date-helpers.js.map +1 -0
  135. package/dist/collection/utils/helpers.js +417 -5
  136. package/dist/collection/utils/helpers.js.map +1 -1
  137. package/dist/collection/utils/types.js +58 -0
  138. package/dist/collection/utils/types.js.map +1 -0
  139. package/dist/components/helpers.js +8 -3
  140. package/dist/components/helpers.js.map +1 -1
  141. package/dist/components/helpers2.js +262 -0
  142. package/dist/components/helpers2.js.map +1 -0
  143. package/dist/components/ic-accordion-group.js +7 -2
  144. package/dist/components/ic-accordion-group.js.map +1 -1
  145. package/dist/components/ic-badge.js +3 -2
  146. package/dist/components/ic-badge.js.map +1 -1
  147. package/dist/components/ic-button2.js +32 -13
  148. package/dist/components/ic-button2.js.map +1 -1
  149. package/dist/components/ic-card.js +6 -19
  150. package/dist/components/ic-card.js.map +1 -1
  151. package/dist/components/ic-checkbox-group.js +1 -1
  152. package/dist/components/ic-checkbox.js +1 -1
  153. package/dist/components/ic-chip.js +1 -1
  154. package/dist/components/ic-data-entity.js +3 -6
  155. package/dist/components/ic-data-entity.js.map +1 -1
  156. package/dist/components/ic-data-row.js +20 -34
  157. package/dist/components/ic-data-row.js.map +1 -1
  158. package/dist/components/ic-date-input.d.ts +11 -0
  159. package/dist/components/ic-date-input.js +8 -0
  160. package/dist/components/ic-date-input.js.map +1 -0
  161. package/dist/components/ic-date-input2.js +1301 -0
  162. package/dist/components/ic-date-input2.js.map +1 -0
  163. package/dist/components/ic-date-picker.d.ts +11 -0
  164. package/dist/components/ic-date-picker.js +1164 -0
  165. package/dist/components/ic-date-picker.js.map +1 -0
  166. package/dist/components/ic-input-component-container2.js +7 -6
  167. package/dist/components/ic-input-component-container2.js.map +1 -1
  168. package/dist/components/ic-link2.js +1 -1
  169. package/dist/components/ic-menu-item2.js +1 -1
  170. package/dist/components/ic-menu-with-multi.d.ts +11 -0
  171. package/dist/components/ic-menu-with-multi.js +8 -0
  172. package/dist/components/ic-menu-with-multi.js.map +1 -0
  173. package/dist/components/ic-menu2.js +5 -4
  174. package/dist/components/ic-menu2.js.map +1 -1
  175. package/dist/components/ic-menu3.js +2665 -0
  176. package/dist/components/ic-menu3.js.map +1 -0
  177. package/dist/components/ic-navigation-button.js +1 -1
  178. package/dist/components/ic-pagination-bar2.js +1 -17
  179. package/dist/components/ic-pagination-bar2.js.map +1 -1
  180. package/dist/components/ic-pagination-item2.js +1 -1
  181. package/dist/components/ic-pagination2.js +1 -1
  182. package/dist/components/ic-popover-menu.js +1 -1
  183. package/dist/components/ic-popover-menu.js.map +1 -1
  184. package/dist/components/ic-radio-group.js +1 -1
  185. package/dist/components/ic-radio-option.js +1 -1
  186. package/dist/components/ic-search-bar.js +1 -1
  187. package/dist/components/ic-search-bar.js.map +1 -1
  188. package/dist/components/ic-select-with-multi.d.ts +11 -0
  189. package/dist/components/ic-select-with-multi.js +949 -0
  190. package/dist/components/ic-select-with-multi.js.map +1 -0
  191. package/dist/components/ic-select2.js +23 -14
  192. package/dist/components/ic-select2.js.map +1 -1
  193. package/dist/components/ic-switch.js +1 -1
  194. package/dist/components/ic-tab.js +1 -1
  195. package/dist/components/ic-text-field2.js +1 -1
  196. package/dist/components/ic-toggle-button-group.js +210 -0
  197. package/dist/components/ic-toggle-button-group.js.map +1 -0
  198. package/dist/components/ic-toggle-button.js +6 -3
  199. package/dist/components/ic-toggle-button.js.map +1 -1
  200. package/dist/core/core.css +8 -5
  201. package/dist/core/core.esm.js +1 -1
  202. package/dist/core/core.esm.js.map +1 -1
  203. package/dist/core/{p-5e94fae8.entry.js → p-06ae5bec.entry.js} +2 -2
  204. package/dist/core/p-06ae5bec.entry.js.map +1 -0
  205. package/dist/core/{p-d5cc084b.entry.js → p-0939ce92.entry.js} +2 -2
  206. package/dist/core/{p-d5cc084b.entry.js.map → p-0939ce92.entry.js.map} +1 -1
  207. package/dist/core/{p-6de46cb7.entry.js → p-16f67397.entry.js} +2 -2
  208. package/dist/core/p-16f67397.entry.js.map +1 -0
  209. package/dist/core/{p-a2f366c7.entry.js → p-1832f4b5.entry.js} +2 -2
  210. package/dist/core/{p-28fb7cca.entry.js → p-1b7d426b.entry.js} +2 -2
  211. package/dist/core/p-1b7d426b.entry.js.map +1 -0
  212. package/dist/core/{p-ff1d23cd.entry.js → p-1ce75941.entry.js} +2 -2
  213. package/dist/core/{p-5746577f.entry.js → p-2e2e0099.entry.js} +2 -2
  214. package/dist/core/p-33679c06.entry.js +2 -0
  215. package/dist/core/p-33679c06.entry.js.map +1 -0
  216. package/dist/core/{p-ca262cdc.entry.js → p-36508aad.entry.js} +2 -2
  217. package/dist/core/{p-7276339a.entry.js → p-3745da83.entry.js} +2 -2
  218. package/dist/core/{p-b43bd4f3.entry.js → p-3f2e77c3.entry.js} +2 -2
  219. package/dist/core/{p-24945ee5.entry.js → p-452985d9.entry.js} +2 -2
  220. package/dist/core/p-452985d9.entry.js.map +1 -0
  221. package/dist/core/{p-3c859b9e.entry.js → p-47ac6838.entry.js} +2 -2
  222. package/dist/core/{p-3d2fcf84.entry.js → p-4f1ffa39.entry.js} +2 -2
  223. package/dist/core/{p-4df42c76.entry.js → p-5759d771.entry.js} +2 -2
  224. package/dist/core/{p-32f18701.entry.js → p-5e2e6c3b.entry.js} +2 -2
  225. package/dist/core/{p-f436630b.entry.js → p-5fe96107.entry.js} +2 -2
  226. package/dist/core/{p-7dfd61bb.entry.js → p-62e22508.entry.js} +2 -2
  227. package/dist/core/{p-d49660e0.entry.js → p-6690bc04.entry.js} +2 -2
  228. package/dist/core/{p-f827e4c0.entry.js → p-6c0e2ceb.entry.js} +2 -2
  229. package/dist/core/{p-a3ab9f4c.entry.js → p-76915584.entry.js} +2 -2
  230. package/dist/core/p-76915584.entry.js.map +1 -0
  231. package/dist/core/{p-966ab920.entry.js → p-76d26018.entry.js} +2 -2
  232. package/dist/core/{p-79b71c18.entry.js → p-776671cf.entry.js} +2 -2
  233. package/dist/core/{p-434780c8.entry.js → p-7cecf5d5.entry.js} +2 -2
  234. package/dist/core/{p-88971cea.entry.js → p-85609bdd.entry.js} +2 -2
  235. package/dist/core/{p-95d3cd52.entry.js → p-86012178.entry.js} +2 -2
  236. package/dist/core/{p-2094c844.entry.js → p-8a7e7d23.entry.js} +2 -2
  237. package/dist/core/{p-aafb2c79.entry.js → p-8c90110a.entry.js} +2 -2
  238. package/dist/core/{p-9ce5f082.entry.js → p-8ea47d42.entry.js} +2 -2
  239. package/dist/core/{p-0d181ac8.entry.js → p-982a6e88.entry.js} +2 -2
  240. package/dist/core/{p-3b9f3a07.entry.js → p-98448bdb.entry.js} +2 -2
  241. package/dist/core/{p-c263542a.entry.js → p-9d01a7ad.entry.js} +2 -2
  242. package/dist/core/{p-051b8266.entry.js → p-9d540656.entry.js} +2 -2
  243. package/dist/core/p-9e3178e8.entry.js +2 -0
  244. package/dist/core/p-9e3178e8.entry.js.map +1 -0
  245. package/dist/core/{p-9fd84c69.entry.js → p-a0f9b259.entry.js} +2 -2
  246. package/dist/core/{p-7632acc6.entry.js → p-a42c2f37.entry.js} +2 -2
  247. package/dist/core/{p-fbb1fba0.entry.js → p-a6447b13.entry.js} +2 -2
  248. package/dist/core/p-aabab75f.entry.js +2 -0
  249. package/dist/core/p-aabab75f.entry.js.map +1 -0
  250. package/dist/core/{p-116b18fe.entry.js → p-ae422058.entry.js} +2 -2
  251. package/dist/core/{p-a7d52bd1.entry.js → p-b306cbc8.entry.js} +2 -2
  252. package/dist/core/p-c7590421.entry.js +2 -0
  253. package/dist/core/p-c7590421.entry.js.map +1 -0
  254. package/dist/core/{p-a162744e.entry.js → p-c7820c23.entry.js} +2 -2
  255. package/dist/core/{p-a162744e.entry.js.map → p-c7820c23.entry.js.map} +1 -1
  256. package/dist/core/{p-d78fd9f3.entry.js → p-ca8cbd6a.entry.js} +2 -2
  257. package/dist/core/{p-da4f0a58.entry.js → p-caf857de.entry.js} +2 -2
  258. package/dist/core/p-cc7bc438.entry.js +2 -0
  259. package/dist/core/p-cc7bc438.entry.js.map +1 -0
  260. package/dist/core/p-cd799087.js +2 -0
  261. package/dist/core/p-cd799087.js.map +1 -0
  262. package/dist/core/p-d32692e2.entry.js +2 -0
  263. package/dist/core/p-d32692e2.entry.js.map +1 -0
  264. package/dist/core/p-d35c7c18.js +2 -0
  265. package/dist/core/p-d35c7c18.js.map +1 -0
  266. package/dist/core/{p-27aa95e7.entry.js → p-d3856ed3.entry.js} +2 -2
  267. package/dist/core/{p-c345a874.entry.js → p-d4fdd8c1.entry.js} +2 -2
  268. package/dist/core/{p-337b6e05.entry.js → p-d5c99ec3.entry.js} +2 -2
  269. package/dist/core/p-e473bbf8.entry.js +2 -0
  270. package/dist/core/p-e473bbf8.entry.js.map +1 -0
  271. package/dist/core/p-e74f1d09.entry.js +2 -0
  272. package/dist/core/p-e74f1d09.entry.js.map +1 -0
  273. package/dist/core/p-e79e0292.entry.js +2 -0
  274. package/dist/core/p-e79e0292.entry.js.map +1 -0
  275. package/dist/core/{p-0f0509ee.entry.js → p-e84b0310.entry.js} +2 -2
  276. package/dist/core/p-e84b0310.entry.js.map +1 -0
  277. package/dist/core/{p-93c5b849.entry.js → p-f55ad6ae.entry.js} +2 -2
  278. package/dist/core/p-f8cf2978.js +2 -0
  279. package/dist/core/p-f8cf2978.js.map +1 -0
  280. package/dist/core/p-f91527a0.entry.js +2 -0
  281. package/dist/core/p-f91527a0.entry.js.map +1 -0
  282. package/dist/core/{p-d9342548.entry.js → p-fbf4e9b7.entry.js} +2 -2
  283. package/dist/esm/core.js +1 -1
  284. package/dist/esm/date-helpers-4f432e92.js +136 -0
  285. package/dist/esm/date-helpers-4f432e92.js.map +1 -0
  286. package/dist/esm/{helpers-d06dc4ed.js → helpers-7aa21b0a.js} +8 -3
  287. package/dist/esm/helpers-7aa21b0a.js.map +1 -0
  288. package/dist/esm/helpers-f328a7b6.js +262 -0
  289. package/dist/esm/helpers-f328a7b6.js.map +1 -0
  290. package/dist/esm/ic-accordion-group.entry.js +6 -2
  291. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  292. package/dist/esm/ic-accordion.entry.js +1 -1
  293. package/dist/esm/ic-alert.entry.js +1 -1
  294. package/dist/esm/ic-back-to-top.entry.js +1 -1
  295. package/dist/esm/ic-badge.entry.js +4 -3
  296. package/dist/esm/ic-badge.entry.js.map +1 -1
  297. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  298. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  299. package/dist/esm/ic-button_3.entry.js +29 -12
  300. package/dist/esm/ic-button_3.entry.js.map +1 -1
  301. package/dist/esm/ic-card.entry.js +5 -6
  302. package/dist/esm/ic-card.entry.js.map +1 -1
  303. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  304. package/dist/esm/ic-checkbox.entry.js +1 -1
  305. package/dist/esm/ic-chip.entry.js +1 -1
  306. package/dist/esm/ic-data-entity.entry.js +3 -6
  307. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  308. package/dist/esm/ic-data-row.entry.js +21 -35
  309. package/dist/esm/ic-data-row.entry.js.map +1 -1
  310. package/dist/esm/ic-date-input.entry.js +1069 -0
  311. package/dist/esm/ic-date-input.entry.js.map +1 -0
  312. package/dist/esm/ic-date-picker.entry.js +1039 -0
  313. package/dist/esm/ic-date-picker.entry.js.map +1 -0
  314. package/dist/esm/ic-dialog.entry.js +1 -1
  315. package/dist/esm/ic-divider.entry.js +1 -1
  316. package/dist/esm/ic-empty-state.entry.js +1 -1
  317. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  318. package/dist/esm/ic-footer-link.entry.js +1 -1
  319. package/dist/esm/ic-footer.entry.js +1 -1
  320. package/dist/esm/ic-hero.entry.js +1 -1
  321. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  322. package/dist/esm/ic-input-component-container_4.entry.js +143 -0
  323. package/dist/esm/ic-input-component-container_4.entry.js.map +1 -0
  324. package/dist/esm/ic-link.entry.js +1 -1
  325. package/dist/esm/ic-menu-group.entry.js +1 -1
  326. package/dist/esm/ic-menu-item.entry.js +1 -1
  327. package/dist/esm/ic-menu-with-multi.entry.js +2595 -0
  328. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -0
  329. package/dist/esm/{ic-input-component-container_3.entry.js → ic-menu.entry.js} +10 -70
  330. package/dist/esm/ic-menu.entry.js.map +1 -0
  331. package/dist/esm/ic-navigation-button.entry.js +1 -1
  332. package/dist/esm/ic-navigation-group.entry.js +1 -1
  333. package/dist/esm/ic-navigation-item.entry.js +1 -1
  334. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  335. package/dist/esm/ic-page-header.entry.js +1 -1
  336. package/dist/esm/ic-pagination-bar.entry.js +1 -17
  337. package/dist/esm/ic-pagination-bar.entry.js.map +1 -1
  338. package/dist/esm/ic-pagination_4.entry.js +21 -13
  339. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  340. package/dist/esm/ic-popover-menu.entry.js +1 -1
  341. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  342. package/dist/esm/ic-radio-group.entry.js +1 -1
  343. package/dist/esm/ic-radio-option.entry.js +1 -1
  344. package/dist/esm/ic-search-bar.entry.js +1 -1
  345. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  346. package/dist/esm/ic-select-with-multi.entry.js +820 -0
  347. package/dist/esm/ic-select-with-multi.entry.js.map +1 -0
  348. package/dist/esm/ic-side-navigation.entry.js +1 -1
  349. package/dist/esm/ic-status-tag.entry.js +1 -1
  350. package/dist/esm/ic-step.entry.js +1 -1
  351. package/dist/esm/ic-stepper.entry.js +1 -1
  352. package/dist/esm/ic-switch.entry.js +1 -1
  353. package/dist/esm/ic-tab-group.entry.js +1 -1
  354. package/dist/esm/ic-tab-panel.entry.js +1 -1
  355. package/dist/esm/ic-tab.entry.js +1 -1
  356. package/dist/esm/ic-theme.entry.js +1 -1
  357. package/dist/esm/ic-toast.entry.js +1 -1
  358. package/dist/esm/ic-toggle-button-group.entry.js +180 -0
  359. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -0
  360. package/dist/esm/ic-toggle-button.entry.js +6 -3
  361. package/dist/esm/ic-toggle-button.entry.js.map +1 -1
  362. package/dist/esm/ic-top-navigation.entry.js +1 -1
  363. package/dist/esm/ic-typography.entry.js +1 -1
  364. package/dist/esm/index-93509377.js +24 -4
  365. package/dist/esm/loader.js +1 -1
  366. package/dist/types/components/ic-date-input/ic-date-input.d.ts +242 -0
  367. package/dist/types/components/ic-date-input/story-data.d.ts +1 -0
  368. package/dist/types/components/ic-date-input/test/helpers/ic-date-input.d.ts +23 -0
  369. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +251 -0
  370. package/dist/types/components/ic-date-picker/ic-day-button.d.ts +16 -0
  371. package/dist/types/components/ic-date-picker/ic-month-picker.d.ts +14 -0
  372. package/dist/types/components/ic-date-picker/ic-year-picker.d.ts +16 -0
  373. package/dist/types/components/ic-date-picker/story-data.d.ts +22 -0
  374. package/dist/types/components/ic-date-picker/test/a11y/ic-date-picker.test.a11y.d.ts +1 -0
  375. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +208 -0
  376. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +289 -0
  377. package/dist/types/components/ic-select-with-multi/story-data.d.ts +32 -0
  378. package/dist/types/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.d.ts +1 -0
  379. package/dist/types/components.d.ts +966 -0
  380. package/dist/types/utils/constants.d.ts +38 -0
  381. package/dist/types/utils/date-helpers.d.ts +22 -0
  382. package/dist/types/utils/helpers.d.ts +133 -2
  383. package/dist/types/utils/types.d.ts +107 -0
  384. package/hydrate/index.js +12358 -6070
  385. package/package.json +3 -3
  386. package/dist/cjs/helpers-00b08718.js.map +0 -1
  387. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +0 -1
  388. package/dist/cjs/ic-input-label_2.cjs.entry.js +0 -86
  389. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +0 -1
  390. package/dist/core/p-0f0509ee.entry.js.map +0 -1
  391. package/dist/core/p-24945ee5.entry.js.map +0 -1
  392. package/dist/core/p-28fb7cca.entry.js.map +0 -1
  393. package/dist/core/p-2aad58b6.js +0 -2
  394. package/dist/core/p-2aad58b6.js.map +0 -1
  395. package/dist/core/p-38314d45.entry.js +0 -2
  396. package/dist/core/p-38314d45.entry.js.map +0 -1
  397. package/dist/core/p-5e94fae8.entry.js.map +0 -1
  398. package/dist/core/p-6de46cb7.entry.js.map +0 -1
  399. package/dist/core/p-7b849cb5.entry.js +0 -2
  400. package/dist/core/p-7b849cb5.entry.js.map +0 -1
  401. package/dist/core/p-9fdd7d73.entry.js +0 -2
  402. package/dist/core/p-9fdd7d73.entry.js.map +0 -1
  403. package/dist/core/p-a3ab9f4c.entry.js.map +0 -1
  404. package/dist/core/p-c9b11488.entry.js +0 -2
  405. package/dist/core/p-c9b11488.entry.js.map +0 -1
  406. package/dist/core/p-f163a406.entry.js +0 -2
  407. package/dist/core/p-f163a406.entry.js.map +0 -1
  408. package/dist/esm/helpers-d06dc4ed.js.map +0 -1
  409. package/dist/esm/ic-input-component-container_3.entry.js.map +0 -1
  410. package/dist/esm/ic-input-label_2.entry.js +0 -81
  411. package/dist/esm/ic-input-label_2.entry.js.map +0 -1
  412. /package/dist/core/{p-a2f366c7.entry.js.map → p-1832f4b5.entry.js.map} +0 -0
  413. /package/dist/core/{p-ff1d23cd.entry.js.map → p-1ce75941.entry.js.map} +0 -0
  414. /package/dist/core/{p-5746577f.entry.js.map → p-2e2e0099.entry.js.map} +0 -0
  415. /package/dist/core/{p-ca262cdc.entry.js.map → p-36508aad.entry.js.map} +0 -0
  416. /package/dist/core/{p-7276339a.entry.js.map → p-3745da83.entry.js.map} +0 -0
  417. /package/dist/core/{p-b43bd4f3.entry.js.map → p-3f2e77c3.entry.js.map} +0 -0
  418. /package/dist/core/{p-3c859b9e.entry.js.map → p-47ac6838.entry.js.map} +0 -0
  419. /package/dist/core/{p-3d2fcf84.entry.js.map → p-4f1ffa39.entry.js.map} +0 -0
  420. /package/dist/core/{p-4df42c76.entry.js.map → p-5759d771.entry.js.map} +0 -0
  421. /package/dist/core/{p-32f18701.entry.js.map → p-5e2e6c3b.entry.js.map} +0 -0
  422. /package/dist/core/{p-f436630b.entry.js.map → p-5fe96107.entry.js.map} +0 -0
  423. /package/dist/core/{p-7dfd61bb.entry.js.map → p-62e22508.entry.js.map} +0 -0
  424. /package/dist/core/{p-d49660e0.entry.js.map → p-6690bc04.entry.js.map} +0 -0
  425. /package/dist/core/{p-f827e4c0.entry.js.map → p-6c0e2ceb.entry.js.map} +0 -0
  426. /package/dist/core/{p-966ab920.entry.js.map → p-76d26018.entry.js.map} +0 -0
  427. /package/dist/core/{p-79b71c18.entry.js.map → p-776671cf.entry.js.map} +0 -0
  428. /package/dist/core/{p-434780c8.entry.js.map → p-7cecf5d5.entry.js.map} +0 -0
  429. /package/dist/core/{p-88971cea.entry.js.map → p-85609bdd.entry.js.map} +0 -0
  430. /package/dist/core/{p-95d3cd52.entry.js.map → p-86012178.entry.js.map} +0 -0
  431. /package/dist/core/{p-2094c844.entry.js.map → p-8a7e7d23.entry.js.map} +0 -0
  432. /package/dist/core/{p-aafb2c79.entry.js.map → p-8c90110a.entry.js.map} +0 -0
  433. /package/dist/core/{p-9ce5f082.entry.js.map → p-8ea47d42.entry.js.map} +0 -0
  434. /package/dist/core/{p-0d181ac8.entry.js.map → p-982a6e88.entry.js.map} +0 -0
  435. /package/dist/core/{p-3b9f3a07.entry.js.map → p-98448bdb.entry.js.map} +0 -0
  436. /package/dist/core/{p-c263542a.entry.js.map → p-9d01a7ad.entry.js.map} +0 -0
  437. /package/dist/core/{p-051b8266.entry.js.map → p-9d540656.entry.js.map} +0 -0
  438. /package/dist/core/{p-9fd84c69.entry.js.map → p-a0f9b259.entry.js.map} +0 -0
  439. /package/dist/core/{p-7632acc6.entry.js.map → p-a42c2f37.entry.js.map} +0 -0
  440. /package/dist/core/{p-fbb1fba0.entry.js.map → p-a6447b13.entry.js.map} +0 -0
  441. /package/dist/core/{p-116b18fe.entry.js.map → p-ae422058.entry.js.map} +0 -0
  442. /package/dist/core/{p-a7d52bd1.entry.js.map → p-b306cbc8.entry.js.map} +0 -0
  443. /package/dist/core/{p-d78fd9f3.entry.js.map → p-ca8cbd6a.entry.js.map} +0 -0
  444. /package/dist/core/{p-da4f0a58.entry.js.map → p-caf857de.entry.js.map} +0 -0
  445. /package/dist/core/{p-27aa95e7.entry.js.map → p-d3856ed3.entry.js.map} +0 -0
  446. /package/dist/core/{p-c345a874.entry.js.map → p-d4fdd8c1.entry.js.map} +0 -0
  447. /package/dist/core/{p-337b6e05.entry.js.map → p-d5c99ec3.entry.js.map} +0 -0
  448. /package/dist/core/{p-93c5b849.entry.js.map → p-f55ad6ae.entry.js.map} +0 -0
  449. /package/dist/core/{p-d9342548.entry.js.map → p-fbf4e9b7.entry.js.map} +0 -0
@@ -0,0 +1,824 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-4cf27b16.js');
6
+ const helpers = require('./helpers-f75cf7cf.js');
7
+
8
+ // Global ARIA attributes
9
+ const IC_INHERITED_ARIA = [
10
+ "aria-atomic",
11
+ "aria-autocomplete",
12
+ "aria-busy",
13
+ "aria-controls",
14
+ "aria-current",
15
+ "aria-describedby",
16
+ "aria-description",
17
+ "aria-details",
18
+ "aria-disabled",
19
+ "aria-dropeffect",
20
+ "aria-errormessage",
21
+ "aria-expanded",
22
+ "aria-flowto",
23
+ "aria-grabbed",
24
+ "aria-haspopup",
25
+ "aria-hidden",
26
+ "aria-invalid",
27
+ "aria-keyshortcuts",
28
+ "aria-label",
29
+ "aria-labelledby",
30
+ "aria-live",
31
+ "aria-owns",
32
+ "aria-relevant",
33
+ "aria-roledescription",
34
+ ];
35
+
36
+ const Expand = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
37
+ <path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />
38
+ </svg>
39
+ `;
40
+
41
+ const Clear = `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
42
+ <path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />
43
+ </svg>
44
+ `;
45
+
46
+ const icSelectCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative;--menu-max-height:100px}:host(.full-width){width:100%}ic-input-component-container:hover{--border-color:var(--ic-action-dark-hover)}ic-input-component-container:active{--border-color:var(--ic-action-dark-active);color:var(--ic-action-dark-active)}ic-input-component-container.menu-open{--border-color:var(--ic-architectural-400);color:var(--ic-action-dark)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs) !important}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:url(\"data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>\")}select option,.select-option-selected{color:var(--ic-color-primary-text)}select:disabled{color:var(--ic-architectural-200);background-image:url(\"data:image/svg+xml;utf8,<svg fill='grey' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>\")}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none}.select-input:focus{outline:var(--ic-hc-focus-outline)}:host(:not(.disabled)) ic-input-component-container:hover .select-input{background-color:var(--ic-architectural-white)}.select-input[disabled]{pointer-events:none}:host(.searchable) .select-input{cursor:auto}.select-input.with-clear-button{padding-right:0}.value-text{max-width:calc(100% - (var(--ic-space-lg) + var(--ic-space-xxs)));box-sizing:border-box}.value-text.with-clear-button{padding-right:calc(var(--ic-space-xl) + var(--ic-space-xs))}.value-text p{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:0 !important}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xxs);color:var(--ic-action-dark)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.disabled) .expand-icon,:host(.disabled) .expand-icon>svg>path{color:var(--ic-architectural-200)}:host(.searchable) .expand-icon{padding-left:0;height:2.25rem}:host(.searchable) .expand-icon>svg{height:2.25rem;padding:0 0.375rem}:host(.searchable:not(.disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-action-dark)}.expand-icon-open,:host(.searchable) .expand-icon-open{transform:rotateX(180deg)}:host(.disabled) .value-text,.placeholder{color:var(--ic-color-tertiary-text)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex}.divider{width:var(--ic-space-1px);background-color:var(--ic-architectural-400);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.small) .divider{height:var(--ic-space-md)}:host(.large) .divider{height:var(--ic-space-xl)}.clear-button{position:absolute;right:calc(var(--ic-space-xl) + var(--ic-space-xxs));border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus{background-color:var(--ic-focus-blue);box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow);border-radius:0.25rem}.clear-button:focus *{fill:white}.clear-button.searchable{position:static}.searchable-select-results-status,.multi-select-selected-count{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}";
47
+
48
+ let inputIds = 0;
49
+ const Select = class {
50
+ constructor(hostRef) {
51
+ index.registerInstance(this, hostRef);
52
+ this.icBlur = index.createEvent(this, "icBlur", 7);
53
+ this.icChange = index.createEvent(this, "icChange", 7);
54
+ this.icClear = index.createEvent(this, "icClear", 7);
55
+ this.icFocus = index.createEvent(this, "icFocus", 7);
56
+ this.icInput = index.createEvent(this, "icInput", 7);
57
+ this.icOptionSelect = index.createEvent(this, "icOptionSelect", 7);
58
+ this.icOptionDeselect = index.createEvent(this, "icOptionDeselect", 7);
59
+ this.icRetryLoad = index.createEvent(this, "icRetryLoad", 7);
60
+ this.hasSetDefaultValue = false;
61
+ this.inheritedAttributes = {};
62
+ this.initialOptionsEmpty = false;
63
+ this.inputId = `ic-select-input-${inputIds++}`;
64
+ this.menuId = `${this.inputId}-menu`;
65
+ this.searchableMenuItemSelected = false;
66
+ this.ungroupedOptions = [];
67
+ this.handleRetry = (ev) => {
68
+ var _a;
69
+ if (ev.detail.keyPressed)
70
+ (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
71
+ this.blurredBecauseButtonPressed = true;
72
+ this.retryButtonClick = true;
73
+ this.hasSetDefaultValue = true;
74
+ this.icRetryLoad.emit({ value: this.hiddenInputValue });
75
+ };
76
+ this.emitIcChange = (value) => {
77
+ if (!this.searchable) {
78
+ // If "Select all" button clicked, replace value with new value (array of all option values)
79
+ if (this.multiple && !Array.isArray(value) && value !== null) {
80
+ this.handleMultipleSelectChange(value);
81
+ }
82
+ else {
83
+ this.value = value;
84
+ }
85
+ }
86
+ clearTimeout(this.debounceIcChange);
87
+ this.debounceIcChange = window.setTimeout(() => {
88
+ const valueToEmit = this.multiple ? this.value : value;
89
+ this.icChange.emit({ value: valueToEmit });
90
+ }, this.currDebounce);
91
+ };
92
+ this.emitImmediateIcChange = (value) => {
93
+ this.value = value;
94
+ clearTimeout(this.debounceIcChange);
95
+ this.icChange.emit({ value });
96
+ };
97
+ /**
98
+ * Processes the provided array of IcMenuOptions, removing duplicates and reporting them with a console.warn
99
+ * @param options array of IcMenuOptions
100
+ * @returns a new options object, with all entries possessing a duplicate 'value' field removed
101
+ */
102
+ this.deduplicateOptions = (options) => {
103
+ const uniqueValues = [];
104
+ const dedupedOptions = [];
105
+ let dedupedChildren;
106
+ options.forEach((option) => {
107
+ if (option.children) {
108
+ //If an option has children, we will loop through them
109
+ dedupedChildren = [];
110
+ option.children.forEach((child) => {
111
+ if (uniqueValues.includes(child.value)) {
112
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${child.value}) which has been removed.`);
113
+ }
114
+ else {
115
+ uniqueValues.push(child.value);
116
+ dedupedChildren.push(child);
117
+ }
118
+ });
119
+ // construct a modified option, inserting the deduplicated children alongside the original information
120
+ const modifiedParent = Object.assign(Object.assign({}, option), { children: dedupedChildren });
121
+ dedupedOptions.push(modifiedParent);
122
+ }
123
+ else {
124
+ // If an option does not have children, assess to see if it's value has been included already
125
+ if (uniqueValues.includes(option.value)) {
126
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
127
+ }
128
+ else {
129
+ uniqueValues.push(option.value);
130
+ dedupedOptions.push(option);
131
+ }
132
+ }
133
+ });
134
+ return dedupedOptions;
135
+ };
136
+ /**
137
+ * Loop through options array and for all options with no value, infer it from the label
138
+ */
139
+ this.setOptionsValuesFromLabels = () => {
140
+ if (this.options.length > 0 && this.options.map) {
141
+ this.options.map((option) => {
142
+ if (!option.value) {
143
+ option.value = option.label;
144
+ }
145
+ });
146
+ }
147
+ };
148
+ this.setUngroupedOptions = (event) => {
149
+ this.ungroupedOptions = event.detail.options;
150
+ };
151
+ this.setTextColor = () => {
152
+ if (this.nativeSelectElement.selectedIndex === 0) {
153
+ this.nativeSelectElement.className = "placeholder";
154
+ }
155
+ else {
156
+ this.nativeSelectElement.className = "select-option-selected";
157
+ }
158
+ };
159
+ this.setMenuChange = (open) => {
160
+ if (this.open !== open) {
161
+ this.open = open;
162
+ }
163
+ };
164
+ this.getLabelFromValue = (value) => {
165
+ return helpers.getLabelFromValue(value, this.uniqueOptions);
166
+ };
167
+ this.getMultipleOptionsString = (selectedValues) => {
168
+ const selectedLabels = selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.map((value) => this.getLabelFromValue(value));
169
+ return selectedLabels === null || selectedLabels === void 0 ? void 0 : selectedLabels.join(", ");
170
+ };
171
+ this.getFilteredChildMenuOptions = (option) => {
172
+ let children = option.children;
173
+ if (this.searchable) {
174
+ children = helpers.getFilteredMenuOptions(option.children, this.includeDescriptionsInSearch, this.searchableSelectInputValue, this.searchMatchPosition);
175
+ }
176
+ else {
177
+ children = helpers.getFilteredMenuOptions(option.children, false, this.pressedCharacters, "start");
178
+ }
179
+ const newOption = Object.assign({}, option);
180
+ newOption.children = children;
181
+ return newOption;
182
+ };
183
+ // (For multi-select) get value array, i.e. selected option values, in order they appear in option list
184
+ this.getValueSortedByOptions = (value) => {
185
+ const valueArray = value;
186
+ const valuesFromAllOptions = this.ungroupedOptions.map((option) => option.value);
187
+ valueArray.sort((a, b) => valuesFromAllOptions.indexOf(a) - valuesFromAllOptions.indexOf(b));
188
+ return valueArray;
189
+ };
190
+ this.handleNativeSelectChange = () => {
191
+ this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
192
+ this.emitImmediateIcChange(this.nativeSelectElement.value);
193
+ this.setTextColor();
194
+ };
195
+ // Handle option select for when a custom input box and menu is rendered
196
+ // (rather than native <select> - rendered when viewed on a mobile / tablet screen)
197
+ this.handleCustomSelectChange = (event) => {
198
+ var _a;
199
+ const value = event.detail.value;
200
+ if (this.searchable && event.detail.label === this.emptyOptionListText) {
201
+ this.searchableSelectElement.focus();
202
+ return;
203
+ }
204
+ if (this.searchable) {
205
+ this.value = value;
206
+ this.searchableMenuItemSelected = true;
207
+ // After editing the input, if selecting the same option as before, set the input value to label again
208
+ if (this.value === this.currValue) {
209
+ this.searchableSelectInputValue = this.getLabelFromValue(this.value);
210
+ }
211
+ this.inputValueToFilter = null;
212
+ this.hiddenInputValue = this.getValueFromLabel(this.searchableSelectInputValue);
213
+ }
214
+ if (this.multiple && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.includes(value))) {
215
+ this.icOptionDeselect.emit({ value });
216
+ }
217
+ else {
218
+ this.icOptionSelect.emit({ value });
219
+ }
220
+ this.ariaActiveDescendant = event.detail.optionId;
221
+ this.emitIcChange(value);
222
+ };
223
+ // Update selected options - adds / removes them, in order of option list
224
+ // Create new array if value prop is undefined
225
+ this.handleMultipleSelectChange = (value) => {
226
+ if (this.value) {
227
+ let valueArray = this.value.slice();
228
+ if (this.value.includes(value)) {
229
+ const valueIndex = valueArray.indexOf(value);
230
+ valueArray.splice(valueIndex, 1);
231
+ }
232
+ else {
233
+ valueArray.push(value);
234
+ valueArray = this.getValueSortedByOptions(valueArray);
235
+ }
236
+ this.value = valueArray.length === 0 ? null : valueArray;
237
+ }
238
+ else {
239
+ const valueArray = [];
240
+ valueArray.push(value);
241
+ this.value = valueArray;
242
+ }
243
+ };
244
+ this.handleSelectAllChange = (event) => {
245
+ const selectAllOptions = event.detail.select;
246
+ const allEnabledOptions = this.ungroupedOptions.filter((option) => !option.disabled);
247
+ const allValues = allEnabledOptions.map((option) => option.value);
248
+ let newValue;
249
+ if (selectAllOptions) {
250
+ let unselectedValues;
251
+ // Only emit icOptionSelect for all values that are newly selected
252
+ if (this.value) {
253
+ unselectedValues = allValues.filter((value) => this.value && !this.value.includes(value));
254
+ }
255
+ else {
256
+ unselectedValues = allValues;
257
+ }
258
+ unselectedValues.forEach((value) => this.icOptionSelect.emit({ value }));
259
+ newValue = allValues;
260
+ }
261
+ else {
262
+ // Only emit icOptionDeselect for values that were selected
263
+ this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
264
+ newValue = null;
265
+ }
266
+ this.emitIcChange(newValue);
267
+ };
268
+ this.handleMenuChange = (event) => {
269
+ this.open = event.detail.open;
270
+ this.pressedCharacters = "";
271
+ this.searchable && this.handleFocusIndicatorDisplay();
272
+ };
273
+ // clears the debounce delay when navigating the menu with arrow keys etc
274
+ // to prevent delay in change event, which should only occur when typing in input
275
+ this.handleMenuKeyPress = (ev) => {
276
+ ev.cancelBubble = true;
277
+ if (!this.multiple) {
278
+ this.handleCharacterKeyDown(ev.detail.key);
279
+ }
280
+ };
281
+ this.handleFocusIndicatorDisplay = () => {
282
+ const focusIndicator = this.el.shadowRoot.querySelector(".focus-indicator");
283
+ if (this.open) {
284
+ focusIndicator.classList.add("focus-indicator-enabled");
285
+ }
286
+ else {
287
+ focusIndicator.classList.remove("focus-indicator-enabled");
288
+ }
289
+ };
290
+ this.handleMouseDown = (event) => {
291
+ if (!this.open) {
292
+ event.preventDefault();
293
+ }
294
+ };
295
+ this.isExternalFiltering = () => this.searchable && this.disableFilter;
296
+ this.handleClick = (event) => {
297
+ var _a;
298
+ if (!this.open) {
299
+ if (this.isExternalFiltering()) {
300
+ this.menu.options = this.filteredOptions;
301
+ }
302
+ else if (!this.hasTimedOut &&
303
+ !this.loading &&
304
+ !((_a = this.noOptions) === null || _a === void 0 ? void 0 : _a.length) &&
305
+ (!this.searchable || this.searchableMenuItemSelected)) {
306
+ this.noOptions = null;
307
+ this.menu.options = this.uniqueOptions;
308
+ }
309
+ }
310
+ if (event.detail !== 0) {
311
+ this.menu.handleClickOpen();
312
+ }
313
+ };
314
+ this.handleExpandIconMouseDown = (event) => {
315
+ if (!this.disabled) {
316
+ event.preventDefault();
317
+ this.searchableSelectElement.focus();
318
+ this.handleClick(event);
319
+ }
320
+ };
321
+ this.handleClear = (event) => {
322
+ event.stopPropagation();
323
+ this.hasTimedOut = false;
324
+ clearTimeout(this.timeoutTimer);
325
+ this.noOptions = null;
326
+ this.emitImmediateIcChange(null);
327
+ this.icClear.emit();
328
+ if (this.searchable) {
329
+ this.searchableSelectElement.value = null;
330
+ this.searchableSelectInputValue = null;
331
+ this.filteredOptions = this.uniqueOptions;
332
+ this.hiddenInputValue = null;
333
+ this.searchableSelectElement.focus();
334
+ }
335
+ else {
336
+ this.customSelectElement.focus();
337
+ }
338
+ };
339
+ this.handleCharacterKeyDown = (key) => {
340
+ // Only close menu when space is pressed if not being used alongside character keys to quickly select options
341
+ if (this.open &&
342
+ key === " " &&
343
+ this.pressedCharacters.length === 0 &&
344
+ !this.hasTimedOut &&
345
+ !this.loading) {
346
+ this.setMenuChange(false);
347
+ }
348
+ if (key.length === 1 && !this.searchable) {
349
+ window.clearTimeout(this.characterKeyPressTimer);
350
+ this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
351
+ if (!(key === " " && !this.pressedCharacters)) {
352
+ this.pressedCharacters += key;
353
+ this.handleFilter();
354
+ if (!this.noOptions) {
355
+ this.emitImmediateIcChange(this.filteredOptions[0].value);
356
+ }
357
+ }
358
+ }
359
+ else {
360
+ this.pressedCharacters = "";
361
+ }
362
+ };
363
+ this.handleNativeSelectKeyDown = (event) => {
364
+ if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
365
+ event.cancelBubble = true;
366
+ }
367
+ this.handleCharacterKeyDown(event.key);
368
+ };
369
+ this.handleKeyDown = (event) => {
370
+ if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
371
+ event.cancelBubble = true;
372
+ }
373
+ const isArrowKey = event.key === "ArrowDown" || event.key === "ArrowUp";
374
+ if (!this.open) {
375
+ if (this.isExternalFiltering() && (event.key === "Enter" || isArrowKey)) {
376
+ this.menu.options = this.filteredOptions;
377
+ }
378
+ else {
379
+ if (!this.hasTimedOut) {
380
+ this.noOptions = null;
381
+ this.menu.options = this.uniqueOptions;
382
+ }
383
+ }
384
+ }
385
+ if (this.open && event.key === "Enter") {
386
+ this.setMenuChange(false);
387
+ }
388
+ else {
389
+ if (!(isArrowKey && this.noOptions !== null)) {
390
+ if (!(event.key === " " && this.pressedCharacters.length > 0)) {
391
+ // Keyboard events get passed onto ic-menu
392
+ this.menu.handleKeyboardOpen(event);
393
+ }
394
+ if (!this.multiple) {
395
+ this.handleCharacterKeyDown(event.key);
396
+ }
397
+ }
398
+ }
399
+ };
400
+ this.handleClearButtonFocus = () => {
401
+ this.clearButtonFocused = true;
402
+ };
403
+ this.handleClearButtonBlur = (ev) => {
404
+ var _a;
405
+ const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
406
+ if (!(this.searchableSelectElement &&
407
+ ev.relatedTarget === this.searchableSelectElement) &&
408
+ !(retryButton && ev.relatedTarget === retryButton)) {
409
+ this.setMenuChange(false);
410
+ this.handleFocusIndicatorDisplay();
411
+ }
412
+ this.clearButtonFocused = false;
413
+ };
414
+ this.handleFilter = () => {
415
+ var _a;
416
+ const options = this.deduplicateOptions(this.searchable ? [...this.uniqueOptions] : this.ungroupedOptions);
417
+ let isGrouped = false;
418
+ let newFilteredOptions = [];
419
+ options.map((option) => {
420
+ if (option.children)
421
+ isGrouped = true;
422
+ });
423
+ let menuOptionsFiltered;
424
+ if (this.searchable) {
425
+ menuOptionsFiltered = helpers.getFilteredMenuOptions(options, this.includeDescriptionsInSearch, this.inputValueToFilter, this.searchMatchPosition);
426
+ this.searchableMenuItemSelected = false;
427
+ }
428
+ else {
429
+ menuOptionsFiltered = helpers.getFilteredMenuOptions(options, false, this.pressedCharacters, "start");
430
+ }
431
+ if (!isGrouped &&
432
+ ((_a = menuOptionsFiltered[0]) === null || _a === void 0 ? void 0 : _a.label) !== this.emptyOptionListText) {
433
+ newFilteredOptions = menuOptionsFiltered;
434
+ }
435
+ else if (isGrouped) {
436
+ options.map((option) => {
437
+ if (this.includeGroupTitlesInSearch) {
438
+ if (menuOptionsFiltered.indexOf(option) !== -1) {
439
+ newFilteredOptions.push(option);
440
+ }
441
+ else {
442
+ newFilteredOptions.push(this.getFilteredChildMenuOptions(option));
443
+ }
444
+ }
445
+ else {
446
+ newFilteredOptions.push(this.getFilteredChildMenuOptions(option));
447
+ }
448
+ });
449
+ }
450
+ let noChildOptionsWhenFiltered = false;
451
+ if (isGrouped) {
452
+ noChildOptionsWhenFiltered = true;
453
+ newFilteredOptions.map((option) => {
454
+ if (option.children.length > 0) {
455
+ noChildOptionsWhenFiltered = false;
456
+ }
457
+ });
458
+ }
459
+ if (newFilteredOptions.length > 0 && !noChildOptionsWhenFiltered) {
460
+ this.noOptions = null;
461
+ this.filteredOptions = newFilteredOptions;
462
+ }
463
+ else {
464
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
465
+ this.filteredOptions = this.noOptions;
466
+ }
467
+ };
468
+ /**
469
+ * Put the select component into loading state.
470
+ * Replace options with the loading message. If timeout is enabled, set the timeout and once passed, replace options with the loading error message
471
+ */
472
+ this.triggerLoading = () => {
473
+ this.hasTimedOut = false;
474
+ this.noOptions = [{ label: this.loadingLabel, value: "", loading: true }];
475
+ if (this.filteredOptions !== this.noOptions && this.searchable) {
476
+ this.filteredOptions = this.noOptions;
477
+ }
478
+ else if (this.uniqueOptions !== this.noOptions && !this.searchable) {
479
+ this.uniqueOptions = this.noOptions;
480
+ }
481
+ if (this.timeout) {
482
+ this.timeoutTimer = window.setTimeout(() => {
483
+ this.loading = false;
484
+ this.hasTimedOut = true;
485
+ this.noOptions = [
486
+ { label: this.loadingErrorLabel, value: "", timedOut: true },
487
+ ];
488
+ this.filteredOptions = this.noOptions;
489
+ if (!this.searchable)
490
+ this.uniqueOptions = this.noOptions;
491
+ }, this.timeout);
492
+ }
493
+ };
494
+ this.getValueFromLabel = (label) => {
495
+ var _a;
496
+ return (_a = this.uniqueOptions.find((option) => option.label === label)) === null || _a === void 0 ? void 0 : _a.value;
497
+ };
498
+ this.handleSearchableSelectInput = (event) => {
499
+ this.searchableSelectInputValue = event.target.value;
500
+ this.icInput.emit({ value: this.searchableSelectInputValue });
501
+ this.emitIcChange(this.searchableSelectInputValue);
502
+ this.hiddenInputValue = this.searchableSelectInputValue;
503
+ this.inputValueToFilter = this.searchableSelectInputValue;
504
+ this.setMenuChange(true);
505
+ if (!this.disableFilter) {
506
+ this.handleFilter();
507
+ this.debounceAriaLiveUpdate();
508
+ }
509
+ };
510
+ this.updateSearchableSelectResultAriaLive = () => {
511
+ const searchableSelectResultsStatusEl = this.el.shadowRoot.querySelector(".searchable-select-results-status");
512
+ if (searchableSelectResultsStatusEl) {
513
+ if (this.noOptions !== null) {
514
+ searchableSelectResultsStatusEl.innerText = this.emptyOptionListText;
515
+ }
516
+ else {
517
+ searchableSelectResultsStatusEl.innerText = "";
518
+ }
519
+ }
520
+ };
521
+ this.updateMultiSelectedCountAriaLive = () => {
522
+ var _a;
523
+ const multiSelectSelectedCountEl = this.el.shadowRoot.querySelector(".multi-select-selected-count");
524
+ const selectedCount = `${(_a = this.currValue) === null || _a === void 0 ? void 0 : _a.length} of ${helpers.getOptionsWithoutGroupTitlesCount(this.options)} selected`;
525
+ if (multiSelectSelectedCountEl &&
526
+ multiSelectSelectedCountEl.innerText !== selectedCount) {
527
+ multiSelectSelectedCountEl.innerText = selectedCount;
528
+ }
529
+ };
530
+ this.getDefaultValue = (value) => this.getLabelFromValue(value) || value || null;
531
+ this.setDefaultValue = () => {
532
+ if (!this.hasSetDefaultValue && this.currValue) {
533
+ this.searchableSelectInputValue =
534
+ this.searchable && this.getDefaultValue(this.currValue);
535
+ this.initialValue = this.currValue;
536
+ this.hasSetDefaultValue = true;
537
+ }
538
+ };
539
+ this.onFocus = () => {
540
+ this.icFocus.emit();
541
+ };
542
+ this.onBlur = (event) => {
543
+ var _a;
544
+ const target = event.relatedTarget;
545
+ if (target !== null &&
546
+ target.tagName === "UL" &&
547
+ target.className.includes("menu")) {
548
+ return;
549
+ }
550
+ const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
551
+ const isSearchableAndNoFocusedInternalElements = this.searchable &&
552
+ event.relatedTarget !== this.menu &&
553
+ !Array.from(this.menu.querySelectorAll("[role='option']")).includes(event.relatedTarget) &&
554
+ !(this.clearButton && event.relatedTarget === this.clearButton) &&
555
+ !(retryButton && event.relatedTarget === retryButton);
556
+ if (isSearchableAndNoFocusedInternalElements) {
557
+ if (!this.retryButtonClick) {
558
+ this.setMenuChange(false);
559
+ }
560
+ this.handleFocusIndicatorDisplay();
561
+ }
562
+ this.retryButtonClick = false;
563
+ this.icBlur.emit();
564
+ };
565
+ this.onTimeoutBlur = (ev) => {
566
+ if (ev.detail.ev.relatedTarget !==
567
+ this.searchableSelectElement &&
568
+ !this.blurredBecauseButtonPressed) {
569
+ this.setMenuChange(false);
570
+ this.handleFocusIndicatorDisplay();
571
+ this.icBlur.emit();
572
+ }
573
+ this.blurredBecauseButtonPressed = false;
574
+ };
575
+ this.handleFormReset = () => {
576
+ this.value = this.initialValue;
577
+ if (this.searchable) {
578
+ this.searchableSelectInputValue = this.getDefaultValue(this.value);
579
+ this.hiddenInputValue = this.value;
580
+ }
581
+ };
582
+ this.ariaActiveDescendant = undefined;
583
+ this.clearButtonFocused = false;
584
+ this.debounceIcChange = undefined;
585
+ this.hiddenInputValue = undefined;
586
+ this.noOptions = null;
587
+ this.open = false;
588
+ this.pressedCharacters = "";
589
+ this.searchableSelectInputValue = null;
590
+ this.charactersUntilSuggestions = 0;
591
+ this.disabled = false;
592
+ this.disableFilter = false;
593
+ this.emptyOptionListText = "No results found";
594
+ this.form = undefined;
595
+ this.formaction = undefined;
596
+ this.formenctype = undefined;
597
+ this.formmethod = undefined;
598
+ this.formnovalidate = undefined;
599
+ this.formtarget = undefined;
600
+ this.fullWidth = false;
601
+ this.helperText = "";
602
+ this.hideLabel = false;
603
+ this.includeDescriptionsInSearch = false;
604
+ this.includeGroupTitlesInSearch = false;
605
+ this.label = undefined;
606
+ this.loadingErrorLabel = "Loading Error";
607
+ this.loadingLabel = "Loading...";
608
+ this.multiple = false;
609
+ this.name = this.inputId;
610
+ this.placeholder = "Select an option";
611
+ this.readonly = false;
612
+ this.required = false;
613
+ this.searchable = false;
614
+ this.searchMatchPosition = "anywhere";
615
+ this.selectOnEnter = false;
616
+ this.showClearButton = false;
617
+ this.size = "default";
618
+ this.small = false;
619
+ this.timeout = undefined;
620
+ this.validationStatus = "";
621
+ this.validationText = "";
622
+ this.loading = false;
623
+ this.options = [];
624
+ this.filteredOptions = this.options;
625
+ this.uniqueOptions = this.options;
626
+ this.debounce = 0;
627
+ this.currDebounce = this.debounce;
628
+ this.value = undefined;
629
+ this.initialValue = this.value;
630
+ this.inputValueToFilter = this.value;
631
+ this.currValue = this.value;
632
+ }
633
+ loadingHandler(newValue) {
634
+ newValue && this.triggerLoading();
635
+ }
636
+ watchOptionsHandler() {
637
+ if (!this.hasTimedOut && this.options !== this.noOptions) {
638
+ this.loading = false;
639
+ clearTimeout(this.timeoutTimer);
640
+ if (this.isExternalFiltering()) {
641
+ // When searchable select
642
+ if (this.options.length > 0) {
643
+ this.setOptionsValuesFromLabels();
644
+ this.noOptions = null;
645
+ this.uniqueOptions = this.deduplicateOptions(this.options);
646
+ this.filteredOptions = this.uniqueOptions;
647
+ }
648
+ else {
649
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
650
+ this.uniqueOptions = this.noOptions;
651
+ this.filteredOptions = this.noOptions;
652
+ }
653
+ this.updateSearchableSelectResultAriaLive();
654
+ this.setDefaultValue();
655
+ }
656
+ else {
657
+ this.setOptionsValuesFromLabels();
658
+ this.uniqueOptions = this.deduplicateOptions(this.options);
659
+ this.filteredOptions = this.uniqueOptions;
660
+ if (this.initialOptionsEmpty) {
661
+ this.setDefaultValue();
662
+ this.initialOptionsEmpty = false;
663
+ }
664
+ }
665
+ }
666
+ else {
667
+ if (!this.searchable)
668
+ this.options = this.noOptions;
669
+ }
670
+ }
671
+ debounceChangedHandler(newValue) {
672
+ this.updateOnChangeDebounce(newValue);
673
+ }
674
+ valueChangedHandler() {
675
+ if (this.value !== this.currValue) {
676
+ if (this.value && this.multiple) {
677
+ this.currValue = this.getValueSortedByOptions(this.value);
678
+ this.updateMultiSelectedCountAriaLive();
679
+ }
680
+ else {
681
+ this.currValue = this.value;
682
+ }
683
+ }
684
+ if (this.searchable) {
685
+ this.searchableSelectInputValue =
686
+ this.getLabelFromValue(this.currValue) ||
687
+ this.currValue;
688
+ }
689
+ }
690
+ disconnectedCallback() {
691
+ helpers.removeFormResetListener(this.el, this.handleFormReset);
692
+ }
693
+ componentWillLoad() {
694
+ this.inheritedAttributes = helpers.inheritAttributes(this.el, [
695
+ ...IC_INHERITED_ARIA,
696
+ "tabindex",
697
+ "title",
698
+ ]);
699
+ helpers.removeDisabledFalse(this.disabled, this.el);
700
+ this.setOptionsValuesFromLabels();
701
+ helpers.addFormResetListener(this.el, this.handleFormReset);
702
+ if (!this.options.length) {
703
+ this.initialOptionsEmpty = true;
704
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
705
+ this.uniqueOptions = this.noOptions;
706
+ this.filteredOptions = this.noOptions;
707
+ }
708
+ else {
709
+ this.setDefaultValue();
710
+ this.uniqueOptions = this.deduplicateOptions(this.options);
711
+ }
712
+ }
713
+ componentDidLoad() {
714
+ helpers.onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Select");
715
+ if (this.loading) {
716
+ this.triggerLoading();
717
+ }
718
+ this.hiddenInputValue = this.searchable && this.currValue;
719
+ }
720
+ componentDidRender() {
721
+ if (this.nativeSelectElement && !this.disabled) {
722
+ this.setTextColor();
723
+ }
724
+ }
725
+ /**
726
+ * Sets focus on the input box.
727
+ */
728
+ async setFocus() {
729
+ if (this.nativeSelectElement) {
730
+ this.nativeSelectElement.focus();
731
+ }
732
+ else if (this.customSelectElement) {
733
+ this.customSelectElement.focus();
734
+ }
735
+ else if (this.searchableSelectElement) {
736
+ this.searchableSelectElement.focus();
737
+ }
738
+ }
739
+ updateOnChangeDebounce(newValue) {
740
+ if (this.currDebounce !== newValue) {
741
+ this.currDebounce = newValue;
742
+ }
743
+ }
744
+ debounceAriaLiveUpdate() {
745
+ clearTimeout(this.debounceAria);
746
+ window.setTimeout(() => {
747
+ this.updateSearchableSelectResultAriaLive();
748
+ }, 800);
749
+ }
750
+ render() {
751
+ const { size, small, disabled, fullWidth, helperText, hideLabel, label, menuId, multiple, name, options, placeholder, readonly, required, searchable, showClearButton, validationStatus, validationText, currValue, } = this;
752
+ // HTML inputs only accept 'string' for their value
753
+ // Does not cause errors when it is a multi-select - sets value correctly, to a comma-separated string
754
+ helpers.renderHiddenInput(true, this.el, name, this.searchable ? this.hiddenInputValue : currValue, disabled);
755
+ const invalid = validationStatus === helpers.IcInformationStatus.Error ? "true" : "false";
756
+ const describedBy = helpers.getInputDescribedByText(this.inputId, helperText !== "", helpers.hasValidationStatus(this.validationStatus, this.disabled)).trim();
757
+ const optionsSelectedCount = `${currValue === null || currValue === void 0 ? void 0 : currValue.length} of ${helpers.getOptionsWithoutGroupTitlesCount(this.options)} selected`;
758
+ return (index.h(index.Host, { class: {
759
+ disabled: disabled,
760
+ searchable: searchable,
761
+ small: small,
762
+ [size]: size !== "default",
763
+ "full-width": fullWidth,
764
+ }, onBlur: this.onBlur }, index.h("ic-input-container", { readonly: readonly }, !hideLabel && (index.h("ic-input-label", { for: this.inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly })), index.h("ic-input-component-container", { ref: (el) => (this.anchorEl = el), class: { "menu-open": this.open }, small: small, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, readonly ? (index.h("ic-typography", null, index.h("p", null, multiple
765
+ ? this.getMultipleOptionsString(currValue)
766
+ : this.getLabelFromValue(currValue)))) : helpers.isMobileOrTablet() && !multiple ? (index.h("select", Object.assign({ ref: (el) => (this.nativeSelectElement = el), disabled: disabled, onChange: this.handleNativeSelectChange, required: required, id: this.inputId, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.handleNativeSelectKeyDown, form: this.form }, this.inheritedAttributes), index.h("option", { value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => {
767
+ if (option.children) {
768
+ return (index.h("optgroup", { label: option.label }, option.children.map((option) => (index.h("option", { value: option.value, disabled: option.disabled, selected: option.value === currValue }, option.label)))));
769
+ }
770
+ else {
771
+ return (index.h("option", { value: option.value, disabled: option.disabled, selected: option.value === currValue }, option.label));
772
+ }
773
+ }))) : searchable ? (index.h("div", { class: "searchable-select-container" }, index.h("input", { class: {
774
+ "select-input": true,
775
+ "with-clear-button": !!this.searchableSelectInputValue,
776
+ }, role: "combobox", autocomplete: "off", "aria-label": label, "aria-describedby": describedBy, "aria-activedescendant": this.ariaActiveDescendant, "aria-autocomplete": "list", "aria-expanded": this.open ? "true" : "false", "aria-invalid": invalid, "aria-required": required ? "true" : "false", "aria-controls": menuId, ref: (el) => (this.searchableSelectElement = el), id: this.inputId, value: this.searchableSelectInputValue, placeholder: placeholder, disabled: disabled, onInput: this.handleSearchableSelectInput, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, form: this.form, formaction: this.formaction, formenctype: this.formenctype, formmethod: this.formmethod, formnovalidate: this.formnovalidate, formtarget: this.formtarget }), this.searchableSelectInputValue &&
777
+ (showClearButton || searchable) && (index.h("div", { class: "clear-button-container" }, index.h("ic-button", { id: "clear-button", ref: (el) => (this.clearButton = el), "aria-label": this.searchableSelectInputValue && currValue === null
778
+ ? "Clear input"
779
+ : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearButtonFocus, onBlur: this.handleClearButtonBlur, size: size, variant: "icon", appearance: this.clearButtonFocused
780
+ ? helpers.IcThemeForegroundEnum.Light
781
+ : helpers.IcThemeForegroundEnum.Dark }), index.h("div", { class: "divider" }))), index.h("span", { onMouseDown: this.handleExpandIconMouseDown, class: {
782
+ "expand-icon": true,
783
+ "expand-icon-open": this.open,
784
+ }, innerHTML: Expand, "aria-hidden": "true" }), index.h("div", { "aria-live": "polite", role: "status", class: "searchable-select-results-status" }))) : (index.h("div", { class: "select-container" }, index.h("button", { class: "select-input", ref: (el) => (this.customSelectElement = el), id: this.inputId, "aria-label": `${label}, ${(multiple && currValue
785
+ ? `${optionsSelectedCount}, ${this.getMultipleOptionsString(currValue)}`
786
+ : this.getLabelFromValue(currValue)) ||
787
+ placeholder}${required ? ", required" : ""}`, "aria-describedby": describedBy, "aria-invalid": invalid, "aria-haspopup": "listbox", "aria-expanded": this.open ? "true" : "false", "aria-owns": menuId, "aria-controls": menuId, disabled: disabled, onBlur: this.onBlur, onFocus: this.onFocus, onClick: this.handleClick, onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown }, index.h("ic-typography", { variant: "body", class: {
788
+ "value-text": true,
789
+ "with-clear-button": currValue && showClearButton,
790
+ placeholder: !this.value || (multiple && this.value.length < 1),
791
+ } }, index.h("p", null, (multiple
792
+ ? this.getMultipleOptionsString(currValue)
793
+ : this.getLabelFromValue(currValue)) ||
794
+ placeholder)), index.h("div", { class: "select-input-end" }, currValue && showClearButton && (index.h("div", { class: "divider" })), index.h("span", { class: {
795
+ "expand-icon": true,
796
+ "expand-icon-open": this.open,
797
+ }, innerHTML: Expand, "aria-hidden": "true" }))), currValue && showClearButton && (index.h("ic-button", { id: "clear-button", "aria-label": "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearButtonFocus, onBlur: this.handleClearButtonBlur, size: size, variant: "icon", appearance: this.clearButtonFocused
798
+ ? helpers.IcThemeForegroundEnum.Light
799
+ : helpers.IcThemeForegroundEnum.Dark }))))), (!helpers.isMobileOrTablet() || multiple) && (index.h("ic-menu-with-multi", { class: {
800
+ "no-results": this.loading ||
801
+ this.hasTimedOut ||
802
+ (this.noOptions !== null &&
803
+ this.noOptions[0] &&
804
+ this.noOptions[0].label === this.emptyOptionListText),
805
+ }, ref: (el) => (this.menu = el), inputEl: searchable
806
+ ? this.searchableSelectElement
807
+ : this.customSelectElement, inputLabel: label, anchorEl: this.anchorEl, small: small, size: size, menuId: menuId, open: this.open, options: searchable ? this.filteredOptions : this.uniqueOptions, value: multiple ? currValue : currValue, fullWidth: fullWidth, selectOnEnter: this.selectOnEnter, onMenuStateChange: this.handleMenuChange, onMenuOptionSelect: this.handleCustomSelectChange, onMenuOptionSelectAll: this.handleSelectAllChange, onMenuKeyPress: this.handleMenuKeyPress, onUngroupedOptionsSet: this.setUngroupedOptions, onRetryButtonClicked: this.handleRetry, parentEl: this.el, onTimeoutBlur: this.onTimeoutBlur, activationType: this.searchable || multiple || this.selectOnEnter
808
+ ? "manual"
809
+ : "automatic", closeOnSelect: !multiple })), this.multiple && (index.h("div", { "aria-live": "polite", role: "status", class: "multi-select-selected-count" })), helpers.hasValidationStatus(this.validationStatus, this.disabled) && (index.h("ic-input-validation", { class: { "menu-open": this.open }, ariaLiveMode: "polite", status: validationStatus, message: validationText, for: this.inputId })))));
810
+ }
811
+ static get delegatesFocus() { return true; }
812
+ get el() { return index.getElement(this); }
813
+ static get watchers() { return {
814
+ "loading": ["loadingHandler"],
815
+ "options": ["watchOptionsHandler"],
816
+ "debounce": ["debounceChangedHandler"],
817
+ "value": ["valueChangedHandler"]
818
+ }; }
819
+ };
820
+ Select.style = icSelectCss;
821
+
822
+ exports.ic_select_with_multi = Select;
823
+
824
+ //# sourceMappingURL=ic-select-with-multi.cjs.entry.js.map