@ukic/web-components 3.21.0 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (437) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-3a796e7a.js → helpers-81cd6930.js} +3 -16
  3. package/dist/cjs/helpers-81cd6930.js.map +1 -0
  4. package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  6. package/dist/cjs/ic-action-chip.cjs.entry.js +7 -3
  7. package/dist/cjs/ic-action-chip.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  10. package/dist/cjs/ic-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-button_3.cjs.entry.js +1 -1
  14. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  15. package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-card-vertical.cjs.entry.js +1 -1
  17. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  18. package/dist/cjs/ic-checkbox.cjs.entry.js +5 -5
  19. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-chip.cjs.entry.js +7 -3
  21. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-classification-banner.cjs.entry.js +13 -5
  23. package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  25. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  26. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  27. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  28. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  29. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  30. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  31. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +212 -80
  34. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  35. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  38. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  42. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-pagination-bar.cjs.entry.js +389 -0
  46. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -0
  47. package/dist/cjs/ic-pagination-item.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-pagination_3.cjs.entry.js +1412 -0
  49. package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -0
  50. package/dist/cjs/ic-popover-menu.cjs.entry.js +5 -5
  51. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-search-bar.cjs.entry.js +11 -11
  54. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  55. package/dist/cjs/ic-section-container.cjs.entry.js +2 -2
  56. package/dist/cjs/ic-side-navigation.cjs.entry.js +18 -9
  57. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  58. package/dist/cjs/ic-skeleton.cjs.entry.js +2 -2
  59. package/dist/cjs/ic-skip-link.cjs.entry.js +2 -2
  60. package/dist/cjs/ic-status-tag.cjs.entry.js +3 -3
  61. package/dist/cjs/ic-step.cjs.entry.js +14 -14
  62. package/dist/cjs/ic-stepper.cjs.entry.js +3 -3
  63. package/dist/cjs/ic-stepper.cjs.entry.js.map +1 -1
  64. package/dist/cjs/ic-switch.cjs.entry.js +5 -5
  65. package/dist/cjs/ic-tab-context.cjs.entry.js +1 -2
  66. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  67. package/dist/cjs/ic-tab-group.cjs.entry.js +3 -3
  68. package/dist/cjs/ic-tab-panel.cjs.entry.js +2 -2
  69. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-theme.cjs.entry.js +2 -2
  71. package/dist/cjs/ic-toast-region.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-toast.cjs.entry.js +8 -7
  73. package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
  74. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +3 -3
  75. package/dist/cjs/ic-toggle-button.cjs.entry.js +3 -3
  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-d337cd8a.js +12 -16
  79. package/dist/cjs/loader.cjs.js +1 -1
  80. package/dist/collection/collection-manifest.json +2 -1
  81. package/dist/collection/components/ic-action-chip/ic-action-chip.css +15 -2
  82. package/dist/collection/components/ic-action-chip/ic-action-chip.js +5 -1
  83. package/dist/collection/components/ic-action-chip/ic-action-chip.js.map +1 -1
  84. package/dist/collection/components/ic-checkbox/ic-checkbox.js +4 -5
  85. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  86. package/dist/collection/components/ic-chip/ic-chip.css +15 -3
  87. package/dist/collection/components/ic-chip/ic-chip.js +5 -1
  88. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
  89. package/dist/collection/components/ic-classification-banner/ic-classification-banner.js +33 -5
  90. package/dist/collection/components/ic-classification-banner/ic-classification-banner.js.map +1 -1
  91. package/dist/collection/components/ic-classification-banner/ic-classification-banner.stories.js +32 -0
  92. package/dist/collection/components/ic-menu/ic-menu.css +6 -1
  93. package/dist/collection/components/ic-menu/ic-menu.js +184 -53
  94. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  95. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.css +104 -0
  96. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +895 -0
  97. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -0
  98. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.stories.js +215 -0
  99. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js +2 -0
  100. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js.map +1 -0
  101. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +4 -4
  102. package/dist/collection/components/ic-search-bar/ic-search-bar.js +10 -11
  103. package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
  104. package/dist/collection/components/ic-section-container/ic-section-container.js +2 -2
  105. package/dist/collection/components/ic-select/ic-select.css +1 -2
  106. package/dist/collection/components/ic-select/ic-select.js +414 -589
  107. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  108. package/dist/collection/components/ic-select/ic-select.types.js +2 -0
  109. package/dist/collection/components/ic-select/ic-select.types.js.map +1 -0
  110. package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +26 -21
  111. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js +18 -9
  112. package/dist/collection/components/ic-side-navigation/ic-side-navigation.js.map +1 -1
  113. package/dist/collection/components/ic-skeleton/ic-skeleton.js +2 -2
  114. package/dist/collection/components/ic-skip-link/ic-skip-link.js +2 -2
  115. package/dist/collection/components/ic-status-tag/ic-status-tag.js +2 -2
  116. package/dist/collection/components/ic-step/ic-step.js +13 -13
  117. package/dist/collection/components/ic-stepper/ic-stepper.js +2 -2
  118. package/dist/collection/components/ic-stepper/ic-stepper.js.map +1 -1
  119. package/dist/collection/components/ic-switch/ic-switch.js +4 -4
  120. package/dist/collection/components/ic-tab-context/ic-tab-context.js +1 -2
  121. package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
  122. package/dist/collection/components/ic-tab-group/ic-tab-group.js +2 -2
  123. package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +2 -2
  124. package/dist/collection/components/ic-theme/ic-theme.js +1 -1
  125. package/dist/collection/components/ic-toast/ic-toast.js +7 -6
  126. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  127. package/dist/collection/components/ic-toast-region/ic-toast-region.js +1 -1
  128. package/dist/collection/components/ic-toggle-button/ic-toggle-button.js +2 -2
  129. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +2 -2
  130. package/dist/collection/utils/helpers.js +2 -15
  131. package/dist/collection/utils/helpers.js.map +1 -1
  132. package/dist/components/helpers.js +3 -16
  133. package/dist/components/helpers.js.map +1 -1
  134. package/dist/components/ic-action-chip.js +6 -2
  135. package/dist/components/ic-action-chip.js.map +1 -1
  136. package/dist/components/ic-card-vertical.js.map +1 -1
  137. package/dist/components/ic-checkbox.js +4 -4
  138. package/dist/components/ic-checkbox.js.map +1 -1
  139. package/dist/components/ic-chip.js +6 -2
  140. package/dist/components/ic-chip.js.map +1 -1
  141. package/dist/components/ic-classification-banner.js +14 -5
  142. package/dist/components/ic-classification-banner.js.map +1 -1
  143. package/dist/components/ic-menu2.js +213 -79
  144. package/dist/components/ic-menu2.js.map +1 -1
  145. package/dist/components/ic-pagination-bar.d.ts +11 -0
  146. package/dist/components/ic-pagination-bar.js +523 -0
  147. package/dist/components/ic-pagination-bar.js.map +1 -0
  148. package/dist/components/ic-pagination.js +1 -375
  149. package/dist/components/ic-pagination.js.map +1 -1
  150. package/dist/{esm/ic-pagination.entry.js → components/ic-pagination2.js} +82 -11
  151. package/dist/components/ic-pagination2.js.map +1 -0
  152. package/dist/components/ic-popover-menu.js +4 -4
  153. package/dist/components/ic-popover-menu.js.map +1 -1
  154. package/dist/components/ic-radio-group.js.map +1 -1
  155. package/dist/components/ic-radio-option.js.map +1 -1
  156. package/dist/components/ic-search-bar.js +11 -11
  157. package/dist/components/ic-search-bar.js.map +1 -1
  158. package/dist/components/ic-section-container2.js +2 -2
  159. package/dist/components/ic-select.js +1 -994
  160. package/dist/components/ic-select.js.map +1 -1
  161. package/dist/components/ic-select2.js +804 -0
  162. package/dist/components/ic-select2.js.map +1 -0
  163. package/dist/components/ic-side-navigation.js +18 -9
  164. package/dist/components/ic-side-navigation.js.map +1 -1
  165. package/dist/components/ic-skeleton.js +2 -2
  166. package/dist/components/ic-skip-link.js +2 -2
  167. package/dist/components/ic-status-tag.js +2 -2
  168. package/dist/components/ic-step.js +13 -13
  169. package/dist/components/ic-stepper.js +2 -2
  170. package/dist/components/ic-stepper.js.map +1 -1
  171. package/dist/components/ic-switch.js +4 -4
  172. package/dist/components/ic-switch.js.map +1 -1
  173. package/dist/components/ic-tab-context.js +1 -2
  174. package/dist/components/ic-tab-context.js.map +1 -1
  175. package/dist/components/ic-tab-group.js +2 -2
  176. package/dist/components/ic-tab-panel.js +2 -2
  177. package/dist/components/ic-tab-panel.js.map +1 -1
  178. package/dist/components/ic-text-field.js +1 -528
  179. package/dist/components/ic-text-field.js.map +1 -1
  180. package/dist/{esm/ic-text-field.entry.js → components/ic-text-field2.js} +114 -11
  181. package/dist/components/ic-text-field2.js.map +1 -0
  182. package/dist/components/ic-theme.js +1 -1
  183. package/dist/components/ic-toast-region.js +1 -1
  184. package/dist/components/ic-toast.js +7 -6
  185. package/dist/components/ic-toast.js.map +1 -1
  186. package/dist/components/ic-toggle-button-group.js +2 -2
  187. package/dist/components/ic-toggle-button.js +2 -2
  188. package/dist/core/core.esm.js +1 -1
  189. package/dist/core/core.esm.js.map +1 -1
  190. package/dist/core/{p-0a24c536.entry.js → p-05fd2707.entry.js} +2 -2
  191. package/dist/core/{p-85e15d01.entry.js → p-09505807.entry.js} +2 -2
  192. package/dist/core/{p-96bc7d24.entry.js → p-09caf7ed.entry.js} +2 -2
  193. package/dist/core/p-09caf7ed.entry.js.map +1 -0
  194. package/dist/core/{p-9057a186.entry.js → p-0b728f50.entry.js} +2 -2
  195. package/dist/core/{p-9057a186.entry.js.map → p-0b728f50.entry.js.map} +1 -1
  196. package/dist/core/p-0fb7f915.entry.js +2 -0
  197. package/dist/core/p-0fb7f915.entry.js.map +1 -0
  198. package/dist/core/{p-41a5da12.entry.js → p-1b81ec88.entry.js} +2 -2
  199. package/dist/core/{p-99951365.entry.js → p-2691cc80.entry.js} +2 -2
  200. package/dist/core/{p-94916588.entry.js → p-2a124daf.entry.js} +2 -2
  201. package/dist/core/{p-04c77b2d.entry.js → p-2b87c592.entry.js} +2 -2
  202. package/dist/core/{p-4aa56990.entry.js → p-2bd80913.entry.js} +2 -2
  203. package/dist/core/{p-aed1c7e7.entry.js → p-347cc084.entry.js} +2 -2
  204. package/dist/core/p-393af2bc.entry.js +2 -0
  205. package/dist/core/p-393af2bc.entry.js.map +1 -0
  206. package/dist/core/{p-a3dea729.entry.js → p-3aed13ba.entry.js} +2 -2
  207. package/dist/core/{p-8da90b72.entry.js → p-46fd555f.entry.js} +2 -2
  208. package/dist/core/{p-43cc0f1d.entry.js → p-48a628f0.entry.js} +2 -2
  209. package/dist/core/{p-9a4e067f.entry.js → p-4f56acff.entry.js} +2 -2
  210. package/dist/core/{p-3021290f.entry.js → p-506d428a.entry.js} +2 -2
  211. package/dist/core/{p-a1b2f483.entry.js → p-50dca790.entry.js} +2 -2
  212. package/dist/core/p-53ab3c0f.entry.js +2 -0
  213. package/dist/core/p-53ab3c0f.entry.js.map +1 -0
  214. package/dist/core/{p-feef7c2c.entry.js → p-56de4f4b.entry.js} +2 -2
  215. package/dist/core/{p-b4e322fe.entry.js → p-5900cb65.entry.js} +2 -2
  216. package/dist/core/{p-78a54069.entry.js → p-5976de6e.entry.js} +2 -2
  217. package/dist/core/{p-2af89564.entry.js → p-61d79fc6.entry.js} +2 -2
  218. package/dist/core/{p-2af89564.entry.js.map → p-61d79fc6.entry.js.map} +1 -1
  219. package/dist/core/p-659d048d.entry.js +2 -0
  220. package/dist/core/{p-1edf2689.entry.js → p-67de1290.entry.js} +2 -2
  221. package/dist/core/p-6b4ec95f.entry.js +3 -0
  222. package/dist/core/p-6b4ec95f.entry.js.map +1 -0
  223. package/dist/core/{p-f700b759.entry.js → p-73043f57.entry.js} +2 -2
  224. package/dist/core/{p-7b8e5926.entry.js → p-735d3096.entry.js} +2 -2
  225. package/dist/core/{p-07075461.entry.js → p-7b538fd1.entry.js} +2 -2
  226. package/dist/core/{p-cfd43558.entry.js → p-80d85403.entry.js} +2 -2
  227. package/dist/core/{p-7f279c8a.entry.js → p-83578f1d.entry.js} +2 -2
  228. package/dist/core/{p-7f279c8a.entry.js.map → p-83578f1d.entry.js.map} +1 -1
  229. package/dist/core/{p-b8c0c142.entry.js → p-880f7548.entry.js} +2 -2
  230. package/dist/core/p-880f7548.entry.js.map +1 -0
  231. package/dist/core/{p-79949920.entry.js → p-8a833e82.entry.js} +2 -2
  232. package/dist/core/{p-0aba9e31.entry.js → p-90678e67.entry.js} +2 -2
  233. package/dist/core/{p-a851eb65.entry.js → p-9502fb86.entry.js} +2 -2
  234. package/dist/core/{p-2ca7f050.entry.js → p-99433296.entry.js} +2 -2
  235. package/dist/core/p-99433296.entry.js.map +1 -0
  236. package/dist/core/{p-f6de08fb.entry.js → p-9c2b2cb9.entry.js} +2 -2
  237. package/dist/core/{p-949d08d3.entry.js → p-9cb83a2e.entry.js} +2 -2
  238. package/dist/core/{p-f0ecb80b.entry.js → p-a08d6b46.entry.js} +2 -2
  239. package/dist/core/p-a321feee.entry.js +2 -0
  240. package/dist/core/p-a321feee.entry.js.map +1 -0
  241. package/dist/core/{p-208f470f.entry.js → p-a780a34b.entry.js} +2 -2
  242. package/dist/core/{p-387b7bca.entry.js → p-aad03a3c.entry.js} +2 -2
  243. package/dist/core/{p-ec14c783.entry.js → p-aaf4e367.entry.js} +2 -2
  244. package/dist/core/{p-707ae6e9.entry.js → p-b52c44eb.entry.js} +2 -2
  245. package/dist/core/{p-716e7eaf.entry.js → p-b777f0a1.entry.js} +2 -2
  246. package/dist/core/p-b777f0a1.entry.js.map +1 -0
  247. package/dist/core/p-b77b1e1f.js +2 -0
  248. package/dist/core/p-b77b1e1f.js.map +1 -0
  249. package/dist/core/{p-780babc0.entry.js → p-b997ad5e.entry.js} +2 -2
  250. package/dist/core/{p-a0af1b0a.entry.js → p-bb7652cd.entry.js} +2 -2
  251. package/dist/core/{p-ded4cd76.entry.js → p-cbca04bb.entry.js} +2 -2
  252. package/dist/core/{p-99687bce.entry.js → p-cc64e5ef.entry.js} +2 -2
  253. package/dist/core/{p-812c5e61.entry.js → p-cfbacca1.entry.js} +2 -2
  254. package/dist/core/{p-0da2caa2.entry.js → p-daec7e69.entry.js} +2 -2
  255. package/dist/core/{p-1590fd69.entry.js → p-e7767c0d.entry.js} +2 -2
  256. package/dist/core/p-e938eb31.entry.js +2 -0
  257. package/dist/core/p-e938eb31.entry.js.map +1 -0
  258. package/dist/core/{p-dce11b9d.entry.js → p-ea7a3d30.entry.js} +2 -2
  259. package/dist/core/{p-880afd4b.entry.js → p-ebd688b9.entry.js} +2 -2
  260. package/dist/core/p-ebd688b9.entry.js.map +1 -0
  261. package/dist/core/{p-a674b13b.entry.js → p-ef70ea50.entry.js} +2 -2
  262. package/dist/core/{p-d25d0aad.entry.js → p-f64996f1.entry.js} +2 -2
  263. package/dist/core/{p-db17a793.entry.js → p-f661ba76.entry.js} +2 -2
  264. package/dist/core/{p-a03bb31c.entry.js → p-f84ac9c6.entry.js} +2 -2
  265. package/dist/core/{p-f3406b42.entry.js → p-fb9376f0.entry.js} +2 -2
  266. package/dist/esm/core.js +1 -1
  267. package/dist/esm/{helpers-0f85537f.js → helpers-66681c73.js} +4 -17
  268. package/dist/esm/helpers-66681c73.js.map +1 -0
  269. package/dist/esm/ic-accordion-group.entry.js +1 -1
  270. package/dist/esm/ic-accordion.entry.js +1 -1
  271. package/dist/esm/ic-action-chip.entry.js +7 -3
  272. package/dist/esm/ic-action-chip.entry.js.map +1 -1
  273. package/dist/esm/ic-alert.entry.js +1 -1
  274. package/dist/esm/ic-back-to-top.entry.js +1 -1
  275. package/dist/esm/ic-badge.entry.js +1 -1
  276. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  277. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  278. package/dist/esm/ic-button_3.entry.js +1 -1
  279. package/dist/esm/ic-button_3.entry.js.map +1 -1
  280. package/dist/esm/ic-card-horizontal.entry.js +1 -1
  281. package/dist/esm/ic-card-vertical.entry.js +1 -1
  282. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  283. package/dist/esm/ic-checkbox.entry.js +5 -5
  284. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  285. package/dist/esm/ic-chip.entry.js +7 -3
  286. package/dist/esm/ic-chip.entry.js.map +1 -1
  287. package/dist/esm/ic-classification-banner.entry.js +13 -5
  288. package/dist/esm/ic-classification-banner.entry.js.map +1 -1
  289. package/dist/esm/ic-data-row.entry.js +1 -1
  290. package/dist/esm/ic-dialog.entry.js +1 -1
  291. package/dist/esm/ic-divider.entry.js +1 -1
  292. package/dist/esm/ic-empty-state.entry.js +1 -1
  293. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  294. package/dist/esm/ic-footer-link.entry.js +1 -1
  295. package/dist/esm/ic-footer.entry.js +1 -1
  296. package/dist/esm/ic-hero.entry.js +1 -1
  297. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  298. package/dist/esm/ic-input-component-container_3.entry.js +212 -80
  299. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  300. package/dist/esm/ic-input-label_2.entry.js +1 -1
  301. package/dist/esm/ic-link.entry.js +1 -1
  302. package/dist/esm/ic-menu-group.entry.js +1 -1
  303. package/dist/esm/ic-menu-item.entry.js +1 -1
  304. package/dist/esm/ic-navigation-button.entry.js +1 -1
  305. package/dist/esm/ic-navigation-group.entry.js +1 -1
  306. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  307. package/dist/esm/ic-navigation-item.entry.js +1 -1
  308. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  309. package/dist/esm/ic-page-header.entry.js +1 -1
  310. package/dist/esm/ic-pagination-bar.entry.js +385 -0
  311. package/dist/esm/ic-pagination-bar.entry.js.map +1 -0
  312. package/dist/esm/ic-pagination-item.entry.js +1 -1
  313. package/dist/esm/ic-pagination_3.entry.js +1406 -0
  314. package/dist/esm/ic-pagination_3.entry.js.map +1 -0
  315. package/dist/esm/ic-popover-menu.entry.js +5 -5
  316. package/dist/esm/ic-radio-group.entry.js +1 -1
  317. package/dist/esm/ic-radio-option.entry.js +1 -1
  318. package/dist/esm/ic-search-bar.entry.js +11 -11
  319. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  320. package/dist/esm/ic-section-container.entry.js +2 -2
  321. package/dist/esm/ic-side-navigation.entry.js +18 -9
  322. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  323. package/dist/esm/ic-skeleton.entry.js +2 -2
  324. package/dist/esm/ic-skip-link.entry.js +2 -2
  325. package/dist/esm/ic-status-tag.entry.js +3 -3
  326. package/dist/esm/ic-step.entry.js +14 -14
  327. package/dist/esm/ic-stepper.entry.js +3 -3
  328. package/dist/esm/ic-stepper.entry.js.map +1 -1
  329. package/dist/esm/ic-switch.entry.js +5 -5
  330. package/dist/esm/ic-tab-context.entry.js +1 -2
  331. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  332. package/dist/esm/ic-tab-group.entry.js +3 -3
  333. package/dist/esm/ic-tab-panel.entry.js +2 -2
  334. package/dist/esm/ic-tab.entry.js +1 -1
  335. package/dist/esm/ic-theme.entry.js +2 -2
  336. package/dist/esm/ic-toast-region.entry.js +1 -1
  337. package/dist/esm/ic-toast.entry.js +8 -7
  338. package/dist/esm/ic-toast.entry.js.map +1 -1
  339. package/dist/esm/ic-toggle-button-group.entry.js +3 -3
  340. package/dist/esm/ic-toggle-button.entry.js +3 -3
  341. package/dist/esm/ic-top-navigation.entry.js +1 -1
  342. package/dist/esm/ic-typography.entry.js +1 -1
  343. package/dist/esm/index-a7a720e7.js +12 -16
  344. package/dist/esm/loader.js +1 -1
  345. package/dist/types/components/ic-classification-banner/ic-classification-banner.d.ts +4 -0
  346. package/dist/types/components/ic-menu/ic-menu.d.ts +11 -1
  347. package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +162 -0
  348. package/dist/types/components/ic-pagination-bar/ic-pagination-bar.types.d.ts +8 -0
  349. package/dist/types/components/ic-select/ic-select.d.ts +53 -80
  350. package/dist/types/components/ic-select/ic-select.types.d.ts +43 -0
  351. package/dist/types/components/ic-side-navigation/ic-side-navigation.d.ts +3 -2
  352. package/dist/types/components.d.ts +234 -5
  353. package/dist/types/utils/helpers.d.ts +2 -4
  354. package/hydrate/index.js +1141 -771
  355. package/hydrate/index.mjs +1141 -771
  356. package/package.json +2 -2
  357. package/vscode-data.json +131 -0
  358. package/dist/cjs/helpers-3a796e7a.js.map +0 -1
  359. package/dist/cjs/ic-pagination.cjs.entry.js +0 -312
  360. package/dist/cjs/ic-pagination.cjs.entry.js.map +0 -1
  361. package/dist/cjs/ic-select.cjs.entry.js +0 -879
  362. package/dist/cjs/ic-select.cjs.entry.js.map +0 -1
  363. package/dist/cjs/ic-text-field.cjs.entry.js +0 -433
  364. package/dist/cjs/ic-text-field.cjs.entry.js.map +0 -1
  365. package/dist/core/p-0d7fd892.entry.js +0 -2
  366. package/dist/core/p-29b61bb5.entry.js +0 -3
  367. package/dist/core/p-29b61bb5.entry.js.map +0 -1
  368. package/dist/core/p-2ca7f050.entry.js.map +0 -1
  369. package/dist/core/p-4aadabc8.entry.js +0 -2
  370. package/dist/core/p-4aadabc8.entry.js.map +0 -1
  371. package/dist/core/p-716e7eaf.entry.js.map +0 -1
  372. package/dist/core/p-808e1ef5.entry.js +0 -2
  373. package/dist/core/p-808e1ef5.entry.js.map +0 -1
  374. package/dist/core/p-880afd4b.entry.js.map +0 -1
  375. package/dist/core/p-8fe4e0ad.entry.js +0 -2
  376. package/dist/core/p-8fe4e0ad.entry.js.map +0 -1
  377. package/dist/core/p-96bc7d24.entry.js.map +0 -1
  378. package/dist/core/p-b8c0c142.entry.js.map +0 -1
  379. package/dist/core/p-c5b9519d.entry.js +0 -2
  380. package/dist/core/p-c5b9519d.entry.js.map +0 -1
  381. package/dist/core/p-d1730d4d.entry.js +0 -2
  382. package/dist/core/p-d1730d4d.entry.js.map +0 -1
  383. package/dist/core/p-dbc8bf0c.js +0 -2
  384. package/dist/core/p-dbc8bf0c.js.map +0 -1
  385. package/dist/core/p-fdb587ab.entry.js +0 -2
  386. package/dist/core/p-fdb587ab.entry.js.map +0 -1
  387. package/dist/esm/helpers-0f85537f.js.map +0 -1
  388. package/dist/esm/ic-pagination.entry.js.map +0 -1
  389. package/dist/esm/ic-select.entry.js +0 -875
  390. package/dist/esm/ic-select.entry.js.map +0 -1
  391. package/dist/esm/ic-text-field.entry.js.map +0 -1
  392. /package/dist/core/{p-0a24c536.entry.js.map → p-05fd2707.entry.js.map} +0 -0
  393. /package/dist/core/{p-85e15d01.entry.js.map → p-09505807.entry.js.map} +0 -0
  394. /package/dist/core/{p-41a5da12.entry.js.map → p-1b81ec88.entry.js.map} +0 -0
  395. /package/dist/core/{p-99951365.entry.js.map → p-2691cc80.entry.js.map} +0 -0
  396. /package/dist/core/{p-94916588.entry.js.map → p-2a124daf.entry.js.map} +0 -0
  397. /package/dist/core/{p-04c77b2d.entry.js.map → p-2b87c592.entry.js.map} +0 -0
  398. /package/dist/core/{p-4aa56990.entry.js.map → p-2bd80913.entry.js.map} +0 -0
  399. /package/dist/core/{p-aed1c7e7.entry.js.map → p-347cc084.entry.js.map} +0 -0
  400. /package/dist/core/{p-a3dea729.entry.js.map → p-3aed13ba.entry.js.map} +0 -0
  401. /package/dist/core/{p-8da90b72.entry.js.map → p-46fd555f.entry.js.map} +0 -0
  402. /package/dist/core/{p-43cc0f1d.entry.js.map → p-48a628f0.entry.js.map} +0 -0
  403. /package/dist/core/{p-9a4e067f.entry.js.map → p-4f56acff.entry.js.map} +0 -0
  404. /package/dist/core/{p-3021290f.entry.js.map → p-506d428a.entry.js.map} +0 -0
  405. /package/dist/core/{p-a1b2f483.entry.js.map → p-50dca790.entry.js.map} +0 -0
  406. /package/dist/core/{p-feef7c2c.entry.js.map → p-56de4f4b.entry.js.map} +0 -0
  407. /package/dist/core/{p-b4e322fe.entry.js.map → p-5900cb65.entry.js.map} +0 -0
  408. /package/dist/core/{p-78a54069.entry.js.map → p-5976de6e.entry.js.map} +0 -0
  409. /package/dist/core/{p-0d7fd892.entry.js.map → p-659d048d.entry.js.map} +0 -0
  410. /package/dist/core/{p-1edf2689.entry.js.map → p-67de1290.entry.js.map} +0 -0
  411. /package/dist/core/{p-f700b759.entry.js.map → p-73043f57.entry.js.map} +0 -0
  412. /package/dist/core/{p-7b8e5926.entry.js.map → p-735d3096.entry.js.map} +0 -0
  413. /package/dist/core/{p-07075461.entry.js.map → p-7b538fd1.entry.js.map} +0 -0
  414. /package/dist/core/{p-cfd43558.entry.js.map → p-80d85403.entry.js.map} +0 -0
  415. /package/dist/core/{p-79949920.entry.js.map → p-8a833e82.entry.js.map} +0 -0
  416. /package/dist/core/{p-0aba9e31.entry.js.map → p-90678e67.entry.js.map} +0 -0
  417. /package/dist/core/{p-a851eb65.entry.js.map → p-9502fb86.entry.js.map} +0 -0
  418. /package/dist/core/{p-f6de08fb.entry.js.map → p-9c2b2cb9.entry.js.map} +0 -0
  419. /package/dist/core/{p-949d08d3.entry.js.map → p-9cb83a2e.entry.js.map} +0 -0
  420. /package/dist/core/{p-f0ecb80b.entry.js.map → p-a08d6b46.entry.js.map} +0 -0
  421. /package/dist/core/{p-208f470f.entry.js.map → p-a780a34b.entry.js.map} +0 -0
  422. /package/dist/core/{p-387b7bca.entry.js.map → p-aad03a3c.entry.js.map} +0 -0
  423. /package/dist/core/{p-ec14c783.entry.js.map → p-aaf4e367.entry.js.map} +0 -0
  424. /package/dist/core/{p-707ae6e9.entry.js.map → p-b52c44eb.entry.js.map} +0 -0
  425. /package/dist/core/{p-780babc0.entry.js.map → p-b997ad5e.entry.js.map} +0 -0
  426. /package/dist/core/{p-a0af1b0a.entry.js.map → p-bb7652cd.entry.js.map} +0 -0
  427. /package/dist/core/{p-ded4cd76.entry.js.map → p-cbca04bb.entry.js.map} +0 -0
  428. /package/dist/core/{p-99687bce.entry.js.map → p-cc64e5ef.entry.js.map} +0 -0
  429. /package/dist/core/{p-812c5e61.entry.js.map → p-cfbacca1.entry.js.map} +0 -0
  430. /package/dist/core/{p-0da2caa2.entry.js.map → p-daec7e69.entry.js.map} +0 -0
  431. /package/dist/core/{p-1590fd69.entry.js.map → p-e7767c0d.entry.js.map} +0 -0
  432. /package/dist/core/{p-dce11b9d.entry.js.map → p-ea7a3d30.entry.js.map} +0 -0
  433. /package/dist/core/{p-a674b13b.entry.js.map → p-ef70ea50.entry.js.map} +0 -0
  434. /package/dist/core/{p-d25d0aad.entry.js.map → p-f64996f1.entry.js.map} +0 -0
  435. /package/dist/core/{p-db17a793.entry.js.map → p-f661ba76.entry.js.map} +0 -0
  436. /package/dist/core/{p-a03bb31c.entry.js.map → p-f84ac9c6.entry.js.map} +0 -0
  437. /package/dist/core/{p-f3406b42.entry.js.map → p-fb9376f0.entry.js.map} +0 -0
