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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (412) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/helpers-93c5fc92.js +198 -0
  3. package/dist/cjs/helpers-93c5fc92.js.map +1 -0
  4. package/dist/cjs/{helpers-86375e76.js → helpers-b525d45a.js} +45 -4
  5. package/dist/cjs/helpers-b525d45a.js.map +1 -0
  6. package/dist/cjs/ic-accordion-group.cjs.entry.js +6 -2
  7. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-alert.cjs.entry.js +2 -2
  10. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-badge.cjs.entry.js +4 -3
  13. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
  15. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  16. package/dist/cjs/ic-button_3.cjs.entry.js +34 -10
  17. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-card.cjs.entry.js +7 -7
  19. package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
  22. package/dist/cjs/ic-chip.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-data-entity.cjs.entry.js +3 -6
  24. package/dist/cjs/ic-data-entity.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-data-row.cjs.entry.js +21 -35
  26. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-dialog.cjs.entry.js +4 -2
  28. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  30. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  31. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  34. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  35. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +12 -10
  37. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-link.cjs.entry.js +1 -1
  40. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  41. package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
  42. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +2599 -0
  43. package/dist/cjs/ic-menu-with-multi.cjs.entry.js.map +1 -0
  44. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  47. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  48. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-pagination-bar.cjs.entry.js +2 -18
  50. package/dist/cjs/ic-pagination-bar.cjs.entry.js.map +1 -1
  51. package/dist/cjs/ic-pagination_4.cjs.entry.js +21 -13
  52. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  53. package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  55. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  56. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  57. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  58. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ic-select-with-multi.cjs.entry.js +837 -0
  60. package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -0
  61. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -5
  62. package/dist/cjs/ic-side-navigation.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  65. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  66. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  67. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-theme.cjs.entry.js +1 -1
  71. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  72. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +184 -0
  73. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -0
  74. package/dist/cjs/ic-toggle-button.cjs.entry.js +6 -3
  75. package/dist/cjs/ic-toggle-button.cjs.entry.js.map +1 -1
  76. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  77. package/dist/cjs/ic-typography.cjs.entry.js +1 -1
  78. package/dist/cjs/index-4cf27b16.js +12 -0
  79. package/dist/cjs/loader.cjs.js +1 -1
  80. package/dist/collection/collection-manifest.json +4 -1
  81. package/dist/collection/components/ic-menu-with-multi/ic-menu.css +701 -0
  82. package/dist/collection/components/ic-menu-with-multi/ic-menu.js +1458 -0
  83. package/dist/collection/components/ic-menu-with-multi/ic-menu.js.map +1 -0
  84. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js +880 -0
  85. package/dist/collection/components/ic-menu-with-multi/test/basic/ic-menu.spec.js.map +1 -0
  86. package/dist/collection/components/ic-select-with-multi/assets/Check.svg +3 -0
  87. package/dist/collection/components/ic-select-with-multi/assets/Clear.svg +3 -0
  88. package/dist/collection/components/ic-select-with-multi/assets/Expand.svg +3 -0
  89. package/dist/collection/components/ic-select-with-multi/ic-select.css +693 -0
  90. package/dist/collection/components/ic-select-with-multi/ic-select.js +1649 -0
  91. package/dist/collection/components/ic-select-with-multi/ic-select.js.map +1 -0
  92. package/dist/collection/components/ic-select-with-multi/story-data.js +216 -0
  93. package/dist/collection/components/ic-select-with-multi/story-data.js.map +1 -0
  94. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js +146 -0
  95. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js.map +1 -0
  96. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js +2040 -0
  97. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js.map +1 -0
  98. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js +1518 -0
  99. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.spec.js.map +1 -0
  100. package/dist/collection/utils/constants.js +28 -0
  101. package/dist/collection/utils/constants.js.map +1 -0
  102. package/dist/collection/utils/helpers.js +168 -5
  103. package/dist/collection/utils/helpers.js.map +1 -1
  104. package/dist/collection/utils/types.js +13 -0
  105. package/dist/collection/utils/types.js.map +1 -0
  106. package/dist/components/helpers.js +44 -4
  107. package/dist/components/helpers.js.map +1 -1
  108. package/dist/components/helpers2.js +183 -0
  109. package/dist/components/helpers2.js.map +1 -0
  110. package/dist/components/ic-accordion-group.js +7 -2
  111. package/dist/components/ic-accordion-group.js.map +1 -1
  112. package/dist/components/ic-alert2.js +1 -1
  113. package/dist/components/ic-alert2.js.map +1 -1
  114. package/dist/components/ic-back-to-top.js +1 -1
  115. package/dist/components/ic-badge.js +4 -3
  116. package/dist/components/ic-badge.js.map +1 -1
  117. package/dist/components/ic-breadcrumb-group.js +1 -1
  118. package/dist/components/ic-breadcrumb2.js +1 -1
  119. package/dist/components/ic-button2.js +38 -9
  120. package/dist/components/ic-button2.js.map +1 -1
  121. package/dist/components/ic-card.js +8 -20
  122. package/dist/components/ic-card.js.map +1 -1
  123. package/dist/components/ic-checkbox-group.js +1 -1
  124. package/dist/components/ic-checkbox.js +1 -1
  125. package/dist/components/ic-chip.js +1 -1
  126. package/dist/components/ic-data-entity.js +3 -6
  127. package/dist/components/ic-data-entity.js.map +1 -1
  128. package/dist/components/ic-data-row.js +21 -35
  129. package/dist/components/ic-data-row.js.map +1 -1
  130. package/dist/components/ic-dialog.js +5 -2
  131. package/dist/components/ic-dialog.js.map +1 -1
  132. package/dist/components/ic-divider2.js +1 -1
  133. package/dist/components/ic-footer-link-group.js +1 -1
  134. package/dist/components/ic-footer-link.js +1 -1
  135. package/dist/components/ic-footer.js +1 -1
  136. package/dist/components/ic-hero.js +1 -1
  137. package/dist/components/ic-horizontal-scroll2.js +1 -1
  138. package/dist/components/ic-input-component-container2.js +7 -6
  139. package/dist/components/ic-input-component-container2.js.map +1 -1
  140. package/dist/components/ic-input-label2.js +1 -1
  141. package/dist/components/ic-input-validation2.js +1 -1
  142. package/dist/components/ic-loading-indicator2.js +1 -1
  143. package/dist/components/ic-menu-group.js +1 -1
  144. package/dist/components/ic-menu-item2.js +1 -1
  145. package/dist/components/ic-menu-with-multi.d.ts +11 -0
  146. package/dist/components/ic-menu-with-multi.js +8 -0
  147. package/dist/components/ic-menu-with-multi.js.map +1 -0
  148. package/dist/components/ic-menu2.js +5 -4
  149. package/dist/components/ic-menu2.js.map +1 -1
  150. package/dist/components/ic-menu3.js +2665 -0
  151. package/dist/components/ic-menu3.js.map +1 -0
  152. package/dist/components/ic-navigation-button.js +1 -1
  153. package/dist/components/ic-navigation-group.js +1 -1
  154. package/dist/components/ic-navigation-item.js +1 -1
  155. package/dist/components/ic-navigation-menu2.js +1 -1
  156. package/dist/components/ic-page-header.js +1 -1
  157. package/dist/components/ic-pagination-bar2.js +1 -17
  158. package/dist/components/ic-pagination-bar2.js.map +1 -1
  159. package/dist/components/ic-pagination-item2.js +1 -1
  160. package/dist/components/ic-pagination2.js +1 -1
  161. package/dist/components/ic-popover-menu.js +2 -2
  162. package/dist/components/ic-popover-menu.js.map +1 -1
  163. package/dist/components/ic-radio-group.js +1 -1
  164. package/dist/components/ic-radio-option.js +1 -1
  165. package/dist/components/ic-search-bar.js +1 -1
  166. package/dist/components/ic-search-bar.js.map +1 -1
  167. package/dist/components/ic-select-with-multi.d.ts +11 -0
  168. package/dist/components/ic-select-with-multi.js +962 -0
  169. package/dist/components/ic-select-with-multi.js.map +1 -0
  170. package/dist/components/ic-select2.js +23 -14
  171. package/dist/components/ic-select2.js.map +1 -1
  172. package/dist/components/ic-side-navigation.js +1 -5
  173. package/dist/components/ic-side-navigation.js.map +1 -1
  174. package/dist/components/ic-step.js +1 -1
  175. package/dist/components/ic-stepper.js +1 -1
  176. package/dist/components/ic-switch.js +1 -1
  177. package/dist/components/ic-tab-panel.js +1 -1
  178. package/dist/components/ic-tab.js +1 -1
  179. package/dist/components/ic-text-field2.js +1 -1
  180. package/dist/components/ic-theme.js +1 -1
  181. package/dist/components/ic-toast.js +1 -1
  182. package/dist/components/ic-toggle-button-group.js +210 -0
  183. package/dist/components/ic-toggle-button-group.js.map +1 -0
  184. package/dist/components/ic-toggle-button.js +6 -3
  185. package/dist/components/ic-toggle-button.js.map +1 -1
  186. package/dist/components/ic-tooltip2.js +1 -1
  187. package/dist/components/ic-tooltip2.js.map +1 -1
  188. package/dist/components/ic-top-navigation.js +1 -1
  189. package/dist/core/core.css +8 -5
  190. package/dist/core/core.esm.js +1 -1
  191. package/dist/core/core.esm.js.map +1 -1
  192. package/dist/core/{p-4119a26b.entry.js → p-045359e1.entry.js} +2 -2
  193. package/dist/core/{p-cae71c32.entry.js → p-10fb4c46.entry.js} +2 -2
  194. package/dist/core/{p-7a0790e4.entry.js → p-169bfa51.entry.js} +2 -2
  195. package/dist/core/{p-56645c00.entry.js → p-1ca332ca.entry.js} +2 -2
  196. package/dist/core/{p-fddc7254.entry.js → p-204ace96.entry.js} +2 -2
  197. package/dist/core/p-21150122.entry.js +2 -0
  198. package/dist/core/p-21150122.entry.js.map +1 -0
  199. package/dist/core/{p-5332a426.entry.js → p-2eac7dcc.entry.js} +2 -2
  200. package/dist/core/{p-3294eba4.entry.js → p-3803a5b5.entry.js} +2 -2
  201. package/dist/core/{p-24945ee5.entry.js → p-452985d9.entry.js} +2 -2
  202. package/dist/core/p-452985d9.entry.js.map +1 -0
  203. package/dist/core/p-4753bac8.entry.js +2 -0
  204. package/dist/core/p-4753bac8.entry.js.map +1 -0
  205. package/dist/core/{p-a048beab.entry.js → p-4baa0916.entry.js} +2 -2
  206. package/dist/core/{p-7e0197a4.entry.js → p-4f413fc0.entry.js} +2 -2
  207. package/dist/core/{p-a6a90c56.entry.js → p-595be57d.entry.js} +2 -2
  208. package/dist/core/{p-5f8c4c83.entry.js → p-5ae93c16.entry.js} +2 -2
  209. package/dist/core/{p-03fdee20.entry.js → p-5e0c830b.entry.js} +2 -2
  210. package/dist/core/{p-03fdee20.entry.js.map → p-5e0c830b.entry.js.map} +1 -1
  211. package/dist/core/p-624d4f5f.entry.js +2 -0
  212. package/dist/core/p-624d4f5f.entry.js.map +1 -0
  213. package/dist/core/{p-fff91bd9.entry.js → p-6933f8e9.entry.js} +2 -2
  214. package/dist/core/{p-043e4073.entry.js → p-6c3044b6.entry.js} +2 -2
  215. package/dist/core/{p-7b17f3ce.entry.js → p-73be1251.entry.js} +2 -2
  216. package/dist/core/{p-e0d8d7a5.entry.js → p-75dac3d1.entry.js} +2 -2
  217. package/dist/core/{p-a3ab9f4c.entry.js → p-76915584.entry.js} +2 -2
  218. package/dist/core/p-76915584.entry.js.map +1 -0
  219. package/dist/core/{p-78ad0c34.entry.js → p-7ef8d616.entry.js} +2 -2
  220. package/dist/core/{p-78ad0c34.entry.js.map → p-7ef8d616.entry.js.map} +1 -1
  221. package/dist/core/{p-f2318ddc.entry.js → p-81ddc39d.entry.js} +2 -2
  222. package/dist/core/{p-3e36c9e4.entry.js → p-869954a2.entry.js} +2 -2
  223. package/dist/core/{p-a561980f.entry.js → p-88d54b72.entry.js} +2 -2
  224. package/dist/core/{p-f4c11be0.entry.js → p-8b08d8fe.entry.js} +2 -2
  225. package/dist/core/p-8b08d8fe.entry.js.map +1 -0
  226. package/dist/core/{p-c2884fcd.entry.js → p-917c5721.entry.js} +2 -2
  227. package/dist/core/{p-217db3af.entry.js → p-942282cd.entry.js} +2 -2
  228. package/dist/core/p-99cad6c2.js +2 -0
  229. package/dist/core/p-99cad6c2.js.map +1 -0
  230. package/dist/core/p-9caf19eb.js +2 -0
  231. package/dist/core/p-9caf19eb.js.map +1 -0
  232. package/dist/core/{p-99a9ce86.entry.js → p-a0f8efb2.entry.js} +2 -2
  233. package/dist/core/{p-234edce6.entry.js → p-a31031a5.entry.js} +2 -2
  234. package/dist/core/{p-faaa06d7.entry.js → p-a434c3d4.entry.js} +2 -2
  235. package/dist/core/{p-ae337896.entry.js → p-a43c12cd.entry.js} +2 -2
  236. package/dist/core/{p-010053ab.entry.js → p-a50c3b9e.entry.js} +2 -2
  237. package/dist/core/{p-b4591bfe.entry.js → p-ab09986c.entry.js} +2 -2
  238. package/dist/core/p-ab09986c.entry.js.map +1 -0
  239. package/dist/core/p-ac4e40a7.entry.js +2 -0
  240. package/dist/core/p-ac4e40a7.entry.js.map +1 -0
  241. package/dist/core/{p-cedabab7.entry.js → p-b82dcc29.entry.js} +2 -2
  242. package/dist/core/{p-8eaed5b7.entry.js → p-ba86928c.entry.js} +2 -2
  243. package/dist/core/{p-9c6e48fb.entry.js → p-c125b65a.entry.js} +2 -2
  244. package/dist/core/{p-452be32a.entry.js → p-c34848da.entry.js} +2 -2
  245. package/dist/core/{p-1e9f689b.entry.js → p-d8469ac0.entry.js} +2 -2
  246. package/dist/core/{p-79b39c8a.entry.js → p-db9c03c0.entry.js} +2 -2
  247. package/dist/core/{p-dd0a5ef0.entry.js → p-e0462b23.entry.js} +2 -2
  248. package/dist/core/p-e0462b23.entry.js.map +1 -0
  249. package/dist/core/p-e0a94f2d.entry.js +2 -0
  250. package/dist/core/p-e0a94f2d.entry.js.map +1 -0
  251. package/dist/core/{p-eb922333.entry.js → p-e3997d60.entry.js} +2 -2
  252. package/dist/core/p-e79e0292.entry.js +2 -0
  253. package/dist/core/p-e79e0292.entry.js.map +1 -0
  254. package/dist/core/{p-26ca8030.entry.js → p-e834344e.entry.js} +2 -2
  255. package/dist/core/{p-2addb040.entry.js → p-f14454b1.entry.js} +2 -2
  256. package/dist/core/{p-e9bc9ee2.entry.js → p-f3c840cd.entry.js} +2 -2
  257. package/dist/core/{p-e9bc9ee2.entry.js.map → p-f3c840cd.entry.js.map} +1 -1
  258. package/dist/core/{p-fc406db5.entry.js → p-f6888309.entry.js} +2 -2
  259. package/dist/core/p-f74a8752.entry.js +2 -0
  260. package/dist/core/p-f74a8752.entry.js.map +1 -0
  261. package/dist/core/{p-e31125df.entry.js → p-f7a14c01.entry.js} +2 -2
  262. package/dist/core/{p-da1f0a53.entry.js → p-f843da01.entry.js} +2 -2
  263. package/dist/core/{p-da1f0a53.entry.js.map → p-f843da01.entry.js.map} +1 -1
  264. package/dist/core/{p-b7d5ced3.entry.js → p-fc5611e2.entry.js} +2 -2
  265. package/dist/core/p-fc5611e2.entry.js.map +1 -0
  266. package/dist/core/p-fde45b29.entry.js +2 -0
  267. package/dist/core/p-fde45b29.entry.js.map +1 -0
  268. package/dist/esm/core.js +1 -1
  269. package/dist/esm/{helpers-229a5574.js → helpers-12b4266a.js} +45 -5
  270. package/dist/esm/helpers-12b4266a.js.map +1 -0
  271. package/dist/esm/helpers-5271897c.js +183 -0
  272. package/dist/esm/helpers-5271897c.js.map +1 -0
  273. package/dist/esm/ic-accordion-group.entry.js +6 -2
  274. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  275. package/dist/esm/ic-accordion.entry.js +1 -1
  276. package/dist/esm/ic-alert.entry.js +2 -2
  277. package/dist/esm/ic-alert.entry.js.map +1 -1
  278. package/dist/esm/ic-back-to-top.entry.js +1 -1
  279. package/dist/esm/ic-badge.entry.js +4 -3
  280. package/dist/esm/ic-badge.entry.js.map +1 -1
  281. package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
  282. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  283. package/dist/esm/ic-button_3.entry.js +34 -10
  284. package/dist/esm/ic-button_3.entry.js.map +1 -1
  285. package/dist/esm/ic-card.entry.js +7 -7
  286. package/dist/esm/ic-card.entry.js.map +1 -1
  287. package/dist/esm/ic-checkbox-group.entry.js +1 -1
  288. package/dist/esm/ic-checkbox.entry.js +1 -1
  289. package/dist/esm/ic-chip.entry.js +1 -1
  290. package/dist/esm/ic-data-entity.entry.js +3 -6
  291. package/dist/esm/ic-data-entity.entry.js.map +1 -1
  292. package/dist/esm/ic-data-row.entry.js +21 -35
  293. package/dist/esm/ic-data-row.entry.js.map +1 -1
  294. package/dist/esm/ic-dialog.entry.js +4 -2
  295. package/dist/esm/ic-dialog.entry.js.map +1 -1
  296. package/dist/esm/ic-divider.entry.js +1 -1
  297. package/dist/esm/ic-empty-state.entry.js +1 -1
  298. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  299. package/dist/esm/ic-footer-link.entry.js +1 -1
  300. package/dist/esm/ic-footer.entry.js +1 -1
  301. package/dist/esm/ic-hero.entry.js +1 -1
  302. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  303. package/dist/esm/ic-input-component-container_3.entry.js +12 -10
  304. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  305. package/dist/esm/ic-input-label_2.entry.js +1 -1
  306. package/dist/esm/ic-link.entry.js +1 -1
  307. package/dist/esm/ic-menu-group.entry.js +1 -1
  308. package/dist/esm/ic-menu-item.entry.js +1 -1
  309. package/dist/esm/ic-menu-with-multi.entry.js +2595 -0
  310. package/dist/esm/ic-menu-with-multi.entry.js.map +1 -0
  311. package/dist/esm/ic-navigation-button.entry.js +1 -1
  312. package/dist/esm/ic-navigation-group.entry.js +1 -1
  313. package/dist/esm/ic-navigation-item.entry.js +1 -1
  314. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  315. package/dist/esm/ic-page-header.entry.js +1 -1
  316. package/dist/esm/ic-pagination-bar.entry.js +1 -17
  317. package/dist/esm/ic-pagination-bar.entry.js.map +1 -1
  318. package/dist/esm/ic-pagination_4.entry.js +21 -13
  319. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  320. package/dist/esm/ic-popover-menu.entry.js +1 -1
  321. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  322. package/dist/esm/ic-radio-group.entry.js +1 -1
  323. package/dist/esm/ic-radio-option.entry.js +1 -1
  324. package/dist/esm/ic-search-bar.entry.js +1 -1
  325. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  326. package/dist/esm/ic-select-with-multi.entry.js +833 -0
  327. package/dist/esm/ic-select-with-multi.entry.js.map +1 -0
  328. package/dist/esm/ic-side-navigation.entry.js +1 -5
  329. package/dist/esm/ic-side-navigation.entry.js.map +1 -1
  330. package/dist/esm/ic-status-tag.entry.js +1 -1
  331. package/dist/esm/ic-step.entry.js +1 -1
  332. package/dist/esm/ic-stepper.entry.js +1 -1
  333. package/dist/esm/ic-switch.entry.js +1 -1
  334. package/dist/esm/ic-tab-group.entry.js +1 -1
  335. package/dist/esm/ic-tab-panel.entry.js +1 -1
  336. package/dist/esm/ic-tab.entry.js +1 -1
  337. package/dist/esm/ic-theme.entry.js +1 -1
  338. package/dist/esm/ic-toast.entry.js +1 -1
  339. package/dist/esm/ic-toggle-button-group.entry.js +180 -0
  340. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -0
  341. package/dist/esm/ic-toggle-button.entry.js +6 -3
  342. package/dist/esm/ic-toggle-button.entry.js.map +1 -1
  343. package/dist/esm/ic-top-navigation.entry.js +1 -1
  344. package/dist/esm/ic-typography.entry.js +1 -1
  345. package/dist/esm/index-93509377.js +12 -0
  346. package/dist/esm/loader.js +1 -1
  347. package/dist/types/components/ic-menu-with-multi/ic-menu.d.ts +208 -0
  348. package/dist/types/components/ic-select-with-multi/ic-select.d.ts +289 -0
  349. package/dist/types/components/ic-select-with-multi/story-data.d.ts +32 -0
  350. package/dist/types/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.d.ts +1 -0
  351. package/dist/types/components.d.ts +531 -0
  352. package/dist/types/utils/constants.d.ts +1 -0
  353. package/dist/types/utils/helpers.d.ts +61 -2
  354. package/dist/types/utils/types.d.ts +16 -0
  355. package/hydrate/index.js +6853 -2907
  356. package/package.json +3 -3
  357. package/dist/cjs/helpers-86375e76.js.map +0 -1
  358. package/dist/core/p-0aa1fe4e.entry.js +0 -2
  359. package/dist/core/p-0aa1fe4e.entry.js.map +0 -1
  360. package/dist/core/p-24945ee5.entry.js.map +0 -1
  361. package/dist/core/p-8cde58bf.entry.js +0 -2
  362. package/dist/core/p-8cde58bf.entry.js.map +0 -1
  363. package/dist/core/p-93828f0e.entry.js +0 -2
  364. package/dist/core/p-93828f0e.entry.js.map +0 -1
  365. package/dist/core/p-9fdd7d73.entry.js +0 -2
  366. package/dist/core/p-9fdd7d73.entry.js.map +0 -1
  367. package/dist/core/p-a3ab9f4c.entry.js.map +0 -1
  368. package/dist/core/p-b4591bfe.entry.js.map +0 -1
  369. package/dist/core/p-b7d5ced3.entry.js.map +0 -1
  370. package/dist/core/p-dd0a5ef0.entry.js.map +0 -1
  371. package/dist/core/p-e0102744.js +0 -2
  372. package/dist/core/p-e0102744.js.map +0 -1
  373. package/dist/core/p-e2ccb52b.entry.js +0 -2
  374. package/dist/core/p-e2ccb52b.entry.js.map +0 -1
  375. package/dist/core/p-f4c11be0.entry.js.map +0 -1
  376. package/dist/esm/helpers-229a5574.js.map +0 -1
  377. /package/dist/core/{p-4119a26b.entry.js.map → p-045359e1.entry.js.map} +0 -0
  378. /package/dist/core/{p-cae71c32.entry.js.map → p-10fb4c46.entry.js.map} +0 -0
  379. /package/dist/core/{p-7a0790e4.entry.js.map → p-169bfa51.entry.js.map} +0 -0
  380. /package/dist/core/{p-56645c00.entry.js.map → p-1ca332ca.entry.js.map} +0 -0
  381. /package/dist/core/{p-fddc7254.entry.js.map → p-204ace96.entry.js.map} +0 -0
  382. /package/dist/core/{p-5332a426.entry.js.map → p-2eac7dcc.entry.js.map} +0 -0
  383. /package/dist/core/{p-3294eba4.entry.js.map → p-3803a5b5.entry.js.map} +0 -0
  384. /package/dist/core/{p-a048beab.entry.js.map → p-4baa0916.entry.js.map} +0 -0
  385. /package/dist/core/{p-7e0197a4.entry.js.map → p-4f413fc0.entry.js.map} +0 -0
  386. /package/dist/core/{p-a6a90c56.entry.js.map → p-595be57d.entry.js.map} +0 -0
  387. /package/dist/core/{p-5f8c4c83.entry.js.map → p-5ae93c16.entry.js.map} +0 -0
  388. /package/dist/core/{p-fff91bd9.entry.js.map → p-6933f8e9.entry.js.map} +0 -0
  389. /package/dist/core/{p-043e4073.entry.js.map → p-6c3044b6.entry.js.map} +0 -0
  390. /package/dist/core/{p-7b17f3ce.entry.js.map → p-73be1251.entry.js.map} +0 -0
  391. /package/dist/core/{p-e0d8d7a5.entry.js.map → p-75dac3d1.entry.js.map} +0 -0
  392. /package/dist/core/{p-f2318ddc.entry.js.map → p-81ddc39d.entry.js.map} +0 -0
  393. /package/dist/core/{p-3e36c9e4.entry.js.map → p-869954a2.entry.js.map} +0 -0
  394. /package/dist/core/{p-a561980f.entry.js.map → p-88d54b72.entry.js.map} +0 -0
  395. /package/dist/core/{p-c2884fcd.entry.js.map → p-917c5721.entry.js.map} +0 -0
  396. /package/dist/core/{p-217db3af.entry.js.map → p-942282cd.entry.js.map} +0 -0
  397. /package/dist/core/{p-99a9ce86.entry.js.map → p-a0f8efb2.entry.js.map} +0 -0
  398. /package/dist/core/{p-234edce6.entry.js.map → p-a31031a5.entry.js.map} +0 -0
  399. /package/dist/core/{p-faaa06d7.entry.js.map → p-a434c3d4.entry.js.map} +0 -0
  400. /package/dist/core/{p-ae337896.entry.js.map → p-a43c12cd.entry.js.map} +0 -0
  401. /package/dist/core/{p-010053ab.entry.js.map → p-a50c3b9e.entry.js.map} +0 -0
  402. /package/dist/core/{p-cedabab7.entry.js.map → p-b82dcc29.entry.js.map} +0 -0
  403. /package/dist/core/{p-8eaed5b7.entry.js.map → p-ba86928c.entry.js.map} +0 -0
  404. /package/dist/core/{p-9c6e48fb.entry.js.map → p-c125b65a.entry.js.map} +0 -0
  405. /package/dist/core/{p-452be32a.entry.js.map → p-c34848da.entry.js.map} +0 -0
  406. /package/dist/core/{p-1e9f689b.entry.js.map → p-d8469ac0.entry.js.map} +0 -0
  407. /package/dist/core/{p-79b39c8a.entry.js.map → p-db9c03c0.entry.js.map} +0 -0
  408. /package/dist/core/{p-eb922333.entry.js.map → p-e3997d60.entry.js.map} +0 -0
  409. /package/dist/core/{p-26ca8030.entry.js.map → p-e834344e.entry.js.map} +0 -0
  410. /package/dist/core/{p-2addb040.entry.js.map → p-f14454b1.entry.js.map} +0 -0
  411. /package/dist/core/{p-fc406db5.entry.js.map → p-f6888309.entry.js.map} +0 -0
  412. /package/dist/core/{p-e31125df.entry.js.map → p-f7a14c01.entry.js.map} +0 -0
