@ukic/web-components 3.15.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/ic-checkbox.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ic-data-list.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-data-row.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ic-footer.cjs.entry.js +9 -5
  6. package/dist/cjs/ic-footer.cjs.entry.js.map +1 -1
  7. package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-input-component-container_3.cjs.entry.js +2 -2
  9. package/dist/cjs/ic-input-component-container_3.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-input-label_2.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-input-label_2.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
  13. package/dist/cjs/ic-navigation-group.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
  15. package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-pagination.cjs.entry.js +8 -4
  17. package/dist/cjs/ic-pagination.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-radio-group.cjs.entry.js +1 -1
  19. package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
  20. package/dist/cjs/ic-radio-option.cjs.entry.js +9 -6
  21. package/dist/cjs/ic-radio-option.cjs.entry.js.map +1 -1
  22. package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
  23. package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
  24. package/dist/cjs/ic-toast.cjs.entry.js +14 -6
  25. package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-toggle-button-group.cjs.entry.js +18 -3
  27. package/dist/cjs/ic-toggle-button-group.cjs.entry.js.map +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/collection/components/ic-button/ic-button.stories.js +3 -3
  30. package/dist/collection/components/ic-checkbox/ic-checkbox.css +2 -0
  31. package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.stories.js +18 -18
  32. package/dist/collection/components/ic-data-list/ic-data-list.css +1 -0
  33. package/dist/collection/components/ic-data-row/ic-data-row.css +2 -0
  34. package/dist/collection/components/ic-footer/ic-footer.js +29 -5
  35. package/dist/collection/components/ic-footer/ic-footer.js.map +1 -1
  36. package/dist/collection/components/ic-footer/ic-footer.stories.js +31 -0
  37. package/dist/collection/components/ic-hero/ic-hero.css +0 -2
  38. package/dist/collection/components/ic-input-component-container/ic-input-component-container.css +9 -0
  39. package/dist/collection/components/ic-input-validation/ic-input-validation.css +2 -1
  40. package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.stories.js +17 -18
  41. package/dist/collection/components/ic-menu/ic-menu.css +8 -0
  42. package/dist/collection/components/ic-navigation-group/ic-navigation-group.css +12 -0
  43. package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +2 -7
  44. package/dist/collection/components/ic-pagination/ic-pagination.js +28 -4
  45. package/dist/collection/components/ic-pagination/ic-pagination.js.map +1 -1
  46. package/dist/collection/components/ic-pagination/ic-pagination.stories.js +5 -3
  47. package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +7 -7
  48. package/dist/collection/components/ic-radio-group/ic-radio-group.css +6 -6
  49. package/dist/collection/components/ic-radio-group/ic-radio-group.stories.js +12 -12
  50. package/dist/collection/components/ic-radio-option/ic-radio-option.css +60 -54
  51. package/dist/collection/components/ic-radio-option/ic-radio-option.js +9 -5
  52. package/dist/collection/components/ic-radio-option/ic-radio-option.js.map +1 -1
  53. package/dist/collection/components/ic-search-bar/ic-search-bar.css +8 -0
  54. package/dist/collection/components/ic-search-bar/ic-search-bar.stories.js +19 -19
  55. package/dist/collection/components/ic-select/ic-select_(multi).stories.js +20 -20
  56. package/dist/collection/components/ic-select/ic-select_(searchable).stories.js +21 -21
  57. package/dist/collection/components/ic-tab-context/ic-tabs.stories.js +1 -1
  58. package/dist/collection/components/ic-text-field/ic-text-field.stories.js +19 -19
  59. package/dist/collection/components/ic-toast/ic-toast.css +26 -1
  60. package/dist/collection/components/ic-toast/ic-toast.js +39 -5
  61. package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
  62. package/dist/collection/components/ic-toast/ic-toast.stories.js +21 -9
  63. package/dist/collection/components/ic-toggle-button/ic-toggle-button.stories.js +14 -14
  64. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js +52 -4
  65. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.js.map +1 -1
  66. package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.stories.js +7 -7
  67. package/dist/collection/components/ic-tooltip/ic-tooltip.stories.js +11 -11
  68. package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +15 -15
  69. package/dist/collection/components/ic-typography/ic-typography.stories.js +1 -1
  70. package/dist/collection/patterns/top-nav-content-footer.stories.js +1 -1
  71. package/dist/components/ic-checkbox.js.map +1 -1
  72. package/dist/components/ic-data-list.js.map +1 -1
  73. package/dist/components/ic-data-row.js.map +1 -1
  74. package/dist/components/ic-footer.js +10 -5
  75. package/dist/components/ic-footer.js.map +1 -1
  76. package/dist/components/ic-hero.js.map +1 -1
  77. package/dist/components/ic-input-component-container2.js +1 -1
  78. package/dist/components/ic-input-component-container2.js.map +1 -1
  79. package/dist/components/ic-input-validation2.js +1 -1
  80. package/dist/components/ic-input-validation2.js.map +1 -1
  81. package/dist/components/ic-menu2.js +1 -1
  82. package/dist/components/ic-menu2.js.map +1 -1
  83. package/dist/components/ic-navigation-group.js +1 -1
  84. package/dist/components/ic-navigation-group.js.map +1 -1
  85. package/dist/components/ic-navigation-item.js +1 -1
  86. package/dist/components/ic-navigation-item.js.map +1 -1
  87. package/dist/components/ic-pagination.js +9 -4
  88. package/dist/components/ic-pagination.js.map +1 -1
  89. package/dist/components/ic-popover-menu.js.map +1 -1
  90. package/dist/components/ic-radio-group.js +1 -1
  91. package/dist/components/ic-radio-group.js.map +1 -1
  92. package/dist/components/ic-radio-option.js +10 -7
  93. package/dist/components/ic-radio-option.js.map +1 -1
  94. package/dist/components/ic-search-bar.js +1 -1
  95. package/dist/components/ic-search-bar.js.map +1 -1
  96. package/dist/components/ic-side-navigation.js.map +1 -1
  97. package/dist/components/ic-skeleton.js.map +1 -1
  98. package/dist/components/ic-toast.js +15 -6
  99. package/dist/components/ic-toast.js.map +1 -1
  100. package/dist/components/ic-toggle-button-group.js +21 -4
  101. package/dist/components/ic-toggle-button-group.js.map +1 -1
  102. package/dist/core/core.css +28 -6
  103. package/dist/core/core.esm.js +1 -1
  104. package/dist/core/core.esm.js.map +1 -1
  105. package/dist/core/p-082e0068.entry.js +2 -0
  106. package/dist/core/p-082e0068.entry.js.map +1 -0
  107. package/dist/core/p-3238389a.entry.js +2 -0
  108. package/dist/core/p-3238389a.entry.js.map +1 -0
  109. package/dist/core/p-33e35173.entry.js.map +1 -1
  110. package/dist/core/p-3636be4f.entry.js +2 -0
  111. package/dist/core/p-3636be4f.entry.js.map +1 -0
  112. package/dist/core/p-52c66bfe.entry.js +2 -0
  113. package/dist/core/p-52c66bfe.entry.js.map +1 -0
  114. package/dist/core/p-6ed48c46.entry.js +2 -0
  115. package/dist/core/p-6ed48c46.entry.js.map +1 -0
  116. package/dist/core/p-8abcc114.entry.js.map +1 -1
  117. package/dist/core/p-9c52ee48.entry.js +2 -0
  118. package/dist/core/p-9c52ee48.entry.js.map +1 -0
  119. package/dist/core/p-afbba548.entry.js +2 -0
  120. package/dist/core/p-afbba548.entry.js.map +1 -0
  121. package/dist/core/p-b4a2f6fa.entry.js.map +1 -1
  122. package/dist/core/{p-0c4ceed9.entry.js → p-b59504f1.entry.js} +2 -2
  123. package/dist/core/p-b59504f1.entry.js.map +1 -0
  124. package/dist/core/p-b83a736d.entry.js +3 -0
  125. package/dist/core/p-b83a736d.entry.js.map +1 -0
  126. package/dist/core/{p-4bdeb62d.entry.js → p-bdda404b.entry.js} +2 -2
  127. package/dist/core/p-bdda404b.entry.js.map +1 -0
  128. package/dist/core/p-ca82850f.entry.js +2 -0
  129. package/dist/core/p-ca82850f.entry.js.map +1 -0
  130. package/dist/core/p-ffd0d9d1.entry.js.map +1 -1
  131. package/dist/esm/core.js +1 -1
  132. package/dist/esm/ic-checkbox.entry.js.map +1 -1
  133. package/dist/esm/ic-data-list.entry.js.map +1 -1
  134. package/dist/esm/ic-data-row.entry.js.map +1 -1
  135. package/dist/esm/ic-footer.entry.js +9 -5
  136. package/dist/esm/ic-footer.entry.js.map +1 -1
  137. package/dist/esm/ic-hero.entry.js.map +1 -1
  138. package/dist/esm/ic-input-component-container_3.entry.js +2 -2
  139. package/dist/esm/ic-input-component-container_3.entry.js.map +1 -1
  140. package/dist/esm/ic-input-label_2.entry.js +1 -1
  141. package/dist/esm/ic-input-label_2.entry.js.map +1 -1
  142. package/dist/esm/ic-navigation-group.entry.js +1 -1
  143. package/dist/esm/ic-navigation-group.entry.js.map +1 -1
  144. package/dist/esm/ic-navigation-item.entry.js +1 -1
  145. package/dist/esm/ic-navigation-item.entry.js.map +1 -1
  146. package/dist/esm/ic-pagination.entry.js +8 -4
  147. package/dist/esm/ic-pagination.entry.js.map +1 -1
  148. package/dist/esm/ic-radio-group.entry.js +1 -1
  149. package/dist/esm/ic-radio-group.entry.js.map +1 -1
  150. package/dist/esm/ic-radio-option.entry.js +9 -6
  151. package/dist/esm/ic-radio-option.entry.js.map +1 -1
  152. package/dist/esm/ic-search-bar.entry.js +1 -1
  153. package/dist/esm/ic-search-bar.entry.js.map +1 -1
  154. package/dist/esm/ic-toast.entry.js +14 -6
  155. package/dist/esm/ic-toast.entry.js.map +1 -1
  156. package/dist/esm/ic-toggle-button-group.entry.js +18 -3
  157. package/dist/esm/ic-toggle-button-group.entry.js.map +1 -1
  158. package/dist/esm/loader.js +1 -1
  159. package/dist/types/components/ic-footer/ic-footer.d.ts +4 -0
  160. package/dist/types/components/ic-pagination/ic-pagination.d.ts +4 -0
  161. package/dist/types/components/ic-toast/ic-toast.d.ts +5 -1
  162. package/dist/types/components/ic-toggle-button-group/ic-toggle-button-group.d.ts +5 -0
  163. package/dist/types/components.d.ts +25 -0
  164. package/hydrate/index.js +72 -33
  165. package/hydrate/index.mjs +72 -33
  166. package/package.json +24 -24
  167. package/vscode-data.json +23 -0
  168. package/dist/core/p-042cfc35.entry.js +0 -2
  169. package/dist/core/p-042cfc35.entry.js.map +0 -1
  170. package/dist/core/p-06c950a3.entry.js +0 -2
  171. package/dist/core/p-06c950a3.entry.js.map +0 -1
  172. package/dist/core/p-0c4ceed9.entry.js.map +0 -1
  173. package/dist/core/p-11d8a504.entry.js +0 -3
  174. package/dist/core/p-11d8a504.entry.js.map +0 -1
  175. package/dist/core/p-14d43f64.entry.js +0 -2
  176. package/dist/core/p-14d43f64.entry.js.map +0 -1
  177. package/dist/core/p-3680f22c.entry.js +0 -2
  178. package/dist/core/p-3680f22c.entry.js.map +0 -1
  179. package/dist/core/p-4bdeb62d.entry.js.map +0 -1
  180. package/dist/core/p-762ea31a.entry.js +0 -2
  181. package/dist/core/p-762ea31a.entry.js.map +0 -1
  182. package/dist/core/p-a5415f6c.entry.js +0 -2
  183. package/dist/core/p-a5415f6c.entry.js.map +0 -1
  184. package/dist/core/p-b3cb1e35.entry.js +0 -2
  185. package/dist/core/p-b3cb1e35.entry.js.map +0 -1
  186. package/dist/core/p-e7af1e2d.entry.js +0 -2
  187. package/dist/core/p-e7af1e2d.entry.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{r as i,c as t,h as e,H as o,g as n}from"./p-8e4e97b4.js";import{D as a,g as s,f as r,y as d}from"./p-a5658054.js";import{C as h}from"./p-3b185c32.js";import"./p-bddf799a.js";const c='/*! 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;--ic-typography-color:currentcolor}:host(.in-side-menu){border-bottom:var(--ic-border-width) solid\n var(--ic-divider-background-monochrome);padding:var(--ic-space-md) 0}:host .navigation-group{height:100%;width:-moz-fit-content;width:fit-content;color:var(--ic-brand-text-color);display:flex;gap:var(--ic-space-xxs);align-items:center;justify-content:center;padding:0 var(--ic-space-md);transition:var(--ic-easing-transition-slow);position:relative;background:none;border:none;text-align:left;box-sizing:border-box}:host .navigation-group:hover,:host .navigation-group:active,:host .selected{background-color:var(--ic-architectural-20);color:var(--ic-color-text-primary-light);outline:none;cursor:pointer}:host(.in-side-menu) .navigation-group{min-height:2.5rem;width:100%;gap:1.25rem}:host(.in-side-menu) .navigation-group .ic-typography-label{width:100%}:host(.in-side-menu:not(.ic-navigation-group-expandable)) .navigation-group,:host(.in-side-menu) .navigation-group-side-menu-collapsed,:host(.in-side-menu) .navigation-group-side-menu-expanded{color:var(--ic-top-navigation-nav-group-link);justify-content:flex-start;padding:var(--ic-space-xs) var(--ic-space-md)}:host(.in-side-menu) .navigation-group-side-menu-expanded{margin-bottom:var(--ic-space-xs)}:host(.in-side-menu) .navigation-group-side-menu-collapsed::after,:host(.in-side-menu) .navigation-group-side-menu-expanded::after{border-style:solid;border-width:0.125em 0.125em 0 0;content:"";display:inline-block;min-height:0.45em;position:relative;top:-0.1em;transform:rotate(135deg);vertical-align:top;min-width:0.45em}:host(.in-side-menu) .navigation-group-side-menu-expanded::after{top:0.15em;transform:rotate(-45deg)}:host(:not(.in-side-menu)) .navigation-group:focus{box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);outline:var(--ic-hc-focus-outline);z-index:var(--ic-z-index-navigation-item);transition:box-shadow var(--ic-easing-transition-fast)}:host(.in-side-menu) .navigation-group-side-menu-expanded:hover:not(:focus),:host(.in-side-menu) .navigation-group-side-menu-collapsed:hover:not(:focus){background-color:var(--ic-top-navigation-nav-group-hover);cursor:pointer}:host(.in-side-menu) .navigation-group-side-menu-expanded:active:not(:focus),:host(.in-side-menu) .navigation-group-side-menu-collapsed:active:not(:focus){background-color:var(--ic-top-navigation-nav-group-pressed)}:host(.in-side-menu) .navigation-group-side-menu-expanded:focus,:host(.in-side-menu) .navigation-group-side-menu-collapsed:focus{box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset);outline:var(--ic-hc-focus-outline);background:none}:host .navigation-group-dropdown{background-color:var(--ic-top-navigation-menu-background);border-bottom:var(--ic-space-1px) solid var(--ic-top-navigation-menu-border);position:absolute;left:0;right:0;padding:var(--ic-space-xs) var(--ic-space-md);box-shadow:0 0.375rem 0.5rem -0.375rem rgba(0 0 0 / 20%);z-index:calc(var(--ic-z-index-navigation-item) - 1)}:host .navigation-group-dropdown-items-list{list-style:none;display:flex;flex-flow:column wrap;align-content:flex-start;padding-left:var(--ic-space-md);max-height:16.5rem}:host .chevron-toggle-icon-wrapper{display:flex;align-items:center}:host .chevron-toggle-icon-wrapper svg{transform:rotate(90deg);height:var(--ic-space-lg);width:var(--ic-space-lg)}:host .chevron-toggle-icon-closed svg{transform:rotate(-90deg)}:host(.ic-navigation-group-expanded) .grouped-links-wrapper{height:var(--navigation-child-items-height, auto) !important;transition:var(--ic-easing-transition-slow);overflow:hidden}:host(.ic-navigation-group-side-nav) .link,:host(.ic-navigation-group-side-nav) ::slotted(a){height:var(--navigation-child-items-height, auto)}:host(.ic-navigation-group-collapsed) .grouped-links-wrapper{height:0;transition:var(--ic-easing-transition-slow);overflow:hidden}:host(.ic-navigation-group-side-nav) .navigation-group{min-height:var(--navigation-group-height);height:-moz-fit-content;height:fit-content;min-width:100%;width:var(--navigation-group-width, auto);justify-content:var(--navigation-group-justify-content);padding:var(--ic-space-md) var(--navigation-group-expand-toggle-padding)\n var(--ic-space-xs) var(--ic-space-md)}:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable)) .navigation-group{padding-right:var(--ic-space-md)}:host(.ic-navigation-group-side-nav) .navigation-group:hover,:host(.ic-navigation-group-side-nav) .navigation-group:active,:host(.ic-navigation-group-side-nav) .selected{background-color:var(--navigation-group-hover);color:var(--navigation-group-text-hover)}:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable)) .navigation-group:hover,:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable)) .navigation-group:active,:host(.in-side-menu:not(.ic-navigation-group-expandable)) .navigation-group:hover,:host(.in-side-menu:not(.ic-navigation-group-expandable)) .navigation-group:active{background:none;cursor:auto}:host(.ic-navigation-group-side-nav) .navigation-group:focus{box-shadow:var(--ic-border-focus-inset);border-radius:var(--ic-border-radius-inset);background:none}:host(.ic-navigation-group-side-nav) .ic-typography-caption{position:var(--navigation-group-title-position);left:var(--navigation-group-title-position-left)}';const p=c;const u="ic-navigation-item";const l=100;const g="IC-NAVIGATION-GROUP";const v=class{constructor(o){i(this,o);this.navigationGroupOpened=t(this,"navigationGroupOpened",7);this.navigationGroupExpanded=t(this,"navigationGroupExpanded",7);this.allGroupedNavigationItemHeights="";this.collapsedNavItemsHeight=null;this.expandedNavItemsHeight=null;this.mouseGate=false;this.deviceSize=a.XL;this.dropdownOpen=false;this.focusStyle=s();this.inTopNavSideMenu=false;this.isSideNavExpanded=false;this.expandable=false;this.expanded=true;this.theme="inherit";this.sideNavExpandHandler=i=>{this.isSideNavExpanded=i.detail.sideNavExpanded;if(!this.linkWrapper||!this.expanded)return;const t=this.isSideNavExpanded?this.expandedNavItemsHeight:this.collapsedNavItemsHeight;if(t){this.setGroupedLinksElementHeight(t)}else{setTimeout((()=>{if(this.isSideNavExpanded){this.expandedNavItemsHeight=this.allGroupedNavigationItemHeights}else{this.collapsedNavItemsHeight=this.allGroupedNavigationItemHeights}this.setGroupedLinksElementHeight(this.allGroupedNavigationItemHeights)}),l)}};this.topNavResizedHandler=({detail:{size:i}})=>{var t;if(i===this.deviceSize)return;this.deviceSize=i;this.inTopNavSideMenu=i<=(((t=this.parentEl)===null||t===void 0?void 0:t.customMobileBreakpoint)||a.L)};this.toggleExpanded=()=>{this.expanded=!this.expanded;if(!this.linkWrapper)return;this.setGroupedLinksElementHeight(!this.expanded?"0":this.isSideNavExpanded?this.expandedNavItemsHeight:this.collapsedNavItemsHeight);this.el.querySelectorAll(u).forEach((i=>{var t;const e=((t=i.shadowRoot)===null||t===void 0?void 0:t.querySelector("a"))||i.querySelector("a");e===null||e===void 0?void 0:e.setAttribute("tabindex",this.expanded?"0":"-1")}))};this.handleClick=i=>{if(this.navigationType==="top"&&i.detail){this.toggleDropdown()}else{this.toggleExpanded()}};this.handleBlur=i=>{if(!this.el.contains(i.relatedTarget)){this.hideDropdown()}};this.handleKeydown=i=>{const{key:t}=i;if(t!=="Enter"&&t!==" "&&t!=="Escape")return;switch(this.navigationType){case"top":if(t===" "||t==="Enter"){this.toggleDropdown()}else if(!this.inTopNavSideMenu){this.hideDropdown()}break;case"side":this.toggleExpanded();i.preventDefault();break;default:this.toggleExpanded();break}};this.handleMouseLeave=i=>{const t=i.relatedTarget;this.mouseGate=false;if(this.el.contains(t)||t===this.dropdown||this.el.contains(document.activeElement))return;if(document.activeElement!==this.el&&(t===null||t===void 0?void 0:t.nodeName)===g&&this.dropdownOpen){this.mouseGate=true;this.hideDropdown()}else{this.mouseGate=false;setTimeout((()=>{this.dropdownOpen?this.hideDropdown():null}),500)}};this.handleMouseEnter=i=>{const t=i.relatedTarget;document.addEventListener("keydown",this.handleKeydown);if((t===null||t===void 0?void 0:t.nodeName)===g&&this.mouseGate){this.showDropdown()}else if(!this.dropdownOpen&&!this.mouseGate){this.mouseGate=true;setTimeout((()=>{if(this.mouseGate)this.showDropdown()}),500)}};this.renderGroupTitleText=()=>e("ic-typography",{id:"nav-group-title",variant:this.navigationType==="side"?"caption":"label"},this.label);this.renderNavigationItems=()=>{if(this.dropdownOpen||this.inTopNavSideMenu&&!this.expandable){return e("div",{class:{[this.inTopNavSideMenu?"navigation-group-dropdown-side-menu":"navigation-group-dropdown"]:true,selected:this.dropdownOpen&&!this.inTopNavSideMenu},onMouseLeave:!this.inTopNavSideMenu?this.handleMouseLeave:undefined,ref:i=>this.dropdown=i},e("nav",{class:{"navigation-group-dropdown-items":!this.inTopNavSideMenu},"aria-labelledby":"nav-group-title"},e("ul",null,e("slot",null))))}if(this.navigationType!=="top"){return e("ul",{ref:i=>this.linkWrapper=i,class:"grouped-links-wrapper"},e("slot",null))}return null};this.setGroupedLinksElementHeight=i=>{var t;(t=this.linkWrapper)===null||t===void 0?void 0:t.style.setProperty("--navigation-child-items-height",i)}}disconnectedCallback(){var i,t;if(this.navigationType==="side"){(i=this.parentEl)===null||i===void 0?void 0:i.removeEventListener("icSideNavExpanded",this.sideNavExpandHandler)}else if(this.navigationType==="top"){(t=this.parentEl)===null||t===void 0?void 0:t.removeEventListener("icTopNavResized",this.topNavResizedHandler)}}componentWillLoad(){var i,t;this.deviceSize=r();const{navType:e,parent:o}=d(this.el);this.navigationType=e;this.parentEl=o;if(this.navigationType==="side"){(i=this.parentEl)===null||i===void 0?void 0:i.addEventListener("icSideNavExpanded",this.sideNavExpandHandler)}else if(this.navigationType==="top"){(t=this.parentEl)===null||t===void 0?void 0:t.addEventListener("icTopNavResized",this.topNavResizedHandler);if(this.deviceSize<=this.parentEl.customMobileBreakpoint)this.inTopNavSideMenu=true}}componentDidLoad(){this.allGroupedNavigationItemHeights=`${Array.from(this.el.querySelectorAll(u)).reduce(((i,{offsetHeight:t})=>i+t),0)}px`;setTimeout((()=>{if(!this.linkWrapper||!this.expanded)return;if(!this.isSideNavExpanded)this.collapsedNavItemsHeight=this.allGroupedNavigationItemHeights;else this.expandedNavItemsHeight=this.allGroupedNavigationItemHeights;this.setGroupedLinksElementHeight(this.allGroupedNavigationItemHeights)}),l)}childBlurHandler(){this.hideDropdown()}handleNavigationGroupOpened(i){if(i.detail.source!==this.el){this.hideDropdown()}}navItemClickHandler(){this.hideDropdown()}brandChangeHandler(i){this.focusStyle=i.detail.mode}async setFocus(){var i;(i=this.groupEl)===null||i===void 0?void 0:i.focus()}toggleDropdown(){this.dropdownOpen=!this.dropdownOpen;if(this.inTopNavSideMenu){this.navigationGroupExpanded.emit({expanded:this.dropdownOpen})}}showDropdown(){if(!this.dropdownOpen){this.navigationGroupOpened.emit({source:this.el});this.toggleDropdown()}}hideDropdown(){document.removeEventListener("keydown",this.handleKeydown);if(this.dropdownOpen){this.toggleDropdown()}}render(){const{dropdownOpen:i,expanded:t,inTopNavSideMenu:n,expandable:a,theme:s,isSideNavExpanded:r,focusStyle:d}=this;const c=i=>i?"expanded":"collapsed";const p={"navigation-group":true,[d]:!n,[`navigation-group-side-menu-${c(i)}`]:n&&a,selected:i&&!n};const u=this.navigationType==="side";const l=this.navigationType==="top";const g=!n&&l;const v=u&&t||l&&i;return e(o,{key:"4d9f64e96f0e60b2e120ef1ff3ead8fc9eeba8ff",class:{"in-side-menu":n,"ic-navigation-group-expandable":a,"ic-navigation-group-side-nav":u,[`ic-navigation-group-${c(t)}`]:true,[`ic-theme-${s}`]:s!=="inherit"},role:"listitem"},a||g?e("button",{onMouseEnter:g?this.handleMouseEnter:undefined,onMouseLeave:l?this.handleMouseLeave:undefined,onBlur:this.handleBlur,onClick:this.handleClick,onKeyDown:this.handleKeydown,class:p,ref:i=>this.groupEl=i,"aria-expanded":`${v}`,"aria-haspopup":`${g}`},this.renderGroupTitleText(),u&&a&&e("div",{class:{"chevron-toggle-icon-wrapper":true,"chevron-toggle-icon-closed":!!t},innerHTML:h})):(!u||r)&&e("div",{class:p},this.renderGroupTitleText()),this.renderNavigationItems())}static get delegatesFocus(){return true}get el(){return n(this)}};v.style=p;export{v as ic_navigation_group};
