@riverty/web-components 6.3.0 → 6.3.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 (397) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  3. package/dist/cjs/focusable-Oll_rmtP.js +28 -0
  4. package/dist/cjs/formData-B2DZyLxP.js +44 -0
  5. package/dist/cjs/index-BnETQtSf.js +1834 -0
  6. package/dist/cjs/index.cjs.js +37 -0
  7. package/dist/cjs/loader.cjs.js +13 -0
  8. package/dist/cjs/r-accordion-panel.cjs.entry.js +24 -0
  9. package/dist/cjs/r-accordion-section.cjs.entry.js +125 -0
  10. package/dist/cjs/r-accordion-trigger.cjs.entry.js +93 -0
  11. package/dist/cjs/r-accordion.cjs.entry.js +20 -0
  12. package/dist/cjs/r-alert.cjs.entry.js +146 -0
  13. package/dist/cjs/r-badge.cjs.entry.js +41 -0
  14. package/dist/cjs/r-button.cjs.entry.js +149 -0
  15. package/dist/cjs/r-checkbox-group.cjs.entry.js +237 -0
  16. package/dist/cjs/r-checkbox.cjs.entry.js +274 -0
  17. package/dist/cjs/r-design-system-devtools.cjs.entry.js +31 -0
  18. package/dist/cjs/r-dialog.cjs.entry.js +107 -0
  19. package/dist/cjs/r-hint_2.cjs.entry.js +50 -0
  20. package/dist/cjs/r-icon-button_2.cjs.entry.js +492 -0
  21. package/dist/cjs/r-icon.cjs.entry.js +284 -0
  22. package/dist/cjs/r-illustration.cjs.entry.js +396 -0
  23. package/dist/cjs/r-input-code.cjs.entry.js +437 -0
  24. package/dist/cjs/r-input-date.cjs.entry.js +524 -0
  25. package/dist/cjs/r-input-password.cjs.entry.js +270 -0
  26. package/dist/cjs/r-input-phone-number.cjs.entry.js +2525 -0
  27. package/dist/cjs/r-input.cjs.entry.js +618 -0
  28. package/dist/cjs/r-list-item.cjs.entry.js +109 -0
  29. package/dist/cjs/r-pagination.cjs.entry.js +320 -0
  30. package/dist/cjs/r-panel.cjs.entry.js +184 -0
  31. package/dist/cjs/r-popover-action.cjs.entry.js +80 -0
  32. package/dist/cjs/r-popover-content.cjs.entry.js +62 -0
  33. package/dist/cjs/r-popover-headline.cjs.entry.js +28 -0
  34. package/dist/cjs/r-popover-trigger.cjs.entry.js +70 -0
  35. package/dist/cjs/r-popover.cjs.entry.js +347 -0
  36. package/dist/cjs/r-progress-bar.cjs.entry.js +25 -0
  37. package/dist/cjs/r-radio-button-description.cjs.entry.js +18 -0
  38. package/dist/cjs/r-radio-button-leading.cjs.entry.js +18 -0
  39. package/dist/cjs/r-radio-button-title.cjs.entry.js +18 -0
  40. package/dist/cjs/r-radio-button-trailing.cjs.entry.js +18 -0
  41. package/dist/cjs/r-radio-button.cjs.entry.js +139 -0
  42. package/dist/cjs/r-radio-group.cjs.entry.js +428 -0
  43. package/dist/cjs/r-select-option.cjs.entry.js +130 -0
  44. package/dist/cjs/r-select.cjs.entry.js +1107 -0
  45. package/dist/cjs/r-skip-link.cjs.entry.js +19 -0
  46. package/dist/cjs/r-stepper-item.cjs.entry.js +42 -0
  47. package/dist/cjs/r-stepper.cjs.entry.js +99 -0
  48. package/dist/cjs/r-tab-panel.cjs.entry.js +26 -0
  49. package/dist/cjs/r-tab.cjs.entry.js +62 -0
  50. package/dist/cjs/r-tabs-list.cjs.entry.js +175 -0
  51. package/dist/cjs/r-tabs.cjs.entry.js +277 -0
  52. package/dist/cjs/r-textarea.cjs.entry.js +270 -0
  53. package/dist/cjs/r-toast-group.cjs.entry.js +46 -0
  54. package/dist/cjs/r-toast.cjs.entry.js +314 -0
  55. package/dist/cjs/style-observer-D9zSP9wP.js +1118 -0
  56. package/dist/cjs/theming-NqxjhVJS.js +109 -0
  57. package/dist/cjs/web-components.cjs.js +25 -0
  58. package/dist/collection/collection-manifest.json +60 -0
  59. package/dist/collection/components/accordion/accordion.css +24 -0
  60. package/dist/collection/components/accordion/accordion.js +90 -0
  61. package/dist/collection/components/accordion/exports.js +1 -0
  62. package/dist/collection/components/accordion-panel/accordion-panel.css +50 -0
  63. package/dist/collection/components/accordion-panel/accordion-panel.js +86 -0
  64. package/dist/collection/components/accordion-section/accordion-section.css +27 -0
  65. package/dist/collection/components/accordion-section/accordion-section.js +235 -0
  66. package/dist/collection/components/accordion-trigger/accordion-trigger.css +93 -0
  67. package/dist/collection/components/accordion-trigger/accordion-trigger.js +220 -0
  68. package/dist/collection/components/alert/alert.css +120 -0
  69. package/dist/collection/components/alert/alert.js +526 -0
  70. package/dist/collection/components/alert/exports.js +2 -0
  71. package/dist/collection/components/badge/badge.css +62 -0
  72. package/dist/collection/components/badge/badge.js +124 -0
  73. package/dist/collection/components/badge/exports.js +1 -0
  74. package/dist/collection/components/button/button.css +180 -0
  75. package/dist/collection/components/button/button.js +510 -0
  76. package/dist/collection/components/button/exports.js +5 -0
  77. package/dist/collection/components/checkbox/checkbox.css +116 -0
  78. package/dist/collection/components/checkbox/checkbox.js +803 -0
  79. package/dist/collection/components/checkbox-group/checkbox-group.css +48 -0
  80. package/dist/collection/components/checkbox-group/checkbox-group.js +744 -0
  81. package/dist/collection/components/design-system-devtools/design-system-devtools.js +59 -0
  82. package/dist/collection/components/dialog/dialog.css +125 -0
  83. package/dist/collection/components/dialog/dialog.js +345 -0
  84. package/dist/collection/components/dialog/exports.js +9 -0
  85. package/dist/collection/components/hint/exports.js +1 -0
  86. package/dist/collection/components/hint/hint.css +63 -0
  87. package/dist/collection/components/hint/hint.js +114 -0
  88. package/dist/collection/components/icon/all-kit.js +2 -0
  89. package/dist/collection/components/icon/data.js +90 -0
  90. package/dist/collection/components/icon/exports.js +7 -0
  91. package/dist/collection/components/icon/icon.css +105 -0
  92. package/dist/collection/components/icon/icon.js +379 -0
  93. package/dist/collection/components/icon/riverty-kit.js +2 -0
  94. package/dist/collection/components/icon-button/icon-button.css +105 -0
  95. package/dist/collection/components/icon-button/icon-button.js +343 -0
  96. package/dist/collection/components/illustration/data.js +112 -0
  97. package/dist/collection/components/illustration/exports.js +3 -0
  98. package/dist/collection/components/illustration/illustration.css +52 -0
  99. package/dist/collection/components/illustration/illustration.js +540 -0
  100. package/dist/collection/components/illustration/illustrations-ui-kit.js +2 -0
  101. package/dist/collection/components/input/exports.js +62 -0
  102. package/dist/collection/components/input/input.css +186 -0
  103. package/dist/collection/components/input/input.js +1861 -0
  104. package/dist/collection/components/input-code/exports.js +2 -0
  105. package/dist/collection/components/input-code/input-code.css +127 -0
  106. package/dist/collection/components/input-code/input-code.js +1165 -0
  107. package/dist/collection/components/input-date/exports.js +1 -0
  108. package/dist/collection/components/input-date/input-date.css +148 -0
  109. package/dist/collection/components/input-date/input-date.js +1254 -0
  110. package/dist/collection/components/input-password/exports.js +1 -0
  111. package/dist/collection/components/input-password/input-password.css +25 -0
  112. package/dist/collection/components/input-password/input-password.js +1077 -0
  113. package/dist/collection/components/input-phone-number/input-phone-number.css +61 -0
  114. package/dist/collection/components/input-phone-number/input-phone-number.js +893 -0
  115. package/dist/collection/components/label/label.css +38 -0
  116. package/dist/collection/components/label/label.js +47 -0
  117. package/dist/collection/components/list-item/list-item/exports.js +2 -0
  118. package/dist/collection/components/list-item/list-item/list-item.css +199 -0
  119. package/dist/collection/components/list-item/list-item/list-item.js +467 -0
  120. package/dist/collection/components/pagination/exports.js +3 -0
  121. package/dist/collection/components/pagination/pagination.css +118 -0
  122. package/dist/collection/components/pagination/pagination.js +814 -0
  123. package/dist/collection/components/panel/exports.js +1 -0
  124. package/dist/collection/components/panel/panel.css +192 -0
  125. package/dist/collection/components/panel/panel.js +473 -0
  126. package/dist/collection/components/popover/exports.js +3 -0
  127. package/dist/collection/components/popover/popover.css +251 -0
  128. package/dist/collection/components/popover/popover.js +741 -0
  129. package/dist/collection/components/popover-action/popover-action.css +21 -0
  130. package/dist/collection/components/popover-action/popover-action.js +150 -0
  131. package/dist/collection/components/popover-content/popover-content.css +9 -0
  132. package/dist/collection/components/popover-content/popover-content.js +130 -0
  133. package/dist/collection/components/popover-headline/popover-headline.css +7 -0
  134. package/dist/collection/components/popover-headline/popover-headline.js +28 -0
  135. package/dist/collection/components/popover-trigger/exports.js +1 -0
  136. package/dist/collection/components/popover-trigger/popover-trigger.css +4 -0
  137. package/dist/collection/components/popover-trigger/popover-trigger.js +163 -0
  138. package/dist/collection/components/progress-bar/progress-bar.css +41 -0
  139. package/dist/collection/components/progress-bar/progress-bar.js +71 -0
  140. package/dist/collection/components/radio-button/radio-button.css +126 -0
  141. package/dist/collection/components/radio-button/radio-button.js +559 -0
  142. package/dist/collection/components/radio-button-description/radio-button-description.css +5 -0
  143. package/dist/collection/components/radio-button-description/radio-button-description.js +22 -0
  144. package/dist/collection/components/radio-button-leading/radio-button-leading.css +3 -0
  145. package/dist/collection/components/radio-button-leading/radio-button-leading.js +22 -0
  146. package/dist/collection/components/radio-button-title/radio-button-title.css +8 -0
  147. package/dist/collection/components/radio-button-title/radio-button-title.js +22 -0
  148. package/dist/collection/components/radio-button-trailing/radio-button-trailing.css +6 -0
  149. package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +22 -0
  150. package/dist/collection/components/radio-group/exports.js +1 -0
  151. package/dist/collection/components/radio-group/radio-group.css +65 -0
  152. package/dist/collection/components/radio-group/radio-group.js +1023 -0
  153. package/dist/collection/components/select/exports.js +1 -0
  154. package/dist/collection/components/select/select.css +247 -0
  155. package/dist/collection/components/select/select.js +2038 -0
  156. package/dist/collection/components/select-option/select-option.css +93 -0
  157. package/dist/collection/components/select-option/select-option.js +459 -0
  158. package/dist/collection/components/skip-link/exports.js +1 -0
  159. package/dist/collection/components/skip-link/skip-link.css +37 -0
  160. package/dist/collection/components/skip-link/skip-link.js +52 -0
  161. package/dist/collection/components/stepper/stepper.css +25 -0
  162. package/dist/collection/components/stepper/stepper.js +216 -0
  163. package/dist/collection/components/stepper-item/stepper-item.css +62 -0
  164. package/dist/collection/components/stepper-item/stepper-item.js +171 -0
  165. package/dist/collection/components/tab/tab.css +81 -0
  166. package/dist/collection/components/tab/tab.js +169 -0
  167. package/dist/collection/components/tab-panel/tab-panel.css +19 -0
  168. package/dist/collection/components/tab-panel/tab-panel.js +72 -0
  169. package/dist/collection/components/tabs/tabs.css +4 -0
  170. package/dist/collection/components/tabs/tabs.js +345 -0
  171. package/dist/collection/components/tabs-list/exports.js +2 -0
  172. package/dist/collection/components/tabs-list/tabs-list.css +58 -0
  173. package/dist/collection/components/tabs-list/tabs-list.js +294 -0
  174. package/dist/collection/components/textarea/exports.js +8 -0
  175. package/dist/collection/components/textarea/textarea.css +148 -0
  176. package/dist/collection/components/textarea/textarea.js +1055 -0
  177. package/dist/collection/components/toast/exports.js +3 -0
  178. package/dist/collection/components/toast/toast.css +179 -0
  179. package/dist/collection/components/toast/toast.js +820 -0
  180. package/dist/collection/components/toast-group/exports.js +1 -0
  181. package/dist/collection/components/toast-group/toast-group.css +37 -0
  182. package/dist/collection/components/toast-group/toast-group.js +49 -0
  183. package/dist/collection/components/tooltip/exports.js +3 -0
  184. package/dist/collection/components/tooltip/tooltip.css +77 -0
  185. package/dist/collection/components/tooltip/tooltip.js +525 -0
  186. package/dist/collection/index.js +2 -0
  187. package/dist/collection/utils/focusable.js +24 -0
  188. package/dist/collection/utils/formData.js +40 -0
  189. package/dist/collection/utils/theming.js +103 -0
  190. package/dist/collection/utils/version-checker.js +33 -0
  191. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  192. package/dist/esm/focusable-ky1yonnS.js +26 -0
  193. package/dist/esm/formData-DvLT8-y3.js +42 -0
  194. package/dist/esm/index-CTxpqopm.js +1806 -0
  195. package/dist/esm/index.js +35 -0
  196. package/dist/esm/loader.js +11 -0
  197. package/dist/esm/r-accordion-panel.entry.js +22 -0
  198. package/dist/esm/r-accordion-section.entry.js +123 -0
  199. package/dist/esm/r-accordion-trigger.entry.js +91 -0
  200. package/dist/esm/r-accordion.entry.js +18 -0
  201. package/dist/esm/r-alert.entry.js +144 -0
  202. package/dist/esm/r-badge.entry.js +39 -0
  203. package/dist/esm/r-button.entry.js +147 -0
  204. package/dist/esm/r-checkbox-group.entry.js +235 -0
  205. package/dist/esm/r-checkbox.entry.js +272 -0
  206. package/dist/esm/r-design-system-devtools.entry.js +29 -0
  207. package/dist/esm/r-dialog.entry.js +105 -0
  208. package/dist/esm/r-hint_2.entry.js +47 -0
  209. package/dist/esm/r-icon-button_2.entry.js +489 -0
  210. package/dist/esm/r-icon.entry.js +282 -0
  211. package/dist/esm/r-illustration.entry.js +394 -0
  212. package/dist/esm/r-input-code.entry.js +435 -0
  213. package/dist/esm/r-input-date.entry.js +522 -0
  214. package/dist/esm/r-input-password.entry.js +268 -0
  215. package/dist/esm/r-input-phone-number.entry.js +2523 -0
  216. package/dist/esm/r-input.entry.js +616 -0
  217. package/dist/esm/r-list-item.entry.js +107 -0
  218. package/dist/esm/r-pagination.entry.js +318 -0
  219. package/dist/esm/r-panel.entry.js +182 -0
  220. package/dist/esm/r-popover-action.entry.js +78 -0
  221. package/dist/esm/r-popover-content.entry.js +60 -0
  222. package/dist/esm/r-popover-headline.entry.js +26 -0
  223. package/dist/esm/r-popover-trigger.entry.js +68 -0
  224. package/dist/esm/r-popover.entry.js +345 -0
  225. package/dist/esm/r-progress-bar.entry.js +23 -0
  226. package/dist/esm/r-radio-button-description.entry.js +16 -0
  227. package/dist/esm/r-radio-button-leading.entry.js +16 -0
  228. package/dist/esm/r-radio-button-title.entry.js +16 -0
  229. package/dist/esm/r-radio-button-trailing.entry.js +16 -0
  230. package/dist/esm/r-radio-button.entry.js +137 -0
  231. package/dist/esm/r-radio-group.entry.js +426 -0
  232. package/dist/esm/r-select-option.entry.js +128 -0
  233. package/dist/esm/r-select.entry.js +1105 -0
  234. package/dist/esm/r-skip-link.entry.js +17 -0
  235. package/dist/esm/r-stepper-item.entry.js +40 -0
  236. package/dist/esm/r-stepper.entry.js +97 -0
  237. package/dist/esm/r-tab-panel.entry.js +24 -0
  238. package/dist/esm/r-tab.entry.js +60 -0
  239. package/dist/esm/r-tabs-list.entry.js +173 -0
  240. package/dist/esm/r-tabs.entry.js +275 -0
  241. package/dist/esm/r-textarea.entry.js +268 -0
  242. package/dist/esm/r-toast-group.entry.js +44 -0
  243. package/dist/esm/r-toast.entry.js +312 -0
  244. package/dist/esm/style-observer-4Uv3PpKT.js +1116 -0
  245. package/dist/esm/theming-DD2IrjpG.js +106 -0
  246. package/dist/esm/web-components.js +21 -0
  247. package/dist/index.cjs.js +1 -0
  248. package/dist/index.js +1 -0
  249. package/dist/types/components/accordion/accordion.d.ts +27 -0
  250. package/dist/types/components/accordion/exports.d.ts +2 -0
  251. package/dist/types/components/accordion-panel/accordion-panel.d.ts +10 -0
  252. package/dist/types/components/accordion-section/accordion-section.d.ts +36 -0
  253. package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +33 -0
  254. package/dist/types/components/alert/alert.d.ts +67 -0
  255. package/dist/types/components/alert/exports.d.ts +4 -0
  256. package/dist/types/components/badge/badge.d.ts +26 -0
  257. package/dist/types/components/badge/exports.d.ts +2 -0
  258. package/dist/types/components/button/button.d.ts +89 -0
  259. package/dist/types/components/button/exports.d.ts +10 -0
  260. package/dist/types/components/checkbox/checkbox.d.ts +138 -0
  261. package/dist/types/components/checkbox-group/checkbox-group.d.ts +124 -0
  262. package/dist/types/components/design-system-devtools/design-system-devtools.d.ts +15 -0
  263. package/dist/types/components/dialog/dialog.d.ts +69 -0
  264. package/dist/types/components/dialog/exports.d.ts +10 -0
  265. package/dist/types/components/hint/exports.d.ts +2 -0
  266. package/dist/types/components/hint/hint.d.ts +20 -0
  267. package/dist/types/components/icon/all-kit.d.ts +2890 -0
  268. package/dist/types/components/icon/data.d.ts +145 -0
  269. package/dist/types/components/icon/exports.d.ts +152 -0
  270. package/dist/types/components/icon/icon.d.ts +37 -0
  271. package/dist/types/components/icon/riverty-kit.d.ts +139 -0
  272. package/dist/types/components/icon-button/icon-button.d.ts +69 -0
  273. package/dist/types/components/illustration/data.d.ts +52 -0
  274. package/dist/types/components/illustration/exports.d.ts +23 -0
  275. package/dist/types/components/illustration/illustration.d.ts +51 -0
  276. package/dist/types/components/illustration/illustrations-ui-kit.d.ts +21 -0
  277. package/dist/types/components/input/exports.d.ts +55 -0
  278. package/dist/types/components/input/input.d.ts +365 -0
  279. package/dist/types/components/input-code/exports.d.ts +4 -0
  280. package/dist/types/components/input-code/input-code.d.ts +177 -0
  281. package/dist/types/components/input-date/exports.d.ts +5 -0
  282. package/dist/types/components/input-date/input-date.d.ts +174 -0
  283. package/dist/types/components/input-password/exports.d.ts +1 -0
  284. package/dist/types/components/input-password/input-password.d.ts +186 -0
  285. package/dist/types/components/input-phone-number/input-phone-number.d.ts +130 -0
  286. package/dist/types/components/label/label.d.ts +9 -0
  287. package/dist/types/components/list-item/list-item/exports.d.ts +4 -0
  288. package/dist/types/components/list-item/list-item/list-item.d.ts +61 -0
  289. package/dist/types/components/pagination/exports.d.ts +6 -0
  290. package/dist/types/components/pagination/pagination.d.ts +140 -0
  291. package/dist/types/components/panel/exports.d.ts +2 -0
  292. package/dist/types/components/panel/panel.d.ts +56 -0
  293. package/dist/types/components/popover/exports.d.ts +6 -0
  294. package/dist/types/components/popover/popover.d.ts +131 -0
  295. package/dist/types/components/popover-action/popover-action.d.ts +24 -0
  296. package/dist/types/components/popover-content/popover-content.d.ts +22 -0
  297. package/dist/types/components/popover-headline/popover-headline.d.ts +6 -0
  298. package/dist/types/components/popover-trigger/exports.d.ts +2 -0
  299. package/dist/types/components/popover-trigger/popover-trigger.d.ts +31 -0
  300. package/dist/types/components/progress-bar/progress-bar.d.ts +10 -0
  301. package/dist/types/components/radio-button/radio-button.d.ts +92 -0
  302. package/dist/types/components/radio-button-description/radio-button-description.d.ts +8 -0
  303. package/dist/types/components/radio-button-leading/radio-button-leading.d.ts +8 -0
  304. package/dist/types/components/radio-button-title/radio-button-title.d.ts +8 -0
  305. package/dist/types/components/radio-button-trailing/radio-button-trailing.d.ts +8 -0
  306. package/dist/types/components/radio-group/exports.d.ts +2 -0
  307. package/dist/types/components/radio-group/radio-group.d.ts +179 -0
  308. package/dist/types/components/select/exports.d.ts +2 -0
  309. package/dist/types/components/select/select.d.ts +319 -0
  310. package/dist/types/components/select-option/select-option.d.ts +113 -0
  311. package/dist/types/components/skip-link/exports.d.ts +2 -0
  312. package/dist/types/components/skip-link/skip-link.d.ts +6 -0
  313. package/dist/types/components/stepper/stepper.d.ts +22 -0
  314. package/dist/types/components/stepper-item/stepper-item.d.ts +23 -0
  315. package/dist/types/components/tab/tab.d.ts +23 -0
  316. package/dist/types/components/tab-panel/tab-panel.d.ts +7 -0
  317. package/dist/types/components/tabs/tabs.d.ts +49 -0
  318. package/dist/types/components/tabs-list/exports.d.ts +4 -0
  319. package/dist/types/components/tabs-list/tabs-list.d.ts +41 -0
  320. package/dist/types/components/textarea/exports.d.ts +2 -0
  321. package/dist/types/components/textarea/textarea.d.ts +158 -0
  322. package/dist/types/components/toast/exports.d.ts +6 -0
  323. package/dist/types/components/toast/toast.d.ts +146 -0
  324. package/dist/types/components/toast-group/exports.d.ts +2 -0
  325. package/dist/types/components/toast-group/toast-group.d.ts +9 -0
  326. package/dist/types/components/tooltip/exports.d.ts +6 -0
  327. package/dist/types/components/tooltip/tooltip.d.ts +132 -0
  328. package/dist/types/components.d.ts +6347 -0
  329. package/dist/types/index.d.ts +1 -0
  330. package/dist/types/stencil-public-runtime.d.ts +1732 -0
  331. package/dist/types/types/jsx-shim.d.ts +13 -0
  332. package/dist/types/types/style-observer.d.ts +20 -0
  333. package/dist/types/utils/focusable.d.ts +1 -0
  334. package/dist/types/utils/formData.d.ts +1 -0
  335. package/dist/types/utils/theming.d.ts +15 -0
  336. package/dist/types/utils/version-checker.d.ts +1 -0
  337. package/dist/web-components/index.esm.js +1 -0
  338. package/dist/web-components/p-01aefcf0.entry.js +1 -0
  339. package/dist/web-components/p-05cb55db.entry.js +1 -0
  340. package/dist/web-components/p-0a34d33b.entry.js +1 -0
  341. package/dist/web-components/p-11b22309.entry.js +1 -0
  342. package/dist/web-components/p-2d878934.entry.js +1 -0
  343. package/dist/web-components/p-325dbedf.entry.js +1 -0
  344. package/dist/web-components/p-34b9457b.entry.js +1 -0
  345. package/dist/web-components/p-36abd05a.entry.js +1 -0
  346. package/dist/web-components/p-386d1ef9.entry.js +1 -0
  347. package/dist/web-components/p-3d67b77b.entry.js +1 -0
  348. package/dist/web-components/p-4Uv3PpKT.js +1 -0
  349. package/dist/web-components/p-4b12fbc0.entry.js +1 -0
  350. package/dist/web-components/p-52f7b505.entry.js +1 -0
  351. package/dist/web-components/p-55600d47.entry.js +1 -0
  352. package/dist/web-components/p-57ebc474.entry.js +1 -0
  353. package/dist/web-components/p-57edf7f4.entry.js +1 -0
  354. package/dist/web-components/p-69a24fe2.entry.js +1 -0
  355. package/dist/web-components/p-6d92648c.entry.js +1 -0
  356. package/dist/web-components/p-75052597.entry.js +1 -0
  357. package/dist/web-components/p-7b2c5b63.entry.js +1 -0
  358. package/dist/web-components/p-7bf463ff.entry.js +1 -0
  359. package/dist/web-components/p-838e43d4.entry.js +1 -0
  360. package/dist/web-components/p-8c16d038.entry.js +1 -0
  361. package/dist/web-components/p-8f8313de.entry.js +1 -0
  362. package/dist/web-components/p-9026d5a2.entry.js +1 -0
  363. package/dist/web-components/p-95396b5c.entry.js +1 -0
  364. package/dist/web-components/p-9c31c7c4.entry.js +1 -0
  365. package/dist/web-components/p-9c415b9c.entry.js +1 -0
  366. package/dist/web-components/p-9f583ed1.entry.js +1 -0
  367. package/dist/web-components/p-B9rsR6cQ.js +1 -0
  368. package/dist/web-components/p-CTxpqopm.js +2 -0
  369. package/dist/web-components/p-DQuL1Twl.js +1 -0
  370. package/dist/web-components/p-DvLT8-y3.js +1 -0
  371. package/dist/web-components/p-b303b2cc.entry.js +1 -0
  372. package/dist/web-components/p-b8df041d.entry.js +1 -0
  373. package/dist/web-components/p-bc30844f.entry.js +1 -0
  374. package/dist/web-components/p-c4a77a65.entry.js +1 -0
  375. package/dist/web-components/p-c549addf.entry.js +1 -0
  376. package/dist/web-components/p-c65df19f.entry.js +1 -0
  377. package/dist/web-components/p-c80a5541.entry.js +1 -0
  378. package/dist/web-components/p-c96ee61a.entry.js +1 -0
  379. package/dist/web-components/p-cf3f044d.entry.js +1 -0
  380. package/dist/web-components/p-d1412932.entry.js +1 -0
  381. package/dist/web-components/p-d9778cfa.entry.js +1 -0
  382. package/dist/web-components/p-dbe4ccb8.entry.js +1 -0
  383. package/dist/web-components/p-ded50850.entry.js +1 -0
  384. package/dist/web-components/p-e5be895b.entry.js +1 -0
  385. package/dist/web-components/p-e6b34c1e.entry.js +1 -0
  386. package/dist/web-components/p-ec3c4800.entry.js +1 -0
  387. package/dist/web-components/p-f670fd87.entry.js +1 -0
  388. package/dist/web-components/p-f867e4c3.entry.js +1 -0
  389. package/dist/web-components/p-ff6b1b8f.entry.js +1 -0
  390. package/dist/web-components/p-ky1yonnS.js +1 -0
  391. package/dist/web-components/web-components.esm.js +1 -0
  392. package/loader/cdn.js +1 -0
  393. package/loader/index.cjs.js +1 -0
  394. package/loader/index.d.ts +24 -0
  395. package/loader/index.es2017.js +1 -0
  396. package/loader/index.js +2 -0
  397. package/package.json +1 -1
