@ds-autonomie/web-components 1.0.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 (500) hide show
  1. package/CHANGELOG.md +318 -0
  2. package/LICENSE +8 -0
  3. package/README.md +3 -0
  4. package/dist/chunks/chunk.23TOS4ZE.js +29 -0
  5. package/dist/chunks/chunk.2FK6USFR.js +63 -0
  6. package/dist/chunks/chunk.2HUORR44.js +76 -0
  7. package/dist/chunks/chunk.3BL7JA77.js +59 -0
  8. package/dist/chunks/chunk.3RBCYA4F.js +147 -0
  9. package/dist/chunks/chunk.3XRQRY25.js +25 -0
  10. package/dist/chunks/chunk.42W4S2HN.js +145 -0
  11. package/dist/chunks/chunk.4A3WMGMZ.js +79 -0
  12. package/dist/chunks/chunk.4A57I2HX.js +241 -0
  13. package/dist/chunks/chunk.4XT2OJD2.js +75 -0
  14. package/dist/chunks/chunk.5LT3B7MI.js +372 -0
  15. package/dist/chunks/chunk.5WAZTHII.js +37 -0
  16. package/dist/chunks/chunk.5XL2LZLC.js +100 -0
  17. package/dist/chunks/chunk.5XUV3SRW.js +420 -0
  18. package/dist/chunks/chunk.6FAUBLR3.js +84 -0
  19. package/dist/chunks/chunk.6M63UXML.js +35 -0
  20. package/dist/chunks/chunk.6PS5KB3O.js +53 -0
  21. package/dist/chunks/chunk.6ZQ4OQ2C.js +51 -0
  22. package/dist/chunks/chunk.73T7TU6S.js +24 -0
  23. package/dist/chunks/chunk.7J7CS3BK.js +43 -0
  24. package/dist/chunks/chunk.7NWAYDYI.js +168 -0
  25. package/dist/chunks/chunk.7ZCCXTFG.js +301 -0
  26. package/dist/chunks/chunk.A2PAK6VF.js +206 -0
  27. package/dist/chunks/chunk.ABGBXXKA.js +164 -0
  28. package/dist/chunks/chunk.AQRNB4GJ.js +33 -0
  29. package/dist/chunks/chunk.AR5HJD7F.js +111 -0
  30. package/dist/chunks/chunk.B4BZKR24.js +16 -0
  31. package/dist/chunks/chunk.BD63GRU5.js +132 -0
  32. package/dist/chunks/chunk.BEB47LM2.js +278 -0
  33. package/dist/chunks/chunk.BLPP3Q5H.js +555 -0
  34. package/dist/chunks/chunk.CJIL3BLA.js +45 -0
  35. package/dist/chunks/chunk.CPXD6UYZ.js +34 -0
  36. package/dist/chunks/chunk.D7CATJYB.js +36 -0
  37. package/dist/chunks/chunk.DC6CT5PU.js +109 -0
  38. package/dist/chunks/chunk.DRGGQ4WL.js +9 -0
  39. package/dist/chunks/chunk.DSGUQNN4.js +26 -0
  40. package/dist/chunks/chunk.DURVPB6M.js +391 -0
  41. package/dist/chunks/chunk.DXVNWE2M.js +166 -0
  42. package/dist/chunks/chunk.EFQHAGXP.js +26 -0
  43. package/dist/chunks/chunk.EHVJT7BH.js +215 -0
  44. package/dist/chunks/chunk.EKWYMXQO.js +166 -0
  45. package/dist/chunks/chunk.EMIT7S33.js +71 -0
  46. package/dist/chunks/chunk.EMJZLQCL.js +60 -0
  47. package/dist/chunks/chunk.ENKP2IFW.js +361 -0
  48. package/dist/chunks/chunk.EU56EW33.js +91 -0
  49. package/dist/chunks/chunk.EYZGEU3G.js +45 -0
  50. package/dist/chunks/chunk.FDYFSRSX.js +33 -0
  51. package/dist/chunks/chunk.FIGO7UV2.js +77 -0
  52. package/dist/chunks/chunk.G7AELPSO.js +131 -0
  53. package/dist/chunks/chunk.GI7VDIWX.js +24 -0
  54. package/dist/chunks/chunk.GYTA2LJC.js +145 -0
  55. package/dist/chunks/chunk.HAL7R4WT.js +0 -0
  56. package/dist/chunks/chunk.HC5BO5YV.js +405 -0
  57. package/dist/chunks/chunk.HH63FIEF.js +122 -0
  58. package/dist/chunks/chunk.HLYGKGDG.js +308 -0
  59. package/dist/chunks/chunk.I33L3NO6.js +122 -0
  60. package/dist/chunks/chunk.IGYXUK7A.js +19 -0
  61. package/dist/chunks/chunk.INCGVIAQ.js +61 -0
  62. package/dist/chunks/chunk.IOFPPNUO.js +25 -0
  63. package/dist/chunks/chunk.IRQOFNJE.js +317 -0
  64. package/dist/chunks/chunk.ISAFRNR2.js +112 -0
  65. package/dist/chunks/chunk.J2XNYTTZ.js +715 -0
  66. package/dist/chunks/chunk.JETXIC4F.js +150 -0
  67. package/dist/chunks/chunk.JT7UJED5.js +33 -0
  68. package/dist/chunks/chunk.K6WCEYZI.js +52 -0
  69. package/dist/chunks/chunk.KBT2EKLF.js +25 -0
  70. package/dist/chunks/chunk.KDAK2GXX.js +58 -0
  71. package/dist/chunks/chunk.KHIMMW3T.js +33 -0
  72. package/dist/chunks/chunk.KIFBWPW5.js +298 -0
  73. package/dist/chunks/chunk.KOH5V4C6.js +552 -0
  74. package/dist/chunks/chunk.LC54322H.js +99 -0
  75. package/dist/chunks/chunk.LMJPQPQT.js +26 -0
  76. package/dist/chunks/chunk.LT7JMZ3T.js +371 -0
  77. package/dist/chunks/chunk.M245ZGRR.js +80 -0
  78. package/dist/chunks/chunk.MOWTZFON.js +63 -0
  79. package/dist/chunks/chunk.MY434P47.js +125 -0
  80. package/dist/chunks/chunk.N6VVY6XD.js +91 -0
  81. package/dist/chunks/chunk.NDEZEB3Z.js +402 -0
  82. package/dist/chunks/chunk.NHRDZGLI.js +81 -0
  83. package/dist/chunks/chunk.NKKVGICB.js +114 -0
  84. package/dist/chunks/chunk.NNBOLKWI.js +17 -0
  85. package/dist/chunks/chunk.O73OYTYJ.js +319 -0
  86. package/dist/chunks/chunk.OBU65KDL.js +29 -0
  87. package/dist/chunks/chunk.ODSCDJDO.js +91 -0
  88. package/dist/chunks/chunk.OVK7QCA7.js +441 -0
  89. package/dist/chunks/chunk.PQWQ42E2.js +150 -0
  90. package/dist/chunks/chunk.PULHNCDM.js +98 -0
  91. package/dist/chunks/chunk.PWWER3ZK.js +806 -0
  92. package/dist/chunks/chunk.QFJA3MTV.js +66 -0
  93. package/dist/chunks/chunk.QKNNLZ2M.js +361 -0
  94. package/dist/chunks/chunk.QL5C2XOW.js +0 -0
  95. package/dist/chunks/chunk.RDGMZ5XB.js +24 -0
  96. package/dist/chunks/chunk.RIJQGADY.js +108 -0
  97. package/dist/chunks/chunk.RMCOWJOW.js +17 -0
  98. package/dist/chunks/chunk.RY4QCT3T.js +29 -0
  99. package/dist/chunks/chunk.S4ATPBQN.js +89 -0
  100. package/dist/chunks/chunk.SGIGGO5M.js +86 -0
  101. package/dist/chunks/chunk.SQMWMSBA.js +207 -0
  102. package/dist/chunks/chunk.TJOP7HQP.js +14 -0
  103. package/dist/chunks/chunk.TUVJKY7S.js +21 -0
  104. package/dist/chunks/chunk.UA32LJYW.js +230 -0
  105. package/dist/chunks/chunk.UEUTSYIH.js +60 -0
  106. package/dist/chunks/chunk.UPYCV66H.js +111 -0
  107. package/dist/chunks/chunk.UV53JTE3.js +128 -0
  108. package/dist/chunks/chunk.UZLQVFDR.js +386 -0
  109. package/dist/chunks/chunk.V7RJROLH.js +48 -0
  110. package/dist/chunks/chunk.VFYKLPN2.js +144 -0
  111. package/dist/chunks/chunk.VRY3E2XG.js +196 -0
  112. package/dist/chunks/chunk.WE6IG5XG.js +164 -0
  113. package/dist/chunks/chunk.WFHOSUOX.js +263 -0
  114. package/dist/chunks/chunk.WHK7EFIM.js +264 -0
  115. package/dist/chunks/chunk.WIEJJS3W.js +88 -0
  116. package/dist/chunks/chunk.WK7RWLAK.js +54 -0
  117. package/dist/chunks/chunk.WNHQYL5W.js +298 -0
  118. package/dist/chunks/chunk.WSVP75MH.js +102 -0
  119. package/dist/chunks/chunk.XNEONNEJ.js +23 -0
  120. package/dist/chunks/chunk.XSCX6TC5.js +127 -0
  121. package/dist/chunks/chunk.XWUQFDIN.js +15 -0
  122. package/dist/chunks/chunk.Y3ZUFLVS.js +90 -0
  123. package/dist/chunks/chunk.YCXTCVAZ.js +30 -0
  124. package/dist/chunks/chunk.YIY5RM53.js +66 -0
  125. package/dist/chunks/chunk.YL3TSWVM.js +17 -0
  126. package/dist/chunks/chunk.YS7MY5CH.js +512 -0
  127. package/dist/chunks/chunk.YY6AEXJK.js +33 -0
  128. package/dist/chunks/chunk.YZHDFJWJ.js +17 -0
  129. package/dist/chunks/chunk.Z6TBD2AC.js +125 -0
  130. package/dist/chunks/chunk.ZKYSHEVZ.js +22 -0
  131. package/dist/chunks/chunk.ZVGZDTBF.js +104 -0
  132. package/dist/components/accordion/accordion.d.ts +49 -0
  133. package/dist/components/accordion/accordion.js +23 -0
  134. package/dist/components/accordion/accordion.styles.d.ts +2 -0
  135. package/dist/components/accordion/accordion.styles.js +8 -0
  136. package/dist/components/alert/alert.d.ts +52 -0
  137. package/dist/components/alert/alert.js +25 -0
  138. package/dist/components/alert/alert.styles.d.ts +2 -0
  139. package/dist/components/alert/alert.styles.js +8 -0
  140. package/dist/components/animation/animation.d.ts +81 -0
  141. package/dist/components/animation/animation.js +12 -0
  142. package/dist/components/animation/animation.styles.d.ts +2 -0
  143. package/dist/components/animation/animation.styles.js +8 -0
  144. package/dist/components/animation/animations.d.ts +6 -0
  145. package/dist/components/animation/animations.js +11 -0
  146. package/dist/components/avatar/avatar.d.ts +42 -0
  147. package/dist/components/avatar/avatar.js +19 -0
  148. package/dist/components/avatar/avatar.styles.d.ts +2 -0
  149. package/dist/components/avatar/avatar.styles.js +8 -0
  150. package/dist/components/avatar-group/avatar-group.d.ts +21 -0
  151. package/dist/components/avatar-group/avatar-group.js +9 -0
  152. package/dist/components/avatar-group/avatar-group.styles.d.ts +2 -0
  153. package/dist/components/avatar-group/avatar-group.styles.js +7 -0
  154. package/dist/components/badge/badge.d.ts +23 -0
  155. package/dist/components/badge/badge.js +10 -0
  156. package/dist/components/badge/badge.styles.d.ts +2 -0
  157. package/dist/components/badge/badge.styles.js +8 -0
  158. package/dist/components/breadcrumb/breadcrumb.d.ts +23 -0
  159. package/dist/components/breadcrumb/breadcrumb.js +20 -0
  160. package/dist/components/breadcrumb/breadcrumb.styles.d.ts +2 -0
  161. package/dist/components/breadcrumb/breadcrumb.styles.js +8 -0
  162. package/dist/components/breadcrumb-item/breadcrumb-item.d.ts +30 -0
  163. package/dist/components/breadcrumb-item/breadcrumb-item.js +12 -0
  164. package/dist/components/breadcrumb-item/breadcrumb-item.styles.d.ts +2 -0
  165. package/dist/components/breadcrumb-item/breadcrumb-item.styles.js +8 -0
  166. package/dist/components/button/button.d.ts +120 -0
  167. package/dist/components/button/button.js +24 -0
  168. package/dist/components/button/button.styles.d.ts +2 -0
  169. package/dist/components/button/button.styles.js +8 -0
  170. package/dist/components/card/card.d.ts +22 -0
  171. package/dist/components/card/card.js +11 -0
  172. package/dist/components/card/card.styles.d.ts +2 -0
  173. package/dist/components/card/card.styles.js +8 -0
  174. package/dist/components/checkbox/checkbox.d.ts +93 -0
  175. package/dist/components/checkbox/checkbox.js +24 -0
  176. package/dist/components/checkbox/checkbox.styles.d.ts +2 -0
  177. package/dist/components/checkbox/checkbox.styles.js +9 -0
  178. package/dist/components/checkbox-button/checkbox-button.d.ts +48 -0
  179. package/dist/components/checkbox-button/checkbox-button.js +21 -0
  180. package/dist/components/checkbox-button/checkbox-button.styles.d.ts +2 -0
  181. package/dist/components/checkbox-button/checkbox-button.styles.js +9 -0
  182. package/dist/components/checkbox-group/checkbox-group.d.ts +85 -0
  183. package/dist/components/checkbox-group/checkbox-group.js +16 -0
  184. package/dist/components/checkbox-group/checkbox-group.styles.d.ts +2 -0
  185. package/dist/components/checkbox-group/checkbox-group.styles.js +9 -0
  186. package/dist/components/dialog/dialog.d.ts +70 -0
  187. package/dist/components/dialog/dialog.js +28 -0
  188. package/dist/components/dialog/dialog.styles.d.ts +2 -0
  189. package/dist/components/dialog/dialog.styles.js +8 -0
  190. package/dist/components/divider/divider.d.ts +17 -0
  191. package/dist/components/divider/divider.js +10 -0
  192. package/dist/components/divider/divider.styles.d.ts +2 -0
  193. package/dist/components/divider/divider.styles.js +8 -0
  194. package/dist/components/drawer/drawer.d.ts +77 -0
  195. package/dist/components/drawer/drawer.js +28 -0
  196. package/dist/components/drawer/drawer.styles.d.ts +2 -0
  197. package/dist/components/drawer/drawer.styles.js +8 -0
  198. package/dist/components/dropdown/dropdown.d.ts +87 -0
  199. package/dist/components/dropdown/dropdown.js +15 -0
  200. package/dist/components/dropdown/dropdown.styles.d.ts +2 -0
  201. package/dist/components/dropdown/dropdown.styles.js +8 -0
  202. package/dist/components/error-text/error-text.d.ts +18 -0
  203. package/dist/components/error-text/error-text.js +9 -0
  204. package/dist/components/error-text/error-text.styles.d.ts +2 -0
  205. package/dist/components/error-text/error-text.styles.js +7 -0
  206. package/dist/components/format-bytes/format-bytes.d.ts +22 -0
  207. package/dist/components/format-bytes/format-bytes.js +9 -0
  208. package/dist/components/format-date/format-date.d.ts +42 -0
  209. package/dist/components/format-date/format-date.js +9 -0
  210. package/dist/components/format-number/format-number.d.ts +36 -0
  211. package/dist/components/format-number/format-number.js +9 -0
  212. package/dist/components/icon/icon.d.ts +40 -0
  213. package/dist/components/icon/icon.js +17 -0
  214. package/dist/components/icon/icon.styles.d.ts +2 -0
  215. package/dist/components/icon/icon.styles.js +8 -0
  216. package/dist/components/icon/library.d.ts +21 -0
  217. package/dist/components/icon/library.default.d.ts +3 -0
  218. package/dist/components/icon/library.default.js +8 -0
  219. package/dist/components/icon/library.js +18 -0
  220. package/dist/components/icon/library.system.d.ts +3 -0
  221. package/dist/components/icon/library.system.js +7 -0
  222. package/dist/components/icon/request.d.ts +11 -0
  223. package/dist/components/icon/request.js +8 -0
  224. package/dist/components/icon-button/icon-button.d.ts +59 -0
  225. package/dist/components/icon-button/icon-button.js +19 -0
  226. package/dist/components/icon-button/icon-button.styles.d.ts +2 -0
  227. package/dist/components/icon-button/icon-button.styles.js +8 -0
  228. package/dist/components/include/include.d.ts +32 -0
  229. package/dist/components/include/include.js +12 -0
  230. package/dist/components/include/include.styles.d.ts +2 -0
  231. package/dist/components/include/include.styles.js +8 -0
  232. package/dist/components/include/request.d.ts +8 -0
  233. package/dist/components/include/request.js +7 -0
  234. package/dist/components/input/input.d.ts +165 -0
  235. package/dist/components/input/input.js +27 -0
  236. package/dist/components/input/input.styles.d.ts +2 -0
  237. package/dist/components/input/input.styles.js +9 -0
  238. package/dist/components/input/input.utils.d.ts +4 -0
  239. package/dist/components/input/input.utils.js +9 -0
  240. package/dist/components/input-mask/input-mask.configs.d.ts +42 -0
  241. package/dist/components/input-mask/input-mask.configs.js +11 -0
  242. package/dist/components/input-mask/input-mask.d.ts +127 -0
  243. package/dist/components/input-mask/input-mask.js +19 -0
  244. package/dist/components/input-mask/input-mask.styles.d.ts +2 -0
  245. package/dist/components/input-mask/input-mask.styles.js +9 -0
  246. package/dist/components/input-mask/input-mask.utils.d.ts +7 -0
  247. package/dist/components/input-mask/input-mask.utils.js +19 -0
  248. package/dist/components/input-phone/input-phone.configs.d.ts +14 -0
  249. package/dist/components/input-phone/input-phone.configs.js +7 -0
  250. package/dist/components/input-phone/input-phone.d.ts +138 -0
  251. package/dist/components/input-phone/input-phone.js +49 -0
  252. package/dist/components/input-phone/input-phone.styles.d.ts +2 -0
  253. package/dist/components/input-phone/input-phone.styles.js +9 -0
  254. package/dist/components/input-phone/input-phone.utils.d.ts +9 -0
  255. package/dist/components/input-phone/input-phone.utils.js +13 -0
  256. package/dist/components/menu/menu.d.ts +43 -0
  257. package/dist/components/menu/menu.js +10 -0
  258. package/dist/components/menu/menu.styles.d.ts +2 -0
  259. package/dist/components/menu/menu.styles.js +8 -0
  260. package/dist/components/menu-item/menu-item.d.ts +44 -0
  261. package/dist/components/menu-item/menu-item.js +20 -0
  262. package/dist/components/menu-item/menu-item.styles.d.ts +2 -0
  263. package/dist/components/menu-item/menu-item.styles.js +8 -0
  264. package/dist/components/menu-label/menu-label.d.ts +17 -0
  265. package/dist/components/menu-label/menu-label.js +10 -0
  266. package/dist/components/menu-label/menu-label.styles.d.ts +2 -0
  267. package/dist/components/menu-label/menu-label.styles.js +8 -0
  268. package/dist/components/mutation-observer/mutation-observer.d.ts +44 -0
  269. package/dist/components/mutation-observer/mutation-observer.js +11 -0
  270. package/dist/components/mutation-observer/mutation-observer.styles.d.ts +2 -0
  271. package/dist/components/mutation-observer/mutation-observer.styles.js +8 -0
  272. package/dist/components/option/option.d.ts +50 -0
  273. package/dist/components/option/option.js +20 -0
  274. package/dist/components/option/option.styles.d.ts +2 -0
  275. package/dist/components/option/option.styles.js +8 -0
  276. package/dist/components/popup/popup.d.ts +123 -0
  277. package/dist/components/popup/popup.js +10 -0
  278. package/dist/components/popup/popup.styles.d.ts +2 -0
  279. package/dist/components/popup/popup.styles.js +8 -0
  280. package/dist/components/progress-bar/progress-bar.d.ts +23 -0
  281. package/dist/components/progress-bar/progress-bar.js +11 -0
  282. package/dist/components/progress-bar/progress-bar.styles.d.ts +2 -0
  283. package/dist/components/progress-bar/progress-bar.styles.js +8 -0
  284. package/dist/components/progress-ring/progress-ring.d.ts +25 -0
  285. package/dist/components/progress-ring/progress-ring.js +11 -0
  286. package/dist/components/progress-ring/progress-ring.styles.d.ts +2 -0
  287. package/dist/components/progress-ring/progress-ring.styles.js +8 -0
  288. package/dist/components/radio/radio.d.ts +46 -0
  289. package/dist/components/radio/radio.js +19 -0
  290. package/dist/components/radio/radio.styles.d.ts +2 -0
  291. package/dist/components/radio/radio.styles.js +8 -0
  292. package/dist/components/radio-button/radio-button.d.ts +47 -0
  293. package/dist/components/radio-button/radio-button.js +13 -0
  294. package/dist/components/radio-button/radio-button.styles.d.ts +2 -0
  295. package/dist/components/radio-button/radio-button.styles.js +9 -0
  296. package/dist/components/radio-group/radio-group.d.ts +91 -0
  297. package/dist/components/radio-group/radio-group.js +16 -0
  298. package/dist/components/radio-group/radio-group.styles.d.ts +2 -0
  299. package/dist/components/radio-group/radio-group.styles.js +9 -0
  300. package/dist/components/relative-time/relative-time.d.ts +34 -0
  301. package/dist/components/relative-time/relative-time.js +9 -0
  302. package/dist/components/resize-observer/resize-observer.d.ts +31 -0
  303. package/dist/components/resize-observer/resize-observer.js +11 -0
  304. package/dist/components/resize-observer/resize-observer.styles.d.ts +2 -0
  305. package/dist/components/resize-observer/resize-observer.styles.js +8 -0
  306. package/dist/components/select/select.d.ts +166 -0
  307. package/dist/components/select/select.js +36 -0
  308. package/dist/components/select/select.styles.d.ts +2 -0
  309. package/dist/components/select/select.styles.js +9 -0
  310. package/dist/components/skeleton/skeleton.d.ts +21 -0
  311. package/dist/components/skeleton/skeleton.js +10 -0
  312. package/dist/components/skeleton/skeleton.styles.d.ts +2 -0
  313. package/dist/components/skeleton/skeleton.styles.js +8 -0
  314. package/dist/components/spinner/spinner.d.ts +21 -0
  315. package/dist/components/spinner/spinner.js +11 -0
  316. package/dist/components/spinner/spinner.styles.d.ts +2 -0
  317. package/dist/components/spinner/spinner.styles.js +8 -0
  318. package/dist/components/tab/tab.d.ts +44 -0
  319. package/dist/components/tab/tab.js +12 -0
  320. package/dist/components/tab/tab.styles.d.ts +2 -0
  321. package/dist/components/tab/tab.styles.js +8 -0
  322. package/dist/components/tab-group/tab-group.d.ts +61 -0
  323. package/dist/components/tab-group/tab-group.js +13 -0
  324. package/dist/components/tab-group/tab-group.styles.d.ts +2 -0
  325. package/dist/components/tab-group/tab-group.styles.js +8 -0
  326. package/dist/components/tab-panel/tab-panel.d.ts +25 -0
  327. package/dist/components/tab-panel/tab-panel.js +11 -0
  328. package/dist/components/tab-panel/tab-panel.styles.d.ts +2 -0
  329. package/dist/components/tab-panel/tab-panel.styles.js +8 -0
  330. package/dist/components/tag/tag.d.ts +34 -0
  331. package/dist/components/tag/tag.js +22 -0
  332. package/dist/components/tag/tag.styles.d.ts +2 -0
  333. package/dist/components/tag/tag.styles.js +8 -0
  334. package/dist/components/textarea/textarea.d.ts +137 -0
  335. package/dist/components/textarea/textarea.js +17 -0
  336. package/dist/components/textarea/textarea.styles.d.ts +2 -0
  337. package/dist/components/textarea/textarea.styles.js +9 -0
  338. package/dist/components/tooltip/tooltip.d.ts +80 -0
  339. package/dist/components/tooltip/tooltip.js +17 -0
  340. package/dist/components/tooltip/tooltip.styles.d.ts +2 -0
  341. package/dist/components/tooltip/tooltip.styles.js +8 -0
  342. package/dist/components/tree/tree.d.ts +53 -0
  343. package/dist/components/tree/tree.js +33 -0
  344. package/dist/components/tree/tree.styles.d.ts +2 -0
  345. package/dist/components/tree/tree.styles.js +8 -0
  346. package/dist/components/tree-item/tree-item.d.ts +69 -0
  347. package/dist/components/tree-item/tree-item.js +31 -0
  348. package/dist/components/tree-item/tree-item.styles.d.ts +2 -0
  349. package/dist/components/tree-item/tree-item.styles.js +8 -0
  350. package/dist/components/visually-hidden/visually-hidden.d.ts +17 -0
  351. package/dist/components/visually-hidden/visually-hidden.js +10 -0
  352. package/dist/components/visually-hidden/visually-hidden.styles.d.ts +2 -0
  353. package/dist/components/visually-hidden/visually-hidden.styles.js +8 -0
  354. package/dist/custom-elements.json +14628 -0
  355. package/dist/design-system-autoloader.d.ts +4 -0
  356. package/dist/design-system-autoloader.js +46 -0
  357. package/dist/design-system.d.ts +58 -0
  358. package/dist/design-system.js +309 -0
  359. package/dist/events/dsa-after-collapse.d.ts +7 -0
  360. package/dist/events/dsa-after-collapse.js +1 -0
  361. package/dist/events/dsa-after-expand.d.ts +7 -0
  362. package/dist/events/dsa-after-expand.js +1 -0
  363. package/dist/events/dsa-after-hide.d.ts +7 -0
  364. package/dist/events/dsa-after-hide.js +1 -0
  365. package/dist/events/dsa-after-show.d.ts +7 -0
  366. package/dist/events/dsa-after-show.js +1 -0
  367. package/dist/events/dsa-blur.d.ts +7 -0
  368. package/dist/events/dsa-blur.js +1 -0
  369. package/dist/events/dsa-cancel.d.ts +7 -0
  370. package/dist/events/dsa-cancel.js +1 -0
  371. package/dist/events/dsa-change.d.ts +7 -0
  372. package/dist/events/dsa-change.js +1 -0
  373. package/dist/events/dsa-clear.d.ts +7 -0
  374. package/dist/events/dsa-clear.js +1 -0
  375. package/dist/events/dsa-close.d.ts +7 -0
  376. package/dist/events/dsa-close.js +1 -0
  377. package/dist/events/dsa-collapse.d.ts +7 -0
  378. package/dist/events/dsa-collapse.js +1 -0
  379. package/dist/events/dsa-error.d.ts +9 -0
  380. package/dist/events/dsa-error.js +1 -0
  381. package/dist/events/dsa-expand.d.ts +7 -0
  382. package/dist/events/dsa-expand.js +1 -0
  383. package/dist/events/dsa-finish.d.ts +7 -0
  384. package/dist/events/dsa-finish.js +1 -0
  385. package/dist/events/dsa-focus.d.ts +7 -0
  386. package/dist/events/dsa-focus.js +1 -0
  387. package/dist/events/dsa-hide.d.ts +7 -0
  388. package/dist/events/dsa-hide.js +1 -0
  389. package/dist/events/dsa-hover.d.ts +10 -0
  390. package/dist/events/dsa-hover.js +1 -0
  391. package/dist/events/dsa-initial-focus.d.ts +7 -0
  392. package/dist/events/dsa-initial-focus.js +1 -0
  393. package/dist/events/dsa-input.d.ts +7 -0
  394. package/dist/events/dsa-input.js +1 -0
  395. package/dist/events/dsa-invalid.d.ts +7 -0
  396. package/dist/events/dsa-invalid.js +1 -0
  397. package/dist/events/dsa-lazy-change.d.ts +7 -0
  398. package/dist/events/dsa-lazy-change.js +1 -0
  399. package/dist/events/dsa-lazy-load.d.ts +7 -0
  400. package/dist/events/dsa-lazy-load.js +1 -0
  401. package/dist/events/dsa-load.d.ts +7 -0
  402. package/dist/events/dsa-load.js +1 -0
  403. package/dist/events/dsa-mutation.d.ts +9 -0
  404. package/dist/events/dsa-mutation.js +1 -0
  405. package/dist/events/dsa-remove.d.ts +7 -0
  406. package/dist/events/dsa-remove.js +1 -0
  407. package/dist/events/dsa-reposition.d.ts +7 -0
  408. package/dist/events/dsa-reposition.js +1 -0
  409. package/dist/events/dsa-request-close.d.ts +9 -0
  410. package/dist/events/dsa-request-close.js +1 -0
  411. package/dist/events/dsa-resize.d.ts +9 -0
  412. package/dist/events/dsa-resize.js +1 -0
  413. package/dist/events/dsa-select.d.ts +10 -0
  414. package/dist/events/dsa-select.js +1 -0
  415. package/dist/events/dsa-selection-change.d.ts +10 -0
  416. package/dist/events/dsa-selection-change.js +1 -0
  417. package/dist/events/dsa-show.d.ts +7 -0
  418. package/dist/events/dsa-show.js +1 -0
  419. package/dist/events/dsa-start.d.ts +7 -0
  420. package/dist/events/dsa-start.js +1 -0
  421. package/dist/events/dsa-tab-hide.d.ts +9 -0
  422. package/dist/events/dsa-tab-hide.js +1 -0
  423. package/dist/events/dsa-tab-show.d.ts +9 -0
  424. package/dist/events/dsa-tab-show.js +1 -0
  425. package/dist/events/events.d.ts +32 -0
  426. package/dist/events/events.js +1 -0
  427. package/dist/internal/animate.d.ts +22 -0
  428. package/dist/internal/animate.js +56 -0
  429. package/dist/internal/components/button-group/button-group.d.ts +34 -0
  430. package/dist/internal/components/button-group/button-group.js +110 -0
  431. package/dist/internal/components/button-group/button-group.styles.d.ts +2 -0
  432. package/dist/internal/components/button-group/button-group.styles.js +19 -0
  433. package/dist/internal/debounce.d.ts +1 -0
  434. package/dist/internal/debounce.js +26 -0
  435. package/dist/internal/default-value.d.ts +2 -0
  436. package/dist/internal/default-value.js +38 -0
  437. package/dist/internal/drag.d.ts +15 -0
  438. package/dist/internal/drag.js +27 -0
  439. package/dist/internal/event.d.ts +2 -0
  440. package/dist/internal/event.js +12 -0
  441. package/dist/internal/form.d.ts +73 -0
  442. package/dist/internal/form.js +328 -0
  443. package/dist/internal/math.d.ts +2 -0
  444. package/dist/internal/math.js +11 -0
  445. package/dist/internal/modal.d.ts +12 -0
  446. package/dist/internal/modal.js +51 -0
  447. package/dist/internal/offset.d.ts +11 -0
  448. package/dist/internal/offset.js +13 -0
  449. package/dist/internal/scroll.d.ts +11 -0
  450. package/dist/internal/scroll.js +63 -0
  451. package/dist/internal/shoelace-element.d.ts +43 -0
  452. package/dist/internal/shoelace-element.js +21 -0
  453. package/dist/internal/slot.d.ts +23 -0
  454. package/dist/internal/slot.js +84 -0
  455. package/dist/internal/string.d.ts +2 -0
  456. package/dist/internal/string.js +4 -0
  457. package/dist/internal/tabbable.d.ts +8 -0
  458. package/dist/internal/tabbable.js +79 -0
  459. package/dist/internal/test/data-testid-helpers.d.ts +12 -0
  460. package/dist/internal/test/data-testid-helpers.js +14 -0
  461. package/dist/internal/test/element-visible-overflow.d.ts +11 -0
  462. package/dist/internal/test/element-visible-overflow.js +18 -0
  463. package/dist/internal/test/form-control-base-tests.d.ts +7 -0
  464. package/dist/internal/test/form-control-base-tests.js +262 -0
  465. package/dist/internal/test/wait-for-scrolling.d.ts +9 -0
  466. package/dist/internal/test/wait-for-scrolling.js +34 -0
  467. package/dist/internal/test.d.ts +20 -0
  468. package/dist/internal/test.js +71 -0
  469. package/dist/internal/watch.d.ts +26 -0
  470. package/dist/internal/watch.js +38 -0
  471. package/dist/styles/component.styles.d.ts +2 -0
  472. package/dist/styles/component.styles.js +16 -0
  473. package/dist/styles/form-control.styles.d.ts +2 -0
  474. package/dist/styles/form-control.styles.js +142 -0
  475. package/dist/themes/dsa-wc-theme.css +1218 -0
  476. package/dist/themes/dsa-wc-theme.min.css +1 -0
  477. package/dist/themes/dsa-wc-theme.styles.js +1229 -0
  478. package/dist/translations/en-gb.d.ts +3 -0
  479. package/dist/translations/en-gb.js +21 -0
  480. package/dist/translations/en.d.ts +3 -0
  481. package/dist/translations/en.js +7 -0
  482. package/dist/translations/fr.d.ts +3 -0
  483. package/dist/translations/fr.js +7 -0
  484. package/dist/utilities/animation-registry.d.ts +24 -0
  485. package/dist/utilities/animation-registry.js +11 -0
  486. package/dist/utilities/animation.d.ts +1 -0
  487. package/dist/utilities/animation.js +10 -0
  488. package/dist/utilities/base-path.d.ts +18 -0
  489. package/dist/utilities/base-path.js +9 -0
  490. package/dist/utilities/form.d.ts +11 -0
  491. package/dist/utilities/form.js +43 -0
  492. package/dist/utilities/icon-library.d.ts +1 -0
  493. package/dist/utilities/icon-library.js +13 -0
  494. package/dist/utilities/localize.d.ts +39 -0
  495. package/dist/utilities/localize.js +9 -0
  496. package/dist/utilities/storybook.d.ts +46 -0
  497. package/dist/utilities/storybook.js +54 -0
  498. package/dist/vscode.html-custom-data.json +2392 -0
  499. package/dist/web-types.json +8687 -0
  500. package/package.json +109 -0