2
- //# sourceMappingURL=p-3680f22c.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icNavigationGroupCss","IcNavigationGroupStyle0","IC_NAVIGATION_ITEM","DYNAMIC_GROUPED_LINKS_HEIGHT_MS","NODE_NAME","NavigationGroup","constructor","hostRef","this","allGroupedNavigationItemHeights","collapsedNavItemsHeight","expandedNavItemsHeight","mouseGate","deviceSize","DEVICE_SIZES","XL","dropdownOpen","focusStyle","getBrandForegroundAppearance","inTopNavSideMenu","isSideNavExpanded","expandable","expanded","theme","sideNavExpandHandler","event","detail","sideNavExpanded","linkWrapper","navItemsHeight","setGroupedLinksElementHeight","setTimeout","topNavResizedHandler","size","_a","parentEl","customMobileBreakpoint","L","toggleExpanded","el","querySelectorAll","forEach","navigationItem","navItem","shadowRoot","querySelector","setAttribute","handleClick","ev","navigationType","toggleDropdown","handleBlur","contains","relatedTarget","hideDropdown","handleKeydown","key","preventDefault","handleMouseLeave","relTarget","dropdown","document","activeElement","nodeName","handleMouseEnter","addEventListener","showDropdown","renderGroupTitleText","h","id","variant","label","renderNavigationItems","class","selected","onMouseLeave","undefined","ref","height","style","setProperty","disconnectedCallback","removeEventListener","_b","componentWillLoad","getCurrentDeviceSize","navType","parent","getNavItemParentDetails","componentDidLoad","Array","from","reduce","childrenHeights","offsetHeight","childBlurHandler","handleNavigationGroupOpened","source","navItemClickHandler","brandChangeHandler","mode","setFocus","groupEl","focus","navigationGroupExpanded","emit","navigationGroupOpened","render","getExpandedClassSuffix","prop","navGroupTitleClassNames","isSideNav","isTopNav","isTopNavDesktop","ariaExpanded","Host","role","onMouseEnter","onBlur","onClick","onKeyDown","innerHTML","chevronIcon"],"sources":["src/components/ic-navigation-group/ic-navigation-group.css?tag=ic-navigation-group&encapsulation=shadow","src/components/ic-navigation-group/ic-navigation-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-navigation-item: z-index of navigation group item\n */\n\n:host {\n display: block;\n\n --ic-typography-color: currentcolor;\n}\n\n:host(.in-side-menu) {\n border-bottom: var(--ic-border-width) solid\n var(--ic-divider-background-monochrome);\n padding: var(--ic-space-md) 0;\n}\n\n:host .navigation-group {\n height: 100%;\n width: fit-content;\n color: var(--ic-brand-text-color);\n display: flex;\n gap: var(--ic-space-xxs);\n align-items: center;\n justify-content: center;\n padding: 0 var(--ic-space-md);\n transition: var(--ic-easing-transition-slow);\n position: relative;\n background: none;\n border: none;\n text-align: left;\n box-sizing: border-box;\n}\n\n:host .navigation-group:hover,\n:host .navigation-group:active,\n:host .selected {\n background-color: var(--ic-architectural-20);\n color: var(--ic-color-text-primary-light);\n outline: none;\n cursor: pointer;\n}\n\n:host(.in-side-menu) .navigation-group {\n min-height: 2.5rem;\n width: 100%;\n gap: 1.25rem;\n}\n\n:host(.in-side-menu) .navigation-group .ic-typography-label {\n width: 100%;\n}\n\n:host(.in-side-menu:not(.ic-navigation-group-expandable)) .navigation-group,\n:host(.in-side-menu) .navigation-group-side-menu-collapsed,\n:host(.in-side-menu) .navigation-group-side-menu-expanded {\n color: var(--ic-top-navigation-nav-group-link);\n justify-content: flex-start;\n padding: var(--ic-space-xs) var(--ic-space-md);\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-expanded {\n margin-bottom: var(--ic-space-xs);\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-collapsed::after,\n:host(.in-side-menu) .navigation-group-side-menu-expanded::after {\n border-style: solid;\n border-width: 0.125em 0.125em 0 0;\n content: \"\";\n display: inline-block;\n min-height: 0.45em;\n position: relative;\n top: -0.1em;\n transform: rotate(135deg);\n vertical-align: top;\n min-width: 0.45em;\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-expanded::after {\n top: 0.15em;\n transform: rotate(-45deg);\n}\n\n:host(:not(.in-side-menu)) .navigation-group:focus {\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n outline: var(--ic-hc-focus-outline);\n z-index: var(--ic-z-index-navigation-item);\n transition: box-shadow var(--ic-easing-transition-fast);\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-expanded:hover:not(:focus),\n:host(.in-side-menu) .navigation-group-side-menu-collapsed:hover:not(:focus) {\n background-color: var(--ic-top-navigation-nav-group-hover);\n cursor: pointer;\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-expanded:active:not(:focus),\n:host(.in-side-menu) .navigation-group-side-menu-collapsed:active:not(:focus) {\n background-color: var(--ic-top-navigation-nav-group-pressed);\n}\n\n:host(.in-side-menu) .navigation-group-side-menu-expanded:focus,\n:host(.in-side-menu) .navigation-group-side-menu-collapsed:focus {\n box-shadow: var(--ic-border-focus-inset);\n border-radius: var(--ic-border-radius-inset);\n outline: var(--ic-hc-focus-outline);\n background: none;\n}\n\n:host .navigation-group-dropdown {\n background-color: var(--ic-top-navigation-menu-background);\n border-bottom: var(--ic-space-1px) solid var(--ic-top-navigation-menu-border);\n position: absolute;\n left: 0;\n right: 0;\n padding: var(--ic-space-xs) var(--ic-space-md);\n box-shadow: 0 0.375rem 0.5rem -0.375rem rgba(0 0 0 / 20%);\n z-index: calc(var(--ic-z-index-navigation-item) - 1);\n}\n\n:host .navigation-group-dropdown-items-list {\n list-style: none;\n display: flex;\n flex-flow: column wrap;\n align-content: flex-start;\n padding-left: var(--ic-space-md);\n max-height: 16.5rem;\n}\n\n:host .chevron-toggle-icon-wrapper {\n display: flex;\n align-items: center;\n}\n\n:host .chevron-toggle-icon-wrapper svg {\n transform: rotate(90deg);\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n}\n\n:host .chevron-toggle-icon-closed svg {\n transform: rotate(-90deg);\n}\n\n:host(.ic-navigation-group-expanded) .grouped-links-wrapper {\n height: var(--navigation-child-items-height, auto) !important;\n transition: var(--ic-easing-transition-slow);\n overflow: hidden;\n}\n\n:host(.ic-navigation-group-side-nav) .link,\n:host(.ic-navigation-group-side-nav) ::slotted(a) {\n height: var(--navigation-child-items-height, auto);\n}\n\n:host(.ic-navigation-group-collapsed) .grouped-links-wrapper {\n height: 0;\n transition: var(--ic-easing-transition-slow);\n overflow: hidden;\n}\n\n:host(.ic-navigation-group-side-nav) .navigation-group {\n min-height: var(--navigation-group-height);\n height: fit-content;\n min-width: 100%;\n width: var(--navigation-group-width, auto);\n justify-content: var(--navigation-group-justify-content);\n padding: var(--ic-space-md) var(--navigation-group-expand-toggle-padding)\n var(--ic-space-xs) var(--ic-space-md);\n}\n\n:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable))\n .navigation-group {\n padding-right: var(--ic-space-md);\n}\n\n:host(.ic-navigation-group-side-nav) .navigation-group:hover,\n:host(.ic-navigation-group-side-nav) .navigation-group:active,\n:host(.ic-navigation-group-side-nav) .selected {\n background-color: var(--navigation-group-hover);\n color: var(--navigation-group-text-hover);\n}\n\n:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable))\n .navigation-group:hover,\n:host(.ic-navigation-group-side-nav:not(.ic-navigation-group-expandable))\n .navigation-group:active,\n:host(.in-side-menu:not(.ic-navigation-group-expandable))\n .navigation-group:hover,\n:host(.in-side-menu:not(.ic-navigation-group-expandable))\n .navigation-group:active {\n background: none;\n cursor: auto;\n}\n\n:host(.ic-navigation-group-side-nav) .navigation-group:focus {\n box-shadow: var(--ic-border-focus-inset);\n border-radius: var(--ic-border-radius-inset);\n background: none;\n}\n\n:host(.ic-navigation-group-side-nav) .ic-typography-caption {\n position: var(--navigation-group-title-position);\n left: var(--navigation-group-title-position-left);\n}\n","import {\n Component,\n Element,\n Host,\n Prop,\n State,\n Listen,\n h,\n Method,\n Event,\n EventEmitter,\n} from \"@stencil/core\";\n\nimport {\n DEVICE_SIZES,\n getCurrentDeviceSize,\n getBrandForegroundAppearance,\n getNavItemParentDetails,\n} from \"../../utils/helpers\";\nimport {\n IcNavType,\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundNoDefault,\n IcThemeMode,\n} from \"../../utils/types\";\n\nimport chevronIcon from \"../../assets/chevron-icon.svg\";\nimport {\n IcNavigationExpandEventDetail,\n IcNavigationOpenEventDetail,\n} from \"./ic-navigation-group.types\";\n\nconst IC_NAVIGATION_ITEM = \"ic-navigation-item\";\nconst DYNAMIC_GROUPED_LINKS_HEIGHT_MS = 100;\nconst NODE_NAME = \"IC-NAVIGATION-GROUP\";\n\n@Component({\n tag: \"ic-navigation-group\",\n styleUrl: \"ic-navigation-group.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class NavigationGroup {\n private allGroupedNavigationItemHeights = \"\";\n private collapsedNavItemsHeight: string | null = null;\n private dropdown?: HTMLElement;\n private expandedNavItemsHeight: string | null = null;\n private groupEl?: HTMLElement;\n private mouseGate = false;\n private linkWrapper?: HTMLUListElement;\n\n @Element() el: HTMLIcNavigationGroupElement;\n\n @State() deviceSize: number = DEVICE_SIZES.XL;\n @State() dropdownOpen = false;\n @State() focusStyle: IcBrandForegroundNoDefault | IcBrandForeground =\n getBrandForegroundAppearance();\n @State() inTopNavSideMenu = false;\n @State() navigationType: IcNavType | \"\";\n @State() parentEl: HTMLElement | null;\n @State() isSideNavExpanded = false;\n\n /**\n * If `true`, the group will be expandable when in an ic-side-navigation component, or, when in an ic-top-navigation component, in the side menu displayed at small screen sizes.\n */\n @Prop() expandable = false;\n\n /**\n * If `true`, the expandable group will be expanded by default when in an ic-side-navigation component. To enable this prop, `expandable` must also be set to `true`.\n */\n @Prop({ mutable: true }) expanded = true;\n\n /**\n * The label to display on the group.\n */\n @Prop() label!: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * @internal Emitted when a navigation group is opened - when within an ic-top-navigation at large screen sizes.\n */\n @Event() navigationGroupOpened: EventEmitter<IcNavigationOpenEventDetail>;\n\n /**\n * @internal Emitted when a navigation group is expanded - when within an ic-top-navigation at small screen sizes.\n */\n @Event() navigationGroupExpanded: EventEmitter<IcNavigationExpandEventDetail>;\n\n disconnectedCallback(): void {\n if (this.navigationType === \"side\") {\n this.parentEl?.removeEventListener(\n \"icSideNavExpanded\",\n this.sideNavExpandHandler as EventListener\n );\n } else if (this.navigationType === \"top\") {\n this.parentEl?.removeEventListener(\n \"icTopNavResized\",\n this.topNavResizedHandler as EventListener\n );\n }\n }\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n const { navType, parent } = getNavItemParentDetails(this.el);\n this.navigationType = navType;\n this.parentEl = parent;\n\n if (this.navigationType === \"side\") {\n this.parentEl?.addEventListener(\n \"icSideNavExpanded\",\n this.sideNavExpandHandler as EventListener\n );\n } else if (this.navigationType === \"top\") {\n this.parentEl?.addEventListener(\n \"icTopNavResized\",\n this.topNavResizedHandler as EventListener\n );\n if (\n this.deviceSize <=\n (this.parentEl as HTMLIcTopNavigationElement).customMobileBreakpoint\n )\n this.inTopNavSideMenu = true;\n }\n }\n\n componentDidLoad(): void {\n this.allGroupedNavigationItemHeights = `${Array.from(\n this.el.querySelectorAll(IC_NAVIGATION_ITEM)\n ).reduce(\n (childrenHeights, { offsetHeight }) => childrenHeights + offsetHeight,\n 0\n )}px`;\n\n /**\n * debounce is required as the incorrect height was retrieved instantly after\n * componentDidLoad is invoked.\n */\n setTimeout(() => {\n if (!this.linkWrapper || !this.expanded) return;\n\n if (!this.isSideNavExpanded)\n this.collapsedNavItemsHeight = this.allGroupedNavigationItemHeights;\n else this.expandedNavItemsHeight = this.allGroupedNavigationItemHeights;\n\n this.setGroupedLinksElementHeight(this.allGroupedNavigationItemHeights);\n }, DYNAMIC_GROUPED_LINKS_HEIGHT_MS);\n }\n\n @Listen(\"childBlur\")\n childBlurHandler(): void {\n this.hideDropdown();\n }\n\n @Listen(\"navigationGroupOpened\", { target: \"document\" })\n handleNavigationGroupOpened(event: CustomEvent): void {\n if (event.detail.source !== this.el) {\n this.hideDropdown();\n }\n }\n\n @Listen(\"navItemClicked\")\n navItemClickHandler(): void {\n this.hideDropdown();\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler(ev: CustomEvent<IcBrand>): void {\n this.focusStyle = ev.detail.mode;\n }\n\n /**\n * Sets focus on the nav item.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.groupEl?.focus();\n }\n\n private sideNavExpandHandler = (event: CustomEvent) => {\n this.isSideNavExpanded = event.detail.sideNavExpanded;\n\n if (!this.linkWrapper || !this.expanded) return;\n\n const navItemsHeight = this.isSideNavExpanded\n ? this.expandedNavItemsHeight\n : this.collapsedNavItemsHeight;\n\n if (navItemsHeight) {\n this.setGroupedLinksElementHeight(navItemsHeight);\n } else {\n setTimeout(() => {\n if (this.isSideNavExpanded) {\n this.expandedNavItemsHeight = this.allGroupedNavigationItemHeights;\n } else {\n this.collapsedNavItemsHeight = this.allGroupedNavigationItemHeights;\n }\n\n this.setGroupedLinksElementHeight(this.allGroupedNavigationItemHeights);\n }, DYNAMIC_GROUPED_LINKS_HEIGHT_MS);\n }\n };\n\n private topNavResizedHandler = ({\n detail: { size },\n }: CustomEvent<{ size: number }>) => {\n if (size === this.deviceSize) return;\n\n this.deviceSize = size;\n this.inTopNavSideMenu =\n size <=\n ((this.parentEl as HTMLIcTopNavigationElement)?.customMobileBreakpoint ||\n DEVICE_SIZES.L);\n };\n\n private toggleDropdown() {\n this.dropdownOpen = !this.dropdownOpen;\n if (this.inTopNavSideMenu) {\n this.navigationGroupExpanded.emit({ expanded: this.dropdownOpen });\n }\n }\n\n private toggleExpanded = () => {\n this.expanded = !this.expanded;\n if (!this.linkWrapper) return;\n\n this.setGroupedLinksElementHeight(\n !this.expanded\n ? \"0\"\n : this.isSideNavExpanded\n ? this.expandedNavItemsHeight\n : this.collapsedNavItemsHeight\n );\n\n this.el.querySelectorAll(IC_NAVIGATION_ITEM).forEach((navigationItem) => {\n const navItem =\n navigationItem.shadowRoot?.querySelector(\"a\") ||\n navigationItem.querySelector(\"a\");\n navItem?.setAttribute(\"tabindex\", this.expanded ? \"0\" : \"-1\");\n });\n };\n\n private showDropdown() {\n if (!this.dropdownOpen) {\n this.navigationGroupOpened.emit({\n source: this.el,\n });\n\n this.toggleDropdown();\n }\n }\n\n private hideDropdown() {\n document.removeEventListener(\"keydown\", this.handleKeydown);\n if (this.dropdownOpen) {\n this.toggleDropdown();\n }\n }\n\n private handleClick = (ev: MouseEvent) => {\n if (this.navigationType === \"top\" && ev.detail) {\n this.toggleDropdown();\n } else {\n this.toggleExpanded();\n }\n };\n\n private handleBlur = (ev: FocusEvent) => {\n if (!this.el.contains(ev.relatedTarget as HTMLElement)) {\n this.hideDropdown();\n }\n };\n\n private handleKeydown = (ev: KeyboardEvent) => {\n const { key } = ev;\n if (key !== \"Enter\" && key !== \" \" && key !== \"Escape\") return;\n\n switch (this.navigationType) {\n case \"top\":\n if (key === \" \" || key === \"Enter\") {\n this.toggleDropdown();\n } else if (!this.inTopNavSideMenu) {\n this.hideDropdown();\n }\n break;\n case \"side\":\n this.toggleExpanded();\n ev.preventDefault();\n break;\n default:\n this.toggleExpanded();\n break;\n }\n };\n\n private handleMouseLeave = (ev: MouseEvent) => {\n const relTarget = ev.relatedTarget as HTMLElement;\n\n this.mouseGate = false;\n\n if (\n this.el.contains(relTarget) ||\n relTarget === this.dropdown ||\n this.el.contains(document.activeElement)\n )\n return;\n\n if (\n document.activeElement !== this.el &&\n relTarget?.nodeName === NODE_NAME &&\n this.dropdownOpen\n ) {\n this.mouseGate = true;\n this.hideDropdown();\n } else {\n this.mouseGate = false;\n setTimeout(() => {\n this.dropdownOpen ? this.hideDropdown() : null;\n }, 500);\n }\n };\n\n private handleMouseEnter = (ev: MouseEvent) => {\n const relTarget = ev.relatedTarget as HTMLElement | null;\n document.addEventListener(\"keydown\", this.handleKeydown);\n\n if (relTarget?.nodeName === NODE_NAME && this.mouseGate) {\n this.showDropdown();\n } else if (!this.dropdownOpen && !this.mouseGate) {\n this.mouseGate = true;\n setTimeout(() => {\n if (this.mouseGate) this.showDropdown();\n }, 500);\n }\n };\n\n private renderGroupTitleText = () => (\n <ic-typography\n id=\"nav-group-title\"\n variant={this.navigationType === \"side\" ? \"caption\" : \"label\"}\n >\n {this.label}\n </ic-typography>\n );\n\n private renderNavigationItems = () => {\n if (this.dropdownOpen || (this.inTopNavSideMenu && !this.expandable)) {\n return (\n <div\n class={{\n [this.inTopNavSideMenu\n ? \"navigation-group-dropdown-side-menu\"\n : \"navigation-group-dropdown\"]: true,\n selected: this.dropdownOpen && !this.inTopNavSideMenu,\n }}\n onMouseLeave={\n !this.inTopNavSideMenu ? this.handleMouseLeave : undefined\n }\n ref={(el) => (this.dropdown = el)}\n >\n <nav\n class={{\n \"navigation-group-dropdown-items\": !this.inTopNavSideMenu,\n }}\n aria-labelledby=\"nav-group-title\"\n >\n <ul>\n <slot></slot>\n </ul>\n </nav>\n </div>\n );\n }\n\n if (this.navigationType !== \"top\") {\n return (\n <ul ref={(el) => (this.linkWrapper = el)} class=\"grouped-links-wrapper\">\n <slot></slot>\n </ul>\n );\n }\n\n return null;\n };\n\n private setGroupedLinksElementHeight = (height: string | null) => {\n this.linkWrapper?.style.setProperty(\n \"--navigation-child-items-height\",\n height\n );\n };\n\n render() {\n const {\n dropdownOpen,\n expanded,\n inTopNavSideMenu,\n expandable,\n theme,\n isSideNavExpanded,\n focusStyle,\n } = this;\n\n const getExpandedClassSuffix = (prop: boolean) =>\n prop ? \"expanded\" : \"collapsed\";\n\n const navGroupTitleClassNames = {\n \"navigation-group\": true,\n [focusStyle]: !inTopNavSideMenu,\n [`navigation-group-side-menu-${getExpandedClassSuffix(dropdownOpen)}`]:\n inTopNavSideMenu && expandable,\n selected: dropdownOpen && !inTopNavSideMenu,\n };\n\n const isSideNav = this.navigationType === \"side\";\n const isTopNav = this.navigationType === \"top\";\n const isTopNavDesktop = !inTopNavSideMenu && isTopNav;\n\n const ariaExpanded = (isSideNav && expanded) || (isTopNav && dropdownOpen);\n\n return (\n <Host\n class={{\n \"in-side-menu\": inTopNavSideMenu,\n \"ic-navigation-group-expandable\": expandable,\n \"ic-navigation-group-side-nav\": isSideNav,\n [`ic-navigation-group-${getExpandedClassSuffix(expanded)}`]: true,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n role=\"listitem\"\n >\n {expandable || isTopNavDesktop ? (\n <button\n onMouseEnter={isTopNavDesktop ? this.handleMouseEnter : undefined}\n onMouseLeave={isTopNav ? this.handleMouseLeave : undefined}\n onBlur={this.handleBlur}\n onClick={this.handleClick}\n onKeyDown={this.handleKeydown}\n class={navGroupTitleClassNames}\n ref={(el) => (this.groupEl = el)}\n aria-expanded={`${ariaExpanded}`}\n aria-haspopup={`${isTopNavDesktop}`}\n >\n {this.renderGroupTitleText()}\n {isSideNav && expandable && (\n <div\n class={{\n \"chevron-toggle-icon-wrapper\": true,\n \"chevron-toggle-icon-closed\": !!expanded,\n }}\n innerHTML={chevronIcon}\n ></div>\n )}\n </button>\n ) : (\n (!isSideNav || isSideNavExpanded) && (\n <div class={navGroupTitleClassNames}>\n {this.renderGroupTitleText()}\n </div>\n )\n )}\n {this.renderNavigationItems()}\n </Host>\n );\n }\n}\n"],"mappings":"qLAAA,MAAMA,EAAuB,4kPAC7B,MAAAC,EAAeD,ECgCf,MAAME,EAAqB,qBAC3B,MAAMC,EAAkC,IACxC,MAAMC,EAAY,sB,MASLC,EAAe,MAP5B,WAAAC,CAAAC,G,wIAQUC,KAAAC,gCAAkC,GAClCD,KAAAE,wBAAyC,KAEzCF,KAAAG,uBAAwC,KAExCH,KAAAI,UAAY,MAKXJ,KAAAK,WAAqBC,EAAaC,GAClCP,KAAAQ,aAAe,MACfR,KAAAS,WACPC,IACOV,KAAAW,iBAAmB,MAGnBX,KAAAY,kBAAoB,MAKrBZ,KAAAa,WAAa,MAKIb,KAAAc,SAAW,KAU5Bd,KAAAe,MAAqB,UAuGrBf,KAAAgB,qBAAwBC,IAC9BjB,KAAKY,kBAAoBK,EAAMC,OAAOC,gBAEtC,IAAKnB,KAAKoB,cAAgBpB,KAAKc,SAAU,OAEzC,MAAMO,EAAiBrB,KAAKY,kBACxBZ,KAAKG,uBACLH,KAAKE,wBAET,GAAImB,EAAgB,CAClBrB,KAAKsB,6BAA6BD,E,KAC7B,CACLE,YAAW,KACT,GAAIvB,KAAKY,kBAAmB,CAC1BZ,KAAKG,uBAAyBH,KAAKC,+B,KAC9B,CACLD,KAAKE,wBAA0BF,KAAKC,+B,CAGtCD,KAAKsB,6BA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EAAI,CAAA3D,IAAA,2CACHiB,MAAO,CACL,eAAgBtD,EAChB,iCAAkCE,EAClC,+BAAgC0F,EAChC,CAAC,uBAAuBH,EAAuBtF,MAAc,KAC7D,CAAC,YAAYC,KAAUA,IAAU,WAEnC6F,KAAK,YAEJ/F,GAAc4F,EACb7C,EAAA,UACEiD,aAAcJ,EAAkBzG,KAAKwD,iBAAmBY,UACxDD,aAAcqC,EAAWxG,KAAKkD,iBAAmBkB,UACjD0C,OAAQ9G,KAAK2C,WACboE,QAAS/G,KAAKuC,YACdyE,UAAWhH,KAAK+C,cAChBkB,MAAOqC,EACPjC,IAAMtC,GAAQ/B,KAAK8F,QAAU/D,EAAG,gBACjB,GAAG2E,IAAc,gBACjB,GAAGD,KAEjBzG,KAAK2D,uBACL4C,GAAa1F,GACZ+C,EAAA,OACEK,MAAO,CACL,8BAA+B,KAC/B,+BAAgCnD,GAElCmG,UAAWC,OAKfX,GAAa3F,IACbgD,EAAA,OAAKK,MAAOqC,GACTtG,KAAK2D,wBAIX3D,KAAKgE,wB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["icFooterCss","IcFooterStyle0","Footer","constructor","hostRef","this","resizeObserver","hostMutationObserver","deviceSize","IC_DEVICE_SIZES","XL","foregroundColor","getBrandForegroundAppearance","aligned","breakpoint","copyright","groupLinks","resizeObserverCallback","currSize","footerResized","emit","runResizeObserver","footerEl","ResizeObserver","getCurrentDeviceSize","observe","disconnectedCallback","disconnect","_a","componentWillLoad","componentDidLoad","checkResizeObserver","MutationObserver","mutationList","renderDynamicChildSlots","el","childList","brandChangeHandler","ev","detail","mode","isSmall","bp","XS","S","M","L","render","caption","description","small","showComplianceSection","isSlotUsed","h","Host","key","class","IcBrandForegroundEnum","Dark","Light","ref","fullHeight","variant","name","role","hasClassificationBanner"],"sources":["src/components/ic-footer/ic-footer.css?tag=ic-footer&encapsulation=shadow","src/components/ic-footer/ic-footer.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n:host {\n display: block;\n\n --footer-compliance-padding: 1rem 0;\n}\n\n:host(.ic-footer-sparse) {\n --footer-links-padding: 1.5rem 0;\n --footer-logo-margin-bottom: calc(var(--ic-space-md) + var(--ic-space-xxs));\n --footer-link-inner-flex-direction: row;\n}\n\n:host(.ic-footer-small) {\n --footer-links-padding: 0 0;\n --footer-logo-margin-bottom: var(--ic-space-md);\n --footer-link-inner-flex-direction: column;\n}\n\n:host(.ic-footer-foreground-dark) {\n --ic-footer-background: var(--ic-brand-color-secondary-light);\n --ic-footer-bottom-background: var(--ic-brand-color-tertiary-light);\n --ic-footer-keyline: var(--ic-state-layer-darken-20);\n --ic-footer-text: var(--ic-color-text-primary-light);\n --ic-footer-link: var(--ic-color-text-primary-light);\n --ic-footer-icon: var(--ic-color-icon-neutral);\n --ic-footer-chevron-icon: var(--ic-color-icon-neutral);\n --ic-footer-logo: var(--ic-color-icon-neutral);\n --ic-footer-hover: var(--ic-architectural-700-state-layer-10);\n --ic-footer-pressed: var(--ic-architectural-700-state-layer-20);\n}\n\n:host(.ic-footer-small.ic-footer-ungrouped) {\n --footer-links-padding: var(--ic-space-md) 0 0 0;\n}\n\n/* Main inner footer element */\nfooter {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n/* Description */\n\n.footer-description {\n background-color: var(--ic-footer-background);\n color: var(--ic-footer-text);\n\n --ic-typography-color: var(--ic-footer-text);\n\n border-bottom: var(--ic-space-1px) solid var(--ic-footer-keyline);\n}\n\n.footer-description-inner {\n padding: 1rem 0;\n}\n\n/* Links */\n\n.footer-links {\n padding: var(--footer-links-padding);\n background-color: var(--ic-footer-background);\n color: var(--ic-footer-link);\n\n --ic-typography-color: var(--ic-footer-link);\n}\n\n.footer-links-inner {\n display: flex;\n flex-direction: var(--footer-link-inner-flex-direction);\n}\n\n/* Compliance */\n\n.footer-compliance {\n background-color: var(--ic-footer-bottom-background);\n color: var(--ic-footer-text);\n\n --ic-typography-color: var(--ic-footer-text);\n}\n\n.footer-compliance-inner {\n padding: var(--footer-compliance-padding);\n}\n\n.footer-logo {\n margin-bottom: var(--footer-logo-margin-bottom);\n display: flex;\n gap: var(--ic-space-xxl);\n}\n\n.footer-logo > ::slotted() {\n margin-right: var(--ic-space-md);\n}\n\n.footer-caption {\n margin-bottom: var(--ic-space-md);\n}\n\n.classification-spacing {\n margin-bottom: var(--ic-space-lg);\n}\n\n@media (forced-colors: active) {\n footer {\n border-top: var(--ic-border-hc);\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n} from \"@stencil/core\";\nimport { IC_DEVICE_SIZES } from \"../../utils/constants\";\nimport {\n getCurrentDeviceSize,\n getBrandForegroundAppearance,\n checkResizeObserver,\n hasClassificationBanner,\n isSlotUsed,\n renderDynamicChildSlots,\n} from \"../../utils/helpers\";\nimport {\n IcAlignment,\n IcBrand,\n IcBrandForeground,\n IcBrandForegroundEnum,\n} from \"../../utils/types\";\nimport { IcFooterBreakpoints } from \"./ic-footer.types\";\n\n/**\n * @slot description - Content will be rendered at the top of the footer.\n * @slot link - Content will be rendered between description and logos.\n * @slot logo - Content will be rendered underneath footer links.\n * @slot caption - Content will be rendered above Crown Copyright.\n */\n\n@Component({\n tag: \"ic-footer\",\n styleUrl: \"ic-footer.css\",\n shadow: true,\n})\nexport class Footer {\n private footerEl?: HTMLElement;\n private resizeObserver: ResizeObserver | null = null;\n private hostMutationObserver: MutationObserver | null = null;\n\n @Element() el: HTMLIcFooterElement;\n\n @State() deviceSize: number = IC_DEVICE_SIZES.XL;\n @State() foregroundColor: IcBrandForeground = getBrandForegroundAppearance();\n\n /**\n * The alignment of the section containers used within the footer.\n */\n @Prop() aligned?: IcAlignment = \"left\";\n\n /**\n * The screen size breakpoint at which to switch to the small layout.\n */\n @Prop() breakpoint?: IcFooterBreakpoints = \"medium\";\n\n /**\n * The caption displayed at the bottom of the footer.\n */\n @Prop() caption?: string;\n\n /**\n * If `true`, the footer will display the crown copyright at the bottom.\n */\n @Prop() copyright?: boolean = true;\n\n /**\n * The description displayed at the top of the footer.\n */\n @Prop() description?: string;\n\n /**\n * If `true`, the footer will be set up to handle link groups instead of standalone links.\n */\n @Prop() groupLinks?: boolean = false;\n\n /**\n * @internal Triggers on page resize and triggers style changes in footer links and link groups\n */\n @Event() footerResized: EventEmitter<void>;\n\n disconnectedCallback(): void {\n if (this.resizeObserver !== null) {\n this.resizeObserver.disconnect();\n }\n\n this.hostMutationObserver?.disconnect();\n }\n\n componentWillLoad(): void {\n this.deviceSize = getCurrentDeviceSize();\n }\n\n componentDidLoad(): void {\n checkResizeObserver(this.runResizeObserver);\n\n this.hostMutationObserver = new MutationObserver((mutationList) => {\n return renderDynamicChildSlots(mutationList, \"link\", this);\n });\n\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n @Listen(\"brandChange\", { target: \"document\" })\n brandChangeHandler(ev: CustomEvent<IcBrand>): void {\n this.foregroundColor = ev.detail.mode;\n }\n\n private isSmall() {\n const bp = this.breakpoint;\n\n return bp === \"extra small\"\n ? this.deviceSize < IC_DEVICE_SIZES.XS\n : bp === \"small\"\n ? this.deviceSize < IC_DEVICE_SIZES.S\n : bp === \"medium\"\n ? this.deviceSize < IC_DEVICE_SIZES.M\n : bp === \"large\"\n ? this.deviceSize < IC_DEVICE_SIZES.L\n : bp === \"extra large\"\n ? this.deviceSize < IC_DEVICE_SIZES.XL\n : false;\n }\n\n private resizeObserverCallback = (currSize: number) => {\n if (currSize !== this.deviceSize) {\n this.deviceSize = currSize;\n }\n this.footerResized.emit();\n };\n\n private runResizeObserver = () => {\n if (this.footerEl) {\n this.resizeObserver = new ResizeObserver(() => {\n const currSize = getCurrentDeviceSize();\n this.resizeObserverCallback(currSize);\n });\n\n this.resizeObserver.observe(this.footerEl);\n }\n };\n\n render() {\n const {\n aligned,\n caption,\n copyright,\n description,\n deviceSize,\n el,\n foregroundColor,\n groupLinks,\n } = this;\n const small = this.isSmall();\n\n const showComplianceSection =\n isSlotUsed(el, \"logo\") ||\n isSlotUsed(el, \"caption\") ||\n caption ||\n copyright;\n\n return (\n <Host\n class={{\n [\"ic-footer\"]: true,\n [`ic-footer-${small ? \"small\" : \"sparse\"}`]: true,\n [`ic-footer-${groupLinks ? \"grouped\" : \"ungrouped\"}`]: true,\n [`ic-footer-foreground-${foregroundColor}`]: true,\n // Slots will be able to infer their own color\n [`ic-footer-${IcBrandForegroundEnum.Dark}`]:\n foregroundColor === IcBrandForegroundEnum.Dark,\n [`ic-footer-${IcBrandForegroundEnum.Light}`]:\n foregroundColor === IcBrandForegroundEnum.Light,\n }}\n >\n <footer ref={(el) => (this.footerEl = el)}>\n {/* Description */}\n {(isSlotUsed(el, \"description\") || description) && (\n <div class=\"footer-description\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-description-inner\">\n <ic-typography variant=\"body\">\n <slot name=\"description\">{description}</slot>\n </ic-typography>\n </div>\n </ic-section-container>\n </div>\n )}\n\n {/* Links */}\n {isSlotUsed(el, \"link\") && (\n <div class=\"footer-links\">\n {groupLinks && small ? (\n <div class=\"footer-links-inner\" role=\"list\">\n <slot name=\"link\" />\n </div>\n ) : (\n <ic-section-container fullHeight aligned={aligned}>\n <div class=\"footer-links-inner\" role=\"list\">\n <slot name=\"link\" />\n </div>\n </ic-section-container>\n )}\n </div>\n )}\n\n {/* Compliance (logo, caption, copyright) */}\n {showComplianceSection && (\n <div class=\"footer-compliance\">\n <ic-section-container aligned={aligned} fullHeight={true}>\n <div class=\"footer-compliance-inner\">\n {isSlotUsed(el, \"logo\") && (\n <div class=\"footer-logo\">\n <slot name=\"logo\" />\n </div>\n )}\n {(isSlotUsed(el, \"caption\") || caption) && (\n <div class=\"footer-caption\">\n <ic-typography\n variant={\n deviceSize <= IC_DEVICE_SIZES.M ? \"caption\" : \"body\"\n }\n >\n <slot name=\"caption\">{caption}</slot>\n </ic-typography>\n </div>\n )}\n {copyright && (\n <div\n class={{\n [\"footer-copyright\"]: true,\n [\"classification-spacing\"]: hasClassificationBanner(),\n }}\n >\n <ic-typography\n variant={\n deviceSize <= IC_DEVICE_SIZES.M\n ? \"caption-uppercase\"\n : \"label-uppercase\"\n }\n >\n &copy; Crown Copyright\n </ic-typography>\n </div>\n )}\n </div>\n </ic-section-container>\n </div>\n )}\n </footer>\n </Host>\n );\n }\n}\n"],"mappings":"6KAAA,MAAMA,EAAc,47IACpB,MAAAC,EAAeD,E,MCuCFE,EAAM,MALnB,WAAAC,CAAAC,G,uDAOUC,KAAAC,eAAwC,KACxCD,KAAAE,qBAAgD,KAI/CF,KAAAG,WAAqBC,EAAgBC,GACrCL,KAAAM,gBAAqCC,IAKtCP,KAAAQ,QAAwB,OAKxBR,KAAAS,WAAmC,SAUnCT,KAAAU,UAAsB,KAUtBV,KAAAW,WAAuB,MAoDvBX,KAAAY,uBAA0BC,IAChC,GAAIA,IAAab,KAAKG,WAAY,CAChCH,KAAKG,WAAaU,C,CAEpBb,KAAKc,cAAcC,MAAM,EAGnBf,KAAAgB,kBAAoB,KAC1B,GAAIhB,KAAKiB,SAAU,CACjBjB,KAAKC,eAAiB,IAAIiB,gBAAe,KACvC,MAAML,EAAWM,IACjBnB,KAAKY,uBAAuBC,EAAS,IAGvCb,KAAKC,eAAemB,QAAQpB,KAAKiB,S,GA3DrC,oBAAAI,G,MACE,GAAIrB,KAAKC,iBAAmB,KAAM,CAChCD,KAAKC,eAAeqB,Y,EAGtBC,EAAAvB,KAAKE,wBAAoB,MAAAqB,SAAA,SAAAA,EAAED,Y,CAG7B,iBAAAE,GACExB,KAAKG,WAAagB,G,CAGpB,gBAAAM,GACEC,EAAoB1B,KAAKgB,mBAEzBhB,KAAKE,qBAAuB,IAAIyB,kBAAkBC,GACzCC,EAAwBD,EAAc,OAAQ5B,QAGvDA,KAAKE,qBAAqBkB,QAAQpB,KAAK8B,GAAI,CACzCC,UAAW,M,CAKf,kBAAAC,CAAmBC,GACjBjC,KAAKM,gBAAkB2B,EAAGC,OAAOC,I,CAG3B,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,MAAM,qBAAqBQ,KAAK,QACnCX,EAAA,QAAMU,KAAK,UAGbV,EAAA,wBAAsBQ,WAAU,KAAChD,QAASA,GACxCwC,EAAA,OAAKG,MAAM,qBAAqBQ,KAAK,QACnCX,EAAA,QAAMU,KAAK,YAQpBZ,GACCE,EAAA,OAAAE,IAAA,2CAAKC,MAAM,qBACTH,EAAA,wBAAAE,IAAA,2CAAsB1C,QAASA,EAASgD,WAAY,MAClDR,EAAA,OAAAE,IAAA,2CAAKC,MAAM,2BACRJ,EAAWjB,EAAI,SACdkB,EAAA,OAAAE,IAAA,2CAAKC,MAAM,eACTH,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,WAGbX,EAAWjB,EAAI,YAAca,IAC7BK,EAAA,OAAAE,IAAA,2CAAKC,MAAM,kBACTH,EAAA,iBAAAE,IAAA,2CACEO,QACEtD,GAAcC,EAAgBoC,EAAI,UAAY,QAGhDQ,EAAA,QAAAE,IAAA,2CAAMQ,KAAK,WAAWf,KAI3BjC,GACCsC,EAAA,OAAAE,IAAA,2CACEC,MAAO,CACL,CAAC,oBAAqB,KACtB,CAAC,0BAA2BS,MAG9BZ,EAAA,iBAAAE,IAAA,2CACEO,QACEtD,GAAcC,EAAgBoC,EAC1B,oBACA,mBAAiB,0B","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as t,c as e,h as o,H as i,g as n}from"./p-8e4e97b4.js";import{r}from"./p-a5658054.js";import"./p-bddf799a.js";const s='/*! 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}:root{display:block}:host{display:flex;flex-direction:row;width:-moz-fit-content;width:fit-content;min-width:-moz-min-content;min-width:min-content;border:var(--ic-border-width) solid var(--ic-toggle-button-unselected-border);border-radius:var(--ic-border-radius)}:host(.ic-toggle-button-group-full-width){width:100%;max-width:100%}:host(.ic-toggle-button-group-loading){min-width:-moz-max-content;min-width:max-content}:host(:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-transition-duration-fast);outline:none}::slotted(ic-toggle-button){flex-grow:1;width:-moz-min-content;width:min-content;--toggle-button-border:none !important;--toggle-button-border-hover:none !important;--toggle-button-border-active:none !important}::slotted(ic-toggle-button:not(:last-of-type)){border-right:var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border)}:host(.ic-toggle-button-group-disabled){border:var(--ic-space-1px) dashed\n var(--ic-toggle-button-unselected-border-disabled);pointer-events:none}:host(.ic-toggle-button-group-disabled) ::slotted(ic-toggle-button:not(:last-of-type)){border-right:var(--ic-space-1px) dashed\n var(--ic-toggle-button-unselected-border-disabled)}:host(.ic-toggle-button-group-monochrome){border:var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-monochrome)}:host(.ic-toggle-button-group-monochrome) ::slotted(ic-toggle-button:not(:last-of-type)){border-right:var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-monochrome)}:host(.ic-toggle-button-group-disabled.ic-toggle-button-group-monochrome){border:var(--ic-border-width) dashed\n var(--ic-toggle-button-unselected-border-disabled-monochrome)}:host(.ic-toggle-button-group-disabled.ic-toggle-button-group-monochrome) ::slotted(ic-toggle-button:not(:last-of-type)){border-right:var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-disabled-monochrome)}:host(.ic-toggle-button-group-hide-outline){--ic-toggle-button-unselected-border:transparent;--ic-toggle-button-unselected-border-disabled:transparent;--ic-toggle-button-unselected-border-monochrome:transparent;--ic-toggle-button-unselected-border-disabled-monochrome:transparent}';const a=s;const l="IC-TOGGLE-BUTTON-GROUP";const d=class{constructor(o){t(this,o);this.icChange=e(this,"icChange",7);this.lastKeyPressed={key:null,shift:false};this.accessibleLabel="Toggle button group";this.disabled=false;this.fullWidth=false;this.loading=false;this.monochrome=false;this.outline=true;this.selectMethod="manual";this.selectType="single";this.size="medium";this.theme="inherit";this.tooltipPlacement="bottom";this.variant="default";this.keyListener=t=>{this.lastKeyPressed={key:t.key,shift:t.shiftKey}};this.handleHostFocus=({target:t,relatedTarget:e})=>{var o;if(this.disabled){t===null||t===void 0?void 0:t.blur();return}if(this.loading)return;const i=t;const n=e;const r=Array.from((i===null||i===void 0?void 0:i.querySelectorAll("ic-toggle-button"))||[]);const s=r.every((t=>!t.checked));const{shift:a}=this.lastKeyPressed;if((s||this.selectType!=="single")&&!a||s&&a&&(n===null||n===void 0?void 0:n.tagName)==l){(o=r[0])===null||o===void 0?void 0:o.focus()}else if(!a||(n===null||n===void 0?void 0:n.tagName)==l){r.filter((t=>t.checked))[0].focus()}};this.handleKeyDown=({key:t})=>{if(t!=="ArrowDown"&&t!=="ArrowRight"&&t!=="ArrowLeft"&&t!=="ArrowUp")return;const e=this.getAllToggleButtons();const o=e[this.getNextItemToSelect(e.indexOf(e.filter((t=>t===document.activeElement))[0]),t==="ArrowDown"||t==="ArrowRight")];if(this.selectMethod==="auto"){o.checked=true;this.selectHandler(new CustomEvent("icToggleChecked",{detail:{checked:o.checked}}),o)}else{o.focus()}};this.getNextItemToSelect=(t,e)=>{const o=this.getAllToggleButtons();const i=o.length-1;if(t<1){t=0}let n=e?t+1:t-1;if(n<0){n=i}else if(n>i){n=0}if(o[n].disabled){n=this.getNextItemToSelect(n,e)}return n};this.getAllToggleButtons=()=>Array.from(this.el.querySelectorAll("ic-toggle-button"))}watchDisabledHandler(){this.getAllToggleButtons().forEach((t=>{t.disabled=this.disabled}));r(this.disabled,this.el)}watchFullWidthHandler(){this.getAllToggleButtons().forEach((t=>{t.fullWidth=this.fullWidth}))}watchLoadingHandler(){this.getAllToggleButtons().forEach((t=>{t.loading=this.loading}))}watchMonochromeHandler(){this.getAllToggleButtons().forEach((t=>{t.monochrome=this.monochrome}))}watchOutlineHandler(){this.getAllToggleButtons().forEach((t=>{t.outline=this.outline}))}watchSizeHandler(){this.getAllToggleButtons().forEach((t=>{t.size=this.size}))}watchThemeHandler(){this.getAllToggleButtons().forEach((t=>{t.theme=this.theme}))}watchTooltipPlacementHandler(){this.getAllToggleButtons().forEach((t=>{t.tooltipPlacement=this.tooltipPlacement}))}watchVariantHandler(){this.getAllToggleButtons().forEach((t=>{t.variant=this.variant}))}selectHandler(t,e){const o=this.getAllToggleButtons();let i=t.target;if(e)e.focus();if(this.selectType==="single"){if(!i&&e){i=e}o.forEach((t=>{if(t.id!==i.id&&t.checked){t.checked=false}}));this.icChange.emit({checked:t.detail.checked,selectedOption:i})}else{const t=o.filter((t=>t.checked&&!t.disabled));this.icChange.emit({checked:t.map((t=>t.checked)),toggledOptions:t.map((t=>({toggleButton:t}))),selectedOption:i})}}componentWillLoad(){if(this.selectType==="multi")this.selectMethod="manual";document.addEventListener("keydown",this.keyListener);r(this.disabled,this.el)}componentDidLoad(){this.getAllToggleButtons().forEach(((t,e)=>{var o,i,n;const r=(n=(i=(o=t.shadowRoot)===null||o===void 0?void 0:o.querySelector("ic-button"))===null||i===void 0?void 0:i.shadowRoot)===null||n===void 0?void 0:n.querySelector("button");if(r){const t=r.getAttribute("aria-label");const e=t?`${t}, `:"";r.setAttribute("aria-label",`${e}${this.accessibleLabel}`)}t.id=e.toString();t.tabIndex=-1;t.addEventListener("keydown",(t=>{this.handleKeyDown(t)}));t.classList.add("expand-toggle-group-child")}))}disconnectedCallback(){document===null||document===void 0?void 0:document.removeEventListener("keydown",this.keyListener)}render(){const{accessibleLabel:t,disabled:e,fullWidth:n,loading:r,monochrome:s,outline:a,theme:l}=this;return o(i,{key:"57a5273a71510ce0c22fec40fa9bd924b475c185",role:"group","aria-label":t,tabindex:e?-1:0,class:{"ic-toggle-button-group-disabled":e,"ic-toggle-button-group-full-width":n,"ic-toggle-button-group-loading":r,"ic-toggle-button-group-monochrome":s,"ic-toggle-button-group-hide-outline":!a,[`ic-theme-${l}`]:l!=="inherit"},onFocus:this.handleHostFocus},o("slot",{key:"2d957f4dec7d5c097a39be86538c2dcea68cffdc"}))}get el(){return n(this)}static get watchers(){return{disabled:["watchDisabledHandler"],fullWidth:["watchFullWidthHandler"],loading:["watchLoadingHandler"],monochrome:["watchMonochromeHandler"],outline:["watchOutlineHandler"],size:["watchSizeHandler"],theme:["watchThemeHandler"],tooltipPlacement:["watchTooltipPlacementHandler"],variant:["watchVariantHandler"]}}};d.style=a;export{d as ic_toggle_button_group};
2
- //# sourceMappingURL=p-762ea31a.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icToggleButtonGroupCss","IcToggleButtonGroupStyle0","TOGGLE_GROUP","ToggleButtonGroup","constructor","hostRef","this","lastKeyPressed","key","shift","accessibleLabel","disabled","fullWidth","loading","monochrome","outline","selectMethod","selectType","size","theme","tooltipPlacement","variant","keyListener","ev","shiftKey","handleHostFocus","target","relatedTarget","blur","el","relEl","toggleButtons","Array","from","querySelectorAll","noToggleButtonsChecked","every","checked","tagName","_a","focus","filter","handleKeyDown","toggleButtonOptions","getAllToggleButtons","targetToggle","getNextItemToSelect","indexOf","document","activeElement","selectHandler","CustomEvent","detail","currentItem","movingDown","numToggles","length","nextItem","watchDisabledHandler","forEach","removeDisabledFalse","watchFullWidthHandler","watchLoadingHandler","watchMonochromeHandler","watchOutlineHandler","watchSizeHandler","watchThemeHandler","watchTooltipPlacementHandler","watchVariantHandler","tabTarget","allToggles","clickedToggle","id","icChange","emit","selectedOption","toggledOptions","map","opt","toggleButton","componentWillLoad","addEventListener","componentDidLoad","i","btn","_c","_b","shadowRoot","querySelector","btnAriaLabel","getAttribute","aria","setAttribute","toString","tabIndex","classList","add","disconnectedCallback","removeEventListener","render","h","Host","role","tabindex","class","onFocus"],"sources":["src/components/ic-toggle-button-group/ic-toggle-button-group.css?tag=ic-toggle-button-group&encapsulation=shadow","src/components/ic-toggle-button-group/ic-toggle-button-group.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/* PARENT HOST */\n\n:root {\n display: block;\n}\n\n:host {\n display: flex;\n flex-direction: row;\n width: fit-content;\n min-width: min-content;\n border: var(--ic-border-width) solid var(--ic-toggle-button-unselected-border);\n border-radius: var(--ic-border-radius);\n}\n\n:host(.ic-toggle-button-group-full-width) {\n width: 100%;\n max-width: 100%;\n}\n\n:host(.ic-toggle-button-group-loading) {\n min-width: max-content;\n}\n\n:host(:focus) {\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-transition-duration-fast);\n outline: none;\n}\n\n/* CHILDREN SLOTTED */\n\n::slotted(ic-toggle-button) {\n flex-grow: 1;\n width: min-content;\n\n --toggle-button-border: none !important;\n --toggle-button-border-hover: none !important;\n --toggle-button-border-active: none !important;\n}\n\n::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border);\n}\n\n/* DISABLED */\n:host(.ic-toggle-button-group-disabled) {\n border: var(--ic-space-1px) dashed\n var(--ic-toggle-button-unselected-border-disabled);\n pointer-events: none;\n}\n\n:host(.ic-toggle-button-group-disabled)\n ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-space-1px) dashed\n var(--ic-toggle-button-unselected-border-disabled);\n}\n\n:host(.ic-toggle-button-group-monochrome) {\n border: var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-monochrome);\n}\n\n:host(.ic-toggle-button-group-monochrome)\n ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-monochrome);\n}\n\n:host(.ic-toggle-button-group-disabled.ic-toggle-button-group-monochrome) {\n border: var(--ic-border-width) dashed\n var(--ic-toggle-button-unselected-border-disabled-monochrome);\n}\n\n:host(.ic-toggle-button-group-disabled.ic-toggle-button-group-monochrome)\n ::slotted(ic-toggle-button:not(:last-of-type)) {\n border-right: var(--ic-border-width) solid\n var(--ic-toggle-button-unselected-border-disabled-monochrome);\n}\n\n:host(.ic-toggle-button-group-hide-outline) {\n --ic-toggle-button-unselected-border: transparent;\n --ic-toggle-button-unselected-border-disabled: transparent;\n --ic-toggle-button-unselected-border-monochrome: transparent;\n --ic-toggle-button-unselected-border-disabled-monochrome: transparent;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Listen,\n Element,\n Event,\n EventEmitter,\n State,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcSizes,\n IcSelectTypes,\n IcSelectMethodTypes,\n IcThemeMode,\n IcButtonTooltipPlacement,\n IcIconPlacementOptions,\n} from \"../../utils/types\";\nimport { IcChangeEventDetail } from \"./ic-toggle-button-group.types\";\nimport { removeDisabledFalse } from \"../../utils/helpers\";\n\ninterface lastKey {\n key: string | null;\n shift: boolean;\n}\n\nconst TOGGLE_GROUP = \"IC-TOGGLE-BUTTON-GROUP\";\n\n@Component({\n tag: \"ic-toggle-button-group\",\n styleUrl: \"ic-toggle-button-group.css\",\n shadow: true,\n})\nexport class ToggleButtonGroup {\n @Element() el: HTMLIcToggleButtonGroupElement;\n\n @State() lastKeyPressed: lastKey = {\n key: null,\n shift: false,\n };\n\n /**\n * The accessible label of the toggle button group component to provide context for screen reader users.\n */\n @Prop() accessibleLabel = \"Toggle button group\";\n\n /**\n * If `true`, the toggle button group will be set to the disabled state.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.disabled = this.disabled;\n });\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * If `true`, the toggle button group will fill the width of the container.\n */\n @Prop() fullWidth = false;\n @Watch(\"fullWidth\")\n watchFullWidthHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.fullWidth = this.fullWidth;\n });\n }\n\n /**\n * The placement of the icons in relation to the toggle button labels.\n */\n @Prop() iconPlacement?: IcIconPlacementOptions;\n\n /**\n * If `true`, the toggle button group will be in loading state.\n */\n @Prop() loading = false;\n @Watch(\"loading\")\n watchLoadingHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.loading = this.loading;\n });\n }\n\n /**\n * If `true`, the toggle button group will display as black in the light theme, and white in dark theme.\n */\n @Prop() monochrome = false;\n @Watch(\"monochrome\")\n watchMonochromeHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.monochrome = this.monochrome;\n });\n }\n\n /**\n * If `true`, the toggle button group will display with an outline.\n */\n @Prop() outline = true;\n @Watch(\"outline\")\n watchOutlineHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.outline = this.outline;\n });\n }\n\n /**\n * If `auto`, controls are toggled automatically when navigated to. If `manual`, the controls must be actioned to change their toggled state. The value of this prop is ignored if `selectType` is set to`multi`.\n */\n @Prop({ mutable: true }) selectMethod: IcSelectMethodTypes = \"manual\";\n\n /**\n * Sets whether single or multiple options can be toggled. If `multi`, then the `selectMethod` is always `manual`.\n */\n @Prop() selectType: IcSelectTypes = \"single\";\n\n /**\n * The size of the toggle buttons to be displayed. This does not affect the font size of the accessible label.\n */\n @Prop() size: IcSizes = \"medium\";\n @Watch(\"size\")\n watchSizeHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.size = this.size;\n });\n }\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n @Watch(\"theme\")\n watchThemeHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.theme = this.theme;\n });\n }\n\n /**\n * The position of the tooltip in relation to the toggle buttons.\n */\n @Prop() tooltipPlacement: IcButtonTooltipPlacement = \"bottom\";\n @Watch(\"tooltipPlacement\")\n watchTooltipPlacementHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.tooltipPlacement = this.tooltipPlacement;\n });\n }\n\n /**\n * The variant of the toggle button.\n */\n @Prop({ reflect: true }) variant: \"default\" | \"icon\" = \"default\";\n @Watch(\"variant\")\n watchVariantHandler(): void {\n this.getAllToggleButtons().forEach((el) => {\n el.variant = this.variant;\n });\n }\n\n /**\n * Emitted when a toggle button is selected.\n */\n @Event() icChange: EventEmitter<IcChangeEventDetail>;\n\n @Listen(\"icToggleChecked\")\n selectHandler(ev: CustomEvent, tabTarget?: HTMLIcToggleButtonElement): void {\n const allToggles = this.getAllToggleButtons();\n let clickedToggle = ev.target as HTMLIcToggleButtonElement;\n\n if (tabTarget) tabTarget.focus(); // tabTarget used in proxySelectHandler\n\n if (this.selectType === \"single\") {\n if (!clickedToggle && tabTarget) {\n clickedToggle = tabTarget;\n }\n allToggles.forEach((el) => {\n if (el.id !== clickedToggle.id && el.checked) {\n el.checked = false;\n }\n });\n\n this.icChange.emit({\n checked: ev.detail.checked,\n selectedOption: clickedToggle,\n });\n } else {\n const toggledOptions = allToggles.filter(\n (el) => el.checked && !el.disabled\n );\n\n this.icChange.emit({\n checked: toggledOptions.map((opt) => opt.checked),\n toggledOptions: toggledOptions.map((opt) => ({\n toggleButton: opt,\n })),\n selectedOption: clickedToggle,\n });\n }\n }\n\n componentWillLoad(): void {\n if (this.selectType === \"multi\") this.selectMethod = \"manual\";\n if (this.selectMethod === \"auto\") this.selectType === \"single\";\n document.addEventListener(\"keydown\", this.keyListener);\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n this.getAllToggleButtons().forEach((el, i) => {\n const btn = el.shadowRoot\n ?.querySelector(\"ic-button\")\n ?.shadowRoot?.querySelector(\"button\");\n if (btn) {\n const btnAriaLabel = btn.getAttribute(\"aria-label\");\n const aria = btnAriaLabel ? `${btnAriaLabel}, ` : \"\";\n btn.setAttribute(\"aria-label\", `${aria}${this.accessibleLabel}`);\n }\n\n el.id = i.toString();\n el.tabIndex = -1;\n el.addEventListener(\"keydown\", (ev) => {\n this.handleKeyDown(ev);\n });\n el.classList.add(\"expand-toggle-group-child\");\n });\n }\n\n disconnectedCallback(): void {\n document?.removeEventListener(\"keydown\", this.keyListener);\n }\n\n private keyListener = (ev: KeyboardEvent) => {\n this.lastKeyPressed = {\n key: ev.key,\n shift: ev.shiftKey,\n };\n };\n\n private handleHostFocus = ({ target, relatedTarget }: FocusEvent) => {\n if (this.disabled) {\n (target as HTMLElement)?.blur();\n return;\n }\n if (this.loading) return;\n const el = target as HTMLIcToggleButtonGroupElement | null;\n const relEl = relatedTarget as HTMLIcToggleButtonElement | null;\n const toggleButtons = Array.from(\n el?.querySelectorAll(\"ic-toggle-button\") || []\n );\n const noToggleButtonsChecked = toggleButtons.every((el) => !el.checked);\n const { shift } = this.lastKeyPressed;\n if (\n ((noToggleButtonsChecked || this.selectType !== \"single\") && !shift) ||\n (noToggleButtonsChecked && shift && relEl?.tagName == TOGGLE_GROUP)\n ) {\n toggleButtons[0]?.focus();\n } else if (!shift || relEl?.tagName == TOGGLE_GROUP) {\n // if checked is true and selectMethod is \"single\", focus that toggle\n toggleButtons.filter((el) => el.checked)[0].focus();\n }\n };\n\n private handleKeyDown = ({ key }: KeyboardEvent) => {\n if (\n key !== \"ArrowDown\" &&\n key !== \"ArrowRight\" &&\n key !== \"ArrowLeft\" &&\n key !== \"ArrowUp\"\n )\n return;\n\n const toggleButtonOptions = this.getAllToggleButtons();\n const targetToggle =\n toggleButtonOptions[\n this.getNextItemToSelect(\n toggleButtonOptions.indexOf(\n toggleButtonOptions.filter((el) => el === document.activeElement)[0]\n ),\n key === \"ArrowDown\" || key === \"ArrowRight\"\n )\n ];\n\n if (this.selectMethod === \"auto\") {\n // trigger selectHandler when unable to add 'target'\n targetToggle.checked = true;\n this.selectHandler(\n new CustomEvent(\"icToggleChecked\", {\n detail: {\n checked: targetToggle.checked,\n },\n }),\n targetToggle\n );\n } else {\n targetToggle.focus();\n }\n };\n\n private getNextItemToSelect = (currentItem: number, movingDown: boolean) => {\n const toggleButtonOptions = this.getAllToggleButtons();\n const numToggles = toggleButtonOptions.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n if (nextItem < 0) {\n nextItem = numToggles;\n } else if (nextItem > numToggles) {\n nextItem = 0;\n }\n\n if (toggleButtonOptions[nextItem].disabled) {\n nextItem = this.getNextItemToSelect(nextItem, movingDown);\n }\n\n return nextItem;\n };\n\n private getAllToggleButtons = () =>\n Array.from(this.el.querySelectorAll(\"ic-toggle-button\"));\n\n render() {\n const {\n accessibleLabel,\n disabled,\n fullWidth,\n loading,\n monochrome,\n outline,\n theme,\n } = this;\n\n return (\n <Host\n role=\"group\"\n aria-label={accessibleLabel}\n tabindex={disabled ? -1 : 0}\n class={{\n \"ic-toggle-button-group-disabled\": disabled,\n \"ic-toggle-button-group-full-width\": fullWidth,\n \"ic-toggle-button-group-loading\": loading,\n \"ic-toggle-button-group-monochrome\": monochrome,\n \"ic-toggle-button-group-hide-outline\": !outline,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n onFocus={this.handleHostFocus}\n >\n <slot></slot>\n </Host>\n );\n }\n}\n"],"mappings":"uHAAA,MAAMA,EAAyB,sjJAC/B,MAAAC,EAAeD,EC2Bf,MAAME,EAAe,yB,MAORC,EAAiB,MAL9B,WAAAC,CAAAC,G,6CAQWC,KAAAC,eAA0B,CACjCC,IAAK,KACLC,MAAO,OAMDH,KAAAI,gBAAkB,sBAKlBJ,KAAAK,SAAW,MAYXL,KAAAM,UAAY,MAgBZN,KAAAO,QAAU,MAWVP,KAAAQ,WAAa,MAWbR,KAAAS,QAAU,KAWOT,KAAAU,aAAoC,SAKrDV,KAAAW,WAA4B,SAK5BX,KAAAY,KAAgB,SAWhBZ,KAAAa,MAAqB,UAWrBb,KAAAc,iBAA6C,SAW5Bd,KAAAe,QAA8B,UAgF/Cf,KAAAgB,YAAeC,IACrBjB,KAAKC,eAAiB,CACpBC,IAAKe,EAAGf,IACRC,MAAOc,EAAGC,SACX,EAGKlB,KAAAmB,gBAAkB,EAAGC,SAAQC,oB,MACnC,GAAIrB,KAAKK,SAAU,CAChBe,IAAsB,MAAtBA,SAAM,SAANA,EAAwBE,OACzB,M,CAEF,GAAItB,KAAKO,QAAS,OAClB,MAAMgB,EAAKH,EACX,MAAMI,EAAQH,EACd,MAAMI,EAAgBC,MAAMC,MAC1BJ,IAAE,MAA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J,OACE8F,EAACC,EAAI,CAAA7F,IAAA,2CACH8F,KAAK,QAAO,aACA5F,EACZ6F,SAAU5F,GAAY,EAAI,EAC1B6F,MAAO,CACL,kCAAmC7F,EACnC,oCAAqCC,EACrC,iCAAkCC,EAClC,oCAAqCC,EACrC,uCAAwCC,EACxC,CAAC,YAAYI,KAAUA,IAAU,WAEnCsF,QAASnG,KAAKmB,iBAEd2E,EAAA,QAAA5F,IAAA,6C","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,H as s,g as a}from"./p-8e4e97b4.js";import{A as r,B as h,C as o,r as n,E as l,o as c,q as d,m as u}from"./p-a5658054.js";import"./p-bddf799a.js";const b=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.8327 5.34199L14.6577 4.16699L9.99935 8.82533L5.34102 4.16699L4.16602 5.34199L8.82435 10.0003L4.16602 14.6587L5.34102 15.8337L9.99935 11.1753L14.6577 15.8337L15.8327 14.6587L11.1743 10.0003L15.8327 5.34199Z" fill="currentColor"/>\n</svg>\n`;const p=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">\n <path d="M13.1292 11.8792H12.4708L12.2375 11.6542C13.0542 10.7042 13.5458 9.47083 13.5458 8.12916C13.5458 5.13749 11.1208 2.71249 8.12916 2.71249C5.13749 2.71249 2.71249 5.13749 2.71249 8.12916C2.71249 11.1208 5.13749 13.5458 8.12916 13.5458C9.47083 13.5458 10.7042 13.0542 11.6542 12.2375L11.8792 12.4708V13.1292L16.0458 17.2875L17.2875 16.0458L13.1292 11.8792ZM8.12916 11.8792C6.05416 11.8792 4.37916 10.2042 4.37916 8.12916C4.37916 6.05416 6.05416 4.37916 8.12916 4.37916C10.2042 4.37916 11.8792 6.05416 11.8792 8.12916C11.8792 10.2042 10.2042 11.8792 8.12916 11.8792Z" fill="currentColor"/>\n</svg>`;const f='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host(.ic-search-bar-search){display:block;--divider-height:1.5rem;--ic-input-label-helpertext-padding:var(--ic-space-xs);--border-color:var(--ic-search-bar-outline);--input-bg-color:var(--ic-search-bar-background);--border-color-disabled:var(--ic-search-bar-outline-disabled);--menu-item-text-color:var(--ic-search-bar-dropdown-option-text);--menu-item-desc-text-color:var(--ic-search-bar-dropdown-option-description);--menu-bg-color:var(--ic-search-bar-dropdown-background);--menu-border-color:var(--ic-search-bar-dropdown-outline)}:host(.ic-search-bar-disabled){--ic-input-label-text-color:var(--ic-search-bar-label-disabled);--ic-input-label-helper-text-color:var(--ic-search-bar-subtitle-disabled)}:host(.ic-search-bar-search:hover){--border-color:var(--ic-search-bar-outline-hover)}:host(.ic-search-bar-search:active){--border-color:var(--ic-search-bar-outline-pressed)}:host(.ic-search-bar-search.ic-search-bar-small){--divider-height:1rem}:host(.ic-search-bar-full-width){width:100%}::-moz-placeholder{color:var(--ic-search-bar-placeholder-text);opacity:1}::placeholder{color:var(--ic-search-bar-placeholder-text);opacity:1}input{border:0;border-radius:var(--ic-border-radius);color:var(--ic-search-bar-filled-text);background-color:var(--input-bg-color);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs);caret-color:var(--ic-search-bar-filled-text-cursor)}input:focus{border:0;outline:0}input:disabled::-moz-placeholder{color:var(--ic-search-bar-disabled-text)}input:disabled,input:disabled::placeholder{color:var(--ic-search-bar-disabled-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.no-left-pad{padding-left:0}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-results-button,input[type="search"]::-webkit-search-results-decoration{display:none}input[type="search"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.clear-button-container{align-items:center;margin-right:var(--ic-space-1px);display:none;visibility:hidden}.clear-button{border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus,.clear-button:active{background-color:var(--ic-color-focus-inner);box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer);border-radius:0.25rem}.clear-button-unfocused *{fill:var(--ic-search-bar-clear-button)}.clear-button:focus,.clear-button:active *{fill:var(--ic-atoms-input-clear-button-focus)}.clear-button-visible{visibility:visible;display:flex}.search-submit-button-container{display:flex;align-items:center}.search-submit-button-unfocused *{fill:var(--ic-search-bar-filled-icon)}.search-submit-button-disabled *{fill:var(--ic-search-bar-icon-disabled)}.search-submit-button-disabled .ic-tooltip-container{display:none !important}.search-submit-button:focus,.search-submit-button:active{background-color:var(--ic-color-focus-inner) !important;box-shadow:inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;border-radius:var(--ic-space-xxs)}.search-submit-button:focus,.search-submit-button:active *{fill:white}.divider{width:var(--ic-border-width);background-color:var(--ic-search-bar-dropdown-divider);height:var(--divider-height)}.menu-container{width:var(--input-width, 20rem);position:relative;top:var(--ic-space-xxxs)}.menu-container.fullwidth{width:100%}.no-results{cursor:not-allowed}.search-results-status{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);margin-bottom:calc(-1 * var(--ic-space-1px));margin-right:calc(-1 * var(--ic-space-1px));overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}@media (forced-colors: active){.search-submit-button-unfocused *{fill:canvastext}.search-submit-button-disabled *{fill:GrayText}}';const m=f;let v=0;const g=class{constructor(e){t(this,e);this.icChange=i(this,"icChange",7);this.icClear=i(this,"icClear",7);this.icInput=i(this,"icInput",7);this.icOptionSelect=i(this,"icOptionSelect",7);this.icMenuChange=i(this,"icMenuChange",7);this.icClearBlur=i(this,"icClearBlur",7);this.icRetryLoad=i(this,"icRetryLoad",7);this.icSubmitSearch=i(this,"icSubmitSearch",7);this.icSubmitSearchBlur=i(this,"icSubmitSearchBlur",7);this.icSearchBarBlur=i(this,"icSearchBarBlur",7);this.icSearchBarFocus=i(this,"icSearchBarFocus",7);this.icKeydown=i(this,"icKeydown",7);this.hasTimedOut=false;this.inputId=`ic-search-bar-input-${v++}`;this.menuCloseFromMenuChangeEvent=false;this.menuId=`${this.inputId}-menu`;this.preLoad=true;this.preventSubmit=false;this.prevNoOption=false;this.retryButtonClick=false;this.retryViaKeyPress=false;this.truncateValue=false;this.clearButtonFocused=false;this.open=false;this.searchSubmitFocused=false;this.showClearButton=false;this.autocapitalize="off";this.autocomplete="off";this.autocorrect="off";this.autofocus=false;this.charactersUntilSuggestion=2;this.disabled=false;this.disableAutoFiltering=false;this.debounce=0;this.emptyOptionListText="No results found";this.focusOnLoad=false;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.assistiveHintText="When autocomplete results are available use the up and down arrows to choose and press enter to select";this.labelField="label";this.loading=false;this.loadingErrorLabel="Loading Error";this.loadingLabel="Loading...";this.name=this.inputId;this.placeholder="Search";this.preventFormSubmitOnSearch=false;this.readonly=false;this.required=false;this.searchMode="navigation";this.size="medium";this.spellcheck=false;this.theme="inherit";this.valueField="value";this.filteredOptions=[];this.options=[];this.value="";this.handleClear=t=>{var i;const e=t;const s=t;if(s.type==="click"||e.code==="Enter"||e.code==="Space"){this.value="";(i=this.inputEl)===null||i===void 0?void 0:i.setAttribute("value","");this.loading=false;clearTimeout(this.timeoutTimer);this.filteredOptions=this.options;this.showMenuWithNoInput()&&this.setMenuChange(true);this.el.setFocus();this.icClear.emit();t.preventDefault();this.preventSubmit=true}};this.onInput=({target:t})=>{this.value=t.value;this.icInput.emit({value:this.value});if(this.options.length>0){this.setMenuChange(true);this.preLoad=false;if(this.disableAutoFiltering===false){const t=r(this.options,false,this.value,"anywhere",this.labelField);this.filteredOptions=t.length>0?t:[{[this.labelField]:this.emptyOptionListText,[this.valueField]:""}]}}if(!this.showClearButton)this.showClearButton=true;this.debounceAriaLiveUpdate()};this.onInputBlur=({target:t,relatedTarget:i})=>{this.icSearchBarBlur.emit({value:t.value,relatedTarget:i})};this.onInputFocus=({target:t})=>{this.icSearchBarFocus.emit({value:t.value});this.showClearButton=true};this.handleClearBlur=({relatedTarget:t})=>{this.icClearBlur.emit({relatedTarget:t});this.clearButtonFocused=false};this.handleSubmitSearchBlur=({relatedTarget:t})=>{this.icSubmitSearchBlur.emit({relatedTarget:t});this.searchSubmitFocused=false};this.setInputValue=t=>{if(this.inputEl){const i=h(t,this.options,this.valueField,this.labelField);if(i)this.inputEl.value=i;else if(this.inputEl.value!==t){this.inputEl.value=t}}};this.handleMouseDown=t=>{t.preventDefault()};this.handleSubmitSearchFocus=()=>{this.searchSubmitFocused=true};this.handleSubmitSearch=()=>{if(this.highlightedValue)this.value=this.highlightedValue;this.highlightedValue=undefined;this.icSubmitSearch.emit({value:this.value});const t=this.el.closest("FORM");if(this.searchSubmitButton&&!!t&&!this.preventSubmit){o(t,this.searchSubmitButton)}};this.handleSubmitSearchKeyDown=t=>{if(t.key===" "){t.preventDefault();this.handleSubmitSearch()}};this.handleRetry=t=>{this.retryViaKeyPress=t.detail.keyPressed==="Enter";this.icRetryLoad.emit({value:t.detail.value});this.triggerLoading();this.retryButtonClick=true};this.triggerLoading=()=>{const t=[{[this.labelField]:this.loadingLabel,[this.valueField]:"",loading:true}];if(this.filteredOptions!==t)this.filteredOptions=t;if(this.timeout){this.timeoutTimer=window.setTimeout((()=>{this.filteredOptions=[{[this.labelField]:this.loadingErrorLabel,[this.valueField]:"",timedOut:true}]}),this.timeout)}};this.handleOptionSelect=t=>{if(t.detail.label===this.emptyOptionListText){this.el.setFocus();return}this.value=t.detail.value;this.icOptionSelect.emit({value:this.value})};this.handleMenuOptionHighlight=t=>{const{optionId:i}=t.detail;if(i)this.highlightedValue=i.replace(`${this.menuId}-`,"");this.ariaActiveDescendant=i||""};this.handleMenuChange=t=>{this.setMenuChange(t.detail.open);if(!t.detail.open){this.menuCloseFromMenuChangeEvent=true}};this.setMenuChange=t=>{if(this.open!==t){this.open=t;this.icMenuChange.emit({open:t})}};this.handleHostFocus=()=>{if(this.options&&(this.value||this.showMenuWithNoInput())&&!this.menuCloseFromMenuChangeEvent){this.setMenuChange(true)}this.truncateValue=false;this.showMenuWithNoInput()&&this.debounceAriaLiveUpdate();this.icSearchBarFocus.emit()};this.handleHostBlur=({relatedTarget:t})=>{var i;if(this.open&&this.options&&t!==this.menu&&!this.retryViaKeyPress&&!this.retryButtonClick){this.setMenuChange(false)}if(this.retryButtonClick||this.retryViaKeyPress){(i=this.inputEl)===null||i===void 0?void 0:i.focus()}this.showClearButton=false;this.menuCloseFromMenuChangeEvent=false;this.truncateValue=true;this.icSearchBarBlur.emit({relatedTarget:t,value:this.value});this.retryViaKeyPress=false;this.retryButtonClick=false;this.showMenuWithNoInput()&&this.updateSearchResultAriaLive()};this.handleFocusClearButton=()=>{this.clearButtonFocused=true};this.renderAssistiveHintEl=()=>{var t,i;const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(`#${this.inputId}`);if(e&&Object.keys(e).length>0&&this.hasOptionsOrFilterDisabled()){this.assistiveHintEl=document.createElement("span");this.assistiveHintEl.innerText=this.assistiveHintText;this.assistiveHintEl.id=`${this.inputId}-assistive-hint`;this.assistiveHintEl.style.display="none";(i=e.after)===null||i===void 0?void 0:i.call(e,this.assistiveHintEl)}};this.updateSearchResultAriaLive=()=>{var t;const i=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(".search-results-status");if(i){if(!this.open||this.value===""&&!this.showMenuWithNoInput()||this.value.length<this.charactersUntilSuggestion){i.innerText=""}else if(this.hasOptionsOrFilterDisabled()&&this.filteredOptions.length>0&&this.open&&!this.filteredOptions[0].loading){i.innerText=this.hadNoOptions()?this.emptyOptionListText:`${this.filteredOptions.length} result${this.filteredOptions.length>1?"s":""} available`}}};this.hasOptionsOrFilterDisabled=()=>this.options.length>0||this.disableAutoFiltering;this.hadNoOptions=()=>this.filteredOptions.length===1&&this.filteredOptions[0][this.labelField]===this.emptyOptionListText&&this.searchMode==="navigation";this.isSubmitDisabled=()=>!this.value||this.value.length<this.charactersUntilSuggestion||this.disabled||this.hadNoOptions()||this.hasTimedOut||this.loading;this.showMenuWithNoInput=()=>this.charactersUntilSuggestion===0;this.updateSearchButtonType=()=>{this.searchButtonType=!!this.el.closest("FORM")&&!this.preventFormSubmitOnSearch?"submit":"button"}}watchCharactersUntilSuggestionHandler(){if(this.showMenuWithNoInput()){this.filteredOptions=this.options}}watchDisabledHandler(){n(this.disabled,this.el)}debounceChanged(){this.icChange=l(this.icChange,this.debounce)}loadingHandler(t){if(t&&!this.hasTimedOut){this.preLoad=false;this.triggerLoading()}}preventFormSubmitOnSearchHandler(){this.updateSearchButtonType()}filteredOptionsHandler(t){this.hasTimedOut=t.some((t=>t.timedOut))}watchOptionsHandler(t){if(this.disableAutoFiltering){if(!this.hasTimedOut){this.loading=false;clearTimeout(this.timeoutTimer);if(t.length>0){this.filteredOptions=t}else{if(this.hadNoOptions()){return}this.setMenuChange(true);if(!this.preLoad){this.filteredOptions=[{[this.labelField]:this.emptyOptionListText,[this.valueField]:""}]}this.preLoad=true}}}else if(this.showMenuWithNoInput()){this.filteredOptions=t}this.debounceAriaLiveUpdate()}watchValueHandler(t){this.setInputValue(t);this.icChange.emit({value:t})}connectedCallback(){this.debounceChanged()}disconnectedCallback(){var t;(t=this.assistiveHintEl)===null||t===void 0?void 0:t.remove()}componentWillLoad(){this.setInputValue(this.value);n(this.disabled,this.el);this.updateSearchButtonType()}componentDidLoad(){if(this.focusOnLoad){this.el.setFocus()}if(this.hasOptionsOrFilterDisabled()){this.renderAssistiveHintEl();if(this.disableAutoFiltering||this.showMenuWithNoInput()){this.filteredOptions=this.options}}c([{prop:this.label,propName:"label"}],"Search Bar")}componentWillRender(){if(this.prevNoOption&&this.menu&&!this.hasTimedOut){this.menu.handleSetFirstOption();this.prevNoOption=false}if(this.filteredOptions.find((t=>t[this.labelField]===this.emptyOptionListText||t[this.labelField]===this.loadingErrorLabel||t[this.labelField]===this.loadingLabel))){this.prevNoOption=true}}handleKeyDown(t){this.icKeydown.emit({event:t});if(this.menu&&this.open){this.menu.handleKeyboardOpen(t)}}handleKeyUp(t){if(t.key==="Enter"){if(this.preventSubmit||this.isSubmitDisabled()){return}this.handleSubmitSearch();this.setMenuChange(false)}if(t.key==="Escape"){this.setMenuChange(false)}if(this.preventSubmit){this.preventSubmit=false}}async setFocus(){var t;this.retryViaKeyPress=false;this.retryButtonClick=false;(t=this.inputEl)===null||t===void 0?void 0:t.focus()}debounceAriaLiveUpdate(){clearTimeout(this.debounceAriaLive);this.debounceAriaLive=window.setTimeout((()=>{this.updateSearchResultAriaLive()}),500)}render(){const{inputId:t,name:i,label:a,required:r,size:o,placeholder:n,helperText:l,disabled:c,value:f,readonly:m,spellcheck:v,fullWidth:g,options:w,open:y,hideLabel:x,menuId:k,ariaActiveDescendant:L,truncateValue:z,autofocus:C,autocapitalize:S,autocomplete:T,filteredOptions:B,theme:F,charactersUntilSuggestion:H,labelField:O,valueField:M,loadingLabel:$,loadingErrorLabel:E,searchMode:D,showClearButton:I,searchSubmitFocused:j,clearButtonFocused:q,searchButtonType:U}=this;const W=m||c;const K=d(this.el,t,l!=="",false).trim();let R=undefined;if(K!==""&&this.hasOptionsOrFilterDisabled()){R=`${K} ${t}-assistive-hint`}else if(this.hasOptionsOrFilterDisabled()){R=`${t}-assistive-hint`}else if(K!==""){R=K}const V=(!!f||this.showMenuWithNoInput())&&this.hasOptionsOrFilterDisabled();const A=V&&y&&B.length>0;const Z=A&&f.length>=H;const N=h(f,w,M,O);u(this.el,f,i,W);return e(s,{key:"71d9a6e7a555373e98a3ee7ea114fc1f69f06570",class:{"ic-search-bar-search":true,"ic-search-bar-full-width":g,"ic-search-bar-disabled":c,"ic-search-bar-small":o==="small",[`ic-theme-${F}`]:F!=="inherit"},onFocus:this.handleHostFocus,onBlur:this.handleHostBlur},e("ic-input-container",{key:"23dfe2a04d5c039174366f85fa42df074fd30c98",readonly:m,disabled:W},!x&&e("ic-input-label",{key:"1c222b2269cbab7436dc225b75e09568d323a1f0",for:t,label:a,helperText:l,required:r,disabled:W&&!m,readonly:m},e("slot",{key:"e38a00e300ddc76daaf3c52332adab4ac16038c4",name:"helper-text",slot:"helper-text"})),e("ic-input-component-container",{key:"17dff32cab5a5b34673c1255f0a1d696b9df84b4",ref:t=>this.anchorEl=t,size:o,disabled:W,readonly:m,fullWidth:g},e("input",{key:"e5d666c8a1609a1683b735940afd707e67b7eaa6",id:t,name:i,ref:t=>this.inputEl=t,value:w&&!!N?N:f,class:{"no-left-pad":m,readonly:m,"truncate-value":z},placeholder:n,required:r,disabled:W,readonly:m,onInput:this.onInput,onBlur:this.onInputBlur,onFocus:this.onInputFocus,"aria-label":x?a:undefined,"aria-activedescendant":L,"aria-expanded":w.length>0&&Z?`${A}`:undefined,"aria-owns":Z?k:undefined,"aria-describedby":R,"aria-controls":Z?k:undefined,"aria-haspopup":w.length>0?"listbox":undefined,"aria-autocomplete":V?"list":undefined,role:w.length>0&&Z?"combobox":undefined,autocomplete:T,autocapitalize:S,autoFocus:C,spellcheck:v,inputmode:"search"}),e("div",{key:"98887c2626a05e3ddc15c7ddad3a756262c197e8",class:{"clear-button-container":true,"clear-button-visible":!!f&&!W&&I}},e("ic-button",{key:"119b7ae17e8c7cbd8a56e6bd8136340c269958e3",id:"clear-button",class:{"clear-button":true,"clear-button-unfocused":!q},"aria-label":"Clear",innerHTML:b,onClick:this.handleClear,onMouseDown:this.handleMouseDown,size:o,onFocus:this.handleFocusClearButton,onBlur:this.handleClearBlur,onKeyDown:this.handleClear,type:"button",variant:"icon-tertiary",theme:q?"light":"dark"}),e("div",{key:"bf3e848c1e275217c686f3aab3b10a09396d6b4e",class:"divider"})),e("div",{key:"4075cd96e0274043b8da4e25d32a5cee5d4bb0e5",class:{"search-submit-button-container":true,"search-submit-button-disabled":this.isSubmitDisabled()}},e("ic-button",{key:"77e1e8bfef4ce5304dbf877b5ecfc440d37d864c",id:"search-submit-button","aria-label":"Search",ref:t=>this.searchSubmitButton=t,class:{"search-submit-button":true,"search-submit-button-small":o==="small","search-submit-button-unfocused":!j,"search-submit-button-disabled":this.isSubmitDisabled()},disabled:this.isSubmitDisabled(),innerHTML:p,size:o,onClick:this.handleSubmitSearch,onMouseDown:this.handleMouseDown,onBlur:this.handleSubmitSearchBlur,onFocus:this.handleSubmitSearchFocus,onKeyDown:this.handleSubmitSearchKeyDown,type:U,variant:"icon-tertiary",theme:j?"light":"dark"}))),e("div",{key:"20e98815de9ec0c35fa247026de3d9e273161ea6",class:{"menu-container":true,fullwidth:g}},Z&&this.anchorEl&&this.inputEl&&e("ic-menu",{key:"b2f7d74335c27d93e9f5dc5b63bab80daeb3eeae",class:{"no-results":this.hadNoOptions()||B.length===1&&(B[0][O]===$||B[0][O]===E)},activationType:"manual",anchorEl:this.anchorEl,autofocusOnSelected:false,searchMode:D,inputEl:this.inputEl,inputLabel:a,ref:t=>this.menu=t,fullWidth:g,menuId:k,open:true,options:B,onMenuOptionSelect:this.handleOptionSelect,onMenuStateChange:this.handleMenuChange,onMenuOptionId:this.handleMenuOptionHighlight,onRetryButtonClicked:this.handleRetry,parentEl:this.el,value:f,labelField:O,valueField:M,searchBar:true}))),e("div",{key:"f76306ff99a2c103fdea197759f6036d479dc51f","aria-live":"polite",role:"status",class:"search-results-status"}))}static get delegatesFocus(){return true}get el(){return a(this)}static get watchers(){return{charactersUntilSuggestion:["watchCharactersUntilSuggestionHandler"],disabled:["watchDisabledHandler"],debounce:["debounceChanged"],loading:["loadingHandler"],preventFormSubmitOnSearch:["preventFormSubmitOnSearchHandler"],filteredOptions:["filteredOptionsHandler"],options:["watchOptionsHandler"],value:["watchValueHandler"]}}};g.style=m;export{g as ic_search_bar};
2
- //# sourceMappingURL=p-a5415f6c.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icSearchBarCss","IcSearchBarStyle0","inputIds","SearchBar","constructor","hostRef","this","hasTimedOut","inputId","menuCloseFromMenuChangeEvent","menuId","preLoad","preventSubmit","prevNoOption","retryButtonClick","retryViaKeyPress","truncateValue","clearButtonFocused","open","searchSubmitFocused","showClearButton","autocapitalize","autocomplete","autocorrect","autofocus","charactersUntilSuggestion","disabled","disableAutoFiltering","debounce","emptyOptionListText","focusOnLoad","fullWidth","helperText","hideLabel","assistiveHintText","labelField","loading","loadingErrorLabel","loadingLabel","name","placeholder","preventFormSubmitOnSearch","readonly","required","searchMode","size","spellcheck","theme","valueField","filteredOptions","options","value","handleClear","ev","keyboardEvent","mouseEvent","type","code","_a","inputEl","setAttribute","clearTimeout","timeoutTimer","showMenuWithNoInput","setMenuChange","el","setFocus","icClear","emit","preventDefault","onInput","target","icInput","length","rawFilteredOptions","getFilteredMenuOptions","debounceAriaLiveUpdate","onInputBlur","relatedTarget","icSearchBarBlur","onInputFocus","icSearchBarFocus","handleClearBlur","icClearBlur","handleSubmitSearchBlur","icSubmitSearchBlur","setInputValue","newValue","label","getLabelFromValue","handleMouseDown","handleSubmitSearchFocus","handleSubmitSearch","highlightedValue","undefined","icSubmitSearch","form","closest","searchSubmitButton","handleHiddenFormButtonClick","handleSubmitSearchKeyDown","key","handleRetry","detail","keyPressed","icRetryLoad","triggerLoading","loadingOption","timeout","window","setTimeout","timedOut","handleOptionSelect","icOptionSelect","handleMenuOptionHighlight","optionId","replace","ariaActiveDescendant","handleMenuChange","icMenuChange","handleHostFocus","handleHostBlur","menu","focus","updateSearchResultAriaLive","handleFocusClearButton","renderAssistiveHintEl","input","shadowRoot","querySelector","Object","keys","hasOptionsOrFilterDisabled","assistiveHintEl","document","createElement","innerText","id","style","display","_b","after","call","searchResultsStatusEl","hadNoOptions","isSubmitDisabled","updateSearchButtonType","searchButtonType","watchCharactersUntilSuggestionHandler","watchDisabledHandler","removeDisabledFalse","debounceChanged","icChange","debounceEvent","loadingHandler","preventFormSubmitOnSearchHandler","filteredOptionsHandler","newOptions","some","opt","watchOptionsHandler","watchValueHandler","connectedCallback","disconnectedCallback","remove","componentWillLoad","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentWillRender","handleSetFirstOption","find","filteredOption","handleKeyDown","event","icKeydown","handleKeyboardOpen","handleKeyUp","debounceAriaLive","render","disabledMode","describedBy","getInputDescribedByText","trim","describedById","hasSuggestedSearch","menuOpen","menuRendered","labelValue","renderHiddenInput","h","Host","class","onFocus","onBlur","for","slot","ref","anchorEl","role","autoFocus","inputmode","innerHTML","clearIcon","onClick","onMouseDown","onKeyDown","variant","searchIcon","fullwidth","activationType","autofocusOnSelected","inputLabel","onMenuOptionSelect","onMenuStateChange","onMenuOptionId","onRetryButtonClicked","parentEl","searchBar"],"sources":["src/components/ic-search-bar/ic-search-bar.css?tag=ic-search-bar&encapsulation=shadow","src/components/ic-search-bar/ic-search-bar.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\n/**\n * @prop --ic-z-index-menu: z-index of search bar menu\n */\n\n:host(.ic-search-bar-search) {\n display: block;\n\n --divider-height: 1.5rem;\n --ic-input-label-helpertext-padding: var(--ic-space-xs);\n --border-color: var(--ic-search-bar-outline);\n --input-bg-color: var(--ic-search-bar-background);\n --border-color-disabled: var(--ic-search-bar-outline-disabled);\n --menu-item-text-color: var(--ic-search-bar-dropdown-option-text);\n --menu-item-desc-text-color: var(--ic-search-bar-dropdown-option-description);\n --menu-bg-color: var(--ic-search-bar-dropdown-background);\n --menu-border-color: var(--ic-search-bar-dropdown-outline);\n}\n\n:host(.ic-search-bar-disabled) {\n --ic-input-label-text-color: var(--ic-search-bar-label-disabled);\n --ic-input-label-helper-text-color: var(--ic-search-bar-subtitle-disabled);\n}\n\n:host(.ic-search-bar-search:hover) {\n --border-color: var(--ic-search-bar-outline-hover);\n}\n\n:host(.ic-search-bar-search:active) {\n --border-color: var(--ic-search-bar-outline-pressed);\n}\n\n:host(.ic-search-bar-search.ic-search-bar-small) {\n --divider-height: 1rem;\n}\n\n:host(.ic-search-bar-full-width) {\n width: 100%;\n}\n\n/* Custom Input */\n\n::placeholder {\n color: var(--ic-search-bar-placeholder-text);\n opacity: 1;\n}\n\ninput {\n border: 0;\n border-radius: var(--ic-border-radius);\n color: var(--ic-search-bar-filled-text);\n background-color: var(--input-bg-color);\n line-height: 1.5rem;\n letter-spacing: 0.005rem;\n width: 100%;\n padding-right: var(--ic-space-xs);\n padding-left: var(--ic-space-xs);\n caret-color: var(--ic-search-bar-filled-text-cursor);\n}\n\ninput:focus {\n border: 0;\n outline: 0;\n}\n\ninput:disabled,\ninput:disabled::placeholder {\n color: var(--ic-search-bar-disabled-text);\n}\n\n/* Chrome, Safari, Edge */\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.no-left-pad {\n padding-left: 0;\n}\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n display: none;\n}\n\ninput[type=\"search\"].truncate-value {\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n/* CLEAR */\n\n.clear-button-container {\n align-items: center;\n margin-right: var(--ic-space-1px);\n display: none;\n visibility: hidden;\n}\n\n.clear-button {\n border-radius: var(--ic-border-radius);\n transition: box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);\n}\n\n.clear-button:focus,\n.clear-button:active {\n background-color: var(--ic-color-focus-inner);\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer);\n border-radius: 0.25rem;\n}\n\n.clear-button-unfocused * {\n fill: var(--ic-search-bar-clear-button);\n}\n\n.clear-button:focus,\n.clear-button:active * {\n fill: var(--ic-atoms-input-clear-button-focus);\n}\n\n.clear-button-visible {\n visibility: visible;\n display: flex;\n}\n\n.search-submit-button-container {\n display: flex;\n align-items: center;\n}\n\n.search-submit-button-unfocused * {\n fill: var(--ic-search-bar-filled-icon);\n}\n\n.search-submit-button-disabled * {\n fill: var(--ic-search-bar-icon-disabled);\n}\n\n.search-submit-button-disabled .ic-tooltip-container {\n display: none !important;\n}\n\n.search-submit-button:focus,\n.search-submit-button:active {\n background-color: var(--ic-color-focus-inner) !important;\n box-shadow: inset 0 0 0 0.125rem var(--ic-color-focus-outer) !important;\n border-radius: var(--ic-space-xxs);\n}\n\n.search-submit-button:focus,\n.search-submit-button:active * {\n fill: white;\n}\n\n.divider {\n width: var(--ic-border-width);\n background-color: var(--ic-search-bar-dropdown-divider);\n height: var(--divider-height);\n}\n\n.menu-container {\n width: var(--input-width, 20rem);\n position: relative;\n top: var(--ic-space-xxxs);\n}\n\n.menu-container.fullwidth {\n width: 100%;\n}\n\n.no-results {\n cursor: not-allowed;\n}\n\n.search-results-status {\n border: 0;\n clip: rect(0, 0, 0, 0, 0);\n height: var(--ic-space-1px);\n margin-bottom: calc(-1 * var(--ic-space-1px));\n margin-right: calc(-1 * var(--ic-space-1px));\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: var(--ic-space-1px);\n}\n\n@media (forced-colors: active) {\n .search-submit-button-unfocused * {\n fill: canvastext;\n }\n\n .search-submit-button-disabled * {\n fill: GrayText;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n Method,\n h,\n} from \"@stencil/core\";\n\nimport {\n IcAutocompleteTypes,\n IcAutocorrectStates,\n IcMenuOption,\n IcMultiValueEventDetail,\n IcSizesNoLarge,\n IcThemeMode,\n} from \"../../utils/types\";\nimport {\n getInputDescribedByText,\n renderHiddenInput,\n handleHiddenFormButtonClick,\n getLabelFromValue,\n onComponentRequiredPropUndefined,\n getFilteredMenuOptions,\n removeDisabledFalse,\n debounceEvent,\n} from \"../../utils/helpers\";\nimport {\n IcSearchBarBlurEventDetail,\n IcSearchBarSearchModes,\n} from \"./ic-search-bar.types\";\nimport { IcValueEventDetail, IcBlurEventDetail } from \"../../utils/types\";\nimport {\n IcMenuChangeEventDetail,\n IcMenuOptionIdEventDetail,\n IcOptionSelectEventDetail,\n} from \"../ic-menu/ic-menu.types\";\n\nimport clearIcon from \"../../assets/clear-icon.svg\";\nimport searchIcon from \"../../assets/search-icon.svg\";\nimport { IcButtonTypes } from \"../ic-button/ic-button.types\";\n\nlet inputIds = 0;\n\n/**\n * @slot helper-text - Content is set as the helper text for the search bar.\n */\n@Component({\n tag: \"ic-search-bar\",\n styleUrl: \"ic-search-bar.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport class SearchBar {\n private anchorEl?: HTMLElement;\n private assistiveHintEl?: HTMLSpanElement;\n private debounceAriaLive?: number;\n private hasTimedOut = false;\n private inputEl?: HTMLInputElement;\n private inputId = `ic-search-bar-input-${inputIds++}`;\n private menu?: HTMLIcMenuElement;\n private menuCloseFromMenuChangeEvent = false;\n private menuId = `${this.inputId}-menu`;\n private preLoad = true;\n private preventSubmit = false;\n private prevNoOption = false;\n private retryButtonClick = false;\n private retryViaKeyPress = false;\n private timeoutTimer?: number;\n private truncateValue = false;\n private searchSubmitButton?: HTMLIcButtonElement;\n\n @Element() el: HTMLIcSearchBarElement;\n\n @State() ariaActiveDescendant?: string;\n @State() clearButtonFocused = false;\n @State() highlightedValue?: string;\n @State() open = false;\n @State() searchSubmitFocused = false;\n @State() showClearButton = false;\n\n /**\n * The automatic capitalisation of the text value as it is entered/edited by the user.\n * Available options: \"off\", \"none\", \"on\", \"sentences\", \"words\", \"characters\".\n */\n @Prop() autocapitalize = \"off\";\n\n /**\n * The state of autocompletion the browser can apply on the text value.\n */\n @Prop() autocomplete: IcAutocompleteTypes = \"off\";\n\n /**\n * The state of autocorrection the browser can apply when the user is entering/editing the text value.\n */\n @Prop() autocorrect: IcAutocorrectStates = \"off\";\n\n /**\n * If `true`, the form control will have input focus when the page loads.\n */\n @Prop() autofocus = false;\n\n /**\n * The number of characters until suggestions appear. The submit button will be disabled until the inputted value is equal to or greater than this number.\n */\n @Prop() charactersUntilSuggestion = 2;\n @Watch(\"charactersUntilSuggestion\")\n watchCharactersUntilSuggestionHandler(): void {\n if (this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n }\n\n /**\n * Specify whether to disable the built in filtering. For example, if options will already be filtered from external source.\n * If `true`, all options provided will be displayed.\n */\n @Prop() disableAutoFiltering = false;\n\n /**\n * The amount of time, in milliseconds, to wait to trigger the `icChange` event after each keystroke.\n */\n @Prop() debounce = 0;\n @Watch(\"debounce\")\n private debounceChanged() {\n this.icChange = debounceEvent(this.icChange, this.debounce);\n }\n\n /**\n * The text displayed when there are no options in the option list.\n */\n @Prop() emptyOptionListText = \"No results found\";\n\n /**\n * If `true`, the search bar will be focused when component loaded.\n */\n @Prop() focusOnLoad = false;\n\n /**\n * Specify whether the search bar fills the full width of the container.\n * If `true`, this overrides the --input-width CSS variable.\n */\n @Prop() fullWidth = false;\n\n /**\n * The helper text that will be displayed for additional field guidance.\n */\n @Prop() helperText = \"\";\n\n /**\n * If `true`, the label will be hidden and the required label value will be applied as an aria-label.\n */\n @Prop() hideLabel = false;\n\n /**\n * The hint text for the hidden assistive description element.\n */\n @Prop() assistiveHintText =\n \"When autocomplete results are available use the up and down arrows to choose and press enter to select\";\n\n /**\n * The label for the search bar.\n */\n @Prop() label!: string;\n\n /**\n * The custom name for the label field to correspond with the IcMenuOption type.\n */\n @Prop() labelField = \"label\";\n\n /**\n * Trigger loading state when fetching options asynchronously\n */\n @Prop({ mutable: true }) loading = false;\n @Watch(\"loading\")\n loadingHandler(newValue: boolean): void {\n if (newValue && !this.hasTimedOut) {\n this.preLoad = false;\n this.triggerLoading();\n }\n }\n\n /**\n * Change the message displayed when external loading times out.\n */\n @Prop() loadingErrorLabel = \"Loading Error\";\n\n /**\n * Change the message displayed whilst the options are being loaded externally.\n */\n @Prop() loadingLabel = \"Loading...\";\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name = this.inputId;\n\n /**\n * The placeholder value to display.\n */\n @Prop() placeholder = \"Search\";\n\n /**\n * If `true` the parent form will not submit when the icSubmitSearch event fires.\n */\n @Prop() preventFormSubmitOnSearch = false;\n @State() searchButtonType: IcButtonTypes;\n @Watch(\"preventFormSubmitOnSearch\")\n preventFormSubmitOnSearchHandler(): void {\n this.updateSearchButtonType();\n }\n\n /**\n * If `true`, the readonly state will be set.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the search bar will require a value.\n */\n @Prop() required = false;\n\n /**\n * Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches.\n */\n @Prop() searchMode: IcSearchBarSearchModes = \"navigation\";\n\n /**\n * The size of the search bar component.\n */\n @Prop() size: IcSizesNoLarge = \"medium\";\n\n /**\n * If `true`, the value of the search will have its spelling and grammar checked.\n */\n @Prop() spellcheck = false;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme: IcThemeMode = \"inherit\";\n\n /**\n * If using external filtering, set a timeout for when loading takes too long.\n */\n @Prop() timeout?: number;\n\n /**\n * The custom name for the value field to correspond with the IcMenuOption type.\n */\n @Prop() valueField = \"value\";\n\n @State() filteredOptions: IcMenuOption[] = [];\n @Watch(\"filteredOptions\")\n filteredOptionsHandler(newOptions: IcMenuOption[]): void {\n this.hasTimedOut = newOptions.some((opt) => opt.timedOut);\n }\n\n /**\n * The suggested search options.\n */\n @Prop() options: IcMenuOption[] = [];\n @Watch(\"options\")\n watchOptionsHandler(newOptions: IcMenuOption[]): void {\n if (this.disableAutoFiltering) {\n if (!this.hasTimedOut) {\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n if (newOptions.length > 0) {\n this.filteredOptions = newOptions;\n } else {\n if (this.hadNoOptions()) {\n return;\n }\n this.setMenuChange(true);\n if (!this.preLoad) {\n this.filteredOptions = [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n this.preLoad = true;\n }\n }\n } else if (this.showMenuWithNoInput()) {\n this.filteredOptions = newOptions;\n }\n this.debounceAriaLiveUpdate();\n }\n\n /**\n * The value of the search input.\n */\n @Prop({ reflect: true, mutable: true }) value = \"\";\n @Watch(\"value\")\n watchValueHandler(newValue: string): void {\n this.setInputValue(newValue);\n this.icChange.emit({ value: newValue });\n }\n\n // The icChange event is defined here so that it appears as an event for search bar\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when value is cleared with clear button\n */\n @Event() icClear: EventEmitter<void>;\n private handleClear = (ev: Event) => {\n const keyboardEvent = ev as KeyboardEvent;\n const mouseEvent = ev as MouseEvent;\n\n if (\n mouseEvent.type === \"click\" ||\n keyboardEvent.code === \"Enter\" ||\n keyboardEvent.code === \"Space\"\n ) {\n this.value = \"\";\n this.inputEl?.setAttribute(\"value\", \"\");\n this.loading = false;\n clearTimeout(this.timeoutTimer);\n this.filteredOptions = this.options;\n this.showMenuWithNoInput() && this.setMenuChange(true);\n this.el.setFocus();\n\n this.icClear.emit();\n ev.preventDefault();\n\n this.preventSubmit = true;\n }\n };\n\n // The icInput event is defined here so that it appears as an event for search bar\n /**\n * Emitted when a keyboard input occurred.\n */\n @Event() icInput: EventEmitter<IcValueEventDetail>;\n private onInput = ({ target }: Event) => {\n this.value = (target as HTMLInputElement).value;\n this.icInput.emit({ value: this.value });\n\n if (this.options.length > 0) {\n this.setMenuChange(true);\n\n this.preLoad = false;\n\n if (this.disableAutoFiltering === false) {\n const rawFilteredOptions = getFilteredMenuOptions(\n this.options,\n false,\n this.value,\n \"anywhere\",\n this.labelField\n );\n\n this.filteredOptions =\n rawFilteredOptions.length > 0\n ? rawFilteredOptions\n : [\n {\n [this.labelField]: this.emptyOptionListText,\n [this.valueField]: \"\",\n },\n ];\n }\n }\n\n if (!this.showClearButton) this.showClearButton = true;\n\n this.debounceAriaLiveUpdate();\n };\n\n private onInputBlur = ({ target, relatedTarget }: FocusEvent) => {\n this.icSearchBarBlur.emit({\n value: (target as HTMLInputElement).value,\n relatedTarget,\n });\n };\n\n private onInputFocus = ({ target }: Event) => {\n this.icSearchBarFocus.emit({ value: (target as HTMLInputElement).value });\n\n this.showClearButton = true;\n };\n\n /**\n * Emitted when option is highlighted within the menu\n */\n @Event() icOptionSelect: EventEmitter<IcOptionSelectEventDetail>;\n\n /**\n * Emitted when the state of the menu changes (i.e. open or close)\n */\n @Event() icMenuChange: EventEmitter<IcMenuChangeEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from clear button\n */\n @Event() icClearBlur: EventEmitter<IcBlurEventDetail>;\n private handleClearBlur = ({ relatedTarget }: FocusEvent) => {\n this.icClearBlur.emit({ relatedTarget });\n\n this.clearButtonFocused = false;\n };\n\n /**\n * Emitted when the 'retry loading' button is clicked\n */\n @Event() icRetryLoad: EventEmitter<IcMultiValueEventDetail>;\n\n /**\n * Emitted when the search value has been submitted\n */\n @Event() icSubmitSearch: EventEmitter<IcValueEventDetail>;\n\n /**\n * @internal - Emitted when blur is invoked from search submit button\n */\n @Event() icSubmitSearchBlur: EventEmitter<IcBlurEventDetail>;\n private handleSubmitSearchBlur = ({ relatedTarget }: FocusEvent) => {\n this.icSubmitSearchBlur.emit({ relatedTarget });\n\n this.searchSubmitFocused = false;\n };\n\n /**\n * Emitted when blur is invoked from ic-search-bar\n */\n @Event() icSearchBarBlur: EventEmitter<IcSearchBarBlurEventDetail>;\n\n /**\n * Emitted when focus is invoked from ic-search-bar\n */\n @Event() icSearchBarFocus: EventEmitter<IcValueEventDetail>;\n\n /**\n * Emitted when a keydown event occurred.\n */\n @Event() icKeydown: EventEmitter<{ event: KeyboardEvent }>;\n\n connectedCallback(): void {\n this.debounceChanged();\n }\n\n disconnectedCallback(): void {\n this.assistiveHintEl?.remove();\n }\n\n componentWillLoad(): void {\n this.setInputValue(this.value);\n\n removeDisabledFalse(this.disabled, this.el as HTMLElement);\n\n this.updateSearchButtonType();\n }\n\n componentDidLoad(): void {\n if (this.focusOnLoad) {\n this.el.setFocus();\n }\n\n if (this.hasOptionsOrFilterDisabled()) {\n this.renderAssistiveHintEl();\n if (this.disableAutoFiltering || this.showMenuWithNoInput()) {\n this.filteredOptions = this.options;\n }\n }\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Search Bar\"\n );\n }\n\n componentWillRender(): void {\n if (this.prevNoOption && this.menu && !this.hasTimedOut) {\n this.menu.handleSetFirstOption();\n this.prevNoOption = false;\n }\n if (\n this.filteredOptions.find(\n (filteredOption) =>\n filteredOption[this.labelField] === this.emptyOptionListText ||\n filteredOption[this.labelField] === this.loadingErrorLabel ||\n filteredOption[this.labelField] === this.loadingLabel\n )\n ) {\n this.prevNoOption = true;\n }\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(event: KeyboardEvent): void {\n this.icKeydown.emit({ event });\n if (this.menu && this.open) {\n this.menu.handleKeyboardOpen(event);\n }\n }\n\n @Listen(\"keyup\", {})\n handleKeyUp(ev: KeyboardEvent): void {\n if (ev.key === \"Enter\") {\n if (this.preventSubmit || this.isSubmitDisabled()) {\n return;\n }\n\n this.handleSubmitSearch();\n this.setMenuChange(false);\n }\n\n if (ev.key === \"Escape\") {\n this.setMenuChange(false);\n }\n\n if (this.preventSubmit) {\n this.preventSubmit = false;\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.inputEl?.focus();\n }\n\n private setInputValue = (newValue: string) => {\n if (this.inputEl) {\n const label = getLabelFromValue(\n newValue,\n this.options,\n this.valueField,\n this.labelField\n );\n if (label) this.inputEl.value = label;\n else if (this.inputEl.value !== newValue) {\n this.inputEl.value = newValue;\n }\n }\n };\n\n private handleMouseDown = (ev: Event) => {\n ev.preventDefault();\n };\n\n private handleSubmitSearchFocus = () => {\n this.searchSubmitFocused = true;\n };\n\n private handleSubmitSearch = () => {\n if (this.highlightedValue) this.value = this.highlightedValue;\n this.highlightedValue = undefined;\n this.icSubmitSearch.emit({ value: this.value });\n\n const form = this.el.closest<HTMLFormElement>(\"FORM\");\n\n if (this.searchSubmitButton && !!form && !this.preventSubmit) {\n handleHiddenFormButtonClick(form, this.searchSubmitButton);\n }\n };\n\n private debounceAriaLiveUpdate() {\n clearTimeout(this.debounceAriaLive);\n\n this.debounceAriaLive = window.setTimeout(() => {\n this.updateSearchResultAriaLive();\n }, 500);\n }\n\n private handleSubmitSearchKeyDown = (ev: KeyboardEvent) => {\n if (ev.key === \" \") {\n ev.preventDefault();\n this.handleSubmitSearch();\n }\n };\n\n private handleRetry = (ev: CustomEvent<IcMultiValueEventDetail>) => {\n this.retryViaKeyPress = ev.detail.keyPressed === \"Enter\";\n this.icRetryLoad.emit({ value: ev.detail.value });\n this.triggerLoading();\n this.retryButtonClick = true;\n };\n\n private triggerLoading = () => {\n const loadingOption: IcMenuOption[] = [\n {\n [this.labelField]: this.loadingLabel,\n [this.valueField]: \"\",\n loading: true,\n },\n ];\n if (this.filteredOptions !== loadingOption)\n this.filteredOptions = loadingOption;\n if (this.timeout) {\n this.timeoutTimer = window.setTimeout(() => {\n this.filteredOptions = [\n {\n [this.labelField]: this.loadingErrorLabel,\n [this.valueField]: \"\",\n timedOut: true,\n },\n ];\n }, this.timeout);\n }\n };\n\n private handleOptionSelect = (ev: CustomEvent) => {\n if (ev.detail.label === this.emptyOptionListText) {\n this.el.setFocus();\n return;\n }\n\n this.value = ev.detail.value;\n this.icOptionSelect.emit({ value: this.value });\n };\n\n private handleMenuOptionHighlight = (\n ev: CustomEvent<IcMenuOptionIdEventDetail>\n ) => {\n const { optionId } = ev.detail;\n if (optionId)\n this.highlightedValue = optionId.replace(`${this.menuId}-`, \"\");\n this.ariaActiveDescendant = optionId || \"\";\n };\n\n private handleMenuChange = (ev: CustomEvent<IcMenuChangeEventDetail>) => {\n this.setMenuChange(ev.detail.open);\n if (!ev.detail.open) {\n this.menuCloseFromMenuChangeEvent = true;\n }\n };\n\n private setMenuChange = (open: boolean) => {\n if (this.open !== open) {\n this.open = open;\n this.icMenuChange.emit({ open });\n }\n };\n\n private handleHostFocus = () => {\n if (\n this.options &&\n (this.value || this.showMenuWithNoInput()) &&\n !this.menuCloseFromMenuChangeEvent\n ) {\n this.setMenuChange(true);\n }\n this.truncateValue = false;\n this.showMenuWithNoInput() && this.debounceAriaLiveUpdate();\n\n this.icSearchBarFocus.emit();\n };\n\n private handleHostBlur = ({ relatedTarget }: FocusEvent) => {\n if (\n this.open &&\n this.options &&\n relatedTarget !== this.menu &&\n !this.retryViaKeyPress &&\n !this.retryButtonClick\n ) {\n this.setMenuChange(false);\n }\n\n if (this.retryButtonClick || this.retryViaKeyPress) {\n this.inputEl?.focus();\n }\n\n this.showClearButton = false;\n this.menuCloseFromMenuChangeEvent = false;\n this.truncateValue = true;\n this.icSearchBarBlur.emit({\n relatedTarget,\n value: this.value,\n });\n this.retryViaKeyPress = false;\n this.retryButtonClick = false;\n this.showMenuWithNoInput() && this.updateSearchResultAriaLive();\n };\n\n private handleFocusClearButton = () => {\n this.clearButtonFocused = true;\n };\n\n private renderAssistiveHintEl = () => {\n const input = this.el.shadowRoot?.querySelector(`#${this.inputId}`);\n\n if (\n input &&\n Object.keys(input).length > 0 &&\n this.hasOptionsOrFilterDisabled()\n ) {\n this.assistiveHintEl = document.createElement(\"span\");\n this.assistiveHintEl.innerText = this.assistiveHintText;\n this.assistiveHintEl.id = `${this.inputId}-assistive-hint`;\n this.assistiveHintEl.style.display = \"none\";\n input.after?.(this.assistiveHintEl);\n }\n };\n\n private updateSearchResultAriaLive = () => {\n const searchResultsStatusEl =\n this.el.shadowRoot?.querySelector<HTMLParagraphElement>(\n \".search-results-status\"\n );\n\n if (searchResultsStatusEl) {\n if (\n !this.open ||\n (this.value === \"\" && !this.showMenuWithNoInput()) ||\n this.value.length < this.charactersUntilSuggestion\n ) {\n searchResultsStatusEl.innerText = \"\";\n } else if (\n this.hasOptionsOrFilterDisabled() &&\n this.filteredOptions.length > 0 &&\n this.open &&\n !this.filteredOptions[0].loading\n ) {\n searchResultsStatusEl.innerText = this.hadNoOptions()\n ? this.emptyOptionListText\n : `${this.filteredOptions.length} result${\n this.filteredOptions.length > 1 ? \"s\" : \"\"\n } available`;\n }\n }\n };\n\n private hasOptionsOrFilterDisabled = () =>\n this.options.length > 0 || this.disableAutoFiltering;\n\n private hadNoOptions = () =>\n this.filteredOptions.length === 1 &&\n this.filteredOptions[0][this.labelField] === this.emptyOptionListText &&\n this.searchMode === \"navigation\";\n\n private isSubmitDisabled = () =>\n !this.value ||\n this.value.length < this.charactersUntilSuggestion ||\n this.disabled ||\n this.hadNoOptions() ||\n this.hasTimedOut ||\n this.loading;\n\n private showMenuWithNoInput = () => this.charactersUntilSuggestion === 0;\n private updateSearchButtonType = () => {\n this.searchButtonType =\n !!this.el.closest<HTMLFormElement>(\"FORM\") &&\n !this.preventFormSubmitOnSearch\n ? \"submit\"\n : \"button\";\n };\n\n render() {\n const {\n inputId,\n name,\n label,\n required,\n size,\n placeholder,\n helperText,\n disabled,\n value,\n readonly,\n spellcheck,\n fullWidth,\n options,\n open,\n hideLabel,\n menuId,\n ariaActiveDescendant,\n truncateValue,\n autofocus,\n autocapitalize,\n autocomplete,\n filteredOptions,\n theme,\n charactersUntilSuggestion,\n labelField,\n valueField,\n loadingLabel,\n loadingErrorLabel,\n searchMode,\n showClearButton,\n searchSubmitFocused,\n clearButtonFocused,\n searchButtonType,\n } = this;\n\n const disabledMode = readonly || disabled;\n\n const describedBy = getInputDescribedByText(\n this.el,\n inputId,\n helperText !== \"\",\n false\n ).trim();\n\n let describedById = undefined;\n\n if (describedBy !== \"\" && this.hasOptionsOrFilterDisabled()) {\n describedById = `${describedBy} ${inputId}-assistive-hint`;\n } else if (this.hasOptionsOrFilterDisabled()) {\n describedById = `${inputId}-assistive-hint`;\n } else if (describedBy !== \"\") {\n describedById = describedBy;\n }\n\n const hasSuggestedSearch =\n (!!value || this.showMenuWithNoInput()) &&\n this.hasOptionsOrFilterDisabled();\n const menuOpen = hasSuggestedSearch && open && filteredOptions.length > 0;\n const menuRendered = menuOpen && value.length >= charactersUntilSuggestion;\n\n const labelValue = getLabelFromValue(\n value,\n options,\n valueField,\n labelField\n );\n\n renderHiddenInput(this.el as HTMLElement, value, name, disabledMode);\n\n return (\n <Host\n class={{\n \"ic-search-bar-search\": true,\n \"ic-search-bar-full-width\": fullWidth,\n \"ic-search-bar-disabled\": disabled,\n \"ic-search-bar-small\": size === \"small\",\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n onFocus={this.handleHostFocus}\n onBlur={this.handleHostBlur}\n >\n <ic-input-container readonly={readonly} disabled={disabledMode}>\n {!hideLabel && (\n <ic-input-label\n for={inputId}\n label={label}\n helperText={helperText}\n required={required}\n disabled={disabledMode && !readonly}\n readonly={readonly}\n >\n <slot name=\"helper-text\" slot=\"helper-text\"></slot>\n </ic-input-label>\n )}\n <ic-input-component-container\n ref={(el) => (this.anchorEl = el)}\n size={size}\n disabled={disabledMode}\n readonly={readonly}\n fullWidth={fullWidth}\n >\n <input\n id={inputId}\n name={name}\n ref={(el) => (this.inputEl = el)}\n value={options && !!labelValue ? labelValue : value}\n class={{\n \"no-left-pad\": readonly,\n readonly,\n \"truncate-value\": truncateValue,\n }}\n placeholder={placeholder}\n required={required}\n disabled={disabledMode}\n readonly={readonly}\n onInput={this.onInput}\n onBlur={this.onInputBlur}\n onFocus={this.onInputFocus}\n aria-label={hideLabel ? label : undefined}\n aria-activedescendant={ariaActiveDescendant}\n aria-expanded={\n options.length > 0 && menuRendered ? `${menuOpen}` : undefined\n }\n aria-owns={menuRendered ? menuId : undefined}\n aria-describedby={describedById}\n aria-controls={menuRendered ? menuId : undefined}\n aria-haspopup={options.length > 0 ? \"listbox\" : undefined}\n aria-autocomplete={hasSuggestedSearch ? \"list\" : undefined}\n role={options.length > 0 && menuRendered ? \"combobox\" : undefined}\n autocomplete={autocomplete}\n autocapitalize={autocapitalize}\n autoFocus={autofocus}\n spellcheck={spellcheck}\n inputmode=\"search\"\n ></input>\n <div\n class={{\n \"clear-button-container\": true,\n \"clear-button-visible\":\n !!value && !disabledMode && showClearButton,\n }}\n >\n <ic-button\n id=\"clear-button\"\n class={{\n \"clear-button\": true,\n \"clear-button-unfocused\": !clearButtonFocused,\n }}\n aria-label=\"Clear\"\n innerHTML={clearIcon}\n onClick={this.handleClear}\n onMouseDown={this.handleMouseDown}\n size={size}\n onFocus={this.handleFocusClearButton}\n onBlur={this.handleClearBlur}\n onKeyDown={this.handleClear}\n type={\"button\"}\n variant=\"icon-tertiary\"\n theme={clearButtonFocused ? \"light\" : \"dark\"}\n ></ic-button>\n <div class=\"divider\"></div>\n </div>\n <div\n class={{\n \"search-submit-button-container\": true,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n >\n <ic-button\n id=\"search-submit-button\"\n aria-label=\"Search\"\n ref={(el) => (this.searchSubmitButton = el)}\n class={{\n \"search-submit-button\": true,\n \"search-submit-button-small\": size === \"small\",\n \"search-submit-button-unfocused\": !searchSubmitFocused,\n \"search-submit-button-disabled\": this.isSubmitDisabled(),\n }}\n disabled={this.isSubmitDisabled()}\n innerHTML={searchIcon}\n size={size}\n onClick={this.handleSubmitSearch}\n onMouseDown={this.handleMouseDown}\n onBlur={this.handleSubmitSearchBlur}\n onFocus={this.handleSubmitSearchFocus}\n onKeyDown={this.handleSubmitSearchKeyDown}\n type={searchButtonType}\n variant=\"icon-tertiary\"\n theme={searchSubmitFocused ? \"light\" : \"dark\"}\n ></ic-button>\n </div>\n </ic-input-component-container>\n <div\n class={{\n \"menu-container\": true,\n fullwidth: fullWidth,\n }}\n >\n {menuRendered && this.anchorEl && this.inputEl && (\n <ic-menu\n class={{\n \"no-results\":\n this.hadNoOptions() ||\n (filteredOptions.length === 1 &&\n (filteredOptions[0][labelField] === loadingLabel ||\n filteredOptions[0][labelField] === loadingErrorLabel)),\n }}\n activationType=\"manual\"\n anchorEl={this.anchorEl}\n autofocusOnSelected={false}\n searchMode={searchMode}\n inputEl={this.inputEl}\n inputLabel={label}\n ref={(el) => (this.menu = el)}\n fullWidth={fullWidth}\n menuId={menuId}\n open={true}\n options={filteredOptions}\n onMenuOptionSelect={this.handleOptionSelect}\n onMenuStateChange={this.handleMenuChange}\n onMenuOptionId={this.handleMenuOptionHighlight}\n onRetryButtonClicked={this.handleRetry}\n parentEl={this.el as HTMLElement}\n value={value}\n labelField={labelField}\n valueField={valueField}\n searchBar={true}\n ></ic-menu>\n )}\n </div>\n </ic-input-container>\n <div\n aria-live=\"polite\"\n role=\"status\"\n class=\"search-results-status\"\n ></div>\n </Host>\n );\n }\n}\n"],"mappings":"qvCAAA,MAAMA,EAAiB,stMACvB,MAAAC,EAAeD,EC8Cf,IAAIE,EAAW,E,MAaFC,EAAS,MARtB,WAAAC,CAAAC,G,0gBAYUC,KAAAC,YAAc,MAEdD,KAAAE,QAAU,uBAAuBN,MAEjCI,KAAAG,6BAA+B,MAC/BH,KAAAI,OAAS,GAAGJ,KAAKE,eACjBF,KAAAK,QAAU,KACVL,KAAAM,cAAgB,MAChBN,KAAAO,aAAe,MACfP,KAAAQ,iBAAmB,MACnBR,KAAAS,iBAAmB,MAEnBT,KAAAU,cAAgB,MAMfV,KAAAW,mBAAqB,MAErBX,KAAAY,KAAO,MACPZ,KAAAa,oBAAsB,MACtBb,KAAAc,gBAAkB,MAMnBd,KAAAe,eAAiB,MAKjBf,KAAAgB,aAAoC,MAKpChB,KAAAiB,YAAmC,MAKnCjB,KAAAkB,UAAY,MAKZlB,KAAAmB,0BAA4B,EAW5BnB,KAAAoB,SAAW,MAUXpB,KAAAqB,qBAAuB,MAKvBrB,KAAAsB,SAAW,EASXtB,KAAAuB,oBA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O,CACL,aACE3L,KAAK0I,gBACJ/F,EAAgBwB,SAAW,IACzBxB,EAAgB,GAAGd,KAAgBG,GAClCW,EAAgB,GAAGd,KAAgBE,IAE3C8K,eAAe,SACfZ,SAAUjM,KAAKiM,SACfa,oBAAqB,MACrBxK,WAAYA,EACZe,QAASrD,KAAKqD,QACd0J,WAAY7H,EACZ8G,IAAMrI,GAAQ3D,KAAKoH,KAAOzD,EAC1BlC,UAAWA,EACXrB,OAAQA,EACRQ,KAAM,KACNgC,QAASD,EACTqK,mBAAoBhN,KAAK0G,mBACzBuG,kBAAmBjN,KAAKgH,iBACxBkG,eAAgBlN,KAAK4G,0BACrBuG,qBAAsBnN,KAAKgG,YAC3BoH,SAAUpN,KAAK2D,GACfd,MAAOA,EACPhB,WAAYA,EACZa,WAAYA,EACZ2K,UAAW,SAKnB5B,EAAA,OAAA1F,IAAA,uDACY,SACVmG,KAAK,SACLP,MAAM,0B","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as e,c as i,h as a,H as t,g as r}from"./p-8e4e97b4.js";import{r as o,l as c,i as n,k as d,o as s,t as l,e as h}from"./p-a5658054.js";import"./p-bddf799a.js";const p='/*! 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}ic-radio-option{display:flex;flex-direction:column;width:-moz-fit-content;width:fit-content}.additional-field-wrapper [slot="additional-field"]{margin-top:calc(var(--ic-space-sm) / 2);margin-left:var(--ic-space-xl)}ic-radio-option.ic-radio-option-disabled,ic-radio-option.ic-radio-option-disabled .radio-label{--ic-typography-color:var(--ic-radio-button-text-option-disabled)}.container input:focus+span.checkmark,.container:hover input:focus+span.checkmark,.container:active input:focus+span.checkmark,:host(:focus) .container input:checked+span.checkmark{box-shadow:var(--ic-border-focus)}.container{display:grid;grid-template-columns:min-content auto;position:relative;cursor:pointer;align-items:center;margin:var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs)}.ic-radio-group-small .container{margin:0 0 0 var(--ic-space-xxs)}.container.disabled,.container.disabled input:disabled{cursor:default}.container input{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-block;position:absolute;cursor:pointer;height:var(--ic-space-lg);width:var(--ic-space-lg);border-radius:50%;border:none}.ic-radio-group-small .container input{height:var(--ic-space-md);width:var(--ic-space-md)}.checkmark{display:block;position:relative;top:0;left:0;height:var(--ic-space-lg);width:var(--ic-space-lg);background-color:var(--ic-radio-button-background-default);border:var(--ic-space-1px) solid var(--ic-radio-button-border-default);border-radius:50%;transition:var(--ic-easing-transition-fast);box-sizing:border-box}.ic-radio-group-small .checkmark{height:var(--ic-space-md);width:var(--ic-space-md)}.container input:checked~.checkmark::after{display:inline-block}.container:hover input~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-hover);border:var(--ic-border-width) solid var(--ic-radio-button-default-hover)}.container:hover input:checked~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-hover);border:0.125rem solid var(--ic-radio-button-default-hover)}.container:hover:not(.disabled) input:checked~.checkmark::after{background-color:var(--ic-radio-button-default-hover)}.container:active input~.checkmark{box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-pressed);border:var(--ic-border-width) solid var(--ic-radio-button-default-pressed)}.container:active input:checked~.checkmark{border:0.125rem solid var(--ic-radio-button-default-pressed);box-shadow:0 0 0 0.25rem var(--ic-radio-button-active-pressed)}.ic-radio-group-small .container input:checked~.checkmark{border-width:var(--ic-space-1px)}.container:active input:checked~.checkmark::after{background-color:var(--ic-radio-button-default-pressed)}.container input:checked~.checkmark{border:0.125rem solid var(--ic-radio-button-default-active)}.container input:checked:disabled~.checkmark{border:0.125rem solid var(--ic-radio-button-border-disabled)}.container input:disabled~.checkmark{border:var(--ic-border-width) dashed var(--ic-radio-button-border-disabled)}.container input:disabled~.checkmark::after{background:var(--ic-radio-button-disabled)}.container:hover input:disabled~.checkmark{box-shadow:none;border:0.125rem solid none}.container:active input:disabled~.checkmark::after{background-color:var(--ic-radio-button-disabled)}.container .checkmark::after{content:"";position:absolute;display:none;top:calc(50% - var(--ic-space-xs));left:calc(50% - var(--ic-space-xs));width:var(--ic-space-md);height:var(--ic-space-md);border-radius:50%;background:var(--ic-radio-button-default-active)}.ic-radio-group-small .container .checkmark::after{top:50%;left:50%;width:0.625rem;height:0.625rem;border-radius:50%;background:var(--ic-radio-button-default-active);transform:translate(-50%, -50%)}.radio-label{margin-left:var(--ic-space-md);--ic-typography-color:var(--ic-radio-button-text-option)}.ic-radio-group-small .radio-label{margin-left:var(--ic-space-xs)}.additional-field-wrapper{margin-left:var(--ic-space-xs)}.branch-corner{color:var(--ic-radio-button-required-bar);height:var(--ic-space-md);width:var(--ic-space-xl);border-radius:0 0 0 0.188rem;border-bottom:0.125rem solid var(--ic-radio-button-required-bar);border-left:0.125rem solid var(--ic-radio-button-required-bar);margin-left:calc(-1 * var(--ic-space-1px))}.dynamic-container{display:flex;position:relative;margin:var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-md);gap:var(--ic-space-xs)}.ic-radio-group-small .dynamic-container{margin-left:12px}.dynamic-container.hidden{display:none}.dynamic-text{color:var(--ic-radio-button-required-text);--ic-typography-color:var(--ic-radio-button-required-text);margin-top:calc(var(--ic-space-sm) / 2);margin-bottom:var(--ic-space-xs);border-radius:2%}@media (max-width: 576px){ic-text-field{--input-width:100%}}@media (forced-colors: active){.container input:checked~.checkmark,.container:active input:checked~.checkmark{border-color:Highlight}.container input:checked~.checkmark::after,.container:active input:checked~.checkmark::after{background-color:Highlight}.container input:disabled~.checkmark,.container input:checked:disabled~.checkmark{border-color:GrayText}.container input:disabled~.checkmark::after,.container:active input:disabled~.checkmark::after{background-color:GrayText}}input[type="radio"]:dir(rtl){right:0}.radio-label:dir(rtl){padding-right:var(--ic-space-sm);padding-left:0}.branch-corner:dir(rtl){border-radius:0 0 0.188rem;border-right:0.125rem solid var(--ic-action-default);border-left:none}.dynamic-container:dir(rtl){margin:var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0}';const b=p;const u="additional-field";const m=class{constructor(a){e(this,a);this.icCheck=i(this,"icCheck",7);this.icSelectedChange=i(this,"icSelectedChange",7);this.defaultRadioValue="";this.hasAdditionalField=false;this.skipFocus=false;this.additionalFieldDisplay="static";this.disabled=false;this.dynamicText="This selection requires additional answers";this.theme="inherit";this.selected=false;this.initiallySelected=this.selected;this.handleClick=e=>{var i,a;const t=e.target.matches(".dynamic-container:not(ic-radio-option, .checkmark), .dynamic-container *:not(ic-radio-option, .checkmark)");if(!this.disabled&&(!t||e.target===this.radioElement)){e.stopPropagation();if(this.skipFocus===false){(i=this.radioElement)===null||i===void 0?void 0:i.focus()}this.skipFocus=false;if(this.hasAdditionalField){this.value=((a=this.getAdditionalField())===null||a===void 0?void 0:a.value)||this.defaultRadioValue}this.icCheck.emit({value:this.value})}};this.handleKeyDown=e=>{const i=["IC-DATE-INPUT","IC-DATE-PICKER"];if(this.getAdditionalField()==document.activeElement&&i.includes(this.getAdditionalField().nodeName)){e.stopPropagation()}};this.handleFormReset=()=>{this.skipFocus=true;this.selected=this.initiallySelected}}watchDisabledHandler(){o(this.disabled,this.el)}watchSelectedHandler(){this.icSelectedChange.emit()}handleCheck(e){if(this.additionalFieldDisplay==="static"&&Array.from(this.el.querySelectorAll("ic-radio-option")).includes(e.target))this.icCheck.emit({value:this.value})}disconnectedCallback(){c(this.el,this.handleFormReset)}componentWillLoad(){if(n(this.el,u)){this.hasAdditionalField=true;this.getAdditionalField()}this.defaultRadioValue=this.value;d(this.el,this.handleFormReset);o(this.disabled,this.el)}componentDidLoad(){s([{prop:this.value,propName:"value"}],"Radio Option")}componentWillRender(){const e=l(this.el,u);if(e&&!this.hasAdditionalField){this.hasAdditionalField=true;this.getAdditionalField()}else if(!e&&this.hasAdditionalField){this.hasAdditionalField=false}}componentDidRender(){if(this.additionalFieldDisplay==="static"){const e=this.getAdditionalField();if(!this.selected||this.disabled){e===null||e===void 0?void 0:e.setAttribute("disabled","")}else{e===null||e===void 0?void 0:e.removeAttribute("disabled")}}}additionalFieldValueHandler(e){if(this.selected){this.value=e.detail.value||this.defaultRadioValue;this.icCheck.emit({value:this.value})}e.stopImmediatePropagation()}async setFocus(){var e;(e=this.radioElement)===null||e===void 0?void 0:e.focus()}async setTabIndex(e){var i;(i=this.radioElement)===null||i===void 0?void 0:i.setAttribute("tabIndex",e.toString())}getAdditionalField(){const e=this.el.querySelector('ic-text-field[slot="additional-field"]');if(e)e.hiddenInput=false;return e}render(){const{additionalFieldDisplay:e,disabled:i,dynamicText:r,form:o,groupLabel:c,handleClick:n,handleKeyDown:d,hasAdditionalField:s,label:l,name:p,selected:b,value:m,theme:f}=this;const v=`ic-radio-option-${h(l)||m}-${c}`;return a(t,{key:"3d233946c372788a34128912099c47d6858d7ea9",onClick:n,onKeyDown:d,class:{["ic-radio-option-disabled"]:!!i,[`ic-theme-${f}`]:f!=="inherit"}},a("div",{key:"e932a0827c6b0620522f9f3df3f5a06316098949",class:{container:true,disabled:!!i}},a("div",{key:"64eeea95469af9831655f56701e2332255bf6669"},a("input",{key:"32f7a8840d8a14a89f1a79b9c61890e0e2fe23a0",tabindex:b?"0":"-1",type:"radio",name:p,id:v,value:m,disabled:i,checked:b,ref:e=>this.radioElement=e,form:o}),a("span",{key:"6cbea9714c51eb75b7be07a509049f0c330ffca5",class:"checkmark"})),a("ic-typography",{key:"55164cf8d231d449267b74389f9d7cd8193ab6db",class:"radio-label",variant:"body"},a("label",{key:"54014827aa5c16641bc3fa864974382bf0715335",htmlFor:v},l))),s&&a("div",{key:"5f3e1054494365c3fafdfd421bed64523307406b",class:{"dynamic-container":true,hidden:e==="dynamic"&&!b}},e==="dynamic"&&a("div",{key:"d9c292dd502569650dcf327a3e48716cde723593",class:"branch-corner"}),a("div",{key:"3994230df8af7e9c5215646a1c5c3d5687961637"},e==="dynamic"&&a("ic-typography",{key:"0b92403d743c4517ca099586a2845e71d528c329",variant:"caption",role:"alert"},a("p",{key:"0b689ea686ff2cb08b27858920a2f0548c197aa7",class:"dynamic-text"},r)),a("div",{key:"7e023eb75b14dd0a75acbe5321ecd676de0a67d4",class:{"additional-field-wrapper":e==="static"}},a("slot",{key:"b3f82b1650ef67a732b35a32c5088745f31d1f31",name:u})))))}get el(){return r(this)}static get watchers(){return{disabled:["watchDisabledHandler"],selected:["watchSelectedHandler"]}}};m.style=b;export{m as ic_radio_option};
2
- //# sourceMappingURL=p-b3cb1e35.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["icRadioOptionCss","IcRadioOptionStyle0","ADDITIONAL_FIELD","RadioOption","constructor","hostRef","this","defaultRadioValue","hasAdditionalField","skipFocus","additionalFieldDisplay","disabled","dynamicText","theme","selected","initiallySelected","handleClick","event","clickedAdditionalField","target","matches","radioElement","stopPropagation","_a","focus","value","_b","getAdditionalField","icCheck","emit","handleKeyDown","preventPropagationElements","document","activeElement","includes","nodeName","handleFormReset","watchDisabledHandler","removeDisabledFalse","el","watchSelectedHandler","icSelectedChange","handleCheck","ev","Array","from","querySelectorAll","disconnectedCallback","removeFormResetListener","componentWillLoad","isSlotUsed","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","propName","componentWillRender","hasSlot","slotHasContent","componentDidRender","additionalField","setAttribute","removeAttribute","additionalFieldValueHandler","detail","stopImmediatePropagation","setFocus","setTabIndex","toString","querySelector","hiddenInput","render","form","groupLabel","label","name","id","isPropDefined","h","Host","key","onClick","onKeyDown","class","container","tabindex","type","checked","ref","variant","htmlFor","hidden","role"],"sources":["src/components/ic-radio-option/ic-radio-option.css?tag=ic-radio-option","src/components/ic-radio-option/ic-radio-option.tsx"],"sourcesContent":["@import \"../../global/normalize.css\";\n\nic-radio-option {\n display: flex;\n flex-direction: column;\n width: fit-content;\n}\n\n.additional-field-wrapper [slot=\"additional-field\"] {\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-left: var(--ic-space-xl);\n}\n\n/* The label turns grey when disabled */\nic-radio-option.ic-radio-option-disabled,\nic-radio-option.ic-radio-option-disabled .radio-label {\n --ic-typography-color: var(--ic-radio-button-text-option-disabled);\n}\n\n/* Focus states */\n\n.container input:focus + span.checkmark,\n.container:hover input:focus + span.checkmark,\n.container:active input:focus + span.checkmark,\n:host(:focus) .container input:checked + span.checkmark {\n box-shadow: var(--ic-border-focus);\n}\n\n/* The container */\n.container {\n display: grid;\n grid-template-columns: min-content auto;\n position: relative;\n cursor: pointer;\n align-items: center;\n margin: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-xxs);\n}\n\n.ic-radio-group-small .container {\n margin: 0 0 0 var(--ic-space-xxs);\n}\n\n.container.disabled,\n.container.disabled input:disabled {\n cursor: default;\n}\n\n/* Hide the browser's default radio button */\n.container input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: inline-block;\n position: absolute;\n cursor: pointer;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n border-radius: 50%;\n border: none;\n}\n\n.ic-radio-group-small .container input {\n height: var(--ic-space-md);\n width: var(--ic-space-md);\n}\n\n/* Create a custom radio button */\n.checkmark {\n display: block;\n position: relative;\n top: 0;\n left: 0;\n height: var(--ic-space-lg);\n width: var(--ic-space-lg);\n background-color: var(--ic-radio-button-background-default);\n border: var(--ic-space-1px) solid var(--ic-radio-button-border-default);\n border-radius: 50%;\n transition: var(--ic-easing-transition-fast);\n box-sizing: border-box;\n}\n\n.ic-radio-group-small .checkmark {\n height: var(--ic-space-md);\n width: var(--ic-space-md);\n}\n\n/* Show the indicator (dot/circle) when checked */\n.container input:checked ~ .checkmark::after {\n display: inline-block;\n}\n\n/* On mouse-over, add a light blue background color */\n.container:hover input ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-hover);\n border: var(--ic-border-width) solid var(--ic-radio-button-default-hover);\n}\n\n.container:hover input:checked ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-hover);\n border: 0.125rem solid var(--ic-radio-button-default-hover);\n}\n\n.container:hover:not(.disabled) input:checked ~ .checkmark::after {\n background-color: var(--ic-radio-button-default-hover);\n}\n\n/* When pressed, adds the active colours */\n.container:active input ~ .checkmark {\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-pressed);\n border: var(--ic-border-width) solid var(--ic-radio-button-default-pressed);\n}\n\n/* When pressed, adds the active colours */\n.container:active input:checked ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-default-pressed);\n box-shadow: 0 0 0 0.25rem var(--ic-radio-button-active-pressed);\n}\n\n.ic-radio-group-small .container input:checked ~ .checkmark {\n border-width: var(--ic-space-1px);\n}\n\n/* When pressed and selected, adds the active colours */\n.container:active input:checked ~ .checkmark::after {\n background-color: var(--ic-radio-button-default-pressed);\n}\n\n/* When the radio button is checked */\n.container input:checked ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-default-active);\n}\n\n/* When the radio button is checked and disabled */\n.container input:checked:disabled ~ .checkmark {\n border: 0.125rem solid var(--ic-radio-button-border-disabled);\n}\n\n/* When the radio button is disabled */\n.container input:disabled ~ .checkmark {\n border: var(--ic-border-width) dashed var(--ic-radio-button-border-disabled);\n}\n\n/* When the radio button is disabled */\n.container input:disabled ~ .checkmark::after {\n background: var(--ic-radio-button-disabled);\n}\n\n/* On mouse-over inactive */\n.container:hover input:disabled ~ .checkmark {\n box-shadow: none;\n border: 0.125rem solid none;\n}\n\n.container:active input:disabled ~ .checkmark::after {\n background-color: var(--ic-radio-button-disabled);\n}\n\n/* Style the indicator (dot/circle) */\n.container .checkmark::after {\n content: \"\";\n position: absolute;\n display: none;\n top: calc(50% - var(--ic-space-xs));\n left: calc(50% - var(--ic-space-xs));\n width: var(--ic-space-md);\n height: var(--ic-space-md);\n border-radius: 50%;\n background: var(--ic-radio-button-default-active);\n}\n\n.ic-radio-group-small .container .checkmark::after {\n top: 50%;\n left: 50%;\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 50%;\n background: var(--ic-radio-button-default-active);\n transform: translate(-50%, -50%);\n}\n\n.radio-label {\n margin-left: var(--ic-space-md);\n\n --ic-typography-color: var(--ic-radio-button-text-option);\n}\n\n.ic-radio-group-small .radio-label {\n margin-left: var(--ic-space-xs);\n}\n\n.additional-field-wrapper {\n margin-left: var(--ic-space-xs);\n}\n\n/* The line */\n.branch-corner {\n color: var(--ic-radio-button-required-bar);\n height: var(--ic-space-md);\n width: var(--ic-space-xl);\n border-radius: 0 0 0 0.188rem;\n border-bottom: 0.125rem solid var(--ic-radio-button-required-bar);\n border-left: 0.125rem solid var(--ic-radio-button-required-bar);\n margin-left: calc(-1 * var(--ic-space-1px));\n}\n\n/* The dynamic container */\n.dynamic-container {\n display: flex;\n position: relative;\n margin: var(--ic-space-xxs) 0 var(--ic-space-xxs) var(--ic-space-md);\n gap: var(--ic-space-xs);\n}\n\n.ic-radio-group-small .dynamic-container {\n margin-left: 12px;\n}\n\n.dynamic-container.hidden {\n display: none;\n}\n\n.dynamic-text {\n color: var(--ic-radio-button-required-text);\n\n --ic-typography-color: var(--ic-radio-button-required-text);\n\n margin-top: calc(var(--ic-space-sm) / 2);\n margin-bottom: var(--ic-space-xs);\n border-radius: 2%;\n}\n\n@media (max-width: 576px) {\n ic-text-field {\n --input-width: 100%;\n }\n}\n\n@media (forced-colors: active) {\n /* Styles here only apply to Forced Colors Mode */\n\n .container input:checked ~ .checkmark,\n .container:active input:checked ~ .checkmark {\n border-color: Highlight;\n }\n\n .container input:checked ~ .checkmark::after,\n .container:active input:checked ~ .checkmark::after {\n background-color: Highlight;\n }\n\n .container input:disabled ~ .checkmark,\n .container input:checked:disabled ~ .checkmark {\n border-color: GrayText;\n }\n\n .container input:disabled ~ .checkmark::after,\n .container:active input:disabled ~ .checkmark::after {\n background-color: GrayText;\n }\n}\n\n/* Right to left */\ninput[type=\"radio\"]:dir(rtl) {\n right: 0;\n}\n\n.radio-label:dir(rtl) {\n padding-right: var(--ic-space-sm);\n padding-left: 0;\n}\n\n.branch-corner:dir(rtl) {\n border-radius: 0 0 0.188rem;\n border-right: 0.125rem solid var(--ic-action-default);\n border-left: none;\n}\n\n.dynamic-container:dir(rtl) {\n margin: var(--ic-space-xxxs) var(--ic-space-sm) var(--ic-space-xxs) 0;\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Listen,\n State,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcAdditionalFieldTypes,\n IcThemeMode,\n IcValueEventDetail,\n} from \"../../utils/types\";\nimport {\n onComponentRequiredPropUndefined,\n addFormResetListener,\n removeFormResetListener,\n removeDisabledFalse,\n isPropDefined,\n isSlotUsed,\n slotHasContent,\n} from \"../../utils/helpers\";\n\nconst ADDITIONAL_FIELD = \"additional-field\";\n\n/**\n * @slot additional-field - Content to displayed alongside a radio option.\n */\n@Component({\n tag: \"ic-radio-option\",\n styleUrl: \"ic-radio-option.css\",\n})\nexport class RadioOption {\n private defaultRadioValue: string = \"\";\n private hasAdditionalField: boolean = false;\n private radioElement?: HTMLInputElement;\n private skipFocus = false;\n\n @Element() el: HTMLIcRadioOptionElement;\n\n /**\n * The style of additionalField that will be displayed if used.\n */\n @Prop({ reflect: true }) additionalFieldDisplay?: IcAdditionalFieldTypes =\n \"static\";\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n @Watch(\"disabled\")\n watchDisabledHandler(): void {\n removeDisabledFalse(this.disabled, this.el);\n }\n\n /**\n * The text to be displayed when dynamic.\n */\n @Prop() dynamicText?: string = \"This selection requires additional answers\";\n\n /**\n * The <form> element to associate the radio with.\n */\n @Prop() form?: string;\n\n /**\n * The group label for the radio option.\n */\n @Prop() groupLabel?: string;\n\n /**\n * The label for the radio option.\n */\n @Prop() label?: string;\n\n /**\n * The name for the radio option.\n */\n @Prop() name?: string;\n\n /**\n * Sets the theme color to the dark or light theme color. \"inherit\" will set the color based on the system settings or ic-theme component.\n */\n @Prop() theme?: IcThemeMode = \"inherit\";\n\n /**\n * The value for the radio option.\n */\n @Prop({ mutable: true }) value!: string;\n\n /**\n * If `true`, the radio option will be displayed in a selected state.\n */\n @Prop({ reflect: true, mutable: true }) selected?: boolean = false;\n @State() initiallySelected = this.selected;\n\n @Watch(\"selected\")\n watchSelectedHandler(): void {\n this.icSelectedChange.emit();\n }\n\n /**\n * Emitted when the radio option is selected.\n */\n @Event() icCheck: EventEmitter<IcValueEventDetail>;\n @Listen(\"icCheck\")\n handleCheck(ev: CustomEvent<IcValueEventDetail>): void {\n if (\n this.additionalFieldDisplay === \"static\" &&\n Array.from(this.el.querySelectorAll(\"ic-radio-option\")).includes(\n ev.target as HTMLIcRadioOptionElement\n )\n )\n this.icCheck.emit({ value: this.value });\n }\n\n /**\n * Emitted when the radio option is selected or deselected.\n */\n @Event() icSelectedChange: EventEmitter<void>;\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n componentWillLoad(): void {\n if (isSlotUsed(this.el, ADDITIONAL_FIELD)) {\n this.hasAdditionalField = true;\n this.getAdditionalField();\n }\n\n this.defaultRadioValue = this.value;\n\n addFormResetListener(this.el, this.handleFormReset);\n\n removeDisabledFalse(this.disabled, this.el);\n }\n\n componentDidLoad(): void {\n onComponentRequiredPropUndefined(\n [{ prop: this.value, propName: \"value\" }],\n \"Radio Option\"\n );\n }\n\n componentWillRender(): void {\n const hasSlot = slotHasContent(this.el, ADDITIONAL_FIELD);\n if (hasSlot && !this.hasAdditionalField) {\n this.hasAdditionalField = true;\n this.getAdditionalField();\n } else if (!hasSlot && this.hasAdditionalField) {\n this.hasAdditionalField = false;\n }\n }\n\n componentDidRender(): void {\n if (this.additionalFieldDisplay === \"static\") {\n const additionalField = this.getAdditionalField();\n if (!this.selected || this.disabled) {\n additionalField?.setAttribute(\"disabled\", \"\");\n } else {\n additionalField?.removeAttribute(\"disabled\");\n }\n }\n }\n\n @Listen(\"icChange\")\n additionalFieldValueHandler(event: CustomEvent<{ value: string }>): void {\n if (this.selected) {\n this.value = event.detail.value || this.defaultRadioValue;\n this.icCheck.emit({\n value: this.value,\n });\n }\n\n event.stopImmediatePropagation();\n }\n\n /**\n * Sets focus on the radio option.\n */\n @Method()\n async setFocus(): Promise<void> {\n this.radioElement?.focus();\n }\n\n /**\n * @internal Sets the tabIndex of the radio option.\n */\n @Method()\n async setTabIndex(value: number): Promise<void> {\n this.radioElement?.setAttribute(\"tabIndex\", value.toString());\n }\n\n private getAdditionalField(): HTMLIcTextFieldElement {\n const additionalField = this.el.querySelector(\n 'ic-text-field[slot=\"additional-field\"]'\n ) as HTMLIcTextFieldElement;\n if (additionalField) additionalField.hiddenInput = false;\n return additionalField;\n }\n\n private handleClick = (event: MouseEvent) => {\n const clickedAdditionalField = (event.target as Element).matches(\n \".dynamic-container:not(ic-radio-option, .checkmark), .dynamic-container *:not(ic-radio-option, .checkmark)\"\n );\n\n if (\n !this.disabled &&\n (!clickedAdditionalField || event.target === this.radioElement)\n ) {\n event.stopPropagation();\n if (this.skipFocus === false) {\n this.radioElement?.focus();\n }\n this.skipFocus = false;\n\n if (this.hasAdditionalField) {\n this.value = this.getAdditionalField()?.value || this.defaultRadioValue;\n }\n\n this.icCheck.emit({\n value: this.value,\n });\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const preventPropagationElements = [\"IC-DATE-INPUT\", \"IC-DATE-PICKER\"];\n\n if (\n this.getAdditionalField() == document.activeElement &&\n preventPropagationElements.includes(this.getAdditionalField().nodeName)\n ) {\n event.stopPropagation();\n }\n };\n\n private handleFormReset = (): void => {\n this.skipFocus = true;\n this.selected = this.initiallySelected;\n };\n\n render() {\n const {\n additionalFieldDisplay,\n disabled,\n dynamicText,\n form,\n groupLabel,\n handleClick,\n handleKeyDown,\n hasAdditionalField,\n label,\n name,\n selected,\n value,\n theme,\n } = this;\n\n const id = `ic-radio-option-${isPropDefined(label) || value}-${groupLabel}`;\n\n return (\n <Host\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n class={{\n [\"ic-radio-option-disabled\"]: !!disabled,\n [`ic-theme-${theme}`]: theme !== \"inherit\",\n }}\n >\n <div class={{ container: true, disabled: !!disabled }}>\n <div>\n <input\n tabindex={selected ? \"0\" : \"-1\"}\n type=\"radio\"\n name={name}\n id={id}\n value={value}\n disabled={disabled}\n checked={selected}\n ref={(el) => (this.radioElement = el)}\n form={form}\n ></input>\n <span class=\"checkmark\"></span>\n </div>\n <ic-typography class=\"radio-label\" variant=\"body\">\n <label htmlFor={id}>{label}</label>\n </ic-typography>\n </div>\n {hasAdditionalField && (\n <div\n class={{\n \"dynamic-container\": true,\n hidden: additionalFieldDisplay === \"dynamic\" && !selected,\n }}\n >\n {additionalFieldDisplay === \"dynamic\" && (\n <div class=\"branch-corner\"></div>\n )}\n <div>\n {additionalFieldDisplay === \"dynamic\" && (\n <ic-typography variant=\"caption\" role=\"alert\">\n <p class=\"dynamic-text\">{dynamicText}</p>\n </ic-typography>\n )}\n <div\n class={{\n \"additional-field-wrapper\":\n additionalFieldDisplay === \"static\",\n }}\n >\n <slot name={ADDITIONAL_FIELD}></slot>\n </div>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"sKAAA,MAAMA,EAAmB,sxPACzB,MAAAC,EAAeD,EC2Bf,MAAME,EAAmB,mB,MASZC,EAAW,MAJxB,WAAAC,CAAAC,G,8FAKUC,KAAAC,kBAA4B,GAC5BD,KAAAE,mBAA8B,MAE9BF,KAAAG,UAAY,MAOKH,KAAAI,uBACvB,SAKMJ,KAAAK,SAAqB,MASrBL,KAAAM,YAAuB,6CAyBvBN,KAAAO,MAAsB,UAUUP,KAAAQ,SAAqB,MACpDR,KAAAS,kBAAoBT,KAAKQ,SA4G1BR,KAAAU,YAAeC,I,QACrB,MAAMC,EAA0BD,EAAME,OAAmBC,QACvD,8GAGF,IACGd,KAAKK,YACJO,GAA0BD,EAAME,SAAWb,KAAKe,cAClD,CACAJ,EAAMK,kBACN,GAAIhB,KAAKG,Y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D,MAAO,CACL,CAAC,8BAA+BxE,EAChC,CAAC,YAAYE,KAAUA,IAAU,YAGnCiE,EAAA,OAAAE,IAAA,2CAAKG,MAAO,CAAEC,UAAW,KAAMzE,WAAYA,IACzCmE,EAAA,OAAAE,IAAA,4CACEF,EAAA,SAAAE,IAAA,2CACEK,SAAUvE,EAAW,IAAM,KAC3BwE,KAAK,QACLX,KAAMA,EACNC,GAAIA,EACJnD,MAAOA,EACPd,SAAUA,EACV4E,QAASzE,EACT0E,IAAMjD,GAAQjC,KAAKe,aAAekB,EAClCiC,KAAMA,IAERM,EAAA,QAAAE,IAAA,2CAAMG,MAAM,eAEdL,EAAA,iBAAAE,IAAA,2CAAeG,MAAM,cAAcM,QAAQ,QACzCX,EAAA,SAAAE,IAAA,2CAAOU,QAASd,GAAKF,KAGxBlE,GACCsE,EAAA,OAAAE,IAAA,2CACEG,MAAO,CACL,oBAAqB,KACrBQ,OAAQjF,IAA2B,YAAcI,IAGlDJ,IAA2B,WAC1BoE,EAAA,OAAAE,IAAA,2CAAKG,MAAM,kBAEbL,EAAA,OAAAE,IAAA,4CACGtE,IAA2B,WAC1BoE,EAAA,iBAAAE,IAAA,2CAAeS,QAAQ,UAAUG,KAAK,SACpCd,EAAA,KAAAE,IAAA,2CAAGG,MAAM,gBAAgBvE,IAG7BkE,EAAA,OAAAE,IAAA,2CACEG,MAAO,CACL,2BACEzE,IAA2B,WAG/BoE,EAAA,QAAAE,IAAA,2CAAML,KAAMzE,O","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as t,c as i,h as e,H as s,g as a}from"./p-8e4e97b4.js";import{t as o,r as n,h as r,o as l,s as h}from"./p-a5658054.js";import"./p-bddf799a.js";const d='/*! 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;--ic-input-label-text-color:var(--ic-radio-button-input-field-label);--ic-input-label-helper-text-color:var(\n --ic-radio-button-input-field-subtitle\n );--ic-input-validation-status-text-color:var(--ic-radio-button-state-text);--ic-input-validation-error:var(--ic-radio-button-state-icon-error)}ic-input-label.error{--ic-input-label-text-color:var(--ic-radio-button-input-field-label-error)}ic-input-label.disabled{--ic-input-label-text-color:var(\n --ic-radio-button-input-field-label-disabled\n );--ic-input-label-helper-text-color:var(\n --ic-radio-button-input-field-subtitle-disabled\n )}ic-input-validation.show-validation{margin-top:var(--ic-space-sm)}:host(.ic-radio-group-small) ic-input-validation.show-validation{margin-top:calc(var(--ic-space-sm) / 2)}ic-input-label:not(.with-helper) .ic-typography-label,ic-input-label .helpertext{margin-bottom:var(--ic-space-sm)}:host(.ic-radio-group-small) ic-input-label:not(.with-helper) .ic-typography-label,:host(.ic-radio-group-small) ic-input-label .helpertext{margin-bottom:calc(var(--ic-space-sm) / 2)}ic-input-label .helpertext{display:block}:host .radio-buttons-container{display:flex;flex-direction:column;gap:var(--ic-space-xxs)}:host(.ic-radio-group-small) .radio-buttons-container{gap:var(--ic-space-xxxs)}:host .radio-buttons-container.horizontal{display:flex;flex-direction:row;gap:calc(var(--ic-space-xl) + var(--ic-space-xs))}:host(.ic-radio-group-small) .radio-buttons-container.horizontal{gap:var(--ic-space-xl)}';const c=d;const b=class{constructor(e){t(this,e);this.icChange=i(this,"icChange",7);this.resizeObserver=null;this.ADDITIONAL_FIELD="additional-field";this.RADIO_HORIZONTAL="horizontal";this.RADIO_VERTICAL="vertical";this.checkedValue="";this.selectedChild=-1;this.disabled=false;this.hideLabel=false;this.orientation="vertical";this.required=false;this.size="medium";this.validationAriaLive="polite";this.validationStatus="";this.validationText="";this.theme="inherit";this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{this.checkOrientation()}));this.resizeObserver.observe(this.el)};this.handleKeyDown=t=>{const i=Array.from(this.el.querySelectorAll('ic-text-field[slot="additional-field"]'));const e=document.activeElement;if(i.length>0&&this.radioOptions.map((t=>o(t,this.ADDITIONAL_FIELD)))&&i.map((t=>t==e))){return}t.stopPropagation();switch(t.key){case"ArrowDown":case"ArrowRight":this.radioOptions[this.getNextItemToSelect(this.selectedChild,true)].click();t.preventDefault();break;case"ArrowUp":case"ArrowLeft":this.radioOptions[this.getNextItemToSelect(this.selectedChild,false)].click();t.preventDefault()}};this.getNextItemToSelect=(t,i)=>{const e=this.radioOptions.length-1;if(t<1){t=0}let s=i?t+1:t-1;if(s<0){s=e}else if(s>e){s=0}if(this.radioOptions[s].disabled){s=this.getNextItemToSelect(s,i)}return s};this.addSlotChangeListener=()=>{var t;(t=this.radioContainer)===null||t===void 0?void 0:t.addEventListener("slotchange",this.setRadioOptions)};this.setFirstRadioOptionTabIndex=t=>{this.radioOptions[0].setTabIndex(t)};this.setRadioOptions=()=>{this.selectedChild=-1;this.checkedValue="";this.radioOptions=Array.from(this.el.children).filter((t=>t.tagName==="IC-RADIO-OPTION"));if(this.radioOptions.length>0){this.radioOptions.forEach(((t,i)=>{if(!t.selected){t.selected=this.checkedValue===t.value}t.name=this.name;t.groupLabel=this.label;if(t.selected){this.selectedChild=i;this.checkedValue=t.value}if(this.disabled){t.disabled=true}}));this.setFirstRadioOptionTabIndex(this.selectedChild>0?-1:0);if(this.initialOrientation===this.RADIO_HORIZONTAL&&this.radioOptions!==undefined&&(this.radioOptions.length>2||this.radioOptions.length===2&&(o(this.radioOptions[0],this.ADDITIONAL_FIELD)||o(this.radioOptions[1],this.ADDITIONAL_FIELD)))){this.currentOrientation=this.RADIO_VERTICAL}}}}watchDisabledHandler(t){this.radioOptions.forEach((i=>i.disabled=t));n(this.disabled,this.el)}orientationChangeHandler(){this.initialOrientation=this.orientation;this.checkOrientation()}watchThemeHandler(t){this.radioOptions.forEach((i=>i.theme=t))}disconnectedCallback(){var t,i;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect();(i=this.radioContainer)===null||i===void 0?void 0:i.removeEventListener("slotchange",this.setRadioOptions)}componentWillLoad(){n(this.disabled,this.el);this.orientationChangeHandler();this.currentOrientation=this.initialOrientation}componentDidLoad(){this.setRadioOptions();r(this.runResizeObserver);this.addSlotChangeListener();l([{prop:this.label,propName:"label"},{prop:this.name,propName:"name"}],"Radio Group");this.watchThemeHandler(this.theme)}selectHandler({detail:t,target:i}){var e;const s=i;if(s.parentElement===this.el){this.checkedValue=t.value;this.icChange.emit({value:this.checkedValue,selectedOption:{radio:s,textFieldValue:(e=s===null||s===void 0?void 0:s.querySelector("ic-text-field"))===null||e===void 0?void 0:e.value}});if(this.radioOptions!==undefined){this.radioOptions.forEach(((t,i)=>{t.selected=s===t;if(t.selected){this.selectedChild=i}}));this.setFirstRadioOptionTabIndex(this.selectedChild>0?-1:0)}}}changeHandler(){var t;const i=(t=this.radioOptions)===null||t===void 0?void 0:t.findIndex((t=>t.selected));if(i<0){this.setFirstRadioOptionTabIndex(0);this.selectedChild=i}}checkOrientation(){if(this.initialOrientation===this.RADIO_HORIZONTAL){let t=0;if(Array.isArray(this.radioOptions)&&this.radioOptions.length>0){this.radioOptions.forEach((({clientWidth:i},e,s)=>{t+=i;if(e<s.length-1)t+=40}))}else{t=0}if(this.initialOrientation==this.RADIO_HORIZONTAL){if(this.radioOptions!==undefined&&(this.radioOptions.length>2||this.radioOptions.length===2&&(o(this.radioOptions[0],this.ADDITIONAL_FIELD)||o(this.radioOptions[1],this.ADDITIONAL_FIELD)))){this.currentOrientation=this.RADIO_VERTICAL}else{if(this.radioContainer){if(t>=this.radioContainer.clientWidth){this.currentOrientation=this.RADIO_VERTICAL}else if(t<this.radioContainer.clientWidth){this.currentOrientation=this.RADIO_HORIZONTAL}}}}}}render(){const{currentOrientation:t,disabled:i,handleKeyDown:a,helperText:o,hideLabel:n,label:r,required:l,size:d,validationAriaLive:c,validationStatus:b,validationText:p,theme:u}=this;const f=h(b,i);return e(s,{key:"4ea2e0ca7614fb4ce6563ea146f86d72707a399a",onKeyDown:a,class:{"ic-radio-group-small":d==="small",[`ic-theme-${u}`]:u!=="inherit"}},e("fieldset",{key:"ebad7a878454455a15892bf53c43bdcb914b77c4",role:"radiogroup",id:this.name,"aria-required":`${l}`},!n&&e("legend",{key:"aac1f37c7b1d4d5bc621bd3030dc9eef60417659"},e("ic-input-label",{key:"fd04e3f74c89b633996eb22e60902e988a8ac8ef",class:{[`${b}`]:true,["disabled"]:!!i},label:r,helperText:o,required:l,disabled:i},e("slot",{key:"66325d58018dff189c975e3e4fc01249b51b6b9f",name:"helper-text",slot:"helper-text"}))),e("div",{key:"6d2d332396c87b798d5d160bdb5977c0a8ad6751",class:{"radio-buttons-container":true,horizontal:t===this.RADIO_HORIZONTAL},ref:t=>this.radioContainer=t},e("slot",{key:"fb0a1b41503ba88ce9bda3c0bc8236ae0a7e3795"}))),e("ic-input-validation",{key:"f9f7c2bdffd83d705149f74fe2caad93e57dd85b",class:{"show-validation":f},ariaLiveMode:c,status:f?b:"",message:f?p:""}))}get el(){return a(this)}static get watchers(){return{disabled:["watchDisabledHandler"],orientation:["orientationChangeHandler"],theme:["watchThemeHandler"]}}};b.style=c;export{b as ic_radio_group};
2
- //# sourceMappingURL=p-e7af1e2d.entry.js.map