@@ -0,0 +1,1105 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
2
+ import { a as appendControlToFormData } from './formData-DvLT8-y3.js';
3
+ import { S as StyleObserver } from './style-observer-4Uv3PpKT.js';
4
+
5
+ const selectCss = ":host{display:inline-flex;flex-direction:column;width:var(--width, auto);transition:width 0.2s ease-out;max-width:none;opacity:1;outline:none}:host slot{display:contents}:host(:hover:not([disabled]:not([disabled=false]))){--r-select--container--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([expanded]:not([expanded=false])){--r-select--options--visibility:visible;--r-select--options--z-index:1;--r-select--background-color:var(--r-background-interactive-softest, #fff);--r-select--value--border-color:var(--r-border-soft, #686868);--r-select--value--background-color:var(--r-background-interactive-softest, #fff);--r-select--trailing-icon--transform:rotate(180deg)}:host([invalid]:not([invalid=false])){--r-select--container--background-color:var(--r-status-error-soft, #fef6f6);--r-select--value--border-color:var(--r-status-error-regular, #b00c15);--r-select--options--border-color:var(--r-status-error-regular, #b00c15)}:host([disabled]:not([disabled=false])){--r-select--opacity:0.4;--r-select--pointer-events:none;--r-select--cursor:not-allowed}:host([data-is-placeholder=true]){--r-select--value-diplay--color:var(--r-text-soft, #686868)}:host([data-max-width=set]){width:100%;--r-select--options--right:0}:host([full-width]){width:100%}:host([data-listbox-position=top]){--r-select--options--top:auto;--r-select--options--bottom:2.875em;--r-select--options--border-width:1px 1px 0 1px}:host([data-listbox-position=bottom]){--r-select--options--top:100%;--r-select--options--bottom:auto;--r-select--options--border-width:0 1px 1px 1px}:host([data-readonly=true]){--r-select--color:var(--r-text-soft, #686868);--r-select--value--background-color:var(--r-background-soft, #f3f1f0);--r-select--value--border-color:transparent transparent var(--r-border-soft, #686868) transparent;--r-select--value--cursor:text;--r-select--value-arrow--visiblility:hidden}.r-select{display:var(--r-select--display, flex);flex-grow:var(--r-select--flex-grow, 1);flex-direction:var(--r-select--flex-direction, column);position:var(--r-select--position, relative);box-sizing:var(--r-select--box-sizing, border-box);max-width:var(--r-select--max-width, 100%);min-width:var(--r-select--min-width, fit-content);font-family:var(--r-select--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-select--font-weight, var(--r-font-weight-regular, 400));font-size:var(--r-select--font-size, var(--r-font-size-400, 1rem));text-align:var(--r-select--text-align, left);color:var(--r-select--color, var(--r-text-regular, #282828));opacity:var(--r-select--opacity, 1);pointer-events:var(--r-select--pointer-events, auto);cursor:var(--r-select--cursor, pointer)}.r-select--label__margin-bottom{margin-bottom:var(--r-select--label--margin-bottom, var(--r-spacing-025, 0.25rem))}.r-select--label-container{display:var(--r-select--label-container--display, flex);gap:var(--r-select--label-container--gap, var(--r-spacing-100, 1rem));align-items:var(--r-select--label-container--align-items, center);justify-content:var(--r-select--label-container--align-items, space-between)}.r-select--label-container ::slotted([slot=popover]){display:var(--r-select--popover--display, inline-flex);height:var(--r-select--popover--height, var(--r-spacing-150, 1.5));align-items:var(--r-select--popover--align-items, center);justify-content:var(--r-select--popover--justify-content, center);margin-right:var(--r-select--popover--margin-right, -0.25rem);--r-popover--trigger--min-width:var(--r-select--popover-trigger--min-width, var(--r-spacing-150, 1.5));--r-popover--trigger--min-height:var(--r-select--popover--trigger--min-height, var(--r-spacing-150, 1.5))}.r-select--trailing-icon{transform:var(--r-select--trailing-icon--transform, rotate(0deg));transition:var(--r-select--trailing-icon--transition, transform 0.15s)}.r-select ::slotted([name=leading]){display:var(--r-select--value--leading-icon--display, flex);align-items:var(--r-select--value--leading-icon--align-items, center);color:var(--r-select--value--leading-icon--color, var(--r-icon-soft, #686868))}.r-select--container{background-color:var(--r-select--container--background-color, var(--r-background-softest, #fff));opacity:var(--r-select--container--opacity, 1);pointer-events:var(--r-select--container--pointer-events, auto)}.r-select--input{height:var(--r-select--input--height, 100%);width:var(--r-select--input--width, 100%);border:var(--r-select--input--border, none);outline:var(--r-select--input--outline, none);background-color:var(--r-select--input--background-color, inherit);color:var(--r-select--input--color, inherit);font-family:var(--r-select--input--font-family, inherit);font-size:var(--r-select--input--font-size, inherit);font-weight:var(--r-select--input--font-weight, inherit);padding:var(--r-select--input--padding, 0)}.r-select--native{position:var(--r-select--native--position, fixed);top:var(--r-select--native--top, -100vh);z-index:var(--r-select--native--z-index, -1);opacity:var(--r-select--native--opacity, 0);font-size:var(--r-select--native--font-size, 1rem);padding:var(--r-select--native--padding, 0 calc(48px + 0.75em) 0 0.75em)}.r-select--value:not([aria-readonly=true]):not(:has(input:read-only)):not(:has(input:disabled)):active{--r-select--value--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}.r-select--value[aria-disabled=false]:focus,.r-select--value:has(input:focus){outline:var(--r-select--value--outline, none);--r-select--value--z-index:2;--r-select--value--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-select--value--outline:2px solid var(--r-border-focused, #0071e3);--r-select--value--outline-offset:2px}.r-select--value{position:var(--r-select--value--position, relative);display:var(--r-select--value--display, inline-grid);grid-template-columns:var(--r-select--value--grid-template-columns, 1fr 1.75rem);box-sizing:var(--r-select--value--box-sizing, border-box);align-items:var(--r-select--value--align-items, center);justify-content:var(--r-select--value--justify-content, space-between);text-align:var(--r-select--value--text-align, left);min-width:var(--r-select--value--min-width, 100%);min-height:var(--r-select--value--min-height, var(--r-spacing-275, 2.75rem));padding:var(--r-select--value--padding, 0);white-space:var(--r-select--value--white-space, nowrap);background-color:var(--r-select--value--background-color, transparent);border-width:var(--r-select--value--border-width, 1px);border-style:var(--r-select--value--border-style, solid);border-color:var(--r-select--value--border-color, var(--r-border-soft, #686868));box-shadow:var(--r-select--value--box-shadow, none);outline:var(--r-select--value--outline, none);outline-offset:var(--r-select--value--outline-offset, 0);z-index:var(--r-select--value--z-index, 0);cursor:var(--r-select--value--cursor, inherit)}.r-select--value-display{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.5em);align-items:var(--r-select--value-diplay--align-tems, center);flex:var(--r-select--value-diplay--flex, 1);padding:var(--r-select--value-diplay--padding, 0 0.75em);overflow:var(--r-select--value-diplay--overflow, hidden);text-overflow:var(--r-select--value-diplay--text-overflow, ellipsis);color:var(--r-select--value-diplay--color, inherit);min-width:var(--r-select--value-diplay--min-width, fit-content);height:var(--r-select--value-diplay--height, 100%)}.r-select--value-selected{display:var(--r-select--value-diplay--display, flex);gap:var(--r-select--value-diplay--gap, 0.75em);align-items:var(--r-select--value-diplay--align-items, center)}.r-select--value-arrow{display:var(--r-select--value-arrow--display, flex);align-items:var(--r-select--value-arrow--align-items, center);justify-content:var(--r-select--value-arrow--justify-content, center);padding:var(--r-select--value-arrow--padding, 0 0.75em 0 0);visibility:var(--r-select--value-arrow--visiblility, visible)}.r-select--value-arrow-button{height:var(--r-select--value-arrow-button--height, 100%);background-color:var(--r-select--value-arrow-button--background-color, transparent);color:var(--r-select--value-arrow-button--color, inherit);border:var(--r-select--value-arrow-button--border, none);outline:var(--r-select--value-arrow-button--outline, none);cursor:var(--r-select--value-arrow-button--cursor, inherit)}.r-select--options{visibility:var(--r-select--options--visibility, hidden);position:var(--r-select--options--position, absolute);top:var(--r-select--options--top, 100%);right:var(--r-select--options--right, 0);bottom:var(--r-select--options--bottom, auto);left:var(--r-select--options--left, 0);margin:var(--r-select--options--margin, 0);padding:var(--r-select--options--padding, 0);list-style:var(--r-select--options--list-style, none);max-height:var(--r-select--options--max-height, 14.375em);min-width:var(--r-select--options--min-width, fit-content);overflow-y:var(--r-select--options--overflow-y, auto);background-color:var(--r-select--options--background-color, var(--r-background-interactive-softest, #fff));border-style:var(--r-select--options--border-style, solid);border-color:var(--r-select--options--border-color, var(--r-border-soft, #686868));border-width:var(--r-select--options--border-width, 0 1px 1px 1px);z-index:var(--r-select--options--z-index, -1)}.r-select--message{margin-top:var(--r-select--message--margin-top, var(--r-spacing-025, 0.25rem))}.hidden{display:none}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}@media (prefers-reduced-motion){:host{transition:none}}";
6
+
7
+ const Select = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.rValidate = createEvent(this, "rValidate");
11
+ this.rChange = createEvent(this, "rChange");
12
+ this.rReset = createEvent(this, "rReset");
13
+ /** Define if select should render as a text item or a block */
14
+ this.fullWidth = false;
15
+ /** Define wether listbox appears on top or at the bottom of the select */
16
+ this.listboxPosition = 'bottom';
17
+ /**
18
+ * Defines aria label for combobox toggle button
19
+ * @default "Toggle combobox"
20
+ */
21
+ this.toggleButtonAriaLabel = 'Toggle combobox';
22
+ /**
23
+ * Defines the text that will be displayed if no results are found
24
+ * @default "No results found"
25
+ */
26
+ this.noResultsFound = 'No results found';
27
+ /** Custom validity state passed after validation */
28
+ this.validityState = '';
29
+ /** Custom validity message passed after validation */
30
+ this.validityMessage = '';
31
+ /** Is select expanded */
32
+ this.isExpanded = false;
33
+ /** Current state, reflecting if select is readonly */
34
+ this.isReadonly = false;
35
+ /** Save current value */
36
+ this.currentValue = '';
37
+ /** Value that must be displayed as selected option */
38
+ this.valueToDisplay = '';
39
+ this.isInitializing = false;
40
+ this.isResetting = false;
41
+ this.focusedOption = null;
42
+ this.isValueFocused = false;
43
+ this.isNoResultsFound = false;
44
+ /** Indicates if the user has interacted with the select (focused/clicked) */
45
+ this.touched = false;
46
+ /** Indicates if the value has been changed by user interaction */
47
+ this.dirty = false;
48
+ this.handleSlotChange = () => {
49
+ setTimeout(() => {
50
+ this.initialize();
51
+ this.defineHostWidth();
52
+ }, 0);
53
+ };
54
+ /**
55
+ * Initial attributes state
56
+ * */
57
+ this.initial = {};
58
+ /** Unique id */
59
+ this.uniqueId = `r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
60
+ this.getValidityStateData = (element) => {
61
+ let validityState = '';
62
+ let validityMessage = '';
63
+ for (const state in element.validity) {
64
+ if (element.validity[state]) {
65
+ validityState = state;
66
+ if (this[state + 'Message']) {
67
+ validityMessage = this[state + 'Message'];
68
+ return { validityState, validityMessage };
69
+ }
70
+ validityMessage = element.validationMessage;
71
+ }
72
+ }
73
+ return { validityState, validityMessage };
74
+ };
75
+ this.validateFormElement = (element = null) => {
76
+ if (element === null)
77
+ return;
78
+ if (this.isNoValidate)
79
+ return;
80
+ if (this.error)
81
+ return;
82
+ const { validityState, validityMessage } = this.getValidityStateData(element);
83
+ this.validityState = validityState;
84
+ this.validityMessage = validityMessage;
85
+ const isValid = this.validityState === 'valid';
86
+ this.valid = isValid;
87
+ this.invalid = !isValid;
88
+ this.rValidate.emit({
89
+ state: this.validityState,
90
+ message: this.validityMessage
91
+ });
92
+ };
93
+ // Typeahead buffer + last matched index
94
+ this.typeaheadBuffer = '';
95
+ this.typeaheadTimeout = null;
96
+ this.lastTypeaheadIndex = -1;
97
+ this.contributeToFormData = (event) => {
98
+ appendControlToFormData(this.nativeElement, event.formData);
99
+ };
100
+ this.onValueClick = (e) => {
101
+ var _a;
102
+ if (this.disabled)
103
+ return;
104
+ e.preventDefault();
105
+ e.stopPropagation();
106
+ // Mark as touched when user clicks on the select
107
+ this.touched = true;
108
+ this.toggle();
109
+ if (!this.isExpanded)
110
+ return;
111
+ if (this.combobox)
112
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
113
+ this.defineListboxPositionState();
114
+ };
115
+ // Returns a handler for a key
116
+ this.keyboardEventHandlerFactory = (code, altKey = false) => {
117
+ switch (code) {
118
+ case 'Enter':
119
+ return () => {
120
+ var _a;
121
+ if (this.isExpanded) {
122
+ const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
123
+ if (newValue !== this.currentValue) {
124
+ this.dirty = true;
125
+ }
126
+ this.setValueFromUserInteraction(newValue);
127
+ return;
128
+ }
129
+ this.expand();
130
+ this.setOptionFocus(this.selectedElement);
131
+ };
132
+ case 'Escape':
133
+ return () => {
134
+ this.collapse();
135
+ this.reportValidity();
136
+ };
137
+ case 'ArrowUp':
138
+ return () => {
139
+ var _a;
140
+ if (!this.isExpanded) {
141
+ this.expand();
142
+ const indexToFocus = this.combobox ? this.optionElements.length - 1 : 0;
143
+ this.setOptionFocus(this.selectedElement || this.optionElements[indexToFocus]);
144
+ return;
145
+ }
146
+ if (this.focusedOption && altKey) {
147
+ const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
148
+ if (newValue !== this.currentValue) {
149
+ this.dirty = true;
150
+ }
151
+ this.setValueFromUserInteraction(newValue);
152
+ return;
153
+ }
154
+ if (!this.combobox && this.focusedOption === this.optionElements[0])
155
+ return;
156
+ if (this.focusedOption) {
157
+ this.focusPrevOption();
158
+ return;
159
+ }
160
+ this.setOptionFocus(this.selectedElement || this.optionElements[0]);
161
+ };
162
+ case 'ArrowDown':
163
+ return () => {
164
+ if (!this.isExpanded) {
165
+ this.expand();
166
+ if (altKey)
167
+ return;
168
+ this.setOptionFocus(this.selectedElement || this.optionElements[0]);
169
+ return;
170
+ }
171
+ if (!this.combobox && this.focusedOption === this.optionElements[this.optionElements.length - 1])
172
+ return;
173
+ if (this.focusedOption) {
174
+ this.focusNextOption();
175
+ return;
176
+ }
177
+ this.setOptionFocus(this.selectedElement || this.optionElements[0]);
178
+ };
179
+ case 'Home':
180
+ return () => {
181
+ if (!this.isExpanded) {
182
+ this.expand();
183
+ this.setOptionFocus(this.selectedElement || this.optionElements[0]);
184
+ return;
185
+ }
186
+ this.setOptionFocus(this.optionElements[0]);
187
+ };
188
+ case 'End':
189
+ return () => {
190
+ if (!this.isExpanded) {
191
+ this.expand();
192
+ this.setOptionFocus(this.selectedElement || this.optionElements[this.optionElements.length - 1]);
193
+ return;
194
+ }
195
+ this.setOptionFocus(this.optionElements[this.optionElements.length - 1]);
196
+ };
197
+ case 'PageUp': {
198
+ return () => {
199
+ if (!this.isExpanded)
200
+ return;
201
+ if (this.focusedOption === null)
202
+ return;
203
+ const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
204
+ if (currentIndex === -1)
205
+ return;
206
+ const targetIndex = currentIndex - 10 >= 0 ? currentIndex - 10 : 0;
207
+ this.setOptionFocus(this.optionElements[targetIndex]);
208
+ };
209
+ }
210
+ case 'PageDown': {
211
+ return () => {
212
+ if (!this.isExpanded)
213
+ return;
214
+ if (this.focusedOption === null)
215
+ return;
216
+ const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
217
+ if (currentIndex === -1)
218
+ return;
219
+ const lastIndex = this.optionElements.length - 1;
220
+ const targetIndex = currentIndex + 10 <= lastIndex ? currentIndex + 10 : lastIndex;
221
+ this.setOptionFocus(this.optionElements[targetIndex]);
222
+ };
223
+ }
224
+ case 'Tab':
225
+ return () => {
226
+ var _a;
227
+ const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
228
+ if (newValue !== this.currentValue) {
229
+ this.dirty = true;
230
+ }
231
+ this.setValueFromUserInteraction(newValue);
232
+ };
233
+ default:
234
+ // No matching key handler: intentional no-op
235
+ return () => { };
236
+ }
237
+ };
238
+ this.onValueKeydown = (e) => {
239
+ e.stopPropagation();
240
+ const preventCodes = [
241
+ 'ArrowUp',
242
+ 'ArrowDown',
243
+ 'Home',
244
+ 'End',
245
+ 'PageUp',
246
+ 'PageDown',
247
+ 'Space',
248
+ 'Enter',
249
+ 'Escape'
250
+ ];
251
+ if (preventCodes.includes(e.code)) {
252
+ e.preventDefault();
253
+ }
254
+ else if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
255
+ // Tab will also be skipped here
256
+ if (!this.isExpanded)
257
+ this.expand();
258
+ this.handleTypeahead(e.key);
259
+ return;
260
+ }
261
+ switch (e.code) {
262
+ case 'Space':
263
+ this.keyboardEventHandlerFactory('Enter')();
264
+ break;
265
+ case 'Tab':
266
+ if (this.focusedOption === null)
267
+ break;
268
+ this.keyboardEventHandlerFactory('Tab')();
269
+ break;
270
+ default:
271
+ this.keyboardEventHandlerFactory(e.code, e.altKey)();
272
+ break;
273
+ }
274
+ };
275
+ this.onComboboxKeydown = (e) => {
276
+ e.stopPropagation();
277
+ const preventCodes = [
278
+ 'ArrowUp',
279
+ 'ArrowDown',
280
+ 'Home',
281
+ 'End',
282
+ 'PageUp',
283
+ 'PageDown',
284
+ 'Enter',
285
+ 'Escape'
286
+ ];
287
+ if (preventCodes.includes(e.code)) {
288
+ e.preventDefault();
289
+ }
290
+ switch (e.code) {
291
+ case 'Tab':
292
+ if (this.focusedOption === null) {
293
+ this.collapse();
294
+ break;
295
+ }
296
+ this.keyboardEventHandlerFactory('Tab')();
297
+ break;
298
+ case 'Escape':
299
+ if (this.isExpanded) {
300
+ this.keyboardEventHandlerFactory('Escape')();
301
+ return;
302
+ }
303
+ this.valueElement.value = '';
304
+ const newValue = '';
305
+ if (newValue !== this.currentValue) {
306
+ this.dirty = true;
307
+ }
308
+ this.setValueFromUserInteraction(newValue);
309
+ this.reportValidity();
310
+ break;
311
+ default:
312
+ this.keyboardEventHandlerFactory(e.code, e.altKey)();
313
+ break;
314
+ }
315
+ };
316
+ this.onValueBlur = () => {
317
+ this.isValueFocused = false;
318
+ const { isBusy, isExpanded } = this;
319
+ if (isBusy || isExpanded)
320
+ return;
321
+ this.reportValidity();
322
+ };
323
+ this.onValueFocus = () => {
324
+ this.isValueFocused = true;
325
+ // Mark as touched when user focuses on the select
326
+ this.touched = true;
327
+ };
328
+ this.filterOptionsListByComboboxValue = (value = '') => {
329
+ const options = Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));
330
+ options.forEach((option) => {
331
+ var _a, _b;
332
+ const optionText = (_b = (_a = option === null || option === void 0 ? void 0 : option.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.toLowerCase();
333
+ const hasMatch = optionText.search(value.toLowerCase()) !== -1;
334
+ option.setAttribute('aria-hidden', `${!hasMatch}`);
335
+ });
336
+ this.isNoResultsFound = options.every((option) => (option === null || option === void 0 ? void 0 : option.getAttribute('aria-hidden')) === 'true');
337
+ if (this.isNoResultsFound) {
338
+ this.statusElement.innerHTML = this.noResultsFound;
339
+ setTimeout(() => {
340
+ this.statusElement.innerText = '';
341
+ }, 1000);
342
+ }
343
+ };
344
+ this.clearComboboxOptions = () => {
345
+ if (!this.combobox)
346
+ return;
347
+ this.filterOptionsListByComboboxValue();
348
+ };
349
+ this.onComboboxChange = (event) => {
350
+ this.filterOptionsListByComboboxValue(event.target.value);
351
+ };
352
+ this.onComboboxInput = (event) => {
353
+ this.filterOptionsListByComboboxValue(event.target.value);
354
+ if (!this.isExpanded) {
355
+ this.expand();
356
+ this.defineListboxPositionState();
357
+ }
358
+ };
359
+ this.onSubmitForm = (event) => {
360
+ if (this.isNoValidate)
361
+ return;
362
+ this.reportValidity();
363
+ if (this.invalid) {
364
+ event.preventDefault();
365
+ event.stopPropagation();
366
+ }
367
+ };
368
+ // Clear validation results and emit rReset event
369
+ this.onResetForm = () => {
370
+ // Clear validation results
371
+ this.resetValidation();
372
+ // Reset touched and dirty states
373
+ this.markAsPristine();
374
+ // Restore initial value
375
+ this.setValue(this.initial['value']);
376
+ // Emit rReset
377
+ this.rReset.emit({
378
+ element: this.host,
379
+ value: this.currentValue
380
+ });
381
+ };
382
+ this.renderSelect = (comboboxAttrs) => {
383
+ var _a, _b;
384
+ return (h("span", Object.assign({ class: "r-select--value", role: "combobox" }, comboboxAttrs, { ref: el => this.valueElement = el, onClick: this.isInteractive ? this.onValueClick : null, onKeyDown: this.isInteractive ? this.onValueKeydown : null, onBlur: this.isInteractive ? this.onValueBlur : null, onFocus: this.isInteractive ? this.onValueFocus : null }), h("span", { class: "r-select--value-display" }, this.isLeadingSlotRendered ? h("slot", { name: "leading" }) : null, h("span", { class: "r-select--value-selected", innerHTML: ((_b = (_a = this.valueToDisplay) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) || this.placeholder || '' })), h("span", { class: "r-select--value-arrow" }, h("r-icon", { class: "r-select--trailing-icon", name: "angle-down", size: "s" }))));
385
+ };
386
+ this.renderCombobox = (comboboxAttrs) => {
387
+ var _a, _b, _c;
388
+ return (h("div", { class: "r-select--value", onClick: this.isInteractive ? this.onValueClick : null, ref: el => this.comboboxContainerElement = el }, h("div", { class: "r-select--value-display" }, this.isLeadingSlotRendered ? h("slot", { name: "leading" }) : null, h("input", Object.assign({ role: "combobox", autocomplete: "off", "aria-autocomplete": "list", disabled: this.disabled, readonly: this.readonly, type: "text" }, comboboxAttrs, { class: "r-select--input", ref: el => this.valueElement = el, onKeyDown: this.isInteractive ? this.onComboboxKeydown : null, onBlur: this.isInteractive ? this.onValueBlur : null, onFocus: this.isInteractive ? this.onValueFocus : null, onChange: this.isInteractive ? this.onComboboxChange : null, onInput: this.isInteractive ? this.onComboboxInput : null, placeholder: this.placeholder || '', value: ((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || '' }))), h("button", { "aria-label": this.toggleButtonAriaLabel, "aria-expanded": `${this.expanded || false}`, "aria-controls": `${this.uniqueId}-list`, disabled: this.disabled, tabindex: "-1", class: "r-select--value-arrow-button r-select--value-arrow" }, h("r-icon", { class: "r-select--trailing-icon", name: "angle-down", size: "s" })), h("div", { class: "visually-hidden", role: "status", ref: (el) => this.statusElement = el })));
389
+ };
390
+ }
391
+ /** Sets the component into `readonly` state */
392
+ async setReadonly() {
393
+ this.collapse();
394
+ this.resetValidation();
395
+ this.isReadonly = true;
396
+ }
397
+ /** Clears readonly state from the component */
398
+ async clearReadonly() {
399
+ this.isReadonly = false;
400
+ }
401
+ handleListboxPositionChange() {
402
+ this.defineListboxPositionState();
403
+ }
404
+ handleExpandedChange() {
405
+ this.expanded ? this.expand() : this.collapse();
406
+ }
407
+ handleReadonlyChange() {
408
+ this.readonly ? this.setReadonly() : this.clearReadonly();
409
+ }
410
+ handleValueChange(value, oldValue) {
411
+ if (this.isInitializing)
412
+ return;
413
+ // Only process if this is not the initial load (oldValue is defined)
414
+ if (oldValue !== undefined && oldValue !== value) {
415
+ // This is a programmatic change from parent attribute
416
+ // Do NOT mark as dirty, do NOT emit rChange
417
+ this._renderSelected(value, false);
418
+ this.clearComboboxOptions();
419
+ }
420
+ }
421
+ /** Listen for custom event triggered by "onClick" event on `<r-select-option>` */
422
+ optionSelectAction(e) {
423
+ e.stopPropagation();
424
+ if (this.disabled)
425
+ return;
426
+ // Mark as dirty only if value actually changes
427
+ if (e.target.value !== this.currentValue) {
428
+ this.dirty = true;
429
+ }
430
+ this.setValueFromUserInteraction(e.target.value);
431
+ }
432
+ tooltipFocusAction() {
433
+ this.collapse();
434
+ this.reportValidity();
435
+ }
436
+ onMouseup(e) {
437
+ if (!this.isExpanded)
438
+ return;
439
+ e.stopPropagation();
440
+ if (!this.host.contains(e.target)) {
441
+ this.collapse();
442
+ this.reportValidity();
443
+ }
444
+ }
445
+ onKeyup(e) {
446
+ if (!this.isExpanded)
447
+ return;
448
+ e.stopPropagation();
449
+ const path = e.composedPath ? e.composedPath() : [];
450
+ const isInsideSelect = path.includes(this.host);
451
+ if (!isInsideSelect) {
452
+ this.collapse();
453
+ this.reportValidity();
454
+ }
455
+ }
456
+ /**
457
+ * Listen on window scroll
458
+ * and update tooltip position if needed
459
+ */
460
+ handleScrolling() {
461
+ if (this.isExpanded)
462
+ this.defineListboxPositionState();
463
+ }
464
+ /**
465
+ * Listen on window resizing
466
+ * and update tooltip position if needed
467
+ */
468
+ handleResizing() {
469
+ if (this.isExpanded)
470
+ this.defineListboxPositionState();
471
+ }
472
+ /**
473
+ * Set value of the select programmatically.
474
+ * Does NOT mark as dirty or emit change events.
475
+ * Use this for programmatic value updates.
476
+ */
477
+ async setValue(value = '') {
478
+ // Clear validation results
479
+ this.resetValidation();
480
+ // Don't emit change event for programmatic updates
481
+ this._renderSelected(value, false);
482
+ this.clearComboboxOptions();
483
+ }
484
+ /**
485
+ * Internal method to set value from user interaction.
486
+ * Assumes dirty flag is already set by the caller.
487
+ * Will emit rChange if dirty flag is true.
488
+ */
489
+ setValueFromUserInteraction(value = '') {
490
+ // Clear validation results
491
+ this.resetValidation();
492
+ // Emit change event for user interactions (if dirty is set)
493
+ this._renderSelected(value, true);
494
+ this.clearComboboxOptions();
495
+ }
496
+ /** Set value of the select */
497
+ async getValue() {
498
+ return this.currentValue || '';
499
+ }
500
+ /** Reset select to its initial state */
501
+ async reset() {
502
+ // Clear validation results
503
+ this.resetValidation();
504
+ // Reset touched and dirty states
505
+ this.markAsPristine();
506
+ // Collapse options listbox
507
+ this.collapse();
508
+ // Restore unfiltered list
509
+ this.clearComboboxOptions();
510
+ // If value has not changed --> nothing to reset
511
+ if (this.currentValue === this.initial['value'])
512
+ return;
513
+ // If initial value is not an empty string
514
+ if (this.initial['value'] !== '' && this.initiallySelectedElement) {
515
+ this.isResetting = true;
516
+ this.setValue(this.initial['value']);
517
+ this.isResetting = false;
518
+ return;
519
+ }
520
+ // Clear any selected option
521
+ this.deselectOptions();
522
+ // Set value of the select to null
523
+ this.currentValue = '';
524
+ this.valueToDisplay = '';
525
+ }
526
+ /**
527
+ * Clears validation results.
528
+ */
529
+ async resetValidation() {
530
+ // Clear validity message
531
+ this.validityMessage = null;
532
+ // Clear validity state
533
+ this.validityState = null;
534
+ // Reset props to initial
535
+ this.invalid = this.initial['invalid'];
536
+ this.valid = !this.invalid;
537
+ }
538
+ /**
539
+ * Returns whether the select has been touched (focused/clicked by user).
540
+ * @returns A boolean indicating whether the select has been touched.
541
+ */
542
+ async isTouched() {
543
+ return this.touched;
544
+ }
545
+ /**
546
+ * Returns whether the select value has been changed by user interaction.
547
+ * @returns A boolean indicating whether the select is dirty.
548
+ */
549
+ async isDirty() {
550
+ return this.dirty;
551
+ }
552
+ /**
553
+ * Marks the select as untouched and pristine (not dirty).
554
+ */
555
+ async markAsPristine() {
556
+ this.touched = false;
557
+ this.dirty = false;
558
+ }
559
+ /** Validates an element, displays provided message in case value is invalid. */
560
+ async setCustomValidity(message) {
561
+ this.customErrorMessage = message;
562
+ this.validateFormElement(this.nativeElement);
563
+ }
564
+ /**
565
+ * Validates the textarea without triggering UI and returns a boolean indicating its validity.
566
+ * @returns A boolean indicating whether the textarea is valid.
567
+ */
568
+ async checkValidity() {
569
+ const { validityState } = this.getValidityStateData(this.nativeElement);
570
+ return validityState === 'valid';
571
+ }
572
+ /** Check validity and reveal validation state and message */
573
+ async reportValidity() {
574
+ this.validateFormElement(this.nativeElement);
575
+ return this.validityState === 'valid';
576
+ }
577
+ /** Set focus on the element */
578
+ async setFocus() {
579
+ var _a;
580
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
581
+ }
582
+ /** Remove focus from the element */
583
+ async setBlur() {
584
+ var _a;
585
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.blur();
586
+ }
587
+ /** Expand options listbox */
588
+ async expand() {
589
+ this.isExpanded = true;
590
+ }
591
+ /** Collapse options listbox */
592
+ async collapse() {
593
+ this.isExpanded = false;
594
+ if (this.isBusy)
595
+ return;
596
+ this.clearOptionsFocus();
597
+ this.setComboboxValueOnCollapse();
598
+ }
599
+ /**
600
+ * Retrieves the currently focused option within this select component.
601
+ *
602
+ * The focused option is identified by the presence of the `data-focused="true"`
603
+ * attribute on an `r-select-option` element inside the component's host.
604
+ *
605
+ * @returns Promise resolving to the focused `HTMLRSelectOptionElement`, or `null`
606
+ * if no option is currently marked as focused.
607
+ */
608
+ async getFocusedOption() {
609
+ return this.host.querySelector('r-select-option[data-focused="true"]') || null;
610
+ }
611
+ /**
612
+ * Sets focus to the option at the specified index.
613
+ *
614
+ * Retrieves the option element from the internal optionElements collection
615
+ * and delegates focusing logic to `setOptionFocus`.
616
+ *
617
+ * @param index - Zero-based index of the option to focus. If the index is out of bounds
618
+ * or the corresponding option element is unavailable, the method will no-op.
619
+ *
620
+ * @returns A promise that resolves with the result of `setOptionFocus`, typically indicating
621
+ * success or failure of applying focus (implementation dependent).
622
+ */
623
+ async setFocusedOption(index) {
624
+ return this.setOptionFocus(this.optionElements[index]);
625
+ }
626
+ clearOptionsFocus() {
627
+ var _a;
628
+ this.focusedOption = null;
629
+ try {
630
+ this.valueElement.ariaActiveDescendantElement = null;
631
+ }
632
+ catch (_b) {
633
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.removeAttribute('aria-activedescendant');
634
+ }
635
+ this.focusedOptions.forEach(option => option.setBlur());
636
+ }
637
+ setComboboxValueOnCollapse() {
638
+ var _a, _b, _c;
639
+ if (!this.combobox)
640
+ return;
641
+ this.valueElement.value = ((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || '';
642
+ this.clearComboboxOptions();
643
+ }
644
+ get focusedOptions() {
645
+ return Array.from(this.host.querySelectorAll('r-select-option[data-focused="true"]'));
646
+ }
647
+ toggle() {
648
+ this.isExpanded = !this.isExpanded;
649
+ }
650
+ get selectedElement() {
651
+ return this.host.querySelector(`r-select-option[value="${this.currentValue}"]`);
652
+ }
653
+ get initiallySelectedElement() {
654
+ return this.host.querySelector(`r-select-option[value="${this.initial['value']}"]`) || null;
655
+ }
656
+ /** Identify wrapping form element */
657
+ get parentFormEl() {
658
+ return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
659
+ }
660
+ /**
661
+ * Determine whether this element should be ignored
662
+ * during Constraint Validation API validation.
663
+ * */
664
+ get isNoValidate() {
665
+ var _a;
666
+ return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
667
+ this.novalidate ||
668
+ false);
669
+ }
670
+ get optionElements() {
671
+ return this.host.querySelectorAll('r-select-option:not([disabled]:not([disabled="false"])):not([aria-hidden="true"])') || null;
672
+ }
673
+ get optionElementsArray() {
674
+ return Array.from(this.optionElements);
675
+ }
676
+ deselectOptions() {
677
+ if (!this.optionElements)
678
+ return;
679
+ this.optionElements.forEach(option => option.clearSelected());
680
+ }
681
+ get isBusy() {
682
+ return this.isInitializing || this.isResetting;
683
+ }
684
+ _renderSelected(value = '', emitValue = true) {
685
+ var _a, _b;
686
+ // Update value of `<r-select>`
687
+ this.currentValue = value;
688
+ if (this.currentValue === null)
689
+ this.host.removeAttribute('value');
690
+ else
691
+ this.host.setAttribute('value', this.currentValue);
692
+ const elementToSelect = this.host.querySelector(`r-select-option[value="${(_a = this.currentValue) === null || _a === void 0 ? void 0 : _a.trim()}"]`);
693
+ this.valueToDisplay = (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.innerHTML) || (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.textContent) || this.currentValue || '';
694
+ // Switch `selected` value for each option
695
+ (_b = this.optionElements) === null || _b === void 0 ? void 0 : _b.forEach(option => {
696
+ option.value === value ? option.setSelected() : option.clearSelected();
697
+ });
698
+ this._renderNativeOption();
699
+ if (this.isExpanded)
700
+ this.collapse();
701
+ if (!this.isBusy) {
702
+ this.reportValidity();
703
+ }
704
+ // Only emit rChange if:
705
+ // 1. emitValue is true
706
+ // 2. Not during initialization or reset
707
+ // 3. The component is dirty (user has interacted)
708
+ if (emitValue && !this.isBusy && this.dirty) {
709
+ this.rChange.emit({
710
+ element: this.host,
711
+ value: value
712
+ });
713
+ }
714
+ }
715
+ setOptionFocus(element = this.selectedElement) {
716
+ if (!element)
717
+ return;
718
+ if (this.optionElements === null)
719
+ return;
720
+ // Helper: fallback to scrollIntoView
721
+ const _scrollIntoViewFallback = (element, container) => {
722
+ const top = element.offsetTop;
723
+ const bottom = top + element.offsetHeight;
724
+ const viewTop = container.scrollTop;
725
+ const viewBottom = viewTop + container.clientHeight;
726
+ if (top < viewTop) {
727
+ container.scrollTop = top;
728
+ }
729
+ else if (bottom > viewBottom) {
730
+ container.scrollTop = bottom - container.clientHeight;
731
+ }
732
+ };
733
+ // Helper: defines if scrollIntoView can be used or calls optional fallback
734
+ const _scrollIntoView = (element, container) => {
735
+ var _a, _b;
736
+ if (!container)
737
+ return;
738
+ // Try native scrollIntoView first (some browsers optimize this)
739
+ try {
740
+ (_a = element.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(element, {
741
+ block: 'nearest',
742
+ inline: 'nearest'
743
+ });
744
+ }
745
+ catch (_c) {
746
+ // Older Safari without options signature
747
+ (_b = element.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(element, false);
748
+ }
749
+ // Manual correction if still out of view
750
+ const optRect = element.getBoundingClientRect();
751
+ const contRect = container.getBoundingClientRect();
752
+ const outside = optRect.top < contRect.top || optRect.bottom > contRect.bottom;
753
+ if (outside) {
754
+ _scrollIntoViewFallback(element, container);
755
+ }
756
+ };
757
+ requestAnimationFrame(() => {
758
+ var _a;
759
+ this.clearOptionsFocus();
760
+ element.setFocus();
761
+ this.focusedOption = element;
762
+ try {
763
+ this.valueElement.ariaActiveDescendantElement = element;
764
+ }
765
+ catch (_b) {
766
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', element.id);
767
+ }
768
+ _scrollIntoView(element, this.listboxElement);
769
+ });
770
+ }
771
+ focusPrevOption(currentElement = this.focusedOption || this.selectedElement) {
772
+ if (this.optionElements === null)
773
+ return;
774
+ const currentIndex = this.optionElementsArray.indexOf(currentElement);
775
+ const prevIndex = currentIndex - 1;
776
+ const isPrevIndex = prevIndex >= 0;
777
+ const prevElement = isPrevIndex ? this.optionElements[prevIndex] : this.optionElements[this.optionElements.length - 1];
778
+ this.setOptionFocus(prevElement);
779
+ }
780
+ focusNextOption(currentElement = this.focusedOption || this.selectedElement) {
781
+ if (this.optionElements === null)
782
+ return;
783
+ const currentIndex = this.optionElementsArray.indexOf(currentElement);
784
+ const nextIndex = currentIndex + 1;
785
+ const lastIndex = this.optionElements.length - 1;
786
+ const isNextIndex = nextIndex <= lastIndex;
787
+ const nextElement = isNextIndex ? this.optionElements[nextIndex] : this.optionElements[0];
788
+ this.setOptionFocus(nextElement);
789
+ }
790
+ /**
791
+ * Return option elements whose label starts with the filter text (case-insensitive).
792
+ */
793
+ filterOptions(options, filter) {
794
+ if (!filter)
795
+ return [];
796
+ const f = filter.toLowerCase();
797
+ return options.filter(o => !o.disabled &&
798
+ (o.textContent || '').trim().toLowerCase().startsWith(f));
799
+ }
800
+ /**
801
+ * Return the index (within the provided array) of an option matching the filter.
802
+ * If the filter is multiple iterations of the same letter (e.g. 'aaa'), cycle through
803
+ * first-letter matches starting from startIndex.
804
+ * Returns -1 if no match.
805
+ */
806
+ getIndexByLetter(options, filter, startIndex = 0) {
807
+ if (!options.length || !filter)
808
+ return -1;
809
+ const ordered = [...options.slice(startIndex), ...options.slice(0, startIndex)];
810
+ const matchesFull = this
811
+ .filterOptions(ordered, filter)
812
+ .sort((a, b) => ((a.textContent || '').trim().toLowerCase())
813
+ .localeCompare((b.textContent || '').trim().toLowerCase()));
814
+ const allSame = filter.split('').every(c => c === filter[0]);
815
+ if (matchesFull[0]) {
816
+ return options.indexOf(matchesFull[0]);
817
+ }
818
+ else if (allSame) {
819
+ const firstLetterMatches = this.filterOptions(ordered, filter[0]);
820
+ if (firstLetterMatches[0]) {
821
+ return options.indexOf(firstLetterMatches[0]);
822
+ }
823
+ return -1;
824
+ }
825
+ return -1;
826
+ }
827
+ handleTypeahead(char) {
828
+ const RESET_MS = 500;
829
+ clearTimeout(this.typeaheadTimeout);
830
+ const options = this.optionElementsArray;
831
+ // Append character
832
+ this.typeaheadBuffer += char.toLowerCase();
833
+ const allSame = this.typeaheadBuffer.split('').every(c => c === this.typeaheadBuffer[0]);
834
+ // Starting point for search:
835
+ let startIndex;
836
+ if (allSame && this.lastTypeaheadIndex !== -1) {
837
+ // Cycle through same-letter matches
838
+ startIndex = (this.lastTypeaheadIndex + 1) % options.length;
839
+ }
840
+ else {
841
+ const focusBase = (this.focusedOption || this.selectedElement);
842
+ const baseIndex = options.indexOf(focusBase);
843
+ startIndex = baseIndex === -1 ? 0 : (baseIndex + 1) % options.length;
844
+ }
845
+ const idx = this.getIndexByLetter(options, this.typeaheadBuffer, startIndex);
846
+ if (idx !== -1) {
847
+ this.lastTypeaheadIndex = idx;
848
+ const el = options[idx];
849
+ if (!this.isExpanded)
850
+ this.expand();
851
+ this.setOptionFocus(el);
852
+ }
853
+ // Reset buffer after inactivity
854
+ this.typeaheadTimeout = setTimeout(() => {
855
+ this.typeaheadBuffer = '';
856
+ }, RESET_MS);
857
+ }
858
+ connectFormEventListeners() {
859
+ if (!this.parentFormEl)
860
+ return;
861
+ this.parentFormEl.addEventListener('formdata', this.contributeToFormData);
862
+ this.parentFormEl.addEventListener('submit', this.onSubmitForm, { capture: true });
863
+ this.parentFormEl.addEventListener('reset', this.onResetForm);
864
+ }
865
+ disconnectFormEventListeners() {
866
+ if (!this.parentFormEl)
867
+ return;
868
+ this.parentFormEl.removeEventListener('formdata', this.contributeToFormData);
869
+ this.parentFormEl.removeEventListener('submit', this.onSubmitForm);
870
+ this.parentFormEl.removeEventListener('reset', this.onResetForm);
871
+ }
872
+ defineHostWidth() {
873
+ if (this.fullWidth)
874
+ return;
875
+ const nativeWidth = this.host.shadowRoot.querySelector('.r-select--native').getBoundingClientRect().width;
876
+ const valueWidth = (this.combobox ? this.comboboxContainerElement : this.valueElement).getBoundingClientRect().width;
877
+ const listWidth = this.listboxElement.getBoundingClientRect().width;
878
+ const structuralWidth = Math.max(nativeWidth, valueWidth, listWidth);
879
+ this.host.style.setProperty('--width', `${structuralWidth}px`);
880
+ }
881
+ _renderNativeOption() {
882
+ var _a, _b, _c, _d, _e;
883
+ const optionElement = document.createElement("option");
884
+ const optionText = document.createTextNode((_c = (_b = (_a = this.selectedElement) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b));
885
+ optionElement.value = this.currentValue;
886
+ optionElement.selected = true;
887
+ optionElement.appendChild(optionText);
888
+ if (!this.nativeElement)
889
+ return;
890
+ this.nativeElement.innerHTML = '';
891
+ (_d = this.nativeElement) === null || _d === void 0 ? void 0 : _d.appendChild(optionElement);
892
+ this.nativeElement.value = this.currentValue;
893
+ (_e = this.nativeElement) === null || _e === void 0 ? void 0 : _e.setAttribute('value', this.currentValue);
894
+ }
895
+ notVisible(element) {
896
+ return getComputedStyle(element).overflow !== "visible";
897
+ }
898
+ /**
899
+ * Finds first element's parent with not visible overflow.
900
+ * @param element -- parent element
901
+ * @param initEl -- initial(child) element
902
+ */
903
+ findOverflowParent(element) {
904
+ var _a, _b;
905
+ if (((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.DOCUMENT_FRAGMENT_NODE) {
906
+ return this.findOverflowParent((_b = element.parentNode) === null || _b === void 0 ? void 0 : _b.host);
907
+ }
908
+ if (this.notVisible(element)) {
909
+ return element;
910
+ }
911
+ if (element.parentElement) {
912
+ return this.findOverflowParent(element.parentElement);
913
+ }
914
+ return null;
915
+ }
916
+ get ariaDescribedBy() {
917
+ const describedBy = `${this.uniqueId}-message`;
918
+ return this.hint ? `${this.uniqueId}-hint ${describedBy}` : describedBy;
919
+ }
920
+ /**
921
+ * Parent with non visible overflow
922
+ */
923
+ get overflowedParent() {
924
+ return this.findOverflowParent(this.host.parentElement);
925
+ }
926
+ /**
927
+ * Available space at the top
928
+ */
929
+ get top() {
930
+ var _a, _b;
931
+ return (!this.overflowedParent ?
932
+ (_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top :
933
+ Math.abs(this.overflowedParent.getBoundingClientRect().top - ((_b = this.valueElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().top)));
934
+ }
935
+ /**
936
+ * Available space at the bottom
937
+ */
938
+ get bottom() {
939
+ var _a;
940
+ function calculateBottomSpace(element) {
941
+ return window.innerHeight - element.getBoundingClientRect().top - element.getBoundingClientRect().height;
942
+ }
943
+ const styles = window.getComputedStyle(this.messageContainer);
944
+ const messageContainerHeight = ((_a = this.messageContainer) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) + parseFloat(styles['marginTop']);
945
+ const calculatedHostBottomSpace = calculateBottomSpace(this.host) + messageContainerHeight;
946
+ return !this.overflowedParent ? calculatedHostBottomSpace + messageContainerHeight : Math.abs(calculateBottomSpace(this.overflowedParent) - calculatedHostBottomSpace);
947
+ }
948
+ /**
949
+ * Set correct tooltip position.
950
+ * First it checks the available space for a defined position and then sets the new one based on the available space.
951
+ */
952
+ defineListboxPositionState() {
953
+ var _a, _b;
954
+ const isBottomSpace = ((_a = this.listboxElement) === null || _a === void 0 ? void 0 : _a.offsetHeight) < this.bottom;
955
+ const isTopSpace = ((_b = this.listboxElement) === null || _b === void 0 ? void 0 : _b.offsetHeight) < this.top;
956
+ const isTop = this.listboxPosition === 'top';
957
+ const isBottom = this.listboxPosition === 'bottom';
958
+ /** Don't change the position if there is sufficient space for the listbox
959
+ * or insufficient space for another position.
960
+ * */
961
+ if ((isTop && (isTopSpace || !isBottomSpace)) || (isBottom && (isBottomSpace || !isTopSpace))) {
962
+ this.listboxPositionState = this.listboxPosition;
963
+ return;
964
+ }
965
+ switch (this.listboxPosition) {
966
+ case 'top':
967
+ this.listboxPositionState = !isTopSpace ? 'bottom' : 'top';
968
+ break;
969
+ case 'bottom':
970
+ this.listboxPositionState = !isBottomSpace ? 'top' : 'bottom';
971
+ break;
972
+ }
973
+ }
974
+ initialize() {
975
+ var _a;
976
+ const currentValue = this.value || '';
977
+ this.initial['value'] = this.value || '';
978
+ this.initial['invalid'] = this.invalid || false;
979
+ this.listboxPositionState = this.listboxPosition;
980
+ // Search for the option to select
981
+ const elementToSelect = this.optionElementsArray.find((el) => el.value.trim() === currentValue);
982
+ // Select the matching element if found
983
+ if (elementToSelect) {
984
+ this.isInitializing = true;
985
+ this.setValue(currentValue);
986
+ this.isInitializing = false;
987
+ return;
988
+ }
989
+ if (this.placeholder)
990
+ return;
991
+ if (this.combobox)
992
+ return;
993
+ const firstOption = (_a = this.optionElements) === null || _a === void 0 ? void 0 : _a[0];
994
+ if (firstOption) {
995
+ this.isInitializing = true;
996
+ this.setValue(firstOption === null || firstOption === void 0 ? void 0 : firstOption.value);
997
+ this.isInitializing = false;
998
+ }
999
+ }
1000
+ initializeStyleObserver() {
1001
+ if (this.listboxWidthObserver || !this.listboxElement)
1002
+ return;
1003
+ const observerCallback = () => {
1004
+ if (!this.listboxElement)
1005
+ return;
1006
+ // Only recompute if listbox grew beyond current host width
1007
+ const listboxWidth = this.listboxElement.getBoundingClientRect().width;
1008
+ const hostWidth = this.host.getBoundingClientRect().width;
1009
+ if (listboxWidth <= hostWidth)
1010
+ return;
1011
+ this.defineHostWidth();
1012
+ };
1013
+ this.listboxWidthObserver = new StyleObserver(observerCallback);
1014
+ this.listboxWidthObserver
1015
+ .observe([this.listboxElement], ['width']);
1016
+ }
1017
+ get hasError() {
1018
+ var _a;
1019
+ return this.invalid && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
1020
+ }
1021
+ get hasValidationError() {
1022
+ if (!this.validityState)
1023
+ return false;
1024
+ return this.validityState !== 'valid' && !!(this.validityMessage || this.customErrorMessage);
1025
+ }
1026
+ get hasMessage() {
1027
+ return this.hasError || this.hasValidationError;
1028
+ }
1029
+ get isInteractive() {
1030
+ return !this.disabled && !this.isReadonly;
1031
+ }
1032
+ get hasLeadingSlot() {
1033
+ return !!this.host.querySelector('[slot="leading"]');
1034
+ }
1035
+ get hasOptionIcon() {
1036
+ return !!this.optionElementsArray.find(el => !!el.querySelector('[slot="icon"]'));
1037
+ }
1038
+ get isLeadingSlotRendered() {
1039
+ return this.hasLeadingSlot && this.hasOptionIcon && !this.currentValue;
1040
+ }
1041
+ get isPlaceholder() {
1042
+ var _a, _b;
1043
+ const { placeholder } = this;
1044
+ return (((_b = (_a = this.valueToDisplay) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) || placeholder || '') === placeholder;
1045
+ }
1046
+ connectedCallback() {
1047
+ this.connectFormEventListeners();
1048
+ }
1049
+ disconnectedCallback() {
1050
+ this.disconnectFormEventListeners();
1051
+ }
1052
+ componentWillLoad() {
1053
+ this.isExpanded = this.expanded;
1054
+ this.isReadonly = this.readonly;
1055
+ }
1056
+ componentDidLoad() {
1057
+ this.defineListboxPositionState();
1058
+ this.initializeStyleObserver();
1059
+ }
1060
+ render() {
1061
+ var _a;
1062
+ const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal } = this;
1063
+ const labelAttr = label ? {
1064
+ fieldIndicator
1065
+ } : {};
1066
+ const isRequired = this.isInteractive ? !!required : false;
1067
+ const comboboxAttrs = {
1068
+ id: `${uniqueId}-value`,
1069
+ tabindex: `${disabled ? -1 : 0}`,
1070
+ 'aria-controls': `${uniqueId}-list`,
1071
+ 'aria-describedby': this.ariaDescribedBy,
1072
+ 'aria-disabled': `${disabled || false}`,
1073
+ 'aria-expanded': `${isExpanded || false}`,
1074
+ 'aria-invalid': `${invalid || false}`,
1075
+ 'aria-readonly': `${!this.isInteractive || false}`,
1076
+ 'aria-required': `${isRequired}`,
1077
+ 'aria-labelledby': `${uniqueId}-label`
1078
+ };
1079
+ const listboxAttrs = {
1080
+ 'aria-label': label
1081
+ };
1082
+ const nativeAttrs = {
1083
+ placeholder,
1084
+ name: this.name,
1085
+ value: this.currentValue,
1086
+ 'aria-hidden': 'true',
1087
+ tabindex: '-1',
1088
+ invalid,
1089
+ disabled,
1090
+ required: isRequired
1091
+ };
1092
+ return (h(Host, { key: '760b35180f5c0e716387bf92b886aef11d33a433', "data-value": this.currentValue, expanded: !this.disabled && this.isExpanded, "data-listbox-position": this.listboxPositionState, "data-initial-value": this.initial['value'], "data-is-placeholder": `${!!this.isPlaceholder}`, "data-value-focused": `${!!this.isValueFocused}`, "data-option-focused": `${!!this.focusedOption}`, "data-validity-state": `${this.validityState || ''}`, "data-validity-message": `${this.validityMessage || ''}`, "data-readonly": `${!!this.isReadonly}`, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, h("div", { key: 'ba9308fb7a9d91d0464a723ac00916832ceaef9d', class: `r-select--label ${!internal ? 'r-select--label__margin-bottom' : ''}` }, h("div", { key: '6de28553dd9a44fd3f0d8b73fffdbaabc2d724d1', class: internal ? 'visually-hidden' : 'r-select--label-container' }, h("label", { key: 'f4eb1fbe89376b3f3d886d0acfb33616a0df9e61', id: `${uniqueId}-label`, onClick: this.isInteractive ? this.onValueClick : null }, h("r-label", Object.assign({ key: 'fa2829ffca13fe5640e75650646aa0dafe44d31c' }, labelAttr), label)), h("slot", { key: '27dca50b5e65eedd73c40992734134f1e52b15d3', name: "popover" })), hint &&
1093
+ h("r-hint", { key: '32ebd3a250e9917f51788347f8683095b701e694', id: `${uniqueId}-hint`, class: "r-select--hint" }, hint)), h("div", { key: '2e195fab570c59cd8e5c038ad2c395c08bc10592', class: "r-select" }, h("select", Object.assign({ key: '3ef7ca05510c50c2453f6c30e1faf3558c602a9c', class: "r-select--native", ref: el => this.nativeElement = el }, nativeAttrs)), h("div", { key: 'bf431b52523f3a810c60db6c20bae82f0bd12dc4', class: "r-select--container" }, this.combobox ? this.renderCombobox(comboboxAttrs) : this.renderSelect(comboboxAttrs), h("div", Object.assign({ key: 'e716d8ea4f124373a1f56f80e4c7f6b2399c6b09', role: "listbox", tabindex: "-1", id: `${uniqueId}-list`, class: "r-select--options", ref: el => this.listboxElement = el }, listboxAttrs), (this.isNoResultsFound || !((_a = this.optionElements) === null || _a === void 0 ? void 0 : _a.length)) && h("r-select-option", { key: '61e5bbcdff156c61f4f46c8fc2f8dddc30fe345a', "data-no-results": "true", value: "no_results" }, this.noResultsFound), h("slot", { key: '8b0949058681d8274aaac39d184a0e59ae91fec8', onSlotchange: this.handleSlotChange })))), h("div", { key: 'd007a8402ecea45df2d24b0169a30856a12c45a0', id: `${uniqueId}-message`, "aria-live": "polite", "aria-atomic": "true", ref: (el) => this.messageContainer = el, class: this.hasMessage && !internal ? 'r-select--message' : 'visually-hidden' }, this.hasMessage && h("r-hint", { key: '83ebfc3c344452d15213087284035853b54b1b3d', variant: this.invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage)))));
1094
+ }
1095
+ get host() { return getElement(this); }
1096
+ static get watchers() { return {
1097
+ "listboxPosition": ["handleListboxPositionChange"],
1098
+ "expanded": ["handleExpandedChange"],
1099
+ "readonly": ["handleReadonlyChange"],
1100
+ "value": ["handleValueChange"]
1101
+ }; }
1102
+ };
1103
+ Select.style = selectCss;
1104
+
1105
+ export { Select as r_select };