@ukic/canary-web-components 2.0.0-canary.26 → 2.0.0-canary.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-6817cfbb.js → helpers-1a85e860.js} +15 -1
  3. package/dist/{esm/helpers-5bd2012a.js.map → cjs/helpers-1a85e860.js.map} +1 -1
  4. package/dist/cjs/ic-alert.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +43 -20
  7. package/dist/cjs/ic-breadcrumb-group.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
  9. package/dist/cjs/ic-checkbox.cjs.entry.js +2 -2
  10. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  11. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-data-table.cjs.entry.js +28 -5
  13. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-date-input.cjs.entry.js +10 -9
  15. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-date-picker.cjs.entry.js +3 -1
  17. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-empty-state_2.cjs.entry.js +23 -16
  19. package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-input-component-container_4.cjs.entry.js +5 -4
  21. package/dist/cjs/ic-input-component-container_4.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  25. package/dist/cjs/ic-page-header.cjs.entry.js +4 -4
  26. package/dist/cjs/ic-page-header.cjs.entry.js.map +1 -1
  27. package/dist/cjs/ic-pagination_4.cjs.entry.js +8 -8
  28. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  29. package/dist/cjs/ic-popover-menu.cjs.entry.js +20 -18
  30. package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
  31. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  32. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  33. package/dist/cjs/ic-search-bar.cjs.entry.js +15 -28
  34. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  35. package/dist/cjs/ic-select-with-multi.cjs.entry.js +1 -1
  36. package/dist/cjs/ic-switch.cjs.entry.js +1 -1
  37. package/dist/cjs/ic-switch.cjs.entry.js.map +1 -1
  38. package/dist/cjs/ic-tab-context.cjs.entry.js +68 -145
  39. package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
  40. package/dist/cjs/ic-tab-panel.cjs.entry.js +5 -13
  41. package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
  42. package/dist/cjs/ic-tab.cjs.entry.js +9 -10
  43. package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
  44. package/dist/cjs/ic-tree-item.cjs.entry.js +1 -1
  45. package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -1
  46. package/dist/cjs/ic-tree-view.cjs.entry.js +2 -2
  47. package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -1
  48. package/dist/cjs/ic-typography.cjs.entry.js +3 -1
  49. package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
  50. package/dist/cjs/loader.cjs.js +1 -1
  51. package/dist/collection/components/ic-data-table/ic-data-table.css +5 -1
  52. package/dist/collection/components/ic-data-table/ic-data-table.js +28 -5
  53. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  54. package/dist/collection/components/ic-data-table/story-data.js +46 -5
  55. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  56. package/dist/collection/components/ic-date-input/ic-date-input.js +27 -8
  57. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
  58. package/dist/collection/components/ic-date-picker/ic-date-picker.js +20 -0
  59. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
  60. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js +72 -21
  61. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.js.map +1 -1
  62. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js +2 -0
  63. package/dist/collection/components/ic-pagination-bar/ic-pagination-bar.types.js.map +1 -0
  64. package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js +20 -2
  65. package/dist/collection/components/ic-pagination-bar/test/basic/ic-pagination-bar.spec.js.map +1 -1
  66. package/dist/collection/components/ic-tree-item/ic-tree-item.js +2 -5
  67. package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -1
  68. package/dist/collection/components/ic-tree-view/ic-tree-view.js +1 -1
  69. package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -1
  70. package/dist/collection/utils/types.js.map +1 -1
  71. package/dist/components/helpers2.js +14 -1
  72. package/dist/components/helpers2.js.map +1 -1
  73. package/dist/components/ic-alert2.js +1 -1
  74. package/dist/components/ic-alert2.js.map +1 -1
  75. package/dist/components/ic-breadcrumb-group.js +45 -21
  76. package/dist/components/ic-breadcrumb-group.js.map +1 -1
  77. package/dist/components/ic-checkbox.js +2 -2
  78. package/dist/components/ic-checkbox.js.map +1 -1
  79. package/dist/components/ic-data-table.js +28 -5
  80. package/dist/components/ic-data-table.js.map +1 -1
  81. package/dist/components/ic-date-input2.js +11 -9
  82. package/dist/components/ic-date-input2.js.map +1 -1
  83. package/dist/components/ic-date-picker.js +4 -1
  84. package/dist/components/ic-date-picker.js.map +1 -1
  85. package/dist/components/ic-input-label2.js +6 -4
  86. package/dist/components/ic-input-label2.js.map +1 -1
  87. package/dist/components/ic-menu3.js +1 -1
  88. package/dist/components/ic-navigation-group.js +1 -1
  89. package/dist/components/ic-navigation-group.js.map +1 -1
  90. package/dist/components/ic-page-header.js +4 -4
  91. package/dist/components/ic-page-header.js.map +1 -1
  92. package/dist/components/ic-pagination-bar2.js +27 -17
  93. package/dist/components/ic-pagination-bar2.js.map +1 -1
  94. package/dist/components/ic-popover-menu.js +22 -19
  95. package/dist/components/ic-popover-menu.js.map +1 -1
  96. package/dist/components/ic-radio-group.js +1 -1
  97. package/dist/components/ic-radio-group.js.map +1 -1
  98. package/dist/components/ic-search-bar.js +15 -28
  99. package/dist/components/ic-search-bar.js.map +1 -1
  100. package/dist/components/ic-select-with-multi.js +1 -1
  101. package/dist/components/ic-select2.js +6 -6
  102. package/dist/components/ic-select2.js.map +1 -1
  103. package/dist/components/ic-switch.js +1 -1
  104. package/dist/components/ic-switch.js.map +1 -1
  105. package/dist/components/ic-tab-context.js +68 -145
  106. package/dist/components/ic-tab-context.js.map +1 -1
  107. package/dist/components/ic-tab-panel.js +6 -17
  108. package/dist/components/ic-tab-panel.js.map +1 -1
  109. package/dist/components/ic-tab.js +9 -10
  110. package/dist/components/ic-tab.js.map +1 -1
  111. package/dist/components/ic-text-field2.js +2 -2
  112. package/dist/components/ic-text-field2.js.map +1 -1
  113. package/dist/components/ic-tree-item.js.map +1 -1
  114. package/dist/components/ic-tree-view.js +2 -2
  115. package/dist/components/ic-tree-view.js.map +1 -1
  116. package/dist/components/ic-typography2.js +3 -1
  117. package/dist/components/ic-typography2.js.map +1 -1
  118. package/dist/core/core.esm.js +1 -1
  119. package/dist/core/core.esm.js.map +1 -1
  120. package/dist/core/p-05ae9a59.entry.js +2 -0
  121. package/dist/core/p-05ae9a59.entry.js.map +1 -0
  122. package/dist/core/{p-9b34989b.entry.js → p-07e4b89b.entry.js} +2 -2
  123. package/dist/core/p-0fc36045.entry.js +2 -0
  124. package/dist/core/p-0fc36045.entry.js.map +1 -0
  125. package/dist/core/p-21d0dea6.entry.js +2 -0
  126. package/dist/core/p-21d0dea6.entry.js.map +1 -0
  127. package/dist/core/p-2ecedbe5.entry.js +2 -0
  128. package/dist/core/p-2ecedbe5.entry.js.map +1 -0
  129. package/dist/core/{p-6b1fcf87.entry.js → p-383ba7e8.entry.js} +2 -2
  130. package/dist/core/p-383ba7e8.entry.js.map +1 -0
  131. package/dist/core/{p-ee8a3de6.entry.js → p-3ce541df.entry.js} +2 -2
  132. package/dist/core/p-3ce541df.entry.js.map +1 -0
  133. package/dist/core/p-3ef5017d.entry.js +2 -0
  134. package/dist/core/p-3ef5017d.entry.js.map +1 -0
  135. package/dist/core/{p-bee3fdb0.entry.js → p-438abe40.entry.js} +2 -2
  136. package/dist/core/p-438abe40.entry.js.map +1 -0
  137. package/dist/core/{p-f1044e4d.entry.js → p-5334bc96.entry.js} +2 -2
  138. package/dist/core/p-5334bc96.entry.js.map +1 -0
  139. package/dist/core/p-5741a8bf.entry.js +2 -0
  140. package/dist/core/p-5741a8bf.entry.js.map +1 -0
  141. package/dist/core/p-6ca98c5d.entry.js +2 -0
  142. package/dist/core/p-6ca98c5d.entry.js.map +1 -0
  143. package/dist/core/p-7435de65.js +2 -0
  144. package/dist/core/p-7435de65.js.map +1 -0
  145. package/dist/core/p-7e5da5eb.entry.js +2 -0
  146. package/dist/core/p-7e5da5eb.entry.js.map +1 -0
  147. package/dist/core/p-7ee62798.entry.js +2 -0
  148. package/dist/core/{p-80d6a6b5.entry.js.map → p-7ee62798.entry.js.map} +1 -1
  149. package/dist/core/p-8f0660ec.entry.js +2 -0
  150. package/dist/core/p-8f0660ec.entry.js.map +1 -0
  151. package/dist/core/p-924548ec.entry.js +2 -0
  152. package/dist/core/p-924548ec.entry.js.map +1 -0
  153. package/dist/core/{p-bfc5f3f4.entry.js → p-9e5c8813.entry.js} +2 -2
  154. package/dist/core/p-9e5c8813.entry.js.map +1 -0
  155. package/dist/core/{p-0ec04c16.entry.js → p-a7331e7c.entry.js} +2 -2
  156. package/dist/core/p-a7331e7c.entry.js.map +1 -0
  157. package/dist/core/{p-20997691.entry.js → p-a7794aa9.entry.js} +2 -2
  158. package/dist/core/p-a7794aa9.entry.js.map +1 -0
  159. package/dist/core/{p-d362992d.entry.js → p-ac591209.entry.js} +2 -2
  160. package/dist/core/{p-92f701e7.entry.js → p-b03d14fc.entry.js} +2 -2
  161. package/dist/core/p-bdb5addb.entry.js +2 -0
  162. package/dist/core/p-bdb5addb.entry.js.map +1 -0
  163. package/dist/core/{p-2ee5d3fb.entry.js → p-d10e81f3.entry.js} +2 -2
  164. package/dist/core/p-d10e81f3.entry.js.map +1 -0
  165. package/dist/core/p-e210f51a.entry.js +2 -0
  166. package/dist/core/p-e210f51a.entry.js.map +1 -0
  167. package/dist/core/{p-c6bdbe69.entry.js → p-fc76d510.entry.js} +2 -2
  168. package/dist/esm/core.js +1 -1
  169. package/dist/esm/{helpers-5bd2012a.js → helpers-c24d4455.js} +15 -2
  170. package/dist/esm/helpers-c24d4455.js.map +1 -0
  171. package/dist/esm/ic-alert.entry.js +1 -1
  172. package/dist/esm/ic-alert.entry.js.map +1 -1
  173. package/dist/esm/ic-breadcrumb-group.entry.js +43 -20
  174. package/dist/esm/ic-breadcrumb-group.entry.js.map +1 -1
  175. package/dist/esm/ic-card-horizontal.entry.js +1 -1
  176. package/dist/esm/ic-checkbox.entry.js +2 -2
  177. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  178. package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
  179. package/dist/esm/ic-data-table.entry.js +28 -5
  180. package/dist/esm/ic-data-table.entry.js.map +1 -1
  181. package/dist/esm/ic-date-input.entry.js +10 -9
  182. package/dist/esm/ic-date-input.entry.js.map +1 -1
  183. package/dist/esm/ic-date-picker.entry.js +3 -1
  184. package/dist/esm/ic-date-picker.entry.js.map +1 -1
  185. package/dist/esm/ic-empty-state_2.entry.js +23 -16
  186. package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
  187. package/dist/esm/ic-input-component-container_4.entry.js +5 -4
  188. package/dist/esm/ic-input-component-container_4.entry.js.map +1 -1
  189. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  190. package/dist/esm/ic-navigation-group.entry.js +1 -1
  191. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  192. package/dist/esm/ic-page-header.entry.js +4 -4
  193. package/dist/esm/ic-page-header.entry.js.map +1 -1
  194. package/dist/esm/ic-pagination_4.entry.js +8 -8
  195. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  196. package/dist/esm/ic-popover-menu.entry.js +20 -18
  197. package/dist/esm/ic-popover-menu.entry.js.map +1 -1
  198. package/dist/esm/ic-radio-group.entry.js +1 -1
  199. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  200. package/dist/esm/ic-search-bar.entry.js +15 -28
  201. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  202. package/dist/esm/ic-select-with-multi.entry.js +1 -1
  203. package/dist/esm/ic-switch.entry.js +1 -1
  204. package/dist/esm/ic-switch.entry.js.map +1 -1
  205. package/dist/esm/ic-tab-context.entry.js +68 -145
  206. package/dist/esm/ic-tab-context.entry.js.map +1 -1
  207. package/dist/esm/ic-tab-panel.entry.js +5 -13
  208. package/dist/esm/ic-tab-panel.entry.js.map +1 -1
  209. package/dist/esm/ic-tab.entry.js +9 -10
  210. package/dist/esm/ic-tab.entry.js.map +1 -1
  211. package/dist/esm/ic-tree-item.entry.js +1 -1
  212. package/dist/esm/ic-tree-item.entry.js.map +1 -1
  213. package/dist/esm/ic-tree-view.entry.js +2 -2
  214. package/dist/esm/ic-tree-view.entry.js.map +1 -1
  215. package/dist/esm/ic-typography.entry.js +3 -1
  216. package/dist/esm/ic-typography.entry.js.map +1 -1
  217. package/dist/esm/loader.js +1 -1
  218. package/dist/types/components/ic-data-table/ic-data-table.d.ts +2 -0
  219. package/dist/types/components/ic-data-table/story-data.d.ts +15 -0
  220. package/dist/types/components/ic-date-input/ic-date-input.d.ts +4 -0
  221. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +4 -0
  222. package/dist/types/components/ic-pagination-bar/ic-pagination-bar.d.ts +14 -5
  223. package/dist/types/components/ic-pagination-bar/ic-pagination-bar.types.d.ts +4 -0
  224. package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +1 -1
  225. package/dist/types/components.d.ts +46 -5
  226. package/dist/types/utils/types.d.ts +1 -0
  227. package/hydrate/index.js +275 -296
  228. package/package.json +3 -3
  229. package/dist/cjs/helpers-6817cfbb.js.map +0 -1
  230. package/dist/core/p-046f4de6.entry.js +0 -2
  231. package/dist/core/p-046f4de6.entry.js.map +0 -1
  232. package/dist/core/p-0ec04c16.entry.js.map +0 -1
  233. package/dist/core/p-20997691.entry.js.map +0 -1
  234. package/dist/core/p-216fbd5e.entry.js +0 -2
  235. package/dist/core/p-216fbd5e.entry.js.map +0 -1
  236. package/dist/core/p-297e99cf.js +0 -2
  237. package/dist/core/p-297e99cf.js.map +0 -1
  238. package/dist/core/p-2ee5d3fb.entry.js.map +0 -1
  239. package/dist/core/p-3ba4335c.entry.js +0 -2
  240. package/dist/core/p-3ba4335c.entry.js.map +0 -1
  241. package/dist/core/p-40e5fa80.entry.js +0 -2
  242. package/dist/core/p-40e5fa80.entry.js.map +0 -1
  243. package/dist/core/p-6af080d3.entry.js +0 -2
  244. package/dist/core/p-6af080d3.entry.js.map +0 -1
  245. package/dist/core/p-6b1fcf87.entry.js.map +0 -1
  246. package/dist/core/p-80d6a6b5.entry.js +0 -2
  247. package/dist/core/p-989310a8.entry.js +0 -2
  248. package/dist/core/p-989310a8.entry.js.map +0 -1
  249. package/dist/core/p-aa72f551.entry.js +0 -2
  250. package/dist/core/p-aa72f551.entry.js.map +0 -1
  251. package/dist/core/p-aaaa9261.entry.js +0 -2
  252. package/dist/core/p-aaaa9261.entry.js.map +0 -1
  253. package/dist/core/p-bd1f8741.entry.js +0 -2
  254. package/dist/core/p-bd1f8741.entry.js.map +0 -1
  255. package/dist/core/p-bee3fdb0.entry.js.map +0 -1
  256. package/dist/core/p-bfc5f3f4.entry.js.map +0 -1
  257. package/dist/core/p-c98ce508.entry.js +0 -2
  258. package/dist/core/p-c98ce508.entry.js.map +0 -1
  259. package/dist/core/p-da8255b8.entry.js +0 -2
  260. package/dist/core/p-da8255b8.entry.js.map +0 -1
  261. package/dist/core/p-ee8a3de6.entry.js.map +0 -1
  262. package/dist/core/p-f1044e4d.entry.js.map +0 -1
  263. package/dist/core/p-fa77211d.entry.js +0 -2
  264. package/dist/core/p-fa77211d.entry.js.map +0 -1
  265. /package/dist/core/{p-9b34989b.entry.js.map → p-07e4b89b.entry.js.map} +0 -0
  266. /package/dist/core/{p-d362992d.entry.js.map → p-ac591209.entry.js.map} +0 -0
  267. /package/dist/core/{p-92f701e7.entry.js.map → p-b03d14fc.entry.js.map} +0 -0
  268. /package/dist/core/{p-c6bdbe69.entry.js.map → p-fc76d510.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["IC_INHERITED_ARIA","IC_BLOCK_COLOR_COMPONENTS","IC_FIXED_COLOR_COMPONENTS","IC_BLOCK_COLOR_EXCEPTIONS","IcInformationStatus","IcThemeForegroundEnum","IcDateInputMonths","IcShortDayNames","IcDayNames","IcWeekDays","stringEnumToArray","theEnum","arr","Object","values","forEach","val","isNaN","Number","str","push","inheritAttributes","element","attributes","attributeObject","attr","hasAttribute","value","getAttribute","removeAttribute","dynamicDebounce","func","getDelay","timer","args","delay","clearTimeout","setTimeout","renderHiddenInput","always","container","name","disabled","undefined","hasShadowDom","inputs","querySelectorAll","inputEls","Array","from","filtered","filter","el","parentElement","input","ownerDocument","createElement","type","classList","add","appendChild","Date","toISOString","getThemeFromContext","themeFromEvent","getRootNode","host","blockColorParent","closest","join","parentTag","tagName","toLowerCase","currentTag","_a","includes","Default","contains","Dark","Light","isEmptyString","trim","length","isPropDefined","prop","getCssProperty","cssVar","getComputedStyle","document","documentElement","getPropertyValue","XS","replace","S","M","L","XL","UNDEFINED","isSlotUsed","slotName","children","some","child","shadowRoot","attachShadow","getInputHelperTextID","id","getInputValidationTextID","getInputDescribedByText","inputId","helperText","validationText","isMobileOrTablet","navigator","maxTouchPoints","getLabelFromValue","options","valueField","labelField","ungroupedOptions","map","option","matchingValue","find","getFilteredMenuOptions","includeDescriptions","searchString","position","label","description","lowerSearchString","startsWith","getOptionsWithoutGroupTitlesCount","optionsWithoutGroupTitles","pxToRem","px","base","parseInt","isNumeric","test","hasValidationStatus","status","onComponentRequiredPropUndefined","props","component","i","propName","console","error","kebabToCamelCase","kebabCase","individualWords","split","camelCase","substring","toUpperCase","checkResizeObserver","callbackFn","window","ResizeObserver","getForm","addFormResetListener","form","addEventListener","removeFormResetListener","removeEventListener","removeDisabledFalse","isMacDevice","userAgent","indexOf","capitalize","text","charAt","slice","checkSlotInChildMutations","addedNodes","removedNodes","hasSlot","nodeList","node","slot","addDataToPosition","dataObject","newKeys","newValue","newData","newIndexes","key","index","controlledIndex","keys","dataKey"],"sources":["src/utils/constants.ts","src/utils/types.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 {\n IcPaginationLabelTypes,\n IcPaginationTypes,\n IcPaginationAlignmentOptions,\n} from \"../components\";\n\nexport type IcFocusableComponents =\n | HTMLIcBreadcrumbElement\n | HTMLIcButtonElement\n | HTMLIcCardElement\n | HTMLIcCheckboxElement\n | HTMLIcChipElement\n | HTMLIcLinkElement\n | HTMLIcNavigationButtonElement\n | HTMLIcNavigationGroupElement\n | HTMLIcNavigationItemElement\n | HTMLIcRadioOptionElement\n | HTMLIcSearchBarElement\n | HTMLIcSelectElement\n | HTMLIcSwitchElement\n | HTMLIcTabElement\n | HTMLIcTextFieldElement;\n\nexport type IcStatusVariants =\n | \"neutral\"\n | \"info\"\n | \"warning\"\n | \"error\"\n | \"success\";\n\nexport enum IcInformationStatus {\n Warning = \"warning\",\n Error = \"error\",\n Success = \"success\",\n}\n\nexport type IcSizes = \"default\" | \"large\" | \"small\";\n\nexport type IcSizesNoLarge = \"default\" | \"small\";\n\nexport type IcInformationStatusOrEmpty = \"warning\" | \"error\" | \"success\" | \"\";\n\nexport type IcNavType = \"side\" | \"top\" | \"page-header\";\n\n// From: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\nexport type IcAutocompleteTypes =\n | \"on\"\n | \"off\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level4\"\n | \"address-level3\"\n | \"address-level2\"\n | \"address-level1\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tel-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\nexport type IcAlignment = \"left\" | \"center\" | \"full-width\";\n\nexport enum IcThemeForegroundEnum {\n Default = \"default\",\n Dark = \"dark\",\n Light = \"light\",\n}\n\nexport type IcThemeForeground = \"default\" | \"dark\" | \"light\";\n\nexport type IcThemeForegroundNoDefault = \"dark\" | \"light\";\n\nexport type IcTheme = {\n mode: IcThemeForeground;\n color: IcColorRGB;\n};\n\nexport type IcAdditionalFieldTypes = \"static\" | \"dynamic\";\n\nexport type IcColorRGB = {\n r: number;\n g: number;\n b: number;\n};\n\nexport type IcColorRGBA = IcColorRGB & {\n a: number;\n};\n\nexport type IcActivationTypes = \"automatic\" | \"manual\";\n\nexport type IcAutocorrectStates = \"on\" | \"off\";\n\nexport type IcNavParentDetails = {\n navType: IcNavType | \"\";\n parent: HTMLElement;\n};\n\nexport type IcTypographyVariants =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"subtitle-large\"\n | \"subtitle-small\"\n | \"body\"\n | \"label\"\n | \"label-uppercase\"\n | \"caption\"\n | \"caption-uppercase\"\n | \"code-large\"\n | \"code-small\"\n | \"code-extra-small\"\n | \"badge\"\n | \"badge-small\";\n\n/**\n * @interface IcMenuOption\n * @field {string} A label field to options. Defaults to \"label\", but can have any custom name.\n * @field {string} A value field to options. Defaults to \"value\", but can have any custom name.\n */\nexport interface IcMenuOption {\n description?: string;\n disabled?: boolean;\n recommended?: boolean;\n children?: IcMenuOption[];\n loading?: boolean;\n timedOut?: boolean;\n [key: string]: any;\n element?: {\n component: any;\n ariaLabel: string;\n };\n icon?: any;\n}\n\nexport type IcSearchMatchPositions = \"start\" | \"anywhere\";\n\nexport interface IcPaginationBarOptions {\n itemsPerPageOptions?: { label: string; value: string }[];\n rangeLabelType?: IcPaginationLabelTypes;\n type?: IcPaginationTypes;\n showItemsPerPageControl?: boolean;\n showGoToPageControl?: boolean;\n alignment?: IcPaginationAlignmentOptions;\n appearance?: IcThemeForeground;\n itemLabel?: string;\n pageLabel?: string;\n hideRangeLabel?: boolean;\n}\n\nexport type IcCallbackFunctionNoReturn = (...args: unknown[]) => void;\n\nexport type IcDateFormat = \"DD/MM/YYYY\" | \"MM/DD/YYYY\" | \"YYYY/MM/DD\";\n\nexport enum IcDateInputMonths {\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n}\n\nexport enum IcShortDayNames {\n \"Sun\",\n \"Mon\",\n \"Tue\",\n \"Wed\",\n \"Thu\",\n \"Fri\",\n \"Sat\",\n}\n\nexport enum IcDayNames {\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n}\n\nexport enum IcWeekDays {\n Sunday = 0,\n Monday = 1,\n Tuesday = 2,\n Wednesday = 3,\n Thursday = 4,\n Friday = 5,\n Saturday = 6,\n}\n\nexport interface IcValueEventDetail {\n value: string | string[];\n keyPressed?: string;\n}\n","/**\n * To investigate:\n * IcColorRGBA works via @ukic/web-components but IcThemeForeground does not even though they are exported\n * from @ukic/web-components in the same file. Why?\n */\nimport {\n IcCallbackFunctionNoReturn,\n IcInformationStatusOrEmpty,\n IcNavParentDetails,\n IcPropObject,\n IcSearchMatchPositions,\n IcColorRGBA,\n} from \"@ukic/web-components\";\nimport {\n IC_BLOCK_COLOR_COMPONENTS,\n IC_BLOCK_COLOR_EXCEPTIONS,\n IC_FIXED_COLOR_COMPONENTS,\n} from \"./constants\"; // Using @ukic/web-components/dist/types/utils/constants does not work so duplicated constants into canary package\nimport {\n IcMenuOption,\n IcThemeForeground,\n IcThemeForegroundEnum,\n} from \"./types\"; // Using @ukic/web-components/dist/types/utils/types does not work so duplicated constants into canary package\nimport { EventEmitter } from \"@stencil/core\";\nimport { IcDataTableDataType } from \"../interface\";\n\nconst DARK_MODE_THRESHOLD = 133.3505;\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]: unknown } => {\n const attributeObject: { [key: string]: unknown } = {};\n\n attributes.forEach((attr) => {\n if (element.hasAttribute(attr)) {\n const value = element.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = element.getAttribute(attr);\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\nexport const dynamicDebounce = (\n func: (...args: unknown[]) => void,\n getDelay: () => number\n): unknown => {\n let timer: ReturnType<typeof setTimeout>;\n return (...args: unknown[]) => {\n const delay = getDelay();\n clearTimeout(timer);\n timer = setTimeout(func, delay, ...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(\"input.ic-input\");\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(\"ic-input\");\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\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\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 * 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\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 : slot.tagName ? [slot] : 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(getCssProperty(\"--ic-breakpoint-xs\").replace(\"px\", \"\")), // 0\n S: Number(getCssProperty(\"--ic-breakpoint-sm\").replace(\"px\", \"\")), // 576\n M: Number(getCssProperty(\"--ic-breakpoint-md\").replace(\"px\", \"\")), // 768\n L: Number(getCssProperty(\"--ic-breakpoint-lg\").replace(\"px\", \"\")), // 992\n XL: Number(getCssProperty(\"--ic-breakpoint-xl\").replace(\"px\", \"\")), // 1200\n UNDEFINED: 1200,\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 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\nexport const isMobileOrTablet = (): boolean =>\n \"maxTouchPoints\" in navigator ? navigator.maxTouchPoints > 0 : false;\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\n/**\n * Gets count of options where only group title \"parent\" options have been removed.\n * Disabled options are included in the count.\n * @param options - array of options\n * @returns number of options not including group titles\n */\nexport const getOptionsWithoutGroupTitlesCount = (\n options: IcMenuOption[]\n): number => {\n const optionsWithoutGroupTitles: IcMenuOption[] = [];\n\n if (options.length > 0 && options.map) {\n options.map((option) => {\n if (option.children) {\n option.children.map((option) => optionsWithoutGroupTitles.push(option));\n } else {\n optionsWithoutGroupTitles.push(option);\n }\n });\n }\n\n return optionsWithoutGroupTitles.length;\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 pxToRem = (px: string, base = 16): string =>\n `${(1 / base) * parseInt(px)}rem`;\n\nexport const isNumeric = (value: string): boolean => {\n return /^-?\\d+$/.test(value);\n};\n\nexport const hasValidationStatus = (\n status: IcInformationStatusOrEmpty,\n disabled: boolean\n): boolean => {\n return status !== \"\" && !disabled;\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\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 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 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 capitalize = (text: string): string => {\n return text.charAt(0).toUpperCase() + text.slice(1);\n};\n\nexport const checkSlotInChildMutations = (\n addedNodes: NodeList,\n removedNodes: NodeList,\n slotName: string\n): boolean => {\n const hasSlot = (nodeList: NodeList) =>\n Array.from(nodeList).some((node) => (node as Element).slot === slotName);\n return hasSlot(addedNodes) || hasSlot(removedNodes);\n};\n\nexport const addDataToPosition = (\n dataObject: IcDataTableDataType,\n newKeys: { key: string; index: number }[],\n newValue: unknown\n): IcDataTableDataType => {\n const newData: IcDataTableDataType = {};\n const newIndexes = newKeys.map((key) => key.index);\n let controlledIndex = 0; // When a new key is added to the data, need to increment the index to account for this new object value\n\n Object.keys(dataObject).forEach((dataKey) => {\n if (newIndexes.includes(controlledIndex)) {\n newData[newKeys[newIndexes.indexOf(controlledIndex)].key] = newValue;\n controlledIndex++;\n }\n newData[dataKey] = dataObject[dataKey];\n controlledIndex++;\n });\n return newData;\n};\n"],"mappings":"MA+BaA,EAAoB,CAC/B,cACA,oBACA,YACA,gBACA,eACA,mBACA,mBACA,eACA,gBACA,kBACA,oBACA,gBACA,cACA,eACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,wBAWK,MAAMC,EAA4B,CACvC,UACA,oBACA,YACA,qBACA,YAGK,MAAMC,EAA4B,CAAC,YAMnC,MAAMC,EAA+C,CAC1D,WAAY,CAAC,Y,ICnDHC,GAAZ,SAAYA,GACVA,EAAA,qBACAA,EAAA,iBACAA,EAAA,oBACD,EAJD,CAAYA,MAAmB,K,IA0EnBC,GAAZ,SAAYA,GACVA,EAAA,qBACAA,EAAA,eACAA,EAAA,gBACD,EAJD,CAAYA,MAAqB,K,IA6FrBC,GAAZ,SAAYA,GACVA,IAAA,wBACAA,IAAA,0BACAA,IAAA,oBACAA,IAAA,oBACAA,IAAA,gBACAA,IAAA,kBACAA,IAAA,kBACAA,IAAA,sBACAA,IAAA,4BACAA,IAAA,wBACAA,IAAA,2BACAA,IAAA,0BACD,EAbD,CAAYA,MAAiB,K,IAejBC,GAAZ,SAAYA,GACVA,IAAA,gBACAA,IAAA,gBACAA,IAAA,gBACAA,IAAA,gBACAA,IAAA,gBACAA,IAAA,gBACAA,IAAA,eACD,EARD,CAAYA,MAAe,K,IAUfC,GAAZ,SAAYA,GACVA,IAAA,sBACAA,IAAA,sBACAA,IAAA,wBACAA,IAAA,4BACAA,IAAA,0BACAA,IAAA,sBACAA,IAAA,yBACD,EARD,CAAYA,MAAU,K,IAUVC,GAAZ,SAAYA,GACVA,IAAA,sBACAA,IAAA,sBACAA,IAAA,wBACAA,IAAA,4BACAA,IAAA,0BACAA,IAAA,sBACAA,IAAA,yBACD,EARD,CAAYA,MAAU,K,MCzMTC,EACXC,IAEA,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O,GAAGjB,cAAgBgB,EAAKE,MAAM,G,MAGtCC,EAA4B,CACvCC,EACAC,EACA7E,KAEA,MAAM8E,EAAWC,GACflI,MAAMC,KAAKiI,GAAU7E,MAAM8E,GAAUA,EAAiBC,OAASjF,IACjE,OAAO8E,EAAQF,IAAeE,EAAQD,EAAa,E,MAGxCK,EAAoB,CAC/BC,EACAC,EACAC,KAEA,MAAMC,EAA+B,GACrC,MAAMC,EAAaH,EAAQ/D,KAAKmE,GAAQA,EAAIC,QAC5C,IAAIC,EAAkB,EAEtBhL,OAAOiL,KAAKR,GAAYvK,SAASgL,IAC/B,GAAIL,EAAW/G,SAASkH,GAAkB,CACxCJ,EAAQF,EAAQG,EAAWjB,QAAQoB,IAAkBF,KAAOH,EAC5DK,G,CAEFJ,EAAQM,GAAWT,EAAWS,GAC9BF,GAAiB,IAEnB,OAAOJ,CAAO,S"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["icPopoverMenuCss","PopoverMenu","constructor","hostRef","this","ARIA_LABEL","popoverMenuEls","setButtonFocus","_a","currentFocus","focus","findAnchorEl","anchor","anchorElement","submenuId","undefined","console","error","document","querySelector","indexOf","isNotPopoverMenuEl","ev","id","tagName","target","closeMenu","setFocusToAnchor","open","anchorEl","icPopoverClosed","emit","getNextItemToSelect","currentItem","movingDown","numButtons","length","nextItem","addMenuItems","elements","i","el","push","groupSlotWrapper","shadowRoot","menuGroupElements","getSlotElements","getMenuAriaLabel","ariaLabel","getAttribute","isPropDefined","submenuLevel","parentLabel","handleBackButtonClick","parentPopover","openFromChild","initPopperJS","popperInstance","createPopper","placement","modifiers","name","options","offset","fallbackPlacements","rootBoundary","openingFromChild","openingFromParent","watchOpenHandler","some","menuItem","unshift","backButton","setTimeout","destroy","disconnectedCallback","componentDidLoad","slotWrapper","popoverMenuElements","componentWillRender","componentDidRender","handleMenuItemClick","detail","hasSubMenu","label","handleSubmenuChange","childEl","submenuTriggerFor","openFromParent","handleClick","handleKeyDown","key","preventDefault","blur","render","h","Host","class","menu","tabindex","ref","onClick","slot","viewBox","fill","xmlns","d","variant","role","delegatesFocus"],"sources":["../web-components/dist/collection/components/ic-popover-menu/ic-popover-menu.css?tag=ic-popover-menu&encapsulation=shadow","../web-components/dist/collection/components/ic-popover-menu/ic-popover-menu.js"],"sourcesContent":["/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-style: inherit;\n vertical-align: baseline;\n}\n\n\n/**\n* @prop --ic-z-index-popover: z-index of popover menu. \n* @prop --max-height: Maximum height of the popover menu.\n* @prop --popover-width: Default width of the popover menu.\n*/\n\n@media (prefers-reduced-motion: no-preference) {\n :host .opening-from-parent {\n animation: slide-in var(--ic-transition-duration-slow) ease-in-out;\n }\n\n :host .opening-from-child {\n animation: slide-out var(--ic-transition-duration-slow) ease-in-out;\n }\n}\n\n:host {\n border-radius: var(--ic-border-radius);\n color: var(--ic-color-primary-text);\n background-color: var(--ic-architectural-white);\n position: relative;\n z-index: var(--ic-z-index-popover);\n box-sizing: border-box;\n box-shadow: var(--ic-elevation-overlay);\n display: none;\n}\n\n:host(.on-dialog) {\n inset: auto !important;\n}\n\n:host(.on-dialog-fix-translate) {\n transform: translate(0, var(--ic-space-xs)) !important;\n}\n\n:host(.on-dialog-translate-y) {\n transform: translate(0, calc(-1 * var(--translate-y))) !important;\n}\n\n.menu {\n border: var(--ic-border-default);\n border-radius: var(--ic-border-radius);\n background-color: var(--ic-architectural-white);\n visibility: hidden;\n height: 0;\n}\n\n.button {\n text-decoration: none;\n list-style-type: none;\n}\n\n:host(:focus-within) {\n box-shadow: var(--ic-border-focus);\n}\n\n.menu:focus-visible {\n outline: none;\n}\n\n:host(.open) {\n display: block;\n min-width: calc(20rem - var(--ic-space-xl));\n width: var(--popover-width, 20rem);\n max-width: calc(100vw - var(--ic-space-xl));\n}\n\n:host(.open) .menu {\n visibility: visible;\n height: -moz-fit-content;\n height: fit-content;\n max-height: var(--max-height, -moz-fit-content);\n max-height: var(--max-height, fit-content);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.parent-label {\n color: var(--ic-color-tertiary-text);\n margin: var(--ic-space-xs) var(--ic-space-xs) 0;\n}\n\n@keyframes slide-in {\n from {\n opacity: 0;\n transform: translateX(10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@keyframes slide-out {\n from {\n opacity: 0;\n transform: translateX(-10rem);\n }\n\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n","import { Host, h, } from \"@stencil/core\";\nimport { getSlotElements, isPropDefined } from \"../../utils/helpers\";\nimport { createPopper } from \"@popperjs/core\";\nexport class PopoverMenu {\n constructor() {\n this.ARIA_LABEL = \"aria-label\";\n this.popoverMenuEls = [];\n this.setButtonFocus = () => {\n var _a;\n (_a = this.popoverMenuEls[this.currentFocus]) === null || _a === void 0 ? void 0 : _a.focus();\n };\n // Checks that the popover menu has an anchor\n this.findAnchorEl = (anchor) => {\n let anchorElement = null;\n if (!anchor) {\n this.submenuId === undefined &&\n console.error(\"No anchor specified for popover component\");\n }\n else {\n anchorElement = document.querySelector(anchor.indexOf(\"#\") === 0 ? anchor : \"#\" + anchor);\n if (anchorElement === null) {\n console.error(`Popover anchor element '${anchor}' not found`);\n }\n }\n return anchorElement;\n };\n this.isNotPopoverMenuEl = (ev) => {\n const { id, tagName } = ev.target;\n return (id !== this.anchor &&\n tagName !== \"IC-MENU-ITEM\" &&\n tagName !== \"IC-MENU-GROUP\" &&\n tagName !== \"IC-POPOVER-MENU\");\n };\n /**\n * Close the popover menu, emit isPopoverClosed event\n * @param setFocusToAnchor when true return focus to anchor element when menu is closed\n */\n this.closeMenu = (setFocusToAnchor = false) => {\n var _a;\n this.open = false;\n if (setFocusToAnchor) {\n (_a = this.anchorEl) === null || _a === void 0 ? void 0 : _a.focus();\n }\n this.icPopoverClosed.emit();\n };\n this.getNextItemToSelect = (currentItem, movingDown) => {\n const numButtons = this.popoverMenuEls.length - 1;\n if (currentItem < 1) {\n currentItem = 0;\n }\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n // Check if wrap around necessary\n if (nextItem < 0) {\n nextItem = numButtons;\n }\n else if (nextItem > numButtons) {\n nextItem = 0;\n }\n return nextItem;\n };\n this.addMenuItems = (elements) => {\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n if (el.tagName === \"IC-MENU-ITEM\") {\n this.popoverMenuEls.push(el);\n }\n else if (el.tagName === \"IC-MENU-GROUP\") {\n const groupSlotWrapper = el.shadowRoot.querySelector(\"ul\");\n const menuGroupElements = getSlotElements(groupSlotWrapper);\n this.addMenuItems(menuGroupElements);\n }\n }\n };\n this.getMenuAriaLabel = () => {\n const ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n if (isPropDefined(this.submenuId)) {\n return `${ariaLabel}, within nested level ${this.submenuLevel} ${this.parentLabel} submenu,`;\n }\n else {\n return ariaLabel;\n }\n };\n this.handleBackButtonClick = () => {\n this.parentPopover.openFromChild();\n this.open = false;\n };\n this.initPopperJS = () => {\n this.popperInstance = createPopper(this.anchorEl, this.el, {\n placement: \"bottom-start\",\n modifiers: [\n {\n name: \"offset\",\n options: {\n offset: [0, 4],\n },\n },\n {\n name: \"flip\",\n options: {\n fallbackPlacements: [\"top-start\", \"top-end\", \"bottom-end\"],\n rootBoundary: \"viewport\",\n },\n },\n ],\n });\n };\n this.openingFromChild = false;\n this.openingFromParent = false;\n this.anchor = undefined;\n this.parentLabel = undefined;\n this.parentPopover = undefined;\n this.submenuId = undefined;\n this.submenuLevel = 1;\n this.open = undefined;\n }\n watchOpenHandler() {\n if (this.open) {\n if (this.parentPopover !== undefined &&\n !this.popoverMenuEls.some((menuItem) => menuItem.id)) {\n this.popoverMenuEls.unshift(this.backButton);\n }\n this.currentFocus = isPropDefined(this.submenuId) ? 1 : 0;\n // Needed so that anchorEl isn't always focused\n setTimeout(this.setButtonFocus, 50);\n }\n else if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n componentDidLoad() {\n const slotWrapper = this.el.shadowRoot.querySelector(\"ul.button\");\n const popoverMenuElements = getSlotElements(slotWrapper);\n if (popoverMenuElements !== null) {\n this.addMenuItems(popoverMenuElements);\n }\n if (this.submenuId === undefined &&\n this.el.getAttribute(this.ARIA_LABEL) === null) {\n console.error(`No aria-label specified for popover menu component - aria-label required`);\n }\n }\n componentWillRender() {\n this.anchorEl = this.findAnchorEl(this.anchor);\n }\n componentDidRender() {\n if (this.open && !this.popperInstance) {\n this.initPopperJS();\n }\n }\n handleMenuItemClick(ev) {\n if (!ev.detail.hasSubMenu && ev.detail.label !== \"Back\") {\n this.closeMenu();\n }\n }\n // This is listening for the event emitted when a menu item is acting as a trigger button\n handleSubmenuChange(ev) {\n // Finds the trigger menu item that has emitted the event\n const target = ev.target;\n this.open = false;\n // Find the popover menu that the menu item triggers (i.e. submenu-trigger-for === submenu-id).\n const childEl = document.querySelector(`ic-popover-menu[submenu-id=${target.submenuTriggerFor}]`);\n // Set the parent popover menu of the submenu and open the submenu\n childEl.parentPopover = this.el;\n childEl.anchor = this.anchor;\n childEl.ariaLabel = this.el.getAttribute(this.ARIA_LABEL);\n childEl.openFromParent();\n childEl.submenuLevel = this.submenuLevel + 1;\n // Set the label in the submenu using the label of the menu item that has emitted the event\n childEl.parentLabel = target.label;\n }\n handleClick(ev) {\n if (this.open && this.isNotPopoverMenuEl(ev)) {\n // If menu is open and the next click on the document is not a popover El, close the popover\n this.closeMenu();\n }\n }\n // Manages the keyboard navigation in the popover menu\n handleKeyDown(ev) {\n switch (ev.key) {\n case \"ArrowDown\":\n case \"ArrowUp\":\n ev.preventDefault();\n this.currentFocus = this.getNextItemToSelect(this.currentFocus, ev.key === \"ArrowDown\");\n this.setButtonFocus();\n break;\n case \"Home\":\n //Sets home focus as first element, or back button\n this.currentFocus = 0;\n this.setButtonFocus();\n break;\n case \"End\":\n //Sets end focus as last element\n this.currentFocus = this.popoverMenuEls.length - 1;\n this.setButtonFocus();\n break;\n case \"Escape\":\n case \"Tab\":\n if (this.open) {\n this.closeMenu(true);\n this.el.blur();\n }\n break;\n }\n }\n /**\n * @internal Opens the menu from the child menu.\n */\n async openFromChild() {\n this.open = true;\n this.openingFromChild = true;\n setTimeout(() => (this.openingFromChild = false), 1000);\n }\n /**\n * @internal Opens the menu from the parent menu.\n */\n async openFromParent() {\n this.open = true;\n this.openingFromParent = true;\n setTimeout(() => (this.openingFromParent = false), 1000);\n }\n render() {\n return (h(Host, { class: { open: this.open } }, h(\"div\", { id: this.parentPopover === undefined\n ? `ic-popover-submenu-${this.submenuId}`\n : \"\", class: {\n menu: true,\n }, tabindex: open ? \"0\" : \"-1\" }, h(\"div\", { class: {\n \"opening-from-parent\": this.openingFromParent,\n \"opening-from-child\": this.openingFromChild,\n } }, isPropDefined(this.submenuId) && (h(\"div\", null, h(\"ic-menu-item\", { class: \"ic-popover-submenu-back-button\", ref: (el) => (this.backButton = el), label: \"Back\", onClick: this.handleBackButtonClick, id: `ic-popover-submenu-back-button-${this.submenuLevel}` }, h(\"svg\", { slot: \"icon\", viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", class: \"submenu-back-icon\" }, h(\"path\", { d: \"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z\", fill: \"currentColor\" }))), h(\"ic-typography\", { variant: \"subtitle-small\", class: \"parent-label\" }, this.parentLabel))), h(\"ul\", { class: \"button\", \"aria-label\": this.getMenuAriaLabel(), role: \"menu\", \"aria-owns\": isPropDefined(this.submenuId)\n ? `ic-popover-submenu-back-button-${this.submenuLevel}`\n : false, \"aria-controls\": isPropDefined(this.submenuId)\n ? `ic-popover-submenu-back-button-${this.submenuLevel}`\n : false }, h(\"slot\", null))))));\n }\n static get is() { return \"ic-popover-menu\"; }\n static get encapsulation() { return \"shadow\"; }\n static get delegatesFocus() { return true; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"ic-popover-menu.css\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"ic-popover-menu.css\"]\n };\n }\n static get properties() {\n return {\n \"anchor\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The ID of the element the popover menu will anchor itself to. This is required unless the popover is a submenu.\"\n },\n \"attribute\": \"anchor\",\n \"reflect\": false\n },\n \"parentLabel\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"The parent popover menu of a child popover menu.\"\n }],\n \"text\": \"\"\n },\n \"attribute\": \"parent-label\",\n \"reflect\": false\n },\n \"parentPopover\": {\n \"type\": \"unknown\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"HTMLIcPopoverMenuElement\",\n \"resolved\": \"HTMLIcPopoverMenuElement\",\n \"references\": {\n \"HTMLIcPopoverMenuElement\": {\n \"location\": \"global\",\n \"id\": \"global::HTMLIcPopoverMenuElement\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"The parent popover menu of a child popover menu.\"\n }],\n \"text\": \"\"\n }\n },\n \"submenuId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The unique identifier for a popover submenu.\"\n },\n \"attribute\": \"submenu-id\",\n \"reflect\": false\n },\n \"submenuLevel\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"The level of menu being displayed.\"\n }],\n \"text\": \"\"\n },\n \"attribute\": \"submenu-level\",\n \"reflect\": false,\n \"defaultValue\": \"1\"\n },\n \"open\": {\n \"type\": \"boolean\",\n \"mutable\": true,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the popover menu will be displayed.\"\n },\n \"attribute\": \"open\",\n \"reflect\": true,\n \"defaultValue\": \"undefined\"\n }\n };\n }\n static get states() {\n return {\n \"openingFromChild\": {},\n \"openingFromParent\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"icPopoverClosed\",\n \"name\": \"icPopoverClosed\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when the popover menu is closed.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }];\n }\n static get methods() {\n return {\n \"openFromChild\": {\n \"complexType\": {\n \"signature\": \"() => Promise<void>\",\n \"parameters\": [],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"\",\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"Opens the menu from the child menu.\"\n }]\n }\n },\n \"openFromParent\": {\n \"complexType\": {\n \"signature\": \"() => Promise<void>\",\n \"parameters\": [],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"\",\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"Opens the menu from the parent menu.\"\n }]\n }\n }\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"open\",\n \"methodName\": \"watchOpenHandler\"\n }];\n }\n static get listeners() {\n return [{\n \"name\": \"handleMenuItemClick\",\n \"method\": \"handleMenuItemClick\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"triggerPopoverMenuInstance\",\n \"method\": \"handleSubmenuChange\",\n \"target\": undefined,\n \"capture\": true,\n \"passive\": false\n }, {\n \"name\": \"click\",\n \"method\": \"handleClick\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"keydown\",\n \"method\": \"handleKeyDown\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }];\n }\n}\n//# sourceMappingURL=ic-popover-menu.js.map\n"],"mappings":"uKAAA,MAAMA,EAAmB,m9H,MCGZC,EAAW,MACpB,WAAAC,CAAAC,G,2DACIC,KAAKC,WAAa,aAClBD,KAAKE,eAAiB,GACtBF,KAAKG,eAAiB,KAClB,IAAIC,GACHA,EAAKJ,KAAKE,eAAeF,KAAKK,iBAAmB,MAAQD,SAAY,OAAS,EAAIA,EAAGE,OAAO,EAGjGN,KAAKO,aAAgBC,IACjB,IAAIC,EAAgB,KACpB,IAAKD,EAAQ,CACTR,KAAKU,YAAcC,W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as e}from"./p-fd186591.js";const a=class{constructor(i){t(this,i);this.icTabSelect=s(this,"icTabSelect",3);this.tabSelect=s(this,"tabSelect",3);this.newTabPanels=[];this.newTabs=[];this.linkTabs=()=>{this.tabs.forEach(((t,s)=>{const i=`ic-tab-${s}-context-${this.contextId}`;const h=`ic-tab-panel-${s}-context-${this.contextId}`;const a=`ic-tab--${s}-context-${this.contextId}`;const c="context-id";t.setAttribute("id",i);t.tabId=a;t.tabPosition=s;t.setAttribute("aria-controls",h);t.setAttribute(c,this.contextId);this.tabGroup.setAttribute(c,this.contextId);this.tabPanels[s].setAttribute("id",h);this.tabPanels[s].panelId=a;this.tabPanels[s].tabPosition=s;this.tabPanels[s].setAttribute("aria-labelledby",i);this.tabPanels[s].setAttribute(c,this.contextId);if(this.appearance===e.Light){t.appearance=this.appearance;this.tabPanels[s].appearance=this.appearance}}));if(this.appearance===e.Light){this.tabGroup.appearance=this.appearance}};this.getChildren=()=>{this.tabGroup=this.el.querySelector("ic-tab-group");this.tabs=Array.from(this.tabGroup.querySelectorAll("ic-tab"));this.tabPanels=Array.from(this.el.children).filter((t=>t.tagName==="IC-TAB-PANEL"));this.enabledTabs=this.getEnabledTabs()};this.keydownHandler=t=>{if(this.activationType==="automatic"){this.handleKeyBoardNavAutomatic(t)}else{this.handleKeyBoardNavManual(t)}};this.attachEventListeners=()=>{this.tabGroup.addEventListener("keydown",this.keydownHandler)};this.setControlledMode=()=>{if(this.selectedTabIndex!==undefined){this.controlledMode=true;this.selectedTab=this.selectedTabIndex}};this.setInitialTab=()=>{if(this.controlledMode){this.selectedTab=this.selectedTabIndex;this.focusedTabIndex=this.selectedTabIndex}else{const t=this.tabs.findIndex((t=>t.tabId===this.enabledTabs[0].tabId));this.selectedTab=t;this.focusedTabIndex=t}};this.configureTabs=()=>{this.enabledTabs.forEach((t=>{t.selected=t.tabPosition===this.selectedTab}));this.tabPanels.forEach((t=>{t.selectedTab=this.tabs[this.selectedTab].tabId}))};this.getEnabledTabs=()=>Array.from(this.tabs).filter((t=>!t.disabled));this.getIndexOfEnabledTab=t=>this.enabledTabs.findIndex((s=>s.tabId===this.tabs[t].tabId));this.keyboardSelectTab=t=>{const s=this.tabs.findIndex((s=>s.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();if(!this.controlledMode){this.selectedTab=s}else{this.icTabSelect.emit({tabIndex:s,tabLabel:this.el.querySelectorAll("ic-tab")[s].textContent.trim()});this.tabSelect.emit({tabIndex:s,tabLabel:this.el.querySelectorAll("ic-tab")[s].textContent.trim()})}};this.keyboardFocusTab=t=>{const s=this.tabs.findIndex((s=>s.tabId===this.enabledTabs[t].tabId));this.enabledTabs[t].focus();this.focusedTabIndex=s};this.handleKeyBoardNavAutomatic=t=>{const s=t.key;const i=this.getIndexOfEnabledTab(this.selectedTab);let h=true;switch(s){case"Home":this.keyboardSelectTab(0);break;case"End":this.keyboardSelectTab(this.enabledTabs.length-1);break;case"ArrowRight":if(i<this.enabledTabs.length-1){this.keyboardSelectTab(i+1)}else{this.keyboardSelectTab(0)}break;case"ArrowLeft":if(i>0){this.keyboardSelectTab(i-1)}else{this.keyboardSelectTab(this.enabledTabs.length-1)}break;default:h=false}if(h)t.preventDefault()};this.handleKeyBoardNavManual=t=>{const s=t.key;const i=this.getIndexOfEnabledTab(this.focusedTabIndex);let h=true;switch(s){case"Home":this.keyboardFocusTab(0);break;case"End":this.keyboardFocusTab(this.enabledTabs.length-1);break;case"ArrowRight":if(i<this.enabledTabs.length-1){this.keyboardFocusTab(i+1)}else{this.keyboardFocusTab(0)}break;case"ArrowLeft":if(i>0){this.keyboardFocusTab(i-1)}else{this.keyboardFocusTab(this.enabledTabs.length-1)}break;case"Enter":this.keyboardSelectTab(this.focusedTabIndex);break;case" ":this.keyboardSelectTab(this.focusedTabIndex);break;default:h=false}if(h)t.preventDefault()};this.selectedTab=undefined;this.activationType="automatic";this.appearance="dark";this.contextId="default";this.selectedTabIndex=undefined}watchAppearanceHandler(){this.tabs.forEach(((t,s)=>{t.appearance=this.appearance;this.tabPanels[s].appearance=this.appearance}));this.tabGroup.appearance=this.appearance}updateSelectedTab(t){this.selectedTab=t}componentDidLoad(){this.setControlledMode();this.getChildren();this.linkTabs();this.attachEventListeners();this.setInitialTab();this.configureTabs()}componentWillUpdate(){this.configureTabs()}disconnectedCallback(){this.tabGroup.removeEventListener("keydown",this.keydownHandler)}tabClickHandler(t){if(this.selectedTabIndex===undefined&&t.detail.contextId===this.contextId){this.selectedTab=t.detail.position}this.icTabSelect.emit({tabIndex:t.detail.position,tabLabel:this.el.querySelectorAll("ic-tab")[t.detail.position].textContent.trim()});this.tabSelect.emit({tabIndex:t.detail.position,tabLabel:this.el.querySelectorAll("ic-tab")[t.detail.position].textContent.trim()});t.stopImmediatePropagation()}tabCreatedHandler(t){if(this.tabs&&this.tabPanels){(t.detail.setFocus?this.newTabs:this.newTabPanels).push(t.detail);if(this.newTabs.length===this.newTabPanels.length){this.tabs.push(...this.newTabs);this.tabPanels.push(...this.newTabPanels);this.enabledTabs=this.getEnabledTabs();this.linkTabs();this.newTabs=[];this.newTabPanels=[]}}}tabEnabledHandler(){this.enabledTabs=this.getEnabledTabs()}async tabRemovedHandler(t){this.getChildren();this.enabledTabs=this.getEnabledTabs();this.linkTabs();if(this.tabs[this.selectedTab]&&this.tabPanels[this.selectedTab]){this.tabs[this.selectedTab].selected=true;this.tabPanels[this.selectedTab].selectedTab=this.tabs[this.selectedTab].tabId}else{this.setInitialTab()}if(t){this.tabs[this.selectedTab].setFocus()}}render(){return i("slot",null)}get el(){return h(this)}static get watchers(){return{appearance:["watchAppearanceHandler"],selectedTabIndex:["updateSelectedTab"]}}};export{a as ic_tab_context};
2
- //# sourceMappingURL=p-3ba4335c.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TabContext","constructor","hostRef","this","newTabPanels","newTabs","linkTabs","tabs","forEach","tab","index","tabId","contextId","tabPanelId","shared","contextIdAttr","setAttribute","tabPosition","tabGroup","tabPanels","panelId","appearance","IcThemeForegroundEnum","Light","getChildren","el","querySelector","Array","from","querySelectorAll","children","filter","child","tagName","enabledTabs","getEnabledTabs","keydownHandler","event","activationType","handleKeyBoardNavAutomatic","handleKeyBoardNavManual","attachEventListeners","addEventListener","setControlledMode","selectedTabIndex","undefined","controlledMode","selectedTab","setInitialTab","focusedTabIndex","firstEnabledTabIndex","findIndex","configureTabs","selected","tabPanel","disabled","getIndexOfEnabledTab","allTabsIndex","keyboardSelectTab","enabledTabIndex","newIndex","focus","icTabSelect","emit","tabIndex","tabLabel","textContent","trim","tabSelect","keyboardFocusTab","key","preventDefault","length","watchAppearanceHandler","updateSelectedTab","newValue","componentDidLoad","componentWillUpdate","disconnectedCallback","removeEventListener","tabClickHandler","detail","position","stopImmediatePropagation","tabCreatedHandler","ev","setFocus","push","tabEnabledHandler","tabRemovedHandler","hadFocus","render","h"],"sources":["../web-components/dist/collection/components/ic-tab-context/ic-tab-context.js"],"sourcesContent":["import { h, } from \"@stencil/core\";\nimport { IcThemeForegroundEnum, } from \"../../utils/types\";\nexport class TabContext {\n constructor() {\n this.newTabPanels = [];\n this.newTabs = [];\n // Sets attributes to link tab-group, tabs and tab-panels\n this.linkTabs = () => {\n this.tabs.forEach((tab, index) => {\n const tabId = `ic-tab-${index}-context-${this.contextId}`;\n const tabPanelId = `ic-tab-panel-${index}-context-${this.contextId}`;\n const shared = `ic-tab--${index}-context-${this.contextId}`;\n const contextIdAttr = \"context-id\";\n tab.setAttribute(\"id\", tabId);\n tab.tabId = shared;\n tab.tabPosition = index;\n tab.setAttribute(\"aria-controls\", tabPanelId);\n tab.setAttribute(contextIdAttr, this.contextId);\n this.tabGroup.setAttribute(contextIdAttr, this.contextId);\n this.tabPanels[index].setAttribute(\"id\", tabPanelId);\n this.tabPanels[index].panelId = shared;\n this.tabPanels[index].tabPosition = index;\n this.tabPanels[index].setAttribute(\"aria-labelledby\", tabId);\n this.tabPanels[index].setAttribute(contextIdAttr, this.contextId);\n if (this.appearance === IcThemeForegroundEnum.Light) {\n tab.appearance = this.appearance;\n this.tabPanels[index].appearance = this.appearance;\n }\n });\n if (this.appearance === IcThemeForegroundEnum.Light) {\n this.tabGroup.appearance = this.appearance;\n }\n };\n // Gets tabs and tabpanels with the same context ID\n // Using querySelector to selector the children in relation to the host\n this.getChildren = () => {\n this.tabGroup = this.el.querySelector(\"ic-tab-group\");\n this.tabs = Array.from(this.tabGroup.querySelectorAll(\"ic-tab\"));\n this.tabPanels = Array.from(this.el.children).filter((child) => child.tagName === \"IC-TAB-PANEL\");\n this.enabledTabs = this.getEnabledTabs();\n };\n this.keydownHandler = (event) => {\n if (this.activationType === \"automatic\") {\n this.handleKeyBoardNavAutomatic(event);\n }\n else {\n this.handleKeyBoardNavManual(event);\n }\n };\n // Determines how keyboard navigation is to be handled based on the activation type\n this.attachEventListeners = () => {\n this.tabGroup.addEventListener(\"keydown\", this.keydownHandler);\n };\n // Determines whether the selected tab is being controlled within the component\n // or by the user (via selectedTabIndex and onIcTabSelect)\n this.setControlledMode = () => {\n if (this.selectedTabIndex !== undefined) {\n this.controlledMode = true;\n this.selectedTab = this.selectedTabIndex;\n }\n };\n // Sets the tab that is selected on initial render\n this.setInitialTab = () => {\n if (this.controlledMode) {\n this.selectedTab = this.selectedTabIndex;\n this.focusedTabIndex = this.selectedTabIndex;\n }\n else {\n const firstEnabledTabIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[0].tabId);\n this.selectedTab = firstEnabledTabIndex;\n this.focusedTabIndex = firstEnabledTabIndex;\n }\n };\n // Passes the selected tab to the tab and tab panel components\n this.configureTabs = () => {\n this.enabledTabs.forEach((tab) => {\n tab.selected = tab.tabPosition === this.selectedTab;\n });\n this.tabPanels.forEach((tabPanel) => {\n tabPanel.selectedTab = this.tabs[this.selectedTab].tabId;\n });\n };\n this.getEnabledTabs = () => {\n return Array.from(this.tabs).filter((child) => !child.disabled);\n };\n this.getIndexOfEnabledTab = (allTabsIndex) => {\n return this.enabledTabs.findIndex((tab) => tab.tabId === this.tabs[allTabsIndex].tabId);\n };\n // Sets focus on tab and selects it\n this.keyboardSelectTab = (enabledTabIndex) => {\n const newIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId);\n this.enabledTabs[enabledTabIndex].focus();\n if (!this.controlledMode) {\n this.selectedTab = newIndex;\n }\n else {\n /* eslint-disable no-unexpected-multiline */\n this.icTabSelect.emit({\n tabIndex: newIndex,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[newIndex].textContent.trim(),\n });\n this.tabSelect.emit({\n tabIndex: newIndex,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[newIndex].textContent.trim(),\n });\n }\n /* eslint-enable no-unexpected-multiline */\n };\n // Sets focus on tab without selecting it (for manual activation)\n this.keyboardFocusTab = (enabledTabIndex) => {\n const newIndex = this.tabs.findIndex((tab) => tab.tabId === this.enabledTabs[enabledTabIndex].tabId);\n this.enabledTabs[enabledTabIndex].focus();\n this.focusedTabIndex = newIndex;\n };\n this.handleKeyBoardNavAutomatic = (event) => {\n const key = event.key;\n const enabledTabIndex = this.getIndexOfEnabledTab(this.selectedTab);\n let preventDefault = true;\n switch (key) {\n case \"Home\":\n this.keyboardSelectTab(0);\n break;\n case \"End\":\n this.keyboardSelectTab(this.enabledTabs.length - 1);\n break;\n case \"ArrowRight\":\n if (enabledTabIndex < this.enabledTabs.length - 1) {\n this.keyboardSelectTab(enabledTabIndex + 1);\n }\n else {\n this.keyboardSelectTab(0);\n }\n break;\n case \"ArrowLeft\":\n if (enabledTabIndex > 0) {\n this.keyboardSelectTab(enabledTabIndex - 1);\n }\n else {\n this.keyboardSelectTab(this.enabledTabs.length - 1);\n }\n break;\n default:\n preventDefault = false;\n }\n if (preventDefault)\n event.preventDefault();\n };\n this.handleKeyBoardNavManual = (event) => {\n const key = event.key;\n const enabledTabIndex = this.getIndexOfEnabledTab(this.focusedTabIndex);\n let preventDefault = true;\n switch (key) {\n case \"Home\":\n this.keyboardFocusTab(0);\n break;\n case \"End\":\n this.keyboardFocusTab(this.enabledTabs.length - 1);\n break;\n case \"ArrowRight\":\n if (enabledTabIndex < this.enabledTabs.length - 1) {\n this.keyboardFocusTab(enabledTabIndex + 1);\n }\n else {\n this.keyboardFocusTab(0);\n }\n break;\n case \"ArrowLeft\":\n if (enabledTabIndex > 0) {\n this.keyboardFocusTab(enabledTabIndex - 1);\n }\n else {\n this.keyboardFocusTab(this.enabledTabs.length - 1);\n }\n break;\n case \"Enter\":\n this.keyboardSelectTab(this.focusedTabIndex);\n break;\n case \" \":\n this.keyboardSelectTab(this.focusedTabIndex);\n break;\n default:\n preventDefault = false;\n }\n if (preventDefault)\n event.preventDefault();\n };\n this.selectedTab = undefined;\n this.activationType = \"automatic\";\n this.appearance = \"dark\";\n this.contextId = \"default\";\n this.selectedTabIndex = undefined;\n }\n watchAppearanceHandler() {\n this.tabs.forEach((tab, index) => {\n tab.appearance = this.appearance;\n this.tabPanels[index].appearance = this.appearance;\n });\n this.tabGroup.appearance = this.appearance;\n }\n updateSelectedTab(newValue) {\n this.selectedTab = newValue;\n }\n componentDidLoad() {\n this.setControlledMode();\n this.getChildren();\n this.linkTabs();\n this.attachEventListeners();\n this.setInitialTab();\n this.configureTabs();\n }\n componentWillUpdate() {\n this.configureTabs();\n }\n disconnectedCallback() {\n this.tabGroup.removeEventListener(\"keydown\", this.keydownHandler);\n }\n tabClickHandler(event) {\n if (this.selectedTabIndex === undefined &&\n event.detail.contextId === this.contextId) {\n this.selectedTab = event.detail.position;\n }\n /* eslint-disable no-unexpected-multiline */\n this.icTabSelect.emit({\n tabIndex: event.detail.position,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[event.detail.position].textContent.trim(),\n });\n this.tabSelect.emit({\n tabIndex: event.detail.position,\n tabLabel: this.el\n .querySelectorAll(\"ic-tab\")[event.detail.position].textContent.trim(),\n });\n /* eslint-enable no-unexpected-multiline */\n event.stopImmediatePropagation();\n }\n tabCreatedHandler(ev) {\n if (this.tabs && this.tabPanels) {\n (ev.detail.setFocus ? this.newTabs : this.newTabPanels).push(ev.detail);\n if (this.newTabs.length === this.newTabPanels.length) {\n this.tabs.push(...this.newTabs);\n this.tabPanels.push(...this.newTabPanels);\n this.enabledTabs = this.getEnabledTabs();\n this.linkTabs();\n this.newTabs = [];\n this.newTabPanels = [];\n }\n }\n }\n tabEnabledHandler() {\n this.enabledTabs = this.getEnabledTabs();\n }\n /**\n * @internal Used to set tab/tab panel IDs when a tab/tab panel has been removed\n */\n async tabRemovedHandler(hadFocus) {\n this.getChildren();\n this.enabledTabs = this.getEnabledTabs();\n this.linkTabs();\n if (this.tabs[this.selectedTab] && this.tabPanels[this.selectedTab]) {\n this.tabs[this.selectedTab].selected = true;\n this.tabPanels[this.selectedTab].selectedTab =\n this.tabs[this.selectedTab].tabId;\n }\n else {\n this.setInitialTab();\n }\n if (hadFocus) {\n this.tabs[this.selectedTab].setFocus();\n }\n }\n render() {\n return h(\"slot\", null);\n }\n static get is() { return \"ic-tab-context\"; }\n static get properties() {\n return {\n \"activationType\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcActivationTypes\",\n \"resolved\": \"\\\"automatic\\\" | \\\"manual\\\"\",\n \"references\": {\n \"IcActivationTypes\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcActivationTypes\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Determines whether tabs have to be manually activated (by pressing 'Enter' or 'Space') when they receive focus using keyboard navigation.\"\n },\n \"attribute\": \"activation-type\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"automatic\\\"\"\n },\n \"appearance\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcThemeForegroundNoDefault\",\n \"resolved\": \"\\\"dark\\\" | \\\"light\\\"\",\n \"references\": {\n \"IcThemeForegroundNoDefault\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcThemeForegroundNoDefault\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The appearance of the tab context, e.g dark, or light.\"\n },\n \"attribute\": \"appearance\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"dark\\\"\"\n },\n \"contextId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The unique context needed if using multiple tabs inside one another i.e. rendering another set of tabs inside a tab panel.\"\n },\n \"attribute\": \"context-id\",\n \"reflect\": true,\n \"defaultValue\": \"\\\"default\\\"\"\n },\n \"selectedTabIndex\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The selected tab to be controlled by the user. Must be used alongside the icTabSelect event to manage tab selection.\"\n },\n \"attribute\": \"selected-tab-index\",\n \"reflect\": false\n }\n };\n }\n static get states() {\n return {\n \"selectedTab\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"icTabSelect\",\n \"name\": \"icTabSelect\",\n \"bubbles\": false,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Emitted when a user selects a tab.\"\n },\n \"complexType\": {\n \"original\": \"IcTabSelectEventDetail\",\n \"resolved\": \"IcTabSelectEventDetail\",\n \"references\": {\n \"IcTabSelectEventDetail\": {\n \"location\": \"import\",\n \"path\": \"../ic-tab/ic-tab.types\",\n \"id\": \"src/components/ic-tab/ic-tab.types.ts::IcTabSelectEventDetail\"\n }\n }\n }\n }, {\n \"method\": \"tabSelect\",\n \"name\": \"tabSelect\",\n \"bubbles\": false,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"deprecated\",\n \"text\": \"This event should not be used anymore. Use icTabSelect instead.\"\n }],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"IcTabSelectEventDetail\",\n \"resolved\": \"IcTabSelectEventDetail\",\n \"references\": {\n \"IcTabSelectEventDetail\": {\n \"location\": \"import\",\n \"path\": \"../ic-tab/ic-tab.types\",\n \"id\": \"src/components/ic-tab/ic-tab.types.ts::IcTabSelectEventDetail\"\n }\n }\n }\n }];\n }\n static get methods() {\n return {\n \"tabRemovedHandler\": {\n \"complexType\": {\n \"signature\": \"(hadFocus?: boolean) => Promise<void>\",\n \"parameters\": [{\n \"name\": \"hadFocus\",\n \"type\": \"boolean\",\n \"docs\": \"\"\n }],\n \"references\": {\n \"Promise\": {\n \"location\": \"global\",\n \"id\": \"global::Promise\"\n }\n },\n \"return\": \"Promise<void>\"\n },\n \"docs\": {\n \"text\": \"\",\n \"tags\": [{\n \"name\": \"internal\",\n \"text\": \"Used to set tab/tab panel IDs when a tab/tab panel has been removed\"\n }]\n }\n }\n };\n }\n static get elementRef() { return \"el\"; }\n static get watchers() {\n return [{\n \"propName\": \"appearance\",\n \"methodName\": \"watchAppearanceHandler\"\n }, {\n \"propName\": \"selectedTabIndex\",\n \"methodName\": \"updateSelectedTab\"\n }];\n }\n static get listeners() {\n return [{\n \"name\": \"tabClick\",\n \"method\": \"tabClickHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabCreated\",\n \"method\": \"tabCreatedHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabPanelCreated\",\n \"method\": \"tabCreatedHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"tabEnabled\",\n \"method\": \"tabEnabledHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }];\n }\n}\n//# sourceMappingURL=ic-tab-context.js.map\n"],"mappings":"mGAEa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UhB,YAAYC,SAEvEhE,KAAKiE,UAAUL,KAAK,CAChBC,SAAU3B,EAAM4C,OAAOC,SACvBjB,SAAU9D,KAAKsB,GACVI,iBAAiB,UAAUQ,EAAM4C,OAAOC,UAAUhB,YAAYC,SAGvE9B,EAAM8C,0B,CAEV,iBAAAC,CAAkBC,GACd,GAAIlF,KAAKI,MAAQJ,KAAKgB,UAAW,EAC5BkE,EAAGJ,OAAOK,SAAWnF,KAAKE,QAAUF,KAAKC,cAAcmF,KAAKF,EAAGJ,QAChE,GAAI9E,KAAKE,QAAQmE,SAAWrE,KAAKC,aAAaoE,OAAQ,CAClDrE,KAAKI,KAAKgF,QAAQpF,KAAKE,SACvBF,KAAKgB,UAAUoE,QAAQpF,KAAKC,cAC5BD,KAAK+B,YAAc/B,KAAKgC,iBACxBhC,KAAKG,WACLH,KAAKE,QAAU,GACfF,KAAKC,aAAe,E,GAIhC,iBAAAoF,GACIrF,KAAK+B,YAAc/B,KAAKgC,gB,CAK5B,uBAAMsD,CAAkBC,GACpBvF,KAAKqB,cACLrB,KAAK+B,YAAc/B,KAAKgC,iBACxBhC,KAAKG,WACL,GAAIH,KAAKI,KAAKJ,KAAK4C,cAAgB5C,KAAKgB,UAAUhB,KAAK4C,aAAc,CACjE5C,KAAKI,KAAKJ,KAAK4C,aAAaM,SAAW,KACvClD,KAAKgB,UAAUhB,KAAK4C,aAAaA,YAC7B5C,KAAKI,KAAKJ,KAAK4C,aAAapC,K,KAE/B,CACDR,KAAK6C,e,CAET,GAAI0C,EAAU,CACVvF,KAAKI,KAAKJ,KAAK4C,aAAauC,U,EAGpC,MAAAK,GACI,OAAOC,EAAE,OAAQ,K"}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,f as i,h as a,H as s,g as r}from"./p-8455d1bb.js";import{c as n}from"./p-e081702e.js";import{j as o,i as l,V as c}from"./p-8128572e.js";import{I as d}from"./p-fd186591.js";const u='/*! 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}.container{min-height:3.5rem;border-radius:var(--ic-border-radius);position:relative;display:flex;align-items:center}.container-neutral{background-color:var(--ic-status-unknown-light)}.container-info{background-color:var(--ic-status-info-light)}.container-warning{background-color:var(--ic-status-warning-light)}.container-error{background-color:var(--ic-status-error-light)}.container-success{background-color:var(--ic-status-success-light)}.alert-icon-container{height:100%;display:flex;align-items:center}.divider{height:100%;width:var(--ic-space-xs);border-radius:var(--ic-space-xxxs) 0 0 var(--ic-space-xxxs);position:absolute}.divider-neutral{background-color:var(--ic-status-unknown)}.divider-info{background-color:var(--ic-status-info)}.divider-warning{background-color:var(--ic-status-warning)}.divider-error{background-color:var(--ic-status-error)}.divider-success{background-color:var(--ic-status-success)}.alert-icon{height:var(--ic-space-lg);width:1.375rem;margin-left:1.125rem}.icon-placeholder{margin-left:var(--ic-space-xs)}.alert-icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.icon-neutral>svg,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block;fill:var(--ic-status-unknown)}:host([variant="info"]) .alert-icon svg{fill:var(--ic-status-info)}:host([variant="warning"]) .alert-icon svg{fill:var(--ic-status-warning)}:host([variant="error"]) .alert-icon svg{fill:var(--ic-status-error)}:host([variant="success"]) .alert-icon svg{fill:var(--ic-status-success)}.alert-content{display:flex;align-items:center;margin-left:0.625rem;width:100%}.alert-message{display:flex;align-items:center;padding:var(--ic-space-xs) var(--ic-space-xs) var(--ic-space-xs) 0;flex:1}.alert-message-title-above{display:inline}.alert-title{margin-right:var(--ic-space-xs)}.alert-title-above{white-space:normal}.alert-action-container{margin-right:var(--ic-space-xs);display:flex;align-items:center}.dismiss-icon{margin-right:var(--ic-space-xxxs);margin-left:-0.375rem;padding:0.375rem;border:none;border-radius:50%;background-color:inherit;display:flex;align-items:center;justify-content:center}.dismiss-icon:hover{cursor:pointer}@media (max-width: 628px){.alert-content{display:flex;flex-direction:column;align-items:flex-start}.alert-message{display:flex;flex-direction:column;align-items:flex-start}.alert-title{white-space:normal}.alert-action-container{margin-bottom:var(--ic-space-xs)}}@media (forced-colors: active){.container{border:var(--ic-hc-border)}}';const p=class{constructor(a){e(this,a);this.dismiss=t(this,"dismiss",7);this.icDismiss=t(this,"icDismiss",7);this.hostMutationObserver=null;this.dismissAction=()=>{this.dismiss.emit();this.icDismiss.emit()};this.hostMutationCallback=e=>{if(e.some((({type:e,addedNodes:t,removedNodes:i})=>e==="childList"?o(t,i,"action"):false))){i(this)}};this.alertTitleWrap=false;this.visible=true;this.announced=true;this.dismissible=false;this.heading="";this.message=undefined;this.titleAbove=false;this.variant="neutral";this.showDefaultIcon=true}disconnectedCallback(){var e;(e=this.hostMutationObserver)===null||e===void 0?void 0:e.disconnect()}componentDidLoad(){this.alertTitleShouldWrap();this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}handleClick(){this.visible=!this.visible}alertTitleShouldWrap(){var e;const t=(e=this.el.shadowRoot.querySelector(".alert-title"))===null||e===void 0?void 0:e.clientHeight;if(t>24)this.alertTitleWrap=true}render(){const{variant:e,heading:t,message:i,titleAbove:r,dismissible:o,announced:u,visible:p,showDefaultIcon:m}=this;return p&&a(s,{role:u?"alert":null,class:{[d.Dark]:true}},a("div",{class:{["container"]:true,[`container-${e}`]:true}},a("div",{class:"alert-icon-container"},a("div",{class:{["divider"]:true,[`divider-${e}`]:true}}),e==="neutral"?l(this.el,"neutral-icon")?a("div",{class:"alert-icon svg-container icon-neutral"},a("slot",{name:"neutral-icon"})):m?a("span",{class:{["alert-icon"]:true,["svg-container"]:true,[`icon-${e}`]:true},innerHTML:c[e].icon}):a("div",{class:"icon-placeholder"}):a("span",{class:{["alert-icon"]:true,["svg-container"]:true,[`icon-${e}`]:true},innerHTML:c[e].icon})),a("div",{class:"alert-content"},a("div",{class:{["alert-message"]:true,["alert-message-title-above"]:r||this.alertTitleWrap}},t&&a("ic-typography",{class:{["alert-title"]:true,["alert-title-above"]:r||this.alertTitleWrap},variant:"subtitle-large"},a("p",null,t)),a("slot",{name:"message"},a("ic-typography",{variant:"body"},i))),l(this.el,"action")&&a("div",{class:"alert-action-container"},a("slot",{name:"action"}))),a("div",{class:"dismiss-icon-container"},o&&a("ic-button",{class:{["svg-container"]:true,["dismiss-icon"]:true},innerHTML:n,onClick:this.dismissAction,variant:"icon",appearance:d.Dark,title:"dismiss"}))))}get el(){return r(this)}};p.style=u;export{p as ic_alert};
2
- //# sourceMappingURL=p-40e5fa80.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icAlertCss","Alert","constructor","hostRef","this","hostMutationObserver","dismissAction","dismiss","emit","icDismiss","hostMutationCallback","mutationList","some","type","addedNodes","removedNodes","checkSlotInChildMutations","forceUpdate","alertTitleWrap","visible","announced","dismissible","heading","message","undefined","titleAbove","variant","showDefaultIcon","disconnectedCallback","_a","disconnect","componentDidLoad","alertTitleShouldWrap","MutationObserver","observe","el","childList","handleClick","titleHeight","shadowRoot","querySelector","clientHeight","render","h","Host","role","class","IcThemeForegroundEnum","Dark","isSlotUsed","name","innerHTML","VARIANT_ICONS","icon","closeIcon","onClick","appearance","title"],"sources":["../web-components/dist/collection/components/ic-alert/ic-alert.css?tag=ic-alert&encapsulation=shadow","../web-components/dist/collection/components/ic-alert/ic-alert.js"],"sourcesContent":["/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers.\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Render the `main` element consistently in IE.\n */\n\nmain {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * Remove the gray background on active links in IE 10.\n */\n\na {\n background-color: transparent;\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57-\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10.\n */\n\nimg {\n border-style: none;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers.\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput {\n /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect {\n /* 1 */\n text-transform: none;\n}\n\n/**\n * Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\n[type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Remove the default vertical scrollbar in IE 10+.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10.\n * 2. Remove the padding in IE 10.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding in Chrome and Safari on macOS.\n */\n\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in Edge, IE 10+, and Firefox.\n */\n\ndetails {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Misc\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10+.\n */\n\ntemplate {\n display: none;\n}\n\n/**\n * Add the correct display in IE 10.\n */\n\n[hidden] {\n display: none;\n}\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-style: inherit;\n vertical-align: baseline;\n}\n\n\n:host {\n display: block;\n}\n\n.container {\n min-height: 3.5rem;\n border-radius: var(--ic-border-radius);\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.container-neutral {\n background-color: var(--ic-status-unknown-light);\n}\n\n.container-info {\n background-color: var(--ic-status-info-light);\n}\n\n.container-warning {\n background-color: var(--ic-status-warning-light);\n}\n\n.container-error {\n background-color: var(--ic-status-error-light);\n}\n\n.container-success {\n background-color: var(--ic-status-success-light);\n}\n\n.alert-icon-container {\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.divider {\n height: 100%;\n width: var(--ic-space-xs);\n border-radius: var(--ic-space-xxxs) 0 0 var(--ic-space-xxxs);\n position: absolute;\n}\n\n.divider-neutral {\n background-color: var(--ic-status-unknown);\n}\n\n.divider-info {\n background-color: var(--ic-status-info);\n}\n\n.divider-warning {\n background-color: var(--ic-status-warning);\n}\n\n.divider-error {\n background-color: var(--ic-status-error);\n}\n\n.divider-success {\n background-color: var(--ic-status-success);\n}\n\n.alert-icon {\n height: var(--ic-space-lg);\n width: 1.375rem;\n margin-left: 1.125rem;\n}\n\n.icon-placeholder {\n margin-left: var(--ic-space-xs);\n}\n\n.alert-icon > svg {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n display: inline-block;\n}\n\n.icon-neutral > svg,\n::slotted(svg) {\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n display: inline-block;\n fill: var(--ic-status-unknown);\n}\n\n:host([variant=\"info\"]) .alert-icon svg {\n fill: var(--ic-status-info);\n}\n\n:host([variant=\"warning\"]) .alert-icon svg {\n fill: var(--ic-status-warning);\n}\n\n:host([variant=\"error\"]) .alert-icon svg {\n fill: var(--ic-status-error);\n}\n\n:host([variant=\"success\"]) .alert-icon svg {\n fill: var(--ic-status-success);\n}\n\n.alert-content {\n display: flex;\n align-items: center;\n margin-left: 0.625rem;\n width: 100%;\n}\n\n.alert-message {\n display: flex;\n align-items: center;\n padding: var(--ic-space-xs) var(--ic-space-xs) var(--ic-space-xs) 0;\n flex: 1;\n}\n\n.alert-message-title-above {\n display: inline;\n}\n\n.alert-title {\n margin-right: var(--ic-space-xs);\n}\n\n.alert-title-above {\n white-space: normal;\n}\n\n.alert-action-container {\n margin-right: var(--ic-space-xs);\n display: flex;\n align-items: center;\n}\n\n.dismiss-icon {\n margin-right: var(--ic-space-xxxs);\n margin-left: -0.375rem;\n padding: 0.375rem;\n border: none;\n border-radius: 50%;\n background-color: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.dismiss-icon:hover {\n cursor: pointer;\n}\n\n@media (max-width: 628px) {\n .alert-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .alert-message {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .alert-title {\n white-space: normal;\n }\n\n .alert-action-container {\n margin-bottom: var(--ic-space-xs);\n }\n}\n\n@media (forced-colors: active) {\n .container {\n border: var(--ic-hc-border);\n }\n}\n","import { Host, h, forceUpdate, } from \"@stencil/core\";\nimport closeIcon from \"../../assets/close-icon.svg\";\nimport { isSlotUsed, checkSlotInChildMutations } from \"../../utils/helpers\";\nimport { IcThemeForegroundEnum } from \"../../utils/types\";\nimport { VARIANT_ICONS } from \"../../utils/constants\";\n/**\n * @slot message - Content is placed to the right of the title.\n * @slot action - Content is placed to the right of the message.\n * @slot neutral-icon - A custom neutral icon is placed to the left of the title. This will override the default icon if used.\n */\nexport class Alert {\n constructor() {\n this.hostMutationObserver = null;\n this.dismissAction = () => {\n this.dismiss.emit();\n this.icDismiss.emit();\n };\n this.hostMutationCallback = (mutationList) => {\n if (mutationList.some(({ type, addedNodes, removedNodes }) => type === \"childList\"\n ? checkSlotInChildMutations(addedNodes, removedNodes, \"action\")\n : false)) {\n forceUpdate(this);\n }\n };\n this.alertTitleWrap = false;\n this.visible = true;\n this.announced = true;\n this.dismissible = false;\n this.heading = \"\";\n this.message = undefined;\n this.titleAbove = false;\n this.variant = \"neutral\";\n this.showDefaultIcon = true;\n }\n disconnectedCallback() {\n var _a;\n (_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();\n }\n componentDidLoad() {\n this.alertTitleShouldWrap();\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n handleClick() {\n this.visible = !this.visible;\n }\n alertTitleShouldWrap() {\n var _a;\n const titleHeight = (_a = this.el.shadowRoot.querySelector(\".alert-title\")) === null || _a === void 0 ? void 0 : _a.clientHeight;\n if (titleHeight > 24)\n this.alertTitleWrap = true;\n }\n render() {\n const { variant, heading, message, titleAbove, dismissible, announced, visible, showDefaultIcon, } = this;\n return (visible && (h(Host, { role: announced ? \"alert\" : null, class: {\n [IcThemeForegroundEnum.Dark]: true,\n } }, h(\"div\", { class: {\n [\"container\"]: true,\n [`container-${variant}`]: true,\n } }, h(\"div\", { class: \"alert-icon-container\" }, h(\"div\", { class: {\n [\"divider\"]: true,\n [`divider-${variant}`]: true,\n } }), variant === \"neutral\" ? (isSlotUsed(this.el, \"neutral-icon\") ? (h(\"div\", { class: \"alert-icon svg-container icon-neutral\" }, h(\"slot\", { name: \"neutral-icon\" }))) : showDefaultIcon ? (h(\"span\", { class: {\n [\"alert-icon\"]: true,\n [\"svg-container\"]: true,\n [`icon-${variant}`]: true,\n }, innerHTML: VARIANT_ICONS[variant].icon })) : (h(\"div\", { class: \"icon-placeholder\" }))) : (h(\"span\", { class: {\n [\"alert-icon\"]: true,\n [\"svg-container\"]: true,\n [`icon-${variant}`]: true,\n }, innerHTML: VARIANT_ICONS[variant].icon }))), h(\"div\", { class: \"alert-content\" }, h(\"div\", { class: {\n [\"alert-message\"]: true,\n [\"alert-message-title-above\"]: titleAbove || this.alertTitleWrap,\n } }, heading && (h(\"ic-typography\", { class: {\n [\"alert-title\"]: true,\n [\"alert-title-above\"]: titleAbove || this.alertTitleWrap,\n }, variant: \"subtitle-large\" }, h(\"p\", null, heading))), h(\"slot\", { name: \"message\" }, h(\"ic-typography\", { variant: \"body\" }, message))), isSlotUsed(this.el, \"action\") && (h(\"div\", { class: \"alert-action-container\" }, h(\"slot\", { name: \"action\" })))), h(\"div\", { class: \"dismiss-icon-container\" }, dismissible && (h(\"ic-button\", { class: {\n [\"svg-container\"]: true,\n [\"dismiss-icon\"]: true,\n }, innerHTML: closeIcon, onClick: this.dismissAction, variant: \"icon\", appearance: IcThemeForegroundEnum.Dark, title: \"dismiss\" })))))));\n }\n static get is() { return \"ic-alert\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() {\n return {\n \"$\": [\"ic-alert.css\"]\n };\n }\n static get styleUrls() {\n return {\n \"$\": [\"ic-alert.css\"]\n };\n }\n static get properties() {\n return {\n \"announced\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the alert will have the 'alert' ARIA role and will be announced to screen readers.\"\n },\n \"attribute\": \"announced\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n },\n \"dismissible\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the alert will have a close icon at the end to dismiss it.\"\n },\n \"attribute\": \"dismissible\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"heading\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The optional title to display at the start of the alert.\"\n },\n \"attribute\": \"heading\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"\\\"\"\n },\n \"message\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The main body message of the alert.\"\n },\n \"attribute\": \"message\",\n \"reflect\": false\n },\n \"titleAbove\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the title and message will appear above and below instead of inline.\"\n },\n \"attribute\": \"title-above\",\n \"reflect\": false,\n \"defaultValue\": \"false\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"IcStatusVariants\",\n \"resolved\": \"\\\"error\\\" | \\\"info\\\" | \\\"neutral\\\" | \\\"success\\\" | \\\"warning\\\"\",\n \"references\": {\n \"IcStatusVariants\": {\n \"location\": \"import\",\n \"path\": \"../../utils/types\",\n \"id\": \"src/utils/types.ts::IcStatusVariants\"\n }\n }\n },\n \"required\": false,\n \"optional\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The variant of the alert which will be rendered.\"\n },\n \"attribute\": \"variant\",\n \"reflect\": false,\n \"defaultValue\": \"\\\"neutral\\\"\"\n },\n \"showDefaultIcon\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"If `true`, the default icon for the neutral variant will be appear on the left of the alert.\"\n },\n \"attribute\": \"show-default-icon\",\n \"reflect\": false,\n \"defaultValue\": \"true\"\n }\n };\n }\n static get states() {\n return {\n \"alertTitleWrap\": {},\n \"visible\": {}\n };\n }\n static get events() {\n return [{\n \"method\": \"dismiss\",\n \"name\": \"dismiss\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [{\n \"name\": \"deprecated\",\n \"text\": \"This event should not be used anymore. Use icDismiss instead.\"\n }],\n \"text\": \"\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }, {\n \"method\": \"icDismiss\",\n \"name\": \"icDismiss\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Is emitted when the user dismisses the alert.\"\n },\n \"complexType\": {\n \"original\": \"void\",\n \"resolved\": \"void\",\n \"references\": {}\n }\n }];\n }\n static get elementRef() { return \"el\"; }\n static get listeners() {\n return [{\n \"name\": \"icDismiss\",\n \"method\": \"handleClick\",\n \"target\": undefined,\n \"capture\": true,\n \"passive\": false\n }];\n }\n}\n//# sourceMappingURL=ic-alert.js.map\n"],"mappings":"iMAAA,MAAMA,EAAa,k1J,MCUNC,EAAK,MACd,WAAAC,CAAAC,G,gFACIC,KAAKC,qBAAuB,KAC5BD,KAAKE,cAAgB,KACjBF,KAAKG,QAAQC,OACbJ,KAAKK,UAAUD,MAAM,EAEzBJ,KAAKM,qBAAwBC,IACzB,GAAIA,EAAaC,MAAK,EAAGC,OAAMC,aAAYC,kBAAmBF,IAAS,YACjEG,EAA0BF,EAAYC,EAAc,UACpD,QAAQ,CACVE,EAAYb,K,GAGpBA,KAAKc,eAAiB,MACtBd,KAAKe,QAAU,KACff,KAAKgB,UAAY,KACjBhB,KAAKiB,YAAc,MACnBjB,KAAKkB,QAAU,GACflB,KAAKmB,QAAUC,UACfpB,KAAKqB,WAAa,MAClBrB,KAAKsB,QAAU,UACftB,KAAKuB,gBAAkB,I,CAE3B,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,CAAC,cAAe,KAChB,CAAC,iBAAkB,KACnB,CAAC,QAAQpB,KAAY,MACtByB,UAAWC,EAAc1B,GAAS2B,QAAWV,EAAE,MAAO,CAAEG,MAAO,iBAAmBH,EAAE,MAAO,CAAEG,MAAO,CACnG,CAAC,iBAAkB,KACnB,CAAC,6BAA8BrB,GAAcrB,KAAKc,iBACjDI,GAAYqB,EAAE,gBAAiB,CAAEG,MAAO,CACzC,CAAC,eAAgB,KACjB,CAAC,qBAAsBrB,GAAcrB,KAAKc,gBAC3CQ,QAAS,kBAAoBiB,EAAE,IAAK,KAAMrB,IAAYqB,EAAE,OAAQ,CAAEO,KAAM,WAAaP,EAAE,gBAAiB,CAAEjB,QAAS,QAAUH,KAAY0B,EAAW7C,KAAK+B,GAAI,WAAcQ,EAAE,MAAO,CAAEG,MAAO,0BAA4BH,EAAE,OAAQ,CAAEO,KAAM,aAAgBP,EAAE,MAAO,CAAEG,MAAO,0BAA4BzB,GAAgBsB,EAAE,YAAa,CAAEG,MAAO,CAChV,CAAC,iBAAkB,KACnB,CAAC,gBAAiB,MACnBK,UAAWG,EAAWC,QAASnD,KAAKE,cAAeoB,QAAS,OAAQ8B,WAAYT,EAAsBC,KAAMS,MAAO,c"}
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,F as s,H as n,g as o}from"./p-8455d1bb.js";import{d as a,a as l,p as h,i as r,b as d}from"./p-297e99cf.js";const c=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">\n <path d="M9 3 5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"></path>\n</svg>`;const u=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(-90deg);">\n <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const v=`<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" style="transform: rotate(90deg)">\n <path d="M16.01 11H4v2h12.01v3L20 12l-3.99-4z"></path>\n</svg>`;const g=':host{position:relative;display:inline-flex;max-height:100%;width:var(--table-width, 100%);height:100%;min-width:var(--table-min-width);max-width:var(--table-max-width)}tbody{vertical-align:top}.table-container{position:relative;height:calc(100% - var(--ic-space-xxxs));display:flex;flex-direction:column;width:100%}.cell-container{display:flex;min-height:1.5rem;overflow-y:hidden;height:var(--row-height)}.truncation-show-hide{overflow:visible;display:block}.cell-icon.truncation-show-hide{display:flex}.cell-container:not(.data-type-element,.truncation-show-hide){overflow-x:hidden}ic-loading-indicator{position:sticky;top:20px}.table-row-container{position:relative;height:100%;overflow:auto;transition:var(--ic-easing-transition-fast);overflow-anchor:none}:host([show-pagination="true"]) .table-row-container{height:calc(100% - 3.5625rem)}table{table-layout:var(--table-layout, "fixed");border-spacing:0;width:100%;height:var(--table-height, auto)}.table-row-container:focus{outline:none;box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-easing-transition-fast);z-index:1}:host([embedded="true"]) .table-row-container{border:var(--ic-border-light)}.column-header-inner-container{padding:var(--ic-space-xs);box-sizing:border-box}.column-header-sticky{position:sticky;top:0;z-index:1}.column-header-overlay{position:sticky;top:0;z-index:1;box-shadow:0 0.375rem var(--ic-space-xs) calc(var(--ic-space-xxs * -1))\n rgb(0 0 0 / 20%)}.row-header-sticky{position:sticky;left:0}.column-header,.table-row{box-sizing:border-box}.table-row-selected{background-color:var(--ic-table-row-selected) !important}.sort-button{margin-left:auto}.sort-button:hover{background-color:var(--ic-action-dark-bg-hover)}.sort-button:active{background-color:var(--ic-action-dark-bg-active)}.sort-button svg{color:var(--ic-architectural-black)}.sort-button-unsorted svg{color:var(--ic-color-tertiary-text)}.table-density-dense .column-header-inner-container,td.table-density-dense{padding:var(--ic-space-xxs) var(--ic-space-xs) !important}.text-dense{font-size:var(--ic-font-size-label)}.table-density-spacious .column-header-inner-container,td.table-density-spacious{padding:0.625rem var(--ic-space-xs) !important}.text-spacious{font-size:1.125rem}.column-header-text{font-weight:var(--ic-font-weight-bold)}.row-header,.column-header{text-align:left;padding:var(--ic-space-xs);background-color:var(--ic-architectural-40);border-right:var(--ic-border-light);border-bottom:var(--ic-border-light)}.column-header{padding:0;width:var(--column-width);min-width:var(--column-min-width, 4rem);max-width:var(--column-max-width)}.column-header:last-child{border-right:none}.scrollable .column-header:last-child{border-right:var(--ic-border-light) !important}:host([embedded="true"]) tr:last-child .table-cell,:host([embedded="true"]) tr:last-child .row-header{border-bottom:none}.column-header-alignment-left,.row-header-alignment-left,.cell-alignment-left{text-align:left !important;justify-content:start !important}.column-header-alignment-right,.row-header-alignment-right,.cell-alignment-right{text-align:right !important;justify-content:end !important}.cell-alignment-right.truncation-tooltip ic-tooltip ic-typography{padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.cell-alignment-right.truncation-show-hide ic-typography{--ellipsis-padding-right:calc(var(--ic-space-xxs) + var(--ic-space-xs))}.column-header-alignment-center,.row-header-alignment-center,.cell-alignment-center{text-align:center !important;justify-content:center !important}.table-row:nth-child(even){background-color:var(--ic-architectural-20)}.table-cell{padding:var(--ic-space-xs);border-bottom:solid var(--ic-architectural-100) var(--ic-space-1px);overflow:hidden;box-sizing:border-box;max-width:var(--column-max-width);min-width:var(--column-min-width)}.data-type-string,.data-type-address{text-align:left;vertical-align:top}.data-type-number,.data-type-date{text-align:right;justify-content:end;vertical-align:top}.cell-alignment-top{vertical-align:top;align-items:flex-start}.cell-alignment-middle{vertical-align:middle;align-items:center}.cell-alignment-bottom{vertical-align:bottom;align-items:flex-end}.cell-emphasis-low{color:var(--ic-color-secondary-text)}.cell-emphasis-high{font-weight:var(--ic-font-weight-bold)}.pagination-container{background-color:var(--ic-architectural-40);border-top:var(--ic-border-light)}.screen-reader-sort-text,.table-caption{position:absolute;left:-100rem}.table-cell,.column-header,.row-header{word-wrap:break-word;white-space:pre-wrap}.loading-empty{padding:var(--ic-space-xl) var(--ic-space-xxl);margin-top:var(--ic-space-xl)}.updating-state{padding:0;border-bottom:var(--ic-border-light)}.updating-state-headers{border-bottom:none}.loading{position:absolute;left:calc(50% - 5.9741rem);opacity:0;transition:opacity var(--ic-transition-duration-slow)}.loading.show-background{background-color:var(--ic-architectural-white);border:var(--ic-border-light)}.loading.show{opacity:1}.icon,::slotted(svg){height:var(--ic-space-lg);width:var(--ic-space-lg);margin-right:var(--ic-space-xxs)}.column-header-alignment-right>.icon,.row-header-alignment-right>.icon,.cell-alignment-right>.icon,.column-header-alignment-right>::slotted(svg),.row-header-alignment-right>::slotted(svg),.cell-alignment-right>::slotted(svg){margin-right:auto}.column-header-alignment-center>ic-typography,.row-header-alignment-right>ic-typography,.cell-alignment-center>ic-typography{flex:1}.icon>svg{height:var(--ic-space-lg);width:var(--ic-space-lg);display:inline-block}.truncation-tooltip ic-typography{display:-webkit-box;-webkit-line-clamp:var(--ic-line-clamp, 0);-webkit-box-orient:vertical;overflow:hidden}.truncation-tooltip ic-typography,.truncation-show-hide ic-typography{white-space:normal}.ic-tooltip-overflow{overflow:hidden;width:100%}@media screen and (min-width: 576px){.column-header-inner-container{display:flex;align-items:center}}';const p=class{constructor(n){t(this,n);this.icRowHeightChange=i(this,"icRowHeightChange",7);this.icSortChange=i(this,"icSortChange",7);this.DENSITY_HEIGHT_MULTIPLIER={dense:.8,default:1,spacious:1.2};this.DENSITY_PADDING_HEIGHT_DIFF={dense:8,default:16,spacious:20};this.SORT_ICONS={unsorted:c,ascending:u,descending:v};this.hasLoadedForOneSecond=true;this.resizeObserver=null;this.SHOW_HIDE_STRING="show-hide";this.SHOW_HIDE_CSS_CLASS=`${this.SHOW_HIDE_STRING}-wrap`;this.TOOLTIP_STRING="tooltip";this.TOOLTIP=`ic-${this.TOOLTIP_STRING}`;this.TEXT_WRAP_STRING="text-wrap";this.TEXT_WRAP_CLASS=`.${this.TEXT_WRAP_STRING}`;this.dataUpdated=false;this.rowHeightSet=false;this.initialLoad=false;this.icPageChangeEvent=false;this.itemsPerPageChange=false;this.DATA_ROW_HEIGHT_STRING="data-row-height";this.ROW_HEIGHT_CSS_VARIABLE="--row-height";this.DEFAULT_LINE_HEIGHT=24;this.densityUpdate=false;this.truncationPatternUpdated=false;this.isNewDebounceDelaySet=false;this.updateSetRowHeight=t=>{const i=parseInt(getComputedStyle(document.documentElement).fontSize);if(t){const e=this.getCellContainer(t);const s=i*parseFloat(e.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(t.scrollHeight>s){e.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE)}}else{this.getTypographyElements().forEach((t=>{const e=this.getCellContainer(t);const s=i*parseFloat(e.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(t.scrollHeight>s){e.style.removeProperty(this.ROW_HEIGHT_CSS_VARIABLE)}}))}};this.debounceDataTruncation=()=>{this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.resizeObserver=new ResizeObserver(a((()=>{this.dataTruncation(t);if(!this.isNewDebounceDelaySet){this.setNewDebounceDelay(200)}}),(()=>this.debounceDelay)));this.resizeObserver.observe(t)}}))};this.setNewDebounceDelay=t=>{this.debounceDelay=t;this.isNewDebounceDelaySet=true};this.getLines=t=>Math.floor(t/this.DEFAULT_LINE_HEIGHT);this.truncate=(t,i,e)=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(i===null||i===void 0?void 0:i.clientHeight)){if(!t.closest(this.TEXT_WRAP_CLASS)){if(this.truncationPattern===this.TOOLTIP_STRING){this.addTooltipTruncation(t,i,e)}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.addShowHideTruncation(i,t)}}}else{if(this.truncationPattern===this.TOOLTIP_STRING&&e){t.setAttribute("style",`--ic-line-clamp: 0`);i.appendChild(t);e.remove()}if(this.truncationPattern===this.SHOW_HIDE_STRING&&!l(t.getAttribute("max-lines"))){this.resetShowHideTruncation(t)}}};this.dataTruncation=t=>{const i=this.getTooltip(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.classList.contains("data-type-element"))||this.dataUpdated){return}if(this.truncationPattern===this.SHOW_HIDE_STRING&&t.shadowRoot.querySelector("button")){const i=t.shadowRoot.querySelector("button");if(i){const i=this.getTruncWrapper(t);if(this.getLines(i.scrollHeight)===+t.getAttribute("max-lines")){this.resetShowHideTruncation(t)}}}if(this.rowHeightSet&&this.truncationPattern===this.SHOW_HIDE_STRING){const i=this.getTruncWrapper(t);if(i&&e.clientHeight-this.DEFAULT_LINE_HEIGHT>i.scrollHeight){this.resetShowHideTruncation(t);return}if(t.scrollHeight>e.clientHeight){this.addShowHideTruncation(e,t);return}}if((t===null||t===void 0?void 0:t.scrollHeight)>0&&(e===null||e===void 0?void 0:e.clientHeight)>0&&(t===null||t===void 0?void 0:t.scrollHeight)===(e===null||e===void 0?void 0:e.clientHeight)){if(i){this.removeTooltip(e,t,i)}return}this.truncate(t,e,i)};this.removeTextWrap=()=>{this.getTypographyElements().forEach((t=>{const i=t.closest("td");if(i.classList.contains(this.TEXT_WRAP_STRING)){i.classList.remove(this.TEXT_WRAP_STRING)}}))};this.getCellContainer=t=>t.closest(".cell-container");this.deleteTextWrapDataKey=t=>Array.isArray(t)&&t.forEach((t=>t.textWrap&&delete t.textWrap));this.startLoadingTimer=()=>{this.hasLoadedForOneSecond=false;this.timerStarted=Date.now();setTimeout((()=>{this.hasLoadedForOneSecond=true;this.timerStarted=null}),this.minimumLoadingDisplayDuration)};this.isObject=t=>typeof t==="object";this.notDefaultDensity=()=>this.density!=="default";this.getCellContent=(t,i)=>{switch(i){case"element":return undefined;case"date":return(t instanceof Date?t:new Date(t)).toLocaleDateString();default:return t}};this.getCellAlignment=(t,i)=>{if(this.isObject(t)&&Object.keys(t).includes("cellAlignment")){return this.getObjectValue(this.getObjectValue(t,"cellAlignment"),i)}};this.getCellOptions=(t,i)=>{if(!(this.isObject(t)&&Object.keys(t).includes(i)))return;return this.getObjectValue(t,i)};this.createUpdatingIndicator=()=>{const{appearance:t,description:i,max:s,min:n,progress:o}=this.updatingOptions||{};return e("th",{colSpan:this.columns.length,class:"updating-state"},e("ic-loading-indicator",{appearance:t,description:i||"Updating table data",fullWidth:true,max:s,min:n,progress:o,type:"linear",size:"small"}))};this.setRowHeight=t=>h(`${t*this.DENSITY_HEIGHT_MULTIPLIER[this.density]-this.DENSITY_PADDING_HEIGHT_DIFF[this.density]}px`);this.setTruncationClass=()=>{if(this.truncationPattern){return{[`truncation-${this.truncationPattern}`]:true}}return{}};this.getColumnWidth=t=>{let i={};if(t){if(typeof t==="string"){i=Object.assign(Object.assign({},i),{["--column-width"]:t})}if(typeof t==="object"&&!!Object.keys(t)){if(t===null||t===void 0?void 0:t.minWidth){i=Object.assign(Object.assign({},i),{["--column-min-width"]:t===null||t===void 0?void 0:t.minWidth})}if(t===null||t===void 0?void 0:t.maxWidth){i=Object.assign(Object.assign({},i),{["--column-max-width"]:t===null||t===void 0?void 0:t.maxWidth})}}}return i};this.getRowHeight=(t,i,e,s)=>{if((this.truncationPattern||t)&&!(i===null||i===void 0?void 0:i.textWrap)&&!e&&!this.getCellOptions(s,"textWrap")&&(i===null||i===void 0?void 0:i.dataType)!=="element"){return{[this.ROW_HEIGHT_CSS_VARIABLE]:this.setRowHeight(t)}}return{}};this.createCells=(t,i)=>{var n;const o=Object.values(t);const a=Object.keys(t);const l=this.getRowOptions(a,o);let h;let d;const c=a.indexOf("header");if(c>-1){h=this.getObjectValue(o[c],"rowAlignment");d=this.getObjectValue(o[c],"emphasis")}const u=(n=this.variableRowHeight)===null||n===void 0?void 0:n.call(this,Object.assign(Object.assign({},t),{index:i}));const v=u?u!=="auto"&&u:this.globalRowHeight!=="auto"&&this.globalRowHeight;return o.map(((t,n)=>{var o,c,u,g,p,f,m,b,w,y;const x=this.columns[n];const O=`${x===null||x===void 0?void 0:x.key}-${i}`;const j=this.isObject(t)&&Object.keys(t).includes("icon");const k=i=>this.getObjectValue(t,i);if(a[n]==="header"){return e("th",{scope:"row",colSpan:k("colspan"),class:{["row-header"]:true,[`row-header-alignment-${k("cellAlignment")}`]:!!k("cellAlignment"),["row-header-sticky"]:this.stickyRowHeaders}},k("title"))}if(a[n]!=="rowOptions"){return e("td",{class:{["table-cell"]:true,[`table-density-${this.density}`]:this.notDefaultDensity()},style:Object.assign({},this.getColumnWidth(x.columnWidth))},e("div",{innerHTML:(x===null||x===void 0?void 0:x.dataType)==="element"&&!r(this.el,O)?t:null,class:Object.assign({"cell-container":(x===null||x===void 0?void 0:x.dataType)!=="element",[`cell-alignment-${((o=x===null||x===void 0?void 0:x.columnAlignment)===null||o===void 0?void 0:o.vertical)||((c=l===null||l===void 0?void 0:l.rowAlignment)===null||c===void 0?void 0:c.vertical)||h||this.getCellAlignment(t,"vertical")}`]:!!((u=x===null||x===void 0?void 0:x.columnAlignment)===null||u===void 0?void 0:u.vertical)||!!((g=l===null||l===void 0?void 0:l.rowAlignment)===null||g===void 0?void 0:g.vertical)||!!h||!!this.getCellAlignment(t,"vertical"),[`cell-alignment-${((p=x===null||x===void 0?void 0:x.columnAlignment)===null||p===void 0?void 0:p.horizontal)||((f=l===null||l===void 0?void 0:l.rowAlignment)===null||f===void 0?void 0:f.horizontal)||this.getCellAlignment(t,"horizontal")}`]:!!((m=x===null||x===void 0?void 0:x.columnAlignment)===null||m===void 0?void 0:m.horizontal)||!!((b=l===null||l===void 0?void 0:l.rowAlignment)===null||b===void 0?void 0:b.horizontal)||!!this.getCellAlignment(t,"horizontal"),[`data-type-${x===null||x===void 0?void 0:x.dataType}`]:true,[this.TEXT_WRAP_STRING]:(x===null||x===void 0?void 0:x.textWrap)||(l===null||l===void 0?void 0:l.textWrap)||!!this.getCellOptions(t,"textWrap"),["cell-icon"]:j||!!((w=x===null||x===void 0?void 0:x.icon)===null||w===void 0?void 0:w.icon)},this.setTruncationClass()),style:Object.assign(Object.assign({},this.getRowHeight(v,x,l===null||l===void 0?void 0:l.textWrap,t)),this.getColumnWidth(x===null||x===void 0?void 0:x.columnWidth)),"data-row-height":this.truncationPattern||v?this.setRowHeight(v):null},r(this.el,O)?e("slot",{name:O}):e(s,null,r(this.el,`${O}-icon`)?e("slot",{name:`${O}-icon`}):(j||((y=x===null||x===void 0?void 0:x.icon)===null||y===void 0?void 0:y.onAllCells))&&e("span",{class:"icon",innerHTML:k("icon")||(x===null||x===void 0?void 0:x.icon.icon)}),(x===null||x===void 0?void 0:x.dataType)!=="element"&&!r(this.el,O)&&e("ic-typography",{variant:"body",class:{[`cell-emphasis-${this.isObject(t)&&k("emphasis")||(x===null||x===void 0?void 0:x.emphasis)||d}`]:this.isObject(t)&&!!k("emphasis")||!!(x===null||x===void 0?void 0:x.emphasis)||!!d,[`text-${this.density}`]:this.notDefaultDensity()}},this.isObject(t)&&(x===null||x===void 0?void 0:x.dataType)!=="date"?Object.keys(t).includes("href")?e("ic-link",{href:k("href")},k("data")):k("data"):this.getCellContent(t,x===null||x===void 0?void 0:x.dataType)))))}}))};this.createColumnHeaders=()=>this.columns.map((({cellAlignment:t,colspan:i,icon:s,key:n,title:o,columnWidth:a})=>e("th",{scope:"col",class:{["column-header"]:true,[`table-density-${this.density}`]:this.notDefaultDensity(),["updating-state-headers"]:this.updating&&!this.loading},style:Object.assign({},this.getColumnWidth(a)),colSpan:i},e("div",{class:{"column-header-inner-container":true,[`column-header-alignment-${t}`]:!!t}},r(this.el,`${n}-column-icon`)?e("slot",{name:`${n}-column-icon`}):s&&!s.hideOnHeader&&e("span",{class:"icon",innerHTML:s.icon}),e("ic-typography",{variant:"body",class:{["column-header-text"]:true,[`text-${this.density}`]:this.notDefaultDensity()}},o),this.sortable&&e("ic-button",{variant:"icon",id:`sort-button-${n}`,"aria-label":this.getSortButtonLabel(n),onClick:()=>this.sortRows(n),innerHTML:this.SORT_ICONS[this.sortedColumn===n?this.sortedColumnOrder:"unsorted"],class:{["sort-button"]:true,["sort-button-unsorted"]:this.sortedColumn!==n||this.sortedColumnOrder==="unsorted"}})))));this.onRowClick=t=>{this.selectedRow=this.selectedRow!==t&&!this.loading&&!this.updating&&t};this.createRows=()=>{const t=this.showPagination?this.data.slice(this.fromRow,this.toRow):this.data.slice();const i=t.map(((t,i)=>{const e=this.columns.map((({key:t},e)=>r(this.el,`${t}-${i}`)&&{key:t,index:e})).filter((t=>!!t));return e.length>0?d(t,e,""):t}));return i.sort(!this.sortable?undefined:this.getSortFunction()).map(((t,i)=>e("tr",{onClick:()=>this.onRowClick(t),class:{["table-row"]:true,["table-row-selected"]:this.selectedRow===t}},this.createCells(t,i))))};this.getObjectValue=(t,i)=>Object.values(t)[Object.keys(t).indexOf(i)];this.getSortButtonLabel=t=>{let i="";const e=t=>{const i=this.sortOptions.sortOrders;return i[(i.indexOf(t)+1)%i.length]};if(this.sortedColumn===t){const t=e(this.sortedColumnOrder);i=t!=="unsorted"?`Sort ${t}`:"Remove sort"}else{i=`Sort ${e("unsorted")}`}return i};this.getComparison=(t,i)=>{const e=t[this.sortedColumn];const s=i[this.sortedColumn];return this.columns.find((t=>t.key===this.sortedColumn)).dataType==="date"?new Date(e).valueOf()-new Date(s).valueOf():String(this.isObject(e)?Object.values(e)[0]:e).localeCompare(String(this.isObject(s)?Object.values(s)[0]:s),undefined,{numeric:true,sensitivity:"base"})};this.getSortFunction=()=>{switch(this.sortedColumnOrder){case"ascending":return(t,i)=>this.getComparison(t,i);case"descending":return(t,i)=>this.getComparison(i,t);default:return undefined}};this.sortRows=t=>{const i=this.el.shadowRoot.querySelector(`#sort-button-${t}`);const e=this.sortOptions.sortOrders;if(t!==this.sortedColumn){if(this.sortedColumn){const i=this.el.shadowRoot.querySelector(`#sort-button-${this.sortedColumn}`);i.setAttribute("aria-label",this.getSortButtonLabel(t))}this.sortedColumn=t;this.sortedColumnOrder="unsorted"}let s=e.indexOf(this.sortedColumnOrder)+1;if(s>e.length-1){s=0}this.sortedColumnOrder=e[s];i.setAttribute("aria-label",this.getSortButtonLabel(t));this.tableSorted=true;this.icSortChange.emit({columnName:t,sorted:this.sortedColumnOrder})};this.getTypographyElements=()=>Array.from(this.el.shadowRoot.querySelectorAll("ic-typography:not(.column-header-text)"));this.getTooltip=t=>t.closest(this.TOOLTIP);this.updateTruncationTooltip=(t=false)=>{this.getTypographyElements().forEach((i=>{const e=this.getTooltip(i);const s=this.getCellContainer(i);if(i.closest(this.TEXT_WRAP_CLASS)){this.removeTooltip(s,i,e);i.setAttribute("style",`--ic-line-clamp: 0`);return}this.regenerateTooltip(s,i,e,t)}))};this.updateScrollOffset=()=>{this.scrollOffset=this.el.shadowRoot.querySelector(".table-row-container").scrollTop};this.setTableDimensions=()=>{let t={};if(this.width){t=Object.assign(Object.assign({},t),{["--table-width"]:this.width})}if(this.height){t=Object.assign(Object.assign({},t),{["--table-height"]:this.height})}if(this.maxWidth){t=Object.assign(Object.assign({},t),{["--table-max-width"]:this.maxWidth})}if(this.minWidth){t=Object.assign(Object.assign({},t),{["--table-min-width"]:this.minWidth})}return t};this.fromRow=0;this.previousRowsPerPage=undefined;this.rowsPerPage=undefined;this.scrollable=false;this.scrollOffset=0;this.selectedRow=undefined;this.sortedColumn=undefined;this.sortedColumnOrder=undefined;this.toRow=undefined;this.currentRowHeight=undefined;this.debounceDelay=0;this.caption=undefined;this.columns=undefined;this.data=undefined;this.density="default";this.embedded=false;this.globalRowHeight="auto";this.height=undefined;this.hideColumnHeaders=false;this.loading=false;this.loadingOptions=undefined;this.maxWidth=undefined;this.minWidth=undefined;this.minimumLoadingDisplayDuration=1e3;this.paginationBarOptions={itemsPerPageOptions:[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"}],rangeLabelType:"page",type:"simple",showItemsPerPageControl:true,showGoToPageControl:true,alignment:"right",appearance:"default",itemLabel:"Item",pageLabel:"Page",hideRangeLabel:false};this.showPagination=false;this.sortable=false;this.sortOptions={sortOrders:["unsorted","ascending","descending"],defaultColumn:""};this.stickyColumnHeaders=false;this.stickyRowHeaders=false;this.tableLayout="fixed";this.truncationPattern=undefined;this.updating=false;this.updatingOptions=undefined;this.variableRowHeight=undefined;this.width=undefined}disconnectedCallback(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){var t;this.rowsPerPage=Number(this.paginationBarOptions.itemsPerPageOptions[0].value);this.previousRowsPerPage=this.rowsPerPage;this.toRow=this.rowsPerPage;this.sortedColumn=this.sortOptions.defaultColumn;this.sortedColumnOrder=this.sortOptions.sortOrders[0];this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:((t=this.data)===null||t===void 0?void 0:t.length)>0});this.initialLoad=true;this.previousItemsPerPage=this.rowsPerPage}componentDidLoad(){const t=this.el.shadowRoot.querySelector("table");const i=this.el.shadowRoot.querySelector(".table-container");if(this.dataUpdated){this.dataUpdated=false}if((t===null||t===void 0?void 0:t.clientHeight)>(i===null||i===void 0?void 0:i.clientHeight)||(t===null||t===void 0?void 0:t.clientWidth)>(i===null||i===void 0?void 0:i.clientWidth)){this.scrollable=true}if(this.loading){this.startLoadingTimer();this.showLoadingIndicator()}if(this.truncationPattern){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.dataTruncation(t)}}));this.debounceDataTruncation()}if(this.globalRowHeight!=="auto"){this.updateSetRowHeight()}}componentDidUpdate(){if(this.truncationPattern===this.SHOW_HIDE_STRING||this.truncationPattern===this.TOOLTIP_STRING){this.truncateUpdatedData()}}truncateUpdatedData(){if(this.dataUpdated){if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>=(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}setTimeout((()=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}),150)}))}if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}this.dataUpdated=false}if(this.tableSorted){if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);if(!i.classList.contains(this.TEXT_WRAP_STRING)){this.createShowHideTruncation(t,i)}else{t.resetTruncation().then((()=>{i.removeAttribute("style")}))}}))}this.tableSorted=false}if(this.rowHeightSet){const t=parseInt(getComputedStyle(document.documentElement).fontSize);const i=this.globalRowHeight==="auto";this.getTypographyElements().forEach((e=>{var s;const n=this.getCellContainer(e);const o=this.getTooltip(e);if(i){n.style.height=null;if(this.truncationPattern===this.TOOLTIP_STRING){this.removeTooltip(n,e,o);e.setAttribute("style",`--ic-line-clamp: 0`)}else if(this.truncationPattern===this.SHOW_HIDE_STRING){this.resetShowHideTruncation(e)}return}const a=t*parseFloat(n.getAttribute(this.DATA_ROW_HEIGHT_STRING));if(!((s=n===null||n===void 0?void 0:n.style)===null||s===void 0?void 0:s.height)&&a>n.clientHeight&&!n.classList.contains(this.TEXT_WRAP_STRING)){n.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,n.getAttribute(this.DATA_ROW_HEIGHT_STRING))}if(this.truncationPattern){if(this.truncationPattern===this.SHOW_HIDE_STRING){const t=this.getTruncWrapper(e);const i=e.shadowRoot.querySelector("button");if(i&&(t===null||t===void 0?void 0:t.scrollHeight)<=n.clientHeight){this.resetShowHideTruncation(e);return}}this.truncate(e,n,o)}else{this.updateSetRowHeight(e)}}));this.rowHeightSet=false}if(this.itemsPerPageChange){const t=this.el.shadowRoot.querySelectorAll(".table-row");if(this.rowsPerPage>this.previousItemsPerPage){const i=Array.from(t).slice(this.previousItemsPerPage);i.forEach((t=>{t.querySelectorAll("ic-typography").forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}))}))}this.previousItemsPerPage=this.rowsPerPage;this.itemsPerPageChange=false}if(!this.initialLoad&&this.icPageChangeEvent){if(this.truncationPattern===this.TOOLTIP_STRING){this.updateTruncationTooltip()}if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=t.shadowRoot.querySelector("button");if((t===null||t===void 0?void 0:t.scrollHeight)>i.clientHeight&&!e){this.addShowHideTruncation(i,t)}}))}this.icPageChangeEvent=false}if(this.densityUpdate){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}));this.densityUpdate=false}if(this.truncationPatternUpdated){if(this.truncationPattern===this.TOOLTIP_STRING){this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);if(t.scrollHeight>i.clientHeight){this.addTooltipTruncation(t,i,e)}}))}else if(this.truncationPattern===this.SHOW_HIDE_STRING){this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}))}}}createShowHideTruncation(t,i){t.checkMaxLines(t.scrollHeight);t.setAttribute("max-lines",`${Math.floor((i===null||i===void 0?void 0:i.clientHeight)/this.DEFAULT_LINE_HEIGHT)}`);t.setShowHideExpanded(false);i.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,null)}addTooltipTruncation(t,i,e){this.addLineClampCSS(t,i);if(!e){this.createTruncationTooltip(t,i)}}addShowHideTruncation(t,i){t.classList.add(this.SHOW_HIDE_CSS_CLASS);this.createShowHideTruncation(i,t)}getTruncWrapper(t){return t.shadowRoot.querySelector(".trunc-wrapper")}handleTypographyTruncationExpandToggle({detail:t}){const{expanded:i,typographyEl:e}=t;const s=this.getCellContainer(e);if(s.style.getPropertyValue(this.ROW_HEIGHT_CSS_VARIABLE)&&i){s.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,"inherit")}}handlePageChange({detail:t,target:i}){if(i.parentElement!==this.el){this.fromRow=(t.value-1)*this.rowsPerPage;this.toRow=this.fromRow+this.rowsPerPage;const i=this.el.shadowRoot.querySelector(".table-row-container");if(this.previousRowsPerPage===this.rowsPerPage){i.scrollTop=0}else if(this.previousRowsPerPage<this.rowsPerPage){i.scrollTop=this.scrollOffset;this.previousRowsPerPage=this.rowsPerPage}else{this.previousRowsPerPage=this.rowsPerPage}}if(!this.initialLoad&&this.previousPaginationPage!==t.value){this.icPageChangeEvent=true}this.previousPaginationPage=t.value;this.initialLoad=false}handleItemsPerPageChange({detail:t,target:i}){if(i.parentElement!==this.el){this.previousRowsPerPage=this.rowsPerPage;this.rowsPerPage=t.value}this.itemsPerPageChange=true}handleDensityChange(t){this.density=t.detail.value}clickListener(t){if(t.target!==this.el)this.selectedRow=undefined}loadingHandler(t){if(t)this.startLoadingTimer();if(this.loading){setTimeout((()=>{this.showLoadingIndicator()}),500)}}truncationPatternHandler(t){if(t===this.TOOLTIP_STRING){this.resetShowHideTruncation();this.updateTruncationTooltip(true);this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);const e=this.getTooltip(t);this.truncate(t,i,e)}))}if(t===this.SHOW_HIDE_STRING){this.updateTruncationTooltip(true);this.getTypographyElements().forEach((t=>{const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((e===null||e===void 0?void 0:e.clientHeight)-this.DEFAULT_LINE_HEIGHT>(i===null||i===void 0?void 0:i.scrollHeight)){this.resetShowHideTruncation(t);return}setTimeout((()=>{if((t===null||t===void 0?void 0:t.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)){this.addShowHideTruncation(e,t)}}),150)}))}this.truncationPatternUpdated=true}async dataHandler(t){this.loadingOptions=Object.assign(Object.assign({},this.loadingOptions),{showBackground:(t===null||t===void 0?void 0:t.length)>0});if(this.loading){!this.hasLoadedForOneSecond?setTimeout((()=>this.loading=false),this.minimumLoadingDisplayDuration-(Date.now()-this.timerStarted)):this.loading=false}if(this.updating)this.updating=false;this.dataUpdated=true}async densityHandler(){this.densityUpdate=true}resetShowHideTruncation(t){if(t){const i=this.getTruncWrapper(t);const e=this.getCellContainer(t);if((i===null||i===void 0?void 0:i.scrollHeight)>(e===null||e===void 0?void 0:e.clientHeight)&&!l(t.getAttribute("max-lines"))&&Math.floor((e===null||e===void 0?void 0:e.clientHeight)/this.DEFAULT_LINE_HEIGHT)!==+t.getAttribute("max-lines")){t.checkMaxLines(i.scrollHeight);t.setAttribute("max-lines",`${Math.floor((e===null||e===void 0?void 0:e.clientHeight)/this.DEFAULT_LINE_HEIGHT)}`);t.setShowHideExpanded(false);e.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,null)}else{t.resetTruncation().then((()=>{if(!t.closest(this.TEXT_WRAP_CLASS)){e.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,e.getAttribute(this.DATA_ROW_HEIGHT_STRING))}}))}}else{this.getTypographyElements().forEach((t=>{const i=this.getCellContainer(t);t.resetTruncation().then((()=>{if(!t.closest(this.TEXT_WRAP_CLASS)){i.style.setProperty(this.ROW_HEIGHT_CSS_VARIABLE,i.getAttribute(this.DATA_ROW_HEIGHT_STRING))}}))}))}}rowHeightChangeHandler(t,i){if(+t!==+i){this.deleteTextWrapDataKey(this.data);this.deleteTextWrapDataKey(this.columns);this.removeTextWrap();this.icRowHeightChange.emit();this.rowHeightSet=true}}async resetRowHeights(t){this.globalRowHeight=t||"auto";this.variableRowHeight=null}showLoadingIndicator(){this.loadingIndicator.classList.add("show")}getRowOptions(t,i){const e=t.indexOf("rowOptions");return e>-1&&i[e]}regenerateTooltip(t,i,e,s){if(e){if(this.tableSorted){e.setAttribute("target",i.id);e.setAttribute("label",i.textContent)}else{this.removeTooltip(t,i,e)}if(s){return}}if(!i.getAttribute("style")&&this.dataUpdated){this.addLineClampCSS(i,t)}if((i===null||i===void 0?void 0:i.scrollHeight)>(t===null||t===void 0?void 0:t.clientHeight)&&this.truncationPattern===this.TOOLTIP_STRING){if(!i.getAttribute("style")||i.style.cssText.includes("--ic-line-clamp: 0;")){this.addLineClampCSS(i,t)}this.createTruncationTooltip(i,t)}}removeTooltip(t,i,e){t.appendChild(i);if(e){e.remove()}}addLineClampCSS(t,i){t.setAttribute("style",`--ic-line-clamp: ${this.getLines(i===null||i===void 0?void 0:i.clientHeight)}`)}createTruncationTooltip(t,i){const e=document.createElement("ic-tooltip");e.setAttribute("target",t.id);e.setAttribute("label",t.textContent);e.classList.add("ic-tooltip-overflow");e.setExternalPopperProps({strategy:"fixed"});i.appendChild(e);e.appendChild(t)}render(){const{caption:t,createColumnHeaders:i,createRows:s,createUpdatingIndicator:o,data:a,hideColumnHeaders:l,loading:h,loadingOptions:d,paginationBarOptions:c,scrollable:u,scrollOffset:v,showPagination:g,sortable:p,sortedColumnOrder:f,sortedColumn:m,stickyColumnHeaders:b,updateScrollOffset:w,updating:y}=this;return e(n,{style:Object.assign({},this.setTableDimensions())},e("div",{class:"table-container"},r(this.el,"title-bar")&&e("slot",{name:"title-bar"}),e("div",{class:{["table-row-container"]:true,scrollable:u},tabIndex:u?0:null,onScroll:w},r(this.el,"title-bar")&&e("slot",{name:"title-bar"}),e("table",{style:{["--table-layout"]:this.tableLayout}},e("caption",{class:"table-caption"},t),!l&&e("thead",{class:{["column-header-sticky"]:b,["column-header-overlay"]:b&&v!==0}},e("tr",null,i())),y&&!h&&(l?e("thead",null,o()):o()),(a===null||a===void 0?void 0:a.length)>0&&!h&&e("tbody",null,s())),!(a===null||a===void 0?void 0:a.length)&&!h&&(r(this.el,"empty-state")?e("slot",{name:"empty-state"}):e("ic-empty-state",{aligned:"center",heading:"No Data",class:"loading-empty"}))),h&&e("ic-loading-indicator",{appearance:d===null||d===void 0?void 0:d.appearance,class:{"loading-empty":h,loading:true,"show-background":d.showBackground},description:d.description||"Loading table data",label:d.label||"Loading...",labelDuration:d===null||d===void 0?void 0:d.labelDuration,max:d===null||d===void 0?void 0:d.max,min:d===null||d===void 0?void 0:d.min,progress:d===null||d===void 0?void 0:d.progress,ref:t=>this.loadingIndicator=t}),(g||r(this.el,"pagination-bar"))&&e("div",{class:"pagination-container"},r(this.el,"pagination-bar")?e("slot",{name:"pagination-bar"}):e("ic-pagination-bar",{totalItems:a.length,type:c.type,rangeLabelType:c.rangeLabelType,showItemsPerPageControl:c.showItemsPerPageControl,showGoToPageControl:c.showGoToPageControl,itemsPerPageOptions:c.itemsPerPageOptions,alignment:c.alignment,appearance:c.appearance,itemLabel:c.itemLabel,pageLabel:c.pageLabel,hideRangeLabel:c.hideRangeLabel})),p&&e("div",{class:"screen-reader-sort-text","aria-live":"polite"},f!=="unsorted"&&m?`${m} sorted ${f}`:"table unsorted")))}get el(){return o(this)}static get watchers(){return{loading:["loadingHandler"],truncationPattern:["truncationPatternHandler"],data:["dataHandler"],density:["densityHandler"],globalRowHeight:["rowHeightChangeHandler"],variableRowHeight:["rowHeightChangeHandler"]}}};p.style=g;export{p as ic_data_table};
2
- //# sourceMappingURL=p-6af080d3.entry.js.map