@solid-design-system/components 5.10.0 → 5.10.1

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 (251) hide show
  1. package/cdn/chunks/chunk.6X4TLHUJ.js +4 -0
  2. package/cdn/components/tooltip/tooltip.d.ts +1 -0
  3. package/cdn/components/tooltip/tooltip.js +1 -1
  4. package/cdn/custom-elements.json +1 -1
  5. package/cdn/solid-components.bundle.js +2 -2
  6. package/cdn/solid-components.iife.js +1 -1
  7. package/cdn/solid-components.js +1 -1
  8. package/cdn/web-types.json +1 -1
  9. package/cdn-versioned/chunks/chunk.2JZXQAEH.js +1 -1
  10. package/cdn-versioned/chunks/chunk.2S6PSHGR.js +1 -1
  11. package/cdn-versioned/chunks/chunk.2YPPKILR.js +1 -1
  12. package/cdn-versioned/chunks/chunk.3I7Z2ZGA.js +1 -1
  13. package/cdn-versioned/chunks/chunk.3VSEXUCN.js +1 -1
  14. package/cdn-versioned/chunks/chunk.45UEUNN5.js +1 -1
  15. package/cdn-versioned/chunks/chunk.4GU7BCCI.js +1 -1
  16. package/cdn-versioned/chunks/chunk.6HLS5XU2.js +1 -1
  17. package/cdn-versioned/chunks/chunk.6NART7VP.js +1 -1
  18. package/cdn-versioned/chunks/chunk.6X4TLHUJ.js +4 -0
  19. package/cdn-versioned/chunks/chunk.7F4BLDO5.js +1 -1
  20. package/cdn-versioned/chunks/chunk.AD3RLPIJ.js +1 -1
  21. package/cdn-versioned/chunks/chunk.AOLFDR44.js +1 -1
  22. package/cdn-versioned/chunks/chunk.AWLGV3BD.js +1 -1
  23. package/cdn-versioned/chunks/chunk.AXOCHBBU.js +1 -1
  24. package/cdn-versioned/chunks/chunk.BBD6RMZH.js +1 -1
  25. package/cdn-versioned/chunks/chunk.BGEMBVJV.js +1 -1
  26. package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
  27. package/cdn-versioned/chunks/chunk.CMIXQ7JH.js +1 -1
  28. package/cdn-versioned/chunks/chunk.CMMWC4RI.js +1 -1
  29. package/cdn-versioned/chunks/chunk.EADKGOFJ.js +1 -1
  30. package/cdn-versioned/chunks/chunk.ELCOIK5P.js +1 -1
  31. package/cdn-versioned/chunks/chunk.FA5R7CKW.js +1 -1
  32. package/cdn-versioned/chunks/chunk.FCFA3AM7.js +1 -1
  33. package/cdn-versioned/chunks/chunk.GGXUEKTA.js +4 -4
  34. package/cdn-versioned/chunks/chunk.GYKZUJLA.js +1 -1
  35. package/cdn-versioned/chunks/chunk.H3RLFSFE.js +4 -4
  36. package/cdn-versioned/chunks/chunk.HAFUAYZZ.js +1 -1
  37. package/cdn-versioned/chunks/chunk.HDPQFCGV.js +1 -1
  38. package/cdn-versioned/chunks/chunk.IFNRX7KW.js +1 -1
  39. package/cdn-versioned/chunks/chunk.IHA7PGG2.js +1 -1
  40. package/cdn-versioned/chunks/chunk.IRWE4TYN.js +1 -1
  41. package/cdn-versioned/chunks/chunk.JUPXHQZ3.js +1 -1
  42. package/cdn-versioned/chunks/chunk.KWDCB5GN.js +1 -1
  43. package/cdn-versioned/chunks/chunk.LAFGNWFC.js +1 -1
  44. package/cdn-versioned/chunks/chunk.LDAMQCO2.js +1 -1
  45. package/cdn-versioned/chunks/chunk.LNX7ZKW3.js +1 -1
  46. package/cdn-versioned/chunks/chunk.MGVRJCCE.js +1 -1
  47. package/cdn-versioned/chunks/chunk.NFHVSI66.js +1 -1
  48. package/cdn-versioned/chunks/chunk.PQFPJ45Y.js +1 -1
  49. package/cdn-versioned/chunks/chunk.R2G6FMES.js +1 -1
  50. package/cdn-versioned/chunks/chunk.R4DOCTBU.js +1 -1
  51. package/cdn-versioned/chunks/chunk.RISDA2AI.js +1 -1
  52. package/cdn-versioned/chunks/chunk.S53XPYBW.js +1 -1
  53. package/cdn-versioned/chunks/chunk.SBIDVQ2E.js +1 -1
  54. package/cdn-versioned/chunks/chunk.SBU6FGLK.js +1 -1
  55. package/cdn-versioned/chunks/chunk.SHKBYZWU.js +1 -1
  56. package/cdn-versioned/chunks/chunk.U6FV3MPT.js +3 -3
  57. package/cdn-versioned/chunks/chunk.V4CRJJ5B.js +1 -1
  58. package/cdn-versioned/chunks/chunk.V7ZZFRHA.js +1 -1
  59. package/cdn-versioned/chunks/chunk.VPGQTCNG.js +1 -1
  60. package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
  61. package/cdn-versioned/chunks/chunk.WXLNA4GN.js +1 -1
  62. package/cdn-versioned/chunks/chunk.XMUDHBRG.js +1 -1
  63. package/cdn-versioned/chunks/chunk.XRBNH2NJ.js +1 -1
  64. package/cdn-versioned/chunks/chunk.YOYAMVUH.js +1 -1
  65. package/cdn-versioned/chunks/chunk.YVTCC5NZ.js +1 -1
  66. package/cdn-versioned/chunks/chunk.Z4UTG2XJ.js +1 -1
  67. package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
  68. package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  69. package/cdn-versioned/components/animation/animation.d.ts +1 -1
  70. package/cdn-versioned/components/audio/audio.d.ts +1 -1
  71. package/cdn-versioned/components/badge/badge.d.ts +1 -1
  72. package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
  73. package/cdn-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  74. package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  75. package/cdn-versioned/components/button/button.d.ts +1 -1
  76. package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
  77. package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
  78. package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  79. package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
  80. package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  81. package/cdn-versioned/components/combobox/combobox.d.ts +1 -1
  82. package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
  83. package/cdn-versioned/components/divider/divider.d.ts +1 -1
  84. package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
  85. package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
  86. package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
  87. package/cdn-versioned/components/flipcard/flipcard.d.ts +1 -1
  88. package/cdn-versioned/components/header/header.d.ts +1 -1
  89. package/cdn-versioned/components/icon/icon.d.ts +1 -1
  90. package/cdn-versioned/components/include/include.d.ts +1 -1
  91. package/cdn-versioned/components/input/input.d.ts +1 -1
  92. package/cdn-versioned/components/link/link.d.ts +1 -1
  93. package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
  94. package/cdn-versioned/components/menu/menu.d.ts +1 -1
  95. package/cdn-versioned/components/menu-item/menu-item.d.ts +1 -1
  96. package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  97. package/cdn-versioned/components/notification/notification.d.ts +1 -1
  98. package/cdn-versioned/components/optgroup/optgroup.d.ts +1 -1
  99. package/cdn-versioned/components/option/option.d.ts +1 -1
  100. package/cdn-versioned/components/popup/popup.d.ts +1 -1
  101. package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
  102. package/cdn-versioned/components/radio/radio.d.ts +1 -1
  103. package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
  104. package/cdn-versioned/components/radio-group/radio-group.d.ts +1 -1
  105. package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
  106. package/cdn-versioned/components/select/select.d.ts +1 -1
  107. package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
  108. package/cdn-versioned/components/step/step.d.ts +1 -1
  109. package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
  110. package/cdn-versioned/components/switch/switch.d.ts +1 -1
  111. package/cdn-versioned/components/tab/tab.d.ts +1 -1
  112. package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
  113. package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  114. package/cdn-versioned/components/tag/tag.d.ts +1 -1
  115. package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
  116. package/cdn-versioned/components/tooltip/tooltip.d.ts +2 -1
  117. package/cdn-versioned/components/tooltip/tooltip.js +1 -1
  118. package/cdn-versioned/components/video/video.d.ts +1 -1
  119. package/cdn-versioned/custom-elements.json +230 -230
  120. package/cdn-versioned/internal/form.js +3 -3
  121. package/cdn-versioned/solid-components.bundle.js +16 -16
  122. package/cdn-versioned/solid-components.css +2 -2
  123. package/cdn-versioned/solid-components.iife.js +16 -16
  124. package/cdn-versioned/solid-components.js +1 -1
  125. package/cdn-versioned/vscode.html-custom-data.json +87 -87
  126. package/cdn-versioned/web-types.json +148 -148
  127. package/dist/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +5 -1
  128. package/dist/components/tooltip/tooltip.d.ts +1 -0
  129. package/dist/components/tooltip/tooltip.js +2 -1
  130. package/dist/custom-elements.json +1 -1
  131. package/dist/solid-components.js +4 -4
  132. package/dist/web-types.json +1 -1
  133. package/dist-versioned/chunks/chunk.2VDSJ75Q.js +2 -2
  134. package/dist-versioned/chunks/chunk.3JIBD4DC.js +4 -4
  135. package/dist-versioned/chunks/chunk.3PUMOBIO.js +1 -1
  136. package/dist-versioned/chunks/chunk.47VXT6XF.js +2 -2
  137. package/dist-versioned/chunks/chunk.4Z5MLLDU.js +2 -2
  138. package/dist-versioned/chunks/chunk.5UQ6EJAW.js +1 -1
  139. package/dist-versioned/chunks/chunk.5XKGAQGU.js +26 -26
  140. package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
  141. package/dist-versioned/chunks/chunk.6ID5BKH5.js +2 -2
  142. package/dist-versioned/chunks/chunk.6SZYSES2.js +1 -1
  143. package/dist-versioned/chunks/chunk.7EMNYFIP.js +1 -1
  144. package/dist-versioned/chunks/chunk.7VIYCZ4Z.js +14 -14
  145. package/dist-versioned/chunks/chunk.7ZISZOWN.js +2 -2
  146. package/dist-versioned/chunks/chunk.AQKWXHIC.js +2 -2
  147. package/dist-versioned/chunks/chunk.BK4CYVLA.js +2 -2
  148. package/dist-versioned/chunks/chunk.EIUEZZ5G.js +12 -12
  149. package/dist-versioned/chunks/chunk.EO5MCLIR.js +2 -2
  150. package/dist-versioned/chunks/chunk.FDQQDXKD.js +1 -1
  151. package/dist-versioned/chunks/chunk.FDUVN4I6.js +6 -6
  152. package/dist-versioned/chunks/chunk.FFAUGMVF.js +3 -3
  153. package/dist-versioned/chunks/chunk.FUGGYSQF.js +6 -6
  154. package/dist-versioned/chunks/chunk.I6NQOQEO.js +3 -3
  155. package/dist-versioned/chunks/chunk.JJTGSFOV.js +3 -3
  156. package/dist-versioned/chunks/chunk.JUUDZ47Q.js +1 -1
  157. package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
  158. package/dist-versioned/chunks/chunk.KFVC6XFD.js +2 -2
  159. package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
  160. package/dist-versioned/chunks/chunk.MEDUZPGV.js +4 -4
  161. package/dist-versioned/chunks/chunk.MEHX7EVL.js +3 -3
  162. package/dist-versioned/chunks/chunk.MQ5VT5VP.js +2 -2
  163. package/dist-versioned/chunks/chunk.N3MU3643.js +1 -1
  164. package/dist-versioned/chunks/chunk.N7WBIQUG.js +5 -5
  165. package/dist-versioned/chunks/chunk.P4UKJXBL.js +3 -3
  166. package/dist-versioned/chunks/chunk.PP5IDYES.js +1 -1
  167. package/dist-versioned/chunks/chunk.QS7N47CI.js +6 -6
  168. package/dist-versioned/chunks/chunk.R2XG3O7O.js +1 -1
  169. package/dist-versioned/chunks/chunk.RGFFEJMJ.js +3 -3
  170. package/dist-versioned/chunks/chunk.SW6AKO54.js +12 -12
  171. package/dist-versioned/chunks/chunk.TQMYNSM4.js +1 -1
  172. package/dist-versioned/chunks/chunk.TWDHTS5K.js +1 -1
  173. package/dist-versioned/chunks/chunk.TX6S5UVP.js +11 -11
  174. package/dist-versioned/chunks/chunk.UAADOLK5.js +1 -1
  175. package/dist-versioned/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +10 -6
  176. package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
  177. package/dist-versioned/chunks/chunk.UJHYOR23.js +5 -5
  178. package/dist-versioned/chunks/chunk.UJHYUCHT.js +2 -2
  179. package/dist-versioned/chunks/chunk.UQ55GFI3.js +3 -3
  180. package/dist-versioned/chunks/chunk.VFG2SXVE.js +8 -8
  181. package/dist-versioned/chunks/chunk.WEUFN5UU.js +24 -24
  182. package/dist-versioned/chunks/chunk.WL7EGHGP.js +2 -2
  183. package/dist-versioned/chunks/chunk.WSEY3LJE.js +4 -4
  184. package/dist-versioned/chunks/chunk.XKFVXICF.js +3 -3
  185. package/dist-versioned/chunks/chunk.YGVCQCO4.js +2 -2
  186. package/dist-versioned/chunks/chunk.YRFRBXRK.js +1 -1
  187. package/dist-versioned/chunks/chunk.ZCI47J45.js +1 -1
  188. package/dist-versioned/chunks/chunk.ZF7CPAC2.js +5 -5
  189. package/dist-versioned/chunks/chunk.ZSZ2IB2L.js +2 -2
  190. package/dist-versioned/chunks/chunk.ZVLZ6XOK.js +2 -2
  191. package/dist-versioned/components/accordion/accordion.d.ts +1 -1
  192. package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
  193. package/dist-versioned/components/animation/animation.d.ts +1 -1
  194. package/dist-versioned/components/audio/audio.d.ts +1 -1
  195. package/dist-versioned/components/badge/badge.d.ts +1 -1
  196. package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
  197. package/dist-versioned/components/breadcrumb/breadcrumb.d.ts +1 -1
  198. package/dist-versioned/components/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  199. package/dist-versioned/components/button/button.d.ts +1 -1
  200. package/dist-versioned/components/button-group/button-group.d.ts +1 -1
  201. package/dist-versioned/components/carousel/carousel.d.ts +1 -1
  202. package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
  203. package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
  204. package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
  205. package/dist-versioned/components/combobox/combobox.d.ts +1 -1
  206. package/dist-versioned/components/dialog/dialog.d.ts +1 -1
  207. package/dist-versioned/components/divider/divider.d.ts +1 -1
  208. package/dist-versioned/components/drawer/drawer.d.ts +1 -1
  209. package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
  210. package/dist-versioned/components/expandable/expandable.d.ts +1 -1
  211. package/dist-versioned/components/flipcard/flipcard.d.ts +1 -1
  212. package/dist-versioned/components/header/header.d.ts +1 -1
  213. package/dist-versioned/components/icon/icon.d.ts +1 -1
  214. package/dist-versioned/components/include/include.d.ts +1 -1
  215. package/dist-versioned/components/input/input.d.ts +1 -1
  216. package/dist-versioned/components/link/link.d.ts +1 -1
  217. package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
  218. package/dist-versioned/components/menu/menu.d.ts +1 -1
  219. package/dist-versioned/components/menu-item/menu-item.d.ts +1 -1
  220. package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
  221. package/dist-versioned/components/notification/notification.d.ts +1 -1
  222. package/dist-versioned/components/optgroup/optgroup.d.ts +1 -1
  223. package/dist-versioned/components/option/option.d.ts +1 -1
  224. package/dist-versioned/components/popup/popup.d.ts +1 -1
  225. package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
  226. package/dist-versioned/components/radio/radio.d.ts +1 -1
  227. package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
  228. package/dist-versioned/components/radio-group/radio-group.d.ts +1 -1
  229. package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
  230. package/dist-versioned/components/select/select.d.ts +1 -1
  231. package/dist-versioned/components/spinner/spinner.d.ts +1 -1
  232. package/dist-versioned/components/step/step.d.ts +1 -1
  233. package/dist-versioned/components/step-group/step-group.d.ts +1 -1
  234. package/dist-versioned/components/switch/switch.d.ts +1 -1
  235. package/dist-versioned/components/tab/tab.d.ts +1 -1
  236. package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
  237. package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
  238. package/dist-versioned/components/tag/tag.d.ts +1 -1
  239. package/dist-versioned/components/textarea/textarea.d.ts +1 -1
  240. package/dist-versioned/components/tooltip/tooltip.d.ts +2 -1
  241. package/dist-versioned/components/tooltip/tooltip.js +2 -1
  242. package/dist-versioned/components/video/video.d.ts +1 -1
  243. package/dist-versioned/custom-elements.json +230 -230
  244. package/dist-versioned/internal/form.js +3 -3
  245. package/dist-versioned/solid-components.css +2 -2
  246. package/dist-versioned/solid-components.js +4 -4
  247. package/dist-versioned/vscode.html-custom-data.json +87 -87
  248. package/dist-versioned/web-types.json +148 -148
  249. package/package.json +1 -1
  250. package/cdn/chunks/chunk.FCYUK5NR.js +0 -4
  251. package/cdn-versioned/chunks/chunk.FCYUK5NR.js +0 -4
