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