@ukic/web-components 3.25.0 → 3.27.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 (328) hide show
  1. package/components/OpenInNew.js +5 -0
  2. package/components/OpenInNew.js.map +1 -0
  3. package/components/check-icon.js +8 -0
  4. package/components/check-icon.js.map +1 -0
  5. package/components/chevron-icon.js +8 -0
  6. package/components/chevron-icon.js.map +1 -0
  7. package/components/close-icon.js +10 -0
  8. package/components/close-icon.js.map +1 -0
  9. package/components/constants.js +184 -0
  10. package/components/constants.js.map +1 -0
  11. package/components/custom-elements.d.ts +2 -0
  12. package/components/helpers.js +547 -0
  13. package/components/helpers.js.map +1 -0
  14. package/components/ic-accordion-group.d.ts +11 -0
  15. package/components/ic-accordion-group.js +191 -0
  16. package/components/ic-accordion-group.js.map +1 -0
  17. package/components/ic-accordion.d.ts +11 -0
  18. package/components/ic-accordion.js +188 -0
  19. package/components/ic-accordion.js.map +1 -0
  20. package/components/ic-action-chip.d.ts +11 -0
  21. package/components/ic-action-chip.js +164 -0
  22. package/components/ic-action-chip.js.map +1 -0
  23. package/components/ic-alert.d.ts +11 -0
  24. package/components/ic-alert.js +193 -0
  25. package/components/ic-alert.js.map +1 -0
  26. package/components/ic-back-to-top.d.ts +11 -0
  27. package/components/ic-back-to-top.js +216 -0
  28. package/components/ic-back-to-top.js.map +1 -0
  29. package/components/ic-badge.d.ts +11 -0
  30. package/components/ic-badge.js +222 -0
  31. package/components/ic-badge.js.map +1 -0
  32. package/components/ic-breadcrumb-group.d.ts +11 -0
  33. package/components/ic-breadcrumb-group.js +278 -0
  34. package/components/ic-breadcrumb-group.js.map +1 -0
  35. package/components/ic-breadcrumb.d.ts +11 -0
  36. package/components/ic-breadcrumb.js +8 -0
  37. package/components/ic-breadcrumb.js.map +1 -0
  38. package/components/ic-breadcrumb2.js +145 -0
  39. package/components/ic-breadcrumb2.js.map +1 -0
  40. package/components/ic-button.d.ts +11 -0
  41. package/components/ic-button.js +8 -0
  42. package/components/ic-button.js.map +1 -0
  43. package/components/ic-button2.js +509 -0
  44. package/components/ic-button2.js.map +1 -0
  45. package/components/ic-card-horizontal.d.ts +11 -0
  46. package/components/ic-card-horizontal.js +214 -0
  47. package/components/ic-card-horizontal.js.map +1 -0
  48. package/components/ic-card-vertical.d.ts +11 -0
  49. package/components/ic-card-vertical.js +219 -0
  50. package/components/ic-card-vertical.js.map +1 -0
  51. package/components/ic-checkbox-group.d.ts +11 -0
  52. package/components/ic-checkbox-group.js +198 -0
  53. package/components/ic-checkbox-group.js.map +1 -0
  54. package/components/ic-checkbox.d.ts +11 -0
  55. package/components/ic-checkbox.js +202 -0
  56. package/components/ic-checkbox.js.map +1 -0
  57. package/components/ic-chip.d.ts +11 -0
  58. package/components/ic-chip.js +183 -0
  59. package/components/ic-chip.js.map +1 -0
  60. package/components/ic-classification-banner.d.ts +11 -0
  61. package/components/ic-classification-banner.js +102 -0
  62. package/components/ic-classification-banner.js.map +1 -0
  63. package/components/ic-data-list.d.ts +11 -0
  64. package/components/ic-data-list.js +63 -0
  65. package/components/ic-data-list.js.map +1 -0
  66. package/components/ic-data-row.d.ts +11 -0
  67. package/components/ic-data-row.js +115 -0
  68. package/components/ic-data-row.js.map +1 -0
  69. package/components/ic-dialog.d.ts +11 -0
  70. package/components/ic-dialog.js +366 -0
  71. package/components/ic-dialog.js.map +1 -0
  72. package/components/ic-divider.d.ts +11 -0
  73. package/components/ic-divider.js +8 -0
  74. package/components/ic-divider.js.map +1 -0
  75. package/components/ic-divider2.js +148 -0
  76. package/components/ic-divider2.js.map +1 -0
  77. package/components/ic-empty-state.d.ts +11 -0
  78. package/components/ic-empty-state.js +82 -0
  79. package/components/ic-empty-state.js.map +1 -0
  80. package/components/ic-footer-link-group.d.ts +11 -0
  81. package/components/ic-footer-link-group.js +101 -0
  82. package/components/ic-footer-link-group.js.map +1 -0
  83. package/components/ic-footer-link.d.ts +11 -0
  84. package/components/ic-footer-link.js +95 -0
  85. package/components/ic-footer-link.js.map +1 -0
  86. package/components/ic-footer.d.ts +11 -0
  87. package/components/ic-footer.js +156 -0
  88. package/components/ic-footer.js.map +1 -0
  89. package/components/ic-hero.d.ts +11 -0
  90. package/components/ic-hero.js +145 -0
  91. package/components/ic-hero.js.map +1 -0
  92. package/components/ic-horizontal-scroll.d.ts +11 -0
  93. package/components/ic-horizontal-scroll.js +8 -0
  94. package/components/ic-horizontal-scroll.js.map +1 -0
  95. package/components/ic-horizontal-scroll2.js +240 -0
  96. package/components/ic-horizontal-scroll2.js.map +1 -0
  97. package/components/ic-input-component-container.d.ts +11 -0
  98. package/components/ic-input-component-container.js +8 -0
  99. package/components/ic-input-component-container.js.map +1 -0
  100. package/components/ic-input-component-container2.js +95 -0
  101. package/components/ic-input-component-container2.js.map +1 -0
  102. package/components/ic-input-container.d.ts +11 -0
  103. package/components/ic-input-container.js +8 -0
  104. package/components/ic-input-container.js.map +1 -0
  105. package/components/ic-input-container2.js +47 -0
  106. package/components/ic-input-container2.js.map +1 -0
  107. package/components/ic-input-label.d.ts +11 -0
  108. package/components/ic-input-label.js +8 -0
  109. package/components/ic-input-label.js.map +1 -0
  110. package/components/ic-input-label2.js +121 -0
  111. package/components/ic-input-label2.js.map +1 -0
  112. package/components/ic-input-validation.d.ts +11 -0
  113. package/components/ic-input-validation.js +8 -0
  114. package/components/ic-input-validation.js.map +1 -0
  115. package/components/ic-input-validation2.js +90 -0
  116. package/components/ic-input-validation2.js.map +1 -0
  117. package/components/ic-layout-grid-item.d.ts +11 -0
  118. package/components/ic-layout-grid-item.js +95 -0
  119. package/components/ic-layout-grid-item.js.map +1 -0
  120. package/components/ic-layout-grid.d.ts +11 -0
  121. package/components/ic-layout-grid.js +188 -0
  122. package/components/ic-layout-grid.js.map +1 -0
  123. package/components/ic-link.d.ts +11 -0
  124. package/components/ic-link.js +8 -0
  125. package/components/ic-link.js.map +1 -0
  126. package/components/ic-link2.js +135 -0
  127. package/components/ic-link2.js.map +1 -0
  128. package/components/ic-loading-indicator.d.ts +11 -0
  129. package/components/ic-loading-indicator.js +8 -0
  130. package/components/ic-loading-indicator.js.map +1 -0
  131. package/components/ic-loading-indicator2.js +278 -0
  132. package/components/ic-loading-indicator2.js.map +1 -0
  133. package/components/ic-menu-group.d.ts +11 -0
  134. package/components/ic-menu-group.js +47 -0
  135. package/components/ic-menu-group.js.map +1 -0
  136. package/components/ic-menu-item.d.ts +11 -0
  137. package/components/ic-menu-item.js +8 -0
  138. package/components/ic-menu-item.js.map +1 -0
  139. package/components/ic-menu-item2.js +171 -0
  140. package/components/ic-menu-item2.js.map +1 -0
  141. package/components/ic-menu.d.ts +11 -0
  142. package/components/ic-menu.js +8 -0
  143. package/components/ic-menu.js.map +1 -0
  144. package/components/ic-menu2.js +2590 -0
  145. package/components/ic-menu2.js.map +1 -0
  146. package/components/ic-navigation-button.d.ts +11 -0
  147. package/components/ic-navigation-button.js +175 -0
  148. package/components/ic-navigation-button.js.map +1 -0
  149. package/components/ic-navigation-group.d.ts +11 -0
  150. package/components/ic-navigation-group.js +326 -0
  151. package/components/ic-navigation-group.js.map +1 -0
  152. package/components/ic-navigation-item.d.ts +11 -0
  153. package/components/ic-navigation-item.js +294 -0
  154. package/components/ic-navigation-item.js.map +1 -0
  155. package/components/ic-navigation-menu.d.ts +11 -0
  156. package/components/ic-navigation-menu.js +8 -0
  157. package/components/ic-navigation-menu.js.map +1 -0
  158. package/components/ic-navigation-menu2.js +188 -0
  159. package/components/ic-navigation-menu2.js.map +1 -0
  160. package/components/ic-page-header.d.ts +11 -0
  161. package/components/ic-page-header.js +196 -0
  162. package/components/ic-page-header.js.map +1 -0
  163. package/components/ic-pagination-bar.d.ts +11 -0
  164. package/components/ic-pagination-bar.js +523 -0
  165. package/components/ic-pagination-bar.js.map +1 -0
  166. package/components/ic-pagination-item.d.ts +11 -0
  167. package/components/ic-pagination-item.js +8 -0
  168. package/components/ic-pagination-item.js.map +1 -0
  169. package/components/ic-pagination-item2.js +107 -0
  170. package/components/ic-pagination-item2.js.map +1 -0
  171. package/components/ic-pagination.d.ts +11 -0
  172. package/components/ic-pagination.js +8 -0
  173. package/components/ic-pagination.js.map +1 -0
  174. package/components/ic-pagination2.js +379 -0
  175. package/components/ic-pagination2.js.map +1 -0
  176. package/components/ic-popover-menu.d.ts +11 -0
  177. package/components/ic-popover-menu.js +369 -0
  178. package/components/ic-popover-menu.js.map +1 -0
  179. package/components/ic-radio-group.d.ts +11 -0
  180. package/components/ic-radio-group.js +317 -0
  181. package/components/ic-radio-group.js.map +1 -0
  182. package/components/ic-radio-option.d.ts +11 -0
  183. package/components/ic-radio-option.js +211 -0
  184. package/components/ic-radio-option.js.map +1 -0
  185. package/components/ic-search-bar.d.ts +11 -0
  186. package/components/ic-search-bar.js +719 -0
  187. package/components/ic-search-bar.js.map +1 -0
  188. package/components/ic-section-container.d.ts +11 -0
  189. package/components/ic-section-container.js +8 -0
  190. package/components/ic-section-container.js.map +1 -0
  191. package/components/ic-section-container2.js +50 -0
  192. package/components/ic-section-container2.js.map +1 -0
  193. package/components/ic-select.d.ts +11 -0
  194. package/components/ic-select.js +8 -0
  195. package/components/ic-select.js.map +1 -0
  196. package/components/ic-select2.js +806 -0
  197. package/components/ic-select2.js.map +1 -0
  198. package/components/ic-side-navigation.d.ts +11 -0
  199. package/components/ic-side-navigation.js +568 -0
  200. package/components/ic-side-navigation.js.map +1 -0
  201. package/components/ic-skeleton.d.ts +11 -0
  202. package/components/ic-skeleton.js +81 -0
  203. package/components/ic-skeleton.js.map +1 -0
  204. package/components/ic-skip-link.d.ts +11 -0
  205. package/components/ic-skip-link.js +91 -0
  206. package/components/ic-skip-link.js.map +1 -0
  207. package/components/ic-status-tag.d.ts +11 -0
  208. package/components/ic-status-tag.js +85 -0
  209. package/components/ic-status-tag.js.map +1 -0
  210. package/components/ic-step.d.ts +11 -0
  211. package/components/ic-step.js +200 -0
  212. package/components/ic-step.js.map +1 -0
  213. package/components/ic-stepper.d.ts +11 -0
  214. package/components/ic-stepper.js +340 -0
  215. package/components/ic-stepper.js.map +1 -0
  216. package/components/ic-switch.d.ts +11 -0
  217. package/components/ic-switch.js +164 -0
  218. package/components/ic-switch.js.map +1 -0
  219. package/components/ic-tab-context.d.ts +11 -0
  220. package/components/ic-tab-context.js +275 -0
  221. package/components/ic-tab-context.js.map +1 -0
  222. package/components/ic-tab-group.d.ts +11 -0
  223. package/components/ic-tab-group.js +89 -0
  224. package/components/ic-tab-group.js.map +1 -0
  225. package/components/ic-tab-panel.d.ts +11 -0
  226. package/components/ic-tab-panel.js +63 -0
  227. package/components/ic-tab-panel.js.map +1 -0
  228. package/components/ic-tab.d.ts +11 -0
  229. package/components/ic-tab.js +143 -0
  230. package/components/ic-tab.js.map +1 -0
  231. package/components/ic-text-field.d.ts +11 -0
  232. package/components/ic-text-field.js +8 -0
  233. package/components/ic-text-field.js.map +1 -0
  234. package/components/ic-text-field2.js +532 -0
  235. package/components/ic-text-field2.js.map +1 -0
  236. package/components/ic-theme.d.ts +11 -0
  237. package/components/ic-theme.js +105 -0
  238. package/components/ic-theme.js.map +1 -0
  239. package/components/ic-toast-region.d.ts +11 -0
  240. package/components/ic-toast-region.js +76 -0
  241. package/components/ic-toast-region.js.map +1 -0
  242. package/components/ic-toast.d.ts +11 -0
  243. package/components/ic-toast.js +295 -0
  244. package/components/ic-toast.js.map +1 -0
  245. package/components/ic-toggle-button-group.d.ts +11 -0
  246. package/components/ic-toggle-button-group.js +323 -0
  247. package/components/ic-toggle-button-group.js.map +1 -0
  248. package/components/ic-toggle-button.d.ts +11 -0
  249. package/components/ic-toggle-button.js +235 -0
  250. package/components/ic-toggle-button.js.map +1 -0
  251. package/components/ic-tooltip.d.ts +11 -0
  252. package/components/ic-tooltip.js +8 -0
  253. package/components/ic-tooltip.js.map +1 -0
  254. package/components/ic-tooltip2.js +2078 -0
  255. package/components/ic-tooltip2.js.map +1 -0
  256. package/components/ic-top-navigation.d.ts +11 -0
  257. package/components/ic-top-navigation.js +320 -0
  258. package/components/ic-top-navigation.js.map +1 -0
  259. package/components/ic-typography.d.ts +11 -0
  260. package/components/ic-typography.js +8 -0
  261. package/components/ic-typography.js.map +1 -0
  262. package/components/ic-typography2.js +228 -0
  263. package/components/ic-typography2.js.map +1 -0
  264. package/components/index.d.ts +33 -0
  265. package/components/index.js +4 -0
  266. package/components/index.js.map +1 -0
  267. package/components/package.json +9 -0
  268. package/dist/cjs/core.cjs.js +1 -1
  269. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  270. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +63 -37
  271. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  272. package/dist/cjs/ic-pagination_3.cjs.entry.js +17 -17
  273. package/dist/cjs/ic-pagination_3.cjs.entry.js.map +1 -1
  274. package/dist/cjs/ic-section-container.cjs.entry.js.map +1 -1
  275. package/dist/cjs/ic-top-navigation.cjs.entry.js +12 -8
  276. package/dist/cjs/ic-top-navigation.cjs.entry.js.map +1 -1
  277. package/dist/cjs/loader.cjs.js +1 -1
  278. package/dist/collection/components/ic-menu/ic-menu.css +19 -0
  279. package/dist/collection/components/ic-menu/ic-menu.js +62 -36
  280. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  281. package/dist/collection/components/ic-menu/ic-menu.types.js.map +1 -1
  282. package/dist/collection/components/ic-select/ic-select.js +17 -17
  283. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  284. package/dist/collection/components/ic-select/ic-select_(single).stories.js +54 -0
  285. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js +33 -9
  286. package/dist/collection/components/ic-top-navigation/ic-top-navigation.js.map +1 -1
  287. package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +26 -0
  288. package/dist/components/ic-menu2.js +63 -37
  289. package/dist/components/ic-menu2.js.map +1 -1
  290. package/dist/components/ic-page-header.js.map +1 -1
  291. package/dist/components/ic-popover-menu.js.map +1 -1
  292. package/dist/components/ic-radio-group.js.map +1 -1
  293. package/dist/components/ic-radio-option.js.map +1 -1
  294. package/dist/components/ic-select2.js +17 -17
  295. package/dist/components/ic-select2.js.map +1 -1
  296. package/dist/components/ic-top-navigation.js +13 -8
  297. package/dist/components/ic-top-navigation.js.map +1 -1
  298. package/dist/core/core.esm.js +1 -1
  299. package/dist/core/core.esm.js.map +1 -1
  300. package/dist/core/{p-46e5a58b.entry.js → p-12474095.entry.js} +2 -2
  301. package/dist/core/p-12474095.entry.js.map +1 -0
  302. package/dist/core/p-98dee727.entry.js.map +1 -1
  303. package/dist/core/p-d1220d2a.entry.js.map +1 -1
  304. package/dist/core/p-e0b66371.entry.js +2 -0
  305. package/dist/core/p-e0b66371.entry.js.map +1 -0
  306. package/dist/core/{p-171a19bf.entry.js → p-fdc4376e.entry.js} +2 -2
  307. package/dist/core/p-fdc4376e.entry.js.map +1 -0
  308. package/dist/esm/core.js +1 -1
  309. package/dist/esm/ic-button_3.entry.js.map +1 -1
  310. package/dist/esm/ic-input-component-container_3.entry.js +63 -37
  311. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  312. package/dist/esm/ic-pagination_3.entry.js +17 -17
  313. package/dist/esm/ic-pagination_3.entry.js.map +1 -1
  314. package/dist/esm/ic-section-container.entry.js.map +1 -1
  315. package/dist/esm/ic-top-navigation.entry.js +12 -8
  316. package/dist/esm/ic-top-navigation.entry.js.map +1 -1
  317. package/dist/esm/loader.js +1 -1
  318. package/dist/types/components/ic-menu/ic-menu.types.d.ts +1 -0
  319. package/dist/types/components/ic-top-navigation/ic-top-navigation.d.ts +4 -1
  320. package/dist/types/components.d.ts +10 -2
  321. package/hydrate/index.js +93 -62
  322. package/hydrate/index.mjs +93 -62
  323. package/package.json +4 -2
  324. package/vscode-data.json +5 -1
  325. package/dist/core/p-171a19bf.entry.js.map +0 -1
  326. package/dist/core/p-343670b4.entry.js +0 -2
  327. package/dist/core/p-343670b4.entry.js.map +0 -1
  328. package/dist/core/p-46e5a58b.entry.js.map +0 -1