@@ -0,0 +1,1458 @@
1
+ import { h, Host, Fragment, } from "@stencil/core";
2
+ import { createPopper } from "@popperjs/core";
3
+ import Check from "../../assets/check-icon.svg";
4
+ import { getOptionsWithoutGroupTitlesCount, isMacDevice, onComponentRequiredPropUndefined, } from "../../utils/helpers";
5
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
+ export class Menu {
7
+ constructor() {
8
+ this.activeDescendantAttr = "aria-activedescendant"; // Prevent duplicate literal string lint error
9
+ this.clearButtonId = "clear-button"; // Prevent duplicate literal string lint error
10
+ this.disabledOptionSelected = false;
11
+ this.hasPreviouslyBlurred = false;
12
+ this.hasTimedOut = false;
13
+ this.isLoading = false;
14
+ this.isMultiSelect = false;
15
+ this.isSearchBar = false;
16
+ this.isSearchableSelect = false;
17
+ this.multiOptionClicked = null;
18
+ this.preventClickOpen = false; // Prevents menu re-opening immediately after it is closed on blur when clicking input.
19
+ this.preventMenuFocus = false; // (When multiple) ensures focus moves straight to select all button from menu.
20
+ this.ungroupedOptions = [];
21
+ this.handleClearListener = () => {
22
+ this.optionHighlighted = "";
23
+ };
24
+ this.handleSubmitSearch = () => {
25
+ const highlightedOptionIndex = this.options.findIndex((option) => option[this.valueField] === this.optionHighlighted);
26
+ this.setInputValue(highlightedOptionIndex);
27
+ };
28
+ this.handleMenuChange = (open, focusInput) => {
29
+ this.menuStateChange.emit({ open, focusInput });
30
+ if (!open) {
31
+ if (focusInput !== false) {
32
+ this.inputEl.focus();
33
+ this.preventClickOpen = false;
34
+ }
35
+ // Reset optionHighlighted so previously highlighted option doesn't get reselected when Enter pressed
36
+ if (this.isMultiSelect) {
37
+ this.optionHighlighted = undefined;
38
+ this.multiOptionClicked = null;
39
+ }
40
+ }
41
+ };
42
+ this.setNextOptionValue = (selectedOptionIndex) => {
43
+ if (this.ungroupedOptions[selectedOptionIndex + 1]) {
44
+ this.menuOptionSelect.emit({
45
+ value: this.ungroupedOptions[selectedOptionIndex + 1][this.valueField],
46
+ optionId: this.getOptionId(this.ungroupedOptions[selectedOptionIndex + 1][this.valueField]),
47
+ });
48
+ }
49
+ else {
50
+ this.menuOptionSelect.emit({
51
+ value: this.ungroupedOptions[0][this.valueField],
52
+ optionId: this.getOptionId(this.ungroupedOptions[0][this.valueField]),
53
+ });
54
+ }
55
+ };
56
+ this.setPreviousOptionValue = (selectedOptionIndex) => {
57
+ if (this.ungroupedOptions[selectedOptionIndex - 1]) {
58
+ this.menuOptionSelect.emit({
59
+ value: this.ungroupedOptions[selectedOptionIndex - 1][this.valueField],
60
+ optionId: this.getOptionId(this.ungroupedOptions[selectedOptionIndex - 1][this.valueField]),
61
+ });
62
+ }
63
+ else {
64
+ this.menuOptionSelect.emit({
65
+ value: this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField],
66
+ optionId: this.getOptionId(this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField]),
67
+ });
68
+ }
69
+ };
70
+ this.getParentEl = (parent) => {
71
+ if (parent.tagName === "IC-SEARCH-BAR") {
72
+ this.isSearchBar = true;
73
+ }
74
+ else if (parent.tagName === "IC-SELECT" ||
75
+ parent.tagName === "IC-SELECT-WITH-MULTI") {
76
+ if (parent.getAttribute("searchable") !== null &&
77
+ parent.getAttribute("searchable") !== undefined) {
78
+ this.isSearchableSelect = true;
79
+ }
80
+ else if (parent.getAttribute("multiple") !== null &&
81
+ parent.getAttribute("multiple") !== undefined) {
82
+ this.isMultiSelect = true;
83
+ }
84
+ }
85
+ };
86
+ // Open menu when up or down arrow keys are pressed
87
+ this.arrowBehaviour = (event) => {
88
+ event.preventDefault();
89
+ this.handleMenuChange(true);
90
+ };
91
+ this.getMenuOptions = () => this.isSearchBar ? this.options : this.ungroupedOptions;
92
+ // Set option that is focused and so should show focus state
93
+ this.setHighlightedOption = (highlightedIndex) => {
94
+ const menuOptions = this.getMenuOptions();
95
+ menuOptions[highlightedIndex] &&
96
+ !menuOptions[highlightedIndex].timedOut &&
97
+ (this.optionHighlighted =
98
+ menuOptions[highlightedIndex][this.valueField] || undefined);
99
+ };
100
+ // Determines keyboard behaviour when selection is automatic
101
+ // (i.e. you don't have to press Enter select an option - just focus on it)
102
+ // and menu is closed
103
+ this.autoSetInputValueKeyboardOpen = (event) => {
104
+ const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
105
+ this.keyboardNav = false;
106
+ switch (event.key) {
107
+ case "ArrowDown":
108
+ this.keyboardNav = true;
109
+ this.arrowBehaviour(event);
110
+ this.setNextOptionValue(selectedOptionIndex);
111
+ break;
112
+ case "ArrowUp":
113
+ this.keyboardNav = true;
114
+ this.arrowBehaviour(event);
115
+ this.setPreviousOptionValue(selectedOptionIndex);
116
+ break;
117
+ case " ":
118
+ case "Enter":
119
+ if (event.target.id !== this.clearButtonId) {
120
+ this.handleMenuChange(true);
121
+ }
122
+ break;
123
+ }
124
+ };
125
+ this.selectHighlightedOption = (target, options, highlightedOptionIndex) => {
126
+ if (!this.isLoading && !this.hasTimedOut) {
127
+ this.keyboardNav = true;
128
+ }
129
+ const isOpen = this.isSearchBar || this.isSearchableSelect || this.open;
130
+ if (isOpen) {
131
+ if (highlightedOptionIndex >= 0) {
132
+ if (options[highlightedOptionIndex] !== undefined) {
133
+ if (this.isSearchBar &&
134
+ options[highlightedOptionIndex].disabled === true) {
135
+ this.disabledOptionSelected = true;
136
+ }
137
+ else {
138
+ this.setInputValue(highlightedOptionIndex);
139
+ this.value = options[highlightedOptionIndex][this.valueField];
140
+ }
141
+ }
142
+ }
143
+ else {
144
+ this.setInputValue(highlightedOptionIndex);
145
+ }
146
+ }
147
+ else if (target.id !== this.clearButtonId &&
148
+ this.isMultiSelect) {
149
+ this.handleMenuChange(true);
150
+ }
151
+ };
152
+ // Determines keyboard behaviour when selection is manual (i.e. when you have to press Enter to select an option)
153
+ this.manualSetInputValueKeyboardOpen = (event) => {
154
+ const menuOptions = this.getMenuOptions();
155
+ this.keyboardNav = false;
156
+ const highlightedOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === this.optionHighlighted);
157
+ const clickedMultiOptionIndex = menuOptions.findIndex((option) => option[this.valueField] === this.multiOptionClicked);
158
+ const getOptionId = (index) => { var _a; return (_a = Array.from(this.el.querySelectorAll("li"))[index]) === null || _a === void 0 ? void 0 : _a.id; };
159
+ // Space press should be equivalent to Enter when multi-select
160
+ if (event.key === " " && this.isMultiSelect) {
161
+ this.selectHighlightedOption(event.target, menuOptions, highlightedOptionIndex);
162
+ }
163
+ else {
164
+ switch (event.key) {
165
+ case "ArrowDown":
166
+ this.keyboardNav = true;
167
+ this.arrowBehaviour(event);
168
+ if (this.multiOptionClicked) {
169
+ // Set focus to option last clicked
170
+ // Prevents it resetting to the top of the menu when user switches to using keyboard
171
+ this.setHighlightedOption(clickedMultiOptionIndex);
172
+ this.multiOptionClicked = null;
173
+ }
174
+ else if (highlightedOptionIndex < menuOptions.length - 1) {
175
+ this.setHighlightedOption(highlightedOptionIndex + 1);
176
+ this.menuOptionId.emit({
177
+ optionId: getOptionId(highlightedOptionIndex + 1),
178
+ });
179
+ }
180
+ else {
181
+ this.setHighlightedOption(0);
182
+ this.menuOptionId.emit({
183
+ optionId: getOptionId(0),
184
+ });
185
+ }
186
+ this.preventIncorrectTabOrder = false;
187
+ this.focusFromSearchKeypress = false;
188
+ break;
189
+ case "ArrowUp":
190
+ this.keyboardNav = true;
191
+ this.arrowBehaviour(event);
192
+ if (this.multiOptionClicked) {
193
+ // Set focus to option last clicked
194
+ // Prevents it resetting to the bottom of the menu when user switches to using keyboard
195
+ this.setHighlightedOption(clickedMultiOptionIndex);
196
+ this.multiOptionClicked = null;
197
+ }
198
+ else if (highlightedOptionIndex <= 0 ||
199
+ highlightedOptionIndex > menuOptions.length + 1) {
200
+ this.setHighlightedOption(menuOptions.length - 1);
201
+ this.menuOptionId.emit({
202
+ optionId: getOptionId(menuOptions.length - 1),
203
+ });
204
+ }
205
+ else {
206
+ this.setHighlightedOption(highlightedOptionIndex - 1);
207
+ this.menuOptionId.emit({
208
+ optionId: getOptionId(highlightedOptionIndex - 1),
209
+ });
210
+ }
211
+ this.preventIncorrectTabOrder = false;
212
+ this.focusFromSearchKeypress = false;
213
+ break;
214
+ case "Home":
215
+ this.keyboardNav = true;
216
+ event.preventDefault();
217
+ this.arrowBehaviour(event);
218
+ this.setHighlightedOption(0);
219
+ this.menuOptionId.emit({
220
+ optionId: getOptionId(0),
221
+ });
222
+ break;
223
+ case "End":
224
+ this.keyboardNav = true;
225
+ event.preventDefault();
226
+ this.arrowBehaviour(event);
227
+ this.setHighlightedOption(menuOptions.length - 1);
228
+ this.menuOptionId.emit({
229
+ optionId: getOptionId(menuOptions.length - 1),
230
+ });
231
+ break;
232
+ case " ":
233
+ if (this.isSearchBar || this.isSearchableSelect) {
234
+ break;
235
+ }
236
+ else {
237
+ if (event.target.id !== this.clearButtonId) {
238
+ this.handleMenuChange(true);
239
+ }
240
+ }
241
+ break;
242
+ case "Enter":
243
+ event.preventDefault();
244
+ this.selectHighlightedOption(event.target, menuOptions, highlightedOptionIndex);
245
+ break;
246
+ case "Escape":
247
+ if (this.open) {
248
+ event.stopImmediatePropagation();
249
+ }
250
+ this.handleMenuChange(false);
251
+ this.menuOptionId.emit({ optionId: undefined });
252
+ break;
253
+ case "a":
254
+ // Checks if Cmd (meta) key is pressed if Mac device (while excluding meta key on Windows)
255
+ // Otherwise, if a different OS, checks Ctrl key
256
+ if ((isMacDevice() && event.metaKey) ||
257
+ (!isMacDevice() && event.ctrlKey)) {
258
+ this.emitSelectAll();
259
+ }
260
+ break;
261
+ case "Shift":
262
+ case "Tab":
263
+ if (this.isSearchBar) {
264
+ this.keyboardNav = true;
265
+ }
266
+ if (this.isMultiSelect) {
267
+ if (this.open && !event.shiftKey && this.selectAllButton) {
268
+ event.preventDefault();
269
+ this.selectAllButton.focus(); // Move focus to select all button instead of focused option
270
+ this.preventMenuFocus = true;
271
+ this.preventClickOpen = true;
272
+ this.optionHighlighted = undefined; // Stop any option focus states showing when focus moved to select all button
273
+ }
274
+ }
275
+ else {
276
+ this.preventIncorrectTabOrder = true;
277
+ }
278
+ break;
279
+ case "Backspace":
280
+ if (this.isSearchBar) {
281
+ this.parentEl.setFocus();
282
+ if (this.searchMode === "navigation")
283
+ this.setHighlightedOption(0);
284
+ }
285
+ else if (this.isSearchableSelect) {
286
+ this.parentEl.setFocus();
287
+ }
288
+ this.focusFromSearchKeypress = true;
289
+ break;
290
+ default:
291
+ if (event.key !== "Tab") {
292
+ if (this.isSearchBar) {
293
+ this.parentEl.setFocus();
294
+ if (this.searchMode === "navigation")
295
+ this.setHighlightedOption(0);
296
+ }
297
+ else if (this.isSearchableSelect) {
298
+ this.parentEl.setFocus();
299
+ }
300
+ this.focusFromSearchKeypress = true;
301
+ break;
302
+ }
303
+ }
304
+ }
305
+ };
306
+ this.setInputValue = (highlightedOptionIndex) => {
307
+ const menuOptions = this.getMenuOptions();
308
+ if (menuOptions[highlightedOptionIndex] !== undefined) {
309
+ this.menuOptionSelect.emit({
310
+ value: menuOptions[highlightedOptionIndex][this.valueField],
311
+ });
312
+ if (this.closeOnSelect) {
313
+ this.optionHighlighted = undefined;
314
+ this.menuOptionId.emit({ optionId: undefined });
315
+ }
316
+ }
317
+ if (this.closeOnSelect) {
318
+ if (!this.hasTimedOut) {
319
+ this.handleMenuChange(false);
320
+ }
321
+ else {
322
+ this.parentEl.setFocus();
323
+ }
324
+ }
325
+ };
326
+ this.handleOptionClick = (event) => {
327
+ const { value, label } = event.target.dataset;
328
+ this.menuOptionSelect.emit({ value, label });
329
+ this.optionHighlighted = undefined;
330
+ if (this.isMultiSelect) {
331
+ this.multiOptionClicked = value;
332
+ }
333
+ else {
334
+ this.handleMenuChange(false);
335
+ }
336
+ };
337
+ this.handleRetry = () => {
338
+ this.retryButtonClicked.emit({ value: this.value });
339
+ };
340
+ this.handleRetryKeyDown = (ev) => {
341
+ if (ev.key === "Enter" || ev.key === " ") {
342
+ ev.preventDefault();
343
+ this.retryButtonClicked.emit({ value: this.value, keyPressed: ev.key });
344
+ }
345
+ };
346
+ this.handleBlur = (event) => {
347
+ if (event.relatedTarget !== this.inputEl) {
348
+ if (event.relatedTarget === this.selectAllButton) {
349
+ this.menu.removeAttribute(this.activeDescendantAttr);
350
+ }
351
+ if (!(this.menu.contains(event.relatedTarget) ||
352
+ event.relatedTarget === this.selectAllButton)) {
353
+ this.handleMenuChange(false, this.hasPreviouslyBlurred);
354
+ this.menu.removeAttribute(this.activeDescendantAttr);
355
+ }
356
+ }
357
+ else {
358
+ this.handleMenuChange(false);
359
+ this.preventClickOpen = true;
360
+ this.menu.removeAttribute(this.activeDescendantAttr);
361
+ }
362
+ if (!this.isSearchBar)
363
+ this.hasPreviouslyBlurred = !!event.relatedTarget;
364
+ };
365
+ this.handleMouseDown = (event) => {
366
+ event.preventDefault();
367
+ };
368
+ this.handleMenuKeyDown = (event) => {
369
+ if (this.activationType === "automatic") {
370
+ this.autoSetValueOnMenuKeyDown(event);
371
+ }
372
+ else if (this.activationType === "manual" && !this.isSearchBar) {
373
+ this.manualSetInputValueKeyboardOpen(event);
374
+ }
375
+ };
376
+ this.handleMenuKeyUp = (event) => {
377
+ if (event.key === "Tab" && event.shiftKey) {
378
+ this.preventClickOpen = false;
379
+ }
380
+ if (event.key === "Enter" && this.disabledOptionSelected) {
381
+ this.disabledOptionSelected = false;
382
+ event.stopImmediatePropagation();
383
+ }
384
+ };
385
+ this.handleSelectAllClick = () => {
386
+ this.keyboardNav = false;
387
+ this.menu.focus();
388
+ this.emitSelectAll();
389
+ };
390
+ this.handleSelectAllBlur = (event) => {
391
+ this.el.classList.remove("select-all-focused");
392
+ if (!this.menu.contains(event.relatedTarget)) {
393
+ this.handleMenuChange(false, false);
394
+ }
395
+ };
396
+ this.handleSelectAllFocus = () => {
397
+ this.el.classList.add("select-all-focused");
398
+ };
399
+ // Fix for Safari - select all button click was causing menu to close
400
+ this.handleSelectAllMouseDown = (event) => {
401
+ event.preventDefault();
402
+ };
403
+ this.emitSelectAll = () => {
404
+ var _a;
405
+ // Select all if there is either no value or not all options are selected
406
+ // 'true' means select all, 'false' means clear all
407
+ this.menuOptionSelectAll.emit({
408
+ select: !this.value || !(((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) === this.ungroupedOptions.length),
409
+ });
410
+ };
411
+ this.emitMenuKeyPress = (isNavKey, key) => {
412
+ this.menuKeyPress.emit({ isNavKey: isNavKey, key: key });
413
+ };
414
+ // Determines keyboard behaviour when selection is automatic
415
+ // (i.e. you don't have to press Enter select an option - just focus on it)
416
+ // and menu is focused
417
+ this.autoSetValueOnMenuKeyDown = (event) => {
418
+ event.cancelBubble = true;
419
+ const selectedOptionIndex = this.ungroupedOptions.findIndex((option) => option[this.valueField] === this.value);
420
+ const isSearchableSelect = this.inputEl.tagName === "INPUT";
421
+ this.keyboardNav = false;
422
+ switch (event.key) {
423
+ case " ":
424
+ event.preventDefault();
425
+ break;
426
+ case "ArrowUp":
427
+ if (!this.hasTimedOut) {
428
+ event.preventDefault();
429
+ this.setPreviousOptionValue(selectedOptionIndex);
430
+ this.keyboardNav = true;
431
+ }
432
+ break;
433
+ case "ArrowDown":
434
+ if (!this.hasTimedOut) {
435
+ event.preventDefault();
436
+ this.setNextOptionValue(selectedOptionIndex);
437
+ this.keyboardNav = true;
438
+ }
439
+ break;
440
+ case "Home":
441
+ this.menuOptionSelect.emit({
442
+ value: this.ungroupedOptions[0][this.valueField],
443
+ });
444
+ this.keyboardNav = true;
445
+ break;
446
+ case "End":
447
+ this.menuOptionSelect.emit({
448
+ value: this.ungroupedOptions[this.ungroupedOptions.length - 1][this.valueField],
449
+ });
450
+ this.keyboardNav = true;
451
+ break;
452
+ case "Enter":
453
+ !this.hasTimedOut && this.handleMenuChange(false);
454
+ break;
455
+ case "Escape":
456
+ this.handleMenuChange(false);
457
+ break;
458
+ case "Backspace":
459
+ if (isSearchableSelect) {
460
+ this.inputEl.focus();
461
+ }
462
+ break;
463
+ case "Shift":
464
+ break;
465
+ default:
466
+ if (isSearchableSelect && event.key !== "Tab" && !this.hasTimedOut) {
467
+ this.inputEl.focus();
468
+ }
469
+ if (event.key.length === 1) {
470
+ this.keyboardNav = true;
471
+ }
472
+ break;
473
+ }
474
+ this.emitMenuKeyPress(this.keyboardNav, event.key);
475
+ };
476
+ this.getOptionId = (value) => {
477
+ return `${this.menuId}-${value}`;
478
+ };
479
+ this.getOptionAriaLabel = (option, parentOption) => {
480
+ let ariaLabel = option[this.labelField];
481
+ if (option.description) {
482
+ ariaLabel = `${ariaLabel}, ${option.description}`;
483
+ }
484
+ if (option.element) {
485
+ ariaLabel = `${ariaLabel}, ${option.element.ariaLabel}`;
486
+ }
487
+ if (parentOption) {
488
+ return `${ariaLabel}, ${parentOption[this.labelField]} group`;
489
+ }
490
+ else {
491
+ return ariaLabel;
492
+ }
493
+ };
494
+ this.getSortedOptions = (options) => {
495
+ let sorted = [];
496
+ if (options.sort) {
497
+ sorted = options.sort((optionA, optionB) => optionA.recommended && !optionB.recommended ? -1 : 0);
498
+ }
499
+ return sorted;
500
+ };
501
+ this.isManualMode = this.activationType === "manual";
502
+ this.scrollToSelected = (menu) => {
503
+ const selectedOption = this.selectOnEnter
504
+ ? this.el.querySelector(`li[data-value="${this.optionHighlighted}"]`)
505
+ : menu.querySelector(".option[aria-selected='true']");
506
+ if (selectedOption) {
507
+ const elTop = selectedOption.offsetTop + selectedOption.offsetHeight;
508
+ if (elTop > menu.scrollTop + menu.offsetHeight ||
509
+ elTop < menu.scrollTop + menu.offsetHeight) {
510
+ menu.scrollTop = selectedOption.offsetTop;
511
+ }
512
+ // 'aria-activedescendant' affects screen reader focus
513
+ // https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/#kbd_focus_activedescendant
514
+ this.menu.setAttribute(this.activeDescendantAttr, selectedOption.id);
515
+ selectedOption.focus();
516
+ }
517
+ };
518
+ // Set 'ungroupedOptions' variable and emit its value
519
+ // - this is all the options with disabled options and group titles removed
520
+ this.loadUngroupedOptions = () => {
521
+ if (this.options.length > 0 && this.options.map) {
522
+ this.options.map((option) => {
523
+ if (option.children) {
524
+ option.children.map((option) => !option.disabled && this.ungroupedOptions.push(option));
525
+ }
526
+ else if (!option.disabled) {
527
+ this.ungroupedOptions.push(option);
528
+ }
529
+ });
530
+ }
531
+ this.ungroupedOptions = this.getSortedOptions(this.ungroupedOptions);
532
+ this.ungroupedOptionsSet.emit({ options: this.ungroupedOptions });
533
+ };
534
+ this.setMenuScrollbar = () => {
535
+ let optionsHeight = 0;
536
+ this.el
537
+ .querySelectorAll(".option")
538
+ .forEach((option) => (optionsHeight += option.clientHeight));
539
+ if (optionsHeight >= 320) {
540
+ this.menu.classList.add("menu-scroll");
541
+ }
542
+ };
543
+ this.handleTimeoutBlur = (ev) => {
544
+ this.timeoutBlur.emit({ ev });
545
+ };
546
+ this.optionContent = (option, selected) => {
547
+ return (h(Fragment, null, option.loading && h("ic-loading-indicator", { size: "icon" }), h("div", { class: "option-text-container" }, h("div", { class: "option-label" }, option.icon && (h("div", { class: "option-icon", innerHTML: option.icon, "aria-hidden": "true" })), h("ic-typography", { variant: "body", "aria-hidden": "true" }, h("p", null, option[this.labelField]))), option.description && (h("ic-typography", { id: `${this.getOptionId(option[this.valueField])}-description`, class: "option-description", variant: "caption", "aria-hidden": "true" }, h("p", null, option.description))), option.element && (h("div", { class: "option-element", innerHTML: option.element.component, "aria-hidden": "true" }))), !!option[this.valueField] &&
548
+ !!this.value &&
549
+ selected &&
550
+ this.parentEl.tagName !== "IC-SEARCH-BAR" && (h("span", { class: "check-icon", innerHTML: Check }))));
551
+ };
552
+ this.displayOption = (option, selected, index, parentOption) => {
553
+ const { open, keyboardNav, isManualMode, initialOptionsListRender, optionHighlighted, options, } = this;
554
+ return (h("li", { id: this.getOptionId(option[this.valueField]), class: {
555
+ option: true,
556
+ "focused-option": isManualMode
557
+ ? (keyboardNav || initialOptionsListRender) &&
558
+ option[this.valueField] === optionHighlighted
559
+ : keyboardNav && selected,
560
+ "last-recommended-option": option.recommended &&
561
+ options[index + 1] &&
562
+ !options[index + 1].recommended,
563
+ "disabled-option": option.disabled,
564
+ "loading-option": option.loading,
565
+ timeout: option.timedOut,
566
+ }, role: "option", tabindex: open &&
567
+ (selected || option[this.valueField] === optionHighlighted) &&
568
+ keyboardNav
569
+ ? "0"
570
+ : "-1", "aria-label": this.getOptionAriaLabel(option, parentOption), "aria-selected": selected ? "true" : "false", "aria-disabled": option.disabled ? "true" : "false", onClick: !option.timedOut && !option.loading && this.handleOptionClick, onBlur: this.handleBlur, onMouseDown: this.handleMouseDown, "data-value": option[this.valueField], "data-label": option[this.labelField] }, option.timedOut ? (h(Fragment, null, h("div", { class: "loading-error-info" }, h("svg", { class: "error-icon-svg", "aria-labelledby": "error-title", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "#000000" }, h("title", { id: "error-title" }, "Error"), h("g", { id: "close-octagon" }, h("path", { id: "Vector", d: "M8.77 3L3.5 8.27V15.73L8.77 21H16.23L21.5 15.73V8.27L16.23 3M8.91 7L12.5 10.59L16.09 7L17.5 8.41L13.91 12L17.5 15.59L16.09 17L12.5 13.41L8.91 17L7.5 15.59L11.09 12L7.5 8.41" }))), h("ic-typography", { variant: "label" }, option[this.labelField])), h("ic-button", { size: "small", variant: "tertiary", onClick: this.handleRetry, onKeyDown: this.handleRetryKeyDown, onBlur: this.handleTimeoutBlur, id: "retry-button" }, "Retry"))) : (this.optionContent(option, selected))));
571
+ };
572
+ this.focusFromSearchKeypress = false;
573
+ this.initialOptionsListRender = false;
574
+ this.keyboardNav = false;
575
+ this.optionHighlighted = undefined;
576
+ this.preventIncorrectTabOrder = false;
577
+ this.menuOptions = undefined;
578
+ this.activationType = "automatic";
579
+ this.anchorEl = undefined;
580
+ this.autoFocusOnSelected = true;
581
+ this.closeOnSelect = true;
582
+ this.fullWidth = false;
583
+ this.inputEl = undefined;
584
+ this.inputLabel = undefined;
585
+ this.labelField = "label";
586
+ this.menuId = undefined;
587
+ this.open = undefined;
588
+ this.parentEl = undefined;
589
+ this.searchMode = "navigation";
590
+ this.selectOnEnter = false;
591
+ this.size = "default";
592
+ this.small = false;
593
+ this.options = undefined;
594
+ this.value = undefined;
595
+ this.valueField = "value";
596
+ }
597
+ watchOpenHandler() {
598
+ if (!this.open && this.popperInstance) {
599
+ this.popperInstance.destroy();
600
+ this.popperInstance = null;
601
+ }
602
+ }
603
+ watchOptionsHandler(newOptions) {
604
+ this.hasTimedOut = newOptions.some((opt) => opt.timedOut);
605
+ this.isLoading = newOptions.some((opt) => opt.loading);
606
+ this.ungroupedOptions = [];
607
+ this.loadUngroupedOptions();
608
+ }
609
+ connectedCallback() {
610
+ this.getParentEl(this.parentEl);
611
+ if (this.isSearchBar) {
612
+ if (this.searchMode === "navigation")
613
+ this.setHighlightedOption(0);
614
+ this.initialOptionsListRender = true;
615
+ }
616
+ }
617
+ disconnectedCallback() {
618
+ if (this.popperInstance) {
619
+ this.popperInstance.destroy();
620
+ }
621
+ this.parentEl.removeEventListener("icClear", this.handleClearListener);
622
+ this.parentEl.removeEventListener("icSubmitSearch", this.handleSubmitSearch);
623
+ }
624
+ componentWillLoad() {
625
+ var _a, _b;
626
+ this.loadUngroupedOptions();
627
+ this.parentEl.addEventListener("icClear", this.handleClearListener);
628
+ this.parentEl.addEventListener("icSubmitSearch", this.handleSubmitSearch);
629
+ this.hasTimedOut = (_a = this.options) === null || _a === void 0 ? void 0 : _a.some((opt) => opt.timedOut);
630
+ this.isLoading = (_b = this.options) === null || _b === void 0 ? void 0 : _b.some((opt) => opt.loading);
631
+ }
632
+ componentDidLoad() {
633
+ if (this.isSearchBar &&
634
+ this.parentEl.disableFilter) {
635
+ this.focusFromSearchKeypress = true;
636
+ }
637
+ onComponentRequiredPropUndefined([
638
+ { prop: this.open, propName: "open" },
639
+ { prop: this.options, propName: "options" },
640
+ { prop: this.menuId, propName: "menu-id" },
641
+ { prop: this.inputLabel, propName: "input-label" },
642
+ //NOTE: no check for value, input-el or anchor-el as otherwise get console errors on first load of select component
643
+ ], "Menu");
644
+ }
645
+ componentDidUpdate() {
646
+ const inputValueInOptions = this.options.some((option) => option[this.valueField] === this.value);
647
+ const optionHighlightedIsSet = this.optionHighlighted !== null &&
648
+ this.optionHighlighted !== undefined &&
649
+ this.optionHighlighted !== "";
650
+ if (this.open && this.options.length !== 0 && !this.preventMenuFocus) {
651
+ if (this.value &&
652
+ this.keyboardNav &&
653
+ inputValueInOptions &&
654
+ this.autoFocusOnSelected &&
655
+ !this.isSearchableSelect) {
656
+ this.scrollToSelected(this.menu);
657
+ }
658
+ else if (optionHighlightedIsSet &&
659
+ !this.focusFromSearchKeypress &&
660
+ !this.preventIncorrectTabOrder) {
661
+ const highlightedEl = this.el.querySelector(`li[data-value="${this.optionHighlighted}"]`);
662
+ if (highlightedEl) {
663
+ this.menu.setAttribute(this.activeDescendantAttr, highlightedEl.id);
664
+ highlightedEl.focus();
665
+ }
666
+ }
667
+ else if (this.inputEl.tagName !== "IC-TEXT-FIELD" &&
668
+ this.inputEl.tagName !== "INPUT") {
669
+ this.menu.focus();
670
+ }
671
+ }
672
+ if (this.open && !this.value && this.selectOnEnter) {
673
+ this.scrollToSelected(this.menu);
674
+ }
675
+ this.preventMenuFocus = false;
676
+ }
677
+ componentDidRender() {
678
+ if (this.open && !this.popperInstance && this.anchorEl) {
679
+ this.initPopperJs(this.anchorEl);
680
+ }
681
+ if (this.open && !!this.options.length) {
682
+ this.setMenuScrollbar();
683
+ }
684
+ }
685
+ /**
686
+ * @internal If menu is opened with the mouse, emit menuStateChange custom event.
687
+ */
688
+ async handleClickOpen() {
689
+ if (!this.preventClickOpen) {
690
+ this.menuStateChange.emit({ open: !this.open });
691
+ this.keyboardNav = false;
692
+ }
693
+ this.preventClickOpen = false;
694
+ }
695
+ /**
696
+ * Used alongside activationType
697
+ * If menu is opened via keyboard navigation (i.e. Enter, ArrowUp or ArrowDown), emit optionSelect custom event.
698
+ * @param {KeyboardEvent} event - keyboard event
699
+ */
700
+ async handleKeyboardOpen(event) {
701
+ this.keyboardNav = false;
702
+ if (this.activationType === "automatic") {
703
+ this.autoSetInputValueKeyboardOpen(event);
704
+ }
705
+ else {
706
+ this.manualSetInputValueKeyboardOpen(event);
707
+ }
708
+ }
709
+ /**
710
+ * @internal Used to highlight the first option in the menu.
711
+ */
712
+ async handleSetFirstOption() {
713
+ this.setHighlightedOption(0);
714
+ }
715
+ /**
716
+ * @internal Used to initialize popperJS with an anchor element.
717
+ * 5/12/2023: Tested with Floating UI, however, discovered inconsistent
718
+ * boundary behaviour so sticking with PopperJS.
719
+ */
720
+ async initPopperJs(anchor) {
721
+ // Placements set to "-start" to accommodate for custom menu width - menu should always be aligned to the left
722
+ this.popperInstance = createPopper(anchor, this.el, {
723
+ placement: "bottom-start",
724
+ modifiers: [
725
+ {
726
+ name: "offset",
727
+ options: {
728
+ offset: [0, 7],
729
+ },
730
+ },
731
+ {
732
+ name: "flip",
733
+ options: {
734
+ fallbackPlacements: ["top-start"],
735
+ rootBoundary: "viewport",
736
+ },
737
+ },
738
+ ],
739
+ });
740
+ }
741
+ render() {
742
+ const { inputLabel, options, menuId, value, fullWidth, hasTimedOut, isLoading, size, small, open, inputEl, keyboardNav, } = this;
743
+ const selectAllButtonText = `${(value === null || value === void 0 ? void 0 : value.length) === this.ungroupedOptions.length ? "Clear" : "Select"} all`;
744
+ const hasNoResults = this.el.classList.contains("no-results");
745
+ return (h(Host, { class: {
746
+ "full-width": fullWidth,
747
+ "no-focus": (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) === "INPUT" ||
748
+ hasTimedOut ||
749
+ isLoading ||
750
+ hasNoResults,
751
+ small: small,
752
+ [size]: true,
753
+ open: open && options.length !== 0,
754
+ multiple: this.isMultiSelect,
755
+ } }, options.length !== 0 && (h("ul", { id: menuId, class: "menu", role: "listbox", "aria-label": `${inputLabel} pop-up`, "aria-multiselectable": this.isMultiSelect ? "true" : "false", tabindex: open && !keyboardNav && (inputEl === null || inputEl === void 0 ? void 0 : inputEl.tagName) !== "INPUT" ? "0" : "-1", ref: (el) => (this.menu = el), onKeyDown: this.handleMenuKeyDown, onKeyUp: this.handleMenuKeyUp, onBlur: this.handleBlur }, this.getSortedOptions(options).map((option, index) => {
756
+ if (option.children) {
757
+ if (option.children.length > 0) {
758
+ return (h("div", null, h("ic-typography", { class: "option-group-title", role: "presentation", variant: "subtitle-small" }, h("p", null, option[this.labelField])), option.children.map((childOption) => childOption.label &&
759
+ this.displayOption(childOption, this.isMultiSelect
760
+ ? value === null || value === void 0 ? void 0 : value.includes(childOption[this.valueField])
761
+ : childOption[this.valueField] === value, index, option))));
762
+ }
763
+ else {
764
+ return null;
765
+ }
766
+ }
767
+ else {
768
+ // Display option only if it has a label (rather than displaying an empty space)
769
+ return (option.label &&
770
+ this.displayOption(option, this.isMultiSelect
771
+ ? value === null || value === void 0 ? void 0 : value.includes(option[this.valueField])
772
+ : option[this.valueField] === value, index));
773
+ }
774
+ }))), options.length !== 0 &&
775
+ this.isMultiSelect &&
776
+ !isLoading &&
777
+ !hasTimedOut &&
778
+ !hasNoResults && (h("div", { class: "option-bar" }, h("ic-typography", null, h("p", null, `${value ? value.length : 0}/${getOptionsWithoutGroupTitlesCount(this.options)} selected`)), h("ic-button", { class: "select-all-button", "aria-label": `${selectAllButtonText} options for ${inputLabel}`, ref: (el) => (this.selectAllButton = el), variant: "tertiary", onClick: this.handleSelectAllClick, onMouseDown: this.handleSelectAllMouseDown, onBlur: this.handleSelectAllBlur, onFocus: this.handleSelectAllFocus, size: size === "small" ? "small" : "default" }, selectAllButtonText)))));
779
+ }
780
+ static get is() { return "ic-menu-with-multi"; }
781
+ static get encapsulation() { return "scoped"; }
782
+ static get originalStyleUrls() {
783
+ return {
784
+ "$": ["ic-menu.css"]
785
+ };
786
+ }
787
+ static get styleUrls() {
788
+ return {
789
+ "$": ["ic-menu.css"]
790
+ };
791
+ }
792
+ static get properties() {
793
+ return {
794
+ "activationType": {
795
+ "type": "string",
796
+ "mutable": false,
797
+ "complexType": {
798
+ "original": "IcActivationTypes",
799
+ "resolved": "\"automatic\" | \"manual\"",
800
+ "references": {
801
+ "IcActivationTypes": {
802
+ "location": "import",
803
+ "path": "@ukic/web-components/dist/types/utils/types",
804
+ "id": "../web-components/dist/types/utils/types.d.ts::IcActivationTypes"
805
+ }
806
+ }
807
+ },
808
+ "required": false,
809
+ "optional": true,
810
+ "docs": {
811
+ "tags": [],
812
+ "text": "Determines whether options manually set as values (by pressing 'Enter') when they receive focus using keyboard navigation."
813
+ },
814
+ "attribute": "activation-type",
815
+ "reflect": false,
816
+ "defaultValue": "\"automatic\""
817
+ },
818
+ "anchorEl": {
819
+ "type": "unknown",
820
+ "mutable": false,
821
+ "complexType": {
822
+ "original": "HTMLElement",
823
+ "resolved": "HTMLElement",
824
+ "references": {
825
+ "HTMLElement": {
826
+ "location": "global",
827
+ "id": "global::HTMLElement"
828
+ }
829
+ }
830
+ },
831
+ "required": true,
832
+ "optional": false,
833
+ "docs": {
834
+ "tags": [],
835
+ "text": "The reference to an anchor element the menu will position itself from when rendered."
836
+ }
837
+ },
838
+ "autoFocusOnSelected": {
839
+ "type": "boolean",
840
+ "mutable": false,
841
+ "complexType": {
842
+ "original": "boolean",
843
+ "resolved": "boolean",
844
+ "references": {}
845
+ },
846
+ "required": false,
847
+ "optional": false,
848
+ "docs": {
849
+ "tags": [{
850
+ "name": "internal",
851
+ "text": "If `true`, autofocus will be applied on selected item when menu is open."
852
+ }],
853
+ "text": ""
854
+ },
855
+ "attribute": "auto-focus-on-selected",
856
+ "reflect": false,
857
+ "defaultValue": "true"
858
+ },
859
+ "closeOnSelect": {
860
+ "type": "boolean",
861
+ "mutable": false,
862
+ "complexType": {
863
+ "original": "boolean",
864
+ "resolved": "boolean",
865
+ "references": {}
866
+ },
867
+ "required": false,
868
+ "optional": false,
869
+ "docs": {
870
+ "tags": [],
871
+ "text": "If `true`, the menu will close when an option is selected."
872
+ },
873
+ "attribute": "close-on-select",
874
+ "reflect": false,
875
+ "defaultValue": "true"
876
+ },
877
+ "fullWidth": {
878
+ "type": "boolean",
879
+ "mutable": false,
880
+ "complexType": {
881
+ "original": "boolean",
882
+ "resolved": "boolean",
883
+ "references": {}
884
+ },
885
+ "required": false,
886
+ "optional": false,
887
+ "docs": {
888
+ "tags": [],
889
+ "text": "If `true`, the menu will fill the width of the container."
890
+ },
891
+ "attribute": "full-width",
892
+ "reflect": false,
893
+ "defaultValue": "false"
894
+ },
895
+ "inputEl": {
896
+ "type": "unknown",
897
+ "mutable": false,
898
+ "complexType": {
899
+ "original": "HTMLElement",
900
+ "resolved": "HTMLElement",
901
+ "references": {
902
+ "HTMLElement": {
903
+ "location": "global",
904
+ "id": "global::HTMLElement"
905
+ }
906
+ }
907
+ },
908
+ "required": true,
909
+ "optional": false,
910
+ "docs": {
911
+ "tags": [],
912
+ "text": "The reference to the input element."
913
+ }
914
+ },
915
+ "inputLabel": {
916
+ "type": "string",
917
+ "mutable": false,
918
+ "complexType": {
919
+ "original": "string",
920
+ "resolved": "string",
921
+ "references": {}
922
+ },
923
+ "required": true,
924
+ "optional": false,
925
+ "docs": {
926
+ "tags": [],
927
+ "text": "The label for the input element."
928
+ },
929
+ "attribute": "input-label",
930
+ "reflect": false
931
+ },
932
+ "labelField": {
933
+ "type": "string",
934
+ "mutable": false,
935
+ "complexType": {
936
+ "original": "string",
937
+ "resolved": "string",
938
+ "references": {}
939
+ },
940
+ "required": false,
941
+ "optional": false,
942
+ "docs": {
943
+ "tags": [],
944
+ "text": "The custom name for the label field for IcMenuOption."
945
+ },
946
+ "attribute": "label-field",
947
+ "reflect": false,
948
+ "defaultValue": "\"label\""
949
+ },
950
+ "menuId": {
951
+ "type": "string",
952
+ "mutable": false,
953
+ "complexType": {
954
+ "original": "string",
955
+ "resolved": "string",
956
+ "references": {}
957
+ },
958
+ "required": true,
959
+ "optional": false,
960
+ "docs": {
961
+ "tags": [],
962
+ "text": "The ID of the menu."
963
+ },
964
+ "attribute": "menu-id",
965
+ "reflect": false
966
+ },
967
+ "open": {
968
+ "type": "boolean",
969
+ "mutable": false,
970
+ "complexType": {
971
+ "original": "boolean",
972
+ "resolved": "boolean",
973
+ "references": {}
974
+ },
975
+ "required": true,
976
+ "optional": false,
977
+ "docs": {
978
+ "tags": [],
979
+ "text": "If `true`, the menu will be displayed open."
980
+ },
981
+ "attribute": "open",
982
+ "reflect": true
983
+ },
984
+ "parentEl": {
985
+ "type": "unknown",
986
+ "mutable": false,
987
+ "complexType": {
988
+ "original": "HTMLElement",
989
+ "resolved": "HTMLElement",
990
+ "references": {
991
+ "HTMLElement": {
992
+ "location": "global",
993
+ "id": "global::HTMLElement"
994
+ }
995
+ }
996
+ },
997
+ "required": false,
998
+ "optional": true,
999
+ "docs": {
1000
+ "tags": [{
1001
+ "name": "internal",
1002
+ "text": "- The parent element if ic-menu is nested inside another component."
1003
+ }],
1004
+ "text": ""
1005
+ }
1006
+ },
1007
+ "searchMode": {
1008
+ "type": "string",
1009
+ "mutable": false,
1010
+ "complexType": {
1011
+ "original": "IcSearchBarSearchModes",
1012
+ "resolved": "\"navigation\" | \"query\"",
1013
+ "references": {
1014
+ "IcSearchBarSearchModes": {
1015
+ "location": "import",
1016
+ "path": "@ukic/web-components/dist/types/components",
1017
+ "id": "../web-components/dist/types/components.d.ts::IcSearchBarSearchModes"
1018
+ }
1019
+ }
1020
+ },
1021
+ "required": false,
1022
+ "optional": true,
1023
+ "docs": {
1024
+ "tags": [],
1025
+ "text": "Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches."
1026
+ },
1027
+ "attribute": "search-mode",
1028
+ "reflect": false,
1029
+ "defaultValue": "\"navigation\""
1030
+ },
1031
+ "selectOnEnter": {
1032
+ "type": "boolean",
1033
+ "mutable": false,
1034
+ "complexType": {
1035
+ "original": "boolean",
1036
+ "resolved": "boolean",
1037
+ "references": {}
1038
+ },
1039
+ "required": false,
1040
+ "optional": true,
1041
+ "docs": {
1042
+ "tags": [{
1043
+ "name": "internal",
1044
+ "text": "If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown."
1045
+ }],
1046
+ "text": ""
1047
+ },
1048
+ "attribute": "select-on-enter",
1049
+ "reflect": false,
1050
+ "defaultValue": "false"
1051
+ },
1052
+ "size": {
1053
+ "type": "string",
1054
+ "mutable": false,
1055
+ "complexType": {
1056
+ "original": "IcSizes",
1057
+ "resolved": "\"default\" | \"large\" | \"small\"",
1058
+ "references": {
1059
+ "IcSizes": {
1060
+ "location": "import",
1061
+ "path": "@ukic/web-components/dist/types/utils/types",
1062
+ "id": "../web-components/dist/types/utils/types.d.ts::IcSizes"
1063
+ }
1064
+ }
1065
+ },
1066
+ "required": false,
1067
+ "optional": true,
1068
+ "docs": {
1069
+ "tags": [],
1070
+ "text": "The size of the menu."
1071
+ },
1072
+ "attribute": "size",
1073
+ "reflect": false,
1074
+ "defaultValue": "\"default\""
1075
+ },
1076
+ "small": {
1077
+ "type": "boolean",
1078
+ "mutable": false,
1079
+ "complexType": {
1080
+ "original": "boolean",
1081
+ "resolved": "boolean",
1082
+ "references": {}
1083
+ },
1084
+ "required": false,
1085
+ "optional": true,
1086
+ "docs": {
1087
+ "tags": [{
1088
+ "name": "deprecated",
1089
+ "text": "This prop should not be used anymore. Set prop `size` to \"small\" instead."
1090
+ }],
1091
+ "text": ""
1092
+ },
1093
+ "attribute": "small",
1094
+ "reflect": false,
1095
+ "defaultValue": "false"
1096
+ },
1097
+ "options": {
1098
+ "type": "unknown",
1099
+ "mutable": false,
1100
+ "complexType": {
1101
+ "original": "IcMenuOption[]",
1102
+ "resolved": "IcMenuOption[]",
1103
+ "references": {
1104
+ "IcMenuOption": {
1105
+ "location": "import",
1106
+ "path": "@ukic/web-components/dist/types/utils/types",
1107
+ "id": "../web-components/dist/types/utils/types.d.ts::IcMenuOption"
1108
+ }
1109
+ }
1110
+ },
1111
+ "required": true,
1112
+ "optional": false,
1113
+ "docs": {
1114
+ "tags": [],
1115
+ "text": "The possible menu selection options."
1116
+ }
1117
+ },
1118
+ "value": {
1119
+ "type": "string",
1120
+ "mutable": true,
1121
+ "complexType": {
1122
+ "original": "string | string[]",
1123
+ "resolved": "string | string[]",
1124
+ "references": {}
1125
+ },
1126
+ "required": true,
1127
+ "optional": false,
1128
+ "docs": {
1129
+ "tags": [],
1130
+ "text": "The value of the currently selected option - or array of values (if multiple options allowed)."
1131
+ },
1132
+ "attribute": "value",
1133
+ "reflect": false
1134
+ },
1135
+ "valueField": {
1136
+ "type": "string",
1137
+ "mutable": false,
1138
+ "complexType": {
1139
+ "original": "string",
1140
+ "resolved": "string",
1141
+ "references": {}
1142
+ },
1143
+ "required": false,
1144
+ "optional": false,
1145
+ "docs": {
1146
+ "tags": [],
1147
+ "text": "The custom name for the value field for IcMenuOption."
1148
+ },
1149
+ "attribute": "value-field",
1150
+ "reflect": false,
1151
+ "defaultValue": "\"value\""
1152
+ }
1153
+ };
1154
+ }
1155
+ static get states() {
1156
+ return {
1157
+ "focusFromSearchKeypress": {},
1158
+ "initialOptionsListRender": {},
1159
+ "keyboardNav": {},
1160
+ "optionHighlighted": {},
1161
+ "preventIncorrectTabOrder": {},
1162
+ "menuOptions": {}
1163
+ };
1164
+ }
1165
+ static get events() {
1166
+ return [{
1167
+ "method": "menuKeyPress",
1168
+ "name": "menuKeyPress",
1169
+ "bubbles": true,
1170
+ "cancelable": true,
1171
+ "composed": true,
1172
+ "docs": {
1173
+ "tags": [{
1174
+ "name": "internal",
1175
+ "text": "Emitted when key is pressed while menu is open."
1176
+ }],
1177
+ "text": ""
1178
+ },
1179
+ "complexType": {
1180
+ "original": "{ isNavKey: boolean; key: string }",
1181
+ "resolved": "{ isNavKey: boolean; key: string; }",
1182
+ "references": {}
1183
+ }
1184
+ }, {
1185
+ "method": "menuOptionId",
1186
+ "name": "menuOptionId",
1187
+ "bubbles": true,
1188
+ "cancelable": true,
1189
+ "composed": true,
1190
+ "docs": {
1191
+ "tags": [{
1192
+ "name": "internal",
1193
+ "text": "Emitted when an option has been highlighted."
1194
+ }],
1195
+ "text": ""
1196
+ },
1197
+ "complexType": {
1198
+ "original": "IcMenuOptionIdEventDetail",
1199
+ "resolved": "IcMenuOptionIdEventDetail",
1200
+ "references": {
1201
+ "IcMenuOptionIdEventDetail": {
1202
+ "location": "import",
1203
+ "path": "@ukic/web-components/dist/types/components",
1204
+ "id": "../web-components/dist/types/components.d.ts::IcMenuOptionIdEventDetail"
1205
+ }
1206
+ }
1207
+ }
1208
+ }, {
1209
+ "method": "menuOptionSelect",
1210
+ "name": "menuOptionSelect",
1211
+ "bubbles": true,
1212
+ "cancelable": true,
1213
+ "composed": true,
1214
+ "docs": {
1215
+ "tags": [{
1216
+ "name": "internal",
1217
+ "text": "Emitted when an option is selected."
1218
+ }],
1219
+ "text": ""
1220
+ },
1221
+ "complexType": {
1222
+ "original": "IcOptionSelectEventDetail",
1223
+ "resolved": "IcOptionSelectEventDetail",
1224
+ "references": {
1225
+ "IcOptionSelectEventDetail": {
1226
+ "location": "import",
1227
+ "path": "@ukic/web-components/dist/types/components",
1228
+ "id": "../web-components/dist/types/components.d.ts::IcOptionSelectEventDetail"
1229
+ }
1230
+ }
1231
+ }
1232
+ }, {
1233
+ "method": "menuOptionSelectAll",
1234
+ "name": "menuOptionSelectAll",
1235
+ "bubbles": true,
1236
+ "cancelable": true,
1237
+ "composed": true,
1238
+ "docs": {
1239
+ "tags": [{
1240
+ "name": "internal",
1241
+ "text": "Emitted when all options are selected or deselected."
1242
+ }],
1243
+ "text": ""
1244
+ },
1245
+ "complexType": {
1246
+ "original": "{ select: boolean }",
1247
+ "resolved": "{ select: boolean; }",
1248
+ "references": {}
1249
+ }
1250
+ }, {
1251
+ "method": "menuStateChange",
1252
+ "name": "menuStateChange",
1253
+ "bubbles": true,
1254
+ "cancelable": true,
1255
+ "composed": true,
1256
+ "docs": {
1257
+ "tags": [{
1258
+ "name": "internal",
1259
+ "text": "Emitted when state of menu changes (i.e. open or close)."
1260
+ }],
1261
+ "text": ""
1262
+ },
1263
+ "complexType": {
1264
+ "original": "IcMenuChangeEventDetail",
1265
+ "resolved": "IcMenuChangeEventDetail",
1266
+ "references": {
1267
+ "IcMenuChangeEventDetail": {
1268
+ "location": "import",
1269
+ "path": "@ukic/web-components/dist/types/components",
1270
+ "id": "../web-components/dist/types/components.d.ts::IcMenuChangeEventDetail"
1271
+ }
1272
+ }
1273
+ }
1274
+ }, {
1275
+ "method": "retryButtonClicked",
1276
+ "name": "retryButtonClicked",
1277
+ "bubbles": true,
1278
+ "cancelable": true,
1279
+ "composed": true,
1280
+ "docs": {
1281
+ "tags": [{
1282
+ "name": "internal",
1283
+ "text": "Emitted when the retry button is clicked."
1284
+ }],
1285
+ "text": ""
1286
+ },
1287
+ "complexType": {
1288
+ "original": "IcValueEventDetail",
1289
+ "resolved": "IcValueEventDetail",
1290
+ "references": {
1291
+ "IcValueEventDetail": {
1292
+ "location": "import",
1293
+ "path": "../../utils/types",
1294
+ "id": "src/utils/types.ts::IcValueEventDetail"
1295
+ }
1296
+ }
1297
+ }
1298
+ }, {
1299
+ "method": "timeoutBlur",
1300
+ "name": "timeoutBlur",
1301
+ "bubbles": true,
1302
+ "cancelable": true,
1303
+ "composed": true,
1304
+ "docs": {
1305
+ "tags": [{
1306
+ "name": "internal",
1307
+ "text": "Emitted when the timeout menu loses focus."
1308
+ }],
1309
+ "text": ""
1310
+ },
1311
+ "complexType": {
1312
+ "original": "{ ev: FocusEvent }",
1313
+ "resolved": "{ ev: FocusEvent; }",
1314
+ "references": {
1315
+ "FocusEvent": {
1316
+ "location": "global",
1317
+ "id": "global::FocusEvent"
1318
+ }
1319
+ }
1320
+ }
1321
+ }, {
1322
+ "method": "ungroupedOptionsSet",
1323
+ "name": "ungroupedOptionsSet",
1324
+ "bubbles": true,
1325
+ "cancelable": true,
1326
+ "composed": true,
1327
+ "docs": {
1328
+ "tags": [{
1329
+ "name": "internal",
1330
+ "text": "Emitted when the ungrouped options have been set."
1331
+ }],
1332
+ "text": ""
1333
+ },
1334
+ "complexType": {
1335
+ "original": "{ options: IcMenuOption[] }",
1336
+ "resolved": "{ options: IcMenuOption[]; }",
1337
+ "references": {
1338
+ "IcMenuOption": {
1339
+ "location": "import",
1340
+ "path": "@ukic/web-components/dist/types/utils/types",
1341
+ "id": "../web-components/dist/types/utils/types.d.ts::IcMenuOption"
1342
+ }
1343
+ }
1344
+ }
1345
+ }];
1346
+ }
1347
+ static get methods() {
1348
+ return {
1349
+ "handleClickOpen": {
1350
+ "complexType": {
1351
+ "signature": "() => Promise<void>",
1352
+ "parameters": [],
1353
+ "references": {
1354
+ "Promise": {
1355
+ "location": "global",
1356
+ "id": "global::Promise"
1357
+ }
1358
+ },
1359
+ "return": "Promise<void>"
1360
+ },
1361
+ "docs": {
1362
+ "text": "",
1363
+ "tags": [{
1364
+ "name": "internal",
1365
+ "text": "If menu is opened with the mouse, emit menuStateChange custom event."
1366
+ }]
1367
+ }
1368
+ },
1369
+ "handleKeyboardOpen": {
1370
+ "complexType": {
1371
+ "signature": "(event: KeyboardEvent) => Promise<void>",
1372
+ "parameters": [{
1373
+ "name": "event",
1374
+ "type": "KeyboardEvent",
1375
+ "docs": "- keyboard event"
1376
+ }],
1377
+ "references": {
1378
+ "Promise": {
1379
+ "location": "global",
1380
+ "id": "global::Promise"
1381
+ },
1382
+ "KeyboardEvent": {
1383
+ "location": "global",
1384
+ "id": "global::KeyboardEvent"
1385
+ }
1386
+ },
1387
+ "return": "Promise<void>"
1388
+ },
1389
+ "docs": {
1390
+ "text": "Used alongside activationType\nIf menu is opened via keyboard navigation (i.e. Enter, ArrowUp or ArrowDown), emit optionSelect custom event.",
1391
+ "tags": [{
1392
+ "name": "param",
1393
+ "text": "event - keyboard event"
1394
+ }]
1395
+ }
1396
+ },
1397
+ "handleSetFirstOption": {
1398
+ "complexType": {
1399
+ "signature": "() => Promise<void>",
1400
+ "parameters": [],
1401
+ "references": {
1402
+ "Promise": {
1403
+ "location": "global",
1404
+ "id": "global::Promise"
1405
+ }
1406
+ },
1407
+ "return": "Promise<void>"
1408
+ },
1409
+ "docs": {
1410
+ "text": "",
1411
+ "tags": [{
1412
+ "name": "internal",
1413
+ "text": "Used to highlight the first option in the menu."
1414
+ }]
1415
+ }
1416
+ },
1417
+ "initPopperJs": {
1418
+ "complexType": {
1419
+ "signature": "(anchor: HTMLElement) => Promise<void>",
1420
+ "parameters": [{
1421
+ "name": "anchor",
1422
+ "type": "HTMLElement",
1423
+ "docs": ""
1424
+ }],
1425
+ "references": {
1426
+ "Promise": {
1427
+ "location": "global",
1428
+ "id": "global::Promise"
1429
+ },
1430
+ "HTMLElement": {
1431
+ "location": "global",
1432
+ "id": "global::HTMLElement"
1433
+ }
1434
+ },
1435
+ "return": "Promise<void>"
1436
+ },
1437
+ "docs": {
1438
+ "text": "",
1439
+ "tags": [{
1440
+ "name": "internal",
1441
+ "text": "Used to initialize popperJS with an anchor element.\n5/12/2023: Tested with Floating UI, however, discovered inconsistent\nboundary behaviour so sticking with PopperJS."
1442
+ }]
1443
+ }
1444
+ }
1445
+ };
1446
+ }
1447
+ static get elementRef() { return "el"; }
1448
+ static get watchers() {
1449
+ return [{
1450
+ "propName": "open",
1451
+ "methodName": "watchOpenHandler"
1452
+ }, {
1453
+ "propName": "options",
1454
+ "methodName": "watchOptionsHandler"
1455
+ }];
1456
+ }
1457
+ }
1458
+ //# sourceMappingURL=ic-menu.js.map