@@ -1,11 +1,11 @@
1
- import{a as M}from"./chunk.CDC46OKY.js";import{c as I}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.6HLS5XU2.js";import{a as z}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.N2OPZHJV.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as D}from"./chunk.GHC63SXL.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as r,c as u,d as c,g as E,h as x}from"./chunk.HDPQFCGV.js";import{b as T,e as p}from"./chunk.UWPDCU52.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-5-10-0-input"]});this.hasSlotController=new z(this,"help-text","label");this.localize=new D(this);this.typeToSelectString="";this.displayLabel="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-10-0-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
1
+ import{a as M}from"./chunk.CDC46OKY.js";import{c as I}from"./chunk.3L472FD4.js";import{b as L}from"./chunk.6HLS5XU2.js";import{a as z}from"./chunk.CGQ2BPPZ.js";import{a as w,c as O}from"./chunk.SKUMYG4O.js";import{a as C}from"./chunk.KLRPP4NQ.js";import{a as k}from"./chunk.N2OPZHJV.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as D}from"./chunk.GHC63SXL.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as $,b as r,c as u,d as c,g as E,h as x}from"./chunk.HDPQFCGV.js";import{b as T,e as p}from"./chunk.UWPDCU52.js";import{b as g,e as y}from"./chunk.6OTM3PE5.js";import{e as s}from"./chunk.TJOCV4DC.js";var i=class extends x{constructor(){super(...arguments);this.formControlController=new L(this,{assumeInteractionOn:["sd-blur","sd-5-10-1-input"]});this.hasSlotController=new z(this,"help-text","label");this.localize=new D(this);this.typeToSelectString="";this.displayLabel="";this.deletedTagLabel="";this.hasFocus=!1;this.selectedOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.defaultValue="";this.open=!1;this.size="lg";this.placement="bottom";this.label="";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.helpText="";this.currentPlacement=this.placement;this.clearable=!1;this.multiple=!1;this.useTags=!1;this.maxOptionsVisible=3;this.form="";this.name="";this.value="";this.required=!1;this.styleOnValid=!1;this.hoist=!1;this.getTag=t=>p`<sd-5-10-1-tag class="relative z-10" ?disabled="${this.disabled}" part="tag" exportparts="
2
2
  base:tag__base,
3
3
  content:tag__content,
4
4
  removable-indicator:tag__removable-indicator,
5
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-10-0-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,l=e.closest(".select__clear")!==null,o=e.closest("sd-5-10-0-icon-button")!==null;if(!(l||o)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),a=h.indexOf(this.currentOption),n=Math.max(0,a);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(n=a+1,n>h.length-1&&(n=0)):t.key==="ArrowUp"?(n=a-1,n<0&&(n=h.length-1)):t.key==="Home"?n=0:t.key==="End"&&(n=h.length-1),this.setCurrentOption(h[n],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let a of h)if(a.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(a);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var l,o,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let a=(l=t.currentTarget)==null?void 0:l.parentElement,n=(o=a==null?void 0:a.previousElementSibling)==null?void 0:o.querySelector("sd-5-10-0-tag"),m=(h=a==null?void 0:a.nextElementSibling)==null?void 0:h.querySelector("sd-5-10-0-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():n?n.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var l;let e=(l=this.shadowRoot)==null?void 0:l.querySelectorAll("sd-5-10-0-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let l=t.composedPath().some(o=>o instanceof HTMLSlotElement&&o.name==="removable-indicator");this.disabled||l||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let l=t.target.closest("sd-5-10-0-option"),o=this.value;l&&!l.disabled&&(this.multiple?this.toggleOptionSelection(l):this.setSelectedOptions(l),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==o&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],l=[];customElements.get("sd-5-10-0-option")?(t.forEach(o=>{this.multiple&&(o.checkbox=!0),l.push(o.value)}),this.setSelectedOptions(t.filter(o=>e.includes(o.value)))):customElements.whenDefined("sd-5-10-0-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-10-0-option")]}getFirstOption(){return this.querySelector("sd-5-10-0-option")}setCurrentOption(t,e){this.getAllOptions().forEach(o=>{o.current=!1,o.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(o.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),l=Array.isArray(t)?t:[t];e.forEach(o=>o.selected=!1),l.length&&l.forEach(o=>o.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}selectionChanged(t){var e,l,o,h;t&&this.multiple?this.selectedOptions.find(a=>a.value===t.value)?this.selectedOptions=this.selectedOptions.filter(a=>a.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(a=>a.selected),this.multiple?(this.value=this.selectedOptions.map(a=>a.value),this.useTags||this.value.length===0?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(l=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?l:"",this.displayLabel=(h=(o=this.selectedOptions[0])==null?void 0:o.getTextLabel())!=null?h:""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let l=this.getTag(t,e);return p`<div @sd-remove="${o=>this.handleTagRemove(o,t)}">${typeof l=="string"?k(l):l}</div>`}return[p``]}):[p`<sd-5-10-0-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
5
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-10-1-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let e=t.target,l=e.closest(".select__clear")!==null,o=e.closest("sd-5-10-1-icon-button")!==null;if(!(l||o)){if(t.key==="Escape"&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.combobox.focus({preventScroll:!0})),t.key==="Enter"||t.key===" "&&this.typeToSelectString===""){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open){this.show(),this.setCurrentOption(this.currentOption||this.getFirstOption(),t);return}this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})));return}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){let h=this.getAllOptions(),a=h.indexOf(this.currentOption),n=Math.max(0,a);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;t.key==="ArrowDown"?(n=a+1,n>h.length-1&&(n=0)):t.key==="ArrowUp"?(n=a-1,n<0&&(n=h.length-1)):t.key==="Home"?n=0:t.key==="End"&&(n=h.length-1),this.setCurrentOption(h[n],t)}if(t.key.length===1||t.key==="Backspace"){let h=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if(t.key==="Backspace")return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>this.typeToSelectString="",1e3),t.key==="Backspace"?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(let a of h)if(a.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(a);break}}}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){this.applySizeToOptions()}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){var l,o,h;if((t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple){t.preventDefault(),t.stopPropagation();let a=(l=t.currentTarget)==null?void 0:l.parentElement,n=(o=a==null?void 0:a.previousElementSibling)==null?void 0:o.querySelector("sd-5-10-1-tag"),m=(h=a==null?void 0:a.nextElementSibling)==null?void 0:h.querySelector("sd-5-10-1-tag");this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>{m?m.focus():n?n.focus():this.focus({preventScroll:!0})})}}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>{var l;let e=(l=this.shadowRoot)==null?void 0:l.querySelectorAll("sd-5-10-1-tag");e&&e.length>0?e==null||e[(e==null?void 0:e.length)-1].focus():this.focus({preventScroll:!0})}))}handleLabelClick(){this.combobox.focus()}handleComboboxMouseDown(t){let l=t.composedPath().some(o=>o instanceof HTMLSlotElement&&o.name==="removable-indicator");this.disabled||l||this.visuallyDisabled||(t.preventDefault(),this.combobox.focus({preventScroll:!0}),this.open=!this.open,this.setCurrentOption(this.currentOption||this.getFirstOption(),t))}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearSelect()}clearSelect(){this.setSelectedOptions([]),this.combobox.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let l=t.target.closest("sd-5-10-1-option"),o=this.value;l&&!l.disabled&&(this.multiple?this.toggleOptionSelection(l):this.setSelectedOptions(l),this.updateComplete.then(()=>this.combobox.focus({preventScroll:!0})),this.value!==o&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.combobox.focus({preventScroll:!0})))}handleDefaultSlotChange(){let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],l=[];customElements.get("sd-5-10-1-option")?(t.forEach(o=>{this.multiple&&(o.checkbox=!0),l.push(o.value)}),this.setSelectedOptions(t.filter(o=>e.includes(o.value)))):customElements.whenDefined("sd-5-10-1-option").then(()=>this.handleDefaultSlotChange())}handleTagRemove(t,e){t.stopPropagation(),e||this.clearSelect(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}))}getAllOptions(){return[...this.querySelectorAll("sd-5-10-1-option")]}getFirstOption(){return this.querySelector("sd-5-10-1-option")}setCurrentOption(t,e){this.getAllOptions().forEach(o=>{o.current=!1,o.tabIndex=-1,((e==null?void 0:e.type)==="keydown"||(e==null?void 0:e.type)==="mousedown")&&(o.isKeyboardFocus=!1)}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus()),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}setSelectedOptions(t){let e=this.getAllOptions(),l=Array.isArray(t)?t:[t];e.forEach(o=>o.selected=!1),l.length&&l.forEach(o=>o.selected=!0),Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}toggleOptionSelection(t,e){e===!0||e===!1?t.selected=e:t.selected=!t.selected,Array.isArray(t)?this.selectionChanged():this.selectionChanged(t)}selectionChanged(t){var e,l,o,h;t&&this.multiple?this.selectedOptions.find(a=>a.value===t.value)?this.selectedOptions=this.selectedOptions.filter(a=>a.value!==t.value):this.selectedOptions=[...this.selectedOptions,t]:this.selectedOptions=this.getAllOptions().filter(a=>a.selected),this.multiple?(this.value=this.selectedOptions.map(a=>a.value),this.useTags||this.value.length===0?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(l=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?l:"",this.displayLabel=(h=(o=this.selectedOptions[0])==null?void 0:o.getTextLabel())!=null?h:""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let l=this.getTag(t,e);return p`<div @sd-remove="${o=>this.handleTagRemove(o,t)}">${typeof l=="string"?k(l):l}</div>`}return[p``]}):[p`<sd-5-10-1-tag class="z-10" ?disabled="${this.disabled}" part="tag" exportparts="
6
6
  base:tag__base,
7
7
  content:tag__content,
8
8
  removable-indicator:tag__removable-indicator,
9
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-10-0-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-10-0-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.multiple||this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(l=>e.includes(l.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,l=this.helpText?!0:!!t.helpText,o=this.clearable&&!this.disabled,h=!!t.tooltip,a=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",n,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",a==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-10-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
9
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-10-1-tag>`]}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){let t=this.getAllOptions();customElements.get("sd-5-10-1-option")&&t.forEach(e=>{e.checkbox=this.multiple})}handleDisabledChange(){(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.multiple||this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await y(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)});let{keyframes:t,options:e}=O(this,"select.show",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.currentOption&&I(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await y(this);let{keyframes:t,options:e}=O(this,"select.hide",{dir:this.localize.dir()});await g(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach(t=>{t.size=this.size})}handleValueChange(){if(this.selectedOptions.length===(Array.isArray(this.value)?this.value.length:1))return;let t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter(l=>e.includes(l.value)))}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,C(this,"sd-after-show")}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.open=!1,C(this,"sd-after-hide")}checkValidity(){var t;return(t=this.valueInput)==null?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.combobox.focus(t)}blur(){this.combobox.blur()}render(){let t={default:this.hasSlotController.test("[default]"),label:this.hasSlotController.test("label"),clearIcon:this.hasSlotController.test("clear-icon"),expandIcon:this.hasSlotController.test("expand-icon"),helpText:this.hasSlotController.test("help-text"),tooltip:this.hasSlotController.test("tooltip")},e=this.label?!0:!!t.label,l=this.helpText?!0:!!t.helpText,o=this.clearable&&!this.disabled,h=!!t.tooltip,a=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],f={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",n,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><span class="sr-only" aria-live="polite">${this.deletedTagLabel}</span> ${e||h?p`<div class="flex items-center gap-1 mb-2"><label id="label" part="form-control-label" class="${e&&"inline-block"}" aria-hidden="${e?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> ${t.tooltip?p`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${d("relative w-full bg-white",a==="disabled"?"text-neutral-500":"text-black")}"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-10-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
10
10
  popup:popup__content,
11
- "><div class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-0-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-10-0-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-10-0-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-10-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-10-0-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="status-check"></sd-5-10-0-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-10-0-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-10-0-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",n,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-10-0-popup></div><div class="text-sm text-neutral-700 mt-2" part="form-control-help-text" id="help-text" aria-hidden="${l?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-10-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-10-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-10-0-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-10-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-10-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}`],s([E({selector:"sd-5-10-0-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-10-0-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"displayLabel",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([r({type:Boolean,reflect:!0})],i.prototype,"open",2),s([r({type:String,reflect:!0})],i.prototype,"size",2),s([r({type:String,reflect:!0})],i.prototype,"placement",2),s([r({type:String,reflect:!0})],i.prototype,"label",2),s([r({type:String,reflect:!0})],i.prototype,"placeholder",2),s([r({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([r({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([r({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([r({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([r({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([r({reflect:!0})],i.prototype,"form",2),s([r({reflect:!0})],i.prototype,"name",2),s([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([r({type:Boolean,reflect:!0})],i.prototype,"required",2),s([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([r({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([r()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-10-0-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
11
+ "><div class="${d("relative w-full h-full grid grid-cols-1 rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200")}" slot="anchor"><div class="${d("input-container flex items-center w-full h-full px-4",{sm:"py-1",md:"py-1",lg:"py-2"}[this.size])}"><input name="${this.name}" form="${this.form}" part="display-input" class="${d("top-0 left-0 appearance-none outline-none flex-grow bg-transparent w-full placeholder-neutral-700",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" .disabled="${this.disabled}" placeholder="${this.placeholder||this.localize.term("selectDefaultPlaceholder")}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="help-text invalid-message" role="combobox" tabindex="-1"> ${this.multiple&&this.useTags?p`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""}<div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(v=>v==null?void 0:v.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("select__clear flex justify-center",m,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-1-icon class="${d("text-neutral-700 z-10",f)}" library="_internal" name="closing-round"></sd-5-10-1-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-10-1-icon part="invalid-icon" class="${d(m,f,"text-error")}" library="_internal" name="risk"></sd-5-10-1-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-10-1-icon part="valid-icon" class="${d("flex-shrink-0 text-success",m,f)}" library="_internal" name="status-check"></sd-5-10-1-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${d("inline-flex ml-2 items-center transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",f)}"><sd-5-10-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor"></sd-5-10-1-icon></slot></div><button part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default focus-visible:outline-none",n,this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]"}[this.size])}" type="button" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-labelledby="label"></button></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-5-10-1-popup></div><div class="text-sm text-neutral-700 mt-2" part="form-control-help-text" id="help-text" aria-hidden="${l?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};i.styles=[...x.styles,T`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}[part=listbox]{max-height:var(--auto-size-available-height,auto)}.input-container,[part=combobox]{grid-column:1/1;grid-row:1/1}sd-5-10-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-10-1-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-10-1-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-10-1-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-10-1-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}`],s([E({selector:"sd-5-10-1-option"})],i.prototype,"_optionsInDefaultSlot",2),s([c("sd-5-10-1-popup")],i.prototype,"popup",2),s([c('[part="combobox"]')],i.prototype,"combobox",2),s([c('[part="display-input"]')],i.prototype,"displayInput",2),s([c(".value-input")],i.prototype,"valueInput",2),s([c('[part="listbox"]')],i.prototype,"listbox",2),s([c("#invalid-message")],i.prototype,"invalidMessage",2),s([u()],i.prototype,"displayLabel",2),s([u()],i.prototype,"deletedTagLabel",2),s([u()],i.prototype,"hasFocus",2),s([u()],i.prototype,"currentOption",2),s([u()],i.prototype,"selectedOptions",2),s([u()],i.prototype,"showValidStyle",2),s([u()],i.prototype,"showInvalidStyle",2),s([M()],i.prototype,"defaultValue",2),s([r({type:Boolean,reflect:!0})],i.prototype,"open",2),s([r({type:String,reflect:!0})],i.prototype,"size",2),s([r({type:String,reflect:!0})],i.prototype,"placement",2),s([r({type:String,reflect:!0})],i.prototype,"label",2),s([r({type:String,reflect:!0})],i.prototype,"placeholder",2),s([r({type:String,attribute:"max-options-tag-label",reflect:!0})],i.prototype,"maxOptionsTagLabel",2),s([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),s([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],i.prototype,"visuallyDisabled",2),s([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),s([u()],i.prototype,"currentPlacement",2),s([r({type:Boolean,reflect:!0})],i.prototype,"clearable",2),s([r({type:Boolean,reflect:!0})],i.prototype,"multiple",2),s([r({type:Boolean,reflect:!0})],i.prototype,"useTags",2),s([r({attribute:"max-options-visible",type:Number,reflect:!0})],i.prototype,"maxOptionsVisible",2),s([r({reflect:!0})],i.prototype,"form",2),s([r({reflect:!0})],i.prototype,"name",2),s([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],i.prototype,"value",2),s([r({type:Boolean,reflect:!0})],i.prototype,"required",2),s([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],i.prototype,"styleOnValid",2),s([r({type:Boolean,reflect:!0})],i.prototype,"hoist",2),s([r()],i.prototype,"getTag",2),s([b("useTags",{waitUntilFirstUpdate:!0})],i.prototype,"handleUseTagsChange",1),s([b(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],i.prototype,"handleDisabledChange",1),s([b("open",{waitUntilFirstUpdate:!0})],i.prototype,"handleOpenChange",1),s([b("size",{waitUntilFirstUpdate:!0})],i.prototype,"applySizeToOptions",1),s([b("value",{waitUntilFirstUpdate:!0})],i.prototype,"handleValueChange",1),i=s([$("sd-5-10-1-select")],i);w("select.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});w("select.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{i as a};
@@ -1 +1 @@
1
- import{a as d}from"./chunk.URI32NHH.js";import{a as b}from"./chunk.CDC46OKY.js";import{b as m}from"./chunk.6HLS5XU2.js";import{a as p}from"./chunk.YTG5BN3U.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as h,b as r,c,d as s,h as o}from"./chunk.HDPQFCGV.js";import{b as u,e as a}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,f)=>e.checked=f});this.title="";this.name="";this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(e){if(this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false"),this.formControlController.setValidity(e)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.visuallyDisabled?"visuallyDisabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return a`<label part="base" class="${l("sd-5-10-0-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",(this.disabled||this.visuallyDisabled)&&"hover:cursor-not-allowed",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${p(this.value)}" .indeterminate="${d(this.indeterminate)}" .checked="${d(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.indeterminate?"mixed":this.checked}" aria-describedby="invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${l("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4","transition-colors ease-in-out duration-medium group-hover:duration-fast","peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-primary",{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"><div class="${l("absolute h-3 transition-[width] right-0.25 duration-medium",this.checked?"w-0":"w-3")}"><div class="${l("w-full h-full transition-colors duration-medium ease-in-out group-hover:duration-fast",{disabledIndeterminate:"bg-neutral-500",disabledChecked:" bg-neutral-500",disabled:"",visuallyDisabled:"",invalidIndeterminate:" bg-error group-hover:bg-error-400",invalid:"group-hover:bg-neutral-200",filled:"bg-accent group-hover:bg-accent-550",default:"hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"></div></div>${this.checked?a`<sd-5-10-0-icon part="checked-icon" class="text-white w-3 h-3" library="_internal" name="status-check"></sd-5-10-0-icon>`:""} ${!this.checked&&this.indeterminate?a`<sd-5-10-0-icon part="indeterminate-icon" class="text-white w-3 h-3" library="_internal" name="status-minus"></sd-5-10-0-icon>`:""} </span><span part="label" id="label" class="${l("select-none inline-block ml-2",this.disabled||this.visuallyDisabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};t.styles=[...o.styles,u`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-width:0}:host([required]) #label:after{content:" *"}`],i([s('input[type="checkbox"]')],t.prototype,"input",2),i([s("#invalid-message")],t.prototype,"invalidMessage",2),i([r({type:String,reflect:!0})],t.prototype,"title",2),i([r({type:String,reflect:!0})],t.prototype,"name",2),i([r()],t.prototype,"value",2),i([r({type:String,reflect:!0})],t.prototype,"size",2),i([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([r({type:Boolean,reflect:!0})],t.prototype,"checked",2),i([r({type:Boolean,reflect:!0})],t.prototype,"indeterminate",2),i([b("checked")],t.prototype,"defaultChecked",2),i([r({type:String,reflect:!0})],t.prototype,"form",2),i([r({type:Boolean,reflect:!0})],t.prototype,"required",2),i([c()],t.prototype,"showInvalidStyle",2),i([n(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([n(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],t.prototype,"handleStateChange",1),t=i([h("sd-5-10-0-checkbox")],t);export{t as a};
1
+ import{a as d}from"./chunk.URI32NHH.js";import{a as b}from"./chunk.CDC46OKY.js";import{b as m}from"./chunk.6HLS5XU2.js";import{a as p}from"./chunk.YTG5BN3U.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as h,b as r,c,d as s,h as o}from"./chunk.HDPQFCGV.js";import{b as u,e as a}from"./chunk.UWPDCU52.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.formControlController=new m(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,f)=>e.checked=f});this.title="";this.name="";this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1;this.indeterminate=!1;this.defaultChecked=!1;this.form="";this.required=!1;this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(e){if(this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false"),this.formControlController.setValidity(e)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.visuallyDisabled?"visuallyDisabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return a`<label part="base" class="${l("sd-5-10-1-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",(this.disabled||this.visuallyDisabled)&&"hover:cursor-not-allowed",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${p(this.value)}" .indeterminate="${d(this.indeterminate)}" .checked="${d(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.indeterminate?"mixed":this.checked}" aria-describedby="invalid-message" aria-invalid="${this.showInvalidStyle}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${l("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4","transition-colors ease-in-out duration-medium group-hover:duration-fast","peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-primary",{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"><div class="${l("absolute h-3 transition-[width] right-0.25 duration-medium",this.checked?"w-0":"w-3")}"><div class="${l("w-full h-full transition-colors duration-medium ease-in-out group-hover:duration-fast",{disabledIndeterminate:"bg-neutral-500",disabledChecked:" bg-neutral-500",disabled:"",visuallyDisabled:"",invalidIndeterminate:" bg-error group-hover:bg-error-400",invalid:"group-hover:bg-neutral-200",filled:"bg-accent group-hover:bg-accent-550",default:"hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}"></div></div>${this.checked?a`<sd-5-10-1-icon part="checked-icon" class="text-white w-3 h-3" library="_internal" name="status-check"></sd-5-10-1-icon>`:""} ${!this.checked&&this.indeterminate?a`<sd-5-10-1-icon part="indeterminate-icon" class="text-white w-3 h-3" library="_internal" name="status-minus"></sd-5-10-1-icon>`:""} </span><span part="label" id="label" class="${l("select-none inline-block ml-2",this.disabled||this.visuallyDisabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};t.styles=[...o.styles,u`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-width:0}:host([required]) #label:after{content:" *"}`],i([s('input[type="checkbox"]')],t.prototype,"input",2),i([s("#invalid-message")],t.prototype,"invalidMessage",2),i([r({type:String,reflect:!0})],t.prototype,"title",2),i([r({type:String,reflect:!0})],t.prototype,"name",2),i([r()],t.prototype,"value",2),i([r({type:String,reflect:!0})],t.prototype,"size",2),i([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([r({type:Boolean,reflect:!0})],t.prototype,"checked",2),i([r({type:Boolean,reflect:!0})],t.prototype,"indeterminate",2),i([b("checked")],t.prototype,"defaultChecked",2),i([r({type:String,reflect:!0})],t.prototype,"form",2),i([r({type:Boolean,reflect:!0})],t.prototype,"required",2),i([c()],t.prototype,"showInvalidStyle",2),i([n(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([n(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],t.prototype,"handleStateChange",1),t=i([h("sd-5-10-1-checkbox")],t);export{t as a};
@@ -1,11 +1,11 @@
1
- import{a as P}from"./chunk.CDC46OKY.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as R,e as K,f as w}from"./chunk.W7A3TU2Z.js";import{c as A}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.6HLS5XU2.js";import{a as F}from"./chunk.CGQ2BPPZ.js";import{a as M}from"./chunk.YTG5BN3U.js";import{a as E,c as C}from"./chunk.SKUMYG4O.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as $}from"./chunk.N2OPZHJV.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as V}from"./chunk.GHC63SXL.js";import{a as g}from"./chunk.E2DRD2OX.js";import{a as k,b as r,c as u,d as c,h as T}from"./chunk.HDPQFCGV.js";import{b as D,e as p}from"./chunk.UWPDCU52.js";import{b as S,e as I}from"./chunk.6OTM3PE5.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends T{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-10-0-input"]});this.hasSlotController=new F(this,"help-text","label");this.localize=new V(this);this.hasFocus=!1;this.displayInputValue="";this.selectedTextLabel="";this.selectedOptions=[];this.filteredOptions=[];this.allOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.deletedTagLabel="";this.name="";this.value="";this.defaultValue="";this.size="lg";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.clearable=!1;this.open=!1;this.hoist=!1;this.label="";this.placement="bottom";this.helpText="";this.form="";this.required=!1;this.type="text";this.currentPlacement=this.placement;this.getOption=H;this.multiple=!1;this.useTags=!0;this.maxOptionsVisible=3;this.styleOnValid=!1;this.filter=(t,e)=>{let i=w(t.value),a=w(t.getTextLabel()),n=w(e);return i.includes(n)||a.includes(n)};this.getTag=t=>p`<sd-5-10-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
1
+ import{a as P}from"./chunk.CDC46OKY.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as R,e as K,f as w}from"./chunk.W7A3TU2Z.js";import{c as A}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.6HLS5XU2.js";import{a as F}from"./chunk.CGQ2BPPZ.js";import{a as M}from"./chunk.YTG5BN3U.js";import{a as E,c as C}from"./chunk.SKUMYG4O.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as $}from"./chunk.N2OPZHJV.js";import{a as d}from"./chunk.26V4EXHB.js";import{a as V}from"./chunk.GHC63SXL.js";import{a as g}from"./chunk.E2DRD2OX.js";import{a as k,b as r,c as u,d as c,h as T}from"./chunk.HDPQFCGV.js";import{b as D,e as p}from"./chunk.UWPDCU52.js";import{b as S,e as I}from"./chunk.6OTM3PE5.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends T{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-5-10-1-input"]});this.hasSlotController=new F(this,"help-text","label");this.localize=new V(this);this.hasFocus=!1;this.displayInputValue="";this.selectedTextLabel="";this.selectedOptions=[];this.filteredOptions=[];this.allOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.deletedTagLabel="";this.name="";this.value="";this.defaultValue="";this.size="lg";this.placeholder="";this.maxOptionsTagLabel="";this.disabled=!1;this.visuallyDisabled=!1;this.clearable=!1;this.open=!1;this.hoist=!1;this.label="";this.placement="bottom";this.helpText="";this.form="";this.required=!1;this.type="text";this.currentPlacement=this.placement;this.getOption=H;this.multiple=!1;this.useTags=!0;this.maxOptionsVisible=3;this.styleOnValid=!1;this.filter=(t,e)=>{let i=w(t.value),a=w(t.getTextLabel()),n=w(e);return i.includes(n)||a.includes(n)};this.getTag=t=>p`<sd-5-10-1-tag ?disabled="${this.disabled}" part="tag" exportparts="
2
2
  base:tag__base,
3
3
  content:tag__content,
4
4
  removable-indicator:tag__removable-indicator,
5
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-10-0-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let i=t.composedPath().some(o=>o instanceof HTMLButtonElement&&o.classList.contains("combobox-button"));if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}if(!(i||t.target.closest(".combobox__clear")!==null)){if(t.key==="Escape"&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),t.key==="Backspace"&&this.multiple&&this.displayInput.value===""){this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0}));return}if(t.key==="Enter"){let o=this.getCurrentOption(),f=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!f){setTimeout(()=>{t.defaultPrevented||this.formControlController.submit()});return}if(!this.open||o!=null&&o.disabled)return;if(o&&!o.disabled){let h=this.value;this.multiple?(this.toggleOptionSelection(o),this.lastOption=o,this.setOrderedSelectedOptions(o),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(o),this.setSelectedOptions(o)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==h&&(this.emit("sd-input"),this.emit("sd-change"))})}this.displayInput.focus({preventScroll:!0}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));return}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption(t.key==="ArrowDown")),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),t.key==="Home"?this.displayInput.setSelectionRange(0,0):t.key==="End"&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){let t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(t==null?void 0:t.getTextLabel())||""}this.formControlController.updateValidity()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){let t=e=>{let i=this.displayInput.value,a=this.getOption(e,i);return e.tabIndex=0,p`${typeof a=="string"?$(a):a}`};return this.filteredOptions.map(e=>e.tagName.toLowerCase()==="sd-5-10-0-optgroup"?(Array.from(e.children).forEach(i=>{i.tagName.toLowerCase()==="sd-5-10-0-option"&&t(i)}),e):t(e))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let i=this.getTag(t,e);return p`<div @sd-remove="${a=>this.handleTagRemove(a,t)}">${typeof i=="string"?$(i):i}</div>`}return[p``]}):[p`<sd-5-10-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
5
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-5-10-1-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{let i=t.composedPath().some(o=>o instanceof HTMLButtonElement&&o.classList.contains("combobox-button"));if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}if(!(i||t.target.closest(".combobox__clear")!==null)){if(t.key==="Escape"&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),t.key==="Backspace"&&this.multiple&&this.displayInput.value===""){this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0}));return}if(t.key==="Enter"){let o=this.getCurrentOption(),f=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!f){setTimeout(()=>{t.defaultPrevented||this.formControlController.submit()});return}if(!this.open||o!=null&&o.disabled)return;if(o&&!o.disabled){let h=this.value;this.multiple?(this.toggleOptionSelection(o),this.lastOption=o,this.setOrderedSelectedOptions(o),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(o),this.setSelectedOptions(o)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==h&&(this.emit("sd-input"),this.emit("sd-change"))})}this.displayInput.focus({preventScroll:!0}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));return}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption(t.key==="ArrowDown")),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),t.key==="Home"?this.displayInput.setSelectionRange(0,0):t.key==="End"&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){let t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(t==null?void 0:t.getTextLabel())||""}this.formControlController.updateValidity()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){let t=e=>{let i=this.displayInput.value,a=this.getOption(e,i);return e.tabIndex=0,p`${typeof a=="string"?$(a):a}`};return this.filteredOptions.map(e=>e.tagName.toLowerCase()==="sd-5-10-1-optgroup"?(Array.from(e.children).forEach(i=>{i.tagName.toLowerCase()==="sd-5-10-1-option"&&t(i)}),e):t(e))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let i=this.getTag(t,e);return p`<div @sd-remove="${a=>this.handleTagRemove(a,t)}">${typeof i=="string"?$(i):i}</div>`}return[p``]}):[p`<sd-5-10-1-tag ?disabled="${this.disabled}" part="tag" exportparts="
6
6
  base:tag__base,
7
7
  content:tag__content,
8
8
  removable-indicator:tag__removable-indicator,
9
- " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-10-0-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-5-10-0-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),A(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-5-10-0-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,b,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((b=i.parentElement)==null?void 0:b.tagName.toLowerCase())==="sd-5-10-0-optgroup"))return a;let o=i.parentElement,f=(m=o.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),h=e.find(O=>O.id===o.id);if(h){h==null||h.appendChild(a),f&&(h==null||h.appendChild(f));return}let v=o.cloneNode();return v.appendChild(a),f&&v.appendChild(f),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-5-10-0-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await I(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=C(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await I(this);let{keyframes:t,options:e}=C(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return R(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return K(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-5-10-0-option")){customElements.whenDefined("sd-5-10-0-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-5-10-0-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-5-10-0-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",h=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",h,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[f],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-10-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
9
+ " size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-5-10-1-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){(t.key==="Backspace"||t.key==="Enter"||t.key===" ")&&this.multiple&&(t.preventDefault(),t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.visuallyDisabled||this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.deletedTagLabel="",this.deletedTagLabel=this.localize.term("removed",e.textContent),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){if(this.visuallyDisabled){t.preventDefault(),t.stopPropagation();return}let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-5-10-1-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>{this.displayInput.focus({preventScroll:!0}),this.value!==a&&(this.emit("sd-input"),this.emit("sd-change"))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let o=a+1;n=o>e.length-1?0:o}else{let o=a-1;n=o<0?e.length-1:o}this.setCurrentOption(e[n],new KeyboardEvent("keydown")),A(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-5-10-1-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t,e){let i=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),i.forEach(a=>{a.current=!1,a.setAttribute("aria-selected","false"),a.isKeyboardFocus=!1}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id)),t&&(e==null?void 0:e.type)==="keydown"&&(t.isKeyboardFocus=!0)}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,b,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,a.checkbox=i.checkbox,a.size=i.size,!(((b=i.parentElement)==null?void 0:b.tagName.toLowerCase())==="sd-5-10-1-optgroup"))return a;let o=i.parentElement,f=(m=o.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),h=e.find(O=>O.id===o.id);if(h){h==null||h.appendChild(a),f&&(h==null||h.appendChild(f));return}let v=o.cloneNode();return v.appendChild(a),f&&v.appendChild(f),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-5-10-1-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),(this.disabled||this.visuallyDisabled)&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&(!this.disabled||!this.visuallyDisabled)){this.emit("sd-show"),this.addOpenListeners(),await I(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=C(this,"combobox.show",{dir:this.localize.dir()});await S(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await I(this);let{keyframes:t,options:e}=C(this,"combobox.hide",{dir:this.localize.dir()});await S(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled||this.visuallyDisabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return R(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return K(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-5-10-1-option")){customElements.whenDefined("sd-5-10-1-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();this.applySizeToOptions();let i=this.findOptionByValue(t,this.value);this.selectedTextLabel=(i==null?void 0:i.getTextLabel())||"",t.forEach((a,n)=>{this.multiple&&(a.checkbox=!0),a.id=a.id||`sd-5-10-1-combobox-option-${n}`}),e.forEach((a,n)=>{a.id=a.id||`sd-5-10-1-combobox-optgroup-${n}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery("")}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,o=this.clearable&&!this.disabled&&!this.visuallyDisabled,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",h=this.disabled||this.visuallyDisabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return p`<div part="form-control" class="${d("relative text-left",h,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label> <span aria-live="polite" class="sr-only">${this.deletedTagLabel}</span><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${d("absolute top-0 w-full h-full pointer-events-none border rounded-default z-10 transition-[border] duration-medium ease-in-out",{disabled:"border-neutral-500",visuallyDisabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[f],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-5-10-1-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${d("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
10
10
  popup:popup__content,
11
- "><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",b,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",b)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",h,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(O=>O==null?void 0:O.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",h)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",y,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-0-icon class="${d("text-neutral-700",m)}" name="closing-round" library="_internal"></sd-5-10-0-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-10-0-icon part="invalid-icon" class="${d(y,m,"text-error")}" library="_internal" name="risk"></sd-5-10-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-10-0-icon part="valid-icon" class="${d("flex-shrink-0 text-success",y,m)}" library="_internal" name="status-check"></sd-5-10-0-icon>`:""}<slot name="right" part="right" class="${d("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",m)}">${this.type!=="search"?p`<sd-5-10-0-icon class="${d("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-5-10-0-icon>`:""}</slot>${this.type==="search"?p`<button class="${d("flex items-center sd-interactive",y)}" type="button"><sd-5-10-0-icon class="${d(v,m)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-10-0-icon></button>`:p`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${M(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?p`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-5-10-0-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-2" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.styles=[...T.styles,D`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-5-10-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-10-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-10-0-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-10-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-10-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}[part=filtered-listbox] sd-5-10-0-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],l([c("sd-5-10-0-popup")],s.prototype,"popup",2),l([c('[part="combobox"]')],s.prototype,"combobox",2),l([c('[part="display-input"]')],s.prototype,"displayInput",2),l([c(".value-input")],s.prototype,"valueInput",2),l([c('[part="listbox"]')],s.prototype,"listbox",2),l([c('[part="tags"]')],s.prototype,"tagWrapper",2),l([c('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([c("slot:not([name])")],s.prototype,"defaultSlot",2),l([c("#invalid-message")],s.prototype,"invalidMessage",2),l([u()],s.prototype,"hasFocus",2),l([u()],s.prototype,"displayInputValue",2),l([u()],s.prototype,"selectedTextLabel",2),l([u()],s.prototype,"selectedOptions",2),l([u()],s.prototype,"filteredOptions",2),l([u()],s.prototype,"allOptions",2),l([u()],s.prototype,"lastOption",2),l([u()],s.prototype,"showValidStyle",2),l([u()],s.prototype,"showInvalidStyle",2),l([u()],s.prototype,"deletedTagLabel",2),l([r({reflect:!0})],s.prototype,"name",2),l([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([P()],s.prototype,"defaultValue",2),l([r({type:String,reflect:!0})],s.prototype,"size",2),l([r({type:String,reflect:!0})],s.prototype,"placeholder",2),l([r({type:String,attribute:"max-options-tag-label",reflect:!0})],s.prototype,"maxOptionsTagLabel",2),l([r({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],s.prototype,"visuallyDisabled",2),l([r({type:Boolean,reflect:!0})],s.prototype,"clearable",2),l([r({type:Boolean,reflect:!0})],s.prototype,"open",2),l([r({type:Boolean,reflect:!0})],s.prototype,"hoist",2),l([r({type:String,reflect:!0})],s.prototype,"label",2),l([r({type:String,reflect:!0})],s.prototype,"placement",2),l([r({type:String,attribute:"help-text",reflect:!0})],s.prototype,"helpText",2),l([r({type:String,reflect:!0})],s.prototype,"form",2),l([r({type:Boolean,reflect:!0})],s.prototype,"required",2),l([r({type:String,reflect:!0})],s.prototype,"type",2),l([u()],s.prototype,"currentPlacement",2),l([r()],s.prototype,"getOption",2),l([r({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([r({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([r({type:Number,reflect:!0,attribute:"max-options-visible"})],s.prototype,"maxOptionsVisible",2),l([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([r()],s.prototype,"filter",2),l([r()],s.prototype,"getTag",2),l([g("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([g("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([g("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([g(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([g("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([g("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([g("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([k("sd-5-10-0-combobox")],s);E("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});E("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{s as a};
11
+ "><div part="combobox" class="${d("relative w-full px-4 flex flex-row items-center rounded-default transition-colors hover:duration-fast ease-in-out",this.visuallyDisabled||this.disabled?"hover:bg-transparent":"hover:bg-neutral-200",this.open&&"shadow transition-shadow duration-medium ease-in-out",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}">${t.left?p`<slot part="left" name="left" class="${d("inline-flex",b,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?p`<div part="tags" class="${d("flex items-center gap-1",b)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${d("appearance-none outline-none bg-transparent flex-auto min-w-0",h,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder||this.localize.term("comboboxDefaultPlaceholder")}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled||this.visuallyDisabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(O=>O==null?void 0:O.getTextLabel()).join(", ")}</div><input class="${d("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",h)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${o?p`<button part="clear-button" class="${d("flex justify-center",y,this.value.length>0?"visible":"invisible")}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-1-icon class="${d("text-neutral-700",m)}" name="closing-round" library="_internal"></sd-5-10-1-icon></slot></button>`:""} ${this.showInvalidStyle?p`<sd-5-10-1-icon part="invalid-icon" class="${d(y,m,"text-error")}" library="_internal" name="risk"></sd-5-10-1-icon>`:""} ${this.styleOnValid&&this.showValidStyle?p`<sd-5-10-1-icon part="valid-icon" class="${d("flex-shrink-0 text-success",y,m)}" library="_internal" name="status-check"></sd-5-10-1-icon>`:""}<slot name="right" part="right" class="${d("inline-flex ml-2 leading-[0]",this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",m)}">${this.type!=="search"?p`<sd-5-10-1-icon class="${d("transition-transform duration-medium ease-in-out",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="_internal" color="currentColor" label="${this.localize.term("open")}"></sd-5-10-1-icon>`:""}</slot>${this.type==="search"?p`<button class="${d("flex items-center sd-interactive",y)}" type="button"><sd-5-10-1-icon class="${d(v,m)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-10-1-icon></button>`:p`<button class="sd-interactive combobox-button absolute top-2" @keydown="${this.handleComboboxMouseDown}" type="button"><span class="sr-only">${this.localize.term("open")}</span></button>`}</div><div id="listbox" role="${M(this.multiple?void 0:"listbox")}" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${d("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow transition-shadow duration-medium ease-in-out",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox">${this.filteredOptions.length===0?p`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-5-10-1-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700 mt-2" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.styles=[...T.styles,D`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}:host([disabled]) ::-moz-placeholder,:host([visually-disabled]) ::-moz-placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([disabled]) ::placeholder,:host([visually-disabled]) ::placeholder{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}:host([visually-disabled]) input{caret-color:transparent}:host([size=sm]) .combobox-button{height:var(--sd-spacing-4,1rem);right:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem)}:host([size=md]) .combobox-button{height:var(--sd-spacing-6,1.5rem);right:.85rem;width:var(--sd-spacing-6,1.5rem)}:host([size=lg]) .combobox-button{height:var(--sd-spacing-8,2rem);right:var(--sd-spacing-3,.75rem);width:var(--sd-spacing-8,2rem)}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-5-10-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-5-10-1-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-5-10-1-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-5-10-1-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-5-10-1-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}[part=filtered-listbox] sd-5-10-1-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],l([c("sd-5-10-1-popup")],s.prototype,"popup",2),l([c('[part="combobox"]')],s.prototype,"combobox",2),l([c('[part="display-input"]')],s.prototype,"displayInput",2),l([c(".value-input")],s.prototype,"valueInput",2),l([c('[part="listbox"]')],s.prototype,"listbox",2),l([c('[part="tags"]')],s.prototype,"tagWrapper",2),l([c('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([c("slot:not([name])")],s.prototype,"defaultSlot",2),l([c("#invalid-message")],s.prototype,"invalidMessage",2),l([u()],s.prototype,"hasFocus",2),l([u()],s.prototype,"displayInputValue",2),l([u()],s.prototype,"selectedTextLabel",2),l([u()],s.prototype,"selectedOptions",2),l([u()],s.prototype,"filteredOptions",2),l([u()],s.prototype,"allOptions",2),l([u()],s.prototype,"lastOption",2),l([u()],s.prototype,"showValidStyle",2),l([u()],s.prototype,"showInvalidStyle",2),l([u()],s.prototype,"deletedTagLabel",2),l([r({reflect:!0})],s.prototype,"name",2),l([r({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([P()],s.prototype,"defaultValue",2),l([r({type:String,reflect:!0})],s.prototype,"size",2),l([r({type:String,reflect:!0})],s.prototype,"placeholder",2),l([r({type:String,attribute:"max-options-tag-label",reflect:!0})],s.prototype,"maxOptionsTagLabel",2),l([r({type:Boolean,reflect:!0})],s.prototype,"disabled",2),l([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],s.prototype,"visuallyDisabled",2),l([r({type:Boolean,reflect:!0})],s.prototype,"clearable",2),l([r({type:Boolean,reflect:!0})],s.prototype,"open",2),l([r({type:Boolean,reflect:!0})],s.prototype,"hoist",2),l([r({type:String,reflect:!0})],s.prototype,"label",2),l([r({type:String,reflect:!0})],s.prototype,"placement",2),l([r({type:String,attribute:"help-text",reflect:!0})],s.prototype,"helpText",2),l([r({type:String,reflect:!0})],s.prototype,"form",2),l([r({type:Boolean,reflect:!0})],s.prototype,"required",2),l([r({type:String,reflect:!0})],s.prototype,"type",2),l([u()],s.prototype,"currentPlacement",2),l([r()],s.prototype,"getOption",2),l([r({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([r({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([r({type:Number,reflect:!0,attribute:"max-options-visible"})],s.prototype,"maxOptionsVisible",2),l([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([r()],s.prototype,"filter",2),l([r()],s.prototype,"getTag",2),l([g("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([g("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([g("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([g(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([g("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([g("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([g("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([k("sd-5-10-1-combobox")],s);E("combobox.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:"var(--sd-duration-medium, 300)",easing:"ease-in-out"}});E("combobox.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:"var(--sd-duration-fast, 150)",easing:"ease-in-out"}});export{s as a};
@@ -1 +1 @@
1
- import{b as m}from"./chunk.H2TKMIFR.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.GHC63SXL.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as d,b as a,d as n,h as o}from"./chunk.HDPQFCGV.js";import{b as r}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:l}=this;this.defaultSlot.assignedElements().filter(i=>i.tagName.toLowerCase()==="sd-5-10-0-option").forEach(i=>{i.disabled=l})}handleDisabledChange(){this.handleDisableOptions()}render(){let{disabled:l}=this;return m`<div role="${l?"presentation":"group"}" class="${s(this.disabled?"text-neutral-500":"")}" part="base" aria-labelledby="group-label"><sd-5-10-0-divider id="divider" class="pt-2 pb-4" part="divider"></sd-5-10-0-divider><div part="label-container" class="${s(this.disabled?"text-neutral-500":"text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="listbox" part="options" aria-label="${this.localize.term("optionGroup")}"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`}};e.styles=[...o.styles,r`:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([d("sd-5-10-0-optgroup")],e);export{e as a};
1
+ import{b as m}from"./chunk.H2TKMIFR.js";import{a as s}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.GHC63SXL.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as d,b as a,d as n,h as o}from"./chunk.HDPQFCGV.js";import{b as r}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.localize=new b(this);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:l}=this;this.defaultSlot.assignedElements().filter(i=>i.tagName.toLowerCase()==="sd-5-10-1-option").forEach(i=>{i.disabled=l})}handleDisabledChange(){this.handleDisableOptions()}render(){let{disabled:l}=this;return m`<div role="${l?"presentation":"group"}" class="${s(this.disabled?"text-neutral-500":"")}" part="base" aria-labelledby="group-label"><sd-5-10-1-divider id="divider" class="pt-2 pb-4" part="divider"></sd-5-10-1-divider><div part="label-container" class="${s(this.disabled?"text-neutral-500":"text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="listbox" part="options" aria-label="${this.localize.term("optionGroup")}"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`}};e.styles=[...o.styles,r`:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a({type:String,reflect:!0})],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([d("sd-5-10-1-optgroup")],e);export{e as a};