@@ -0,0 +1,806 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
2
+ import { S as checkSlotInChildMutations, r as removeDisabledFalse, t as removeFormResetListener, s as addFormResetListener, w as getInputDescribedByText, u as renderHiddenInput, i as isSlotUsed, T as isMobileOrTablet, A as IcInformationStatus } from './helpers.js';
3
+ import { I as IC_INHERITED_ARIA } from './constants.js';
4
+ import { d as defineCustomElement$9 } from './ic-button2.js';
5
+ import { d as defineCustomElement$8 } from './ic-input-component-container2.js';
6
+ import { d as defineCustomElement$7 } from './ic-input-container2.js';
7
+ import { d as defineCustomElement$6 } from './ic-input-label2.js';
8
+ import { d as defineCustomElement$5 } from './ic-input-validation2.js';
9
+ import { d as defineCustomElement$4 } from './ic-loading-indicator2.js';
10
+ import { d as defineCustomElement$3 } from './ic-menu2.js';
11
+ import { d as defineCustomElement$2 } from './ic-tooltip2.js';
12
+ import { d as defineCustomElement$1 } from './ic-typography2.js';
13
+
14
+ const Expand = `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
15
+ <path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />
16
+ </svg>
17
+ `;
18
+
19
+ const Clear = `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
20
+ <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" />
21
+ </svg>
22
+ `;
23
+
24
+ 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;--ic-input-label-helpertext-padding:var(--ic-space-xs);--menu-max-height:100px;--border-color:var(--ic-select-field-border);--border-color-hover:var(--ic-select-field-border-hover);--border-color-pressed:var(--ic-select-field-border-pressed);--border-color-disabled:var(--ic-select-field-border-disabled);--border-color-error:var(--ic-select-field-border-error);--border-color-error-hover:var(--ic-select-field-border-error-hover);--border-color-error-pressed:var(--ic-select-field-border-error-pressed);--border-color-success:var(--ic-select-field-border-success);--border-color-success-hover:var(--ic-select-field-border-success-hover);--border-color-success-pressed:var(--ic-select-field-border-success-pressed);--border-color-warning:var(--ic-select-field-border-warning);--border-color-warning-hover:var(--ic-select-field-border-warning-hover);--border-color-warning-pressed:var(--ic-select-field-border-warning-pressed);--ic-input-label-text-color:var(--ic-select-field-label);--ic-input-label-helper-text-color:var(\n --ic-select-input-field-label-subtitle\n );--ic-input-validation-status-text-color:var(--ic-select-state-text);--ic-input-validation-error:var(--ic-select-state-icon-error);--ic-input-validation-warning-icon-color:var(--ic-select-state-icon-warning);--ic-input-validation-success-icon-color:var(--ic-select-state-icon-success);--menu-item-text-color:var(--ic-select-list-option-text);--menu-bg-color:var(--ic-select-list-option-background);--menu-border-color:var(--ic-select-dropdown-list-border)}:host(.ic-select-disabled){--ic-input-label-text-color:var(--ic-select-field-label-disabled);--ic-input-label-helper-text-color:var(\n --ic-select-input-field-label-subtitle-disabled\n )}:host(.ic-select-full-width){width:100%}ic-input-component-container.menu-open{--border-color:var(--ic-select-field-border-pressed)}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)}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-select-field-background);color:var(--ic-select-content-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:var(--ic-select-mobile-dropdown-icon);caret-color:var(--ic-select-input-field-text-cursor)}select option,.select-option-selected{color:var(--ic-select-list-option-text)}select:disabled{color:var(--ic-select-content-text-disabled);background-image:var(--ic-select-mobile-dropdown-icon-disabled)}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;background-color:var(--ic-select-field-background);color:var(--ic-select-content-text)}.select-input:focus{outline:none}.select-input[disabled]{pointer-events:none}:host(.ic-select-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;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:0 !important}.value-text.with-clear-button{padding-right:calc(var(--ic-space-xl) + var(--ic-space-xs))}.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-select-expand-icon-color)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.ic-select-disabled) .expand-icon,:host(.ic-select-disabled) .expand-icon>svg>path{color:var(--ic-select-disabled-expand-icon-color)}:host(.ic-select-searchable) .expand-icon{padding-left:0;height:2.25rem}:host(.ic-select-searchable) .expand-icon>svg{height:2.25rem;padding:0 calc(var(--ic-space-xxxs) + var(--ic-space-xxs)) 0\n var(--ic-space-xxs)}:host(.ic-select-searchable:not(.ic-select-disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-select-expand-icon-color)}.expand-icon-open,:host(.ic-select-searchable) .expand-icon-open{transform:rotateX(180deg)}.placeholder{color:var(--ic-select-content-placeholder-text)}:host(.ic-select-disabled.ic-select-searchable) .select-input::-moz-placeholder{color:var(--ic-select-content-text-disabled)}:host(.ic-select-disabled) .value-text,:host(.ic-select-disabled) .select-input,:host(.ic-select-disabled) .placeholder,:host(.ic-select-disabled.ic-select-searchable) .select-input::placeholder{color:var(--ic-select-content-text-disabled)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex;align-items:center}.divider{width:var(--ic-space-1px);background-color:var(--ic-select-content-divider);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.ic-select-small) .divider{height:var(--ic-space-md)}:host(.ic-select-large) .divider{height:var(--ic-space-xl)}.clear-button{color:var(--ic-select-clear-button);position:absolute;right:calc(var(--ic-space-xl) + var(--ic-space-xxs) - var(--ic-space-1px));border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus,.clear-button:active{background-color:var(--ic-color-focus-inner);box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer);border-radius:0.25rem}.clear-button:focus,.clear-button:active *{fill:var(--ic-atoms-input-clear-button-focus)}.clear-button.searchable{position:static}.aria-live-hidden-text{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)}::slotted([slot=\"icon\"]){fill:var(--ic-select-content-placeholder-text)}.has-value ::slotted([slot=\"icon\"]){fill:var(--ic-select-content-text)}.readonly ::slotted([slot=\"icon\"]){padding:0.375rem;margin-bottom:0.75rem}@media (forced-colors: active){.has-value ::slotted([slot=\"icon\"]){fill:currentcolor}}@media (prefers-reduced-motion: reduce){.clear-button,ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{transition:none}}";
25
+ const IcSelectStyle0 = icSelectCss;
26
+
27
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
28
+ var t = {};
29
+ for (var p in s)
30
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
31
+ t[p] = s[p];
32
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
33
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
34
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
35
+ t[p[i]] = s[p[i]];
36
+ }
37
+ return t;
38
+ };
39
+ let inputIds = 0;
40
+ const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "tabindex", "title"];
41
+ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement {
42
+ constructor() {
43
+ super();
44
+ this.__registerHost();
45
+ this.__attachShadow();
46
+ this.icBlur = createEvent(this, "icBlur", 7);
47
+ this.icChange = createEvent(this, "icChange", 7);
48
+ this.icClear = createEvent(this, "icClear", 7);
49
+ this.icClose = createEvent(this, "icClose", 7);
50
+ this.icFocus = createEvent(this, "icFocus", 7);
51
+ this.icInput = createEvent(this, "icInput", 7);
52
+ this.icOpen = createEvent(this, "icOpen", 7);
53
+ this.icOptionSelect = createEvent(this, "icOptionSelect", 7);
54
+ this.icOptionDeselect = createEvent(this, "icOptionDeselect", 7);
55
+ this.icRetryLoad = createEvent(this, "icRetryLoad", 7);
56
+ this.inputId = `ic-select-input-${inputIds++}`;
57
+ this.menuId = `${this.inputId}-menu`;
58
+ this.inheritedAttributes = {};
59
+ this.hostMutationObserver = null;
60
+ this.timeoutTimer = null;
61
+ this.hasTimedOut = false;
62
+ this.initialRender = true;
63
+ this.pressedCharacters = "";
64
+ this.hasError = false;
65
+ this.searchableSelectInputValue = "";
66
+ this.selectButtonAriaLiveText = "";
67
+ this.selectInputAriaLiveText = "";
68
+ /**
69
+ * If `true`, the disabled state will be set.
70
+ */
71
+ this.disabled = false;
72
+ /**
73
+ * If `true`, the built in filtering will be disabled for a searchable variant. For example, if options will already be filtered from external source.
74
+ */
75
+ this.disableAutoFiltering = false;
76
+ /**
77
+ * The text displayed when there are no options in the option list.
78
+ */
79
+ this.emptyOptionListText = "No results found";
80
+ /**
81
+ * If `true`, the select will fill the width of the container.
82
+ */
83
+ this.fullWidth = false;
84
+ /**
85
+ * The helper text that will be displayed for additional field guidance.
86
+ */
87
+ this.helperText = "";
88
+ /**
89
+ * If `true`, the label will be hidden and the required label value will be applied as an aria-label.
90
+ */
91
+ this.hideLabel = false;
92
+ /**
93
+ * If `true`, descriptions of options will be included when filtering options in a searchable select. Only applies to built in filtering.
94
+ */
95
+ this.includeDescriptionsInSearch = false;
96
+ /**
97
+ * If `true`, group titles of grouped options will be included when filtering options in a searchable select. Only applies to built in filtering.
98
+ */
99
+ this.includeGroupTitlesInSearch = false;
100
+ /**
101
+ * The message displayed when external loading times out.
102
+ */
103
+ this.loadingErrorLabel = "Loading Error";
104
+ /**
105
+ * The message displayed whilst the options are being loaded externally.
106
+ */
107
+ this.loadingLabel = "Loading...";
108
+ /**
109
+ * If `true`, multiple options can be selected.
110
+ */
111
+ this.multiple = false;
112
+ /**
113
+ * The name of the control, which is submitted with the form data.
114
+ */
115
+ this.name = this.inputId;
116
+ /**
117
+ * The placeholder value to be displayed.
118
+ */
119
+ this.placeholder = "Select an option";
120
+ /**
121
+ * If `true`, the readonly state will be set.
122
+ */
123
+ this.readonly = false;
124
+ /**
125
+ * If `true`, the select will require a value.
126
+ */
127
+ this.required = false;
128
+ /**
129
+ * If `true`, a searchable variant of the select will be displayed which can be typed in to filter options. This functionality is only available on the single-select variant of the select component.
130
+ */
131
+ this.searchable = false;
132
+ /**
133
+ * Whether the search string of the searchable select should match the start of or anywhere in the options. Only applies to built in filtering.
134
+ */
135
+ this.searchMatchPosition = "anywhere";
136
+ /**
137
+ * If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown on the single select.
138
+ */
139
+ this.selectOnEnter = false;
140
+ /**
141
+ * If `true`, a button which clears the select input when clicked will be displayed. The button will always appear on the searchable select.
142
+ */
143
+ this.showClearButton = false;
144
+ /**
145
+ * The size of the select.
146
+ */
147
+ this.size = "medium";
148
+ /**
149
+ * Sets the theme color to the dark or light theme color. "inherit" will set the color based on the system settings or ic-theme component.
150
+ */
151
+ this.theme = "inherit";
152
+ /**
153
+ * The value of the `aria-live` attribute on the validation message.
154
+ */
155
+ this.validationAriaLive = "polite";
156
+ /**
157
+ * The validation status - e.g. 'error' | 'warning' | 'success'.
158
+ */
159
+ this.validationStatus = "";
160
+ /**
161
+ * The text to display as the validation message.
162
+ */
163
+ this.validationText = "";
164
+ /**
165
+ * 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.
166
+ */
167
+ this.useNativeSelectOnMobile = true;
168
+ /**
169
+ * If `true`, the loading state will be triggered when fetching options asynchronously.
170
+ */
171
+ this.loading = false;
172
+ /**
173
+ * The possible selection options.
174
+ */
175
+ this.options = [];
176
+ this.flatOptions = [];
177
+ /**
178
+ * The amount of time, in milliseconds, to wait to trigger the `icInput` event after each keystroke.
179
+ */
180
+ this.debounce = 0;
181
+ this.currDebounce = this.debounce;
182
+ /**
183
+ * The value of the select, reflected by the value of the currently selected option.
184
+ * For the searchable variant, the value is also reflected by the user input.
185
+ * For the multi-select variant, the value must be an array of option values.
186
+ */
187
+ this.value = null;
188
+ this.initialValue = this.value;
189
+ this.open = false;
190
+ this.getValidatedValue = (value) => {
191
+ const validValues = this.flatOptions.map((opt) => opt.value);
192
+ if (validValues.length === 0)
193
+ return value;
194
+ if (this.multiple) {
195
+ if (!value)
196
+ return null;
197
+ const arr = Array.isArray(value) ? value : [value]; // Ensure value is an array
198
+ const filtered = validValues.filter((v) => arr.includes(v)); // Keep only valid values
199
+ return filtered.length > 0 ? filtered : null;
200
+ }
201
+ else {
202
+ return validValues.includes(value) ? value : null;
203
+ }
204
+ };
205
+ this.getFilteredOptions = (searchString, searchMatchPosition, includeDescriptionsInSearch, includeGroupTitlesInSearch) => {
206
+ const search = searchString.toLowerCase();
207
+ const match = (text, method) => method === "anywhere" ? text.includes(search) : text.startsWith(search);
208
+ return this.unflattenOptions(this.flatOptions.filter((option) => {
209
+ var _a, _b, _c, _d;
210
+ const label = option.label.toLowerCase();
211
+ const group = (_b = (_a = option.group) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : "";
212
+ const description = (_d = (_c = option.description) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : "";
213
+ return (match(label, searchMatchPosition) ||
214
+ (includeDescriptionsInSearch &&
215
+ match(description, searchMatchPosition)) ||
216
+ (includeGroupTitlesInSearch && match(group, searchMatchPosition)));
217
+ }));
218
+ };
219
+ this.getOptions = () => {
220
+ const options = this.searchable &&
221
+ !this.disableAutoFiltering &&
222
+ this.searchableSelectInputValue
223
+ ? this.getFilteredOptions(this.searchableSelectInputValue, this.searchMatchPosition, this.includeDescriptionsInSearch, this.includeGroupTitlesInSearch)
224
+ : this.unflattenOptions(this.flatOptions);
225
+ if (this.hasTimedOut)
226
+ return [{ label: this.loadingErrorLabel, value: "", timedOut: true }];
227
+ if (this.loading)
228
+ return [{ label: this.loadingLabel, value: "", loading: true }];
229
+ if (options.length > 0)
230
+ return options;
231
+ return [{ label: this.emptyOptionListText, value: "" }];
232
+ };
233
+ this.getFlatOptions = (options) => options.flatMap((item) => ("children" in item && item.children
234
+ ? [...item.children.map((child) => (Object.assign({ group: item.label }, child)))]
235
+ : [item]));
236
+ this.unflattenOptions = (flatOptions) => {
237
+ const groupMap = new Map();
238
+ const result = [];
239
+ for (const option of flatOptions) {
240
+ if (option.group) {
241
+ let group = groupMap.get(option.group);
242
+ if (!group) {
243
+ group = { label: option.group, children: [] };
244
+ groupMap.set(option.group, group);
245
+ result.push(group);
246
+ }
247
+ const rest = __rest(option, ["group"]);
248
+ group.children.push(rest);
249
+ }
250
+ else {
251
+ result.push(option);
252
+ }
253
+ }
254
+ return result;
255
+ };
256
+ 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 : ""; };
257
+ // Construct the string that will be shown in the select input or button
258
+ this.getLabelString = () => {
259
+ if (Array.isArray(this.value)) {
260
+ return this.value.map(this.getLabelFromValue).filter(Boolean).join(", ");
261
+ }
262
+ return (this.getLabelFromValue(this.value) ||
263
+ (this.searchable ? "" : this.placeholder));
264
+ };
265
+ this.handleClick = (event) => {
266
+ var _a;
267
+ if (event.detail !== 0) {
268
+ (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleClickOpen();
269
+ }
270
+ };
271
+ this.handleExpandIconMouseDown = (event) => {
272
+ var _a;
273
+ if (!this.disabled) {
274
+ event.preventDefault();
275
+ (_a = this.searchableSelectElement) === null || _a === void 0 ? void 0 : _a.focus();
276
+ this.handleClick(event);
277
+ }
278
+ };
279
+ this.handleBlur = ({ relatedTarget }) => {
280
+ var _a, _b;
281
+ const target = relatedTarget;
282
+ if (this.el.contains(target) ||
283
+ ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.contains(target)) ||
284
+ ((_b = this.menu) === null || _b === void 0 ? void 0 : _b.contains(target)) ||
285
+ target === this.clearButton) {
286
+ return;
287
+ }
288
+ this.open = false;
289
+ this.handleFocusIndicatorDisplay();
290
+ if (this.searchable) {
291
+ this.searchableSelectInputValue = "";
292
+ }
293
+ this.icBlur.emit();
294
+ };
295
+ this.handleTimeoutBlur = (event) => {
296
+ this.handleBlur(event.detail.ev);
297
+ };
298
+ this.handleFocus = () => {
299
+ this.icFocus.emit();
300
+ };
301
+ this.handleClear = () => {
302
+ this.clearTimer();
303
+ this.loading = false;
304
+ this.value = null;
305
+ this.searchableSelectInputValue = "";
306
+ this.icClear.emit();
307
+ this.setFocus();
308
+ };
309
+ this.setTextColor = () => {
310
+ if (this.nativeSelectElement) {
311
+ this.nativeSelectElement.className =
312
+ this.nativeSelectElement.selectedIndex === 0
313
+ ? "placeholder"
314
+ : "select-option-selected";
315
+ }
316
+ };
317
+ this.handleNativeSelectChange = () => {
318
+ if (this.nativeSelectElement) {
319
+ this.icOptionSelect.emit({ value: this.nativeSelectElement.value });
320
+ this.icChange.emit({ value: this.nativeSelectElement.value });
321
+ }
322
+ this.setTextColor();
323
+ };
324
+ this.handleFocusIndicatorDisplay = () => {
325
+ var _a;
326
+ const focusIndicator = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".focus-indicator");
327
+ if (focusIndicator) {
328
+ if (this.open) {
329
+ focusIndicator.classList.add("focus-indicator-enabled");
330
+ }
331
+ else {
332
+ focusIndicator.classList.remove("focus-indicator-enabled");
333
+ }
334
+ }
335
+ };
336
+ this.handleKeyDown = (event) => {
337
+ var _a, _b;
338
+ if (!(event.key === " " && this.pressedCharacters.length > 0)) {
339
+ if (this.open) {
340
+ (_a = this.menu) === null || _a === void 0 ? void 0 : _a.handleMenuKeyDown(event);
341
+ }
342
+ else {
343
+ (_b = this.menu) === null || _b === void 0 ? void 0 : _b.handleKeyboardOpen(event);
344
+ }
345
+ }
346
+ if (!this.multiple &&
347
+ !this.searchable &&
348
+ !this.selectOnEnter &&
349
+ /^[a-zA-Z0-9 ]$/.test(event.key)) {
350
+ this.handleCharacterKeyDown(event.key);
351
+ }
352
+ };
353
+ this.handleCharacterKeyDown = (key) => {
354
+ // Only close menu when space is pressed if not being used alongside character keys to quickly select options
355
+ if (this.open && key === " " && this.pressedCharacters.length === 0) {
356
+ this.open = false;
357
+ }
358
+ if (key.length !== 1 || this.searchable) {
359
+ this.pressedCharacters = "";
360
+ return;
361
+ }
362
+ window.clearTimeout(this.characterKeyPressTimer);
363
+ this.characterKeyPressTimer = window.setTimeout(() => (this.pressedCharacters = ""), 1000);
364
+ if (key !== " " || !!this.pressedCharacters) {
365
+ this.pressedCharacters += key;
366
+ const filteredOptions = this.getFilteredOptions(this.pressedCharacters, "start", false, false);
367
+ if (filteredOptions.length > 0) {
368
+ const firstOption = filteredOptions[0];
369
+ if ("children" in firstOption) {
370
+ if (firstOption.children && !firstOption.children[0].disabled) {
371
+ this.value = firstOption.children[0].value;
372
+ }
373
+ }
374
+ else if (!("disabled" in firstOption) || !firstOption.disabled) {
375
+ this.value = firstOption.value;
376
+ }
377
+ }
378
+ }
379
+ };
380
+ this.handleNativeSelectKeyDown = (event) => {
381
+ this.handleKeyDown(event);
382
+ };
383
+ this.handleSelectChange = (event) => {
384
+ const { value } = event.detail;
385
+ if (!value || this.getLabelFromValue(value) === this.emptyOptionListText) {
386
+ this.value = null;
387
+ return;
388
+ }
389
+ if (this.multiple) {
390
+ let valueArray = Array.isArray(this.value) ? [...this.value] : [];
391
+ const index = valueArray.indexOf(value);
392
+ if (index > -1) {
393
+ valueArray.splice(index, 1);
394
+ this.icOptionDeselect.emit({ value });
395
+ }
396
+ else {
397
+ this.icOptionSelect.emit({ value });
398
+ valueArray.push(value);
399
+ valueArray = this.getValidatedValue(valueArray);
400
+ }
401
+ this.value = valueArray.length ? valueArray : null;
402
+ }
403
+ else {
404
+ this.icOptionSelect.emit({ value });
405
+ this.value = value;
406
+ if (this.searchable)
407
+ this.searchableSelectInputValue = "";
408
+ }
409
+ };
410
+ this.handleSelectAllChange = ({ detail, }) => {
411
+ const allSelectableValues = this.flatOptions
412
+ .filter((option) => !option.disabled)
413
+ .map((option) => option.value);
414
+ if (detail.select) {
415
+ allSelectableValues
416
+ .filter((value) => { var _a; return !((_a = this.value) !== null && _a !== void 0 ? _a : []).includes(value); })
417
+ .forEach((value) => {
418
+ this.icOptionSelect.emit({ value });
419
+ });
420
+ this.value = allSelectableValues;
421
+ }
422
+ else {
423
+ this.value.forEach((value) => this.icOptionDeselect.emit({ value }));
424
+ this.value = null;
425
+ }
426
+ };
427
+ this.handleFormReset = () => {
428
+ this.value = this.initialValue;
429
+ this.searchableSelectInputValue = "";
430
+ if (this.searchable) {
431
+ this.hiddenInputValue = this.initialValue;
432
+ }
433
+ };
434
+ this.handleRetry = () => {
435
+ this.clearTimer();
436
+ this.hasTimedOut = false;
437
+ this.hasError = false;
438
+ this.loading = true;
439
+ this.icRetryLoad.emit({
440
+ value: this.searchable
441
+ ? this.searchableSelectInputValue
442
+ : this.hiddenInputValue,
443
+ });
444
+ this.setFocus();
445
+ };
446
+ this.handleSearchableSelectInput = (event) => {
447
+ var _a;
448
+ this.updateSearchableSelectResultAriaLive();
449
+ if (!this.multiple) {
450
+ this.value = null;
451
+ }
452
+ this.searchableSelectInputValue =
453
+ (_a = event.target.value) !== null && _a !== void 0 ? _a : "";
454
+ this.open = true;
455
+ clearTimeout(this.debounceIcInput);
456
+ this.debounceIcInput = window.setTimeout(() => this.icInput.emit({ value: this.searchableSelectInputValue }), this.currDebounce);
457
+ };
458
+ this.hostMutationCallback = (mutationList) => {
459
+ let forceComponentUpdate = false;
460
+ mutationList.forEach(({ attributeName, type, addedNodes, removedNodes }) => {
461
+ if (attributeName) {
462
+ const attribute = this.el.getAttribute(attributeName);
463
+ if (attribute && MUTABLE_ATTRIBUTES.includes(attributeName)) {
464
+ this.inheritedAttributes[attributeName] = attribute;
465
+ forceComponentUpdate = true;
466
+ }
467
+ }
468
+ else if (type === "childList") {
469
+ forceComponentUpdate = checkSlotInChildMutations(addedNodes, removedNodes, "icon");
470
+ }
471
+ });
472
+ if (forceComponentUpdate) {
473
+ forceUpdate(this);
474
+ }
475
+ };
476
+ this.updateSelectButtonAriaLive = () => {
477
+ const value_label = this.getLabelFromValue(this.value);
478
+ this.selectButtonAriaLiveText = this.multiple
479
+ ? `${this.value ? this.value.length : 0} of ${this.flatOptions.length} selected`
480
+ : this.value
481
+ ? value_label !== null && value_label !== void 0 ? value_label : `${value_label} selected`
482
+ : "";
483
+ };
484
+ this.updateSearchableSelectResultAriaLive = () => {
485
+ var _a, _b;
486
+ this.selectInputAriaLiveText =
487
+ ((_b = (_a = this.getOptions()) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.label) == this.emptyOptionListText
488
+ ? this.emptyOptionListText
489
+ : "";
490
+ };
491
+ this.updateAriaActiveDescendant = (event) => {
492
+ this.ariaActiveDescendant = event.detail.optionId;
493
+ };
494
+ this.handleMenuChange = (event) => {
495
+ this.open = event.detail.open;
496
+ this.pressedCharacters = "";
497
+ };
498
+ this.getDeduplicatedOptions = (flatOptions) => {
499
+ const seen = new Set();
500
+ return flatOptions.filter((option) => {
501
+ if (option.value && seen.has(option.value)) {
502
+ console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${option.value}) which has been removed.`);
503
+ return false;
504
+ }
505
+ if (option.value)
506
+ seen.add(option.value);
507
+ return true;
508
+ });
509
+ };
510
+ this.renderNativeOption = (option) => (h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label));
511
+ }
512
+ watchDisabledHandler() {
513
+ removeDisabledFalse(this.disabled, this.el);
514
+ }
515
+ loadingHandler(newValue) {
516
+ this.hasTimedOut = false;
517
+ if (newValue) {
518
+ this.hasError = false;
519
+ if (this.timeout) {
520
+ if (this.timeoutTimer) {
521
+ this.clearTimer();
522
+ }
523
+ this.timeoutTimer = window.setTimeout(() => {
524
+ this.loading = false;
525
+ this.hasTimedOut = true;
526
+ forceUpdate(this);
527
+ }, this.timeout);
528
+ }
529
+ }
530
+ else {
531
+ if (this.timeoutTimer) {
532
+ this.clearTimer();
533
+ }
534
+ }
535
+ }
536
+ clearTimer() {
537
+ if (this.timeoutTimer) {
538
+ clearTimeout(this.timeoutTimer);
539
+ this.timeoutTimer = null;
540
+ }
541
+ }
542
+ optionsChangedHandler() {
543
+ const flat = this.getFlatOptions(this.options)
544
+ .filter((option) => option.value != null || option.label != null) // filter out options missing both value and label
545
+ .map((option) => {
546
+ var _a, _b;
547
+ 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 }));
548
+ });
549
+ this.flatOptions = this.getDeduplicatedOptions(flat);
550
+ if (!this.initialRender)
551
+ this.loading = false;
552
+ this.clearTimer();
553
+ this.updateSelectButtonAriaLive();
554
+ }
555
+ debounceChangedHandler(newValue) {
556
+ if (this.currDebounce !== newValue) {
557
+ this.currDebounce = newValue;
558
+ }
559
+ }
560
+ valueChangedHandler(newValue) {
561
+ const validated = this.getValidatedValue(newValue);
562
+ const isEqual = Array.isArray(validated) && Array.isArray(this.value)
563
+ ? validated.length === this.value.length &&
564
+ validated.every((v, i) => v === this.value[i])
565
+ : validated === this.value;
566
+ if (!isEqual) {
567
+ this.value = validated;
568
+ return;
569
+ }
570
+ this.updateSelectButtonAriaLive();
571
+ this.icChange.emit({ value: this.value });
572
+ }
573
+ openChangedHandler() {
574
+ this.open ? this.icOpen.emit() : this.icClose.emit();
575
+ if (!this.open) {
576
+ this.ariaActiveDescendant = undefined;
577
+ }
578
+ this.handleFocusIndicatorDisplay();
579
+ }
580
+ /**
581
+ * Sets focus on the select component.
582
+ */
583
+ async setFocus() {
584
+ if (this.nativeSelectElement) {
585
+ this.nativeSelectElement.focus();
586
+ }
587
+ else if (this.selectElement) {
588
+ this.selectElement.focus();
589
+ }
590
+ else if (this.searchableSelectElement) {
591
+ this.searchableSelectElement.focus();
592
+ }
593
+ }
594
+ componentDidRender() {
595
+ if (this.nativeSelectElement && !this.disabled) {
596
+ this.setTextColor();
597
+ }
598
+ this.initialRender = false;
599
+ }
600
+ disconnectedCallback() {
601
+ var _a;
602
+ removeFormResetListener(this.el, this.handleFormReset);
603
+ (_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
604
+ this.clearTimer();
605
+ }
606
+ componentDidLoad() {
607
+ forceUpdate(this);
608
+ this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
609
+ this.hostMutationObserver.observe(this.el, {
610
+ attributes: true,
611
+ childList: true,
612
+ });
613
+ }
614
+ componentWillLoad() {
615
+ this.optionsChangedHandler();
616
+ this.value = this.getValidatedValue(this.value);
617
+ this.initialValue = this.value;
618
+ if (this.loading)
619
+ this.loadingHandler(true);
620
+ addFormResetListener(this.el, this.handleFormReset);
621
+ }
622
+ render() {
623
+ 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;
624
+ const hasValue = !!value;
625
+ const hasInput = !!searchableSelectInputValue;
626
+ const isClearable = !disabled &&
627
+ ((searchable && (hasInput || hasValue)) ||
628
+ (!searchable && hasValue && !loading && showClearButton));
629
+ const showValidation = !!validationStatus && !disabled;
630
+ const invalid = validationStatus === IcInformationStatus.Error;
631
+ const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", showValidation).trim();
632
+ const menuOptions = this.getOptions();
633
+ const noOptions = disabled ||
634
+ (menuOptions.length === 1 &&
635
+ (menuOptions[0].label === this.emptyOptionListText ||
636
+ "loading" in menuOptions[0] ||
637
+ "timedOut" in menuOptions[0]));
638
+ renderHiddenInput(this.el, value, name || inputId, disabled);
639
+ const ClearButton = () => (h("ic-button", { key: 'ccad95540b222ca1564e200453968c8077adb655', 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" }));
640
+ const NativeSelect = () => (h("select", Object.assign({ key: '1eba8d0971230dd2ce06fcbb67a619d294ceb108', 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: 'd8063316a6856d82168c4cfa1810136b0314656d', value: "", selected: true, disabled: !showClearButton }, placeholder), options.map((option) => "children" in option && option.children ? (h("optgroup", { label: option.label }, option.children.map((child) => this.renderNativeOption(child)))) : (this.renderNativeOption(option)))));
641
+ const SelectButton = () => (h("div", { key: 'a8bf449262637487d8ae452e7c105f44e7ca07c1', class: "select-container" }, h("button", { key: '5eb82bb22aad88df86ec5f7c9b86e3fcf164ca0d', class: "select-input", role: "combobox", ref: (el) => (this.selectElement = el), id: inputId, "aria-label": `${label}, ${(multiple && value
642
+ ? `${value.length} of ${this.flatOptions.length} selected, ${this.getLabelString()}`
643
+ : 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: '8264f4225215a94635061eb53b07a52eecc21628', variant: "body", class: {
644
+ "value-text": true,
645
+ "with-clear-button": !!isClearable,
646
+ placeholder: !value,
647
+ } }, this.getLabelString()), h("div", { key: 'c731e218d0d7c9c22d77c5965880b1fe3e9ff14a', class: "select-input-end" }, isClearable && h("div", { key: 'f4c4d4ec7ca9be93df55b14e3f0a8f4746f2e121', class: "divider" }), h("span", { key: '248e311d560b9a47356bb70fe099327a1e259a8c', class: {
648
+ "expand-icon": true,
649
+ "expand-icon-open": open,
650
+ }, innerHTML: Expand, "aria-hidden": "true" }))), isClearable && h(ClearButton, { key: '76b7a404924c3cb50fbc9eedb632368ccf23fa29' }), h("div", { key: 'b2fe5eaa7336f06d8155562ec7b88ca194c3c25f', "aria-live": "polite", "aria-atomic": "true", class: "aria-live-hidden-text" }, selectButtonAriaLiveText)));
651
+ const SelectInput = () => (h("div", { key: '6f8e044acc9a3bed5f9c1736c98af442c93a4080', class: "searchable-select-container" }, h("input", { key: 'f1b88830e97efae75464871e1fcc210c34688687', class: {
652
+ "value-text": true,
653
+ "select-input": true,
654
+ "with-clear-button": !!searchableSelectInputValue,
655
+ }, 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
656
+ ? ""
657
+ : value
658
+ ? this.getLabelString()
659
+ : 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: '805b65e817893ea35ceef45df316fd6a8420de14', class: "clear-button-container" }, h(ClearButton, { key: '4a4a3be1f63751d0ac92ee8ade48383c422d72df' }), h("div", { key: 'b1810cb26626c0af8d3b88c05b1aef3b93ae3e85', class: "divider" }))), h("span", { key: '2cc1c159480a01ac0028df8ca8d6fbf2c4b4f3cb', onMouseDown: this.handleExpandIconMouseDown, class: {
660
+ "expand-icon": true,
661
+ "expand-icon-open": open,
662
+ }, innerHTML: Expand, "aria-hidden": "true" }), h("div", { key: 'b2cab9164c85d99b1f0f858aa2edba94b9b1bfbc', "aria-live": "polite", role: "status", class: "aria-live-hidden-text" }, selectInputAriaLiveText)));
663
+ const ReadOnly = () => (h("ic-typography", { key: '31d247dbf2ff3cc91e5a42a25c0dd5970c892349' }, h("p", { key: '096b44388a6777f69721d396ecb6954dbb5bd982' }, this.getLabelString() === placeholder ? "" : this.getLabelString())));
664
+ return (h(Host, { key: '9fcaf3f3b71f02bca0bafe89ce2ea48ad044b881', class: {
665
+ "ic-select-disabled": disabled,
666
+ "ic-select-searchable": searchable,
667
+ [`ic-select-${size}`]: size !== "medium",
668
+ "ic-select-full-width": fullWidth,
669
+ [`ic-theme-${theme}`]: theme !== "inherit",
670
+ } }, h("ic-input-container", { key: '7b8b3b791f1314201942a6906bed7fc82de3d16e', readonly: readonly }, !hideLabel && (h("ic-input-label", { key: '193ed16c31d6082cc82a7fe0b7e85794b076313c', for: inputId, label: label, helperText: helperText, required: required, disabled: disabled, readonly: readonly }, h("slot", { key: 'fcbdd1538668341d40b77fea35eb8260ccaaa40f', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: 'b471c6303dba66e3bf55b1dc35c49e56b64c5fce', ref: (el) => (this.anchorEl = el), class: { "menu-open": open }, size: size, fullWidth: fullWidth, disabled: disabled, readonly: readonly, validationStatus: validationStatus }, isSlotUsed(this.el, "icon") &&
671
+ !disabled &&
672
+ (!readonly || !!value) && (h("span", { key: 'aab4faffaa8e5984822a11ecf4786e6d428f2d38', slot: "left-icon", class: {
673
+ readonly,
674
+ "has-value": !!value,
675
+ } }, h("slot", { key: 'a3052ea357290195b322597e739962d6dd2475d2', name: "icon" }))), isMobileOrTablet() && this.useNativeSelectOnMobile && !multiple ? (h(NativeSelect, null)) : readonly ? (h(ReadOnly, null)) : !searchable ? (h(SelectButton, null)) : (h(SelectInput, null))), !(isMobileOrTablet() &&
676
+ this.useNativeSelectOnMobile &&
677
+ !multiple) && (h("ic-menu", { key: '442e9be50328f4f98350ed4941d37885c9fb75f2', 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: '93d96e72668c30c53daf8367a9eed5b975f49c05', class: {
678
+ "menu-open": open,
679
+ }, ariaLiveMode: validationAriaLive, status: showValidation ? validationStatus : "", message: showValidation ? validationText : "", for: inputId }))));
680
+ }
681
+ static get delegatesFocus() { return true; }
682
+ get el() { return this; }
683
+ static get watchers() { return {
684
+ "disabled": ["watchDisabledHandler"],
685
+ "loading": ["loadingHandler"],
686
+ "options": ["optionsChangedHandler"],
687
+ "debounce": ["debounceChangedHandler"],
688
+ "value": ["valueChangedHandler"],
689
+ "open": ["openChangedHandler"]
690
+ }; }
691
+ static get style() { return IcSelectStyle0; }
692
+ }, [17, "ic-select", {
693
+ "disabled": [516],
694
+ "disableAutoFiltering": [4, "disable-auto-filtering"],
695
+ "emptyOptionListText": [1, "empty-option-list-text"],
696
+ "form": [1],
697
+ "fullWidth": [4, "full-width"],
698
+ "helperText": [1, "helper-text"],
699
+ "hideLabel": [4, "hide-label"],
700
+ "includeDescriptionsInSearch": [4, "include-descriptions-in-search"],
701
+ "includeGroupTitlesInSearch": [4, "include-group-titles-in-search"],
702
+ "label": [1],
703
+ "loadingErrorLabel": [1, "loading-error-label"],
704
+ "loadingLabel": [1, "loading-label"],
705
+ "multiple": [4],
706
+ "name": [1],
707
+ "placeholder": [1],
708
+ "readonly": [4],
709
+ "required": [4],
710
+ "searchable": [4],
711
+ "searchMatchPosition": [1, "search-match-position"],
712
+ "selectOnEnter": [4, "select-on-enter"],
713
+ "showClearButton": [4, "show-clear-button"],
714
+ "size": [1],
715
+ "timeout": [2],
716
+ "theme": [1],
717
+ "validationAriaLive": [1, "validation-aria-live"],
718
+ "validationStatus": [1, "validation-status"],
719
+ "validationText": [1, "validation-text"],
720
+ "useNativeSelectOnMobile": [4, "use-native-select-on-mobile"],
721
+ "loading": [1028],
722
+ "options": [16],
723
+ "debounce": [2],
724
+ "value": [1025],
725
+ "ariaActiveDescendant": [32],
726
+ "debounceIcInput": [32],
727
+ "hiddenInputValue": [32],
728
+ "hasError": [32],
729
+ "searchableSelectInputValue": [32],
730
+ "selectButtonAriaLiveText": [32],
731
+ "selectInputAriaLiveText": [32],
732
+ "flatOptions": [32],
733
+ "currDebounce": [32],
734
+ "initialValue": [32],
735
+ "open": [32],
736
+ "setFocus": [64]
737
+ }, undefined, {
738
+ "disabled": ["watchDisabledHandler"],
739
+ "loading": ["loadingHandler"],
740
+ "options": ["optionsChangedHandler"],
741
+ "debounce": ["debounceChangedHandler"],
742
+ "value": ["valueChangedHandler"],
743
+ "open": ["openChangedHandler"]
744
+ }]);
745
+ function defineCustomElement() {
746
+ if (typeof customElements === "undefined") {
747
+ return;
748
+ }
749
+ const components = ["ic-select", "ic-button", "ic-input-component-container", "ic-input-container", "ic-input-label", "ic-input-validation", "ic-loading-indicator", "ic-menu", "ic-tooltip", "ic-typography"];
750
+ components.forEach(tagName => { switch (tagName) {
751
+ case "ic-select":
752
+ if (!customElements.get(tagName)) {
753
+ customElements.define(tagName, Select);
754
+ }
755
+ break;
756
+ case "ic-button":
757
+ if (!customElements.get(tagName)) {
758
+ defineCustomElement$9();
759
+ }
760
+ break;
761
+ case "ic-input-component-container":
762
+ if (!customElements.get(tagName)) {
763
+ defineCustomElement$8();
764
+ }
765
+ break;
766
+ case "ic-input-container":
767
+ if (!customElements.get(tagName)) {
768
+ defineCustomElement$7();
769
+ }
770
+ break;
771
+ case "ic-input-label":
772
+ if (!customElements.get(tagName)) {
773
+ defineCustomElement$6();
774
+ }
775
+ break;
776
+ case "ic-input-validation":
777
+ if (!customElements.get(tagName)) {
778
+ defineCustomElement$5();
779
+ }
780
+ break;
781
+ case "ic-loading-indicator":
782
+ if (!customElements.get(tagName)) {
783
+ defineCustomElement$4();
784
+ }
785
+ break;
786
+ case "ic-menu":
787
+ if (!customElements.get(tagName)) {
788
+ defineCustomElement$3();
789
+ }
790
+ break;
791
+ case "ic-tooltip":
792
+ if (!customElements.get(tagName)) {
793
+ defineCustomElement$2();
794
+ }
795
+ break;
796
+ case "ic-typography":
797
+ if (!customElements.get(tagName)) {
798
+ defineCustomElement$1();
799
+ }
800
+ break;
801
+ } });
802
+ }
803
+
804
+ export { Select as S, defineCustomElement as d };
805
+
806
+ //# sourceMappingURL=ic-select2.js.map