@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,719 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { V as getFilteredMenuOptions, W as getLabelFromValue, h as handleHiddenFormButtonClick, r as removeDisabledFalse, U as debounceEvent, o as onComponentRequiredPropUndefined, w as getInputDescribedByText, u as renderHiddenInput } from './helpers.js';
3
+ import { d as defineCustomElement$9 } from './ic-button2.js';
4
+ import { d as defineCustomElement$8 } from './ic-input-component-container2.js';
5
+ import { d as defineCustomElement$7 } from './ic-input-container2.js';
6
+ import { d as defineCustomElement$6 } from './ic-input-label2.js';
7
+ import { d as defineCustomElement$5 } from './ic-loading-indicator2.js';
8
+ import { d as defineCustomElement$4 } from './ic-menu2.js';
9
+ import { d as defineCustomElement$3 } from './ic-tooltip2.js';
10
+ import { d as defineCustomElement$2 } from './ic-typography2.js';
11
+
12
+ const clearIcon = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
13
+ <path d="M15.8327 5.34199L14.6577 4.16699L9.99935 8.82533L5.34102 4.16699L4.16602 5.34199L8.82435 10.0003L4.16602 14.6587L5.34102 15.8337L9.99935 11.1753L14.6577 15.8337L15.8327 14.6587L11.1743 10.0003L15.8327 5.34199Z" fill="currentColor"/>
14
+ </svg>
15
+ `;
16
+
17
+ const searchIcon = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
18
+ <path d="M13.1292 11.8792H12.4708L12.2375 11.6542C13.0542 10.7042 13.5458 9.47083 13.5458 8.12916C13.5458 5.13749 11.1208 2.71249 8.12916 2.71249C5.13749 2.71249 2.71249 5.13749 2.71249 8.12916C2.71249 11.1208 5.13749 13.5458 8.12916 13.5458C9.47083 13.5458 10.7042 13.0542 11.6542 12.2375L11.8792 12.4708V13.1292L16.0458 17.2875L17.2875 16.0458L13.1292 11.8792ZM8.12916 11.8792C6.05416 11.8792 4.37916 10.2042 4.37916 8.12916C4.37916 6.05416 6.05416 4.37916 8.12916 4.37916C10.2042 4.37916 11.8792 6.05416 11.8792 8.12916C11.8792 10.2042 10.2042 11.8792 8.12916 11.8792Z" fill="currentColor"/>
19
+ </svg>`;
20
+
21
+ const icSearchBarCss = "/*! 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(.ic-search-bar-search){display:block;--divider-height:1.5rem;--ic-input-label-helpertext-padding:var(--ic-space-xs);--border-color:var(--ic-search-bar-outline);--input-bg-color:var(--ic-search-bar-background);--border-color-disabled:var(--ic-search-bar-outline-disabled);--menu-item-text-color:var(--ic-search-bar-dropdown-option-text);--menu-item-desc-text-color:var(--ic-search-bar-dropdown-option-description);--menu-bg-color:var(--ic-search-bar-dropdown-background);--menu-border-color:var(--ic-search-bar-dropdown-outline)}:host(.ic-search-bar-disabled){--ic-input-label-text-color:var(--ic-search-bar-label-disabled);--ic-input-label-helper-text-color:var(--ic-search-bar-subtitle-disabled)}:host(.ic-search-bar-search:hover){--border-color:var(--ic-search-bar-outline-hover)}:host(.ic-search-bar-search:active){--border-color:var(--ic-search-bar-outline-pressed)}:host(.ic-search-bar-search.ic-search-bar-small){--divider-height:1rem}:host(.ic-search-bar-full-width){width:100%}::-moz-placeholder{color:var(--ic-search-bar-placeholder-text);opacity:1}::placeholder{color:var(--ic-search-bar-placeholder-text);opacity:1}input{border:0;border-radius:var(--ic-border-radius);color:var(--ic-search-bar-filled-text);background-color:var(--input-bg-color);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs);caret-color:var(--ic-search-bar-filled-text-cursor)}input:focus{border:0;outline:0}input:disabled::-moz-placeholder{color:var(--ic-search-bar-disabled-text)}input:disabled,input:disabled::placeholder{color:var(--ic-search-bar-disabled-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.no-left-pad{padding-left:0}input[type=\"search\"]::-webkit-search-cancel-button,input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-results-button,input[type=\"search\"]::-webkit-search-results-decoration{display:none}input[type=\"search\"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.clear-button-container{align-items:center;margin-right:var(--ic-space-1px);display:none;visibility:hidden}.clear-button{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-unfocused *{fill:var(--ic-search-bar-clear-button)}.clear-button:focus,.clear-button:active *{fill:var(--ic-atoms-input-clear-button-focus)}.clear-button-visible{visibility:visible;display:flex}.search-submit-button-container{display:flex;align-items:center}.search-submit-button-unfocused *{fill:var(--ic-search-bar-filled-icon)}.search-submit-button-disabled *{fill:var(--ic-search-bar-icon-disabled)}.search-submit-button-disabled .ic-tooltip-container{display:none !important}.search-submit-button:focus,.search-submit-button:active{background-color:var(--ic-color-focus-inner) !important;box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;border-radius:var(--ic-space-xxs)}.search-submit-button:focus,.search-submit-button:active *{fill:white}.divider{width:var(--ic-border-width);background-color:var(--ic-search-bar-dropdown-divider);height:var(--divider-height)}.menu-container{width:var(--input-width, 20rem);position:relative;top:var(--ic-space-xxxs)}.menu-container.fullwidth{width:100%}.no-results{cursor:not-allowed}.search-results-status{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);margin-bottom:calc(-1 * var(--ic-space-1px));margin-right:calc(-1 * var(--ic-space-1px));overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}@media (forced-colors: active){.search-submit-button-unfocused *{fill:canvastext}.search-submit-button-disabled *{fill:GrayText}}@media screen AND (max-width: 22rem){.menu-container{max-width:var(--menu-width, var(--input-width, 20rem));width:100%}}@media (prefers-reduced-motion: reduce){.clear-button{transition:none}}";
22
+ const IcSearchBarStyle0 = icSearchBarCss;
23
+
24
+ let inputIds = 0;
25
+ const SearchBar = /*@__PURE__*/ proxyCustomElement(class SearchBar extends HTMLElement {
26
+ constructor() {
27
+ super();
28
+ this.__registerHost();
29
+ this.__attachShadow();
30
+ this.icChange = createEvent(this, "icChange", 7);
31
+ this.icClear = createEvent(this, "icClear", 7);
32
+ this.icInput = createEvent(this, "icInput", 7);
33
+ this.icOptionSelect = createEvent(this, "icOptionSelect", 7);
34
+ this.icMenuChange = createEvent(this, "icMenuChange", 7);
35
+ this.icClearBlur = createEvent(this, "icClearBlur", 7);
36
+ this.icRetryLoad = createEvent(this, "icRetryLoad", 7);
37
+ this.icSubmitSearch = createEvent(this, "icSubmitSearch", 7);
38
+ this.icSubmitSearchBlur = createEvent(this, "icSubmitSearchBlur", 7);
39
+ this.icSearchBarBlur = createEvent(this, "icSearchBarBlur", 7);
40
+ this.icSearchBarFocus = createEvent(this, "icSearchBarFocus", 7);
41
+ this.icKeydown = createEvent(this, "icKeydown", 7);
42
+ this.hasTimedOut = false;
43
+ this.inputId = `ic-search-bar-input-${inputIds++}`;
44
+ this.menuCloseFromMenuChangeEvent = false;
45
+ this.menuId = `${this.inputId}-menu`;
46
+ this.preLoad = true;
47
+ this.preventSubmit = false;
48
+ this.prevNoOption = false;
49
+ this.retryButtonClick = false;
50
+ this.retryViaKeyPress = false;
51
+ this.truncateValue = false;
52
+ this.clearButtonFocused = false;
53
+ this.open = false;
54
+ this.searchSubmitFocused = false;
55
+ this.showClearButton = false;
56
+ /**
57
+ * The automatic capitalisation of the text value as it is entered/edited by the user.
58
+ * Available options: "off", "none", "on", "sentences", "words", "characters".
59
+ */
60
+ this.autocapitalize = "off";
61
+ /**
62
+ * The state of autocompletion the browser can apply on the text value.
63
+ */
64
+ this.autocomplete = "off";
65
+ /**
66
+ * The state of autocorrection the browser can apply when the user is entering/editing the text value.
67
+ */
68
+ this.autocorrect = "off";
69
+ /**
70
+ * If `true`, the form control will have input focus when the page loads.
71
+ */
72
+ this.autofocus = false;
73
+ /**
74
+ * The number of characters until suggestions appear. The submit button will be disabled until the inputted value is equal to or greater than this number.
75
+ */
76
+ this.charactersUntilSuggestion = 2;
77
+ /**
78
+ * If `true`, the disabled state will be set.
79
+ */
80
+ this.disabled = false;
81
+ /**
82
+ * Specify whether to disable the built in filtering. For example, if options will already be filtered from external source.
83
+ * If `true`, all options provided will be displayed.
84
+ */
85
+ this.disableAutoFiltering = false;
86
+ /**
87
+ * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.
88
+ */
89
+ this.debounce = 0;
90
+ /**
91
+ * The text displayed when there are no options in the option list.
92
+ */
93
+ this.emptyOptionListText = "No results found";
94
+ /**
95
+ * If `true`, the search bar will be focused when component loaded.
96
+ */
97
+ this.focusOnLoad = false;
98
+ /**
99
+ * Specify whether the search bar fills the full width of the container.
100
+ * If `true`, this overrides the --input-width CSS variable.
101
+ */
102
+ this.fullWidth = false;
103
+ /**
104
+ * The helper text that will be displayed for additional field guidance.
105
+ */
106
+ this.helperText = "";
107
+ /**
108
+ * If `true`, the label will be hidden and the required label value will be applied as an aria-label.
109
+ */
110
+ this.hideLabel = false;
111
+ /**
112
+ * The hint text for the hidden assistive description element.
113
+ */
114
+ this.assistiveHintText = "When autocomplete results are available use the up and down arrows to choose and press enter to select";
115
+ /**
116
+ * The custom name for the label field to correspond with the IcMenuOption type.
117
+ */
118
+ this.labelField = "label";
119
+ /**
120
+ * Trigger loading state when fetching options asynchronously
121
+ */
122
+ this.loading = false;
123
+ /**
124
+ * Change the message displayed when external loading times out.
125
+ */
126
+ this.loadingErrorLabel = "Loading Error";
127
+ /**
128
+ * Change the message displayed whilst the options are being loaded externally.
129
+ */
130
+ this.loadingLabel = "Loading...";
131
+ /**
132
+ * The name of the control, which is submitted with the form data.
133
+ */
134
+ this.name = this.inputId;
135
+ /**
136
+ * The placeholder value to display.
137
+ */
138
+ this.placeholder = "Search";
139
+ /**
140
+ * If `true` the parent form will not submit when the icSubmitSearch event fires.
141
+ */
142
+ this.preventFormSubmitOnSearch = false;
143
+ /**
144
+ * If `true`, the readonly state will be set.
145
+ */
146
+ this.readonly = false;
147
+ /**
148
+ * If `true`, the search bar will require a value.
149
+ */
150
+ this.required = false;
151
+ /**
152
+ * Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches.
153
+ */
154
+ this.searchMode = "navigation";
155
+ /**
156
+ * The size of the search bar component.
157
+ */
158
+ this.size = "medium";
159
+ /**
160
+ * If `true`, the value of the search will have its spelling and grammar checked.
161
+ */
162
+ this.spellcheck = false;
163
+ /**
164
+ * 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.
165
+ */
166
+ this.theme = "inherit";
167
+ /**
168
+ * The custom name for the value field to correspond with the IcMenuOption type.
169
+ */
170
+ this.valueField = "value";
171
+ this.filteredOptions = [];
172
+ /**
173
+ * The suggested search options.
174
+ */
175
+ this.options = [];
176
+ /**
177
+ * The value of the search input.
178
+ */
179
+ this.value = "";
180
+ this.handleClear = (ev) => {
181
+ var _a;
182
+ const keyboardEvent = ev;
183
+ const mouseEvent = ev;
184
+ if (mouseEvent.type === "click" ||
185
+ keyboardEvent.code === "Enter" ||
186
+ keyboardEvent.code === "Space") {
187
+ this.value = "";
188
+ (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.setAttribute("value", "");
189
+ this.loading = false;
190
+ clearTimeout(this.timeoutTimer);
191
+ this.filteredOptions = this.options;
192
+ this.showMenuWithNoInput() && this.setMenuChange(true);
193
+ this.el.setFocus();
194
+ this.icClear.emit();
195
+ ev.preventDefault();
196
+ this.preventSubmit = true;
197
+ }
198
+ };
199
+ this.onInput = ({ target }) => {
200
+ this.value = target.value;
201
+ this.icInput.emit({ value: this.value });
202
+ if (this.options.length > 0) {
203
+ this.setMenuChange(true);
204
+ this.preLoad = false;
205
+ if (this.disableAutoFiltering === false) {
206
+ const rawFilteredOptions = getFilteredMenuOptions(this.options, this.value, this.labelField);
207
+ this.filteredOptions =
208
+ rawFilteredOptions.length > 0
209
+ ? rawFilteredOptions
210
+ : [
211
+ {
212
+ [this.labelField]: this.emptyOptionListText,
213
+ [this.valueField]: "",
214
+ },
215
+ ];
216
+ }
217
+ }
218
+ if (!this.showClearButton)
219
+ this.showClearButton = true;
220
+ this.debounceAriaLiveUpdate();
221
+ };
222
+ this.onInputBlur = ({ target, relatedTarget }) => {
223
+ this.icSearchBarBlur.emit({
224
+ value: target.value,
225
+ relatedTarget,
226
+ });
227
+ };
228
+ this.onInputFocus = ({ target }) => {
229
+ this.icSearchBarFocus.emit({ value: target.value });
230
+ this.showClearButton = true;
231
+ };
232
+ this.handleClearBlur = ({ relatedTarget }) => {
233
+ this.icClearBlur.emit({ relatedTarget });
234
+ this.clearButtonFocused = false;
235
+ };
236
+ this.handleSubmitSearchBlur = ({ relatedTarget }) => {
237
+ this.icSubmitSearchBlur.emit({ relatedTarget });
238
+ this.searchSubmitFocused = false;
239
+ };
240
+ this.setInputValue = (newValue) => {
241
+ if (this.inputEl) {
242
+ const label = getLabelFromValue(newValue, this.options, this.valueField, this.labelField);
243
+ if (label)
244
+ this.inputEl.value = label;
245
+ else if (this.inputEl.value !== newValue) {
246
+ this.inputEl.value = newValue;
247
+ }
248
+ }
249
+ };
250
+ this.handleMouseDown = (ev) => {
251
+ ev.preventDefault();
252
+ };
253
+ this.handleSubmitSearchFocus = () => {
254
+ this.searchSubmitFocused = true;
255
+ };
256
+ this.handleSubmitSearch = () => {
257
+ if (this.highlightedValue)
258
+ this.value = this.highlightedValue;
259
+ this.highlightedValue = undefined;
260
+ this.icSubmitSearch.emit({ value: this.value });
261
+ const form = this.el.closest("FORM");
262
+ if (this.searchSubmitButton && !!form && !this.preventSubmit) {
263
+ handleHiddenFormButtonClick(form, this.searchSubmitButton);
264
+ }
265
+ };
266
+ this.handleSubmitSearchKeyDown = (ev) => {
267
+ if (ev.key === " ") {
268
+ ev.preventDefault();
269
+ this.handleSubmitSearch();
270
+ }
271
+ };
272
+ this.handleRetry = (ev) => {
273
+ this.retryViaKeyPress = ev.detail.keyPressed === "Enter";
274
+ this.icRetryLoad.emit({ value: ev.detail.value });
275
+ this.triggerLoading();
276
+ this.retryButtonClick = true;
277
+ };
278
+ this.triggerLoading = () => {
279
+ const loadingOption = [
280
+ {
281
+ [this.labelField]: this.loadingLabel,
282
+ [this.valueField]: "",
283
+ loading: true,
284
+ },
285
+ ];
286
+ if (this.filteredOptions !== loadingOption)
287
+ this.filteredOptions = loadingOption;
288
+ if (this.timeout) {
289
+ this.timeoutTimer = window.setTimeout(() => {
290
+ this.filteredOptions = [
291
+ {
292
+ [this.labelField]: this.loadingErrorLabel,
293
+ [this.valueField]: "",
294
+ timedOut: true,
295
+ },
296
+ ];
297
+ }, this.timeout);
298
+ }
299
+ };
300
+ this.handleOptionSelect = (ev) => {
301
+ if (ev.detail.label === this.emptyOptionListText) {
302
+ this.el.setFocus();
303
+ return;
304
+ }
305
+ this.value = ev.detail.value;
306
+ this.icOptionSelect.emit({ value: this.value });
307
+ };
308
+ this.handleMenuOptionHighlight = (ev) => {
309
+ const { optionId } = ev.detail;
310
+ if (optionId)
311
+ this.highlightedValue = optionId.replace(`${this.menuId}-`, "");
312
+ this.ariaActiveDescendant = optionId || "";
313
+ };
314
+ this.handleMenuChange = (ev) => {
315
+ this.setMenuChange(ev.detail.open);
316
+ if (!ev.detail.open) {
317
+ this.menuCloseFromMenuChangeEvent = true;
318
+ }
319
+ };
320
+ this.setMenuChange = (open) => {
321
+ if (this.open !== open) {
322
+ this.open = open;
323
+ this.icMenuChange.emit({ open });
324
+ }
325
+ };
326
+ this.handleHostFocus = () => {
327
+ if (this.options &&
328
+ (this.value || this.showMenuWithNoInput()) &&
329
+ !this.menuCloseFromMenuChangeEvent) {
330
+ this.setMenuChange(true);
331
+ }
332
+ this.truncateValue = false;
333
+ this.showMenuWithNoInput() && this.debounceAriaLiveUpdate();
334
+ this.icSearchBarFocus.emit();
335
+ };
336
+ this.handleHostBlur = ({ relatedTarget }) => {
337
+ var _a;
338
+ if (this.open &&
339
+ this.options &&
340
+ relatedTarget !== this.menu &&
341
+ !this.retryViaKeyPress &&
342
+ !this.retryButtonClick) {
343
+ this.setMenuChange(false);
344
+ }
345
+ if (this.retryButtonClick || this.retryViaKeyPress) {
346
+ (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
347
+ }
348
+ this.showClearButton = false;
349
+ this.menuCloseFromMenuChangeEvent = false;
350
+ this.truncateValue = true;
351
+ this.icSearchBarBlur.emit({
352
+ relatedTarget,
353
+ value: this.value,
354
+ });
355
+ this.retryViaKeyPress = false;
356
+ this.retryButtonClick = false;
357
+ this.showMenuWithNoInput() && this.updateSearchResultAriaLive();
358
+ };
359
+ this.handleFocusClearButton = () => {
360
+ this.clearButtonFocused = true;
361
+ };
362
+ this.renderAssistiveHintEl = () => {
363
+ var _a, _b;
364
+ const input = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`#${this.inputId}`);
365
+ if (input &&
366
+ Object.keys(input).length > 0 &&
367
+ this.hasOptionsOrFilterDisabled()) {
368
+ this.assistiveHintEl = document.createElement("span");
369
+ this.assistiveHintEl.innerText = this.assistiveHintText;
370
+ this.assistiveHintEl.id = `${this.inputId}-assistive-hint`;
371
+ this.assistiveHintEl.style.display = "none";
372
+ (_b = input.after) === null || _b === void 0 ? void 0 : _b.call(input, this.assistiveHintEl);
373
+ }
374
+ };
375
+ this.updateSearchResultAriaLive = () => {
376
+ var _a;
377
+ const searchResultsStatusEl = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".search-results-status");
378
+ if (searchResultsStatusEl) {
379
+ if (!this.open ||
380
+ (this.value === "" && !this.showMenuWithNoInput()) ||
381
+ this.value.length < this.charactersUntilSuggestion) {
382
+ searchResultsStatusEl.innerText = "";
383
+ }
384
+ else if (this.hasOptionsOrFilterDisabled() &&
385
+ this.filteredOptions.length > 0 &&
386
+ this.open &&
387
+ !this.filteredOptions[0].loading) {
388
+ searchResultsStatusEl.innerText = this.hadNoOptions()
389
+ ? this.emptyOptionListText
390
+ : `${this.filteredOptions.length} result${this.filteredOptions.length > 1 ? "s" : ""} available`;
391
+ }
392
+ }
393
+ };
394
+ this.hasOptionsOrFilterDisabled = () => this.options.length > 0 || this.disableAutoFiltering;
395
+ this.hadNoOptions = () => this.filteredOptions.length === 1 &&
396
+ this.filteredOptions[0][this.labelField] === this.emptyOptionListText &&
397
+ this.searchMode === "navigation";
398
+ this.isSubmitDisabled = () => !this.value ||
399
+ this.value.length < this.charactersUntilSuggestion ||
400
+ this.disabled ||
401
+ this.hadNoOptions() ||
402
+ this.hasTimedOut ||
403
+ this.loading;
404
+ this.showMenuWithNoInput = () => this.charactersUntilSuggestion === 0;
405
+ this.updateSearchButtonType = () => {
406
+ this.searchButtonType =
407
+ !!this.el.closest("FORM") &&
408
+ !this.preventFormSubmitOnSearch
409
+ ? "submit"
410
+ : "button";
411
+ };
412
+ }
413
+ watchCharactersUntilSuggestionHandler() {
414
+ if (this.showMenuWithNoInput()) {
415
+ this.filteredOptions = this.options;
416
+ }
417
+ }
418
+ watchDisabledHandler() {
419
+ removeDisabledFalse(this.disabled, this.el);
420
+ }
421
+ debounceChanged() {
422
+ this.icChange = debounceEvent(this.icChange, this.debounce);
423
+ }
424
+ loadingHandler(newValue) {
425
+ if (newValue && !this.hasTimedOut) {
426
+ this.preLoad = false;
427
+ this.triggerLoading();
428
+ }
429
+ }
430
+ preventFormSubmitOnSearchHandler() {
431
+ this.updateSearchButtonType();
432
+ }
433
+ filteredOptionsHandler(newOptions) {
434
+ this.hasTimedOut = newOptions.some((opt) => opt.timedOut);
435
+ }
436
+ watchOptionsHandler(newOptions) {
437
+ if (this.disableAutoFiltering) {
438
+ if (!this.hasTimedOut) {
439
+ this.loading = false;
440
+ clearTimeout(this.timeoutTimer);
441
+ if (newOptions.length > 0) {
442
+ this.filteredOptions = newOptions;
443
+ }
444
+ else {
445
+ if (this.hadNoOptions()) {
446
+ return;
447
+ }
448
+ this.setMenuChange(true);
449
+ if (!this.preLoad) {
450
+ this.filteredOptions = [
451
+ {
452
+ [this.labelField]: this.emptyOptionListText,
453
+ [this.valueField]: "",
454
+ },
455
+ ];
456
+ }
457
+ this.preLoad = true;
458
+ }
459
+ }
460
+ }
461
+ else if (this.showMenuWithNoInput()) {
462
+ this.filteredOptions = newOptions;
463
+ }
464
+ this.debounceAriaLiveUpdate();
465
+ }
466
+ watchValueHandler(newValue) {
467
+ this.setInputValue(newValue);
468
+ this.icChange.emit({ value: newValue });
469
+ }
470
+ connectedCallback() {
471
+ this.debounceChanged();
472
+ }
473
+ disconnectedCallback() {
474
+ var _a;
475
+ (_a = this.assistiveHintEl) === null || _a === void 0 ? void 0 : _a.remove();
476
+ }
477
+ componentWillLoad() {
478
+ this.setInputValue(this.value);
479
+ removeDisabledFalse(this.disabled, this.el);
480
+ this.updateSearchButtonType();
481
+ }
482
+ componentDidLoad() {
483
+ if (this.focusOnLoad) {
484
+ this.el.setFocus();
485
+ }
486
+ if (this.hasOptionsOrFilterDisabled()) {
487
+ this.renderAssistiveHintEl();
488
+ if (this.disableAutoFiltering || this.showMenuWithNoInput()) {
489
+ this.filteredOptions = this.options;
490
+ }
491
+ }
492
+ onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Search Bar");
493
+ }
494
+ componentWillRender() {
495
+ if (this.prevNoOption && this.menu && !this.hasTimedOut) {
496
+ this.menu.handleSetFirstOption();
497
+ this.prevNoOption = false;
498
+ }
499
+ if (this.filteredOptions.find((filteredOption) => filteredOption[this.labelField] === this.emptyOptionListText ||
500
+ filteredOption[this.labelField] === this.loadingErrorLabel ||
501
+ filteredOption[this.labelField] === this.loadingLabel)) {
502
+ this.prevNoOption = true;
503
+ }
504
+ }
505
+ handleKeyDown(event) {
506
+ this.icKeydown.emit({ event });
507
+ if (this.menu && this.open) {
508
+ this.menu.handleKeyboardOpen(event);
509
+ }
510
+ }
511
+ handleKeyUp(ev) {
512
+ if (ev.key === "Enter") {
513
+ if (this.preventSubmit || this.isSubmitDisabled()) {
514
+ return;
515
+ }
516
+ this.handleSubmitSearch();
517
+ this.setMenuChange(false);
518
+ }
519
+ if (ev.key === "Escape") {
520
+ this.setMenuChange(false);
521
+ }
522
+ if (this.preventSubmit) {
523
+ this.preventSubmit = false;
524
+ }
525
+ }
526
+ /**
527
+ * Sets focus on the native `input`.
528
+ */
529
+ async setFocus() {
530
+ var _a;
531
+ this.retryViaKeyPress = false;
532
+ this.retryButtonClick = false;
533
+ (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
534
+ }
535
+ debounceAriaLiveUpdate() {
536
+ clearTimeout(this.debounceAriaLive);
537
+ this.debounceAriaLive = window.setTimeout(() => {
538
+ this.updateSearchResultAriaLive();
539
+ }, 500);
540
+ }
541
+ render() {
542
+ const { inputId, name, label, required, size, placeholder, helperText, disabled, value, readonly, spellcheck, fullWidth, options, open, hideLabel, menuId, ariaActiveDescendant, truncateValue, autofocus, autocapitalize, autocomplete, filteredOptions, theme, charactersUntilSuggestion, labelField, valueField, loadingLabel, loadingErrorLabel, searchMode, showClearButton, searchSubmitFocused, clearButtonFocused, searchButtonType, } = this;
543
+ const disabledMode = readonly || disabled;
544
+ const describedBy = getInputDescribedByText(this.el, inputId, helperText !== "", false).trim();
545
+ let describedById = undefined;
546
+ if (describedBy !== "" && this.hasOptionsOrFilterDisabled()) {
547
+ describedById = `${describedBy} ${inputId}-assistive-hint`;
548
+ }
549
+ else if (this.hasOptionsOrFilterDisabled()) {
550
+ describedById = `${inputId}-assistive-hint`;
551
+ }
552
+ else if (describedBy !== "") {
553
+ describedById = describedBy;
554
+ }
555
+ const hasSuggestedSearch = (!!value || this.showMenuWithNoInput()) &&
556
+ this.hasOptionsOrFilterDisabled();
557
+ const menuOpen = hasSuggestedSearch && open && filteredOptions.length > 0;
558
+ const menuRendered = menuOpen && value.length >= charactersUntilSuggestion;
559
+ const labelValue = getLabelFromValue(value, options, valueField, labelField);
560
+ renderHiddenInput(this.el, value, name, disabledMode);
561
+ return (h(Host, { key: 'f9ec3f2c47607e817cf0352546d0f72653b433ae', class: {
562
+ "ic-search-bar-search": true,
563
+ "ic-search-bar-full-width": fullWidth,
564
+ "ic-search-bar-disabled": disabled,
565
+ "ic-search-bar-small": size === "small",
566
+ [`ic-theme-${theme}`]: theme !== "inherit",
567
+ }, onFocus: this.handleHostFocus, onBlur: this.handleHostBlur }, h("ic-input-container", { key: 'fde0dc358fd80f81d23927eb18b6bd73e9694bcc', readonly: readonly, disabled: disabledMode }, !hideLabel && (h("ic-input-label", { key: '3c2a138a07c5a637842bf0330a857cd8a4c05be5', for: inputId, label: label, helperText: helperText, required: required, disabled: disabledMode && !readonly, readonly: readonly }, h("slot", { key: '4e5d465c5f4486826f3a634a4dd5ed2ecf01b249', name: "helper-text", slot: "helper-text" }))), h("ic-input-component-container", { key: '62ad9581a1280af102d990de7fcac4055f800bec', ref: (el) => (this.anchorEl = el), size: size, disabled: disabledMode, readonly: readonly, fullWidth: fullWidth }, h("input", { key: '196cad9c551d68276d99af9a60bd07a141130bd9', id: inputId, name: name, ref: (el) => (this.inputEl = el), value: options && !!labelValue ? labelValue : value, class: {
568
+ "no-left-pad": readonly,
569
+ readonly,
570
+ "truncate-value": truncateValue,
571
+ }, placeholder: placeholder, required: required, disabled: disabledMode, readonly: readonly, onInput: this.onInput, onBlur: this.onInputBlur, onFocus: this.onInputFocus, "aria-label": hideLabel ? label : undefined, "aria-activedescendant": ariaActiveDescendant, "aria-expanded": options.length > 0 && menuRendered ? `${menuOpen}` : undefined, "aria-owns": menuRendered ? menuId : undefined, "aria-describedby": describedById, "aria-controls": menuRendered ? menuId : undefined, "aria-haspopup": options.length > 0 ? "listbox" : undefined, "aria-autocomplete": hasSuggestedSearch ? "list" : undefined, role: options.length > 0 && menuRendered ? "combobox" : undefined, autocomplete: autocomplete, autocapitalize: autocapitalize, autoFocus: autofocus, spellcheck: spellcheck, inputmode: "search" }), h("div", { key: '94889d1ffab13321ea522704aacd7ebf0e0c3d00', class: {
572
+ "clear-button-container": true,
573
+ "clear-button-visible": !!value && !disabledMode && showClearButton,
574
+ } }, h("ic-button", { key: 'd0a3c5b6288c249ba8be2a4bcbbd2a33f1a30025', id: "clear-button", class: {
575
+ "clear-button": true,
576
+ "clear-button-unfocused": !clearButtonFocused,
577
+ }, "aria-label": "Clear", innerHTML: clearIcon, onClick: this.handleClear, onMouseDown: this.handleMouseDown, size: size, onFocus: this.handleFocusClearButton, onBlur: this.handleClearBlur, onKeyDown: this.handleClear, type: "button", variant: "icon-tertiary", theme: clearButtonFocused ? "light" : "dark" }), h("div", { key: '3965e828aba0dd8f88051ec717c7fafcb237a271', class: "divider" })), h("div", { key: 'c143dbc227dce558f5f87e1e2f7e3a014b9d250c', class: {
578
+ "search-submit-button-container": true,
579
+ "search-submit-button-disabled": this.isSubmitDisabled(),
580
+ } }, h("ic-button", { key: '98e79886a69703ab39c8d6f5f97c147fb406870d', id: "search-submit-button", "aria-label": "Search", ref: (el) => (this.searchSubmitButton = el), class: {
581
+ "search-submit-button": true,
582
+ "search-submit-button-small": size === "small",
583
+ "search-submit-button-unfocused": !searchSubmitFocused,
584
+ "search-submit-button-disabled": this.isSubmitDisabled(),
585
+ }, disabled: this.isSubmitDisabled(), innerHTML: searchIcon, size: size, onClick: this.handleSubmitSearch, onMouseDown: this.handleMouseDown, onBlur: this.handleSubmitSearchBlur, onFocus: this.handleSubmitSearchFocus, onKeyDown: this.handleSubmitSearchKeyDown, type: searchButtonType, variant: "icon-tertiary", theme: searchSubmitFocused ? "light" : "dark" }))), h("div", { key: '4b0377230ac437eda9f5674876e87a7a72a0779c', class: {
586
+ "menu-container": true,
587
+ fullwidth: fullWidth,
588
+ } }, menuRendered && this.anchorEl && this.inputEl && (h("ic-menu", { key: '8be3e2accba616f85a408e8c82304433e98f7715', class: {
589
+ "no-results": this.hadNoOptions() ||
590
+ (filteredOptions.length === 1 &&
591
+ (filteredOptions[0][labelField] === loadingLabel ||
592
+ filteredOptions[0][labelField] === loadingErrorLabel)),
593
+ }, activationType: "manual", anchorEl: this.anchorEl, autofocusOnSelected: false, searchMode: searchMode, inputEl: this.inputEl, inputLabel: label, ref: (el) => (this.menu = el), fullWidth: fullWidth, menuId: menuId, open: true, options: filteredOptions, onMenuOptionSelect: this.handleOptionSelect, onMenuStateChange: this.handleMenuChange, onMenuOptionId: this.handleMenuOptionHighlight, onRetryButtonClicked: this.handleRetry, parentEl: this.el, value: value, labelField: labelField, valueField: valueField, searchBar: true })))), h("div", { key: '09953fbff84f3e27a6522da365ef49e96b21fa62', "aria-live": "polite", role: "status", class: "search-results-status" })));
594
+ }
595
+ static get delegatesFocus() { return true; }
596
+ get el() { return this; }
597
+ static get watchers() { return {
598
+ "charactersUntilSuggestion": ["watchCharactersUntilSuggestionHandler"],
599
+ "disabled": ["watchDisabledHandler"],
600
+ "debounce": ["debounceChanged"],
601
+ "loading": ["loadingHandler"],
602
+ "preventFormSubmitOnSearch": ["preventFormSubmitOnSearchHandler"],
603
+ "filteredOptions": ["filteredOptionsHandler"],
604
+ "options": ["watchOptionsHandler"],
605
+ "value": ["watchValueHandler"]
606
+ }; }
607
+ static get style() { return IcSearchBarStyle0; }
608
+ }, [17, "ic-search-bar", {
609
+ "autocapitalize": [1],
610
+ "autocomplete": [1],
611
+ "autocorrect": [1],
612
+ "autofocus": [4],
613
+ "charactersUntilSuggestion": [2, "characters-until-suggestion"],
614
+ "disabled": [4],
615
+ "disableAutoFiltering": [4, "disable-auto-filtering"],
616
+ "debounce": [2],
617
+ "emptyOptionListText": [1, "empty-option-list-text"],
618
+ "focusOnLoad": [4, "focus-on-load"],
619
+ "fullWidth": [4, "full-width"],
620
+ "helperText": [1, "helper-text"],
621
+ "hideLabel": [4, "hide-label"],
622
+ "assistiveHintText": [1, "assistive-hint-text"],
623
+ "label": [1],
624
+ "labelField": [1, "label-field"],
625
+ "loading": [1028],
626
+ "loadingErrorLabel": [1, "loading-error-label"],
627
+ "loadingLabel": [1, "loading-label"],
628
+ "name": [1],
629
+ "placeholder": [1],
630
+ "preventFormSubmitOnSearch": [4, "prevent-form-submit-on-search"],
631
+ "readonly": [4],
632
+ "required": [4],
633
+ "searchMode": [1, "search-mode"],
634
+ "size": [1],
635
+ "spellcheck": [4],
636
+ "theme": [1],
637
+ "timeout": [2],
638
+ "valueField": [1, "value-field"],
639
+ "options": [16],
640
+ "value": [1537],
641
+ "ariaActiveDescendant": [32],
642
+ "clearButtonFocused": [32],
643
+ "highlightedValue": [32],
644
+ "open": [32],
645
+ "searchSubmitFocused": [32],
646
+ "showClearButton": [32],
647
+ "searchButtonType": [32],
648
+ "filteredOptions": [32],
649
+ "setFocus": [64]
650
+ }, [[0, "keydown", "handleKeyDown"], [0, "keyup", "handleKeyUp"]], {
651
+ "charactersUntilSuggestion": ["watchCharactersUntilSuggestionHandler"],
652
+ "disabled": ["watchDisabledHandler"],
653
+ "debounce": ["debounceChanged"],
654
+ "loading": ["loadingHandler"],
655
+ "preventFormSubmitOnSearch": ["preventFormSubmitOnSearchHandler"],
656
+ "filteredOptions": ["filteredOptionsHandler"],
657
+ "options": ["watchOptionsHandler"],
658
+ "value": ["watchValueHandler"]
659
+ }]);
660
+ function defineCustomElement$1() {
661
+ if (typeof customElements === "undefined") {
662
+ return;
663
+ }
664
+ const components = ["ic-search-bar", "ic-button", "ic-input-component-container", "ic-input-container", "ic-input-label", "ic-loading-indicator", "ic-menu", "ic-tooltip", "ic-typography"];
665
+ components.forEach(tagName => { switch (tagName) {
666
+ case "ic-search-bar":
667
+ if (!customElements.get(tagName)) {
668
+ customElements.define(tagName, SearchBar);
669
+ }
670
+ break;
671
+ case "ic-button":
672
+ if (!customElements.get(tagName)) {
673
+ defineCustomElement$9();
674
+ }
675
+ break;
676
+ case "ic-input-component-container":
677
+ if (!customElements.get(tagName)) {
678
+ defineCustomElement$8();
679
+ }
680
+ break;
681
+ case "ic-input-container":
682
+ if (!customElements.get(tagName)) {
683
+ defineCustomElement$7();
684
+ }
685
+ break;
686
+ case "ic-input-label":
687
+ if (!customElements.get(tagName)) {
688
+ defineCustomElement$6();
689
+ }
690
+ break;
691
+ case "ic-loading-indicator":
692
+ if (!customElements.get(tagName)) {
693
+ defineCustomElement$5();
694
+ }
695
+ break;
696
+ case "ic-menu":
697
+ if (!customElements.get(tagName)) {
698
+ defineCustomElement$4();
699
+ }
700
+ break;
701
+ case "ic-tooltip":
702
+ if (!customElements.get(tagName)) {
703
+ defineCustomElement$3();
704
+ }
705
+ break;
706
+ case "ic-typography":
707
+ if (!customElements.get(tagName)) {
708
+ defineCustomElement$2();
709
+ }
710
+ break;
711
+ } });
712
+ }
713
+
714
+ const IcSearchBar = SearchBar;
715
+ const defineCustomElement = defineCustomElement$1;
716
+
717
+ export { IcSearchBar, defineCustomElement };
718
+
719
+ //# sourceMappingURL=ic-search-bar.js.map