@@ -1,5 +1,17 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
1
13
  import { Host, h, forceUpdate, } from "@stencil/core";
2
- import { getInputDescribedByText, getLabelFromValue, hasValidationStatus, inheritAttributes, onComponentRequiredPropUndefined, renderHiddenInput, isMobileOrTablet, getFilteredMenuOptions, getOptionsWithoutGroupTitlesCount, addFormResetListener, removeFormResetListener, removeDisabledFalse, checkSlotInChildMutations, isSlotUsed, isMacDevice, } from "../../utils/helpers";
14
+ import { addFormResetListener, checkSlotInChildMutations, getInputDescribedByText, isMobileOrTablet, isSlotUsed, removeDisabledFalse, removeFormResetListener, renderHiddenInput, } from "../../utils/helpers";
3
15
  import { IC_INHERITED_ARIA } from "../../utils/constants";
4
16
  import { IcInformationStatus, } from "../../utils/types";
5
17
  import Expand from "./assets/Expand.svg";
@@ -12,22 +24,18 @@ const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "tabindex", "title"];
12
24
  */
13
25
  export class Select {
14
26
  constructor() {
15
- this.blurredBecauseButtonPressed = false;
16
- this.hasSetDefaultValue = false;
17
- this.hasTimedOut = false;
18
- this.inheritedAttributes = {};
19
- this.initialOptionsEmpty = false;
20
27
  this.inputId = `ic-select-input-${inputIds++}`;
21
28
  this.menuId = `${this.inputId}-menu`;
22
- this.retryButtonClick = false;
23
- this.searchableMenuItemSelected = false;
24
- this.ungroupedOptions = [];
29
+ this.inheritedAttributes = {};
25
30
  this.hostMutationObserver = null;
26
- this.clearButtonFocused = false;
27
- this.noOptions = null;
28
- this.open = false;
31
+ this.timeoutTimer = null;
32
+ this.hasTimedOut = false;
33
+ this.initialRender = true;
29
34
  this.pressedCharacters = "";
30
- this.searchableSelectInputValue = null;
35
+ this.hasError = false;
36
+ this.searchableSelectInputValue = "";
37
+ this.selectButtonAriaLiveText = "";
38
+ this.selectInputAriaLiveText = "";
31
39
  /**
32
40
  * If `true`, the disabled state will be set.
33
41
  */
@@ -124,6 +132,10 @@ export class Select {
124
132
  * The text to display as the validation message.
125
133
  */
126
134
  this.validationText = "";
135
+ /**
136
+ * If `true` and on a mobile or tablet device, the native select element will be used instead of the custom select component for better usability.
137
+ */
138
+ this.useNativeSelectOnMobile = true;
127
139
  /**
128
140
  * If `true`, the loading state will be triggered when fetching options asynchronously.
129
141
  */
@@ -132,8 +144,7 @@ export class Select {
132
144
  * The possible selection options.
133
145
  */
134
146
  this.options = [];
135
- this.filteredOptions = this.options;
136
- this.uniqueOptions = this.options;
147
+ this.flatOptions = [];
137
148
  /**
138
149
  * The amount of time, in milliseconds, to wait to trigger the `icInput` event after each keystroke.
139
150
  */
@@ -146,147 +157,125 @@ export class Select {
146
157
  */
147
158
  this.value = null;
148
159
  this.initialValue = this.value;
149
- this.inputValueToFilter = this.value;
150
- // triggered when attributes of host element change
151
- this.hostMutationCallback = (mutationList) => {
152
- let forceComponentUpdate = false;
153
- mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
154
- if (attributeName) {
155
- const attribute = this.el.getAttribute(attributeName);
156
- if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
157
- this.inheritedAttributes[attributeName] = attribute;
158
- forceComponentUpdate = true;
159
- }
160
- }
161
- else if (type === "childList") {
162
- forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
163
- }
164
- });
165
- if (forceComponentUpdate) {
166
- forceUpdate(this);
160
+ this.open = false;
161
+ this.getValidatedValue = (value) => {
162
+ const validValues = this.flatOptions.map((opt) => opt.value);
163
+ if (validValues.length === 0)
164
+ return value;
165
+ if (this.multiple) {
166
+ if (!value)
167
+ return null;
168
+ const arr = Array.isArray(value) ? value : [value]; // Ensure value is an array
169
+ const filtered = validValues.filter((v) => arr.includes(v)); // Keep only valid values
170
+ return filtered.length > 0 ? filtered : null;
171
+ }
172
+ else {
173
+ return validValues.includes(value) ? value : null;
167
174
  }
168
175
  };
169
- this.handleRetry = (ev) => {
170
- var _a;
171
- if (ev.detail.keyPressed)
172
- (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
173
- this.blurredBecauseButtonPressed = true;
174
- this.retryButtonClick = true;
175
- this.hasSetDefaultValue = true;
176
- this.icRetryLoad.emit({
177
- value: this.searchable
178
- ? this.searchableSelectInputValue
179
- : this.hiddenInputValue,
180
- });
176
+ this.getFilteredOptions = (searchString, searchMatchPosition, includeDescriptionsInSearch, includeGroupTitlesInSearch) => {
177
+ const search = searchString.toLowerCase();
178
+ const match = (text, method) => method === "anywhere" ? text.includes(search) : text.startsWith(search);
179
+ return this.unflattenOptions(this.flatOptions.filter((option) => {
180
+ var _a, _b, _c, _d;
181
+ const label = option.label.toLowerCase();
182
+ const group = (_b = (_a = option.group) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : "";
183
+ const description = (_d = (_c = option.description) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : "";
184
+ return (match(label, searchMatchPosition) ||
185
+ (includeDescriptionsInSearch &&
186
+ match(description, searchMatchPosition)) ||
187
+ (includeGroupTitlesInSearch && match(group, searchMatchPosition)));
188
+ }));
181
189
  };
182
- this.emitIcChange = (value) => {
183
- // If "Select all" button clicked, replace value with new value (array of all option values)
184
- if (this.multiple && !Array.isArray(value) && value !== null) {
185
- // Update selected options - adds / removes them, in order of option list
186
- // Create new array if value prop is undefined
187
- if (this.value) {
188
- let valueArray = this.value.slice();
189
- if (this.value.includes(value)) {
190
- valueArray.splice(valueArray.indexOf(value), 1);
191
- }
192
- else {
193
- valueArray.push(value);
194
- valueArray = this.getValueSortedByOptions(valueArray);
190
+ this.getOptions = () => {
191
+ const options = this.searchable &&
192
+ !this.disableAutoFiltering &&
193
+ this.searchableSelectInputValue
194
+ ? this.getFilteredOptions(this.searchableSelectInputValue, this.searchMatchPosition, this.includeDescriptionsInSearch, this.includeGroupTitlesInSearch)
195
+ : this.unflattenOptions(this.flatOptions);
196
+ if (this.hasTimedOut)
197
+ return [{ label: this.loadingErrorLabel, value: "", timedOut: true }];
198
+ if (this.loading)
199
+ return [{ label: this.loadingLabel, value: "", loading: true }];
200
+ if (options.length > 0)
201
+ return options;
202
+ return [{ label: this.emptyOptionListText, value: "" }];
203
+ };
204
+ this.getFlatOptions = (options) => options.flatMap((item) => ("children" in item && item.children
205
+ ? [...item.children.map((child) => (Object.assign({ group: item.label }, child)))]
206
+ : [item]));
207
+ this.unflattenOptions = (flatOptions) => {
208
+ const groupMap = new Map();
209
+ const result = [];
210
+ for (const option of flatOptions) {
211
+ if (option.group) {
212
+ let group = groupMap.get(option.group);
213
+ if (!group) {
214
+ group = { label: option.group, children: [] };
215
+ groupMap.set(option.group, group);
216
+ result.push(group);
195
217
  }
196
- this.value = valueArray.length === 0 ? null : valueArray;
218
+ const { group: _ } = option, rest = __rest(option, ["group"]);
219
+ group.children.push(rest);
197
220
  }
198
221
  else {
199
- this.value = [value];
222
+ result.push(option);
200
223
  }
201
224
  }
202
- else {
203
- this.value = value;
225
+ return result;
226
+ };
227
+ this.getLabelFromValue = (value) => { var _a, _b; return (_b = (_a = this.flatOptions.find((option) => option.value === value)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : ""; };
228
+ // Construct the string that will be shown in the select input or button
229
+ this.getLabelString = () => {
230
+ if (Array.isArray(this.value)) {
231
+ return this.value.map(this.getLabelFromValue).filter(Boolean).join(", ");
204
232
  }
205
- this.icChange.emit({ value: this.multiple ? this.value : value });
233
+ return (this.getLabelFromValue(this.value) ||
234
+ (this.searchable ? "" : this.placeholder));
206
235
  };
207
- this.emitIcInput = (value) => {
208
- clearTimeout(this.debounceIcInput);
209
- this.debounceIcInput = window.setTimeout(() => this.icInput.emit({ value }), this.currDebounce);
236
+ this.handleClick = (event) => {
237
+ var _a;
238
+ if (event.detail !== 0) {
239
+ (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleClickOpen();
240
+ }
210
241
  };
211
- this.setOptions = () => {
212
- if (!this.hasTimedOut && this.options !== this.noOptions) {
213
- this.loading = false;
214
- clearTimeout(this.timeoutTimer);
215
- if (this.options.length > 0) {
216
- this.setOptionsValuesFromLabels();
217
- this.uniqueOptions = this.deduplicateOptions(this.options);
218
- }
219
- else {
220
- this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
221
- this.uniqueOptions = this.noOptions;
222
- }
223
- this.filteredOptions = this.uniqueOptions;
224
- if (this.isExternalFiltering()) {
225
- // When searchable select
226
- this.noOptions = null;
227
- this.updateSearchableSelectResultAriaLive();
228
- this.setDefaultValue();
229
- }
230
- else if (this.initialOptionsEmpty) {
231
- this.setDefaultValue();
232
- this.initialOptionsEmpty = false;
233
- }
242
+ this.handleExpandIconMouseDown = (event) => {
243
+ var _a;
244
+ if (!this.disabled) {
245
+ event.preventDefault();
246
+ (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
247
+ this.handleClick(event);
234
248
  }
235
- else if (!this.searchable) {
236
- this.options = this.noOptions || [];
249
+ };
250
+ this.handleBlur = ({ relatedTarget }) => {
251
+ var _a, _b;
252
+ const target = relatedTarget;
253
+ if (this.el.contains(target) ||
254
+ ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
255
+ ((_b = this.menu) === null || _b === void 0 ? void 0 : _b.contains(target)) ||
256
+ target === this.clearButton) {
257
+ return;
237
258
  }
259
+ this.open = false;
260
+ this.handleFocusIndicatorDisplay();
261
+ if (this.searchable) {
262
+ this.searchableSelectInputValue = "";
263
+ }
264
+ this.icBlur.emit();
238
265
  };
239
- /**
240
- * Processes the provided array of IcMenuOptions, removing duplicates and reporting them with a console.warn
241
- * @param options array of IcMenuOptions
242
- * @returns a new options object, with all entries possessing a duplicate 'value' field removed
243
- */
244
- this.deduplicateOptions = (options) => {
245
- const uniqueValues = [];
246
- const dedupedOptions = [];
247
- options.forEach((option) => {
248
- if (option.children) {
249
- //If an option has children, we will loop through them
250
- const dedupedChildren = [];
251
- option.children.forEach((child) => {
252
- if (uniqueValues.includes(child.value)) {
253
- console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${child.value}) which has been removed.`);
254
- }
255
- else {
256
- uniqueValues.push(child.value);
257
- dedupedChildren.push(child);
258
- }
259
- });
260
- // construct a modified option, inserting the deduplicated children alongside the original information
261
- dedupedOptions.push(Object.assign(Object.assign({}, option), { children: dedupedChildren }));
262
- }
263
- else {
264
- // If an option does not have children, assess to see if it's value has been included already
265
- if (uniqueValues.includes(option.value)) {
266
- console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
267
- }
268
- else {
269
- uniqueValues.push(option.value);
270
- dedupedOptions.push(option);
271
- }
272
- }
273
- });
274
- return dedupedOptions;
266
+ this.handleTimeoutBlur = (event) => {
267
+ this.handleBlur(event.detail.ev);
275
268
  };
276
- /**
277
- * Loop through options array and for all options with no value, infer it from the label
278
- */
279
- this.setOptionsValuesFromLabels = () => {
280
- if (this.options.length > 0) {
281
- this.options.map((option) => {
282
- if (!option.value) {
283
- option.value = option.label;
284
- }
285
- });
286
- }
269
+ this.handleFocus = () => {
270
+ this.icFocus.emit();
287
271
  };
288
- this.setUngroupedOptions = (event) => {
289
- this.ungroupedOptions = event.detail.options;
272
+ this.handleClear = () => {
273
+ this.clearTimer();
274
+ this.loading = false;
275
+ this.value = null;
276
+ this.searchableSelectInputValue = "";
277
+ this.icClear.emit();
278
+ this.setFocus();
290
279
  };
291
280
  this.setTextColor = () => {
292
281
  if (this.nativeSelectElement) {
@@ -296,94 +285,13 @@ export class Select {
296
285
  : "select-option-selected";
297
286
  }
298
287
  };
299
- this.setMenuChange = (open) => {
300
- if (this.open !== open) {
301
- this.open = open;
302
- }
303
- };
304
- this.getLabelFromValue = (value) => getLabelFromValue(value, this.uniqueOptions);
305
- this.getMultipleOptionsString = (selectedValues) => selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.map((value) => this.getLabelFromValue(value)).filter((label) => !!label).join(", ");
306
- this.getFilteredChildMenuOptions = (option) => (Object.assign(Object.assign({}, option), { children: option.children &&
307
- getFilteredMenuOptions(option.children, this.searchable && !!this.includeDescriptionsInSearch, this.searchable
308
- ? this.searchableSelectInputValue || ""
309
- : this.pressedCharacters, this.searchable ? this.searchMatchPosition : "start") }));
310
- // (For multi-select) get value array, i.e. selected option values, in order they appear in option list
311
- this.getValueSortedByOptions = (value) => {
312
- const valueArray = value;
313
- const valuesFromAllOptions = this.ungroupedOptions.map((option) => option.value);
314
- valueArray.sort((a, b) => valuesFromAllOptions.indexOf(a) - valuesFromAllOptions.indexOf(b));
315
- return valueArray;
316
- };
317
288
  this.handleNativeSelectChange = () => {
318
289
  if (this.nativeSelectElement) {
319
290
  this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
320
- this.emitIcChange(this.nativeSelectElement.value);
291
+ this.icChange.emit({ value: this.nativeSelectElement.value });
321
292
  }
322
293
  this.setTextColor();
323
294
  };
324
- // Handle option select for when a custom input box and menu is rendered
325
- // (rather than native <select> - rendered when viewed on a mobile / tablet screen)
326
- this.handleCustomSelectChange = (event) => {
327
- var _a, _b;
328
- const { value, label, optionId } = event.detail;
329
- if (label === this.emptyOptionListText) {
330
- (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
331
- return;
332
- }
333
- if (this.searchable) {
334
- this.value = value || null;
335
- this.searchableMenuItemSelected = true;
336
- // After editing the input, if selecting the same option as before, set the input value to label again
337
- if (this.value === this.currValue) {
338
- this.searchableSelectInputValue =
339
- this.getLabelFromValue(this.value) || null;
340
- }
341
- this.inputValueToFilter = null;
342
- this.hiddenInputValue =
343
- this.getValueFromLabel(this.searchableSelectInputValue) || null;
344
- }
345
- if (value) {
346
- if (this.multiple && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.includes(value))) {
347
- this.icOptionDeselect.emit({ value });
348
- }
349
- else {
350
- this.icOptionSelect.emit({ value });
351
- }
352
- }
353
- this.ariaActiveDescendant = optionId;
354
- this.emitIcChange(value || null);
355
- };
356
- this.handleSelectAllChange = ({ detail, }) => {
357
- const allValues = this.ungroupedOptions
358
- .filter((option) => !option.disabled)
359
- .map((option) => option.value);
360
- if (detail.select) {
361
- // Only emit icOptionSelect for all values that are newly selected
362
- const unselectedValues = this.value
363
- ? allValues.filter((value) => this.value && !this.value.includes(value))
364
- : allValues;
365
- unselectedValues.forEach((value) => this.icOptionSelect.emit({ value }));
366
- }
367
- else {
368
- // Only emit icOptionDeselect for values that were selected
369
- this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
370
- }
371
- this.emitIcChange(detail.select ? allValues : null);
372
- };
373
- this.handleMenuChange = (event) => {
374
- this.open = event.detail.open;
375
- this.pressedCharacters = "";
376
- if (this.searchable)
377
- this.handleFocusIndicatorDisplay();
378
- };
379
- // clears the debounce delay when navigating the menu with arrow keys etc
380
- // to prevent delay in change event, which should only occur when typing in input
381
- this.handleMenuKeyPress = (ev) => {
382
- ev.cancelBubble = true;
383
- if (!this.multiple) {
384
- this.handleCharacterKeyDown(ev.detail.key);
385
- }
386
- };
387
295
  this.handleFocusIndicatorDisplay = () => {
388
296
  var _a;
389
297
  const focusIndicator = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".focus-indicator");
@@ -396,58 +304,27 @@ export class Select {
396
304
  }
397
305
  }
398
306
  };
399
- this.handleMouseDown = (event) => {
400
- if (!this.open) {
401
- event.preventDefault();
402
- }
403
- };
404
- this.isExternalFiltering = () => this.searchable && !!this.disableAutoFiltering;
405
- this.handleClick = (event) => {
307
+ this.handleKeyDown = (event) => {
406
308
  var _a, _b;
407
- if (!this.open && this.menu) {
408
- if (this.isExternalFiltering()) {
409
- this.menu.options = this.filteredOptions;
309
+ if (!(event.key === " " && this.pressedCharacters.length > 0)) {
310
+ if (this.open) {
311
+ (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleMenuKeyDown(event);
410
312
  }
411
- else if (!this.hasTimedOut &&
412
- !this.loading &&
413
- !((_a = this.noOptions) === null || _a === void 0 ? void 0 : _a.length) &&
414
- (!this.searchable || this.searchableMenuItemSelected)) {
415
- this.noOptions = null;
416
- this.menu.options = this.uniqueOptions;
313
+ else {
314
+ (_b = this.menu) === null || _b === void 0 ? void 0 : _b.handleKeyboardOpen(event);
417
315
  }
418
316
  }
419
- if (event.detail !== 0) {
420
- (_b = this.menu) === null || _b === void 0 ? void 0 : _b.handleClickOpen();
421
- }
422
- };
423
- this.handleExpandIconMouseDown = (event) => {
424
- var _a;
425
- if (!this.disabled) {
426
- event.preventDefault();
427
- (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
428
- this.handleClick(event);
429
- }
430
- };
431
- this.handleClear = (event) => {
432
- var _a, _b;
433
- event.stopPropagation();
434
- this.hasTimedOut = false;
435
- clearTimeout(this.timeoutTimer);
436
- this.clearInput();
437
- this.emitIcChange(null);
438
- this.icClear.emit();
439
- if (this.searchable) {
440
- this.hiddenInputValue = null;
441
- (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
442
- }
443
- else {
444
- (_b = this.customSelectElement) === null || _b === void 0 ? void 0 : _b.focus();
317
+ if (!this.multiple &&
318
+ !this.searchable &&
319
+ !this.selectOnEnter &&
320
+ /^[a-zA-Z0-9 ]$/.test(event.key)) {
321
+ this.handleCharacterKeyDown(event.key);
445
322
  }
446
323
  };
447
324
  this.handleCharacterKeyDown = (key) => {
448
325
  // Only close menu when space is pressed if not being used alongside character keys to quickly select options
449
326
  if (this.open && key === " " && this.pressedCharacters.length === 0) {
450
- this.setMenuChange(false);
327
+ this.open = false;
451
328
  }
452
329
  if (key.length !== 1 || this.searchable) {
453
330
  this.pressedCharacters = "";
@@ -457,385 +334,316 @@ export class Select {
457
334
  this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
458
335
  if (key !== " " || !!this.pressedCharacters) {
459
336
  this.pressedCharacters += key;
460
- this.handleFilter();
461
- if (!this.noOptions) {
462
- this.emitIcChange(this.filteredOptions[0].value);
337
+ const filteredOptions = this.getFilteredOptions(this.pressedCharacters, "start", false, false);
338
+ if (filteredOptions.length > 0) {
339
+ const firstOption = filteredOptions[0];
340
+ if ("children" in firstOption) {
341
+ this.value = firstOption.children[0].value;
342
+ }
343
+ else {
344
+ this.value = firstOption.value;
345
+ }
463
346
  }
464
347
  }
465
348
  };
466
349
  this.handleNativeSelectKeyDown = (event) => {
467
- if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
468
- event.cancelBubble = true;
469
- }
470
- this.handleCharacterKeyDown(event.key);
350
+ this.handleKeyDown(event);
471
351
  };
472
- this.handleKeyDown = (event) => {
473
- var _a;
474
- if ((event.key !== "Escape" && event.key !== "Tab") || this.open) {
475
- event.cancelBubble = true;
352
+ this.handleSelectChange = (event) => {
353
+ const { value } = event.detail;
354
+ if (!value || this.getLabelFromValue(value) === this.emptyOptionListText) {
355
+ this.value = null;
356
+ return;
476
357
  }
477
- const isArrowKey = event.key === "ArrowDown" || event.key === "ArrowUp";
478
- if (this.menu && !this.open) {
479
- if (this.isExternalFiltering() && (event.key === "Enter" || isArrowKey)) {
480
- this.menu.options = this.filteredOptions;
358
+ if (this.multiple) {
359
+ let valueArray = Array.isArray(this.value) ? [...this.value] : [];
360
+ const index = valueArray.indexOf(value);
361
+ if (index > -1) {
362
+ valueArray.splice(index, 1);
363
+ this.icOptionDeselect.emit({ value });
481
364
  }
482
- else if (!this.hasTimedOut) {
483
- this.noOptions = null;
484
- this.menu.options = this.uniqueOptions;
365
+ else {
366
+ this.icOptionSelect.emit({ value });
367
+ valueArray.push(value);
368
+ valueArray = this.getValidatedValue(valueArray);
485
369
  }
486
- }
487
- if (this.open && event.key === "Enter") {
488
- this.setMenuChange(false);
370
+ this.value = valueArray.length ? valueArray : null;
489
371
  }
490
372
  else {
491
- if (!isArrowKey || this.noOptions === null) {
492
- if (event.key !== " " || this.pressedCharacters.length <= 0) {
493
- // Keyboard events get passed onto ic-menu except in the case of ctrl-a on a searchable select
494
- const isCtrlA = event.key === "a" &&
495
- ((isMacDevice() && event.metaKey) ||
496
- (!isMacDevice() && event.ctrlKey));
497
- if (!(this.searchable && isCtrlA)) {
498
- (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleKeyboardOpen(event);
499
- }
500
- }
501
- if (!this.multiple) {
502
- this.handleCharacterKeyDown(event.key);
503
- }
504
- }
505
- }
506
- };
507
- this.handleClearButtonFocus = () => {
508
- this.clearButtonFocused = true;
509
- };
510
- this.handleClearButtonBlur = (ev) => {
511
- var _a;
512
- const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
513
- if ((!this.searchableSelectElement ||
514
- ev.relatedTarget !== this.searchableSelectElement) &&
515
- (!retryButton || ev.relatedTarget !== retryButton)) {
516
- this.setMenuChange(false);
517
- this.handleFocusIndicatorDisplay();
373
+ this.icOptionSelect.emit({ value });
374
+ this.value = value;
375
+ if (this.searchable)
376
+ this.searchableSelectInputValue = "";
518
377
  }
519
- this.clearButtonFocused = false;
520
378
  };
521
- this.handleFilter = () => {
522
- var _a;
523
- const options = this.deduplicateOptions(this.searchable ? [...this.uniqueOptions] : this.ungroupedOptions);
524
- const isGrouped = options.some((option) => !!option.children);
525
- let newFilteredOptions = [];
526
- let menuOptionsFiltered;
527
- if (this.searchable) {
528
- menuOptionsFiltered = getFilteredMenuOptions(options, !!this.includeDescriptionsInSearch, this.inputValueToFilter || "", this.searchMatchPosition);
529
- this.searchableMenuItemSelected = false;
379
+ this.handleSelectAllChange = ({ detail, }) => {
380
+ const allSelectableValues = this.flatOptions
381
+ .filter((option) => !option.disabled)
382
+ .map((option) => option.value);
383
+ if (detail.select) {
384
+ allSelectableValues
385
+ .filter((value) => { var _a; return !((_a = this.value) !== null && _a !== void 0 ? _a : []).includes(value); })
386
+ .forEach((value) => {
387
+ this.icOptionSelect.emit({ value });
388
+ });
389
+ this.value = allSelectableValues;
530
390
  }
531
391
  else {
532
- menuOptionsFiltered = getFilteredMenuOptions(options, false, this.pressedCharacters, "start");
533
- }
534
- if (!isGrouped &&
535
- ((_a = menuOptionsFiltered[0]) === null || _a === void 0 ? void 0 : _a.label) !== this.emptyOptionListText) {
536
- newFilteredOptions = menuOptionsFiltered;
537
- }
538
- else if (isGrouped) {
539
- newFilteredOptions = options.map((option) => this.includeGroupTitlesInSearch &&
540
- menuOptionsFiltered.indexOf(option) !== -1
541
- ? option
542
- : this.getFilteredChildMenuOptions(option));
543
- }
544
- if (newFilteredOptions.length > 0 &&
545
- (!isGrouped ||
546
- newFilteredOptions.some(({ children }) => children && children.length > 0))) {
547
- this.noOptions = null;
548
- this.filteredOptions = newFilteredOptions;
392
+ this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
393
+ this.value = null;
549
394
  }
550
- else {
551
- this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
552
- this.filteredOptions = this.noOptions;
395
+ };
396
+ this.handleFormReset = () => {
397
+ this.value = this.initialValue;
398
+ this.searchableSelectInputValue = "";
399
+ if (this.searchable) {
400
+ this.hiddenInputValue = this.initialValue;
553
401
  }
554
402
  };
555
- /**
556
- * Put the select component into loading state.
557
- * Replace options with the loading message. If timeout is enabled, set the timeout and once passed, replace options with the loading error message
558
- */
559
- this.triggerLoading = () => {
403
+ this.handleRetry = () => {
404
+ this.clearTimer();
560
405
  this.hasTimedOut = false;
561
- this.noOptions = [{ label: this.loadingLabel, value: "", loading: true }];
562
- if (this.filteredOptions !== this.noOptions && this.searchable) {
563
- this.filteredOptions = this.noOptions;
564
- }
565
- else if (this.uniqueOptions !== this.noOptions && !this.searchable) {
566
- this.uniqueOptions = this.noOptions;
567
- }
568
- if (this.timeout) {
569
- this.timeoutTimer = window.setTimeout(() => {
570
- this.loading = false;
571
- this.hasTimedOut = true;
572
- this.noOptions = [
573
- { label: this.loadingErrorLabel, value: "", timedOut: true },
574
- ];
575
- this.filteredOptions = this.noOptions;
576
- if (!this.searchable)
577
- this.uniqueOptions = this.noOptions;
578
- }, this.timeout);
579
- }
406
+ this.hasError = false;
407
+ this.loading = true;
408
+ this.icRetryLoad.emit({
409
+ value: this.searchable
410
+ ? this.searchableSelectInputValue
411
+ : this.hiddenInputValue,
412
+ });
413
+ this.setFocus();
580
414
  };
581
- this.getValueFromLabel = (label) => { var _a; return label && ((_a = this.uniqueOptions.find((option) => option.label === label)) === null || _a === void 0 ? void 0 : _a.value); };
582
415
  this.handleSearchableSelectInput = (event) => {
583
- this.searchableSelectInputValue = event.target.value;
584
- this.emitIcInput(this.searchableSelectInputValue);
585
- // De-select previous selection when input is edited
586
- // Only emit icChange once when editing input
587
- if (this.value != null) {
588
- this.emitIcChange(null);
589
- }
590
- this.hiddenInputValue = null;
591
- this.inputValueToFilter = this.searchableSelectInputValue;
592
- this.setMenuChange(true);
593
- if (!this.disableAutoFiltering) {
594
- this.handleFilter();
595
- clearTimeout(this.debounceAria);
596
- window.setTimeout(() => {
597
- this.updateSearchableSelectResultAriaLive();
598
- }, 800);
599
- }
600
- };
601
- this.updateSearchableSelectResultAriaLive = () => {
602
416
  var _a;
603
- const searchableSelectResultsStatusEl = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".searchable-select-results-status");
604
- if (searchableSelectResultsStatusEl) {
605
- searchableSelectResultsStatusEl.innerText =
606
- this.noOptions !== null ? this.emptyOptionListText : "";
607
- }
608
- };
609
- this.updateMultiSelectedCountAriaLive = () => {
610
- var _a, _b;
611
- const multiSelectSelectedCountEl = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".multi-select-selected-count");
612
- const selectedCount = `${(_b = this.currValue) === null || _b === void 0 ? void 0 : _b.length} of ${getOptionsWithoutGroupTitlesCount(this.options)} selected`;
613
- if (multiSelectSelectedCountEl &&
614
- multiSelectSelectedCountEl.innerText !== selectedCount) {
615
- multiSelectSelectedCountEl.innerText = selectedCount;
616
- }
617
- };
618
- this.getDefaultValue = (value) => this.getLabelFromValue(value) || null;
619
- this.setDefaultValue = () => {
620
- if (!this.hasSetDefaultValue && this.currValue) {
621
- this.searchableSelectInputValue = this.searchable
622
- ? this.getDefaultValue(this.currValue)
623
- : null;
624
- this.initialValue = this.currValue;
625
- this.hasSetDefaultValue = true;
417
+ this.updateSearchableSelectResultAriaLive();
418
+ if (!this.multiple) {
419
+ this.value = null;
626
420
  }
421
+ this.searchableSelectInputValue =
422
+ (_a = event.target.value) !== null && _a !== void 0 ? _a : "";
423
+ this.open = true;
424
+ clearTimeout(this.debounceIcInput);
425
+ this.debounceIcInput = window.setTimeout(() => this.icInput.emit({ value: this.searchableSelectInputValue }), this.currDebounce);
627
426
  };
628
- this.onFocus = () => {
629
- this.icFocus.emit();
630
- };
631
- this.onBlur = ({ relatedTarget }) => {
632
- var _a;
633
- const target = relatedTarget;
634
- if (target !== null &&
635
- ((target.tagName === "UL" && target.className.includes("menu")) ||
636
- (target.tagName === "LI" && target.className.includes("option")))) {
637
- return;
638
- }
639
- const retryButton = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.querySelector("#retry-button");
640
- if (this.searchable &&
641
- !!this.menu &&
642
- target !== this.menu &&
643
- !Array.from(this.menu.querySelectorAll("[role='option']")).includes(target) &&
644
- (!this.clearButton || target !== this.clearButton) &&
645
- (!retryButton || target !== retryButton)) {
646
- if (!this.retryButtonClick) {
647
- this.setMenuChange(false);
648
- // Clear input field on blur when searchable if no option is selected
649
- if (!this.value) {
650
- this.clearInput();
427
+ this.hostMutationCallback = (mutationList) => {
428
+ let forceComponentUpdate = false;
429
+ mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
430
+ if (attributeName) {
431
+ const attribute = this.el.getAttribute(attributeName);
432
+ if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
433
+ this.inheritedAttributes[attributeName] = attribute;
434
+ forceComponentUpdate = true;
651
435
  }
652
436
  }
653
- this.handleFocusIndicatorDisplay();
437
+ else if (type === "childList") {
438
+ forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
439
+ }
440
+ });
441
+ if (forceComponentUpdate) {
442
+ forceUpdate(this);
654
443
  }
655
- this.retryButtonClick = false;
656
- this.icBlur.emit();
657
444
  };
658
- this.onTimeoutBlur = (ev) => {
659
- if (ev.detail.ev.relatedTarget !==
660
- this.searchableSelectElement &&
661
- !this.blurredBecauseButtonPressed) {
662
- this.setMenuChange(false);
663
- this.handleFocusIndicatorDisplay();
664
- this.icBlur.emit();
665
- }
666
- this.blurredBecauseButtonPressed = false;
445
+ this.updateSelectButtonAriaLive = () => {
446
+ const value_label = this.getLabelFromValue(this.value);
447
+ this.selectButtonAriaLiveText = this.multiple
448
+ ? `${this.value ? this.value.length : 0} of ${this.flatOptions.length} selected`
449
+ : this.value
450
+ ? value_label !== null && value_label !== void 0 ? value_label : `${value_label} selected`
451
+ : "";
667
452
  };
668
- this.handleFormReset = () => {
669
- this.value = this.initialValue;
670
- if (this.searchable) {
671
- this.searchableSelectInputValue = this.getDefaultValue(this.value);
672
- this.hiddenInputValue = this.value;
673
- }
453
+ this.updateSearchableSelectResultAriaLive = () => {
454
+ var _a, _b;
455
+ this.selectInputAriaLiveText =
456
+ ((_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.label) == this.emptyOptionListText
457
+ ? this.emptyOptionListText
458
+ : "";
674
459
  };
675
- this.clearInput = () => {
676
- var _a;
677
- this.noOptions = null;
678
- if (this.searchable) {
679
- (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.setAttribute("value", "");
680
- this.searchableSelectInputValue = null;
681
- this.filteredOptions = this.uniqueOptions;
682
- }
460
+ this.updateAriaActiveDescendant = (event) => {
461
+ this.ariaActiveDescendant = event.detail.optionId;
683
462
  };
684
- this.renderNativeOption = (option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.currValue }, option.label));
463
+ this.handleMenuChange = (event) => {
464
+ this.open = event.detail.open;
465
+ this.pressedCharacters = "";
466
+ };
467
+ this.getDeduplicatedOptions = (flatOptions) => {
468
+ const seen = new Set();
469
+ return flatOptions.filter((option) => {
470
+ if (option.value && seen.has(option.value)) {
471
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
472
+ return false;
473
+ }
474
+ if (option.value)
475
+ seen.add(option.value);
476
+ return true;
477
+ });
478
+ };
479
+ this.renderNativeOption = (option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label));
685
480
  }
686
481
  watchDisabledHandler() {
687
482
  removeDisabledFalse(this.disabled, this.el);
688
483
  }
689
484
  loadingHandler(newValue) {
690
- newValue ? this.triggerLoading() : this.setOptions();
485
+ this.hasTimedOut = false;
486
+ if (newValue) {
487
+ this.hasError = false;
488
+ if (this.timeout) {
489
+ if (this.timeoutTimer) {
490
+ this.clearTimer();
491
+ }
492
+ this.timeoutTimer = window.setTimeout(() => {
493
+ this.loading = false;
494
+ this.hasTimedOut = true;
495
+ forceUpdate(this);
496
+ }, this.timeout);
497
+ }
498
+ }
499
+ else {
500
+ if (this.timeoutTimer) {
501
+ this.clearTimer();
502
+ }
503
+ }
691
504
  }
692
- watchOptionsHandler() {
693
- this.setOptions();
505
+ clearTimer() {
506
+ if (this.timeoutTimer) {
507
+ clearTimeout(this.timeoutTimer);
508
+ this.timeoutTimer = null;
509
+ }
510
+ }
511
+ optionsChangedHandler() {
512
+ const flat = this.getFlatOptions(this.options)
513
+ .filter((option) => option.value != null || option.label != null) // filter out options missing both value and label
514
+ .map((option) => {
515
+ var _a, _b;
516
+ return (Object.assign(Object.assign({}, option), { value: (_a = option.value) !== null && _a !== void 0 ? _a : option.label, label: (_b = option.label) !== null && _b !== void 0 ? _b : option.value }));
517
+ });
518
+ this.flatOptions = this.getDeduplicatedOptions(flat);
519
+ if (!this.initialRender)
520
+ this.loading = false;
521
+ this.clearTimer();
522
+ this.updateSelectButtonAriaLive();
694
523
  }
695
524
  debounceChangedHandler(newValue) {
696
525
  if (this.currDebounce !== newValue) {
697
526
  this.currDebounce = newValue;
698
527
  }
699
528
  }
700
- valueChangedHandler() {
701
- if (this.value !== this.currValue) {
702
- if (this.value && this.multiple) {
703
- this.currValue = this.getMultipleOptionsString(this.value)
704
- ? this.getValueSortedByOptions(this.value)
705
- : null;
706
- this.updateMultiSelectedCountAriaLive();
707
- }
708
- else {
709
- this.currValue = this.getLabelFromValue(this.value)
710
- ? this.value
711
- : null;
712
- }
713
- }
714
- if (this.searchable && this.value) {
715
- // Only set if value not null - prevents whole input value being cleared when edited
716
- this.searchableSelectInputValue =
717
- this.getLabelFromValue(String(this.currValue)) || null;
529
+ valueChangedHandler(newValue) {
530
+ const validated = this.getValidatedValue(newValue);
531
+ const isEqual = Array.isArray(validated) && Array.isArray(this.value)
532
+ ? validated.length === this.value.length &&
533
+ validated.every((v, i) => v === this.value[i])
534
+ : validated === this.value;
535
+ if (!isEqual) {
536
+ this.value = validated;
537
+ return;
718
538
  }
539
+ this.updateSelectButtonAriaLive();
540
+ this.icChange.emit({ value: this.value });
719
541
  }
720
542
  openChangedHandler() {
721
543
  this.open ? this.icOpen.emit() : this.icClose.emit();
544
+ if (!this.open) {
545
+ this.ariaActiveDescendant = undefined;
546
+ }
547
+ this.handleFocusIndicatorDisplay();
548
+ }
549
+ /**
550
+ * Sets focus on the select component.
551
+ */
552
+ async setFocus() {
553
+ if (this.nativeSelectElement) {
554
+ this.nativeSelectElement.focus();
555
+ }
556
+ else if (this.selectElement) {
557
+ this.selectElement.focus();
558
+ }
559
+ else if (this.searchableSelectElement) {
560
+ this.searchableSelectElement.focus();
561
+ }
562
+ }
563
+ componentDidRender() {
564
+ if (this.nativeSelectElement && !this.disabled) {
565
+ this.setTextColor();
566
+ }
567
+ this.initialRender = false;
722
568
  }
723
569
  disconnectedCallback() {
724
570
  var _a;
725
571
  removeFormResetListener(this.el, this.handleFormReset);
726
572
  (_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
727
- }
728
- componentWillLoad() {
729
- const valueInOptions = this.multiple
730
- ? this.getMultipleOptionsString(this.value)
731
- : this.getLabelFromValue(this.value);
732
- this.currValue = valueInOptions ? this.value : null;
733
- this.inheritedAttributes = inheritAttributes(this.el, MUTABLE_ATTRIBUTES);
734
- removeDisabledFalse(this.disabled, this.el);
735
- this.setOptionsValuesFromLabels();
736
- addFormResetListener(this.el, this.handleFormReset);
737
- if (!this.options.length) {
738
- this.initialOptionsEmpty = true;
739
- this.noOptions = [{ label: this.emptyOptionListText, value: "" }];
740
- this.uniqueOptions = this.noOptions;
741
- this.filteredOptions = this.noOptions;
742
- }
743
- else {
744
- this.setDefaultValue();
745
- this.uniqueOptions = this.deduplicateOptions(this.options);
746
- }
573
+ this.clearTimer();
747
574
  }
748
575
  componentDidLoad() {
749
- onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Select");
750
- if (this.loading) {
751
- this.triggerLoading();
752
- }
753
- if (this.searchable) {
754
- this.hiddenInputValue = this.currValue;
755
- }
576
+ forceUpdate(this);
756
577
  this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
757
578
  this.hostMutationObserver.observe(this.el, {
758
579
  attributes: true,
759
580
  childList: true,
760
581
  });
761
582
  }
762
- componentDidRender() {
763
- if (this.nativeSelectElement && !this.disabled) {
764
- this.setTextColor();
765
- }
766
- }
767
- /**
768
- * Sets focus on the input box.
769
- */
770
- async setFocus() {
771
- if (this.nativeSelectElement) {
772
- this.nativeSelectElement.focus();
773
- }
774
- else if (this.customSelectElement) {
775
- this.customSelectElement.focus();
776
- }
777
- else if (this.searchableSelectElement) {
778
- this.searchableSelectElement.focus();
779
- }
583
+ componentWillLoad() {
584
+ this.optionsChangedHandler();
585
+ this.value = this.getValidatedValue(this.value);
586
+ this.initialValue = this.value;
587
+ if (this.loading)
588
+ this.loadingHandler(true);
589
+ addFormResetListener(this.el, this.handleFormReset);
780
590
  }
781
591
  render() {
782
- var _a, _b, _c, _d;
783
- const { size, disabled, fullWidth, helperText, hideLabel, label, menuId, multiple, name, options, placeholder, readonly, required, searchable, showClearButton, validationAriaLive, validationStatus, validationText, currValue, theme, hiddenInputValue, open, inputId, searchableSelectInputValue, loading, value, emptyOptionListText, uniqueOptions, selectOnEnter, form, inheritedAttributes, ariaActiveDescendant, hasTimedOut, filteredOptions, clearButtonFocused, } = this;
784
- // HTML inputs only accept 'string' for their value
785
- // Does not cause errors when it is a multi-select - sets value correctly, to a comma-separated string
786
- renderHiddenInput(this.el, searchable ? hiddenInputValue : currValue, name || inputId, disabled);
787
- const invalid = `${validationStatus === IcInformationStatus.Error}`;
788
- const showValidation = hasValidationStatus(validationStatus, !!disabled);
789
- const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", showValidation).trim();
790
- const valueLabelString = multiple
791
- ? this.getMultipleOptionsString(currValue)
792
- : this.getLabelFromValue(currValue);
592
+ const { disabled, searchable, size, fullWidth, theme, readonly, hideLabel, inputId, label, helperText, required, value, options, menuId, multiple, validationStatus, open, showClearButton, selectOnEnter, loading, searchableSelectInputValue, validationText, validationAriaLive, form, ariaActiveDescendant, placeholder, name, inheritedAttributes, selectInputAriaLiveText, selectButtonAriaLiveText, } = this;
593
+ const hasValue = !!value;
594
+ const hasInput = !!searchableSelectInputValue;
793
595
  const isClearable = !disabled &&
794
- (searchable
795
- ? !!searchableSelectInputValue
796
- : !!currValue && !loading && showClearButton);
797
- return (h(Host, { key: '9c3955b4ba942dd962018252d50aad7bbb1f1744', class: {
596
+ ((searchable && (hasInput || hasValue)) ||
597
+ (!searchable && hasValue && !loading && showClearButton));
598
+ const showValidation = !!validationStatus && !disabled;
599
+ const invalid = validationStatus === IcInformationStatus.Error;
600
+ const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", showValidation).trim();
601
+ const menuOptions = this.getOptions();
602
+ const noOptions = disabled ||
603
+ (menuOptions.length === 1 &&
604
+ (menuOptions[0].label === this.emptyOptionListText ||
605
+ "loading" in menuOptions[0] ||
606
+ "timedOut" in menuOptions[0]));
607
+ renderHiddenInput(this.el, value, name || inputId, disabled);
608
+ const ClearButton = () => (h("ic-button", { key: '983b6bfae4f3a9d439f23fe022652605d91f0a1e', ref: (el) => (this.clearButton = el), id: "clear-button", "aria-label": this.searchable ? "Clear input" : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onBlur: this.handleBlur, size: size, variant: "icon-tertiary" }));
609
+ const NativeSelect = () => (h("select", Object.assign({ key: '2fb628398e722cff8c3759229af969600e553485', ref: (el) => (this.nativeSelectElement = el), disabled: disabled, onChange: this.handleNativeSelectChange, required: required, id: inputId, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleNativeSelectKeyDown, form: form }, inheritedAttributes), h("option", { key: '5fb827fef7ab7c597a2361ac4d019f9e07adb55f', value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => "children" in option ? (h("optgroup", { label: option.label }, option.children.map((child) => this.renderNativeOption(child)))) : (this.renderNativeOption(option)))));
610
+ const SelectButton = () => (h("div", { key: '47ad04d6da391fcb88a8b6a6a841dec93f53cd74', class: "select-container" }, h("button", { key: '7ee23a4f16c4aca4b287391ac5bf5f6ee4441b07', class: "select-input", role: "combobox", ref: (el) => (this.selectElement = el), id: inputId, "aria-label": `${label}, ${(multiple && value
611
+ ? `${value.length} of ${this.flatOptions.length} selected, ${this.getLabelString()}`
612
+ : this.getLabelString()) || placeholder}`, onClick: this.handleClick, "aria-describedby": describedBy, "aria-invalid": invalid ? "true" : "false", "aria-haspopup": "listbox", "aria-expanded": `${open}`, "aria-controls": menuId, "aria-required": `${required}`, disabled: disabled, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, "aria-activedescendant": ariaActiveDescendant }, h("ic-typography", { key: '438cce7c257e37d0a0aef5247d28d31586725a1e', variant: "body", class: {
613
+ "value-text": true,
614
+ "with-clear-button": !!isClearable,
615
+ placeholder: !value,
616
+ } }, this.getLabelString()), h("div", { key: '8926d05851401339717c159651b802fb41e53096', class: "select-input-end" }, isClearable && h("div", { key: '5c94e4ba98ad972001890d639b00c82887e0fb5d', class: "divider" }), h("span", { key: '23569f5196d66f2b4a834d44006f6a05446598cd', class: {
617
+ "expand-icon": true,
618
+ "expand-icon-open": open,
619
+ }, innerHTML: Expand, "aria-hidden": "true" }))), isClearable && h(ClearButton, { key: 'e4165cb01b0bdc1681e3d9490007182b934f40ea' }), h("div", { key: '6208229358ee8ba7a007a08f5e551d494015a347', "aria-live": "polite", "aria-atomic": "true", class: "aria-live-hidden-text" }, selectButtonAriaLiveText)));
620
+ const SelectInput = () => (h("div", { key: 'af39791c29e8d792c16fed1fffe08db8f621fcac', class: "searchable-select-container" }, h("input", { key: '366bd3c57ad76f130d73ab2390c557b9e8fe98c8', class: {
621
+ "value-text": true,
622
+ "select-input": true,
623
+ "with-clear-button": !!searchableSelectInputValue,
624
+ }, role: "combobox", autocomplete: "off", "aria-label": label, "aria-describedby": describedBy, "aria-activedescendant": ariaActiveDescendant, "aria-autocomplete": "list", "aria-expanded": `${open}`, "aria-invalid": invalid ? "true" : "false", "aria-required": `${required}`, "aria-controls": menuId, ref: (el) => (this.searchableSelectElement = el), id: inputId, value: multiple
625
+ ? ""
626
+ : value
627
+ ? this.getLabelString()
628
+ : searchableSelectInputValue || undefined, disabled: disabled, placeholder: placeholder, onInput: this.handleSearchableSelectInput, onClick: this.handleClick, onBlur: this.handleBlur, onFocus: this.handleFocus, onKeyDown: this.handleKeyDown, form: form }), isClearable && (h("div", { key: 'e9260358a6c8ac3683d1de3015064665d32d907f', class: "clear-button-container" }, h(ClearButton, { key: '0c05ed1cf92ac8fde61ba55192a8a1511338239e' }), h("div", { key: 'e44933edcc7c79459f1ecd551eec43a86fd53b11', class: "divider" }))), h("span", { key: '36e7fe34e7d438caab2967fae27bfe4fb2e49041', onMouseDown: this.handleExpandIconMouseDown, class: {
629
+ "expand-icon": true,
630
+ "expand-icon-open": open,
631
+ }, innerHTML: Expand, "aria-hidden": "true" }), h("div", { key: 'c3e06f04e62b273b8a7a6f9df0aa27bf71060ed4', "aria-live": "polite", role: "status", class: "aria-live-hidden-text" }, selectInputAriaLiveText)));
632
+ const ReadOnly = () => (h("ic-typography", { key: '979d342f453fdb2ed79a6cf231d9a40275662a44' }, h("p", { key: '221530958da8731657b5ad4d455041dc3934718f' }, this.getLabelString() === placeholder ? "" : this.getLabelString())));
633
+ return (h(Host, { key: 'efbdccb0f0b7e86142cd530d52a86f7ce95d6c1c', class: {
798
634
  "ic-select-disabled": disabled,
799
635
  "ic-select-searchable": searchable,
800
636
  [`ic-select-${size}`]: size !== "medium",
801
637
  "ic-select-full-width": fullWidth,
802
638
  [`ic-theme-${theme}`]: theme !== "inherit",
803
- }, onBlur: this.onBlur }, h("ic-input-container", { key: 'c67e465c4a39b81ef2f9f861a02a9d9d89e5c3de', readonly: readonly }, !hideLabel && (h("ic-input-label", { key: '9554f5a63ea338139b1cf1be426ef97d829694a5', for: inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly }, h("slot", { key: '3749b881b972bf1143f67587e2d70bce773eb597', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '61c1d6fc5c5bd6535e502e9e15ca013612ab009b', ref: (el) => (this.anchorEl = el), class: { "menu-open": open }, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, isSlotUsed(this.el, "icon") &&
639
+ } }, h("ic-input-container", { key: '48fe83c1c79ec578f94a2d8af4b8b452570a421f', readonly: readonly }, !hideLabel && (h("ic-input-label", { key: '8410dabe6d0d62c7c1459991631807cfa6546735', for: inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly }, h("slot", { key: '77ce0ab9ca879ecf515de633ff27ba8e2320cf2c', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '699375a82eb49f5eb351cf95b4822b4cad7bcc1a', ref: (el) => (this.anchorEl = el), class: { "menu-open": open }, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, isSlotUsed(this.el, "icon") &&
804
640
  !disabled &&
805
- (!readonly || !!value) && (h("span", { key: 'f81e4bd0e7548bfe8206928808475083b2b641ee', slot: "left-icon", class: {
641
+ (!readonly || !!value) && (h("span", { key: 'fcfec6b75fdb0eb41950460af3c6d7dc5ad43657', slot: "left-icon", class: {
806
642
  readonly,
807
643
  "has-value": !!value,
808
- } }, h("slot", { key: '792566ca482c7ebca0804ac0a18a5beeb3e6f15a', name: "icon" }))), readonly ? (h("ic-typography", null, h("p", null, valueLabelString))) : isMobileOrTablet() && !multiple ? (h("select", Object.assign({ ref: (el) => (this.nativeSelectElement = el), disabled: disabled, onChange: this.handleNativeSelectChange, required: required, id: inputId, "aria-label": label, "aria-describedby": describedBy, "aria-invalid": invalid, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.handleNativeSelectKeyDown, form: form }, inheritedAttributes), h("option", { value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => option.children ? (h("optgroup", { label: option.label }, option.children.map((child) => this.renderNativeOption(child)))) : (this.renderNativeOption(option))))) : searchable ? (h("div", { class: "searchable-select-container" }, h("input", { class: {
809
- "value-text": true,
810
- "select-input": true,
811
- "with-clear-button": !!searchableSelectInputValue,
812
- }, role: "combobox", autocomplete: "off", "aria-label": label, "aria-describedby": describedBy, "aria-activedescendant": ariaActiveDescendant, "aria-autocomplete": "list", "aria-expanded": `${open}`, "aria-invalid": invalid, "aria-required": `${required}`, "aria-controls": menuId, ref: (el) => (this.searchableSelectElement = el), id: inputId, value: searchableSelectInputValue || undefined, placeholder: placeholder, disabled: disabled, onInput: this.handleSearchableSelectInput, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, form: form }), isClearable && (h("div", { class: "clear-button-container" }, h("ic-button", { id: "clear-button", ref: (el) => (this.clearButton = el), "aria-label": searchableSelectInputValue &&
813
- (currValue === null || loading)
814
- ? "Clear input"
815
- : "Clear selection", class: "clear-button", innerHTML: Clear, onClick: this.handleClear, onFocus: this.handleClearButtonFocus, onBlur: this.handleClearButtonBlur, size: size, variant: "icon-tertiary", theme: clearButtonFocused ? "light" : "dark" }), h("div", { class: "divider" }))), h("span", { onMouseDown: this.handleExpandIconMouseDown, class: {
816
- "expand-icon": true,
817
- "expand-icon-open": open,
818
- }, innerHTML: Expand, "aria-hidden": "true" }), h("div", { "aria-live": "polite", role: "status", class: "searchable-select-results-status" }))) : (h("div", { class: "select-container" }, h("button", { role: "combobox", class: "select-input", ref: (el) => (this.customSelectElement = el), id: inputId, "aria-label": `${label}, ${(multiple && currValue
819
- ? `${currValue.length} of ${getOptionsWithoutGroupTitlesCount(options)} selected, ${valueLabelString}`
820
- : valueLabelString) || placeholder}`, "aria-describedby": describedBy, "aria-invalid": invalid, "aria-haspopup": "listbox", "aria-expanded": `${open}`, "aria-owns": menuId, "aria-controls": menuId, "aria-required": `${required}`, disabled: disabled, onBlur: this.onBlur, onFocus: this.onFocus, onClick: this.handleClick, onMouseDown: this.handleMouseDown, onKeyDown: this.handleKeyDown }, h("ic-typography", { variant: "body", class: {
821
- "value-text": true,
822
- "with-clear-button": isClearable,
823
- placeholder: !loading && multiple
824
- ? !value || value.length < 1
825
- : !this.getLabelFromValue(currValue),
826
- } }, valueLabelString || placeholder), h("div", { class: "select-input-end" }, isClearable && h("div", { class: "divider" }), h("span", { class: {
827
- "expand-icon": true,
828
- "expand-icon-open": open,
829
- }, innerHTML: Expand, "aria-hidden": "true" }))), isClearable && (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-tertiary", theme: clearButtonFocused ? "light" : "dark" }))))), (!isMobileOrTablet() || multiple) && (h("ic-menu", { key: 'bb2e95961d8685349e46edf1c93a2dce9792657b', class: {
830
- "no-results": loading ||
831
- hasTimedOut ||
832
- (searchable &&
833
- ((_b = (_a = this.filteredOptions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.label) === emptyOptionListText) ||
834
- (!searchable &&
835
- ((_d = (_c = this.uniqueOptions) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.label) === emptyOptionListText),
836
- }, ref: (el) => (this.menu = el), inputEl: searchable
837
- ? this.searchableSelectElement
838
- : this.customSelectElement, inputLabel: label, anchorEl: this.anchorEl, size: size, menuId: menuId, open: open, options: searchable ? filteredOptions : uniqueOptions, value: multiple ? currValue : currValue, fullWidth: fullWidth, selectOnEnter: 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: searchable || multiple || selectOnEnter ? "manual" : "automatic", closeOnSelect: !multiple, multiSelect: multiple ? true : false, searchableSelect: searchable ? true : false })), multiple && (h("div", { key: '5d6db7b55942499db04a942c7980ad09e5db65f8', "aria-live": "polite", role: "status", class: "multi-select-selected-count" })), h("ic-input-validation", { key: '5133bf75be8a86fe3134491d659b934dac271e57', class: {
644
+ } }, h("slot", { key: '08d321011ba86b6d50bf3c8c85bf16595c8df657', name: "icon" }))), isMobileOrTablet() && this.useNativeSelectOnMobile && !multiple ? (h(NativeSelect, null)) : readonly ? (h(ReadOnly, null)) : !searchable ? (h(SelectButton, null)) : (h(SelectInput, null))), !(isMobileOrTablet() &&
645
+ this.useNativeSelectOnMobile &&
646
+ !multiple) && (h("ic-menu", { key: '3fc0ee9172a93e744174e2f2b7a16c4f327a82c9', ref: (el) => (this.menu = el), class: { "no-results": noOptions }, inputEl: searchable ? this.searchableSelectElement : this.selectElement, allowMenuFocus: false, inputLabel: label, anchorEl: this.anchorEl, size: size, menuId: menuId, open: open, options: this.getOptions(), value: multiple ? value : value, fullWidth: fullWidth, selectOnEnter: selectOnEnter, onMenuStateChange: this.handleMenuChange, onMenuOptionSelect: this.handleSelectChange, onMenuOptionSelectAll: this.handleSelectAllChange, onTimeoutBlur: this.handleTimeoutBlur, onMenuOptionId: this.updateAriaActiveDescendant, onClick: this.setFocus, parentEl: this.el, activationType: searchable || multiple || selectOnEnter ? "manual" : "automatic", onRetryButtonClicked: this.handleRetry, closeOnSelect: !multiple, multiSelect: multiple, searchableSelect: searchable })), h("ic-input-validation", { key: '6b8bd66f22d67776d418e0aac1b41d2f03f3c9cd', class: {
839
647
  "menu-open": open,
840
648
  }, ariaLiveMode: validationAriaLive, status: showValidation ? validationStatus : "", message: showValidation ? validationText : "", for: inputId }))));
841
649
  }
@@ -1421,6 +1229,26 @@ export class Select {
1421
1229
  "reflect": false,
1422
1230
  "defaultValue": "\"\""
1423
1231
  },
1232
+ "useNativeSelectOnMobile": {
1233
+ "type": "boolean",
1234
+ "mutable": false,
1235
+ "complexType": {
1236
+ "original": "boolean",
1237
+ "resolved": "boolean",
1238
+ "references": {}
1239
+ },
1240
+ "required": false,
1241
+ "optional": false,
1242
+ "docs": {
1243
+ "tags": [],
1244
+ "text": "If `true` and on a mobile or tablet device, the native select element will be used instead of the custom select component for better usability."
1245
+ },
1246
+ "getter": false,
1247
+ "setter": false,
1248
+ "attribute": "use-native-select-on-mobile",
1249
+ "reflect": false,
1250
+ "defaultValue": "true"
1251
+ },
1424
1252
  "loading": {
1425
1253
  "type": "boolean",
1426
1254
  "mutable": true,
@@ -1445,13 +1273,13 @@ export class Select {
1445
1273
  "type": "unknown",
1446
1274
  "mutable": false,
1447
1275
  "complexType": {
1448
- "original": "IcMenuOption[]",
1449
- "resolved": "IcMenuOption[]",
1276
+ "original": "IcSelectOption[]",
1277
+ "resolved": "IcSelectOption[]",
1450
1278
  "references": {
1451
- "IcMenuOption": {
1279
+ "IcSelectOption": {
1452
1280
  "location": "import",
1453
- "path": "../../utils/types",
1454
- "id": "src/utils/types.ts::IcMenuOption"
1281
+ "path": "./ic-select.types",
1282
+ "id": "src/components/ic-select/ic-select.types.ts::IcSelectOption"
1455
1283
  }
1456
1284
  }
1457
1285
  },
@@ -1510,19 +1338,16 @@ export class Select {
1510
1338
  static get states() {
1511
1339
  return {
1512
1340
  "ariaActiveDescendant": {},
1513
- "clearButtonFocused": {},
1514
1341
  "debounceIcInput": {},
1515
1342
  "hiddenInputValue": {},
1516
- "noOptions": {},
1517
- "open": {},
1518
- "pressedCharacters": {},
1343
+ "hasError": {},
1519
1344
  "searchableSelectInputValue": {},
1520
- "filteredOptions": {},
1521
- "uniqueOptions": {},
1345
+ "selectButtonAriaLiveText": {},
1346
+ "selectInputAriaLiveText": {},
1347
+ "flatOptions": {},
1522
1348
  "currDebounce": {},
1523
1349
  "initialValue": {},
1524
- "inputValueToFilter": {},
1525
- "currValue": {}
1350
+ "open": {}
1526
1351
  };
1527
1352
  }
1528
1353
  static get events() {
@@ -1723,7 +1548,7 @@ export class Select {
1723
1548
  "return": "Promise<void>"
1724
1549
  },
1725
1550
  "docs": {
1726
- "text": "Sets focus on the input box.",
1551
+ "text": "Sets focus on the select component.",
1727
1552
  "tags": []
1728
1553
  }
1729
1554
  }
@@ -1739,7 +1564,7 @@ export class Select {
1739
1564
  "methodName": "loadingHandler"
1740
1565
  }, {
1741
1566
  "propName": "options",
1742
- "methodName": "watchOptionsHandler"
1567
+ "methodName": "optionsChangedHandler"
1743
1568
  }, {
1744
1569
  "propName": "debounce",
1745
1570
  "methodName": "debounceChangedHandler"