@ukic/web-components 2.19.0 → 2.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (389) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-88e018cf.js → helpers-6b6c212d.js} +54 -98
  3. package/dist/cjs/helpers-6b6c212d.js.map +1 -0
  4. package/dist/cjs/ic-accordion-group.cjs.entry.js +3 -1
  5. package/dist/cjs/ic-accordion-group.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  7. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  8. package/dist/cjs/ic-back-to-top.cjs.entry.js +15 -9
  9. package/dist/cjs/ic-back-to-top.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-badge.cjs.entry.js +55 -77
  11. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +3 -1
  13. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
  15. package/dist/cjs/ic-button_3.cjs.entry.js +2 -2
  16. package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
  17. package/dist/cjs/ic-card.cjs.entry.js +1 -1
  18. package/dist/cjs/ic-checkbox-group.cjs.entry.js +23 -16
  19. package/dist/cjs/ic-checkbox-group.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-checkbox.cjs.entry.js +32 -30
  21. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-chip.cjs.entry.js +21 -31
  23. package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
  25. package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
  26. package/dist/cjs/ic-divider.cjs.entry.js +1 -1
  27. package/dist/cjs/ic-empty-state.cjs.entry.js +1 -1
  28. package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
  29. package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
  30. package/dist/cjs/ic-footer.cjs.entry.js +1 -1
  31. package/dist/cjs/ic-hero.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
  33. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +3 -3
  34. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  35. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-link.cjs.entry.js +2 -2
  37. package/dist/cjs/ic-link.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
  39. package/dist/cjs/ic-menu-item.cjs.entry.js +2 -2
  40. package/dist/cjs/ic-menu-item.cjs.entry.js.map +1 -1
  41. package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
  42. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  43. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  44. package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
  46. package/dist/cjs/ic-pagination-item.cjs.entry.js +2 -2
  47. package/dist/cjs/ic-pagination-item.cjs.entry.js.map +1 -1
  48. package/dist/cjs/ic-pagination.cjs.entry.js +1 -1
  49. package/dist/cjs/ic-popover-menu.cjs.entry.js +3 -2
  50. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  51. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  52. package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
  53. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  54. package/dist/cjs/ic-select.cjs.entry.js +9 -5
  55. package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
  56. package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
  57. package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
  58. package/dist/cjs/ic-step.cjs.entry.js +1 -1
  59. package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
  60. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  61. package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
  62. package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
  63. package/dist/cjs/ic-tab.cjs.entry.js +1 -1
  64. package/dist/cjs/ic-text-field.cjs.entry.js +1 -1
  65. package/dist/cjs/ic-theme.cjs.entry.js +13 -15
  66. package/dist/cjs/ic-theme.cjs.entry.js.map +1 -1
  67. package/dist/cjs/ic-toast.cjs.entry.js +1 -1
  68. package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
  69. package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
  70. package/dist/cjs/ic-typography.cjs.entry.js +2 -2
  71. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  72. package/dist/cjs/loader.cjs.js +1 -1
  73. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js +5 -1
  74. package/dist/collection/components/ic-accordion-group/ic-accordion-group.js.map +1 -1
  75. package/dist/collection/components/ic-back-to-top/ic-back-to-top.css +7 -4
  76. package/dist/collection/components/ic-back-to-top/ic-back-to-top.js +37 -7
  77. package/dist/collection/components/ic-back-to-top/ic-back-to-top.js.map +1 -1
  78. package/dist/collection/components/ic-back-to-top/ic-back-to-top.types.js +2 -0
  79. package/dist/collection/components/ic-back-to-top/ic-back-to-top.types.js.map +1 -0
  80. package/dist/collection/components/ic-back-to-top/test/basic/ic-back-to-top.spec.js +9 -0
  81. package/dist/collection/components/ic-back-to-top/test/basic/ic-back-to-top.spec.js.map +1 -1
  82. package/dist/collection/components/ic-badge/ic-badge.js +64 -78
  83. package/dist/collection/components/ic-badge/ic-badge.js.map +1 -1
  84. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js +2 -0
  85. package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.js.map +1 -1
  86. package/dist/collection/components/ic-checkbox/ic-checkbox.js +31 -29
  87. package/dist/collection/components/ic-checkbox/ic-checkbox.js.map +1 -1
  88. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js +27 -15
  89. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.js.map +1 -1
  90. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js +12 -0
  91. package/dist/collection/components/ic-checkbox-group/test/basic/ic-checkbox-group.spec.js.map +1 -1
  92. package/dist/collection/components/ic-chip/ic-chip.css +5 -1
  93. package/dist/collection/components/ic-chip/ic-chip.js +20 -30
  94. package/dist/collection/components/ic-chip/ic-chip.js.map +1 -1
  95. package/dist/collection/components/ic-link/ic-link.css +1 -1
  96. package/dist/collection/components/ic-menu/ic-menu.js +2 -2
  97. package/dist/collection/components/ic-menu/ic-menu.js.map +1 -1
  98. package/dist/collection/components/ic-menu-item/ic-menu-item.js +2 -2
  99. package/dist/collection/components/ic-menu-item/ic-menu-item.js.map +1 -1
  100. package/dist/collection/components/ic-pagination/ic-pagination.types.js.map +1 -1
  101. package/dist/collection/components/ic-pagination-item/ic-pagination-item.css +1 -1
  102. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +2 -1
  103. package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
  104. package/dist/collection/components/ic-select/ic-select.js +8 -4
  105. package/dist/collection/components/ic-select/ic-select.js.map +1 -1
  106. package/dist/collection/components/ic-theme/ic-theme.js +21 -17
  107. package/dist/collection/components/ic-theme/ic-theme.js.map +1 -1
  108. package/dist/collection/components/ic-tooltip/ic-tooltip.css +7 -0
  109. package/dist/collection/components/ic-typography/ic-typography.css +11 -2
  110. package/dist/collection/utils/helpers.js +54 -101
  111. package/dist/collection/utils/helpers.js.map +1 -1
  112. package/dist/components/helpers.js +53 -96
  113. package/dist/components/helpers.js.map +1 -1
  114. package/dist/components/ic-accordion-group.js +2 -1
  115. package/dist/components/ic-accordion-group.js.map +1 -1
  116. package/dist/components/ic-back-to-top.js +22 -9
  117. package/dist/components/ic-back-to-top.js.map +1 -1
  118. package/dist/components/ic-badge.js +59 -77
  119. package/dist/components/ic-badge.js.map +1 -1
  120. package/dist/components/ic-breadcrumb-group.js +2 -0
  121. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  122. package/dist/components/ic-checkbox-group.js +26 -16
  123. package/dist/components/ic-checkbox-group.js.map +1 -1
  124. package/dist/components/ic-checkbox.js +32 -30
  125. package/dist/components/ic-checkbox.js.map +1 -1
  126. package/dist/components/ic-chip.js +21 -31
  127. package/dist/components/ic-chip.js.map +1 -1
  128. package/dist/components/ic-divider2.js +1 -1
  129. package/dist/components/ic-footer-link-group.js +1 -1
  130. package/dist/components/ic-footer-link.js +1 -1
  131. package/dist/components/ic-footer.js +1 -1
  132. package/dist/components/ic-hero.js +1 -1
  133. package/dist/components/ic-horizontal-scroll2.js +1 -1
  134. package/dist/components/ic-link2.js +1 -1
  135. package/dist/components/ic-link2.js.map +1 -1
  136. package/dist/components/ic-menu-item2.js +2 -2
  137. package/dist/components/ic-menu-item2.js.map +1 -1
  138. package/dist/components/ic-menu2.js +2 -2
  139. package/dist/components/ic-menu2.js.map +1 -1
  140. package/dist/components/ic-navigation-button.js +1 -1
  141. package/dist/components/ic-navigation-group.js +1 -1
  142. package/dist/components/ic-navigation-item.js +1 -1
  143. package/dist/components/ic-navigation-menu2.js +1 -1
  144. package/dist/components/ic-pagination-item2.js +1 -1
  145. package/dist/components/ic-pagination-item2.js.map +1 -1
  146. package/dist/components/ic-popover-menu.js +3 -2
  147. package/dist/components/ic-popover-menu.js.map +1 -1
  148. package/dist/components/ic-radio-option.js +1 -1
  149. package/dist/components/ic-search-bar.js +1 -1
  150. package/dist/components/ic-select.js +9 -5
  151. package/dist/components/ic-select.js.map +1 -1
  152. package/dist/components/ic-side-navigation.js +1 -1
  153. package/dist/components/ic-stepper.js +1 -1
  154. package/dist/components/ic-text-field2.js +1 -1
  155. package/dist/components/ic-theme.js +13 -15
  156. package/dist/components/ic-theme.js.map +1 -1
  157. package/dist/components/ic-toast.js +1 -1
  158. package/dist/components/ic-tooltip2.js +1 -1
  159. package/dist/components/ic-tooltip2.js.map +1 -1
  160. package/dist/components/ic-top-navigation.js +1 -1
  161. package/dist/components/ic-typography2.js +1 -1
  162. package/dist/components/ic-typography2.js.map +1 -1
  163. package/dist/core/core.css +2 -2
  164. package/dist/core/core.esm.js +1 -1
  165. package/dist/core/core.esm.js.map +1 -1
  166. package/dist/core/p-0029cbe8.entry.js +2 -0
  167. package/dist/core/{p-24bed047.entry.js.map → p-0029cbe8.entry.js.map} +1 -1
  168. package/dist/core/{p-d19d157d.entry.js → p-01710aab.entry.js} +2 -2
  169. package/dist/core/{p-d19d157d.entry.js.map → p-01710aab.entry.js.map} +1 -1
  170. package/dist/core/p-088c78d6.entry.js +2 -0
  171. package/dist/core/{p-f8df0716.entry.js.map → p-088c78d6.entry.js.map} +1 -1
  172. package/dist/core/{p-6f9dcfb5.entry.js → p-10bc436c.entry.js} +2 -2
  173. package/dist/core/{p-8fe2b073.entry.js → p-159562b8.entry.js} +2 -2
  174. package/dist/core/{p-e8e0fa96.entry.js → p-169ee4ae.entry.js} +2 -2
  175. package/dist/core/p-169ee4ae.entry.js.map +1 -0
  176. package/dist/core/{p-8b65be1e.entry.js → p-20ad129d.entry.js} +2 -2
  177. package/dist/core/{p-8e37e832.entry.js → p-28417be0.entry.js} +2 -2
  178. package/dist/core/p-2afc16d6.entry.js +2 -0
  179. package/dist/core/p-2afc16d6.entry.js.map +1 -0
  180. package/dist/core/{p-04cc2b25.entry.js → p-2eca2dd4.entry.js} +2 -2
  181. package/dist/core/p-302167d7.entry.js +2 -0
  182. package/dist/core/p-302167d7.entry.js.map +1 -0
  183. package/dist/core/{p-692ccc73.entry.js → p-30c2e138.entry.js} +2 -2
  184. package/dist/core/p-31a4d154.entry.js +2 -0
  185. package/dist/core/p-31a4d154.entry.js.map +1 -0
  186. package/dist/core/{p-1b1270a1.entry.js → p-3841b57e.entry.js} +2 -2
  187. package/dist/core/p-3841b57e.entry.js.map +1 -0
  188. package/dist/core/{p-1197f0d4.entry.js → p-3c8b1aac.entry.js} +2 -2
  189. package/dist/core/{p-051583a5.entry.js → p-3caef79e.entry.js} +2 -2
  190. package/dist/core/{p-d7f4779d.entry.js → p-3d41246b.entry.js} +2 -2
  191. package/dist/core/{p-8153def1.entry.js → p-3f532072.entry.js} +2 -2
  192. package/dist/core/{p-5481b048.entry.js → p-40f856bd.entry.js} +2 -2
  193. package/dist/core/{p-b451f27c.entry.js → p-4212d1ba.entry.js} +2 -2
  194. package/dist/core/p-47bb180f.entry.js +2 -0
  195. package/dist/core/p-47bb180f.entry.js.map +1 -0
  196. package/dist/core/{p-8ed04819.entry.js → p-5058cfa5.entry.js} +2 -2
  197. package/dist/core/{p-2b326b17.entry.js → p-53321e37.entry.js} +2 -2
  198. package/dist/core/{p-c3acbefe.entry.js → p-54bd7d41.entry.js} +2 -2
  199. package/dist/core/{p-c3acbefe.entry.js.map → p-54bd7d41.entry.js.map} +1 -1
  200. package/dist/core/p-559226eb.entry.js +2 -0
  201. package/dist/core/p-559226eb.entry.js.map +1 -0
  202. package/dist/core/p-5bb40791.js +2 -0
  203. package/dist/core/p-5bb40791.js.map +1 -0
  204. package/dist/core/{p-bceaf300.entry.js → p-63cadc85.entry.js} +2 -2
  205. package/dist/core/{p-1a6fab3e.entry.js → p-6688b8d6.entry.js} +2 -2
  206. package/dist/core/{p-e5957ce0.entry.js → p-7b60082f.entry.js} +2 -2
  207. package/dist/core/p-7c064275.entry.js +2 -0
  208. package/dist/core/{p-74f9082d.entry.js.map → p-7c064275.entry.js.map} +1 -1
  209. package/dist/core/{p-346578e4.entry.js → p-7fc43ade.entry.js} +2 -2
  210. package/dist/core/{p-3f53446c.entry.js → p-8073cda6.entry.js} +2 -2
  211. package/dist/core/{p-fd737b7e.entry.js → p-8085a9c7.entry.js} +2 -2
  212. package/dist/core/{p-ba1c3cf7.entry.js → p-8d4bf735.entry.js} +2 -2
  213. package/dist/core/{p-32e2ae6f.entry.js → p-906248f0.entry.js} +2 -2
  214. package/dist/core/{p-731515cf.entry.js → p-98bebf11.entry.js} +2 -2
  215. package/dist/core/{p-2f91e86a.entry.js → p-9d12998e.entry.js} +2 -2
  216. package/dist/core/{p-a13236ef.entry.js → p-9f6bc1d4.entry.js} +2 -2
  217. package/dist/core/p-9f6bc1d4.entry.js.map +1 -0
  218. package/dist/core/{p-03796d51.entry.js → p-a4f52fc0.entry.js} +2 -2
  219. package/dist/core/{p-ba40f44a.entry.js → p-a5758865.entry.js} +2 -2
  220. package/dist/core/{p-ba40f44a.entry.js.map → p-a5758865.entry.js.map} +1 -1
  221. package/dist/core/{p-328bc6a2.entry.js → p-aa41ab55.entry.js} +2 -2
  222. package/dist/core/p-aa41ab55.entry.js.map +1 -0
  223. package/dist/core/{p-f50a57f3.entry.js → p-b283bddd.entry.js} +2 -2
  224. package/dist/core/p-b403c2f8.entry.js +2 -0
  225. package/dist/core/p-b403c2f8.entry.js.map +1 -0
  226. package/dist/core/{p-498273cb.entry.js → p-b75ec5d6.entry.js} +2 -2
  227. package/dist/core/p-b75ec5d6.entry.js.map +1 -0
  228. package/dist/core/{p-1c3b619f.entry.js → p-b7a49514.entry.js} +2 -2
  229. package/dist/core/{p-2d4e7985.entry.js → p-c1202776.entry.js} +2 -2
  230. package/dist/core/{p-af5eacc1.entry.js → p-c884dc80.entry.js} +2 -2
  231. package/dist/core/{p-e68485ee.entry.js → p-e449f058.entry.js} +2 -2
  232. package/dist/core/p-e449f058.entry.js.map +1 -0
  233. package/dist/core/{p-adf468f4.entry.js → p-e8bf8ad7.entry.js} +2 -2
  234. package/dist/core/p-e8bf8ad7.entry.js.map +1 -0
  235. package/dist/core/p-f1a7abd0.entry.js +2 -0
  236. package/dist/core/{p-078f7f23.entry.js.map → p-f1a7abd0.entry.js.map} +1 -1
  237. package/dist/core/{p-52a4c223.entry.js → p-f278107f.entry.js} +2 -2
  238. package/dist/core/{p-c919c571.entry.js → p-fe4e3486.entry.js} +2 -2
  239. package/dist/core/{p-4f3fe190.entry.js → p-fee47770.entry.js} +2 -2
  240. package/dist/esm/core.js +1 -1
  241. package/dist/esm/{helpers-24ba0b83.js → helpers-3f9bbeca.js} +54 -97
  242. package/dist/esm/helpers-3f9bbeca.js.map +1 -0
  243. package/dist/esm/ic-accordion-group.entry.js +3 -1
  244. package/dist/esm/ic-accordion-group.entry.js.map +1 -1
  245. package/dist/esm/ic-accordion.entry.js +1 -1
  246. package/dist/esm/ic-alert.entry.js +1 -1
  247. package/dist/esm/ic-back-to-top.entry.js +15 -9
  248. package/dist/esm/ic-back-to-top.entry.js.map +1 -1
  249. package/dist/esm/ic-badge.entry.js +55 -77
  250. package/dist/esm/ic-badge.entry.js.map +1 -1
  251. package/dist/esm/ic-breadcrumb-group.entry.js +3 -1
  252. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  253. package/dist/esm/ic-breadcrumb.entry.js +1 -1
  254. package/dist/esm/ic-button_3.entry.js +2 -2
  255. package/dist/esm/ic-button_3.entry.js.map +1 -1
  256. package/dist/esm/ic-card.entry.js +1 -1
  257. package/dist/esm/ic-checkbox-group.entry.js +23 -16
  258. package/dist/esm/ic-checkbox-group.entry.js.map +1 -1
  259. package/dist/esm/ic-checkbox.entry.js +32 -30
  260. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  261. package/dist/esm/ic-chip.entry.js +21 -31
  262. package/dist/esm/ic-chip.entry.js.map +1 -1
  263. package/dist/esm/ic-data-row.entry.js +1 -1
  264. package/dist/esm/ic-dialog.entry.js +1 -1
  265. package/dist/esm/ic-divider.entry.js +1 -1
  266. package/dist/esm/ic-empty-state.entry.js +1 -1
  267. package/dist/esm/ic-footer-link-group.entry.js +1 -1
  268. package/dist/esm/ic-footer-link.entry.js +1 -1
  269. package/dist/esm/ic-footer.entry.js +1 -1
  270. package/dist/esm/ic-hero.entry.js +1 -1
  271. package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
  272. package/dist/esm/ic-input-component-container_3.entry.js +3 -3
  273. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  274. package/dist/esm/ic-input-label_2.entry.js +1 -1
  275. package/dist/esm/ic-link.entry.js +2 -2
  276. package/dist/esm/ic-link.entry.js.map +1 -1
  277. package/dist/esm/ic-menu-group.entry.js +1 -1
  278. package/dist/esm/ic-menu-item.entry.js +2 -2
  279. package/dist/esm/ic-menu-item.entry.js.map +1 -1
  280. package/dist/esm/ic-navigation-button.entry.js +1 -1
  281. package/dist/esm/ic-navigation-group.entry.js +1 -1
  282. package/dist/esm/ic-navigation-item.entry.js +1 -1
  283. package/dist/esm/ic-navigation-menu.entry.js +1 -1
  284. package/dist/esm/ic-page-header.entry.js +1 -1
  285. package/dist/esm/ic-pagination-item.entry.js +2 -2
  286. package/dist/esm/ic-pagination-item.entry.js.map +1 -1
  287. package/dist/esm/ic-pagination.entry.js +1 -1
  288. package/dist/esm/ic-popover-menu.entry.js +3 -2
  289. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  290. package/dist/esm/ic-radio-group.entry.js +1 -1
  291. package/dist/esm/ic-radio-option.entry.js +1 -1
  292. package/dist/esm/ic-search-bar.entry.js +1 -1
  293. package/dist/esm/ic-select.entry.js +9 -5
  294. package/dist/esm/ic-select.entry.js.map +1 -1
  295. package/dist/esm/ic-side-navigation.entry.js +1 -1
  296. package/dist/esm/ic-status-tag.entry.js +1 -1
  297. package/dist/esm/ic-step.entry.js +1 -1
  298. package/dist/esm/ic-stepper.entry.js +1 -1
  299. package/dist/esm/ic-switch.entry.js +1 -1
  300. package/dist/esm/ic-tab-group.entry.js +1 -1
  301. package/dist/esm/ic-tab-panel.entry.js +1 -1
  302. package/dist/esm/ic-tab.entry.js +1 -1
  303. package/dist/esm/ic-text-field.entry.js +1 -1
  304. package/dist/esm/ic-theme.entry.js +13 -15
  305. package/dist/esm/ic-theme.entry.js.map +1 -1
  306. package/dist/esm/ic-toast.entry.js +1 -1
  307. package/dist/esm/ic-toggle-button.entry.js +1 -1
  308. package/dist/esm/ic-top-navigation.entry.js +1 -1
  309. package/dist/esm/ic-typography.entry.js +2 -2
  310. package/dist/esm/ic-typography.entry.js.map +1 -1
  311. package/dist/esm/loader.js +1 -1
  312. package/dist/types/components/ic-accordion-group/ic-accordion-group.d.ts +3 -0
  313. package/dist/types/components/ic-back-to-top/ic-back-to-top.d.ts +6 -0
  314. package/dist/types/components/ic-back-to-top/ic-back-to-top.types.d.ts +1 -0
  315. package/dist/types/components/ic-badge/ic-badge.d.ts +6 -0
  316. package/dist/types/components/ic-checkbox/ic-checkbox.d.ts +0 -1
  317. package/dist/types/components/ic-checkbox-group/ic-checkbox-group.d.ts +2 -1
  318. package/dist/types/components/ic-chip/ic-chip.d.ts +1 -1
  319. package/dist/types/components/ic-pagination/ic-pagination.types.d.ts +2 -0
  320. package/dist/types/components/ic-theme/ic-theme.d.ts +2 -3
  321. package/dist/types/components.d.ts +12 -2
  322. package/dist/types/utils/helpers.d.ts +6 -13
  323. package/hydrate/index.js +230 -281
  324. package/package.json +2 -2
  325. package/vscode-data.json +12 -0
  326. package/dist/cjs/helpers-88e018cf.js.map +0 -1
  327. package/dist/collection/components/ic-text-field/test/a11y/ic-text-field.test.a11y.js +0 -33
  328. package/dist/collection/components/ic-text-field/test/a11y/ic-text-field.test.a11y.js.map +0 -1
  329. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.e2e.js +0 -110
  330. package/dist/collection/components/ic-text-field/test/basic/ic-text-field.e2e.js.map +0 -1
  331. package/dist/core/p-00c21dd7.entry.js +0 -2
  332. package/dist/core/p-00c21dd7.entry.js.map +0 -1
  333. package/dist/core/p-02ad4585.entry.js +0 -2
  334. package/dist/core/p-02ad4585.entry.js.map +0 -1
  335. package/dist/core/p-078f7f23.entry.js +0 -2
  336. package/dist/core/p-0c097626.entry.js +0 -2
  337. package/dist/core/p-0c097626.entry.js.map +0 -1
  338. package/dist/core/p-1b1270a1.entry.js.map +0 -1
  339. package/dist/core/p-24bed047.entry.js +0 -2
  340. package/dist/core/p-328bc6a2.entry.js.map +0 -1
  341. package/dist/core/p-44ea7a6d.entry.js +0 -2
  342. package/dist/core/p-44ea7a6d.entry.js.map +0 -1
  343. package/dist/core/p-498273cb.entry.js.map +0 -1
  344. package/dist/core/p-74f9082d.entry.js +0 -2
  345. package/dist/core/p-8bc2a670.entry.js +0 -2
  346. package/dist/core/p-8bc2a670.entry.js.map +0 -1
  347. package/dist/core/p-9f29ab99.entry.js +0 -2
  348. package/dist/core/p-9f29ab99.entry.js.map +0 -1
  349. package/dist/core/p-a13236ef.entry.js.map +0 -1
  350. package/dist/core/p-adf468f4.entry.js.map +0 -1
  351. package/dist/core/p-e4d0d1fb.js +0 -2
  352. package/dist/core/p-e4d0d1fb.js.map +0 -1
  353. package/dist/core/p-e68485ee.entry.js.map +0 -1
  354. package/dist/core/p-e8e0fa96.entry.js.map +0 -1
  355. package/dist/core/p-f8df0716.entry.js +0 -2
  356. package/dist/esm/helpers-24ba0b83.js.map +0 -1
  357. package/dist/types/components/ic-text-field/test/a11y/ic-text-field.test.a11y.d.ts +0 -1
  358. /package/dist/core/{p-6f9dcfb5.entry.js.map → p-10bc436c.entry.js.map} +0 -0
  359. /package/dist/core/{p-8fe2b073.entry.js.map → p-159562b8.entry.js.map} +0 -0
  360. /package/dist/core/{p-8b65be1e.entry.js.map → p-20ad129d.entry.js.map} +0 -0
  361. /package/dist/core/{p-8e37e832.entry.js.map → p-28417be0.entry.js.map} +0 -0
  362. /package/dist/core/{p-04cc2b25.entry.js.map → p-2eca2dd4.entry.js.map} +0 -0
  363. /package/dist/core/{p-692ccc73.entry.js.map → p-30c2e138.entry.js.map} +0 -0
  364. /package/dist/core/{p-1197f0d4.entry.js.map → p-3c8b1aac.entry.js.map} +0 -0
  365. /package/dist/core/{p-051583a5.entry.js.map → p-3caef79e.entry.js.map} +0 -0
  366. /package/dist/core/{p-d7f4779d.entry.js.map → p-3d41246b.entry.js.map} +0 -0
  367. /package/dist/core/{p-8153def1.entry.js.map → p-3f532072.entry.js.map} +0 -0
  368. /package/dist/core/{p-5481b048.entry.js.map → p-40f856bd.entry.js.map} +0 -0
  369. /package/dist/core/{p-b451f27c.entry.js.map → p-4212d1ba.entry.js.map} +0 -0
  370. /package/dist/core/{p-8ed04819.entry.js.map → p-5058cfa5.entry.js.map} +0 -0
  371. /package/dist/core/{p-2b326b17.entry.js.map → p-53321e37.entry.js.map} +0 -0
  372. /package/dist/core/{p-bceaf300.entry.js.map → p-63cadc85.entry.js.map} +0 -0
  373. /package/dist/core/{p-1a6fab3e.entry.js.map → p-6688b8d6.entry.js.map} +0 -0
  374. /package/dist/core/{p-e5957ce0.entry.js.map → p-7b60082f.entry.js.map} +0 -0
  375. /package/dist/core/{p-346578e4.entry.js.map → p-7fc43ade.entry.js.map} +0 -0
  376. /package/dist/core/{p-3f53446c.entry.js.map → p-8073cda6.entry.js.map} +0 -0
  377. /package/dist/core/{p-fd737b7e.entry.js.map → p-8085a9c7.entry.js.map} +0 -0
  378. /package/dist/core/{p-ba1c3cf7.entry.js.map → p-8d4bf735.entry.js.map} +0 -0
  379. /package/dist/core/{p-32e2ae6f.entry.js.map → p-906248f0.entry.js.map} +0 -0
  380. /package/dist/core/{p-731515cf.entry.js.map → p-98bebf11.entry.js.map} +0 -0
  381. /package/dist/core/{p-2f91e86a.entry.js.map → p-9d12998e.entry.js.map} +0 -0
  382. /package/dist/core/{p-03796d51.entry.js.map → p-a4f52fc0.entry.js.map} +0 -0
  383. /package/dist/core/{p-f50a57f3.entry.js.map → p-b283bddd.entry.js.map} +0 -0
  384. /package/dist/core/{p-1c3b619f.entry.js.map → p-b7a49514.entry.js.map} +0 -0
  385. /package/dist/core/{p-2d4e7985.entry.js.map → p-c1202776.entry.js.map} +0 -0
  386. /package/dist/core/{p-af5eacc1.entry.js.map → p-c884dc80.entry.js.map} +0 -0
  387. /package/dist/core/{p-52a4c223.entry.js.map → p-f278107f.entry.js.map} +0 -0
  388. /package/dist/core/{p-c919c571.entry.js.map → p-fe4e3486.entry.js.map} +0 -0
  389. /package/dist/core/{p-4f3fe190.entry.js.map → p-fee47770.entry.js.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukic/web-components",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "A web component UI library compiled with StencilJS",
5
5
  "author": "mi6",
6
6
  "bugs": {
@@ -96,5 +96,5 @@
96
96
  "webpack": "^5.76.0"
97
97
  },
98
98
  "license": "MIT",
99
- "gitHead": "5441c917fd593f7797ace93dc674a78006abb775"
99
+ "gitHead": "bee9250acbbeec465702a621ad5a68bf74cd91f4"
100
100
  }