@@ -0,0 +1,806 @@
1
+ import {
2
+ select_styles_default
3
+ } from "./chunk.DURVPB6M.js";
4
+ import {
5
+ defaultValue
6
+ } from "./chunk.GI7VDIWX.js";
7
+ import {
8
+ scrollIntoView
9
+ } from "./chunk.EMIT7S33.js";
10
+ import {
11
+ FormControlController
12
+ } from "./chunk.KIFBWPW5.js";
13
+ import {
14
+ HasSlotController
15
+ } from "./chunk.YIY5RM53.js";
16
+ import {
17
+ waitForEvent
18
+ } from "./chunk.B4BZKR24.js";
19
+ import {
20
+ animateTo,
21
+ stopAnimations
22
+ } from "./chunk.2FK6USFR.js";
23
+ import {
24
+ getAnimation,
25
+ setDefaultAnimation
26
+ } from "./chunk.V7RJROLH.js";
27
+ import {
28
+ LocalizeController
29
+ } from "./chunk.5XL2LZLC.js";
30
+ import {
31
+ watch
32
+ } from "./chunk.D7CATJYB.js";
33
+ import {
34
+ ShoelaceElement
35
+ } from "./chunk.YCXTCVAZ.js";
36
+ import {
37
+ __decorateClass
38
+ } from "./chunk.6M63UXML.js";
39
+
40
+ // src/components/select/select.ts
41
+ import { html } from "lit";
42
+ import { customElement, property, query, state } from "lit/decorators.js";
43
+ import { classMap } from "lit/directives/class-map.js";
44
+ var DSASelect = class extends ShoelaceElement {
45
+ constructor() {
46
+ super(...arguments);
47
+ this.formControlController = new FormControlController(this, {
48
+ assumeInteractionOn: ["dsa-blur", "dsa-input"]
49
+ });
50
+ this.hasSlotController = new HasSlotController(
51
+ this,
52
+ "help-text",
53
+ "label"
54
+ );
55
+ this.localize = new LocalizeController(this);
56
+ this.typeToSelectString = "";
57
+ this.hasFocus = false;
58
+ this.displayLabel = "";
59
+ this.selectedOptions = [];
60
+ this.name = "";
61
+ this.title = "";
62
+ this.value = "";
63
+ this.defaultValue = [""];
64
+ this.size = "medium";
65
+ this.placeholder = "";
66
+ this.multiple = false;
67
+ this.variant = "base";
68
+ this.maxOptionsVisible = 3;
69
+ this.disabled = false;
70
+ this.clearable = false;
71
+ this.open = false;
72
+ this.hoist = false;
73
+ this.label = "";
74
+ this.placement = "bottom";
75
+ this.helpText = "";
76
+ this.form = "";
77
+ this.required = false;
78
+ this.error = false;
79
+ this.errorMessage = "";
80
+ this.displayValue = false;
81
+ this.noSyncWidth = false;
82
+ }
83
+ /** Gets the validity state object */
84
+ get validity() {
85
+ return this.valueInput.validity;
86
+ }
87
+ /** Gets the validation message */
88
+ get validationMessage() {
89
+ return this.valueInput.validationMessage;
90
+ }
91
+ connectedCallback() {
92
+ super.connectedCallback();
93
+ this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
94
+ this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
95
+ this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
96
+ this.open = false;
97
+ }
98
+ addOpenListeners() {
99
+ document.addEventListener("focusin", this.handleDocumentFocusIn);
100
+ document.addEventListener("keydown", this.handleDocumentKeyDown);
101
+ document.addEventListener("mousedown", this.handleDocumentMouseDown);
102
+ }
103
+ removeOpenListeners() {
104
+ document.removeEventListener("focusin", this.handleDocumentFocusIn);
105
+ document.removeEventListener("keydown", this.handleDocumentKeyDown);
106
+ document.removeEventListener("mousedown", this.handleDocumentMouseDown);
107
+ }
108
+ handleFocus() {
109
+ this.hasFocus = true;
110
+ this.displayInput.setSelectionRange(0, 0);
111
+ this.emit("dsa-focus");
112
+ }
113
+ handleBlur() {
114
+ this.hasFocus = false;
115
+ this.emit("dsa-blur");
116
+ }
117
+ handleDocumentFocusIn(event) {
118
+ const path = event.composedPath();
119
+ if (this && !path.includes(this)) {
120
+ this.hide();
121
+ }
122
+ }
123
+ handleDocumentKeyDown(event) {
124
+ const target = event.target;
125
+ const isClearButton = target.closest(".select__clear") !== null;
126
+ const isIconButton = target.closest("dsa-icon-button") !== null;
127
+ if (isClearButton || isIconButton) {
128
+ return;
129
+ }
130
+ if (event.key === "Escape" && this.open) {
131
+ event.preventDefault();
132
+ event.stopPropagation();
133
+ this.hide();
134
+ this.displayInput.focus({ preventScroll: true });
135
+ }
136
+ if (event.key === "Enter" || event.key === " " && this.typeToSelectString === "") {
137
+ event.preventDefault();
138
+ event.stopImmediatePropagation();
139
+ if (!this.open) {
140
+ this.show();
141
+ return;
142
+ }
143
+ if (this.currentOption && !this.currentOption.disabled) {
144
+ if (this.multiple) {
145
+ this.toggleOptionSelection(this.currentOption);
146
+ } else {
147
+ this.setSelectedOptions(this.currentOption);
148
+ }
149
+ this.updateComplete.then(() => {
150
+ this.emit("dsa-input");
151
+ this.emit("dsa-change");
152
+ });
153
+ if (!this.multiple) {
154
+ this.hide();
155
+ this.displayInput.focus({ preventScroll: true });
156
+ }
157
+ }
158
+ return;
159
+ }
160
+ if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
161
+ const allOptions = this.getAllOptions();
162
+ const currentIndex = allOptions.indexOf(this.currentOption);
163
+ let newIndex = Math.max(0, currentIndex);
164
+ event.preventDefault();
165
+ if (!this.open) {
166
+ this.show();
167
+ if (this.currentOption) {
168
+ return;
169
+ }
170
+ }
171
+ if (event.key === "ArrowDown") {
172
+ newIndex = currentIndex + 1;
173
+ if (newIndex > allOptions.length - 1)
174
+ newIndex = 0;
175
+ } else if (event.key === "ArrowUp") {
176
+ newIndex = currentIndex - 1;
177
+ if (newIndex < 0)
178
+ newIndex = allOptions.length - 1;
179
+ } else if (event.key === "Home") {
180
+ newIndex = 0;
181
+ } else if (event.key === "End") {
182
+ newIndex = allOptions.length - 1;
183
+ }
184
+ this.setCurrentOption(allOptions[newIndex]);
185
+ }
186
+ if (event.key.length === 1 || event.key === "Backspace") {
187
+ const allOptions = this.getAllOptions();
188
+ if (event.metaKey || event.ctrlKey || event.altKey) {
189
+ return;
190
+ }
191
+ if (!this.open) {
192
+ if (event.key === "Backspace") {
193
+ return;
194
+ }
195
+ this.show();
196
+ }
197
+ event.stopPropagation();
198
+ event.preventDefault();
199
+ clearTimeout(this.typeToSelectTimeout);
200
+ this.typeToSelectTimeout = window.setTimeout(
201
+ () => this.typeToSelectString = "",
202
+ 1e3
203
+ );
204
+ if (event.key === "Backspace") {
205
+ this.typeToSelectString = this.typeToSelectString.slice(0, -1);
206
+ } else {
207
+ this.typeToSelectString += event.key.toLowerCase();
208
+ }
209
+ for (const option of allOptions) {
210
+ const label = option.getTextLabel().toLowerCase();
211
+ if (label.startsWith(this.typeToSelectString)) {
212
+ this.setCurrentOption(option);
213
+ break;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ handleDocumentMouseDown(event) {
219
+ const path = event.composedPath();
220
+ if (this && !path.includes(this)) {
221
+ this.hide();
222
+ }
223
+ }
224
+ handleLabelClick() {
225
+ this.displayInput.focus();
226
+ }
227
+ handleComboboxMouseDown(event) {
228
+ const path = event.composedPath();
229
+ const isIconButton = path.some(
230
+ (el) => el instanceof Element && el.tagName.toLowerCase() === "dsa-icon-button"
231
+ );
232
+ if (this.disabled || isIconButton) {
233
+ return;
234
+ }
235
+ event.preventDefault();
236
+ this.displayInput.focus({ preventScroll: true });
237
+ this.open = !this.open;
238
+ }
239
+ handleComboboxKeyDown(event) {
240
+ event.stopPropagation();
241
+ this.handleDocumentKeyDown(event);
242
+ }
243
+ handleClearClick(event) {
244
+ event.stopPropagation();
245
+ if (this.value !== "") {
246
+ this.setSelectedOptions([]);
247
+ this.displayInput.focus({ preventScroll: true });
248
+ this.updateComplete.then(() => {
249
+ this.emit("dsa-clear");
250
+ this.emit("dsa-input");
251
+ this.emit("dsa-change");
252
+ });
253
+ }
254
+ }
255
+ handleClearMouseDown(event) {
256
+ event.stopPropagation();
257
+ event.preventDefault();
258
+ }
259
+ handleOptionClick(event) {
260
+ const target = event.target;
261
+ const option = target.closest("dsa-option");
262
+ const oldValue = this.value;
263
+ if (option && !option.disabled) {
264
+ if (this.multiple) {
265
+ this.toggleOptionSelection(option);
266
+ } else {
267
+ this.setSelectedOptions(option);
268
+ }
269
+ this.updateComplete.then(
270
+ () => this.displayInput.focus({ preventScroll: true })
271
+ );
272
+ if (this.value !== oldValue) {
273
+ this.updateComplete.then(() => {
274
+ this.emit("dsa-input");
275
+ this.emit("dsa-change");
276
+ });
277
+ }
278
+ if (!this.multiple) {
279
+ this.hide();
280
+ this.displayInput.focus({ preventScroll: true });
281
+ }
282
+ }
283
+ }
284
+ handleDefaultSlotChange() {
285
+ const allOptions = this.getAllOptions();
286
+ const value = Array.isArray(this.value) ? this.value : [this.value];
287
+ const values = [];
288
+ if (customElements.get("dsa-option")) {
289
+ allOptions.forEach((option) => values.push(option.value));
290
+ this.setSelectedOptions(
291
+ allOptions.filter((el) => value.includes(el.value))
292
+ );
293
+ } else {
294
+ customElements.whenDefined("dsa-option").then(() => this.handleDefaultSlotChange());
295
+ }
296
+ }
297
+ handleTagRemove(event, option) {
298
+ event.stopPropagation();
299
+ if (!this.disabled) {
300
+ this.toggleOptionSelection(option, false);
301
+ this.updateComplete.then(() => {
302
+ this.emit("dsa-input");
303
+ this.emit("dsa-change");
304
+ });
305
+ }
306
+ }
307
+ // Gets an array of all <dsa-option> elements
308
+ getAllOptions() {
309
+ return [...this.querySelectorAll("dsa-option")];
310
+ }
311
+ // Gets the first <dsa-option> element
312
+ getFirstOption() {
313
+ return this.querySelector("dsa-option");
314
+ }
315
+ // Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one
316
+ // option may be "current" at a time.
317
+ setCurrentOption(option) {
318
+ const allOptions = this.getAllOptions();
319
+ allOptions.forEach((el) => {
320
+ el.current = false;
321
+ el.tabIndex = -1;
322
+ });
323
+ if (option) {
324
+ this.currentOption = option;
325
+ option.current = true;
326
+ option.tabIndex = 0;
327
+ option.focus();
328
+ }
329
+ }
330
+ // Sets the selected option(s)
331
+ setSelectedOptions(option) {
332
+ const allOptions = this.getAllOptions();
333
+ const newSelectedOptions = Array.isArray(option) ? option : [option];
334
+ allOptions.forEach((el) => el.selected = false);
335
+ if (newSelectedOptions.length) {
336
+ newSelectedOptions.forEach((el) => el.selected = true);
337
+ }
338
+ this.selectionChanged();
339
+ }
340
+ // Toggles an option's selected state
341
+ toggleOptionSelection(option, force) {
342
+ if (force === true || force === false) {
343
+ option.selected = force;
344
+ } else {
345
+ option.selected = !option.selected;
346
+ }
347
+ this.selectionChanged();
348
+ }
349
+ // This method must be called whenever the selection changes. It will update the selected options cache, the current
350
+ // value, and the display value
351
+ selectionChanged() {
352
+ var _a, _b, _c, _d;
353
+ this.selectedOptions = this.getAllOptions().filter((el) => el.selected);
354
+ if (this.multiple) {
355
+ this.value = this.selectedOptions.map((el) => el.value);
356
+ if (this.placeholder && this.value.length === 0) {
357
+ this.displayLabel = "";
358
+ } else {
359
+ this.displayLabel = this.localize.term(
360
+ "numOptionsSelected",
361
+ this.selectedOptions.length
362
+ );
363
+ }
364
+ } else {
365
+ this.value = (_b = (_a = this.selectedOptions[0]) == null ? void 0 : _a.value) != null ? _b : "";
366
+ this.displayLabel = (_d = (_c = this.selectedOptions[0]) == null ? void 0 : _c.getTextLabel()) != null ? _d : "";
367
+ }
368
+ this.updateComplete.then(() => {
369
+ this.formControlController.updateValidity();
370
+ });
371
+ }
372
+ handleInvalid(event) {
373
+ this.formControlController.setValidity(false);
374
+ this.formControlController.emitInvalidEvent(event);
375
+ }
376
+ handleDisabledChange() {
377
+ if (this.disabled) {
378
+ this.open = false;
379
+ this.handleOpenChange();
380
+ }
381
+ }
382
+ handleValueChange() {
383
+ const allOptions = this.getAllOptions();
384
+ const value = Array.isArray(this.value) ? this.value : [this.value];
385
+ this.setSelectedOptions(
386
+ allOptions.filter((el) => value.includes(el.value))
387
+ );
388
+ }
389
+ async handleOpenChange() {
390
+ if (this.open && !this.disabled) {
391
+ this.setCurrentOption(this.selectedOptions[0] || this.getFirstOption());
392
+ this.emit("dsa-show");
393
+ this.addOpenListeners();
394
+ await stopAnimations(this);
395
+ this.listbox.hidden = false;
396
+ this.popup.active = true;
397
+ requestAnimationFrame(() => {
398
+ this.setCurrentOption(this.currentOption);
399
+ });
400
+ const { keyframes, options } = getAnimation(this, "select.show", {
401
+ dir: this.localize.dir()
402
+ });
403
+ await animateTo(this.popup.popup, keyframes, options);
404
+ if (this.currentOption) {
405
+ scrollIntoView(this.currentOption, this.listbox, "vertical", "auto");
406
+ }
407
+ this.emit("dsa-after-show");
408
+ } else {
409
+ this.emit("dsa-hide");
410
+ this.removeOpenListeners();
411
+ await stopAnimations(this);
412
+ const { keyframes, options } = getAnimation(this, "select.hide", {
413
+ dir: this.localize.dir()
414
+ });
415
+ await animateTo(this.popup.popup, keyframes, options);
416
+ this.listbox.hidden = true;
417
+ this.popup.active = false;
418
+ this.emit("dsa-after-hide");
419
+ }
420
+ }
421
+ /** Shows the listbox. */
422
+ async show() {
423
+ if (this.open || this.disabled) {
424
+ this.open = false;
425
+ return void 0;
426
+ }
427
+ this.open = true;
428
+ return await waitForEvent(this, "dsa-after-show");
429
+ }
430
+ /** Hides the listbox. */
431
+ async hide() {
432
+ if (!this.open || this.disabled) {
433
+ this.open = false;
434
+ return void 0;
435
+ }
436
+ this.open = false;
437
+ return await waitForEvent(this, "dsa-after-hide");
438
+ }
439
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
440
+ checkValidity() {
441
+ return this.valueInput.checkValidity();
442
+ }
443
+ /** Gets the associated form, if one exists. */
444
+ getForm() {
445
+ return this.formControlController.getForm();
446
+ }
447
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
448
+ reportValidity() {
449
+ return this.valueInput.reportValidity();
450
+ }
451
+ /** Sets a custom validation message. Pass an empty string to restore validity. */
452
+ setCustomValidity(message) {
453
+ this.valueInput.setCustomValidity(message);
454
+ this.formControlController.updateValidity();
455
+ }
456
+ /** Sets focus on the control. */
457
+ focus(options) {
458
+ this.displayInput.focus(options);
459
+ }
460
+ /** Removes focus from the control. */
461
+ blur() {
462
+ this.displayInput.blur();
463
+ }
464
+ render() {
465
+ const isValueDefined = this.value.length > 0;
466
+ const hasLabelSlot = this.hasSlotController.test("label");
467
+ const hasHelpTextSlot = this.hasSlotController.test("help-text");
468
+ const hasLabel = this.label ? true : !!hasLabelSlot;
469
+ const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
470
+ const hasClearIcon = this.clearable && !this.disabled && isValueDefined;
471
+ const isPlaceholderVisible = this.placeholder && this.value.length === 0;
472
+ const selectInputWidth = this.displayValue ? isValueDefined ? this.value.length : 1 : void 0;
473
+ return html`
474
+ <div
475
+ part="form-control"
476
+ class=${classMap({
477
+ "form-control": true,
478
+ "form-control--error": this.error,
479
+ "form-control--disabled": this.disabled,
480
+ "form-control--small": this.size === "small",
481
+ "form-control--medium": this.size === "medium",
482
+ "form-control--large": this.size === "large",
483
+ "form-control--has-label": hasLabel,
484
+ "form-control--has-help-text": hasHelpText
485
+ })}
486
+ >
487
+ <label
488
+ id="label"
489
+ part="form-control-label"
490
+ class="form-control__label"
491
+ aria-hidden=${hasLabel ? "false" : "true"}
492
+ @click=${this.handleLabelClick}
493
+ >
494
+ ${this.required ? html`<span class="form-control__label-required">*</span>` : ""}
495
+ <slot name="label">${this.label}</slot>
496
+ </label>
497
+ <slot name="tooltip" class="form-control__tooltip"></slot>
498
+
499
+ <div
500
+ part="form-control-input"
501
+ class="form-control-input form-control__field"
502
+ >
503
+ <dsa-popup
504
+ class=${classMap({
505
+ select: true,
506
+ "select--error": this.error,
507
+ "select--open": this.open,
508
+ "select--disabled": this.disabled,
509
+ "select--multiple": this.multiple,
510
+ "select--focused": this.hasFocus,
511
+ "select--placeholder-visible": isPlaceholderVisible,
512
+ "select--top": ["top", "top-start", "top-end"].includes(
513
+ this.placement
514
+ ),
515
+ "select--bottom": [
516
+ "bottom",
517
+ "bottom-start",
518
+ "bottom-end"
519
+ ].includes(this.placement),
520
+ "select--small": this.size === "small",
521
+ "select--medium": this.size === "medium",
522
+ "select--large": this.size === "large",
523
+ "select--on-base": this.variant === "base",
524
+ "select--on-layer": this.variant === "layer"
525
+ })}
526
+ part="popup"
527
+ placement=${this.placement}
528
+ strategy=${this.hoist ? "fixed" : "absolute"}
529
+ flip
530
+ shift
531
+ sync=${this.noSyncWidth ? void 0 : "width"}
532
+ auto-size="vertical"
533
+ auto-size-padding="10"
534
+ >
535
+ <div
536
+ part="combobox"
537
+ class="select__combobox"
538
+ slot="anchor"
539
+ @keydown=${this.handleComboboxKeyDown}
540
+ @mousedown=${this.handleComboboxMouseDown}
541
+ >
542
+ <slot part="prefix" name="prefix" class="select__prefix"></slot>
543
+
544
+ <input
545
+ part="display-input"
546
+ class="select__display-input"
547
+ type="text"
548
+ placeholder=${this.placeholder}
549
+ .disabled=${this.disabled}
550
+ .value=${this.displayValue ? this.value : this.displayLabel}
551
+ size=${selectInputWidth}
552
+ autocomplete="off"
553
+ spellcheck="false"
554
+ autocapitalize="off"
555
+ readonly
556
+ title=${hasLabel ? void 0 : this.title}
557
+ aria-controls="listbox"
558
+ aria-expanded=${this.open ? "true" : "false"}
559
+ aria-haspopup="listbox"
560
+ aria-labelledby=${hasLabel ? "label" : void 0}
561
+ aria-label=${hasLabel ? void 0 : this.title}
562
+ aria-disabled=${this.disabled ? "true" : "false"}
563
+ aria-describedby="help-text"
564
+ role="combobox"
565
+ tabindex="0"
566
+ @focus=${this.handleFocus}
567
+ @blur=${this.handleBlur}
568
+ />
569
+
570
+ ${this.multiple ? html`
571
+ <div part="tags" class="select__tags">
572
+ ${this.selectedOptions.map((option, index) => {
573
+ if (index < this.maxOptionsVisible || this.maxOptionsVisible <= 0) {
574
+ return html`
575
+ <dsa-tag
576
+ part="tag"
577
+ exportparts="
578
+ base:tag__base,
579
+ content:tag__content,
580
+ remove-button:tag__remove-button,
581
+ remove-button__base:tag__remove-button__base
582
+ "
583
+ size=${this.size}
584
+ removable
585
+ disable-removable-focus
586
+ @dsa-remove=${(event) => this.handleTagRemove(event, option)}
587
+ label=${option.getTextLabel()}
588
+ >
589
+ </dsa-tag>
590
+ `;
591
+ } else if (index === this.maxOptionsVisible) {
592
+ return html`
593
+ <dsa-tag
594
+ disable-removable-focus
595
+ size=${this.size}
596
+ label="+${this.selectedOptions.length - index}"
597
+ >
598
+ </dsa-tag>
599
+ `;
600
+ } else {
601
+ return null;
602
+ }
603
+ })}
604
+ </div>
605
+ ` : ""}
606
+
607
+ <input
608
+ class="select__value-input"
609
+ type="text"
610
+ ?disabled=${this.disabled}
611
+ ?required=${this.required}
612
+ .value=${Array.isArray(this.value) ? this.value.join(", ") : this.value}
613
+ tabindex="-1"
614
+ aria-hidden="true"
615
+ @focus=${() => this.focus()}
616
+ @invalid=${this.handleInvalid}
617
+ />
618
+
619
+ ${hasClearIcon ? html`
620
+ <button
621
+ part="clear-button"
622
+ class="select__clear"
623
+ type="button"
624
+ aria-label=${this.localize.term("clearEntry")}
625
+ @mousedown=${this.handleClearMouseDown}
626
+ @click=${this.handleClearClick}
627
+ tabindex="-1"
628
+ >
629
+ <dsa-icon name="close"></dsa-icon>
630
+ </button>
631
+ ` : ""}
632
+
633
+ <dsa-icon
634
+ class="select__expand-icon"
635
+ name="arrow_drop_down"
636
+ ></dsa-icon>
637
+ </div>
638
+
639
+ <slot
640
+ id="listbox"
641
+ role="listbox"
642
+ aria-expanded=${this.open ? "true" : "false"}
643
+ aria-multiselectable=${this.multiple ? "true" : "false"}
644
+ aria-labelledby="label"
645
+ part="listbox"
646
+ class="select__listbox"
647
+ tabindex="-1"
648
+ @mouseup=${this.handleOptionClick}
649
+ @slotchange=${this.handleDefaultSlotChange}
650
+ ></slot>
651
+ </dsa-popup>
652
+ </div>
653
+ <slot
654
+ name="help-text"
655
+ part="form-control-help-text"
656
+ id="help-text"
657
+ class="form-control__help-text"
658
+ aria-hidden=${hasHelpText ? "false" : "true"}
659
+ >
660
+ ${this.helpText}
661
+ </slot>
662
+
663
+ ${this.error && !this.disabled ? html`<dsa-error-text
664
+ part="form-control-error-text"
665
+ class="form-control__error-text"
666
+ >${this.errorMessage}</dsa-error-text
667
+ >` : ""}
668
+ </div>
669
+ `;
670
+ }
671
+ };
672
+ DSASelect.styles = select_styles_default;
673
+ __decorateClass([
674
+ query(".select")
675
+ ], DSASelect.prototype, "popup", 2);
676
+ __decorateClass([
677
+ query(".select__combobox")
678
+ ], DSASelect.prototype, "combobox", 2);
679
+ __decorateClass([
680
+ query(".select__display-input")
681
+ ], DSASelect.prototype, "displayInput", 2);
682
+ __decorateClass([
683
+ query(".select__value-input")
684
+ ], DSASelect.prototype, "valueInput", 2);
685
+ __decorateClass([
686
+ query(".select__listbox")
687
+ ], DSASelect.prototype, "listbox", 2);
688
+ __decorateClass([
689
+ state()
690
+ ], DSASelect.prototype, "hasFocus", 2);
691
+ __decorateClass([
692
+ state()
693
+ ], DSASelect.prototype, "displayLabel", 2);
694
+ __decorateClass([
695
+ state()
696
+ ], DSASelect.prototype, "currentOption", 2);
697
+ __decorateClass([
698
+ state()
699
+ ], DSASelect.prototype, "selectedOptions", 2);
700
+ __decorateClass([
701
+ property()
702
+ ], DSASelect.prototype, "name", 2);
703
+ __decorateClass([
704
+ property()
705
+ ], DSASelect.prototype, "title", 2);
706
+ __decorateClass([
707
+ property({
708
+ converter: {
709
+ fromAttribute: (value) => value.split(" "),
710
+ toAttribute: (value) => {
711
+ if (typeof value === "string") {
712
+ return value;
713
+ } else {
714
+ return value.join(" ");
715
+ }
716
+ }
717
+ }
718
+ })
719
+ ], DSASelect.prototype, "value", 2);
720
+ __decorateClass([
721
+ defaultValue()
722
+ ], DSASelect.prototype, "defaultValue", 2);
723
+ __decorateClass([
724
+ property()
725
+ ], DSASelect.prototype, "size", 2);
726
+ __decorateClass([
727
+ property()
728
+ ], DSASelect.prototype, "placeholder", 2);
729
+ __decorateClass([
730
+ property({ type: Boolean, reflect: true })
731
+ ], DSASelect.prototype, "multiple", 2);
732
+ __decorateClass([
733
+ property({ reflect: true })
734
+ ], DSASelect.prototype, "variant", 2);
735
+ __decorateClass([
736
+ property({ attribute: "max-options-visible", type: Number })
737
+ ], DSASelect.prototype, "maxOptionsVisible", 2);
738
+ __decorateClass([
739
+ property({ type: Boolean, reflect: true })
740
+ ], DSASelect.prototype, "disabled", 2);
741
+ __decorateClass([
742
+ property({ type: Boolean })
743
+ ], DSASelect.prototype, "clearable", 2);
744
+ __decorateClass([
745
+ property({ type: Boolean, reflect: true })
746
+ ], DSASelect.prototype, "open", 2);
747
+ __decorateClass([
748
+ property({ type: Boolean })
749
+ ], DSASelect.prototype, "hoist", 2);
750
+ __decorateClass([
751
+ property()
752
+ ], DSASelect.prototype, "label", 2);
753
+ __decorateClass([
754
+ property({ reflect: true })
755
+ ], DSASelect.prototype, "placement", 2);
756
+ __decorateClass([
757
+ property({ attribute: "help-text" })
758
+ ], DSASelect.prototype, "helpText", 2);
759
+ __decorateClass([
760
+ property({ reflect: true })
761
+ ], DSASelect.prototype, "form", 2);
762
+ __decorateClass([
763
+ property({ type: Boolean, reflect: true })
764
+ ], DSASelect.prototype, "required", 2);
765
+ __decorateClass([
766
+ property({ type: Boolean })
767
+ ], DSASelect.prototype, "error", 2);
768
+ __decorateClass([
769
+ property({ attribute: "error-message" })
770
+ ], DSASelect.prototype, "errorMessage", 2);
771
+ __decorateClass([
772
+ property({ attribute: "display-value", type: Boolean })
773
+ ], DSASelect.prototype, "displayValue", 2);
774
+ __decorateClass([
775
+ property({ attribute: "no-sync-width", type: Boolean })
776
+ ], DSASelect.prototype, "noSyncWidth", 2);
777
+ __decorateClass([
778
+ watch("disabled", { waitUntilFirstUpdate: true })
779
+ ], DSASelect.prototype, "handleDisabledChange", 1);
780
+ __decorateClass([
781
+ watch("value", { waitUntilFirstUpdate: true })
782
+ ], DSASelect.prototype, "handleValueChange", 1);
783
+ __decorateClass([
784
+ watch("open", { waitUntilFirstUpdate: true })
785
+ ], DSASelect.prototype, "handleOpenChange", 1);
786
+ DSASelect = __decorateClass([
787
+ customElement("dsa-select")
788
+ ], DSASelect);
789
+ setDefaultAnimation("select.show", {
790
+ keyframes: [
791
+ { opacity: 0, scale: 0.9 },
792
+ { opacity: 1, scale: 1 }
793
+ ],
794
+ options: { duration: 100, easing: "ease" }
795
+ });
796
+ setDefaultAnimation("select.hide", {
797
+ keyframes: [
798
+ { opacity: 1, scale: 1 },
799
+ { opacity: 0, scale: 0.9 }
800
+ ],
801
+ options: { duration: 100, easing: "ease" }
802
+ });
803
+
804
+ export {
805
+ DSASelect
806
+ };