@ukic/canary-web-components 2.0.0-canary.6 → 2.0.0-canary.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/helpers-93c5fc92.js +198 -0
  3. package/dist/cjs/helpers-93c5fc92.js.map +1 -0
  4. package/dist/cjs/{helpers-86375e76.js → helpers-b525d45a.js} +45 -4
  5. package/dist/cjs/helpers-b525d45a.js.map +1 -0
  6. package/dist/cjs/ic-accordion-group.cjs.entry.js +6 -2
  7. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-alert.cjs.entry.js +2 -2
  10. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-badge.cjs.entry.js +4 -3
  13. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  15. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-button_3.cjs.entry.js +34 -10
  17. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-card.cjs.entry.js +7 -7
  19. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-data-entity.cjs.entry.js +3 -6
  24. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-data-row.cjs.entry.js +21 -35
  26. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-dialog.cjs.entry.js +4 -2
  28. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  30. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  31. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  34. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +12 -10
  37. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  42. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +2599 -0
  43. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -0
  44. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-pagination-bar.cjs.entry.js +2 -18
  50. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -1
  51. package/dist/cjs/ic-pagination_4.cjs.entry.js +21 -13
  52. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  53. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  55. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  57. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  58. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ic-select-with-multi.cjs.entry.js +837 -0
  60. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -0
  61. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -5
  62. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  65. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  66. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +184 -0
  73. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -0
  74. package/dist/cjs/ic-toggle-button.cjs.entry.js +6 -3
  75. package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
  76. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  77. package/dist/cjs/ic-typography.cjs.entry.js +1 -1
  78. package/dist/cjs/index-4cf27b16.js +12 -0
  79. package/dist/cjs/loader.cjs.js +1 -1
  80. package/dist/collection/collection-manifest.json +4 -1
  81. package/dist/collection/components/ic-menu-with-multi/ic-menu.css +701 -0
  82. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +1458 -0
  83. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -0
  84. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +880 -0
  85. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -0
  86. package/dist/collection/components/ic-select-with-multi/assets/Check.svg +3 -0
  87. package/dist/collection/components/ic-select-with-multi/assets/Clear.svg +3 -0
  88. package/dist/collection/components/ic-select-with-multi/assets/Expand.svg +3 -0
  89. package/dist/collection/components/ic-select-with-multi/ic-select.css +693 -0
  90. package/dist/collection/components/ic-select-with-multi/ic-select.js +1649 -0
  91. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -0
  92. package/dist/collection/components/ic-select-with-multi/story-data.js +216 -0
  93. package/dist/collection/components/ic-select-with-multi/story-data.js.map +1 -0
  94. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js +146 -0
  95. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js.map +1 -0
  96. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js +2040 -0
  97. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js.map +1 -0
  98. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js +1518 -0
  99. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js.map +1 -0
  100. package/dist/collection/utils/constants.js +28 -0
  101. package/dist/collection/utils/constants.js.map +1 -0
  102. package/dist/collection/utils/helpers.js +168 -5
  103. package/dist/collection/utils/helpers.js.map +1 -1
  104. package/dist/collection/utils/types.js +13 -0
  105. package/dist/collection/utils/types.js.map +1 -0
  106. package/dist/components/helpers.js +44 -4
  107. package/dist/components/helpers.js.map +1 -1
  108. package/dist/components/helpers2.js +183 -0
  109. package/dist/components/helpers2.js.map +1 -0
  110. package/dist/components/ic-accordion-group.js +7 -2
  111. package/dist/components/ic-accordion-group.js.map +1 -1
  112. package/dist/components/ic-alert2.js +1 -1
  113. package/dist/components/ic-alert2.js.map +1 -1
  114. package/dist/components/ic-back-to-top.js +1 -1
  115. package/dist/components/ic-badge.js +4 -3
  116. package/dist/components/ic-badge.js.map +1 -1
  117. package/dist/components/ic-breadcrumb-group.js +1 -1
  118. package/dist/components/ic-breadcrumb2.js +1 -1
  119. package/dist/components/ic-button2.js +38 -9
  120. package/dist/components/ic-button2.js.map +1 -1
  121. package/dist/components/ic-card.js +8 -20
  122. package/dist/components/ic-card.js.map +1 -1
  123. package/dist/components/ic-checkbox-group.js +1 -1
  124. package/dist/components/ic-checkbox.js +1 -1
  125. package/dist/components/ic-chip.js +1 -1
  126. package/dist/components/ic-data-entity.js +3 -6
  127. package/dist/components/ic-data-entity.js.map +1 -1
  128. package/dist/components/ic-data-row.js +21 -35
  129. package/dist/components/ic-data-row.js.map +1 -1
  130. package/dist/components/ic-dialog.js +5 -2
  131. package/dist/components/ic-dialog.js.map +1 -1
  132. package/dist/components/ic-divider2.js +1 -1
  133. package/dist/components/ic-footer-link-group.js +1 -1
  134. package/dist/components/ic-footer-link.js +1 -1
  135. package/dist/components/ic-footer.js +1 -1
  136. package/dist/components/ic-hero.js +1 -1
  137. package/dist/components/ic-horizontal-scroll2.js +1 -1
  138. package/dist/components/ic-input-component-container2.js +7 -6
  139. package/dist/components/ic-input-component-container2.js.map +1 -1
  140. package/dist/components/ic-input-label2.js +1 -1
  141. package/dist/components/ic-input-validation2.js +1 -1
  142. package/dist/components/ic-loading-indicator2.js +1 -1
  143. package/dist/components/ic-menu-group.js +1 -1
  144. package/dist/components/ic-menu-item2.js +1 -1
  145. package/dist/components/ic-menu-with-multi.d.ts +11 -0
  146. package/dist/components/ic-menu-with-multi.js +8 -0
  147. package/dist/components/ic-menu-with-multi.js.map +1 -0
  148. package/dist/components/ic-menu2.js +5 -4
  149. package/dist/components/ic-menu2.js.map +1 -1
  150. package/dist/components/ic-menu3.js +2665 -0
  151. package/dist/components/ic-menu3.js.map +1 -0
  152. package/dist/components/ic-navigation-button.js +1 -1
  153. package/dist/components/ic-navigation-group.js +1 -1
  154. package/dist/components/ic-navigation-item.js +1 -1
  155. package/dist/components/ic-navigation-menu2.js +1 -1
  156. package/dist/components/ic-page-header.js +1 -1
  157. package/dist/components/ic-pagination-bar2.js +1 -17
  158. package/dist/components/ic-pagination-bar2.js.map +1 -1
  159. package/dist/components/ic-pagination-item2.js +1 -1
  160. package/dist/components/ic-pagination2.js +1 -1
  161. package/dist/components/ic-popover-menu.js +2 -2
  162. package/dist/components/ic-popover-menu.js.map +1 -1
  163. package/dist/components/ic-radio-group.js +1 -1
  164. package/dist/components/ic-radio-option.js +1 -1
  165. package/dist/components/ic-search-bar.js +1 -1
  166. package/dist/components/ic-search-bar.js.map +1 -1
  167. package/dist/components/ic-select-with-multi.d.ts +11 -0
  168. package/dist/components/ic-select-with-multi.js +962 -0
  169. package/dist/components/ic-select-with-multi.js.map +1 -0
  170. package/dist/components/ic-select2.js +23 -14
  171. package/dist/components/ic-select2.js.map +1 -1
  172. package/dist/components/ic-side-navigation.js +1 -5
  173. package/dist/components/ic-side-navigation.js.map +1 -1
  174. package/dist/components/ic-step.js +1 -1
  175. package/dist/components/ic-stepper.js +1 -1
  176. package/dist/components/ic-switch.js +1 -1
  177. package/dist/components/ic-tab-panel.js +1 -1
  178. package/dist/components/ic-tab.js +1 -1
  179. package/dist/components/ic-text-field2.js +1 -1
  180. package/dist/components/ic-theme.js +1 -1
  181. package/dist/components/ic-toast.js +1 -1
  182. package/dist/components/ic-toggle-button-group.js +210 -0
  183. package/dist/components/ic-toggle-button-group.js.map +1 -0
  184. package/dist/components/ic-toggle-button.js +6 -3
  185. package/dist/components/ic-toggle-button.js.map +1 -1
  186. package/dist/components/ic-tooltip2.js +1 -1
  187. package/dist/components/ic-tooltip2.js.map +1 -1
  188. package/dist/components/ic-top-navigation.js +1 -1
  189. package/dist/core/core.css +8 -5
  190. package/dist/core/core.esm.js +1 -1
  191. package/dist/core/core.esm.js.map +1 -1
  192. package/dist/core/{p-4119a26b.entry.js → p-045359e1.entry.js} +2 -2
  193. package/dist/core/{p-cae71c32.entry.js → p-10fb4c46.entry.js} +2 -2
  194. package/dist/core/{p-7a0790e4.entry.js → p-169bfa51.entry.js} +2 -2
  195. package/dist/core/{p-56645c00.entry.js → p-1ca332ca.entry.js} +2 -2
  196. package/dist/core/{p-fddc7254.entry.js → p-204ace96.entry.js} +2 -2
  197. package/dist/core/p-21150122.entry.js +2 -0
  198. package/dist/core/p-21150122.entry.js.map +1 -0
  199. package/dist/core/{p-5332a426.entry.js → p-2eac7dcc.entry.js} +2 -2
  200. package/dist/core/{p-3294eba4.entry.js → p-3803a5b5.entry.js} +2 -2
  201. package/dist/core/{p-24945ee5.entry.js → p-452985d9.entry.js} +2 -2
  202. package/dist/core/p-452985d9.entry.js.map +1 -0
  203. package/dist/core/p-4753bac8.entry.js +2 -0
  204. package/dist/core/p-4753bac8.entry.js.map +1 -0
  205. package/dist/core/{p-a048beab.entry.js → p-4baa0916.entry.js} +2 -2
  206. package/dist/core/{p-7e0197a4.entry.js → p-4f413fc0.entry.js} +2 -2
  207. package/dist/core/{p-a6a90c56.entry.js → p-595be57d.entry.js} +2 -2
  208. package/dist/core/{p-5f8c4c83.entry.js → p-5ae93c16.entry.js} +2 -2
  209. package/dist/core/{p-03fdee20.entry.js → p-5e0c830b.entry.js} +2 -2
  210. package/dist/core/{p-03fdee20.entry.js.map → p-5e0c830b.entry.js.map} +1 -1
  211. package/dist/core/p-624d4f5f.entry.js +2 -0
  212. package/dist/core/p-624d4f5f.entry.js.map +1 -0
  213. package/dist/core/{p-fff91bd9.entry.js → p-6933f8e9.entry.js} +2 -2
  214. package/dist/core/{p-043e4073.entry.js → p-6c3044b6.entry.js} +2 -2
  215. package/dist/core/{p-7b17f3ce.entry.js → p-73be1251.entry.js} +2 -2
  216. package/dist/core/{p-e0d8d7a5.entry.js → p-75dac3d1.entry.js} +2 -2
  217. package/dist/core/{p-a3ab9f4c.entry.js → p-76915584.entry.js} +2 -2
  218. package/dist/core/p-76915584.entry.js.map +1 -0
  219. package/dist/core/{p-78ad0c34.entry.js → p-7ef8d616.entry.js} +2 -2
  220. package/dist/core/{p-78ad0c34.entry.js.map → p-7ef8d616.entry.js.map} +1 -1
  221. package/dist/core/{p-f2318ddc.entry.js → p-81ddc39d.entry.js} +2 -2
  222. package/dist/core/{p-3e36c9e4.entry.js → p-869954a2.entry.js} +2 -2
  223. package/dist/core/{p-a561980f.entry.js → p-88d54b72.entry.js} +2 -2
  224. package/dist/core/{p-f4c11be0.entry.js → p-8b08d8fe.entry.js} +2 -2
  225. package/dist/core/p-8b08d8fe.entry.js.map +1 -0
  226. package/dist/core/{p-c2884fcd.entry.js → p-917c5721.entry.js} +2 -2
  227. package/dist/core/{p-217db3af.entry.js → p-942282cd.entry.js} +2 -2
  228. package/dist/core/p-99cad6c2.js +2 -0
  229. package/dist/core/p-99cad6c2.js.map +1 -0
  230. package/dist/core/p-9caf19eb.js +2 -0
  231. package/dist/core/p-9caf19eb.js.map +1 -0
  232. package/dist/core/{p-99a9ce86.entry.js → p-a0f8efb2.entry.js} +2 -2
  233. package/dist/core/{p-234edce6.entry.js → p-a31031a5.entry.js} +2 -2
  234. package/dist/core/{p-faaa06d7.entry.js → p-a434c3d4.entry.js} +2 -2
  235. package/dist/core/{p-ae337896.entry.js → p-a43c12cd.entry.js} +2 -2
  236. package/dist/core/{p-010053ab.entry.js → p-a50c3b9e.entry.js} +2 -2
  237. package/dist/core/{p-b4591bfe.entry.js → p-ab09986c.entry.js} +2 -2
  238. package/dist/core/p-ab09986c.entry.js.map +1 -0
  239. package/dist/core/p-ac4e40a7.entry.js +2 -0
  240. package/dist/core/p-ac4e40a7.entry.js.map +1 -0
  241. package/dist/core/{p-cedabab7.entry.js → p-b82dcc29.entry.js} +2 -2
  242. package/dist/core/{p-8eaed5b7.entry.js → p-ba86928c.entry.js} +2 -2
  243. package/dist/core/{p-9c6e48fb.entry.js → p-c125b65a.entry.js} +2 -2
  244. package/dist/core/{p-452be32a.entry.js → p-c34848da.entry.js} +2 -2
  245. package/dist/core/{p-1e9f689b.entry.js → p-d8469ac0.entry.js} +2 -2
  246. package/dist/core/{p-79b39c8a.entry.js → p-db9c03c0.entry.js} +2 -2
  247. package/dist/core/{p-dd0a5ef0.entry.js → p-e0462b23.entry.js} +2 -2
  248. package/dist/core/p-e0462b23.entry.js.map +1 -0
  249. package/dist/core/p-e0a94f2d.entry.js +2 -0
  250. package/dist/core/p-e0a94f2d.entry.js.map +1 -0
  251. package/dist/core/{p-eb922333.entry.js → p-e3997d60.entry.js} +2 -2
  252. package/dist/core/p-e79e0292.entry.js +2 -0
  253. package/dist/core/p-e79e0292.entry.js.map +1 -0
  254. package/dist/core/{p-26ca8030.entry.js → p-e834344e.entry.js} +2 -2
  255. package/dist/core/{p-2addb040.entry.js → p-f14454b1.entry.js} +2 -2
  256. package/dist/core/{p-e9bc9ee2.entry.js → p-f3c840cd.entry.js} +2 -2
  257. package/dist/core/{p-e9bc9ee2.entry.js.map → p-f3c840cd.entry.js.map} +1 -1
  258. package/dist/core/{p-fc406db5.entry.js → p-f6888309.entry.js} +2 -2
  259. package/dist/core/p-f74a8752.entry.js +2 -0
  260. package/dist/core/p-f74a8752.entry.js.map +1 -0
  261. package/dist/core/{p-e31125df.entry.js → p-f7a14c01.entry.js} +2 -2
  262. package/dist/core/{p-da1f0a53.entry.js → p-f843da01.entry.js} +2 -2
  263. package/dist/core/{p-da1f0a53.entry.js.map → p-f843da01.entry.js.map} +1 -1
  264. package/dist/core/{p-b7d5ced3.entry.js → p-fc5611e2.entry.js} +2 -2
  265. package/dist/core/p-fc5611e2.entry.js.map +1 -0
  266. package/dist/core/p-fde45b29.entry.js +2 -0
  267. package/dist/core/p-fde45b29.entry.js.map +1 -0
  268. package/dist/esm/core.js +1 -1
  269. package/dist/esm/{helpers-229a5574.js → helpers-12b4266a.js} +45 -5
  270. package/dist/esm/helpers-12b4266a.js.map +1 -0
  271. package/dist/esm/helpers-5271897c.js +183 -0
  272. package/dist/esm/helpers-5271897c.js.map +1 -0
  273. package/dist/esm/ic-accordion-group.entry.js +6 -2
  274. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  275. package/dist/esm/ic-accordion.entry.js +1 -1
  276. package/dist/esm/ic-alert.entry.js +2 -2
  277. package/dist/esm/ic-alert.entry.js.map +1 -1
  278. package/dist/esm/ic-back-to-top.entry.js +1 -1
  279. package/dist/esm/ic-badge.entry.js +4 -3
  280. package/dist/esm/ic-badge.entry.js.map +1 -1
  281. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  282. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  283. package/dist/esm/ic-button_3.entry.js +34 -10
  284. package/dist/esm/ic-button_3.entry.js.map +1 -1
  285. package/dist/esm/ic-card.entry.js +7 -7
  286. package/dist/esm/ic-card.entry.js.map +1 -1
  287. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  288. package/dist/esm/ic-checkbox.entry.js +1 -1
  289. package/dist/esm/ic-chip.entry.js +1 -1
  290. package/dist/esm/ic-data-entity.entry.js +3 -6
  291. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  292. package/dist/esm/ic-data-row.entry.js +21 -35
  293. package/dist/esm/ic-data-row.entry.js.map +1 -1
  294. package/dist/esm/ic-dialog.entry.js +4 -2
  295. package/dist/esm/ic-dialog.entry.js.map +1 -1
  296. package/dist/esm/ic-divider.entry.js +1 -1
  297. package/dist/esm/ic-empty-state.entry.js +1 -1
  298. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  299. package/dist/esm/ic-footer-link.entry.js +1 -1
  300. package/dist/esm/ic-footer.entry.js +1 -1
  301. package/dist/esm/ic-hero.entry.js +1 -1
  302. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  303. package/dist/esm/ic-input-component-container_3.entry.js +12 -10
  304. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  305. package/dist/esm/ic-input-label_2.entry.js +1 -1
  306. package/dist/esm/ic-link.entry.js +1 -1
  307. package/dist/esm/ic-menu-group.entry.js +1 -1
  308. package/dist/esm/ic-menu-item.entry.js +1 -1
  309. package/dist/esm/ic-menu-with-multi.entry.js +2595 -0
  310. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -0
  311. package/dist/esm/ic-navigation-button.entry.js +1 -1
  312. package/dist/esm/ic-navigation-group.entry.js +1 -1
  313. package/dist/esm/ic-navigation-item.entry.js +1 -1
  314. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  315. package/dist/esm/ic-page-header.entry.js +1 -1
  316. package/dist/esm/ic-pagination-bar.entry.js +1 -17
  317. package/dist/esm/ic-pagination-bar.entry.js.map +1 -1
  318. package/dist/esm/ic-pagination_4.entry.js +21 -13
  319. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  320. package/dist/esm/ic-popover-menu.entry.js +1 -1
  321. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  322. package/dist/esm/ic-radio-group.entry.js +1 -1
  323. package/dist/esm/ic-radio-option.entry.js +1 -1
  324. package/dist/esm/ic-search-bar.entry.js +1 -1
  325. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  326. package/dist/esm/ic-select-with-multi.entry.js +833 -0
  327. package/dist/esm/ic-select-with-multi.entry.js.map +1 -0
  328. package/dist/esm/ic-side-navigation.entry.js +1 -5
  329. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  330. package/dist/esm/ic-status-tag.entry.js +1 -1
  331. package/dist/esm/ic-step.entry.js +1 -1
  332. package/dist/esm/ic-stepper.entry.js +1 -1
  333. package/dist/esm/ic-switch.entry.js +1 -1
  334. package/dist/esm/ic-tab-group.entry.js +1 -1
  335. package/dist/esm/ic-tab-panel.entry.js +1 -1
  336. package/dist/esm/ic-tab.entry.js +1 -1
  337. package/dist/esm/ic-theme.entry.js +1 -1
  338. package/dist/esm/ic-toast.entry.js +1 -1
  339. package/dist/esm/ic-toggle-button-group.entry.js +180 -0
  340. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -0
  341. package/dist/esm/ic-toggle-button.entry.js +6 -3
  342. package/dist/esm/ic-toggle-button.entry.js.map +1 -1
  343. package/dist/esm/ic-top-navigation.entry.js +1 -1
  344. package/dist/esm/ic-typography.entry.js +1 -1
  345. package/dist/esm/index-93509377.js +12 -0
  346. package/dist/esm/loader.js +1 -1
  347. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +208 -0
  348. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +289 -0
  349. package/dist/types/components/ic-select-with-multi/story-data.d.ts +32 -0
  350. package/dist/types/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.d.ts +1 -0
  351. package/dist/types/components.d.ts +531 -0
  352. package/dist/types/utils/constants.d.ts +1 -0
  353. package/dist/types/utils/helpers.d.ts +61 -2
  354. package/dist/types/utils/types.d.ts +16 -0
  355. package/hydrate/index.js +6853 -2907
  356. package/package.json +3 -3
  357. package/dist/cjs/helpers-86375e76.js.map +0 -1
  358. package/dist/core/p-0aa1fe4e.entry.js +0 -2
  359. package/dist/core/p-0aa1fe4e.entry.js.map +0 -1
  360. package/dist/core/p-24945ee5.entry.js.map +0 -1
  361. package/dist/core/p-8cde58bf.entry.js +0 -2
  362. package/dist/core/p-8cde58bf.entry.js.map +0 -1
  363. package/dist/core/p-93828f0e.entry.js +0 -2
  364. package/dist/core/p-93828f0e.entry.js.map +0 -1
  365. package/dist/core/p-9fdd7d73.entry.js +0 -2
  366. package/dist/core/p-9fdd7d73.entry.js.map +0 -1
  367. package/dist/core/p-a3ab9f4c.entry.js.map +0 -1
  368. package/dist/core/p-b4591bfe.entry.js.map +0 -1
  369. package/dist/core/p-b7d5ced3.entry.js.map +0 -1
  370. package/dist/core/p-dd0a5ef0.entry.js.map +0 -1
  371. package/dist/core/p-e0102744.js +0 -2
  372. package/dist/core/p-e0102744.js.map +0 -1
  373. package/dist/core/p-e2ccb52b.entry.js +0 -2
  374. package/dist/core/p-e2ccb52b.entry.js.map +0 -1
  375. package/dist/core/p-f4c11be0.entry.js.map +0 -1
  376. package/dist/esm/helpers-229a5574.js.map +0 -1
  377. /package/dist/core/{p-4119a26b.entry.js.map → p-045359e1.entry.js.map} +0 -0
  378. /package/dist/core/{p-cae71c32.entry.js.map → p-10fb4c46.entry.js.map} +0 -0
  379. /package/dist/core/{p-7a0790e4.entry.js.map → p-169bfa51.entry.js.map} +0 -0
  380. /package/dist/core/{p-56645c00.entry.js.map → p-1ca332ca.entry.js.map} +0 -0
  381. /package/dist/core/{p-fddc7254.entry.js.map → p-204ace96.entry.js.map} +0 -0
  382. /package/dist/core/{p-5332a426.entry.js.map → p-2eac7dcc.entry.js.map} +0 -0
  383. /package/dist/core/{p-3294eba4.entry.js.map → p-3803a5b5.entry.js.map} +0 -0
  384. /package/dist/core/{p-a048beab.entry.js.map → p-4baa0916.entry.js.map} +0 -0
  385. /package/dist/core/{p-7e0197a4.entry.js.map → p-4f413fc0.entry.js.map} +0 -0
  386. /package/dist/core/{p-a6a90c56.entry.js.map → p-595be57d.entry.js.map} +0 -0
  387. /package/dist/core/{p-5f8c4c83.entry.js.map → p-5ae93c16.entry.js.map} +0 -0
  388. /package/dist/core/{p-fff91bd9.entry.js.map → p-6933f8e9.entry.js.map} +0 -0
  389. /package/dist/core/{p-043e4073.entry.js.map → p-6c3044b6.entry.js.map} +0 -0
  390. /package/dist/core/{p-7b17f3ce.entry.js.map → p-73be1251.entry.js.map} +0 -0
  391. /package/dist/core/{p-e0d8d7a5.entry.js.map → p-75dac3d1.entry.js.map} +0 -0
  392. /package/dist/core/{p-f2318ddc.entry.js.map → p-81ddc39d.entry.js.map} +0 -0
  393. /package/dist/core/{p-3e36c9e4.entry.js.map → p-869954a2.entry.js.map} +0 -0
  394. /package/dist/core/{p-a561980f.entry.js.map → p-88d54b72.entry.js.map} +0 -0
  395. /package/dist/core/{p-c2884fcd.entry.js.map → p-917c5721.entry.js.map} +0 -0
  396. /package/dist/core/{p-217db3af.entry.js.map → p-942282cd.entry.js.map} +0 -0
  397. /package/dist/core/{p-99a9ce86.entry.js.map → p-a0f8efb2.entry.js.map} +0 -0
  398. /package/dist/core/{p-234edce6.entry.js.map → p-a31031a5.entry.js.map} +0 -0
  399. /package/dist/core/{p-faaa06d7.entry.js.map → p-a434c3d4.entry.js.map} +0 -0
  400. /package/dist/core/{p-ae337896.entry.js.map → p-a43c12cd.entry.js.map} +0 -0
  401. /package/dist/core/{p-010053ab.entry.js.map → p-a50c3b9e.entry.js.map} +0 -0
  402. /package/dist/core/{p-cedabab7.entry.js.map → p-b82dcc29.entry.js.map} +0 -0
  403. /package/dist/core/{p-8eaed5b7.entry.js.map → p-ba86928c.entry.js.map} +0 -0
  404. /package/dist/core/{p-9c6e48fb.entry.js.map → p-c125b65a.entry.js.map} +0 -0
  405. /package/dist/core/{p-452be32a.entry.js.map → p-c34848da.entry.js.map} +0 -0
  406. /package/dist/core/{p-1e9f689b.entry.js.map → p-d8469ac0.entry.js.map} +0 -0
  407. /package/dist/core/{p-79b39c8a.entry.js.map → p-db9c03c0.entry.js.map} +0 -0
  408. /package/dist/core/{p-eb922333.entry.js.map → p-e3997d60.entry.js.map} +0 -0
  409. /package/dist/core/{p-26ca8030.entry.js.map → p-e834344e.entry.js.map} +0 -0
  410. /package/dist/core/{p-2addb040.entry.js.map → p-f14454b1.entry.js.map} +0 -0
  411. /package/dist/core/{p-fc406db5.entry.js.map → p-f6888309.entry.js.map} +0 -0
  412. /package/dist/core/{p-e31125df.entry.js.map → p-f7a14c01.entry.js.map} +0 -0