package/vscode-data.json CHANGED
@@ -156,6 +156,18 @@
156
156
  {
157
157
  "name": "target",
158
158
  "description": "The ID of the element to jump back to when the link is clicked."
159
+ },
160
+ {
161
+ "name": "variant",
162
+ "description": "The variant of the button to render",
163
+ "values": [
164
+ {
165
+ "name": "default"
166
+ },
167
+ {
168
+ "name": "icon"
169
+ }
170
+ ]
159
171
  }
160
172
  ]
161
173
  },
@@ -1 +0,0 @@
1
- {"file":"helpers-88e018cf.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;MACa,aAAa,GAAG;IAC3B,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,SAAS;KACrB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,sBAAsB;KAClC;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,SAAS;KACrB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,OAAO;KACnB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,SAAS;KACrB;EACD;AAEF;MACa,iBAAiB,GAAG;IAC/B,aAAa;IACb,mBAAmB;IACnB,WAAW;IACX,eAAe;IACf,cAAc;IACd,kBAAkB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C;AACH,EAAE;MAEW,uBAAuB,GAAG,CACrC,EAAe,EACf,UAAsC;IAEtC,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IACzB,IAAI,IAAI,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;KAC/C;AACH,EAAE;MAEW,OAAO,GAAG,CAAC,EAAU,EAAE,IAAI,GAAG,EAAE,KAC3C,GAAG,CAAC,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC,EAAE,CAAC,MAAM;MAEvB,mBAAmB,GAAG,CACjC,QAAiB,EACjB,OAAoB;IAEpB,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;KACrC;AACH,EAAE;MA0BW,aAAa,GAAG,CAAC,KAAuB;IACnD,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,IAAI,SAAS,KAAK,GAAG,EAAE;QACrB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;KAC9B;SAAM,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE;QAC1C,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,OAAO,SAAS,CAAC;AACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["IcThemeForegroundEnum"],"sources":["src/utils/constants.ts","src/utils/helpers.ts"],"sourcesContent":["import errorIcon from \"../assets/error-icon.svg\";\nimport infoIcon from \"../assets/info-icon.svg\";\nimport neutralIcon from \"../assets/neutral-icon.svg\";\nimport successIcon from \"../assets/success-icon.svg\";\nimport warningIcon from \"../assets/warning-icon.svg\";\n\n// Global status icons\nexport const VARIANT_ICONS = {\n neutral: {\n icon: neutralIcon,\n ariaLabel: \"Neutral\",\n },\n info: {\n icon: infoIcon,\n ariaLabel: \"For your information\",\n },\n warning: {\n icon: warningIcon,\n ariaLabel: \"Warning\",\n },\n error: {\n icon: errorIcon,\n ariaLabel: \"Error\",\n },\n success: {\n icon: successIcon,\n ariaLabel: \"Success\",\n },\n};\n\n// Global ARIA attributes\nexport const IC_INHERITED_ARIA = [\n \"aria-atomic\",\n \"aria-autocomplete\",\n \"aria-busy\",\n \"aria-controls\",\n \"aria-current\",\n \"aria-describedby\",\n \"aria-description\",\n \"aria-details\",\n \"aria-disabled\",\n \"aria-dropeffect\",\n \"aria-errormessage\",\n \"aria-expanded\",\n \"aria-flowto\",\n \"aria-grabbed\",\n \"aria-haspopup\",\n \"aria-hidden\",\n \"aria-invalid\",\n \"aria-keyshortcuts\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-live\",\n \"aria-owns\",\n \"aria-relevant\",\n \"aria-roledescription\",\n];\n\nexport const IC_DEVICE_SIZES = {\n XS: 576,\n S: 768,\n M: 992,\n L: 1200,\n XL: 99999,\n};\n\nexport const IC_BLOCK_COLOR_COMPONENTS = [\n \"ic-hero\",\n \"ic-top-navigation\",\n \"ic-footer\",\n \"ic-side-navigation\",\n \"ic-alert\",\n];\n\nexport const IC_FIXED_COLOR_COMPONENTS = [\"ic-alert\"];\n\nexport interface IcColorExceptions {\n [details: string]: string[];\n}\n\nexport const IC_BLOCK_COLOR_EXCEPTIONS: IcColorExceptions = {\n \"ic-alert\": [\"ic-link\"],\n};\n\n/* Range within which the chosen theme colour would not have a sufficient brightness difference with either of the black or white foreground colours\n * The brightness difference must be greater than 125 to provide good colour visibility\n * Calculated by:\n * - Using the brightness formula for both colours: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding 125 to the brightness of the black foreground colour - RGB(11, 12, 12)\n * - Subtracting 125 from the brightness of the white foreground colour - RGB(255, 255, 255)\n */\nexport const BLACK_MIN_COLOR_BRIGHTNESS = 136.701;\nexport const WHITE_MAX_COLOR_BRIGHTNESS = 130;\n","import { EventEmitter } from \"@stencil/core\";\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n IcDeviceSizes,\n IcColor,\n} from \"./types\";\n\nimport {\n IcMenuOption,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"../utils/types\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\nconst icInput = \"ic-input\";\nconst linkIcInput = \"input.ic-input\";\n\n/**\n * converts an enum of strings into an array of strings\n */\nexport const stringEnumToArray = (\n theEnum: Record<string, string | number>\n): string[] => {\n const arr: string[] = [];\n Object.values(theEnum).forEach((val) => {\n if (isNaN(Number(val))) {\n const str = val as string;\n arr.push(str);\n }\n });\n return arr;\n};\n\n/**\n * Used to inherit global attributes set on the host. Called in componentWillLoad and assigned\n * to a variable that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\nexport const inheritAttributes = (\n element: HTMLElement,\n attributes: string[] = []\n): { [key: string]: string } => {\n const attributeObject: { [key: string]: string } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = value;\n }\n element.removeAttribute(attr);\n }\n });\n\n return attributeObject;\n};\n\nexport const debounceEvent = (\n event: EventEmitter,\n wait: number\n): EventEmitter => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const original = (event as any)._original || event;\n return {\n _original: event,\n emit: debounce(original.emit.bind(original), wait),\n } as EventEmitter;\n};\n\nexport const debounce = (\n func: (...args: unknown[]) => void,\n wait = 0\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n clearTimeout(timer);\n timer = setTimeout(func, wait, ...args);\n };\n};\n\n/**\n * This method is used to add a hidden input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param always Add a hidden input even if the container does not use Shadow\n * @param container The element where the input will be added\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n */\nexport const renderHiddenInput = (\n always: boolean,\n container: HTMLElement,\n name: string,\n value: string | Date | undefined | null,\n disabled: boolean\n): void => {\n if (name !== undefined && (always || hasShadowDom(container))) {\n const inputs = container.querySelectorAll(linkIcInput);\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.type = \"hidden\";\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.disabled = disabled;\n input.name = name;\n\n if (value instanceof Date) {\n input.value = value ? value.toISOString() : null;\n } else {\n input.value = value || \"\";\n }\n }\n};\n\n/**\n * This method is used to add a hidden file input to a host element that contains\n * a Shadow DOM. It does not add the input inside of the Shadow root which\n * allows it to be picked up inside of forms. It should contain the same\n * values as the host element.\n *\n * @param event: The event that is emitted once a file is selected.\n * @param container The element where the input will be added\n * @param multiple If true, multiple files can be selected\n * @param name The name of the input\n * @param value The value of the input\n * @param disabled If true, the input is disabled\n * @param accept A string of the accepted files\n */\nexport const renderFileHiddenInput = (\n event: EventEmitter,\n container: HTMLElement,\n multiple: boolean,\n name: string,\n value: FileList | undefined | null,\n disabled: boolean,\n accept: string\n): void => {\n if (name !== undefined && hasShadowDom(container)) {\n const inputs = container.querySelectorAll(linkIcInput);\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n\n let input = filtered[0] as HTMLInputElement;\n if (input === null || input === undefined) {\n input = container.ownerDocument.createElement(\"input\");\n input.classList.add(icInput);\n container.appendChild(input);\n }\n input.type = \"file\";\n input.hidden = true;\n input.multiple = multiple;\n input.name = name;\n input.files = value;\n input.disabled = disabled;\n input.accept = accept;\n input.onchange = () => {\n event.emit(input.files);\n };\n input.click();\n }\n};\n\nexport const removeHiddenInput = (container: HTMLElement): void => {\n const inputs = container.querySelectorAll(\"input.ic-input\");\n const inputEls = Array.from(inputs);\n const filtered = inputEls.filter((el) => container === el.parentElement);\n const input = filtered[0] as HTMLInputElement;\n input?.remove();\n};\n\nexport const hasShadowDom = (el: HTMLElement): boolean =>\n !!el.shadowRoot && !!el.attachShadow;\n\nexport const getInputHelperTextID = (id: string): string => id + \"-helper-text\";\n\nexport const getInputValidationTextID = (id: string): string =>\n id + \"-validation-text\";\n\nexport const getInputDescribedByText = (\n inputId: string,\n helperText: boolean,\n validationText: boolean\n): string =>\n `${helperText ? getInputHelperTextID(inputId) : \"\"} ${\n validationText ? getInputValidationTextID(inputId) : \"\"\n }`.trim();\n\n/**\n * This method helps to understand the context in which a component exists,\n * to assist with choosing appropriate foreground colours to use. For example,\n * this method will help you use the 'white' version of a button if it's within\n * a block colour element using white foreground text.\n *\n * This only works for components/elements passed via <slot> and not if they\n * are part of an IC component.\n *\n * \"\"\n * @returns IcThemeForeground depending on the context\n */\nexport const getThemeFromContext = (\n el: Element,\n themeFromEvent: IcThemeForeground = null\n): IcThemeForeground => {\n const parentElement =\n el.parentElement || (<ShadowRoot>el.getRootNode()).host.parentElement;\n const blockColorParent = parentElement.closest(\n IC_BLOCK_COLOR_COMPONENTS.join(\",\")\n );\n\n // If within a block color component\n if (blockColorParent !== null) {\n const parentTag = blockColorParent.tagName.toLowerCase();\n const currentTag = el.tagName.toLowerCase();\n\n if (IC_BLOCK_COLOR_EXCEPTIONS[parentTag]?.includes(currentTag)) {\n return IcThemeForegroundEnum.Default;\n } else if (\n themeFromEvent !== null &&\n !IC_FIXED_COLOR_COMPONENTS.includes(parentTag)\n ) {\n return themeFromEvent;\n } else if (\n blockColorParent.classList.contains(IcThemeForegroundEnum.Dark)\n ) {\n return IcThemeForegroundEnum.Dark;\n }\n\n return IcThemeForegroundEnum.Light;\n }\n\n return IcThemeForegroundEnum.Default;\n};\n\n/**\n * Checks if the current device is a mobile or tablet device.\n * @returns {boolean} Returns true if the device is a mobile or tablet device, otherwise returns false.\n */\nexport const isMobileOrTablet = (): boolean =>\n \"maxTouchPoints\" in navigator && \"userAgent\" in navigator\n ? navigator.maxTouchPoints > 0 &&\n /iPad|iPhone|iPod|Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n : false;\n\n/**\n * Will create a button within the lightDOM which interacts with the parent form.\n * This is required as buttons within the shadowDOM will not invoke a submit or reset\n *\n * @param form - parent form element which contains shadowDom button\n * @param button - shadowDOM button\n */\nexport const handleHiddenFormButtonClick = (\n form: HTMLFormElement,\n button: HTMLIcButtonElement | HTMLButtonElement\n): void => {\n const hiddenFormButton = document.createElement(\"button\");\n\n hiddenFormButton.setAttribute(\"type\", button.type);\n hiddenFormButton.style.display = \"none\";\n\n form.appendChild(hiddenFormButton);\n\n hiddenFormButton.click();\n hiddenFormButton.remove();\n};\n\nexport const isEmptyString = (value: string): boolean =>\n value ? value.trim().length === 0 : true;\n\n// A helper function that checks if a prop has been defined\nexport const isPropDefined = (prop: string): string | null =>\n prop !== undefined ? prop : null;\n\n/**\n * Extracts the label using the value from an object. Requires the object to have a label and value property.\n * @param value - value from object\n * @param options - list of menu items\n * @returns - label corresponding to value\n */\nexport const getLabelFromValue = (\n value: string,\n options: IcMenuOption[],\n valueField = \"value\",\n labelField = \"label\"\n): string | undefined => {\n const ungroupedOptions: IcMenuOption[] = [];\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option: IcMenuOption) =>\n ungroupedOptions.push(option)\n );\n } else {\n ungroupedOptions.push(option);\n }\n });\n const matchingValue = ungroupedOptions.find(\n (option) => option[valueField] === value\n );\n if (matchingValue !== undefined) return matchingValue[labelField];\n }\n\n return undefined;\n};\n\n/**\n * Filters the options based on the search string.\n * @param options - array of options\n * @param includeDescriptions - determines whether option descriptions are included when filtering options\n * @param searchString - string used to filter the options\n * @param position - whether the search string matches the start of or anywhere in the options\n * @returns filtered array of options\n */\nexport const getFilteredMenuOptions = (\n options: IcMenuOption[],\n includeDescriptions: boolean,\n searchString: string,\n position: IcSearchMatchPositions,\n labelField = \"label\"\n): IcMenuOption[] =>\n options.filter((option) => {\n const label: string = option[labelField].toLowerCase();\n const description = option.description?.toLowerCase();\n const lowerSearchString = searchString.toLowerCase();\n\n return position === \"anywhere\"\n ? includeDescriptions\n ? label.includes(lowerSearchString) ||\n description?.includes(lowerSearchString)\n : label.includes(lowerSearchString)\n : includeDescriptions\n ? label.startsWith(lowerSearchString) ||\n description?.startsWith(lowerSearchString)\n : label.startsWith(lowerSearchString);\n });\n\nexport const deviceSizeMatches = (size: number): boolean =>\n window.matchMedia(`(max-width: ${size}px)`).matches;\n\nexport const getCurrentDeviceSize = (): number => {\n if (deviceSizeMatches(DEVICE_SIZES.S)) {\n return DEVICE_SIZES.S;\n }\n if (deviceSizeMatches(DEVICE_SIZES.M)) {\n return DEVICE_SIZES.M;\n }\n if (deviceSizeMatches(DEVICE_SIZES.L)) {\n return DEVICE_SIZES.L;\n }\n if (deviceSizeMatches(DEVICE_SIZES.XL)) {\n return DEVICE_SIZES.XL;\n }\n //fallback needed as all of above get initialised to 0 in jest tests\n return DEVICE_SIZES.UNDEFINED;\n};\n\nexport const getCssProperty = (cssVar: string): string =>\n getComputedStyle(document.documentElement).getPropertyValue(cssVar);\n\n/**\n * Returns the brightness of the theme colour, calculated by using the theme RGB CSS values by:\n * - Multiplying each RGB value by a set number: https://www.w3.org/TR/AERT/#color-contrast\n * - Adding them together and dividing by 1000\n * This is a similar calculation to its CSS counterpart: \"--ic-theme-text\"\n * @returns number representing the brightness of the theme colour\n */\nexport const getThemeColorBrightness = (): number => {\n const themeRed = getCssProperty(\"--ic-theme-primary-r\");\n const themeGreen = getCssProperty(\"--ic-theme-primary-g\");\n const themeBlue = getCssProperty(\"--ic-theme-primary-b\");\n return (\n (parseInt(themeRed) * 299 +\n parseInt(themeGreen) * 587 +\n parseInt(themeBlue) * 114) /\n 1000\n );\n};\n\n/**\n * Returns if dark or light foreground colors should be used for color contrast reasons\n * @returns \"dark\" or \"light\"\n */\nexport const getThemeForegroundColor = (): IcThemeForeground =>\n getThemeColorBrightness() > DARK_MODE_THRESHOLD\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n\nexport const getSlot = (element: HTMLElement, name: string): Element | null => {\n if (element && element.querySelector) {\n return element.querySelector(`[slot=\"${name}\"]`);\n }\n return null;\n};\n\nexport const slotHasContent = (element: HTMLElement, name: string): boolean =>\n getSlot(element, name) !== null;\n\nexport const getSlotContent = (\n element: HTMLElement,\n name: string\n): Element[] | NodeListOf<ChildNode> | null => {\n const slot = getSlot(element, name);\n if (slot) {\n return getSlotElements(slot);\n }\n\n return null;\n};\n\nexport const getSlotElements = (\n slot: Element\n): NodeListOf<ChildNode> | Element[] => {\n const slotContent = slot.firstElementChild as HTMLSlotElement;\n\n if (slotContent !== null) {\n const elements = slotContent.assignedElements\n ? slotContent.assignedElements()\n : slotContent.childNodes;\n return elements.length ? elements : null;\n } else {\n //check for single element\n return slot === null ? null : [slot];\n }\n};\n\nexport const getNavItemParentDetails = (\n el: HTMLElement\n): IcNavParentDetails => {\n let navType: IcNavParentDetails = { navType: \"\", parent: null };\n switch (getParentElementType(el)) {\n case \"IC-NAVIGATION-GROUP\":\n navType = getNavItemParentDetails(el.parentElement);\n break;\n case \"IC-TOP-NAVIGATION\":\n navType = { navType: \"top\", parent: getParentElement(el) };\n break;\n case \"IC-SIDE-NAVIGATION\":\n navType = { navType: \"side\", parent: getParentElement(el) };\n break;\n case \"IC-PAGE-HEADER\":\n navType = { navType: \"page-header\", parent: null };\n break;\n }\n return navType;\n};\n\nexport const DEVICE_SIZES = {\n XS: Number(\n getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 0\n S: Number(\n getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 576\n M: Number(\n getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 768\n L: Number(\n getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 992\n XL: Number(\n getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")\n ) as IcDeviceSizes, // 1200\n UNDEFINED: 1200,\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => {\n return status !== \"\" && !disabled;\n};\n\nexport const isSlotUsed = (element: HTMLElement, slotName: string): boolean =>\n Array.from(element.children).some(\n (child) => child.getAttribute(\"slot\") === slotName\n );\n\n// added as a common method to allow detection of gatsby hydration issue, where (camelCase) props are initially undefined & then update\n// with a value. Allows a callback function to be executed when this is the case\nexport const onComponentPropUndefinedChange = (\n oldValue: string | undefined,\n newValue: string | undefined,\n callback: IcCallbackFunctionNoReturn\n): void => {\n if (oldValue === undefined && newValue !== oldValue) {\n callback();\n }\n};\n\nexport const onComponentRequiredPropUndefined = (\n props: IcPropObject[],\n component: string\n): void => {\n for (let i = 0; i < props.length; i++) {\n const { prop, propName } = props[i];\n if (prop === null || prop === undefined) {\n console.error(\n `No ${propName} specified for ${component} component - prop '${propName}' (web components) / '${kebabToCamelCase(\n propName\n )}' (react) required`\n );\n }\n }\n};\n\nexport const kebabToCamelCase = (kebabCase: string): string => {\n kebabCase = kebabCase.toLowerCase();\n const individualWords: string[] = kebabCase.split(\"-\");\n let camelCase = individualWords[0];\n for (let i = 1; i < individualWords.length; i++) {\n camelCase +=\n individualWords[i].substring(0, 1).toUpperCase() +\n individualWords[i].substring(1);\n }\n return camelCase;\n};\n\nexport const checkResizeObserver = (\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n if (\n typeof window !== \"undefined\" &&\n typeof window.ResizeObserver !== \"undefined\"\n ) {\n callbackFn();\n }\n};\n\nconst hex2dec = function (v: string) {\n return parseInt(v, 16);\n};\n\nexport const hexToRgba = (hex: string): IcColorRGBA => {\n let c;\n if (hex.length === 4) {\n c = hex.replace(\"#\", \"\").split(\"\");\n return {\n r: hex2dec(c[0] + c[0]),\n g: hex2dec(c[1] + c[1]),\n b: hex2dec(c[2] + c[2]),\n a: 1,\n };\n } else {\n return {\n r: hex2dec(hex.slice(1, 3)),\n g: hex2dec(hex.slice(3, 5)),\n b: hex2dec(hex.slice(5)),\n a: 1,\n };\n }\n};\n\nexport const rgbaStrToObj = (rgbaStr: string): IcColorRGBA => {\n const fourthChar = rgbaStr.slice(3, 4);\n let colorRGBA: IcColorRGBA;\n if (fourthChar.toLowerCase() === \"a\") {\n colorRGBA = { r: null, g: null, b: null, a: null };\n const rgba = rgbaStr\n .substring(5, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgba[0]);\n colorRGBA.g = Number(rgba[1]);\n colorRGBA.b = Number(rgba[2]);\n colorRGBA.a = Number(rgba[3]);\n } else {\n colorRGBA = { r: null, g: null, b: null, a: 1 };\n const rgb = rgbaStr\n .substring(4, rgbaStr.length - 1)\n .replace(/ /g, \"\")\n .split(\",\");\n colorRGBA.r = Number(rgb[0]);\n colorRGBA.g = Number(rgb[1]);\n colorRGBA.b = Number(rgb[2]);\n }\n\n return colorRGBA;\n};\n\nexport const elementOverflowsX = (element: HTMLElement): boolean =>\n element.scrollWidth > element.clientWidth;\n\n/**\n *\n * @param child - The child element\n * @returns string\n */\nexport const getParentElementType = (child: HTMLElement): string =>\n child.parentElement.tagName;\n\nexport const getParentElement = (child: HTMLElement): HTMLElement =>\n child.parentElement;\n\nexport const hasClassificationBanner = (): boolean =>\n !!document.querySelector(\"ic-classification-banner:not([inline='true'])\");\n\nexport const getForm = (el: HTMLElement): HTMLFormElement => el.closest(\"FORM\");\n\nexport const addFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.addEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const removeFormResetListener = (\n el: HTMLElement,\n callbackFn: IcCallbackFunctionNoReturn\n): void => {\n const form = getForm(el);\n if (form !== null) {\n form.removeEventListener(\"reset\", callbackFn);\n }\n};\n\nexport const pxToRem = (px: string, base = 16): string =>\n `${(1 / base) * parseInt(px)}rem`;\n\nexport const removeDisabledFalse = (\n disabled: boolean,\n element: HTMLElement\n): void => {\n if (!disabled) {\n element.removeAttribute(\"disabled\");\n }\n};\n\nexport const isMacDevice = (): boolean => {\n return window.navigator.userAgent.toUpperCase().indexOf(\"MAC\") >= 0;\n};\n\nexport const isNumeric = (value: string): boolean => {\n return /^-?\\d+$/.test(value);\n};\n\nexport async function waitForHydration(): Promise<boolean> {\n const elements = document.getElementsByTagName(\"*\");\n\n for (let i = 0; i < elements.length; i++) {\n if (elements[i].tagName.startsWith(\"IC-\")) {\n if (elements[i].classList.contains(\"hydrated\")) {\n return true;\n }\n } else {\n return false;\n }\n }\n\n return false;\n}\n\nexport const convertToRGBA = (color: IcColor | string) => {\n let colorRGBA = null;\n\n const firstChar = color.slice(0, 1);\n if (firstChar === \"#\") {\n colorRGBA = hexToRgba(color);\n } else if (firstChar.toLowerCase() === \"r\") {\n colorRGBA = rgbaStrToObj(color);\n }\n\n return colorRGBA;\n};\n"],"version":3}
@@ -1,33 +0,0 @@
1
- import { fixture } from "@open-wc/testing-helpers";
2
- import { axe } from "jest-axe";
3
- describe("ic-text-field", () => {
4
- it("passes accessibility", async () => {
5
- const el = await fixture(`<ic-text-field
6
- validation-status="erro"
7
- validation-text="now it has really gone to pot"
8
- value="Tea"
9
- max-length="25"
10
- label="What is your favourite coffee?"
11
- required
12
- placeholder="Placeholder"
13
- helper-text="Such as Arabica, Robusta or Liberica"
14
- >
15
- <svg
16
- slot="icon"
17
- xmlns="http://www.w3.org/2000/svg"
18
- height="24px"
19
- viewBox="0 0 24 24"
20
- width="24px"
21
- fill="#000000"
22
- >
23
- <path d="M0 0h24v24H0z" fill="none" />
24
- <path
25
- d="M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"
26
- />
27
- </svg>
28
- </ic-text-field>`);
29
- expect(el.shadowRoot.innerHTML).not.toBe("");
30
- expect(await axe(el)).toHaveNoViolations();
31
- });
32
- });
33
- //# sourceMappingURL=ic-text-field.test.a11y.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ic-text-field.test.a11y.js","sourceRoot":"","sources":["../../../../../src/components/ic-text-field/test/a11y/ic-text-field.test.a11y.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;mBAuBV,CAAC,CAAC;QACjB,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7C,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { fixture } from \"@open-wc/testing-helpers\";\nimport { axe } from \"jest-axe\";\n\ndescribe(\"ic-text-field\", () => {\n it(\"passes accessibility\", async () => {\n const el = await fixture(`<ic-text-field\n validation-status=\"erro\"\n validation-text=\"now it has really gone to pot\"\n value=\"Tea\"\n max-length=\"25\"\n label=\"What is your favourite coffee?\"\n required\n placeholder=\"Placeholder\"\n helper-text=\"Such as Arabica, Robusta or Liberica\"\n >\n <svg\n slot=\"icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n height=\"24px\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n fill=\"#000000\"\n >\n <path d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path\n d=\"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z\"\n />\n </svg>\n </ic-text-field>`);\n expect(el.shadowRoot.innerHTML).not.toBe(\"\");\n expect(await axe(el)).toHaveNoViolations();\n });\n});\n"]}
@@ -1,110 +0,0 @@
1
- import { newE2EPage } from "@stencil/core/testing";
2
- describe("ic-text-field", () => {
3
- it("should trigger max length validation when long value set", async () => {
4
- const page = await newE2EPage();
5
- await page.setContent('<ic-text-field label="Test label" max-length="20">');
6
- await page.waitForChanges();
7
- const element = await page.find("ic-text-field");
8
- element.setProperty("value", "a really long test value");
9
- await page.waitForChanges();
10
- const input = await page.find("ic-text-field >>> #ic-text-field-input-0");
11
- const value = await input.getProperty("value");
12
- expect(value).toBe("a really long test value");
13
- let icon = await page.find("ic-text-field >>> .icon-error");
14
- let iconVis = await icon.isVisible();
15
- expect(iconVis).toBeTruthy();
16
- const validationText = await page.find("ic-text-field >>> #ic-text-field-input-0-validation-text");
17
- expect(validationText).toEqualText("Maximum length exceeded");
18
- const charCountText = await page.find("ic-text-field >>> #ic-text-field-input-0-charcount");
19
- expect(charCountText).toEqualText("24/20");
20
- await input.press("Backspace");
21
- await input.press("Backspace");
22
- await input.press("Backspace");
23
- await input.press("Backspace");
24
- expect(charCountText).toEqualText("20/20");
25
- expect(validationText).toEqualText("");
26
- icon = await page.find("ic-text-field >>> .icon-error");
27
- expect(icon).toBeNull();
28
- await input.press("a");
29
- expect(charCountText).toEqualText("21/20");
30
- expect(validationText).toEqualText("Maximum length exceeded");
31
- icon = await page.find("ic-text-field >>> .icon-error");
32
- iconVis = await icon.isVisible();
33
- expect(iconVis).toBeTruthy();
34
- });
35
- it("should trigger min/max value validation when lower/higher value set", async () => {
36
- const page = await newE2EPage();
37
- await page.setContent('<ic-text-field label="Test label" min=1 max=4 inputmode="numeric" type="number"');
38
- await page.waitForChanges();
39
- const element = await page.find("ic-text-field");
40
- element.setProperty("value", "5");
41
- await page.waitForChanges();
42
- const input = await page.find("ic-text-field >>> #ic-text-field-input-0");
43
- const value = await input.getProperty("value");
44
- expect(value).toBe("5");
45
- const icon = await page.find("ic-text-field >>> .icon-error");
46
- const iconVis = await icon.isVisible();
47
- expect(iconVis).toBeTruthy();
48
- let validationText = await page.find("ic-text-field >>> #ic-text-field-input-0-validation-text");
49
- expect(validationText).toEqualText("Maximum value of 4 exceeded");
50
- element.setProperty("value", "4");
51
- await page.waitForChanges();
52
- validationText = await page.find("ic-text-field >>> #ic-text-field-input-0-validation-text");
53
- expect(validationText).toBeNull();
54
- element.setProperty("value", "0");
55
- await page.waitForChanges();
56
- validationText = await page.find("ic-text-field >>> #ic-text-field-input-0-validation-text");
57
- expect(validationText).toEqualText("Minimum value of 1 not met");
58
- });
59
- it("should focus input when setFocus method called", async () => {
60
- const page = await newE2EPage();
61
- await page.setContent('<ic-text-field label="Test label">');
62
- await page.waitForChanges();
63
- const element = await page.find("ic-text-field");
64
- await element.callMethod("setFocus");
65
- await page.waitForChanges();
66
- const activeElId = await page.$eval("ic-text-field", (el) => el.shadowRoot.activeElement.id);
67
- expect(activeElId).toBe("ic-text-field-input-0");
68
- });
69
- it("works on a form", async () => {
70
- const page = await newE2EPage();
71
- await page.setContent('<form><ic-text-field label="Test label" name="formInputEl"></ic-text-field><button id="resetButton" type="reset">Reset</button></form>');
72
- await page.waitForChanges();
73
- let input = await page.find("ic-text-field >>> #ic-text-field-input-0");
74
- await input.press("s");
75
- await input.press("o");
76
- await input.press("m");
77
- await input.press("e");
78
- await input.press("Space");
79
- await input.press("t");
80
- await input.press("e");
81
- await input.press("x");
82
- await input.press("t");
83
- let value = await input.getProperty("value");
84
- expect(value).toBe("some text");
85
- //check value on underlying hidden form control
86
- const formInput = await page.find("input[name=formInputEl]");
87
- const visible = await formInput.isVisible();
88
- expect(visible).toBe(false);
89
- const formInputvalue = await formInput.getProperty("value");
90
- expect(formInputvalue).toBe("some text");
91
- const resetButton = await page.find("#resetButton");
92
- await resetButton.click();
93
- input = await page.find("ic-text-field >>> #ic-text-field-input-0");
94
- value = await input.getProperty("value");
95
- expect(value).toBe("");
96
- });
97
- it("should update any attributes inherited from the root element when they are mutated", async () => {
98
- const page = await newE2EPage();
99
- await page.setContent('<ic-text-field label="Test label">');
100
- await page.waitForChanges();
101
- let input = await page.find("ic-text-field >>> input");
102
- expect(input.getAttribute("title")).toBeNull();
103
- const textField = await page.find("ic-text-field");
104
- textField.setAttribute("title", "new-input-title");
105
- await page.waitForChanges();
106
- input = await page.find("ic-text-field >>> input");
107
- expect(input.getAttribute("title")).toBe("new-input-title");
108
- });
109
- });
110
- //# sourceMappingURL=ic-text-field.e2e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ic-text-field.e2e.js","sourceRoot":"","sources":["../../../../../src/components/ic-text-field/test/basic/ic-text-field.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;QACxE,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,oDAAoD,CAAC,CAAC;QAE5E,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACjD,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;QAEzD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QAE1E,MAAM,KAAK,GAAG,M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AA0C,CAAC,CAAC;QACpE,KAAK,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oFAAoF,EAAE,KAAK,IAAI,EAAE;QAClG,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,oCAAoC,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACvD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QAE/C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAE5B,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from \"@stencil/core/testing\";\n\ndescribe(\"ic-text-field\", () => {\n it(\"should trigger max length validation when long value set\", async () => {\n const page = await newE2EPage();\n await page.setContent('<ic-text-field label=\"Test label\" max-length=\"20\">');\n\n await page.waitForChanges();\n\n const element = await page.find(\"ic-text-field\");\n element.setProperty(\"value\", \"a really long test value\");\n\n await page.waitForChanges();\n\n const input = await page.find(\"ic-text-field >>> #ic-text-field-input-0\");\n\n const value = await input.getProperty(\"value\");\n expect(value).toBe(\"a really long test value\");\n\n let icon = await page.find(\"ic-text-field >>> .icon-error\");\n let iconVis = await icon.isVisible();\n expect(iconVis).toBeTruthy();\n\n const validationText = await page.find(\n \"ic-text-field >>> #ic-text-field-input-0-validation-text\"\n );\n expect(validationText).toEqualText(\"Maximum length exceeded\");\n\n const charCountText = await page.find(\n \"ic-text-field >>> #ic-text-field-input-0-charcount\"\n );\n expect(charCountText).toEqualText(\"24/20\");\n\n await input.press(\"Backspace\");\n await input.press(\"Backspace\");\n await input.press(\"Backspace\");\n await input.press(\"Backspace\");\n expect(charCountText).toEqualText(\"20/20\");\n\n expect(validationText).toEqualText(\"\");\n icon = await page.find(\"ic-text-field >>> .icon-error\");\n expect(icon).toBeNull();\n\n await input.press(\"a\");\n expect(charCountText).toEqualText(\"21/20\");\n expect(validationText).toEqualText(\"Maximum length exceeded\");\n\n icon = await page.find(\"ic-text-field >>> .icon-error\");\n iconVis = await icon.isVisible();\n expect(iconVis).toBeTruthy();\n });\n\n it(\"should trigger min/max value validation when lower/higher value set\", async () => {\n const page = await newE2EPage();\n await page.setContent(\n '<ic-text-field label=\"Test label\" min=1 max=4 inputmode=\"numeric\" type=\"number\"'\n );\n\n await page.waitForChanges();\n\n const element = await page.find(\"ic-text-field\");\n element.setProperty(\"value\", \"5\");\n\n await page.waitForChanges();\n\n const input = await page.find(\"ic-text-field >>> #ic-text-field-input-0\");\n\n const value = await input.getProperty(\"value\");\n expect(value).toBe(\"5\");\n\n const icon = await page.find(\"ic-text-field >>> .icon-error\");\n const iconVis = await icon.isVisible();\n expect(iconVis).toBeTruthy();\n\n let validationText = await page.find(\n \"ic-text-field >>> #ic-text-field-input-0-validation-text\"\n );\n expect(validationText).toEqualText(\"Maximum value of 4 exceeded\");\n\n element.setProperty(\"value\", \"4\");\n\n await page.waitForChanges();\n\n validationText = await page.find(\n \"ic-text-field >>> #ic-text-field-input-0-validation-text\"\n );\n expect(validationText).toBeNull();\n\n element.setProperty(\"value\", \"0\");\n\n await page.waitForChanges();\n\n validationText = await page.find(\n \"ic-text-field >>> #ic-text-field-input-0-validation-text\"\n );\n expect(validationText).toEqualText(\"Minimum value of 1 not met\");\n });\n\n it(\"should focus input when setFocus method called\", async () => {\n const page = await newE2EPage();\n await page.setContent('<ic-text-field label=\"Test label\">');\n await page.waitForChanges();\n\n const element = await page.find(\"ic-text-field\");\n await element.callMethod(\"setFocus\");\n\n await page.waitForChanges();\n const activeElId = await page.$eval(\n \"ic-text-field\",\n (el) => el.shadowRoot.activeElement.id\n );\n\n expect(activeElId).toBe(\"ic-text-field-input-0\");\n });\n\n it(\"works on a form\", async () => {\n const page = await newE2EPage();\n\n await page.setContent(\n '<form><ic-text-field label=\"Test label\" name=\"formInputEl\"></ic-text-field><button id=\"resetButton\" type=\"reset\">Reset</button></form>'\n );\n await page.waitForChanges();\n\n let input = await page.find(\"ic-text-field >>> #ic-text-field-input-0\");\n\n await input.press(\"s\");\n await input.press(\"o\");\n await input.press(\"m\");\n await input.press(\"e\");\n await input.press(\"Space\");\n await input.press(\"t\");\n await input.press(\"e\");\n await input.press(\"x\");\n await input.press(\"t\");\n\n let value = await input.getProperty(\"value\");\n expect(value).toBe(\"some text\");\n //check value on underlying hidden form control\n const formInput = await page.find(\"input[name=formInputEl]\");\n\n const visible = await formInput.isVisible();\n expect(visible).toBe(false);\n\n const formInputvalue = await formInput.getProperty(\"value\");\n expect(formInputvalue).toBe(\"some text\");\n\n const resetButton = await page.find(\"#resetButton\");\n await resetButton.click();\n\n input = await page.find(\"ic-text-field >>> #ic-text-field-input-0\");\n value = await input.getProperty(\"value\");\n expect(value).toBe(\"\");\n });\n\n it(\"should update any attributes inherited from the root element when they are mutated\", async () => {\n const page = await newE2EPage();\n await page.setContent('<ic-text-field label=\"Test label\">');\n await page.waitForChanges();\n\n let input = await page.find(\"ic-text-field >>> input\");\n expect(input.getAttribute(\"title\")).toBeNull();\n\n const textField = await page.find(\"ic-text-field\");\n textField.setAttribute(\"title\", \"new-input-title\");\n await page.waitForChanges();\n\n input = await page.find(\"ic-text-field >>> input\");\n expect(input.getAttribute(\"title\")).toBe(\"new-input-title\");\n });\n});\n"]}
@@ -1,2 +0,0 @@
1
- import{r as s,h as a,H as t,g as i}from"./p-6b5e91e2.js";import{I as c}from"./p-26b7b18f.js";import{c as r,h as e,g as o,b as h,d as n,a as l,e as p}from"./p-e4d0d1fb.js";const d="@media (prefers-reduced-motion: no-preference){:host(.show){animation:expand var(--ic-transition-duration-slow)}:host(.hide){animation:shrink var(--ic-transition-duration-slow)}}:host{display:flex;height:var(--ic-space-md);min-width:var(--ic-space-md);width:-moz-fit-content;width:fit-content;border-radius:calc(2 * var(--ic-space-xxl));position:absolute}:host(.neutral){background-color:var(--ic-architectural-500)}:host(.light){background-color:var(--ic-architectural-40)}:host(.info){background-color:var(--ic-status-info)}:host(.warning){background-color:var(--ic-status-warning-mid)}:host(.error){background-color:var(--ic-status-error)}:host(.success){background-color:var(--ic-status-success)}:host(.small){height:var(--ic-space-sm);min-width:var(--ic-space-sm)}:host(.large){height:calc(var(--ic-space-md) + var(--ic-space-xxs));min-width:calc(var(--ic-space-md) + var(--ic-space-xxs))}:host(.dot.default){height:var(--ic-space-xs);width:var(--ic-space-xs);min-width:var(--ic-space-xs)}:host(.dot.small){height:calc(var(--ic-space-xxs) + var(--ic-space-xxxs));width:calc(var(--ic-space-xxs) + var(--ic-space-xxxs));min-width:calc(var(--ic-space-xxs) + var(--ic-space-xxxs))}:host(.dot.large){height:var(--ic-space-sm);width:var(--ic-space-sm);min-width:var(--ic-space-sm)}:host(.foreground-dark) ::slotted(*){fill:var(--ic-color-primary-text)}:host(.foreground-light) ::slotted(*){fill:white}:host(.foreground-dark) ic-typography{color:var(--ic-color-primary-text)}:host(.foreground-light) ic-typography{color:white}:host(.text) ic-typography{align-self:center;padding:0 calc((var(--ic-space-xs) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px)}:host(.text.small) ic-typography{padding:0 0.2132rem}:host(.text.large) ic-typography{padding:0 calc((var(--ic-space-sm) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px)}:host(.icon) ::slotted(svg){width:var(--ic-space-sm);height:var(--ic-space-sm);padding:var(--ic-space-xxxs)}:host(.icon.small) ::slotted(svg){width:var(--ic-space-xs);height:var(--ic-space-xs)}:host(.icon.large) ::slotted(svg){width:calc(var(--ic-space-sm) + var(--ic-space-xxxs));height:calc(var(--ic-space-sm) + var(--ic-space-xxxs));padding:calc(var(--ic-space-xxxs) + var(--ic-space-1px))}:host(.far){top:calc(-1 * var(--ic-space-xs));right:calc(-1 * var(--ic-space-xs))}:host(.far.small),:host(.dot.far.large){top:calc(-1 * var(--ic-space-xxs));right:calc(-1 * var(--ic-space-xxs))}:host(.dot.far),:host(.dot.far.small){top:calc(-1 * var(--ic-space-xxxs));right:calc(-1 * var(--ic-space-xxxs))}:host(.near){top:calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));right:calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)))}:host(.dot.near){top:calc(-1 * var(--ic-space-1px));right:calc(-1 * var(--ic-space-1px))}:host(.inline){position:static}:host(.hide){visibility:hidden !important;transition:visibility var(--ic-transition-duration-slow)}@keyframes expand{from{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes shrink{from{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(0)}}";const u=class{constructor(a){s(this,a);this.ariaLabel=null;this.setBadgeColour=()=>{if(this.customColor!==null&&r(this.customColor)!==null){const s=r(this.customColor);this.customColorRGBA=s;this.el.style.backgroundColor=`rgba(${s.r.toString()}, ${s.g.toString()}, ${s.b.toString()}, ${s.a.toString()})`}};this.getBadgeForeground=()=>{let s;let a;let t;switch(this.variant){case"custom":s=this.customColorRGBA.r;a=this.customColorRGBA.g;t=this.customColorRGBA.b;break;case"error":s=parseInt(o("--ic-status-error-r"));a=parseInt(o("--ic-status-error-g"));t=parseInt(o("--ic-status-error-b"));break;case"success":s=parseInt(o("--ic-status-success-r"));a=parseInt(o("--ic-status-success-g"));t=parseInt(o("--ic-status-success-b"));break;case"warning":s=parseInt(o("--ic-status-warning-r"));a=parseInt(o("--ic-status-warning-g"));t=parseInt(o("--ic-status-warning-b"));break;case"info":{const i=e(o("--ic-status-info"));s=i.r;a=i.g;t=i.b;break}case"neutral":{const i=e(o("--ic-architectural-500"));s=i.r;a=i.g;t=i.b;break}case"light":{const i=e(o("--ic-architectural-40"));s=i.r;a=i.g;t=i.b;break}}const i=(s*299+a*587+t*114)/1e3;this.foregroundColour=i>133.3505?c.Dark:c.Light};this.getTextLabel=()=>{let s;if(this.textLabel!==null){if(this.maxNumber!==null){s=Number(this.textLabel)>this.maxNumber?`${this.maxNumber}+`:this.textLabel}else{s=this.textLabel}}return s};this.setAccessibleLabel=()=>{const s=p(this.el);const a=h(this.el).ariaLabel;const t=this.isAccessibleLabelDefined()?this.accessibleLabel:this.textLabel||"with badge being displayed";if(h(this.el)!==null){if(s!=="IC-CARD"&&(s!=="IC-TAB"||s==="IC-TAB"&&a)){h(this.el).ariaLabel=`${a?`${a} ,`:""} ${t}`}else{this.ariaLabel=`, ${t}`}}};this.isAccessibleLabelDefined=()=>n(this.accessibleLabel)&&this.accessibleLabel!==null;this.accessibleLabel=undefined;this.customColor=null;this.maxNumber=undefined;this.position="far";this.size="default";this.textLabel=undefined;this.type="text";this.variant="neutral";this.visible=true}componentWillLoad(){this.variant==="custom"&&this.setBadgeColour();this.getBadgeForeground();this.setAccessibleLabel()}componentDidLoad(){this.type==="text"&&l([{prop:this.textLabel,propName:"text-label"}],"Badge")}async showBadge(){this.visible=true}async hideBadge(){this.visible=false}render(){const{position:s,size:i,type:c,variant:r,foregroundColour:e,visible:o}=this;return a(t,{class:{[`${s}`]:true,[`${i}`]:true,[`${r}`]:true,[`${c}`]:true,[`foreground-${e}`]:e!==null,["show"]:o,["hide"]:!o},id:this.el.id||null,"aria-label":this.ariaLabel,role:"status"},c==="icon"&&a("slot",{name:"badge-icon"}),c==="text"&&a("ic-typography",{variant:i==="small"?"badge-small":"badge"},this.getTextLabel()))}static get delegatesFocus(){return true}get el(){return i(this)}};u.style=d;export{u as ic_badge};
2
- //# sourceMappingURL=p-00c21dd7.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icBadgeCss","Badge","this","ariaLabel","setBadgeColour","customColor","convertToRGBA","colorRGBA","customColorRGBA","el","style","backgroundColor","r","toString","g","b","a","getBadgeForeground","red","green","blue","variant","parseInt","getCssProperty","info","hexToRgba","neutral","light","brightness","foregroundColour","IcThemeForegroundEnum","Dark","Light","getTextLabel","label","textLabel","maxNumber","Number","setAccessibleLabel","parentElType","getParentElementType","parentElAriaLabel","getParentElement","defaultAriaLabel","isAccessibleLabelDefined","accessibleLabel","isPropDefined","componentWillLoad","componentDidLoad","type","onComponentRequiredPropUndefined","prop","propName","showBadge","visible","hideBadge","render","position","size","h","Host","class","id","role","name"],"sources":["src/components/ic-badge/ic-badge.css?tag=ic-badge&encapsulation=shadow","src/components/ic-badge/ic-badge.tsx"],"sourcesContent":["@media (prefers-reduced-motion: no-preference) {\n :host(.show) {\n animation: expand var(--ic-transition-duration-slow);\n }\n\n :host(.hide) {\n animation: shrink var(--ic-transition-duration-slow);\n }\n}\n\n:host {\n display: flex;\n height: var(--ic-space-md);\n min-width: var(--ic-space-md);\n width: fit-content;\n border-radius: calc(2 * var(--ic-space-xxl));\n position: absolute;\n}\n\n:host(.neutral) {\n background-color: var(--ic-architectural-500);\n}\n\n:host(.light) {\n background-color: var(--ic-architectural-40);\n}\n\n:host(.info) {\n background-color: var(--ic-status-info);\n}\n\n:host(.warning) {\n background-color: var(--ic-status-warning-mid);\n}\n\n:host(.error) {\n background-color: var(--ic-status-error);\n}\n\n:host(.success) {\n background-color: var(--ic-status-success);\n}\n\n:host(.small) {\n height: var(--ic-space-sm);\n min-width: var(--ic-space-sm);\n}\n\n:host(.large) {\n height: calc(var(--ic-space-md) + var(--ic-space-xxs));\n min-width: calc(var(--ic-space-md) + var(--ic-space-xxs));\n}\n\n:host(.dot.default) {\n height: var(--ic-space-xs);\n width: var(--ic-space-xs);\n min-width: var(--ic-space-xs);\n}\n\n:host(.dot.small) {\n height: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n width: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n min-width: calc(var(--ic-space-xxs) + var(--ic-space-xxxs));\n}\n\n:host(.dot.large) {\n height: var(--ic-space-sm);\n width: var(--ic-space-sm);\n min-width: var(--ic-space-sm);\n}\n\n:host(.foreground-dark) ::slotted(*) {\n fill: var(--ic-color-primary-text);\n}\n\n:host(.foreground-light) ::slotted(*) {\n fill: white;\n}\n\n:host(.foreground-dark) ic-typography {\n color: var(--ic-color-primary-text);\n}\n\n:host(.foreground-light) ic-typography {\n color: white;\n}\n\n:host(.text) ic-typography {\n align-self: center;\n padding: 0 calc((var(--ic-space-xs) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px);\n}\n\n:host(.text.small) ic-typography {\n padding: 0 0.2132rem;\n}\n\n:host(.text.large) ic-typography {\n padding: 0 calc((var(--ic-space-sm) + var(--ic-space-1px)) / 2)\n var(--ic-space-1px);\n}\n\n:host(.icon) ::slotted(svg) {\n width: var(--ic-space-sm);\n height: var(--ic-space-sm);\n padding: var(--ic-space-xxxs);\n}\n\n:host(.icon.small) ::slotted(svg) {\n width: var(--ic-space-xs);\n height: var(--ic-space-xs);\n}\n\n:host(.icon.large) ::slotted(svg) {\n width: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n height: calc(var(--ic-space-sm) + var(--ic-space-xxxs));\n padding: calc(var(--ic-space-xxxs) + var(--ic-space-1px));\n}\n\n:host(.far) {\n top: calc(-1 * var(--ic-space-xs));\n right: calc(-1 * var(--ic-space-xs));\n}\n\n:host(.far.small),\n:host(.dot.far.large) {\n top: calc(-1 * var(--ic-space-xxs));\n right: calc(-1 * var(--ic-space-xxs));\n}\n\n:host(.dot.far),\n:host(.dot.far.small) {\n top: calc(-1 * var(--ic-space-xxxs));\n right: calc(-1 * var(--ic-space-xxxs));\n}\n\n:host(.near) {\n top: calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));\n right: calc(-1 * calc(var(--ic-space-xxs) + var(--ic-space-1px)));\n}\n\n:host(.dot.near) {\n top: calc(-1 * var(--ic-space-1px));\n right: calc(-1 * var(--ic-space-1px));\n}\n\n:host(.inline) {\n position: static;\n}\n\n:host(.hide) {\n visibility: hidden !important;\n transition: visibility var(--ic-transition-duration-slow);\n}\n\n@keyframes expand {\n from {\n opacity: 0;\n transform: scale(0);\n }\n\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes shrink {\n from {\n opacity: 1;\n transform: scale(1);\n }\n\n to {\n opacity: 0;\n transform: scale(0);\n }\n}\n","import { Component, Element, Host, Method, Prop, h } from \"@stencil/core\";\nimport {\n IcBadgePositions,\n IcBadgeTypes,\n IcBadgeVariants,\n} from \"./ic-badge.types\";\nimport {\n IcColorRGBA,\n IcSizes,\n IcThemeForeground,\n IcThemeForegroundEnum,\n IcColor,\n} from \"../../utils/types\";\nimport {\n convertToRGBA,\n getCssProperty,\n getParentElement,\n getParentElementType,\n hexToRgba,\n isPropDefined,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\n\n/**\n * @slot badge-icon - Icon will be rendered inside the badge if type is set to icon.\n */\n@Component({\n tag: \"ic-badge\",\n styleUrl: \"ic-badge.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class Badge {\n private ariaLabel: string = null;\n private customColorRGBA: IcColorRGBA;\n private foregroundColour: IcThemeForeground;\n\n @Element() el: HTMLIcBadgeElement;\n\n /**\n * The accessible label of the badge component to provide context for screen reader users.\n */\n @Prop() accessibleLabel?: string;\n\n /**\n * The custom badge colour. This will only style the badge component if variant=\"custom\".\n * Can be a hex value e.g. \"#ff0000\", RGB e.g. \"rgb(255, 0, 0)\", or RGBA e.g. \"rgba(255, 0, 0, 1)\".\n */\n @Prop() customColor?: IcColor = null;\n\n /**\n * The maximum number shown on the badge appended with a +.\n * This will only be displayed if type=\"text\" and textLabel is not empty.\n */\n @Prop() maxNumber?: number;\n\n /**\n * The positioning of the badge in reference to the parent element.\n */\n @Prop() position?: IcBadgePositions = \"far\";\n\n /**\n * The size of the badge to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The text displayed in the badge. This will only be displayed if type=\"text\".\n */\n @Prop() textLabel?: string;\n\n /**\n * The type of badge to be displayed.\n */\n @Prop() type?: IcBadgeTypes = \"text\";\n\n /**\n * The variant of the badge to be displayed.\n */\n @Prop() variant?: IcBadgeVariants = \"neutral\";\n\n /**\n * If `true`, the badge will be displayed.\n */\n @Prop({ mutable: true }) visible: boolean = true;\n\n componentWillLoad(): void {\n this.variant === \"custom\" && this.setBadgeColour();\n\n this.getBadgeForeground();\n\n this.setAccessibleLabel();\n }\n\n componentDidLoad(): void {\n this.type === \"text\" &&\n onComponentRequiredPropUndefined(\n [{ prop: this.textLabel, propName: \"text-label\" }],\n \"Badge\"\n );\n }\n\n /**\n * @deprecated This method should not be used anymore. Use visible prop to set badge visibility.\n */\n @Method()\n async showBadge(): Promise<void> {\n this.visible = true;\n }\n\n /**\n * @deprecated This method should not be used anymore. Use visible prop to set badge visibility.\n */\n @Method()\n async hideBadge(): Promise<void> {\n this.visible = false;\n }\n\n private setBadgeColour = () => {\n if (this.customColor !== null && convertToRGBA(this.customColor) !== null) {\n const colorRGBA = convertToRGBA(this.customColor);\n this.customColorRGBA = colorRGBA;\n this.el.style.backgroundColor = `rgba(${colorRGBA.r.toString()}, ${colorRGBA.g.toString()}, ${colorRGBA.b.toString()}, ${colorRGBA.a.toString()})`;\n }\n };\n\n private getBadgeForeground = () => {\n let red: number;\n let green: number;\n let blue: number;\n\n switch (this.variant) {\n case \"custom\":\n red = this.customColorRGBA.r;\n green = this.customColorRGBA.g;\n blue = this.customColorRGBA.b;\n break;\n case \"error\":\n red = parseInt(getCssProperty(\"--ic-status-error-r\"));\n green = parseInt(getCssProperty(\"--ic-status-error-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-error-b\"));\n break;\n case \"success\":\n red = parseInt(getCssProperty(\"--ic-status-success-r\"));\n green = parseInt(getCssProperty(\"--ic-status-success-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-success-b\"));\n break;\n case \"warning\":\n red = parseInt(getCssProperty(\"--ic-status-warning-r\"));\n green = parseInt(getCssProperty(\"--ic-status-warning-g\"));\n blue = parseInt(getCssProperty(\"--ic-status-warning-b\"));\n break;\n case \"info\": {\n const info = hexToRgba(getCssProperty(\"--ic-status-info\"));\n red = info.r;\n green = info.g;\n blue = info.b;\n break;\n }\n case \"neutral\": {\n const neutral = hexToRgba(getCssProperty(\"--ic-architectural-500\"));\n red = neutral.r;\n green = neutral.g;\n blue = neutral.b;\n break;\n }\n case \"light\": {\n const light = hexToRgba(getCssProperty(\"--ic-architectural-40\"));\n red = light.r;\n green = light.g;\n blue = light.b;\n break;\n }\n }\n\n const brightness = (red * 299 + green * 587 + blue * 114) / 1000;\n this.foregroundColour =\n brightness > 133.3505\n ? IcThemeForegroundEnum.Dark\n : IcThemeForegroundEnum.Light;\n };\n\n private getTextLabel = () => {\n let label;\n if (this.textLabel !== null) {\n if (this.maxNumber !== null) {\n label =\n Number(this.textLabel) > this.maxNumber\n ? `${this.maxNumber}+`\n : this.textLabel;\n } else {\n label = this.textLabel;\n }\n }\n return label;\n };\n\n // Set aria-label on badge and / or parent element\n // Aria-describedby seems to not work, probably due to shadow DOM\n private setAccessibleLabel = () => {\n const parentElType = getParentElementType(this.el);\n const parentElAriaLabel = getParentElement(this.el).ariaLabel;\n const defaultAriaLabel = this.isAccessibleLabelDefined()\n ? this.accessibleLabel\n : this.textLabel || \"with badge being displayed\";\n\n if (getParentElement(this.el) !== null) {\n if (\n parentElType !== \"IC-CARD\" &&\n (parentElType !== \"IC-TAB\" ||\n (parentElType === \"IC-TAB\" && parentElAriaLabel))\n ) {\n getParentElement(this.el).ariaLabel = `${\n parentElAriaLabel ? `${parentElAriaLabel} ,` : \"\"\n } ${defaultAriaLabel}`;\n } else {\n this.ariaLabel = `, ${defaultAriaLabel}`;\n }\n }\n };\n\n private isAccessibleLabelDefined = () => {\n return isPropDefined(this.accessibleLabel) && this.accessibleLabel !== null;\n };\n\n render() {\n const { position, size, type, variant, foregroundColour, visible } = this;\n\n return (\n <Host\n class={{\n [`${position}`]: true,\n [`${size}`]: true,\n [`${variant}`]: true,\n [`${type}`]: true,\n [`foreground-${foregroundColour}`]: foregroundColour !== null,\n [\"show\"]: visible,\n [\"hide\"]: !visible,\n }}\n id={this.el.id || null}\n aria-label={this.ariaLabel}\n role=\"status\"\n >\n {type === \"icon\" && <slot name=\"badge-icon\"></slot>}\n {type === \"text\" && (\n <ic-typography variant={size === \"small\" ? \"badge-small\" : \"badge\"}>\n {this.getTextLabel()}\n </ic-typography>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"2KAAA,MAAMA,EAAa,u/F,MCiCNC,EAAK,M,yBACRC,KAAAC,UAAoB,KAqFpBD,KAAAE,eAAiB,KACvB,GAAIF,KAAKG,cAAgB,MAAQC,EAAcJ,KAAKG,eAAiB,KAAM,CACzE,MAAME,EAAYD,EAAcJ,KAAKG,aACrCH,KAAKM,gBAAkBD,EACvBL,KAAKO,GAAGC,MAAMC,gBAAkB,QAAQJ,EAAUK,EAAEC,eAAeN,EAAUO,EAAED,eAAeN,EAAUQ,EAAEF,eAAeN,EAAUS,EAAEH,a,GAIjIX,KAAAe,mBAAqB,KAC3B,IAAIC,EACJ,IAAIC,EACJ,IAAIC,EAEJ,OAAQlB,KAAKmB,SACX,IAAK,SACHH,EAAMhB,KAAKM,gBAAgBI,EAC3BO,EAAQjB,KAAKM,gBAAgBM,EAC7BM,EAAOlB,KAAKM,gBAAgBO,EAC5B,MACF,IAAK,QACHG,EAAMI,SAASC,EAAe,wBAC9BJ,EAAQG,SAASC,EAAe,wBAChCH,EAAOE,SAASC,EAAe,wBAC/B,MACF,IAAK,U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AChC,CACAC,EAAiBxC,KAAKO,IAAIN,UAAY,GACpCsC,EAAoB,GAAGA,MAAwB,MAC7CE,G,KACC,CACLzC,KAAKC,UAAY,KAAKwC,G,IAKpBzC,KAAA0C,yBAA2B,IAC1BE,EAAc5C,KAAK2C,kBAAoB3C,KAAK2C,kBAAoB,K,gDA9KzC,K,uCAWM,M,UAKb,U,mCAUK,O,aAKM,U,aAKQ,I,CAE5C,iBAAAE,GACE7C,KAAKmB,UAAY,UAAYnB,KAAKE,iBAElCF,KAAKe,qBAELf,KAAKoC,oB,CAGP,gBAAAU,GACE9C,KAAK+C,OAAS,QACZC,EACE,CAAC,CAAEC,KAAMjD,KAAKiC,UAAWiB,SAAU,eACnC,Q,CAQN,eAAMC,GACJnD,KAAKoD,QAAU,I,CAOjB,eAAMC,GACJrD,KAAKoD,QAAU,K,CA8GjB,MAAAE,GACE,MAAMC,SAAEA,EAAQC,KAAEA,EAAIT,KAAEA,EAAI5B,QAAEA,EAAOQ,iBAAEA,EAAgByB,QAAEA,GAAYpD,KAErE,OACEyD,EAACC,EAAI,CACHC,MAAO,CACL,CAAC,GAAGJ,KAAa,KACjB,CAAC,GAAGC,KAAS,KACb,CAAC,GAAGrC,KAAY,KAChB,CAAC,GAAG4B,KAAS,KACb,CAAC,cAAcpB,KAAqBA,IAAqB,KACzD,CAAC,QAASyB,EACV,CAAC,SAAUA,GAEbQ,GAAI5D,KAAKO,GAAGqD,IAAM,KAAI,aACV5D,KAAKC,UACjB4D,KAAK,UAEJd,IAAS,QAAUU,EAAA,QAAMK,KAAK,eAC9Bf,IAAS,QACRU,EAAA,iBAAetC,QAASqC,IAAS,QAAU,cAAgB,SACxDxD,KAAK+B,gB"}
@@ -1,2 +0,0 @@
1
- import{r as t,h as e,g as i}from"./p-6b5e91e2.js";import{o,a as n}from"./p-e4d0d1fb.js";import"./p-26b7b18f.js";const a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" aria-hidden="true">\n <path d="M0 8L1.41 9.41L7 3.83V16H9V3.83L14.58 9.42L16 8L8 0L0 8Z"/>\n</svg>\n`;const r='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:absolute;right:0}button{position:fixed;right:var(--ic-space-md);bottom:var(--ic-space-md);height:2.5rem;align-items:center;padding:var(--ic-space-xs) var(--ic-space-md) var(--ic-space-xs)\n var(--ic-space-sm);margin:0;gap:var(--ic-space-xs);display:flex;background-color:var(--ic-architectural-white);border:var(--ic-border-width) solid var(--ic-action-default);outline-width:inherit;box-sizing:border-box;box-shadow:var(--ic-elevation-overlay);border-radius:5rem;text-decoration:none;visibility:hidden;opacity:0;transition:visibility 0s linear var(--ic-transition-duration-slow),\n opacity var(--ic-transition-duration-slow);cursor:pointer;z-index:var(--ic-z-index-back-to-top)}button:hover{text-decoration:none;background-color:var(--ic-action-default-bg-hover-no-alpha);border:var(--ic-border-width) solid var(--ic-action-default-hover)}button:active{text-decoration:none;background-color:var(--ic-action-default-bg-active-no-alpha);border:var(--ic-border-width) solid var(--ic-action-default-active)}button:focus{box-shadow:var(--ic-border-focus)}.ic-back-to-top-link.show{visibility:visible;opacity:1;transition:visibility 0s linear 0s,\n opacity var(--ic-transition-duration-slow),\n box-shadow var(--ic-easing-transition-fast)}.ic-back-to-top-link.by-footer{position:relative;right:var(--ic-space-md);bottom:3.5rem}.ic-back-to-top-link.offset-banner{margin-bottom:var(--ic-space-lg)}.ic-back-to-top-icon{fill:var(--ic-action-default);padding-left:var(--ic-space-xxs);padding-top:var(--ic-space-xxxs)}.ic-back-to-top-icon>svg{height:var(--ic-space-md);width:var(--ic-space-md);display:inline-block}.ic-back-to-top-link span{color:var(--ic-action-default)}.ic-back-to-top-link:hover .ic-back-to-top-icon{fill:var(--ic-action-default-hover)}.ic-back-to-top-link:hover span{color:var(--ic-action-default-hover)}@media (forced-colors: active){.ic-back-to-top-icon{fill:currentcolor}}';const s="Back to top";const c=class{constructor(e){t(this,e);this.topObserver=null;this.setTargetElVisible=t=>{this.targetElVisible=t};this.setFooterVisible=t=>{this.checkForClassificationBanner();this.footerVisible=typeof window!=="undefined"&&window.scrollY===0?false:t};this.targetElObserverCallback=t=>{this.setTargetElVisible(t[0].isIntersecting)};this.footerObserverCallback=t=>{this.setFooterVisible(t[0].isIntersecting)};this.findTargetEl=t=>{let e=null;if(t===null||t===undefined){console.log("Error: No target ID specified for back to top component - defaulting to top of page")}else{e=document.querySelector(`${t.startsWith("#")?"":"#"}${t}`);if(e===null){console.log(`Error: Back to top target element '${t}' not found - defaulting to top of page`)}}return e};this.createTopObserver=t=>{this.targetEl=this.findTargetEl(t);let e;if(this.topObserver!==null){const t=document.querySelector("#ic-back-to-top-target");if(t!==null){this.topObserver.unobserve(t);t.remove()}}if(this.targetEl===null){e=document.body;this.targetEl=e.firstElementChild;this.isTargetElNull=true}else{e=this.targetEl.parentNode;this.isTargetElNull=false}const i=document.createElement("div");i.setAttribute("id","ic-back-to-top-target");e.insertBefore(i,this.targetEl);const o=getComputedStyle(this.targetEl).marginTop;this.topObserver=new IntersectionObserver(this.targetElObserverCallback,{threshold:[0],rootMargin:`${o} 0px 0px 0px`});this.topObserver.observe(i)};this.handleClick=()=>{if(this.isTargetElNull){window.scrollTo(0,0)}else{this.targetEl.scrollIntoView()}};this.checkForClassificationBanner=()=>{const t=document.querySelectorAll("ic-classification-banner:not([inline='true'])");this.bannerOffset=t.length>0};this.bannerOffset=false;this.footerVisible=false;this.targetElVisible=true;this.target=undefined}watchPropHandler(t,e){o(e,t,(()=>{this.createTopObserver(t)}))}componentWillLoad(){this.createTopObserver(this.target);this.checkForClassificationBanner();let t=document.querySelectorAll("ic-footer");if(t.length===0){t=document.querySelectorAll("footer")}if(t.length){const e=t[t.length-1];const i=this.bannerOffset?.15:0;const o=new IntersectionObserver(this.footerObserverCallback,{threshold:[i]});o.observe(e)}}componentDidLoad(){n([{prop:this.target,propName:"target"}],"Back to Top")}render(){const{bannerOffset:t,targetElVisible:i,footerVisible:o}=this;return e("button",{class:{["ic-back-to-top-link"]:true,["offset-banner"]:t,["show"]:!i,["by-footer"]:o},"aria-label":s,onClick:this.handleClick},e("span",{class:"ic-back-to-top-icon",innerHTML:a}),e("ic-typography",{variant:"subtitle-small"},e("span",null,s)))}static get delegatesFocus(){return true}get el(){return i(this)}static get watchers(){return{target:["watchPropHandler"]}}};c.style=r;export{c as ic_back_to_top};
2
- //# sourceMappingURL=p-02ad4585.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icBackToTopCss","backToTopLabel","BackToTop","this","topObserver","setTargetElVisible","visible","targetElVisible","setFooterVisible","checkForClassificationBanner","footerVisible","window","scrollY","targetElObserverCallback","entries","isIntersecting","footerObserverCallback","findTargetEl","target","targetElement","undefined","console","log","document","querySelector","startsWith","createTopObserver","targetEl","objParent","observedEl","unobserve","remove","body","firstElementChild","isTargetElNull","parentNode","objBackToTopTargetEl","createElement","setAttribute","insertBefore","marginTop","getComputedStyle","IntersectionObserver","threshold","rootMargin","observe","handleClick","scrollTo","scrollIntoView","banners","querySelectorAll","bannerOffset","length","watchPropHandler","newValue","oldValue","onComponentPropUndefinedChange","componentWillLoad","footers","footerEl","footerObserver","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","render","h","class","onClick","innerHTML","ArrowUpward","variant"],"sources":["src/components/ic-back-to-top/ic-back-to-top.css?tag=ic-back-to-top&encapsulation=shadow","src/components/ic-back-to-top/ic-back-to-top.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-back-to-top: z-index of back to top\n */\n\n:host {\n display: block;\n position: absolute;\n right: 0;\n}\n\nbutton {\n position: fixed;\n right: var(--ic-space-md);\n bottom: var(--ic-space-md);\n height: 2.5rem;\n align-items: center;\n padding: var(--ic-space-xs) var(--ic-space-md) var(--ic-space-xs)\n var(--ic-space-sm);\n margin: 0;\n gap: var(--ic-space-xs);\n display: flex;\n background-color: var(--ic-architectural-white);\n border: var(--ic-border-width) solid var(--ic-action-default);\n outline-width: inherit;\n box-sizing: border-box;\n box-shadow: var(--ic-elevation-overlay);\n border-radius: 5rem;\n text-decoration: none;\n visibility: hidden;\n opacity: 0;\n transition: visibility 0s linear var(--ic-transition-duration-slow),\n opacity var(--ic-transition-duration-slow);\n cursor: pointer;\n z-index: var(--ic-z-index-back-to-top);\n}\n\nbutton:hover {\n text-decoration: none;\n background-color: var(--ic-action-default-bg-hover-no-alpha);\n border: var(--ic-border-width) solid var(--ic-action-default-hover);\n}\n\nbutton:active {\n text-decoration: none;\n background-color: var(--ic-action-default-bg-active-no-alpha);\n border: var(--ic-border-width) solid var(--ic-action-default-active);\n}\n\nbutton:focus {\n box-shadow: var(--ic-border-focus);\n}\n\n.ic-back-to-top-link.show {\n visibility: visible;\n opacity: 1;\n transition: visibility 0s linear 0s,\n opacity var(--ic-transition-duration-slow),\n box-shadow var(--ic-easing-transition-fast);\n}\n\n.ic-back-to-top-link.by-footer {\n position: relative;\n right: var(--ic-space-md);\n bottom: 3.5rem;\n}\n\n.ic-back-to-top-link.offset-banner {\n margin-bottom: var(--ic-space-lg);\n}\n\n.ic-back-to-top-icon {\n fill: var(--ic-action-default);\n padding-left: var(--ic-space-xxs);\n padding-top: var(--ic-space-xxxs);\n}\n\n.ic-back-to-top-icon > svg {\n height: var(--ic-space-md);\n width: var(--ic-space-md);\n display: inline-block;\n}\n\n.ic-back-to-top-link span {\n color: var(--ic-action-default);\n}\n\n.ic-back-to-top-link:hover .ic-back-to-top-icon {\n fill: var(--ic-action-default-hover);\n}\n\n.ic-back-to-top-link:hover span {\n color: var(--ic-action-default-hover);\n}\n\n@media (forced-colors: active) {\n .ic-back-to-top-icon {\n fill: currentcolor;\n }\n}\n","import { Component, h, Element, Prop, State, Watch } from \"@stencil/core\";\nimport ArrowUpward from \"./assets/ArrowUpward.svg\";\nimport {\n onComponentPropUndefinedChange,\n onComponentRequiredPropUndefined,\n} from \"../../utils/helpers\";\n\nconst backToTopLabel = \"Back to top\";\n\n@Component({\n tag: \"ic-back-to-top\",\n styleUrl: \"ic-back-to-top.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BackToTop {\n private isTargetElNull: boolean;\n private targetEl: Element;\n private topObserver: IntersectionObserver = null;\n\n @Element() el: HTMLIcBackToTopElement;\n\n @State() bannerOffset: boolean = false;\n @State() footerVisible: boolean = false;\n @State() targetElVisible: boolean = true;\n\n /**\n * The ID of the element to jump back to when the link is clicked.\n */\n @Prop() target!: string;\n\n @Watch(\"target\")\n watchPropHandler(newValue: string, oldValue: string): void {\n //added for gatsby rehydration issue where prop is initially undefined but then changes to actual value\n onComponentPropUndefinedChange(oldValue, newValue, () => {\n this.createTopObserver(newValue);\n });\n }\n\n componentWillLoad(): void {\n this.createTopObserver(this.target);\n this.checkForClassificationBanner();\n\n //observer for when footer scrolls into view\n let footers = document.querySelectorAll(\n \"ic-footer\"\n ) as NodeListOf<HTMLElement>;\n if (footers.length === 0) {\n footers = document.querySelectorAll(\"footer\");\n }\n\n if (footers.length) {\n const footerEl = footers[footers.length - 1];\n const threshold = this.bannerOffset ? 0.15 : 0;\n const footerObserver = new IntersectionObserver(\n this.footerObserverCallback,\n { threshold: [threshold] }\n );\n footerObserver.observe(footerEl);\n }\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.target, propName: \"target\" }],\n \"Back to Top\"\n );\n }\n\n private setTargetElVisible = (visible: boolean) => {\n this.targetElVisible = visible;\n };\n\n private setFooterVisible = (visible: boolean) => {\n this.checkForClassificationBanner();\n this.footerVisible =\n typeof window !== \"undefined\" && window.scrollY === 0 ? false : visible;\n };\n\n private targetElObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setTargetElVisible(entries[0].isIntersecting);\n };\n\n private footerObserverCallback = (entries: IntersectionObserverEntry[]) => {\n this.setFooterVisible(entries[0].isIntersecting);\n };\n\n private findTargetEl = (target: string): Element => {\n let targetElement: Element = null;\n if (target === null || target === undefined) {\n console.log(\n \"Error: No target ID specified for back to top component - defaulting to top of page\"\n );\n } else {\n targetElement = document.querySelector(\n `${target.startsWith(\"#\") ? \"\" : \"#\"}${target}`\n );\n if (targetElement === null) {\n console.log(\n `Error: Back to top target element '${target}' not found - defaulting to top of page`\n );\n }\n }\n return targetElement;\n };\n\n private createTopObserver = (target: string) => {\n this.targetEl = this.findTargetEl(target);\n let objParent: HTMLElement;\n\n //remove old element & observer\n if (this.topObserver !== null) {\n const observedEl = document.querySelector(\"#ic-back-to-top-target\");\n if (observedEl !== null) {\n this.topObserver.unobserve(observedEl);\n observedEl.remove();\n }\n }\n\n if (this.targetEl === null) {\n objParent = document.body;\n this.targetEl = objParent.firstElementChild;\n this.isTargetElNull = true;\n } else {\n objParent = this.targetEl.parentNode as HTMLElement;\n this.isTargetElNull = false;\n }\n\n //insert a new 0px height element before specified target that can be used to determine when page is scrolled\n const objBackToTopTargetEl = document.createElement(\"div\");\n objBackToTopTargetEl.setAttribute(\"id\", \"ic-back-to-top-target\");\n objParent.insertBefore(objBackToTopTargetEl, this.targetEl);\n\n // resize observer needs to factor in any top margin on the target el\n const marginTop = getComputedStyle(this.targetEl).marginTop;\n this.topObserver = new IntersectionObserver(this.targetElObserverCallback, {\n threshold: [0],\n rootMargin: `${marginTop} 0px 0px 0px`,\n });\n this.topObserver.observe(objBackToTopTargetEl);\n };\n\n private handleClick = () => {\n if (this.isTargetElNull) {\n window.scrollTo(0, 0);\n } else {\n this.targetEl.scrollIntoView();\n }\n };\n\n private checkForClassificationBanner = () => {\n //adjust position for classification banner at bottom\n const banners = document.querySelectorAll(\n \"ic-classification-banner:not([inline='true'])\"\n );\n this.bannerOffset = banners.length > 0;\n };\n\n render() {\n const { bannerOffset, targetElVisible, footerVisible } = this;\n return (\n <button\n class={{\n [\"ic-back-to-top-link\"]: true,\n [\"offset-banner\"]: bannerOffset,\n [\"show\"]: !targetElVisible,\n [\"by-footer\"]: footerVisible,\n }}\n aria-label={backToTopLabel}\n onClick={this.handleClick}\n >\n <span class=\"ic-back-to-top-icon\" innerHTML={ArrowUpward} />\n\n <ic-typography variant=\"subtitle-small\">\n <span>{backToTopLabel}</span>\n </ic-typography>\n </button>\n );\n }\n}\n"],"mappings":"8RAAA,MAAMA,EAAiB,0uICOvB,MAAMC,EAAiB,c,MASVC,EAAS,M,yBAGZC,KAAAC,YAAoC,KAmDpCD,KAAAE,mBAAsBC,IAC5BH,KAAKI,gBAAkBD,CAAO,EAGxBH,KAAAK,iBAAoBF,IAC1BH,KAAKM,+BACLN,KAAKO,qBACIC,SAAW,aAAeA,OAAOC,UAAY,EAAI,MAAQN,CAAO,EAGnEH,KAAAU,yBAA4BC,IAClCX,KAAKE,mBAAmBS,EAAQ,GAAGC,eAAe,EAG5CZ,KAAAa,uBAA0BF,IAChCX,KAAKK,iBAAiBM,EAAQ,GAAGC,eAAe,EAG1CZ,KAAAc,aAAgBC,IACtB,IAAIC,EAAyB,KAC7B,GAAID,IAAW,MAAQA,IAAWE,UAAW,CAC3CC,QAAQC,IACN,sF,KAEG,CACLH,EAAgBI,SAASC,cACvB,GAAGN,EAAOO,WAAW,KAAO,GAAK,MAAMP,KAEzC,GAAIC,IAAkB,KAAM,CAC1BE,QAAQC,IACN,sCAAsCJ,2C,EAI5C,OAAOC,CAAa,EAGdhB,KAAAuB,kBAAqBR,IAC3Bf,KAAKwB,SAAWxB,KAAKc,aAAaC,GAClC,IAAIU,EAGJ,GAAIzB,KAAKC,cAAgB,KAAM,CAC7B,MAAMyB,EAAaN,SAASC,cAAc,0BAC1C,GAAIK,IAAe,KAAM,CACvB1B,KAAKC,YAAY0B,UAAUD,GAC3BA,EAAWE,Q,EAIf,GAAI5B,KAAKwB,WAAa,KAAM,CAC1BC,EAAYL,SAASS,KACrB7B,KAAKwB,SAAWC,EAAUK,kBAC1B9B,KAAK+B,eAAiB,I,KACjB,CACLN,EAAYzB,KAAKwB,SAASQ,WAC1BhC,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CACL,CAAC,uBAAwB,KACzB,CAAC,iBAAkBhB,EACnB,CAAC,SAAU5C,EACX,CAAC,aAAcG,GAChB,aACWT,EACZmE,QAASjE,KAAK2C,aAEdoB,EAAA,QAAMC,MAAM,sBAAsBE,UAAWC,IAE7CJ,EAAA,iBAAeK,QAAQ,kBACrBL,EAAA,YAAOjE,I"}
@@ -1,2 +0,0 @@
1
- import{r as t,c as e,f as i,h as s,H as a,g as n}from"./p-6b5e91e2.js";import{a as o}from"./p-26b7b18f.js";import{M as r,m as l,w as h,l as c,r as d,a as u,q as p,n as m,i as b,G as f,x}from"./p-e4d0d1fb.js";const g='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block}:host(.fullwidth){width:100%}::-moz-placeholder{color:var(--ic-color-tertiary-text);opacity:1}::placeholder{color:var(--ic-color-tertiary-text);opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs)}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(--ic-architectural-200)}input.readonly,textarea.readonly{color:var(--ic-color-primary-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type="number"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.maxlengthtext{color:var(--ic-color-secondary-text)}.no-left-pad{padding-left:0}::slotted([slot="icon"]){fill:var(--ic-color-tertiary-text)}.has-value ::slotted([slot="icon"]){fill:var(--ic-color-primary-text)}.charcount{margin-right:calc(-1 * var(--ic-space-xxxs))}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}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot="icon"]){fill:currentcolor}}';let y=0;const v=[...x,"title"];const w=class{constructor(s){t(this,s);this.getValidationText=e(this,"getValidationText",7);this.icBlur=e(this,"icBlur",7);this.icChange=e(this,"icChange",7);this.icFocus=e(this,"icFocus",7);this.icInput=e(this,"icInput",7);this.icKeydown=e(this,"icKeydown",7);this.inheritedAttributes={};this.showLeftIcon=this.hasLeftIconSlot();this.hostMutationObserver=null;this.getMaxLengthExceeded=t=>{this.numChars=t.length;if(this.type==="number"){this.minValueUnattained=t&&Number(t)<Number(this.min)?true:false;this.maxValueExceeded=Number(t)>Number(this.max)?true:false}if(this.maxLength>0){this.maxLengthExceeded=t.length>this.maxLength?true:false}};this.getMaxCharactersReached=t=>{this.numChars=t.length;if(this.maxCharacters>0){this.maxCharactersReached=this.numChars>=this.maxCharacters;if(this.maxCharactersError&&!this.maxCharactersReached){this.maxCharactersError=false}}};this.getMinCharactersUnattained=t=>{this.numChars=t.length;if(this.minCharacters>0){this.minCharactersUnattained=this.numChars<this.minCharacters}};this.onInput=t=>{this.value=t.target.value;this.icInput.emit({value:this.value})};this.onBlur=t=>{const e=t.target.value;this.getMinCharactersUnattained(e);this.icBlur.emit({value:e})};this.onFocus=t=>{const e=t.target.value;this.icFocus.emit({value:e})};this.isTextArea=()=>this.rows>1;this.getInlineValidationText=()=>{this.getValidationText.emit({value:this.validationText})};this.hasStatus=t=>t!==""&&!this.disabled;this.showStatusText=t=>this.hasStatus(t)&&!(t==o.Success&&this.validationInline)&&!this.validationInlineInternal;this.handleFormReset=()=>{this.value=this.initialValue};this.hostMutationCallback=t=>{let e=false;t.forEach((({attributeName:t})=>{if(v.includes(t)){this.inheritedAttributes[t]=this.el.getAttribute(t);e=true}}));if(e){i(this)}};this.numChars=0;this.maxCharactersReached=false;this.maxCharactersError=false;this.minCharactersUnattained=false;this.maxLengthExceeded=false;this.maxValueExceeded=false;this.minValueUnattained=false;this.ariaActiveDescendant=undefined;this.ariaAutocomplete=undefined;this.ariaExpanded=undefined;this.ariaOwns=undefined;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autoFocus=false;this.disabled=false;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.hiddenInput=true;this.inputId=`ic-text-field-input-${y++}`;this.inputmode="text";this.label=undefined;this.max=undefined;this.maxCharacters=0;this.maxLength=0;this.min=undefined;this.minCharacters=0;this.name=this.inputId;this.placeholder="";this.readonly=false;this.required=false;this.resize=false;this.role=undefined;this.rows=1;this.size="default";this.small=false;this.spellcheck=false;this.truncateValue=undefined;this.type="text";this.validationInline=false;this.validationInlineInternal=false;this.validationStatus="";this.validationText="";this.debounce=0;this.value="";this.initialValue=this.value}debounceChanged(){this.icChange=r(this.icChange,this.debounce)}watchValueHandler(t){if(this.inputEl&&this.inputEl.value!==t){this.inputEl.value=t}this.getMaxLengthExceeded(t);this.getMaxCharactersReached(t);this.icChange.emit({value:t})}connectedCallback(){this.debounceChanged()}disconnectedCallback(){var t;l(this.el,this.handleFormReset);(t=this.hostMutationObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){if(this.value!==this.initialValue){this.watchValueHandler(this.value)}this.getMaxLengthExceeded(this.value);this.getMaxCharactersReached(this.value);this.inheritedAttributes=h(this.el,v);if(this.readonly){this.maxLengthExceeded=false;this.maxValueExceeded=false;this.minValueUnattained=false}c(this.el,this.handleFormReset);d(this.disabled,this.el)}componentDidLoad(){u([{prop:this.label,propName:"label"}],"Text Field");if(this.validationInlineInternal){this.getInlineValidationText()}this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{attributes:true})}handleKeyDown(t){this.icKeydown.emit({event:t});this.maxCharactersError=this.maxCharactersReached}async setFocus(){if(this.inputEl){this.inputEl.focus()}}hasLeftIconSlot(){const t=this.el.querySelector(`[slot="icon"]`);return t!==null}render(){const{inputId:t,name:e,label:i,required:n,size:r,small:l,placeholder:h,helperText:c,rows:d,resize:u,disabled:x,value:g,min:y,max:v,maxLength:w,numChars:k,readonly:z,maxLengthExceeded:C,maxCharacters:I,maxCharactersError:M,maxCharactersReached:F,minCharacters:L,minCharactersUnattained:j,minValueUnattained:q,maxValueExceeded:T,validationStatus:N,validationText:V,validationInline:$,validationInlineInternal:B,spellcheck:W,inputmode:E,fullWidth:H,truncateValue:O,hiddenInput:S}=this;const D=z?true:x;const K=x?"":h;const U=C||T||q||j||M?M?o.Warning:o.Error:N;const _=C?"Maximum length exceeded":M?`Maximum input is ${I} characters`:T?`Maximum value of ${v} exceeded`:q?`Minimum value of ${y} not met`:j?`Minimum input is ${L} characters`:V;const G=z?0:w;const R=C||M||T||q||w===0&&U===o.Error?"assertive":"polite";const A=this.showStatusText(U);const J=this.isTextArea();const P=w>0?t+"-charcount-desc":"";const Q=(P+" "+p(t,c!=="",A)).trim();if(this.showLeftIcon&&!z&&D){this.showLeftIcon=false}const X=U===o.Error?"true":"false";const Y=D&&!z;if(S){m(true,this.el,e,g,D)}return s(a,{class:{["fullwidth"]:H}},s("ic-input-container",{readonly:z,disabled:D},!this.hideLabel&&s("ic-input-label",{for:t,label:i,helperText:c,required:n,disabled:Y,readonly:z}),s("ic-input-component-container",{size:l?"small":r,validationStatus:U,multiLine:J,disabled:D,readonly:z,validationInline:$,fullWidth:H},this.showLeftIcon&&s("span",{class:{["readonly"]:z,["has-value"]:g.length>0},slot:"left-icon"},s("slot",{name:"icon"})),!J?s("input",Object.assign({id:t,name:e,ref:t=>this.inputEl=t,type:this.type,min:y,max:v,value:g,class:{["no-left-pad"]:!this.showLeftIcon&&z,["readonly"]:z,["truncate-value"]:O},placeholder:K,required:n,disabled:D,readonly:z,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":Q,"aria-invalid":X,"aria-activedescendant":this.ariaActiveDescendant,"aria-expanded":this.ariaExpanded,"aria-owns":this.ariaOwns,autocomplete:this.autocomplete,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:W,inputmode:E,role:this.role,maxlength:F?I:null,minlength:j?L:null},this.inheritedAttributes)):s("textarea",Object.assign({id:t,class:{["no-resize"]:u===false||z,["no-left-pad"]:!this.showLeftIcon&&z,["readonly"]:z},name:e,ref:t=>this.inputEl=t,value:g,rows:d,required:n,disabled:D,placeholder:K,readonly:z,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,"aria-label":i,"aria-describedby":Q,"aria-invalid":X,autocapitalize:this.autocapitalize,autoFocus:this.autoFocus,spellcheck:W,inputmode:E,maxlength:F?I:null,minlength:j?L:null},this.inheritedAttributes)),b(this.el,"clear-button")&&s("slot",{name:"clear-button"}),b(this.el,"search-submit-button")&&s("slot",{name:"search-submit-button"})),b(this.el,"menu")&&s("slot",{name:"menu"}),(!f(N)||!f(V)||G>0||T||M||j||q)&&!B&&s("ic-input-validation",{status:this.hasStatus(U)===false||U===o.Success&&$||B?"":U,message:A?_:"",ariaLiveMode:R,for:t,fullWidth:H},!z&&G>0&&s("div",{slot:"validation-message-adornment"},s("ic-typography",{variant:"caption",class:{["maxlengthtext"]:true,["error"]:C,["disabled"]:Y}},s("span",{"aria-live":"polite",id:`${t}-charcount`,class:"charcount"},k,"/",G),s("span",{hidden:true,id:P},"Field can contain a maximum of ",G," characters."))))))}get el(){return n(this)}static get watchers(){return{debounce:["debounceChanged"],value:["watchValueHandler"]}}};w.style=g;export{w as ic_text_field};
2
- //# sourceMappingURL=p-078f7f23.entry.js.map
@@ -1,2 +0,0 @@
1
- import{r as i,c as t,f as s,h as e,H as h,g as a}from"./p-6b5e91e2.js";import{E as n,B as o,m as l,w as r,r as c,l as d,a as u,n as p,q as f,s as b,F as v,x as m}from"./p-e4d0d1fb.js";import{I as g,a as w}from"./p-26b7b18f.js";const x=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />\n</svg>\n`;const y=`<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />\n</svg>\n`;const k='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative}:host(.full-width){width:100%}ic-input-component-container:hover{--border-color:var(--ic-action-dark-hover)}ic-input-component-container:active{--border-color:var(--ic-action-dark-active);color:var(--ic-action-dark-active)}ic-input-component-container.menu-open{--border-color:var(--ic-architectural-400);color:var(--ic-action-dark)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs) !important}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:url("data:image/svg+xml;utf8,<svg fill=\'black\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select option,.select-option-selected{color:var(--ic-color-primary-text)}select:disabled{color:var(--ic-architectural-200);background-image:url("data:image/svg+xml;utf8,<svg fill=\'grey\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none}.select-input:focus{outline:var(--ic-hc-focus-outline)}:host(:not(.disabled)) ic-input-component-container:hover .select-input{background-color:var(--ic-architectural-white)}.select-input[disabled]{pointer-events:none}:host(.searchable) .select-input{cursor:auto}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xs);color:var(--ic-action-dark)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.disabled) .expand-icon,:host(.disabled) .expand-icon>svg>path{color:var(--ic-architectural-200)}:host(.searchable) .expand-icon{padding-left:var(--ic-space-xxs);height:2.25rem}:host(.searchable) .expand-icon>svg{height:2.25rem;padding:0 0.375rem}:host(.searchable:not(.disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-action-dark)}.expand-icon-filled{color:var(--ic-action-dark)}.expand-icon-open,:host(.searchable) .expand-icon-open{transform:rotateX(180deg)}:host(.disabled) .value-text,.placeholder{color:var(--ic-color-tertiary-text)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex;gap:var(--ic-space-xxs);padding-left:2.375rem;align-items:center}:host(.small) .clear-button-container{padding-left:1.875rem}.divider{width:var(--ic-border-width);background-color:var(--ic-architectural-400);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.small) .divider{height:var(--ic-space-md)}.clear-button{position:absolute;right:2.75rem;border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus{background-color:var(--ic-focus-blue);box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow);border-radius:0.25rem}.clear-button:focus *{fill:white}.searchable-select-results-status{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}';let z=0;const L=[...m,"tabindex","title"];const C=class{constructor(e){i(this,e);this.icBlur=t(this,"icBlur",7);this.icChange=t(this,"icChange",7);this.icClear=t(this,"icClear",7);this.icClose=t(this,"icClose",7);this.icFocus=t(this,"icFocus",7);this.icInput=t(this,"icInput",7);this.icOpen=t(this,"icOpen",7);this.icOptionSelect=t(this,"icOptionSelect",7);this.icRetryLoad=t(this,"icRetryLoad",7);this.hasSetDefaultValue=false;this.inheritedAttributes={};this.initialOptionsEmpty=false;this.inputId=`ic-select-input-${z++}`;this.menuId=`${this.inputId}-menu`;this.searchableMenuItemSelected=false;this.ungroupedOptions=[];this.hostMutationObserver=null;this.hostMutationCallback=i=>{let t=false;i.forEach((({attributeName:i})=>{if(L.includes(i)){this.inheritedAttributes[i]=this.el.getAttribute(i);t=true}}));if(t){s(this)}};this.handleRetry=i=>{var t;if(i.detail.keyPressed)(t=this.searchableSelectElement)===null||t===void 0?void 0:t.focus();this.blurredBecauseButtonPressed=true;this.retryButtonClick=true;this.hasSetDefaultValue=true;this.icRetryLoad.emit({value:this.hiddenInputValue})};this.emitIcChange=i=>{if(!this.searchable){this.value=i}clearTimeout(this.debounceIcChange);this.debounceIcChange=window.setTimeout((()=>{this.icChange.emit({value:i})}),this.currDebounce)};this.emitImmediateIcChange=i=>{this.value=i;clearTimeout(this.debounceIcChange);this.icChange.emit({value:i})};this.deduplicateOptions=i=>{const t=[];const s=[];let e;i.forEach((i=>{if(i.children){e=[];i.children.forEach((i=>{if(t.includes(i.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${i.value}) which has been removed.`)}else{t.push(i.value);e.push(i)}}));const h=Object.assign(Object.assign({},i),{children:e});s.push(h)}else{if(t.includes(i.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${i.value}) which has been removed.`)}else{t.push(i.value);s.push(i)}}}));return s};this.setOptionsValuesFromLabels=()=>{if(this.options.length>0&&this.options.map){this.options.map((i=>{if(!i.value){i.value=i.label}}))}};this.setUngroupedOptions=i=>{this.ungroupedOptions=i.detail.options};this.setTextColor=()=>{if(this.nativeSelectElement.selectedIndex===0){this.nativeSelectElement.className="placeholder"}else{this.nativeSelectElement.className="select-option-selected"}};this.setMenuChange=i=>{if(this.open!==i){this.open=i}};this.getLabelFromValue=i=>n(i,this.uniqueOptions);this.getFilteredChildMenuOptions=i=>{let t=i.children;if(this.searchable){t=o(i.children,this.includeDescriptionsInSearch,this.searchableSelectInputValue,this.searchMatchPosition)}else{t=o(i.children,false,this.pressedCharacters,"start")}const s=Object.assign({},i);s.children=t;return s};this.handleNativeSelectChange=()=>{this.icOptionSelect.emit({value:this.nativeSelectElement.value});this.emitImmediateIcChange(this.nativeSelectElement.value);this.setTextColor()};this.handleCustomSelectChange=i=>{if(this.searchable&&i.detail.label===this.emptyOptionListText){this.searchableSelectElement.focus();return}if(this.searchable){this.value=i.detail.value;this.searchableMenuItemSelected=true;if(this.value===this.currValue){this.searchableSelectInputValue=this.getLabelFromValue(this.value)}this.inputValueToFilter=null;this.hiddenInputValue=this.getValueFromLabel(this.searchableSelectInputValue)}this.ariaActiveDescendant=i.detail.optionId;this.icOptionSelect.emit({value:i.detail.value});this.emitIcChange(i.detail.value)};this.handleMenuChange=i=>{this.open=i.detail.open;this.pressedCharacters="";this.searchable&&this.handleFocusIndicatorDisplay()};this.handleMenuKeyPress=i=>{i.cancelBubble=true;this.handleCharacterKeyDown(i.detail.key)};this.handleMenuValueChange=i=>{this.value=i.detail.value};this.handleFocusIndicatorDisplay=()=>{const i=this.el.shadowRoot.querySelector(".focus-indicator");if(this.open){i.classList.add("focus-indicator-enabled")}else{i.classList.remove("focus-indicator-enabled")}};this.handleMouseDown=i=>{if(!this.open){i.preventDefault()}};this.isExternalFiltering=()=>this.searchable&&this.disableFilter;this.handleClick=i=>{var t;if(!this.open){if(this.isExternalFiltering()){this.menu.options=this.filteredOptions}else if(!this.hasTimedOut&&!this.loading&&!((t=this.noOptions)===null||t===void 0?void 0:t.length)&&(!this.searchable||this.searchableMenuItemSelected)){this.noOptions=null;this.menu.options=this.uniqueOptions}}if(i.detail!==0){this.menu.handleClickOpen()}};this.handleExpandIconMouseDown=i=>{if(!this.disabled){i.preventDefault();this.searchableSelectElement.focus();this.handleClick(i)}};this.handleClear=i=>{i.stopPropagation();this.hasTimedOut=false;clearTimeout(this.timeoutTimer);this.noOptions=null;this.emitImmediateIcChange(null);this.icClear.emit();if(this.searchable){this.searchableSelectElement.value=null;this.searchableSelectInputValue=null;this.filteredOptions=this.uniqueOptions;this.hiddenInputValue=null;this.searchableSelectElement.focus()}else{this.customSelectElement.focus()}};this.handleCharacterKeyDown=i=>{if(this.open&&i===" "&&this.pressedCharacters.length===0&&!this.hasTimedOut&&!this.loading){this.setMenuChange(false)}if(i.length===1&&!this.searchable){window.clearTimeout(this.characterKeyPressTimer);this.characterKeyPressTimer=window.setTimeout((()=>this.pressedCharacters=""),1e3);this.pressedCharacters+=i;this.handleFilter();if(!this.noOptions){this.emitImmediateIcChange(this.filteredOptions[0].value)}}else{this.pressedCharacters=""}};this.handleNativeSelectKeyDown=i=>{if(i.key!=="Escape"&&i.key!=="Tab"||this.open){i.cancelBubble=true}this.handleCharacterKeyDown(i.key)};this.handleKeyDown=i=>{if(i.key!=="Escape"&&i.key!=="Tab"||this.open){i.cancelBubble=true}const t=i.key==="ArrowDown"||i.key==="ArrowUp";if(!this.open){if(this.isExternalFiltering()&&(i.key==="Enter"||t)){this.menu.options=this.filteredOptions}else{if(!this.hasTimedOut){this.noOptions=null;this.menu.options=this.uniqueOptions}}}if(this.open&&i.key==="Enter"){this.setMenuChange(false)}else{if(!(t&&this.noOptions!==null)){if(!(i.key===" "&&this.pressedCharacters.length>0)){this.menu.handleKeyboardOpen(i)}this.handleCharacterKeyDown(i.key)}}};this.handleClearButtonFocus=()=>{this.clearButtonFocused=true};this.handleClearButtonBlur=i=>{var t;const s=(t=this.menu)===null||t===void 0?void 0:t.querySelector("#retry-button");if(!(this.searchableSelectElement&&i.relatedTarget===this.searchableSelectElement)&&!(s&&i.relatedTarget===s)){this.setMenuChange(false);this.handleFocusIndicatorDisplay()}this.clearButtonFocused=false};this.handleFilter=()=>{var i;const t=this.deduplicateOptions(this.searchable?[...this.uniqueOptions]:this.ungroupedOptions);let s=false;let e=[];t.map((i=>{if(i.children)s=true}));let h;if(this.searchable){h=o(t,this.includeDescriptionsInSearch,this.inputValueToFilter,this.searchMatchPosition);this.searchableMenuItemSelected=false}else{h=o(t,false,this.pressedCharacters,"start")}if(!s&&((i=h[0])===null||i===void 0?void 0:i.label)!==this.emptyOptionListText){e=h}else if(s){t.map((i=>{if(this.includeGroupTitlesInSearch){if(h.indexOf(i)!==-1){e.push(i)}else{e.push(this.getFilteredChildMenuOptions(i))}}else{e.push(this.getFilteredChildMenuOptions(i))}}))}let a=false;if(s){a=true;e.map((i=>{if(i.children.length>0){a=false}}))}if(e.length>0&&!a){this.noOptions=null;this.filteredOptions=e}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.filteredOptions=this.noOptions}};this.triggerLoading=()=>{this.hasTimedOut=false;this.noOptions=[{label:this.loadingLabel,value:"",loading:true}];if(this.filteredOptions!==this.noOptions&&this.searchable){this.filteredOptions=this.noOptions}else if(this.uniqueOptions!==this.noOptions&&!this.searchable){this.uniqueOptions=this.noOptions}if(this.timeout){this.timeoutTimer=window.setTimeout((()=>{this.loading=false;this.hasTimedOut=true;this.noOptions=[{label:this.loadingErrorLabel,value:"",timedOut:true}];this.filteredOptions=this.noOptions;if(!this.searchable)this.uniqueOptions=this.noOptions}),this.timeout)}};this.getValueFromLabel=i=>{var t;return(t=this.uniqueOptions.find((t=>t.label===i)))===null||t===void 0?void 0:t.value};this.handleSearchableSelectInput=i=>{this.searchableSelectInputValue=i.target.value;this.icInput.emit({value:this.searchableSelectInputValue});this.emitIcChange(this.searchableSelectInputValue);this.hiddenInputValue=this.searchableSelectInputValue;this.inputValueToFilter=this.searchableSelectInputValue;this.setMenuChange(true);if(!this.disableFilter){this.handleFilter();this.debounceAriaLiveUpdate()}};this.updateSearchableSelectResultAriaLive=()=>{const i=this.el.shadowRoot.querySelector(".searchable-select-results-status");if(i){if(this.noOptions!==null){i.innerText=this.emptyOptionListText}else{i.innerText=""}}};this.getDefaultValue=i=>this.getLabelFromValue(i)||i||null;this.onFocus=()=>{this.icFocus.emit()};this.onBlur=({relatedTarget:i})=>{var t;const s=i;if(s!==null&&(s.tagName==="UL"&&s.className.includes("menu")||s.tagName==="LI"&&s.className.includes("option"))){return}const e=(t=this.menu)===null||t===void 0?void 0:t.querySelector("#retry-button");const h=this.searchable&&!!this.menu&&s!==this.menu&&!Array.from(this.menu.querySelectorAll("[role='option']")).includes(s)&&!(this.clearButton&&s===this.clearButton)&&!(e&&s===e);if(h){if(!this.retryButtonClick){this.setMenuChange(false)}this.handleFocusIndicatorDisplay()}this.retryButtonClick=false;this.icBlur.emit()};this.onTimeoutBlur=i=>{if(i.detail.ev.relatedTarget!==this.searchableSelectElement&&!this.blurredBecauseButtonPressed){this.setMenuChange(false);this.handleFocusIndicatorDisplay();this.icBlur.emit()}this.blurredBecauseButtonPressed=false};this.handleFormReset=()=>{this.value=this.initialValue;if(this.searchable){this.searchableSelectInputValue=this.getDefaultValue(this.value);this.hiddenInputValue=this.value}};this.ariaActiveDescendant=undefined;this.clearButtonFocused=false;this.debounceIcChange=undefined;this.hiddenInputValue=undefined;this.noOptions=null;this.open=false;this.pressedCharacters="";this.searchableSelectInputValue=null;this.charactersUntilSuggestions=0;this.disabled=false;this.disableFilter=false;this.emptyOptionListText="No results found";this.form=undefined;this.formaction=undefined;this.formenctype=undefined;this.formmethod=undefined;this.formnovalidate=undefined;this.formtarget=undefined;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.includeDescriptionsInSearch=false;this.includeGroupTitlesInSearch=false;this.label=undefined;this.loadingErrorLabel="Loading Error";this.loadingLabel="Loading...";this.name=this.inputId;this.placeholder="Select an option";this.readonly=false;this.required=false;this.searchable=false;this.searchMatchPosition="anywhere";this.selectOnEnter=false;this.showClearButton=false;this.size="default";this.small=false;this.timeout=undefined;this.validationStatus="";this.validationText="";this.loading=false;this.options=[];this.filteredOptions=this.options;this.uniqueOptions=this.options;this.debounce=0;this.currDebounce=this.debounce;this.value=undefined;this.initialValue=this.value;this.inputValueToFilter=this.value;this.currValue=this.value}loadingHandler(i){i&&this.triggerLoading()}watchOptionsHandler(){if(!this.hasTimedOut){this.loading=false;clearTimeout(this.timeoutTimer);if(this.isExternalFiltering()){if(this.options.length>0){this.setOptionsValuesFromLabels();this.noOptions=null;this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}this.updateSearchableSelectResultAriaLive();this.setDefaultValue()}else{this.setOptionsValuesFromLabels();this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions;if(this.initialOptionsEmpty){this.setDefaultValue();this.initialOptionsEmpty=false}}}else{if(!this.searchable)this.options=this.noOptions}}debounceChangedHandler(i){this.updateOnChangeDebounce(i)}valueChangedHandler(){if(this.value!==this.currValue){this.currValue=this.value}if(this.searchable){this.searchableSelectInputValue=this.getLabelFromValue(this.currValue)||this.currValue}}openChangedHandler(){this.open?this.icOpen.emit():this.icClose.emit()}disconnectedCallback(){var i;l(this.el,this.handleFormReset);(i=this.hostMutationObserver)===null||i===void 0?void 0:i.disconnect()}componentWillLoad(){this.inheritedAttributes=r(this.el,L);c(this.disabled,this.el);this.setOptionsValuesFromLabels();d(this.el,this.handleFormReset);if(!this.options.length){this.initialOptionsEmpty=true;this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}else{this.setDefaultValue();this.uniqueOptions=this.deduplicateOptions(this.options)}}componentDidLoad(){u([{prop:this.label,propName:"label"}],"Select");if(this.loading){this.triggerLoading()}this.hiddenInputValue=this.searchable&&this.currValue;this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{attributes:true})}componentDidRender(){if(this.nativeSelectElement&&!this.disabled){this.setTextColor()}}async setFocus(){if(this.nativeSelectElement){this.nativeSelectElement.focus()}else if(this.customSelectElement){this.customSelectElement.focus()}else if(this.searchableSelectElement){this.searchableSelectElement.focus()}}updateOnChangeDebounce(i){if(this.currDebounce!==i){this.currDebounce=i}}debounceAriaLiveUpdate(){clearTimeout(this.debounceAria);window.setTimeout((()=>{this.updateSearchableSelectResultAriaLive()}),800)}setDefaultValue(){if(!this.hasSetDefaultValue&&this.currValue){this.searchableSelectInputValue=this.getDefaultValue(this.currValue);this.initialValue=this.currValue;this.hasSetDefaultValue=true}}render(){const{small:i,size:t,disabled:s,fullWidth:a,helperText:n,hideLabel:o,label:l,menuId:r,name:c,options:d,placeholder:u,readonly:m,required:k,searchable:z,showClearButton:L,validationStatus:C,validationText:M,currValue:T}=this;p(true,this.el,c,this.searchable?this.hiddenInputValue:T,s);const H=C===w.Error?"true":"false";const B=f(this.inputId,n!=="",b(this.validationStatus,this.disabled)).trim();return e(h,{class:{disabled:s,searchable:z,small:i,[t]:t!=="default","full-width":a},onBlur:this.onBlur},e("ic-input-container",{readonly:m},!o&&e("ic-input-label",{for:this.inputId,label:l,helperText:n,required:k,disabled:s,readonly:m}),e("ic-input-component-container",{ref:i=>this.anchorEl=i,class:{"menu-open":this.open},small:i,size:t,fullWidth:a,disabled:s,readonly:m,validationStatus:C},m?e("ic-typography",null,e("p",null,this.getLabelFromValue(T))):v()?e("select",Object.assign({ref:i=>this.nativeSelectElement=i,disabled:s,onChange:this.handleNativeSelectChange,required:k,id:this.inputId,"aria-label":l,"aria-describedby":B,"aria-invalid":H,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.handleNativeSelectKeyDown,form:this.form},this.inheritedAttributes),e("option",{value:"",selected:true,disabled:!L},u),d.map((i=>{if(i.children){return e("optgroup",{label:i.label},i.children.map((i=>e("option",{value:i.value,disabled:i.disabled,selected:i.value===T},i.label))))}else{return e("option",{value:i.value,disabled:i.disabled,selected:i.value===T},i.label)}}))):z?e("div",{class:"searchable-select-container"},e("input",{class:"select-input",role:"combobox",autocomplete:"off","aria-label":l,"aria-describedby":B,"aria-activedescendant":this.ariaActiveDescendant,"aria-autocomplete":"list","aria-expanded":this.open?"true":"false","aria-invalid":H,"aria-required":k?"true":"false","aria-controls":r,ref:i=>this.searchableSelectElement=i,id:this.inputId,value:this.searchableSelectInputValue,placeholder:u,disabled:s,onInput:this.handleSearchableSelectInput,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,form:this.form,formaction:this.formaction,formenctype:this.formenctype,formmethod:this.formmethod,formnovalidate:this.formnovalidate,formtarget:this.formtarget}),this.searchableSelectInputValue&&(L||z)&&e("div",{class:"clear-button-container"},e("ic-button",{id:"clear-button",ref:i=>this.clearButton=i,"aria-label":this.searchableSelectInputValue&&T===null?"Clear input":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?g.Light:g.Dark}),e("div",{class:"divider"})),e("span",{onMouseDown:this.handleExpandIconMouseDown,class:{"expand-icon":true,"expand-icon-open":this.open,"expand-icon-filled":!(T==null||T==="")},innerHTML:x,"aria-hidden":"true"}),e("div",{"aria-live":"polite",role:"status",class:"searchable-select-results-status"})):e("div",{class:"select-container"},e("button",{class:"select-input",ref:i=>this.customSelectElement=i,id:this.inputId,"aria-label":`${l}, ${this.getLabelFromValue(T)||u}${k?", required":""}`,"aria-describedby":B,"aria-invalid":H,"aria-haspopup":"listbox","aria-expanded":this.open?"true":"false","aria-owns":r,"aria-controls":r,disabled:s,onBlur:this.onBlur,onFocus:this.onFocus,onClick:this.handleClick,onMouseDown:this.handleMouseDown,onKeyDown:this.handleKeyDown},e("ic-typography",{variant:"body",class:{"value-text":true,placeholder:this.getLabelFromValue(T)===undefined}},e("p",null,this.getLabelFromValue(T)||u)),e("div",{class:"select-input-end"},T&&L&&e("div",{class:"divider"}),e("span",{class:{"expand-icon":true,"expand-icon-open":this.open,"expand-icon-filled":!(T==null||T==="")},innerHTML:x,"aria-hidden":"true"}))),T&&L&&e("ic-button",{id:"clear-button","aria-label":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?g.Light:g.Dark}))),!v()&&e("ic-menu",{class:{"no-results":this.loading||this.hasTimedOut||this.noOptions!==null&&this.noOptions[0]&&this.noOptions[0].label===this.emptyOptionListText},ref:i=>this.menu=i,inputEl:z?this.searchableSelectElement:this.customSelectElement,inputLabel:l,anchorEl:this.anchorEl,small:i,size:t,menuId:r,open:this.open,options:z?this.filteredOptions:this.uniqueOptions,value:T,fullWidth:a,selectOnEnter:this.selectOnEnter,onMenuStateChange:this.handleMenuChange,onMenuOptionSelect:this.handleCustomSelectChange,onMenuKeyPress:this.handleMenuKeyPress,onMenuValueChange:this.handleMenuValueChange,onUngroupedOptionsSet:this.setUngroupedOptions,onRetryButtonClicked:this.handleRetry,parentEl:this.el,onTimeoutBlur:this.onTimeoutBlur,activationType:this.searchable||this.selectOnEnter?"manual":"automatic"}),b(this.validationStatus,this.disabled)&&e("ic-input-validation",{class:{"menu-open":this.open},ariaLiveMode:"polite",status:C,message:M,for:this.inputId})))}static get delegatesFocus(){return true}get el(){return a(this)}static get watchers(){return{loading:["loadingHandler"],options:["watchOptionsHandler"],debounce:["debounceChangedHandler"],value:["valueChangedHandler"],open:["openChangedHandler"]}}};C.style=k;export{C as ic_select};
2
- //# sourceMappingURL=p-0c097626.entry.js.map