@@ -0,0 +1,962 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { a as getLabelFromValue, b as getFilteredMenuOptions, g as getOptionsWithoutGroupTitlesCount, r as removeFormResetListener, d as inheritAttributes, e as removeDisabledFalse, f as addFormResetListener, o as onComponentRequiredPropUndefined, h as renderHiddenInput, j as getInputDescribedByText, k as isMobileOrTablet, l as hasValidationStatus } from './helpers2.js';
3
+ import { d as defineCustomElement$a } from './ic-button2.js';
4
+ import { d as defineCustomElement$9 } from './ic-input-component-container2.js';
5
+ import { d as defineCustomElement$8 } from './ic-input-container2.js';
6
+ import { d as defineCustomElement$7 } from './ic-input-label2.js';
7
+ import { d as defineCustomElement$6 } from './ic-input-validation2.js';
8
+ import { d as defineCustomElement$5 } from './ic-loading-indicator2.js';
9
+ import { d as defineCustomElement$4 } from './ic-menu3.js';
10
+ import { d as defineCustomElement$3 } from './ic-tooltip2.js';
11
+ import { d as defineCustomElement$2 } from './ic-typography2.js';
12
+
13
+ // Global ARIA attributes
14
+ const IC_INHERITED_ARIA = [
15
+ "aria-atomic",
16
+ "aria-autocomplete",
17
+ "aria-busy",
18
+ "aria-controls",
19
+ "aria-current",
20
+ "aria-describedby",
21
+ "aria-description",
22
+ "aria-details",
23
+ "aria-disabled",
24
+ "aria-dropeffect",
25
+ "aria-errormessage",
26
+ "aria-expanded",
27
+ "aria-flowto",
28
+ "aria-grabbed",
29
+ "aria-haspopup",
30
+ "aria-hidden",
31
+ "aria-invalid",
32
+ "aria-keyshortcuts",
33
+ "aria-label",
34
+ "aria-labelledby",
35
+ "aria-live",
36
+ "aria-owns",
37
+ "aria-relevant",
38
+ "aria-roledescription",
39
+ ];
40
+
41
+ var IcInformationStatus;
42
+ (function (IcInformationStatus) {
43
+ IcInformationStatus["Warning"] = "warning";
44
+ IcInformationStatus["Error"] = "error";
45
+ IcInformationStatus["Success"] = "success";
46
+ })(IcInformationStatus || (IcInformationStatus = {}));
47
+ var IcThemeForegroundEnum;
48
+ (function (IcThemeForegroundEnum) {
49
+ IcThemeForegroundEnum["Default"] = "default";
50
+ IcThemeForegroundEnum["Dark"] = "dark";
51
+ IcThemeForegroundEnum["Light"] = "light";
52
+ })(IcThemeForegroundEnum || (IcThemeForegroundEnum = {}));
53
+
54
+ const Expand = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
55
+ <path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />
56
+ </svg>
57
+ `;
58
+
59
+ const Clear = `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
60
+ <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" />
61
+ </svg>
62
+ `;
63
+
64
+ 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)}";
65
+
66
+ let inputIds = 0;
67
+ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement {
68
+ constructor() {
69
+ super();
70
+ this.__registerHost();
71
+ this.__attachShadow();
72
+ this.icBlur = createEvent(this, "icBlur", 7);
73
+ this.icChange = createEvent(this, "icChange", 7);
74
+ this.icClear = createEvent(this, "icClear", 7);
75
+ this.icFocus = createEvent(this, "icFocus", 7);
76
+ this.icInput = createEvent(this, "icInput", 7);
77
+ this.icOptionSelect = createEvent(this, "icOptionSelect", 7);
78
+ this.icOptionDeselect = createEvent(this, "icOptionDeselect", 7);
79
+ this.icRetryLoad = createEvent(this, "icRetryLoad", 7);
80
+ this.hasSetDefaultValue = false;
81
+ this.inheritedAttributes = {};
82
+ this.initialOptionsEmpty = false;
83
+ this.inputId = `ic-select-input-${inputIds++}`;
84
+ this.menuId = `${this.inputId}-menu`;
85
+ this.searchableMenuItemSelected = false;
86
+ this.ungroupedOptions = [];
87
+ this.handleRetry = (ev) => {
88
+ var _a;
89
+ if (ev.detail.keyPressed)
90
+ (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
91
+ this.blurredBecauseButtonPressed = true;
92
+ this.retryButtonClick = true;
93
+ this.hasSetDefaultValue = true;
94
+ this.icRetryLoad.emit({ value: this.hiddenInputValue });
95
+ };
96
+ this.emitIcChange = (value) => {
97
+ if (!this.searchable) {
98
+ // If "Select all" button clicked, replace value with new value (array of all option values)
99
+ if (this.multiple && !Array.isArray(value) && value !== null) {
100
+ this.handleMultipleSelectChange(value);
101
+ }
102
+ else {
103
+ this.value = value;
104
+ }
105
+ }
106
+ clearTimeout(this.debounceIcChange);
107
+ this.debounceIcChange = window.setTimeout(() => {
108
+ const valueToEmit = this.multiple ? this.value : value;
109
+ this.icChange.emit({ value: valueToEmit });
110
+ }, this.currDebounce);
111
+ };
112
+ this.emitImmediateIcChange = (value) => {
113
+ this.value = value;
114
+ clearTimeout(this.debounceIcChange);
115
+ this.icChange.emit({ value });
116
+ };
117
+ /**
118
+ * Processes the provided array of IcMenuOptions, removing duplicates and reporting them with a console.warn
119
+ * @param options array of IcMenuOptions
120
+ * @returns a new options object, with all entries possessing a duplicate 'value' field removed
121
+ */
122
+ this.deduplicateOptions = (options) => {
123
+ const uniqueValues = [];
124
+ const dedupedOptions = [];
125
+ let dedupedChildren;
126
+ options.forEach((option) => {
127
+ if (option.children) {
128
+ //If an option has children, we will loop through them
129
+ dedupedChildren = [];
130
+ option.children.forEach((child) => {
131
+ if (uniqueValues.includes(child.value)) {
132
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${child.value}) which has been removed.`);
133
+ }
134
+ else {
135
+ uniqueValues.push(child.value);
136
+ dedupedChildren.push(child);
137
+ }
138
+ });
139
+ // construct a modified option, inserting the deduplicated children alongside the original information
140
+ const modifiedParent = Object.assign(Object.assign({}, option), { children: dedupedChildren });
141
+ dedupedOptions.push(modifiedParent);
142
+ }
143
+ else {
144
+ // If an option does not have children, assess to see if it's value has been included already
145
+ if (uniqueValues.includes(option.value)) {
146
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
147
+ }
148
+ else {
149
+ uniqueValues.push(option.value);
150
+ dedupedOptions.push(option);
151
+ }
152
+ }
153
+ });
154
+ return dedupedOptions;
155
+ };
156
+ /**
157
+ * Loop through options array and for all options with no value, infer it from the label
158
+ */
159
+ this.setOptionsValuesFromLabels = () => {
160
+ if (this.options.length > 0 && this.options.map) {
161
+ this.options.map((option) => {
162
+ if (!option.value) {
163
+ option.value = option.label;
164
+ }
165
+ });
166
+ }
167
+ };
168
+ this.setUngroupedOptions = (event) => {
169
+ this.ungroupedOptions = event.detail.options;
170
+ };
171
+ this.setTextColor = () => {
172
+ if (this.nativeSelectElement.selectedIndex === 0) {
173
+ this.nativeSelectElement.className = "placeholder";
174
+ }
175
+ else {
176
+ this.nativeSelectElement.className = "select-option-selected";
177
+ }
178
+ };
179
+ this.setMenuChange = (open) => {
180
+ if (this.open !== open) {
181
+ this.open = open;
182
+ }
183
+ };
184
+ this.getLabelFromValue = (value) => {
185
+ return getLabelFromValue(value, this.uniqueOptions);
186
+ };
187
+ this.getMultipleOptionsString = (selectedValues) => {
188
+ const selectedLabels = selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.map((value) => this.getLabelFromValue(value));
189
+ return selectedLabels === null || selectedLabels === void 0 ? void 0 : selectedLabels.join(", ");
190
+ };
191
+ this.getFilteredChildMenuOptions = (option) => {
192
+ let children = option.children;
193
+ if (this.searchable) {
194
+ children = getFilteredMenuOptions(option.children, this.includeDescriptionsInSearch, this.searchableSelectInputValue, this.searchMatchPosition);
195
+ }
196
+ else {
197
+ children = getFilteredMenuOptions(option.children, false, this.pressedCharacters, "start");
198
+ }
199
+ const newOption = Object.assign({}, option);
200
+ newOption.children = children;
201
+ return newOption;
202
+ };
203
+ // (For multi-select) get value array, i.e. selected option values, in order they appear in option list
204
+ this.getValueSortedByOptions = (value) => {
205
+ const valueArray = value;
206
+ const valuesFromAllOptions = this.ungroupedOptions.map((option) => option.value);
207
+ valueArray.sort((a, b) => valuesFromAllOptions.indexOf(a) - valuesFromAllOptions.indexOf(b));
208
+ return valueArray;
209
+ };
210
+ this.handleNativeSelectChange = () => {
211
+ this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
212
+ this.emitImmediateIcChange(this.nativeSelectElement.value);
213
+ this.setTextColor();
214
+ };
215
+ // Handle option select for when a custom input box and menu is rendered
216
+ // (rather than native <select> - rendered when viewed on a mobile / tablet screen)
217
+ this.handleCustomSelectChange = (event) => {
218
+ var _a;
219
+ const value = event.detail.value;
220
+ if (this.searchable && event.detail.label === this.emptyOptionListText) {
221
+ this.searchableSelectElement.focus();
222
+ return;
223
+ }
224
+ if (this.searchable) {
225
+ this.value = value;
226
+ this.searchableMenuItemSelected = true;
227
+ // After editing the input, if selecting the same option as before, set the input value to label again
228
+ if (this.value === this.currValue) {
229
+ this.searchableSelectInputValue = this.getLabelFromValue(this.value);
230
+ }
231
+ this.inputValueToFilter = null;
232
+ this.hiddenInputValue = this.getValueFromLabel(this.searchableSelectInputValue);
233
+ }
234
+ if (this.multiple && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.includes(value))) {
235
+ this.icOptionDeselect.emit({ value });
236
+ }
237
+ else {
238
+ this.icOptionSelect.emit({ value });
239
+ }
240
+ this.ariaActiveDescendant = event.detail.optionId;
241
+ this.emitIcChange(value);
242
+ };
243
+ // Update selected options - adds / removes them, in order of option list
244
+ // Create new array if value prop is undefined
245
+ this.handleMultipleSelectChange = (value) => {
246
+ if (this.value) {
247
+ let valueArray = this.value.slice();
248
+ if (this.value.includes(value)) {
249
+ const valueIndex = valueArray.indexOf(value);
250
+ valueArray.splice(valueIndex, 1);
251
+ }
252
+ else {
253
+ valueArray.push(value);
254
+ valueArray = this.getValueSortedByOptions(valueArray);
255
+ }
256
+ this.value = valueArray.length === 0 ? null : valueArray;
257
+ }
258
+ else {
259
+ const valueArray = [];
260
+ valueArray.push(value);
261
+ this.value = valueArray;
262
+ }
263
+ };
264
+ this.handleSelectAllChange = (event) => {
265
+ const selectAllOptions = event.detail.select;
266
+ const allEnabledOptions = this.ungroupedOptions.filter((option) => !option.disabled);
267
+ const allValues = allEnabledOptions.map((option) => option.value);
268
+ let newValue;
269
+ if (selectAllOptions) {
270
+ let unselectedValues;
271
+ // Only emit icOptionSelect for all values that are newly selected
272
+ if (this.value) {
273
+ unselectedValues = allValues.filter((value) => this.value && !this.value.includes(value));
274
+ }
275
+ else {
276
+ unselectedValues = allValues;
277
+ }
278
+ unselectedValues.forEach((value) => this.icOptionSelect.emit({ value }));
279
+ newValue = allValues;
280
+ }
281
+ else {
282
+ // Only emit icOptionDeselect for values that were selected
283
+ this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
284
+ newValue = null;
285
+ }
286
+ this.emitIcChange(newValue);
287
+ };
288
+ this.handleMenuChange = (event) => {
289
+ this.open = event.detail.open;
290
+ this.pressedCharacters = "";
291
+ this.searchable && this.handleFocusIndicatorDisplay();
292
+ };
293
+ // clears the debounce delay when navigating the menu with arrow keys etc
294
+ // to prevent delay in change event, which should only occur when typing in input
295
+ this.handleMenuKeyPress = (ev) => {
296
+ ev.cancelBubble = true;
297
+ if (!this.multiple) {
298
+ this.handleCharacterKeyDown(ev.detail.key);
299
+ }
300
+ };
301
+ this.handleFocusIndicatorDisplay = () => {
302
+ const focusIndicator = this.el.shadowRoot.querySelector(".focus-indicator");
303
+ if (this.open) {
304
+ focusIndicator.classList.add("focus-indicator-enabled");
305
+ }
306
+ else {
307
+ focusIndicator.classList.remove("focus-indicator-enabled");
308
+ }
309
+ };
310
+ this.handleMouseDown = (event) => {
311
+ if (!this.open) {
312
+ event.preventDefault();
313
+ }
314
+ };
315
+ this.isExternalFiltering = () => this.searchable && this.disableFilter;
316
+ this.handleClick = (event) => {
317
+ var _a;
318
+ if (!this.open) {
319
+ if (this.isExternalFiltering()) {
320
+ this.menu.options = this.filteredOptions;
321
+ }
322
+ else if (!this.hasTimedOut &&
323
+ !this.loading &&
324
+ !((_a = this.noOptions) === null || _a === void 0 ? void 0 : _a.length) &&
325
+ (!this.searchable || this.searchableMenuItemSelected)) {
326
+ this.noOptions = null;
327
+ this.menu.options = this.uniqueOptions;
328
+ }
329
+ }
330
+ if (event.detail !== 0) {
331
+ this.menu.handleClickOpen();
332
+ }
333
+ };
334
+ this.handleExpandIconMouseDown = (event) => {
335
+ if (!this.disabled) {
336
+ event.preventDefault();
337
+ this.searchableSelectElement.focus();
338
+ this.handleClick(event);
339
+ }
340
+ };
341
+ this.handleClear = (event) => {
342
+ event.stopPropagation();
343
+ this.hasTimedOut = false;
344
+ clearTimeout(this.timeoutTimer);
345
+ this.noOptions = null;
346
+ this.emitImmediateIcChange(null);
347
+ this.icClear.emit();
348
+ if (this.searchable) {
349
+ this.searchableSelectElement.value = null;
350
+ this.searchableSelectInputValue = null;
351
+ this.filteredOptions = this.uniqueOptions;
352
+ this.hiddenInputValue = null;
353
+ this.searchableSelectElement.focus();
354
+ }
355
+ else {
356
+ this.customSelectElement.focus();
357
+ }
358
+ };
359
+ this.handleCharacterKeyDown = (key) => {
360
+ // Only close menu when space is pressed if not being used alongside character keys to quickly select options
361
+ if (this.open &&
362
+ key === " " &&
363
+ this.pressedCharacters.length === 0 &&
364
+ !this.hasTimedOut &&
365
+ !this.loading) {
366
+ this.setMenuChange(false);
367
+ }
368
+ if (key.length === 1 && !this.searchable) {
369
+ window.clearTimeout(this.characterKeyPressTimer);
370
+ this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
371
+ if (!(key === " " && !this.pressedCharacters)) {
372
+ this.pressedCharacters += key;
373
+ this.handleFilter();
374
+ if (!this.noOptions) {
375
+ this.emitImmediateIcChange(this.filteredOptions[0].value);
376
+ }
377
+ }
378
+ }
379
+ else {
380
+ this.pressedCharacters = "";
381
+ }
382
+ };
383
+ this.handleNativeSelectKeyDown = (event) => {
384
+ if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
385
+ event.cancelBubble = true;
386
+ }
387
+ this.handleCharacterKeyDown(event.key);
388
+ };
389
+ this.handleKeyDown = (event) => {
390
+ if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
391
+ event.cancelBubble = true;
392
+ }
393
+ const isArrowKey = event.key === "ArrowDown" || event.key === "ArrowUp";
394
+ if (!this.open) {
395
+ if (this.isExternalFiltering() && (event.key === "Enter" || isArrowKey)) {
396
+ this.menu.options = this.filteredOptions;
397
+ }
398
+ else {
399
+ if (!this.hasTimedOut) {
400
+ this.noOptions = null;
401
+ this.menu.options = this.uniqueOptions;
402
+ }
403
+ }
404
+ }
405
+ if (this.open && event.key === "Enter") {
406
+ this.setMenuChange(false);
407
+ }
408
+ else {
409
+ if (!(isArrowKey && this.noOptions !== null)) {
410
+ if (!(event.key === " " && this.pressedCharacters.length > 0)) {
411
+ // Keyboard events get passed onto ic-menu
412
+ this.menu.handleKeyboardOpen(event);
413
+ }
414
+ if (!this.multiple) {
415
+ this.handleCharacterKeyDown(event.key);
416
+ }
417
+ }
418
+ }
419
+ };
420
+ this.handleClearButtonFocus = () => {
421
+ this.clearButtonFocused = true;
422
+ };
423
+ this.handleClearButtonBlur = (ev) => {
424
+ var _a;
425
+ const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
426
+ if (!(this.searchableSelectElement &&
427
+ ev.relatedTarget === this.searchableSelectElement) &&
428
+ !(retryButton && ev.relatedTarget === retryButton)) {
429
+ this.setMenuChange(false);
430
+ this.handleFocusIndicatorDisplay();
431
+ }
432
+ this.clearButtonFocused = false;
433
+ };
434
+ this.handleFilter = () => {
435
+ var _a;
436
+ const options = this.deduplicateOptions(this.searchable ? [...this.uniqueOptions] : this.ungroupedOptions);
437
+ let isGrouped = false;
438
+ let newFilteredOptions = [];
439
+ options.map((option) => {
440
+ if (option.children)
441
+ isGrouped = true;
442
+ });
443
+ let menuOptionsFiltered;
444
+ if (this.searchable) {
445
+ menuOptionsFiltered = getFilteredMenuOptions(options, this.includeDescriptionsInSearch, this.inputValueToFilter, this.searchMatchPosition);
446
+ this.searchableMenuItemSelected = false;
447
+ }
448
+ else {
449
+ menuOptionsFiltered = getFilteredMenuOptions(options, false, this.pressedCharacters, "start");
450
+ }
451
+ if (!isGrouped &&
452
+ ((_a = menuOptionsFiltered[0]) === null || _a === void 0 ? void 0 : _a.label) !== this.emptyOptionListText) {
453
+ newFilteredOptions = menuOptionsFiltered;
454
+ }
455
+ else if (isGrouped) {
456
+ options.map((option) => {
457
+ if (this.includeGroupTitlesInSearch) {
458
+ if (menuOptionsFiltered.indexOf(option) !== -1) {
459
+ newFilteredOptions.push(option);
460
+ }
461
+ else {
462
+ newFilteredOptions.push(this.getFilteredChildMenuOptions(option));
463
+ }
464
+ }
465
+ else {
466
+ newFilteredOptions.push(this.getFilteredChildMenuOptions(option));
467
+ }
468
+ });
469
+ }
470
+ let noChildOptionsWhenFiltered = false;
471
+ if (isGrouped) {
472
+ noChildOptionsWhenFiltered = true;
473
+ newFilteredOptions.map((option) => {
474
+ if (option.children.length > 0) {
475
+ noChildOptionsWhenFiltered = false;
476
+ }
477
+ });
478
+ }
479
+ if (newFilteredOptions.length > 0 && !noChildOptionsWhenFiltered) {
480
+ this.noOptions = null;
481
+ this.filteredOptions = newFilteredOptions;
482
+ }
483
+ else {
484
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
485
+ this.filteredOptions = this.noOptions;
486
+ }
487
+ };
488
+ /**
489
+ * Put the select component into loading state.
490
+ * Replace options with the loading message. If timeout is enabled, set the timeout and once passed, replace options with the loading error message
491
+ */
492
+ this.triggerLoading = () => {
493
+ this.hasTimedOut = false;
494
+ this.noOptions = [{ label: this.loadingLabel, value: "", loading: true }];
495
+ if (this.filteredOptions !== this.noOptions && this.searchable) {
496
+ this.filteredOptions = this.noOptions;
497
+ }
498
+ else if (this.uniqueOptions !== this.noOptions && !this.searchable) {
499
+ this.uniqueOptions = this.noOptions;
500
+ }
501
+ if (this.timeout) {
502
+ this.timeoutTimer = window.setTimeout(() => {
503
+ this.loading = false;
504
+ this.hasTimedOut = true;
505
+ this.noOptions = [
506
+ { label: this.loadingErrorLabel, value: "", timedOut: true },
507
+ ];
508
+ this.filteredOptions = this.noOptions;
509
+ if (!this.searchable)
510
+ this.uniqueOptions = this.noOptions;
511
+ }, this.timeout);
512
+ }
513
+ };
514
+ this.getValueFromLabel = (label) => {
515
+ var _a;
516
+ return (_a = this.uniqueOptions.find((option) => option.label === label)) === null || _a === void 0 ? void 0 : _a.value;
517
+ };
518
+ this.handleSearchableSelectInput = (event) => {
519
+ this.searchableSelectInputValue = event.target.value;
520
+ this.icInput.emit({ value: this.searchableSelectInputValue });
521
+ this.emitIcChange(this.searchableSelectInputValue);
522
+ this.hiddenInputValue = this.searchableSelectInputValue;
523
+ this.inputValueToFilter = this.searchableSelectInputValue;
524
+ this.setMenuChange(true);
525
+ if (!this.disableFilter) {
526
+ this.handleFilter();
527
+ this.debounceAriaLiveUpdate();
528
+ }
529
+ };
530
+ this.updateSearchableSelectResultAriaLive = () => {
531
+ const searchableSelectResultsStatusEl = this.el.shadowRoot.querySelector(".searchable-select-results-status");
532
+ if (searchableSelectResultsStatusEl) {
533
+ if (this.noOptions !== null) {
534
+ searchableSelectResultsStatusEl.innerText = this.emptyOptionListText;
535
+ }
536
+ else {
537
+ searchableSelectResultsStatusEl.innerText = "";
538
+ }
539
+ }
540
+ };
541
+ this.updateMultiSelectedCountAriaLive = () => {
542
+ var _a;
543
+ const multiSelectSelectedCountEl = this.el.shadowRoot.querySelector(".multi-select-selected-count");
544
+ const selectedCount = `${(_a = this.currValue) === null || _a === void 0 ? void 0 : _a.length} of ${getOptionsWithoutGroupTitlesCount(this.options)} selected`;
545
+ if (multiSelectSelectedCountEl &&
546
+ multiSelectSelectedCountEl.innerText !== selectedCount) {
547
+ multiSelectSelectedCountEl.innerText = selectedCount;
548
+ }
549
+ };
550
+ this.getDefaultValue = (value) => this.getLabelFromValue(value) || value || null;
551
+ this.setDefaultValue = () => {
552
+ if (!this.hasSetDefaultValue && this.currValue) {
553
+ this.searchableSelectInputValue =
554
+ this.searchable && this.getDefaultValue(this.currValue);
555
+ this.initialValue = this.currValue;
556
+ this.hasSetDefaultValue = true;
557
+ }
558
+ };
559
+ this.onFocus = () => {
560
+ this.icFocus.emit();
561
+ };
562
+ this.onBlur = (event) => {
563
+ var _a;
564
+ const target = event.relatedTarget;
565
+ if (target !== null &&
566
+ target.tagName === "UL" &&
567
+ target.className.includes("menu")) {
568
+ return;
569
+ }
570
+ const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
571
+ const isSearchableAndNoFocusedInternalElements = this.searchable &&
572
+ event.relatedTarget !== this.menu &&
573
+ !Array.from(this.menu.querySelectorAll("[role='option']")).includes(event.relatedTarget) &&
574
+ !(this.clearButton && event.relatedTarget === this.clearButton) &&
575
+ !(retryButton && event.relatedTarget === retryButton);
576
+ if (isSearchableAndNoFocusedInternalElements) {
577
+ if (!this.retryButtonClick) {
578
+ this.setMenuChange(false);
579
+ }
580
+ this.handleFocusIndicatorDisplay();
581
+ }
582
+ this.retryButtonClick = false;
583
+ this.icBlur.emit();
584
+ };
585
+ this.onTimeoutBlur = (ev) => {
586
+ if (ev.detail.ev.relatedTarget !==
587
+ this.searchableSelectElement &&
588
+ !this.blurredBecauseButtonPressed) {
589
+ this.setMenuChange(false);
590
+ this.handleFocusIndicatorDisplay();
591
+ this.icBlur.emit();
592
+ }
593
+ this.blurredBecauseButtonPressed = false;
594
+ };
595
+ this.handleFormReset = () => {
596
+ this.value = this.initialValue;
597
+ if (this.searchable) {
598
+ this.searchableSelectInputValue = this.getDefaultValue(this.value);
599
+ this.hiddenInputValue = this.value;
600
+ }
601
+ };
602
+ this.ariaActiveDescendant = undefined;
603
+ this.clearButtonFocused = false;
604
+ this.debounceIcChange = undefined;
605
+ this.hiddenInputValue = undefined;
606
+ this.noOptions = null;
607
+ this.open = false;
608
+ this.pressedCharacters = "";
609
+ this.searchableSelectInputValue = null;
610
+ this.charactersUntilSuggestions = 0;
611
+ this.disabled = false;
612
+ this.disableFilter = false;
613
+ this.emptyOptionListText = "No results found";
614
+ this.form = undefined;
615
+ this.formaction = undefined;
616
+ this.formenctype = undefined;
617
+ this.formmethod = undefined;
618
+ this.formnovalidate = undefined;
619
+ this.formtarget = undefined;
620
+ this.fullWidth = false;
621
+ this.helperText = "";
622
+ this.hideLabel = false;
623
+ this.includeDescriptionsInSearch = false;
624
+ this.includeGroupTitlesInSearch = false;
625
+ this.label = undefined;
626
+ this.loadingErrorLabel = "Loading Error";
627
+ this.loadingLabel = "Loading...";
628
+ this.multiple = false;
629
+ this.name = this.inputId;
630
+ this.placeholder = "Select an option";
631
+ this.readonly = false;
632
+ this.required = false;
633
+ this.searchable = false;
634
+ this.searchMatchPosition = "anywhere";
635
+ this.selectOnEnter = false;
636
+ this.showClearButton = false;
637
+ this.size = "default";
638
+ this.small = false;
639
+ this.timeout = undefined;
640
+ this.validationStatus = "";
641
+ this.validationText = "";
642
+ this.loading = false;
643
+ this.options = [];
644
+ this.filteredOptions = this.options;
645
+ this.uniqueOptions = this.options;
646
+ this.debounce = 0;
647
+ this.currDebounce = this.debounce;
648
+ this.value = undefined;
649
+ this.initialValue = this.value;
650
+ this.inputValueToFilter = this.value;
651
+ this.currValue = this.value;
652
+ }
653
+ loadingHandler(newValue) {
654
+ newValue && this.triggerLoading();
655
+ }
656
+ watchOptionsHandler() {
657
+ if (!this.hasTimedOut && this.options !== this.noOptions) {
658
+ this.loading = false;
659
+ clearTimeout(this.timeoutTimer);
660
+ if (this.isExternalFiltering()) {
661
+ // When searchable select
662
+ if (this.options.length > 0) {
663
+ this.setOptionsValuesFromLabels();
664
+ this.noOptions = null;
665
+ this.uniqueOptions = this.deduplicateOptions(this.options);
666
+ this.filteredOptions = this.uniqueOptions;
667
+ }
668
+ else {
669
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
670
+ this.uniqueOptions = this.noOptions;
671
+ this.filteredOptions = this.noOptions;
672
+ }
673
+ this.updateSearchableSelectResultAriaLive();
674
+ this.setDefaultValue();
675
+ }
676
+ else {
677
+ this.setOptionsValuesFromLabels();
678
+ this.uniqueOptions = this.deduplicateOptions(this.options);
679
+ this.filteredOptions = this.uniqueOptions;
680
+ if (this.initialOptionsEmpty) {
681
+ this.setDefaultValue();
682
+ this.initialOptionsEmpty = false;
683
+ }
684
+ }
685
+ }
686
+ else {
687
+ if (!this.searchable)
688
+ this.options = this.noOptions;
689
+ }
690
+ }
691
+ debounceChangedHandler(newValue) {
692
+ this.updateOnChangeDebounce(newValue);
693
+ }
694
+ valueChangedHandler() {
695
+ if (this.value !== this.currValue) {
696
+ if (this.value && this.multiple) {
697
+ this.currValue = this.getValueSortedByOptions(this.value);
698
+ this.updateMultiSelectedCountAriaLive();
699
+ }
700
+ else {
701
+ this.currValue = this.value;
702
+ }
703
+ }
704
+ if (this.searchable) {
705
+ this.searchableSelectInputValue =
706
+ this.getLabelFromValue(this.currValue) ||
707
+ this.currValue;
708
+ }
709
+ }
710
+ disconnectedCallback() {
711
+ removeFormResetListener(this.el, this.handleFormReset);
712
+ }
713
+ componentWillLoad() {
714
+ this.inheritedAttributes = inheritAttributes(this.el, [
715
+ ...IC_INHERITED_ARIA,
716
+ "tabindex",
717
+ "title",
718
+ ]);
719
+ removeDisabledFalse(this.disabled, this.el);
720
+ this.setOptionsValuesFromLabels();
721
+ addFormResetListener(this.el, this.handleFormReset);
722
+ if (!this.options.length) {
723
+ this.initialOptionsEmpty = true;
724
+ this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
725
+ this.uniqueOptions = this.noOptions;
726
+ this.filteredOptions = this.noOptions;
727
+ }
728
+ else {
729
+ this.setDefaultValue();
730
+ this.uniqueOptions = this.deduplicateOptions(this.options);
731
+ }
732
+ }
733
+ componentDidLoad() {
734
+ onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Select");
735
+ if (this.loading) {
736
+ this.triggerLoading();
737
+ }
738
+ this.hiddenInputValue = this.searchable && this.currValue;
739
+ }
740
+ componentDidRender() {
741
+ if (this.nativeSelectElement && !this.disabled) {
742
+ this.setTextColor();
743
+ }
744
+ }
745
+ /**
746
+ * Sets focus on the input box.
747
+ */
748
+ async setFocus() {
749
+ if (this.nativeSelectElement) {
750
+ this.nativeSelectElement.focus();
751
+ }
752
+ else if (this.customSelectElement) {
753
+ this.customSelectElement.focus();
754
+ }
755
+ else if (this.searchableSelectElement) {
756
+ this.searchableSelectElement.focus();
757
+ }
758
+ }
759
+ updateOnChangeDebounce(newValue) {
760
+ if (this.currDebounce !== newValue) {
761
+ this.currDebounce = newValue;
762
+ }
763
+ }
764
+ debounceAriaLiveUpdate() {
765
+ clearTimeout(this.debounceAria);
766
+ window.setTimeout(() => {
767
+ this.updateSearchableSelectResultAriaLive();
768
+ }, 800);
769
+ }
770
+ render() {
771
+ const { size, small, disabled, fullWidth, helperText, hideLabel, label, menuId, multiple, name, options, placeholder, readonly, required, searchable, showClearButton, validationStatus, validationText, currValue, } = this;
772
+ // HTML inputs only accept 'string' for their value
773
+ // Does not cause errors when it is a multi-select - sets value correctly, to a comma-separated string
774
+ renderHiddenInput(true, this.el, name, this.searchable ? this.hiddenInputValue : currValue, disabled);
775
+ const invalid = validationStatus === IcInformationStatus.Error ? "true" : "false";
776
+ const describedBy = getInputDescribedByText(this.inputId, helperText !== "", hasValidationStatus(this.validationStatus, this.disabled)).trim();
777
+ const optionsSelectedCount = `${currValue === null || currValue === void 0 ? void 0 : currValue.length} of ${getOptionsWithoutGroupTitlesCount(this.options)} selected`;
778
+ return (h(Host, { class: {
779
+ disabled: disabled,
780
+ searchable: searchable,
781
+ small: small,
782
+ [size]: size !== "default",
783
+ "full-width": fullWidth,
784
+ }, onBlur: this.onBlur }, h("ic-input-container", { readonly: readonly }, !hideLabel && (h("ic-input-label", { for: this.inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly })), 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 ? (h("ic-typography", null, h("p", null, multiple
785
+ ? this.getMultipleOptionsString(currValue)
786
+ : this.getLabelFromValue(currValue)))) : isMobileOrTablet() && !multiple ? (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), h("option", { value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => {
787
+ if (option.children) {
788
+ return (h("optgroup", { label: option.label }, option.children.map((option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === currValue }, option.label)))));
789
+ }
790
+ else {
791
+ return (h("option", { value: option.value, disabled: option.disabled, selected: option.value === currValue }, option.label));
792
+ }
793
+ }))) : searchable ? (h("div", { class: "searchable-select-container" }, h("input", { class: {
794
+ "select-input": true,
795
+ "with-clear-button": !!this.searchableSelectInputValue,
796
+ }, 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 &&
797
+ (showClearButton || searchable) && (h("div", { class: "clear-button-container" }, h("ic-button", { id: "clear-button", ref: (el) => (this.clearButton = el), "aria-label": this.searchableSelectInputValue && currValue === null
798
+ ? "Clear input"
799
+ : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearButtonFocus, onBlur: this.handleClearButtonBlur, size: size, variant: "icon", appearance: this.clearButtonFocused
800
+ ? IcThemeForegroundEnum.Light
801
+ : IcThemeForegroundEnum.Dark }), h("div", { class: "divider" }))), h("span", { onMouseDown: this.handleExpandIconMouseDown, class: {
802
+ "expand-icon": true,
803
+ "expand-icon-open": this.open,
804
+ }, innerHTML: Expand, "aria-hidden": "true" }), h("div", { "aria-live": "polite", role: "status", class: "searchable-select-results-status" }))) : (h("div", { class: "select-container" }, h("button", { class: "select-input", ref: (el) => (this.customSelectElement = el), id: this.inputId, "aria-label": `${label}, ${(multiple && currValue
805
+ ? `${optionsSelectedCount}, ${this.getMultipleOptionsString(currValue)}`
806
+ : this.getLabelFromValue(currValue)) ||
807
+ 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 }, h("ic-typography", { variant: "body", class: {
808
+ "value-text": true,
809
+ "with-clear-button": currValue && showClearButton,
810
+ placeholder: !this.value || (multiple && this.value.length < 1),
811
+ } }, h("p", null, (multiple
812
+ ? this.getMultipleOptionsString(currValue)
813
+ : this.getLabelFromValue(currValue)) ||
814
+ placeholder)), h("div", { class: "select-input-end" }, currValue && showClearButton && (h("div", { class: "divider" })), h("span", { class: {
815
+ "expand-icon": true,
816
+ "expand-icon-open": this.open,
817
+ }, innerHTML: Expand, "aria-hidden": "true" }))), currValue && showClearButton && (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
818
+ ? IcThemeForegroundEnum.Light
819
+ : IcThemeForegroundEnum.Dark }))))), (!isMobileOrTablet() || multiple) && (h("ic-menu-with-multi", { class: {
820
+ "no-results": this.loading ||
821
+ this.hasTimedOut ||
822
+ (this.noOptions !== null &&
823
+ this.noOptions[0] &&
824
+ this.noOptions[0].label === this.emptyOptionListText),
825
+ }, ref: (el) => (this.menu = el), inputEl: searchable
826
+ ? this.searchableSelectElement
827
+ : 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
828
+ ? "manual"
829
+ : "automatic", closeOnSelect: !multiple })), this.multiple && (h("div", { "aria-live": "polite", role: "status", class: "multi-select-selected-count" })), hasValidationStatus(this.validationStatus, this.disabled) && (h("ic-input-validation", { class: { "menu-open": this.open }, ariaLiveMode: "polite", status: validationStatus, message: validationText, for: this.inputId })))));
830
+ }
831
+ static get delegatesFocus() { return true; }
832
+ get el() { return this; }
833
+ static get watchers() { return {
834
+ "loading": ["loadingHandler"],
835
+ "options": ["watchOptionsHandler"],
836
+ "debounce": ["debounceChangedHandler"],
837
+ "value": ["valueChangedHandler"]
838
+ }; }
839
+ static get style() { return icSelectCss; }
840
+ }, [17, "ic-select-with-multi", {
841
+ "charactersUntilSuggestions": [2, "characters-until-suggestions"],
842
+ "disabled": [516],
843
+ "disableFilter": [4, "disable-filter"],
844
+ "emptyOptionListText": [1, "empty-option-list-text"],
845
+ "form": [1],
846
+ "formaction": [1],
847
+ "formenctype": [1],
848
+ "formmethod": [1],
849
+ "formnovalidate": [4],
850
+ "formtarget": [1],
851
+ "fullWidth": [4, "full-width"],
852
+ "helperText": [1, "helper-text"],
853
+ "hideLabel": [4, "hide-label"],
854
+ "includeDescriptionsInSearch": [4, "include-descriptions-in-search"],
855
+ "includeGroupTitlesInSearch": [4, "include-group-titles-in-search"],
856
+ "label": [1],
857
+ "loadingErrorLabel": [1, "loading-error-label"],
858
+ "loadingLabel": [1, "loading-label"],
859
+ "multiple": [4],
860
+ "name": [1],
861
+ "placeholder": [1],
862
+ "readonly": [4],
863
+ "required": [4],
864
+ "searchable": [4],
865
+ "searchMatchPosition": [1, "search-match-position"],
866
+ "selectOnEnter": [4, "select-on-enter"],
867
+ "showClearButton": [4, "show-clear-button"],
868
+ "size": [1],
869
+ "small": [4],
870
+ "timeout": [2],
871
+ "validationStatus": [1, "validation-status"],
872
+ "validationText": [1, "validation-text"],
873
+ "loading": [1028],
874
+ "options": [16],
875
+ "debounce": [2],
876
+ "value": [1025],
877
+ "ariaActiveDescendant": [32],
878
+ "clearButtonFocused": [32],
879
+ "debounceIcChange": [32],
880
+ "hiddenInputValue": [32],
881
+ "noOptions": [32],
882
+ "open": [32],
883
+ "pressedCharacters": [32],
884
+ "searchableSelectInputValue": [32],
885
+ "filteredOptions": [32],
886
+ "uniqueOptions": [32],
887
+ "currDebounce": [32],
888
+ "initialValue": [32],
889
+ "inputValueToFilter": [32],
890
+ "currValue": [32],
891
+ "setFocus": [64]
892
+ }, undefined, {
893
+ "loading": ["loadingHandler"],
894
+ "options": ["watchOptionsHandler"],
895
+ "debounce": ["debounceChangedHandler"],
896
+ "value": ["valueChangedHandler"]
897
+ }]);
898
+ function defineCustomElement$1() {
899
+ if (typeof customElements === "undefined") {
900
+ return;
901
+ }
902
+ const components = ["ic-select-with-multi", "ic-button", "ic-input-component-container", "ic-input-container", "ic-input-label", "ic-input-validation", "ic-loading-indicator", "ic-menu-with-multi", "ic-tooltip", "ic-typography"];
903
+ components.forEach(tagName => { switch (tagName) {
904
+ case "ic-select-with-multi":
905
+ if (!customElements.get(tagName)) {
906
+ customElements.define(tagName, Select);
907
+ }
908
+ break;
909
+ case "ic-button":
910
+ if (!customElements.get(tagName)) {
911
+ defineCustomElement$a();
912
+ }
913
+ break;
914
+ case "ic-input-component-container":
915
+ if (!customElements.get(tagName)) {
916
+ defineCustomElement$9();
917
+ }
918
+ break;
919
+ case "ic-input-container":
920
+ if (!customElements.get(tagName)) {
921
+ defineCustomElement$8();
922
+ }
923
+ break;
924
+ case "ic-input-label":
925
+ if (!customElements.get(tagName)) {
926
+ defineCustomElement$7();
927
+ }
928
+ break;
929
+ case "ic-input-validation":
930
+ if (!customElements.get(tagName)) {
931
+ defineCustomElement$6();
932
+ }
933
+ break;
934
+ case "ic-loading-indicator":
935
+ if (!customElements.get(tagName)) {
936
+ defineCustomElement$5();
937
+ }
938
+ break;
939
+ case "ic-menu-with-multi":
940
+ if (!customElements.get(tagName)) {
941
+ defineCustomElement$4();
942
+ }
943
+ break;
944
+ case "ic-tooltip":
945
+ if (!customElements.get(tagName)) {
946
+ defineCustomElement$3();
947
+ }
948
+ break;
949
+ case "ic-typography":
950
+ if (!customElements.get(tagName)) {
951
+ defineCustomElement$2();
952
+ }
953
+ break;
954
+ } });
955
+ }
956
+
957
+ const IcSelectWithMulti = Select;
958
+ const defineCustomElement = defineCustomElement$1;
959
+
960
+ export { IcSelectWithMulti, defineCustomElement };
961
+
962
+ //# sourceMappingURL=ic-select-with-multi.js.map