@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.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/focusable-Oll_rmtP.js +28 -0
- package/dist/cjs/formData-B2DZyLxP.js +44 -0
- package/dist/cjs/index-BnETQtSf.js +1834 -0
- package/dist/cjs/index.cjs.js +37 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/r-accordion-panel.cjs.entry.js +24 -0
- package/dist/cjs/r-accordion-section.cjs.entry.js +125 -0
- package/dist/cjs/r-accordion-trigger.cjs.entry.js +93 -0
- package/dist/cjs/r-accordion.cjs.entry.js +20 -0
- package/dist/cjs/r-alert.cjs.entry.js +146 -0
- package/dist/cjs/r-badge.cjs.entry.js +41 -0
- package/dist/cjs/r-button.cjs.entry.js +149 -0
- package/dist/cjs/r-checkbox-group.cjs.entry.js +237 -0
- package/dist/cjs/r-checkbox.cjs.entry.js +274 -0
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +31 -0
- package/dist/cjs/r-dialog.cjs.entry.js +107 -0
- package/dist/cjs/r-hint_2.cjs.entry.js +50 -0
- package/dist/cjs/r-icon-button_2.cjs.entry.js +492 -0
- package/dist/cjs/r-icon.cjs.entry.js +284 -0
- package/dist/cjs/r-illustration.cjs.entry.js +396 -0
- package/dist/cjs/r-input-code.cjs.entry.js +437 -0
- package/dist/cjs/r-input-date.cjs.entry.js +524 -0
- package/dist/cjs/r-input-password.cjs.entry.js +270 -0
- package/dist/cjs/r-input-phone-number.cjs.entry.js +2525 -0
- package/dist/cjs/r-input.cjs.entry.js +618 -0
- package/dist/cjs/r-list-item.cjs.entry.js +109 -0
- package/dist/cjs/r-pagination.cjs.entry.js +320 -0
- package/dist/cjs/r-panel.cjs.entry.js +184 -0
- package/dist/cjs/r-popover-action.cjs.entry.js +80 -0
- package/dist/cjs/r-popover-content.cjs.entry.js +62 -0
- package/dist/cjs/r-popover-headline.cjs.entry.js +28 -0
- package/dist/cjs/r-popover-trigger.cjs.entry.js +70 -0
- package/dist/cjs/r-popover.cjs.entry.js +347 -0
- package/dist/cjs/r-progress-bar.cjs.entry.js +25 -0
- package/dist/cjs/r-radio-button-description.cjs.entry.js +18 -0
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +18 -0
- package/dist/cjs/r-radio-button-title.cjs.entry.js +18 -0
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +18 -0
- package/dist/cjs/r-radio-button.cjs.entry.js +139 -0
- package/dist/cjs/r-radio-group.cjs.entry.js +428 -0
- package/dist/cjs/r-select-option.cjs.entry.js +130 -0
- package/dist/cjs/r-select.cjs.entry.js +1107 -0
- package/dist/cjs/r-skip-link.cjs.entry.js +19 -0
- package/dist/cjs/r-stepper-item.cjs.entry.js +42 -0
- package/dist/cjs/r-stepper.cjs.entry.js +99 -0
- package/dist/cjs/r-tab-panel.cjs.entry.js +26 -0
- package/dist/cjs/r-tab.cjs.entry.js +62 -0
- package/dist/cjs/r-tabs-list.cjs.entry.js +175 -0
- package/dist/cjs/r-tabs.cjs.entry.js +277 -0
- package/dist/cjs/r-textarea.cjs.entry.js +270 -0
- package/dist/cjs/r-toast-group.cjs.entry.js +46 -0
- package/dist/cjs/r-toast.cjs.entry.js +314 -0
- package/dist/cjs/style-observer-D9zSP9wP.js +1118 -0
- package/dist/cjs/theming-NqxjhVJS.js +109 -0
- package/dist/cjs/web-components.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +60 -0
- package/dist/collection/components/accordion/accordion.css +24 -0
- package/dist/collection/components/accordion/accordion.js +90 -0
- package/dist/collection/components/accordion/exports.js +1 -0
- package/dist/collection/components/accordion-panel/accordion-panel.css +50 -0
- package/dist/collection/components/accordion-panel/accordion-panel.js +86 -0
- package/dist/collection/components/accordion-section/accordion-section.css +27 -0
- package/dist/collection/components/accordion-section/accordion-section.js +235 -0
- package/dist/collection/components/accordion-trigger/accordion-trigger.css +93 -0
- package/dist/collection/components/accordion-trigger/accordion-trigger.js +220 -0
- package/dist/collection/components/alert/alert.css +120 -0
- package/dist/collection/components/alert/alert.js +526 -0
- package/dist/collection/components/alert/exports.js +2 -0
- package/dist/collection/components/badge/badge.css +62 -0
- package/dist/collection/components/badge/badge.js +124 -0
- package/dist/collection/components/badge/exports.js +1 -0
- package/dist/collection/components/button/button.css +180 -0
- package/dist/collection/components/button/button.js +510 -0
- package/dist/collection/components/button/exports.js +5 -0
- package/dist/collection/components/checkbox/checkbox.css +116 -0
- package/dist/collection/components/checkbox/checkbox.js +803 -0
- package/dist/collection/components/checkbox-group/checkbox-group.css +48 -0
- package/dist/collection/components/checkbox-group/checkbox-group.js +744 -0
- package/dist/collection/components/design-system-devtools/design-system-devtools.js +59 -0
- package/dist/collection/components/dialog/dialog.css +125 -0
- package/dist/collection/components/dialog/dialog.js +345 -0
- package/dist/collection/components/dialog/exports.js +9 -0
- package/dist/collection/components/hint/exports.js +1 -0
- package/dist/collection/components/hint/hint.css +63 -0
- package/dist/collection/components/hint/hint.js +114 -0
- package/dist/collection/components/icon/all-kit.js +2 -0
- package/dist/collection/components/icon/data.js +90 -0
- package/dist/collection/components/icon/exports.js +7 -0
- package/dist/collection/components/icon/icon.css +105 -0
- package/dist/collection/components/icon/icon.js +379 -0
- package/dist/collection/components/icon/riverty-kit.js +2 -0
- package/dist/collection/components/icon-button/icon-button.css +105 -0
- package/dist/collection/components/icon-button/icon-button.js +343 -0
- package/dist/collection/components/illustration/data.js +112 -0
- package/dist/collection/components/illustration/exports.js +3 -0
- package/dist/collection/components/illustration/illustration.css +52 -0
- package/dist/collection/components/illustration/illustration.js +540 -0
- package/dist/collection/components/illustration/illustrations-ui-kit.js +2 -0
- package/dist/collection/components/input/exports.js +62 -0
- package/dist/collection/components/input/input.css +186 -0
- package/dist/collection/components/input/input.js +1861 -0
- package/dist/collection/components/input-code/exports.js +2 -0
- package/dist/collection/components/input-code/input-code.css +127 -0
- package/dist/collection/components/input-code/input-code.js +1165 -0
- package/dist/collection/components/input-date/exports.js +1 -0
- package/dist/collection/components/input-date/input-date.css +148 -0
- package/dist/collection/components/input-date/input-date.js +1254 -0
- package/dist/collection/components/input-password/exports.js +1 -0
- package/dist/collection/components/input-password/input-password.css +25 -0
- package/dist/collection/components/input-password/input-password.js +1077 -0
- package/dist/collection/components/input-phone-number/input-phone-number.css +61 -0
- package/dist/collection/components/input-phone-number/input-phone-number.js +893 -0
- package/dist/collection/components/label/label.css +38 -0
- package/dist/collection/components/label/label.js +47 -0
- package/dist/collection/components/list-item/list-item/exports.js +2 -0
- package/dist/collection/components/list-item/list-item/list-item.css +199 -0
- package/dist/collection/components/list-item/list-item/list-item.js +467 -0
- package/dist/collection/components/pagination/exports.js +3 -0
- package/dist/collection/components/pagination/pagination.css +118 -0
- package/dist/collection/components/pagination/pagination.js +814 -0
- package/dist/collection/components/panel/exports.js +1 -0
- package/dist/collection/components/panel/panel.css +192 -0
- package/dist/collection/components/panel/panel.js +473 -0
- package/dist/collection/components/popover/exports.js +3 -0
- package/dist/collection/components/popover/popover.css +251 -0
- package/dist/collection/components/popover/popover.js +741 -0
- package/dist/collection/components/popover-action/popover-action.css +21 -0
- package/dist/collection/components/popover-action/popover-action.js +150 -0
- package/dist/collection/components/popover-content/popover-content.css +9 -0
- package/dist/collection/components/popover-content/popover-content.js +130 -0
- package/dist/collection/components/popover-headline/popover-headline.css +7 -0
- package/dist/collection/components/popover-headline/popover-headline.js +28 -0
- package/dist/collection/components/popover-trigger/exports.js +1 -0
- package/dist/collection/components/popover-trigger/popover-trigger.css +4 -0
- package/dist/collection/components/popover-trigger/popover-trigger.js +163 -0
- package/dist/collection/components/progress-bar/progress-bar.css +41 -0
- package/dist/collection/components/progress-bar/progress-bar.js +71 -0
- package/dist/collection/components/radio-button/radio-button.css +126 -0
- package/dist/collection/components/radio-button/radio-button.js +559 -0
- package/dist/collection/components/radio-button-description/radio-button-description.css +5 -0
- package/dist/collection/components/radio-button-description/radio-button-description.js +22 -0
- package/dist/collection/components/radio-button-leading/radio-button-leading.css +3 -0
- package/dist/collection/components/radio-button-leading/radio-button-leading.js +22 -0
- package/dist/collection/components/radio-button-title/radio-button-title.css +8 -0
- package/dist/collection/components/radio-button-title/radio-button-title.js +22 -0
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.css +6 -0
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +22 -0
- package/dist/collection/components/radio-group/exports.js +1 -0
- package/dist/collection/components/radio-group/radio-group.css +65 -0
- package/dist/collection/components/radio-group/radio-group.js +1023 -0
- package/dist/collection/components/select/exports.js +1 -0
- package/dist/collection/components/select/select.css +247 -0
- package/dist/collection/components/select/select.js +2038 -0
- package/dist/collection/components/select-option/select-option.css +93 -0
- package/dist/collection/components/select-option/select-option.js +459 -0
- package/dist/collection/components/skip-link/exports.js +1 -0
- package/dist/collection/components/skip-link/skip-link.css +37 -0
- package/dist/collection/components/skip-link/skip-link.js +52 -0
- package/dist/collection/components/stepper/stepper.css +25 -0
- package/dist/collection/components/stepper/stepper.js +216 -0
- package/dist/collection/components/stepper-item/stepper-item.css +62 -0
- package/dist/collection/components/stepper-item/stepper-item.js +171 -0
- package/dist/collection/components/tab/tab.css +81 -0
- package/dist/collection/components/tab/tab.js +169 -0
- package/dist/collection/components/tab-panel/tab-panel.css +19 -0
- package/dist/collection/components/tab-panel/tab-panel.js +72 -0
- package/dist/collection/components/tabs/tabs.css +4 -0
- package/dist/collection/components/tabs/tabs.js +345 -0
- package/dist/collection/components/tabs-list/exports.js +2 -0
- package/dist/collection/components/tabs-list/tabs-list.css +58 -0
- package/dist/collection/components/tabs-list/tabs-list.js +294 -0
- package/dist/collection/components/textarea/exports.js +8 -0
- package/dist/collection/components/textarea/textarea.css +148 -0
- package/dist/collection/components/textarea/textarea.js +1055 -0
- package/dist/collection/components/toast/exports.js +3 -0
- package/dist/collection/components/toast/toast.css +179 -0
- package/dist/collection/components/toast/toast.js +820 -0
- package/dist/collection/components/toast-group/exports.js +1 -0
- package/dist/collection/components/toast-group/toast-group.css +37 -0
- package/dist/collection/components/toast-group/toast-group.js +49 -0
- package/dist/collection/components/tooltip/exports.js +3 -0
- package/dist/collection/components/tooltip/tooltip.css +77 -0
- package/dist/collection/components/tooltip/tooltip.js +525 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/utils/focusable.js +24 -0
- package/dist/collection/utils/formData.js +40 -0
- package/dist/collection/utils/theming.js +103 -0
- package/dist/collection/utils/version-checker.js +33 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/focusable-ky1yonnS.js +26 -0
- package/dist/esm/formData-DvLT8-y3.js +42 -0
- package/dist/esm/index-CTxpqopm.js +1806 -0
- package/dist/esm/index.js +35 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/r-accordion-panel.entry.js +22 -0
- package/dist/esm/r-accordion-section.entry.js +123 -0
- package/dist/esm/r-accordion-trigger.entry.js +91 -0
- package/dist/esm/r-accordion.entry.js +18 -0
- package/dist/esm/r-alert.entry.js +144 -0
- package/dist/esm/r-badge.entry.js +39 -0
- package/dist/esm/r-button.entry.js +147 -0
- package/dist/esm/r-checkbox-group.entry.js +235 -0
- package/dist/esm/r-checkbox.entry.js +272 -0
- package/dist/esm/r-design-system-devtools.entry.js +29 -0
- package/dist/esm/r-dialog.entry.js +105 -0
- package/dist/esm/r-hint_2.entry.js +47 -0
- package/dist/esm/r-icon-button_2.entry.js +489 -0
- package/dist/esm/r-icon.entry.js +282 -0
- package/dist/esm/r-illustration.entry.js +394 -0
- package/dist/esm/r-input-code.entry.js +435 -0
- package/dist/esm/r-input-date.entry.js +522 -0
- package/dist/esm/r-input-password.entry.js +268 -0
- package/dist/esm/r-input-phone-number.entry.js +2523 -0
- package/dist/esm/r-input.entry.js +616 -0
- package/dist/esm/r-list-item.entry.js +107 -0
- package/dist/esm/r-pagination.entry.js +318 -0
- package/dist/esm/r-panel.entry.js +182 -0
- package/dist/esm/r-popover-action.entry.js +78 -0
- package/dist/esm/r-popover-content.entry.js +60 -0
- package/dist/esm/r-popover-headline.entry.js +26 -0
- package/dist/esm/r-popover-trigger.entry.js +68 -0
- package/dist/esm/r-popover.entry.js +345 -0
- package/dist/esm/r-progress-bar.entry.js +23 -0
- package/dist/esm/r-radio-button-description.entry.js +16 -0
- package/dist/esm/r-radio-button-leading.entry.js +16 -0
- package/dist/esm/r-radio-button-title.entry.js +16 -0
- package/dist/esm/r-radio-button-trailing.entry.js +16 -0
- package/dist/esm/r-radio-button.entry.js +137 -0
- package/dist/esm/r-radio-group.entry.js +426 -0
- package/dist/esm/r-select-option.entry.js +128 -0
- package/dist/esm/r-select.entry.js +1105 -0
- package/dist/esm/r-skip-link.entry.js +17 -0
- package/dist/esm/r-stepper-item.entry.js +40 -0
- package/dist/esm/r-stepper.entry.js +97 -0
- package/dist/esm/r-tab-panel.entry.js +24 -0
- package/dist/esm/r-tab.entry.js +60 -0
- package/dist/esm/r-tabs-list.entry.js +173 -0
- package/dist/esm/r-tabs.entry.js +275 -0
- package/dist/esm/r-textarea.entry.js +268 -0
- package/dist/esm/r-toast-group.entry.js +44 -0
- package/dist/esm/r-toast.entry.js +312 -0
- package/dist/esm/style-observer-4Uv3PpKT.js +1116 -0
- package/dist/esm/theming-DD2IrjpG.js +106 -0
- package/dist/esm/web-components.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/accordion/accordion.d.ts +27 -0
- package/dist/types/components/accordion/exports.d.ts +2 -0
- package/dist/types/components/accordion-panel/accordion-panel.d.ts +10 -0
- package/dist/types/components/accordion-section/accordion-section.d.ts +36 -0
- package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +33 -0
- package/dist/types/components/alert/alert.d.ts +67 -0
- package/dist/types/components/alert/exports.d.ts +4 -0
- package/dist/types/components/badge/badge.d.ts +26 -0
- package/dist/types/components/badge/exports.d.ts +2 -0
- package/dist/types/components/button/button.d.ts +89 -0
- package/dist/types/components/button/exports.d.ts +10 -0
- package/dist/types/components/checkbox/checkbox.d.ts +138 -0
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +124 -0
- package/dist/types/components/design-system-devtools/design-system-devtools.d.ts +15 -0
- package/dist/types/components/dialog/dialog.d.ts +69 -0
- package/dist/types/components/dialog/exports.d.ts +10 -0
- package/dist/types/components/hint/exports.d.ts +2 -0
- package/dist/types/components/hint/hint.d.ts +20 -0
- package/dist/types/components/icon/all-kit.d.ts +2890 -0
- package/dist/types/components/icon/data.d.ts +145 -0
- package/dist/types/components/icon/exports.d.ts +152 -0
- package/dist/types/components/icon/icon.d.ts +37 -0
- package/dist/types/components/icon/riverty-kit.d.ts +139 -0
- package/dist/types/components/icon-button/icon-button.d.ts +69 -0
- package/dist/types/components/illustration/data.d.ts +52 -0
- package/dist/types/components/illustration/exports.d.ts +23 -0
- package/dist/types/components/illustration/illustration.d.ts +51 -0
- package/dist/types/components/illustration/illustrations-ui-kit.d.ts +21 -0
- package/dist/types/components/input/exports.d.ts +55 -0
- package/dist/types/components/input/input.d.ts +365 -0
- package/dist/types/components/input-code/exports.d.ts +4 -0
- package/dist/types/components/input-code/input-code.d.ts +177 -0
- package/dist/types/components/input-date/exports.d.ts +5 -0
- package/dist/types/components/input-date/input-date.d.ts +174 -0
- package/dist/types/components/input-password/exports.d.ts +1 -0
- package/dist/types/components/input-password/input-password.d.ts +186 -0
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +130 -0
- package/dist/types/components/label/label.d.ts +9 -0
- package/dist/types/components/list-item/list-item/exports.d.ts +4 -0
- package/dist/types/components/list-item/list-item/list-item.d.ts +61 -0
- package/dist/types/components/pagination/exports.d.ts +6 -0
- package/dist/types/components/pagination/pagination.d.ts +140 -0
- package/dist/types/components/panel/exports.d.ts +2 -0
- package/dist/types/components/panel/panel.d.ts +56 -0
- package/dist/types/components/popover/exports.d.ts +6 -0
- package/dist/types/components/popover/popover.d.ts +131 -0
- package/dist/types/components/popover-action/popover-action.d.ts +24 -0
- package/dist/types/components/popover-content/popover-content.d.ts +22 -0
- package/dist/types/components/popover-headline/popover-headline.d.ts +6 -0
- package/dist/types/components/popover-trigger/exports.d.ts +2 -0
- package/dist/types/components/popover-trigger/popover-trigger.d.ts +31 -0
- package/dist/types/components/progress-bar/progress-bar.d.ts +10 -0
- package/dist/types/components/radio-button/radio-button.d.ts +92 -0
- package/dist/types/components/radio-button-description/radio-button-description.d.ts +8 -0
- package/dist/types/components/radio-button-leading/radio-button-leading.d.ts +8 -0
- package/dist/types/components/radio-button-title/radio-button-title.d.ts +8 -0
- package/dist/types/components/radio-button-trailing/radio-button-trailing.d.ts +8 -0
- package/dist/types/components/radio-group/exports.d.ts +2 -0
- package/dist/types/components/radio-group/radio-group.d.ts +179 -0
- package/dist/types/components/select/exports.d.ts +2 -0
- package/dist/types/components/select/select.d.ts +319 -0
- package/dist/types/components/select-option/select-option.d.ts +113 -0
- package/dist/types/components/skip-link/exports.d.ts +2 -0
- package/dist/types/components/skip-link/skip-link.d.ts +6 -0
- package/dist/types/components/stepper/stepper.d.ts +22 -0
- package/dist/types/components/stepper-item/stepper-item.d.ts +23 -0
- package/dist/types/components/tab/tab.d.ts +23 -0
- package/dist/types/components/tab-panel/tab-panel.d.ts +7 -0
- package/dist/types/components/tabs/tabs.d.ts +49 -0
- package/dist/types/components/tabs-list/exports.d.ts +4 -0
- package/dist/types/components/tabs-list/tabs-list.d.ts +41 -0
- package/dist/types/components/textarea/exports.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +158 -0
- package/dist/types/components/toast/exports.d.ts +6 -0
- package/dist/types/components/toast/toast.d.ts +146 -0
- package/dist/types/components/toast-group/exports.d.ts +2 -0
- package/dist/types/components/toast-group/toast-group.d.ts +9 -0
- package/dist/types/components/tooltip/exports.d.ts +6 -0
- package/dist/types/components/tooltip/tooltip.d.ts +132 -0
- package/dist/types/components.d.ts +6347 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1732 -0
- package/dist/types/types/jsx-shim.d.ts +13 -0
- package/dist/types/types/style-observer.d.ts +20 -0
- package/dist/types/utils/focusable.d.ts +1 -0
- package/dist/types/utils/formData.d.ts +1 -0
- package/dist/types/utils/theming.d.ts +15 -0
- package/dist/types/utils/version-checker.d.ts +1 -0
- package/dist/web-components/index.esm.js +1 -0
- package/dist/web-components/p-01aefcf0.entry.js +1 -0
- package/dist/web-components/p-05cb55db.entry.js +1 -0
- package/dist/web-components/p-0a34d33b.entry.js +1 -0
- package/dist/web-components/p-11b22309.entry.js +1 -0
- package/dist/web-components/p-2d878934.entry.js +1 -0
- package/dist/web-components/p-325dbedf.entry.js +1 -0
- package/dist/web-components/p-34b9457b.entry.js +1 -0
- package/dist/web-components/p-36abd05a.entry.js +1 -0
- package/dist/web-components/p-386d1ef9.entry.js +1 -0
- package/dist/web-components/p-3d67b77b.entry.js +1 -0
- package/dist/web-components/p-4Uv3PpKT.js +1 -0
- package/dist/web-components/p-4b12fbc0.entry.js +1 -0
- package/dist/web-components/p-52f7b505.entry.js +1 -0
- package/dist/web-components/p-55600d47.entry.js +1 -0
- package/dist/web-components/p-57ebc474.entry.js +1 -0
- package/dist/web-components/p-57edf7f4.entry.js +1 -0
- package/dist/web-components/p-69a24fe2.entry.js +1 -0
- package/dist/web-components/p-6d92648c.entry.js +1 -0
- package/dist/web-components/p-75052597.entry.js +1 -0
- package/dist/web-components/p-7b2c5b63.entry.js +1 -0
- package/dist/web-components/p-7bf463ff.entry.js +1 -0
- package/dist/web-components/p-838e43d4.entry.js +1 -0
- package/dist/web-components/p-8c16d038.entry.js +1 -0
- package/dist/web-components/p-8f8313de.entry.js +1 -0
- package/dist/web-components/p-9026d5a2.entry.js +1 -0
- package/dist/web-components/p-95396b5c.entry.js +1 -0
- package/dist/web-components/p-9c31c7c4.entry.js +1 -0
- package/dist/web-components/p-9c415b9c.entry.js +1 -0
- package/dist/web-components/p-9f583ed1.entry.js +1 -0
- package/dist/web-components/p-B9rsR6cQ.js +1 -0
- package/dist/web-components/p-CTxpqopm.js +2 -0
- package/dist/web-components/p-DQuL1Twl.js +1 -0
- package/dist/web-components/p-DvLT8-y3.js +1 -0
- package/dist/web-components/p-b303b2cc.entry.js +1 -0
- package/dist/web-components/p-b8df041d.entry.js +1 -0
- package/dist/web-components/p-bc30844f.entry.js +1 -0
- package/dist/web-components/p-c4a77a65.entry.js +1 -0
- package/dist/web-components/p-c549addf.entry.js +1 -0
- package/dist/web-components/p-c65df19f.entry.js +1 -0
- package/dist/web-components/p-c80a5541.entry.js +1 -0
- package/dist/web-components/p-c96ee61a.entry.js +1 -0
- package/dist/web-components/p-cf3f044d.entry.js +1 -0
- package/dist/web-components/p-d1412932.entry.js +1 -0
- package/dist/web-components/p-d9778cfa.entry.js +1 -0
- package/dist/web-components/p-dbe4ccb8.entry.js +1 -0
- package/dist/web-components/p-ded50850.entry.js +1 -0
- package/dist/web-components/p-e5be895b.entry.js +1 -0
- package/dist/web-components/p-e6b34c1e.entry.js +1 -0
- package/dist/web-components/p-ec3c4800.entry.js +1 -0
- package/dist/web-components/p-f670fd87.entry.js +1 -0
- package/dist/web-components/p-f867e4c3.entry.js +1 -0
- package/dist/web-components/p-ff6b1b8f.entry.js +1 -0
- package/dist/web-components/p-ky1yonnS.js +1 -0
- package/dist/web-components/web-components.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2038 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { appendControlToFormData } from "../../utils/formData";
|
|
3
|
+
import StyleObserver from "style-observer";
|
|
4
|
+
/**
|
|
5
|
+
* A select allows the user to choose between a set of options.
|
|
6
|
+
*
|
|
7
|
+
* Overall behavior is based on native `<select>`
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export class Select {
|
|
11
|
+
constructor() {
|
|
12
|
+
/** Define if select should render as a text item or a block */
|
|
13
|
+
this.fullWidth = false;
|
|
14
|
+
/** Define wether listbox appears on top or at the bottom of the select */
|
|
15
|
+
this.listboxPosition = 'bottom';
|
|
16
|
+
/**
|
|
17
|
+
* Defines aria label for combobox toggle button
|
|
18
|
+
* @default "Toggle combobox"
|
|
19
|
+
*/
|
|
20
|
+
this.toggleButtonAriaLabel = 'Toggle combobox';
|
|
21
|
+
/**
|
|
22
|
+
* Defines the text that will be displayed if no results are found
|
|
23
|
+
* @default "No results found"
|
|
24
|
+
*/
|
|
25
|
+
this.noResultsFound = 'No results found';
|
|
26
|
+
/** Custom validity state passed after validation */
|
|
27
|
+
this.validityState = '';
|
|
28
|
+
/** Custom validity message passed after validation */
|
|
29
|
+
this.validityMessage = '';
|
|
30
|
+
/** Is select expanded */
|
|
31
|
+
this.isExpanded = false;
|
|
32
|
+
/** Current state, reflecting if select is readonly */
|
|
33
|
+
this.isReadonly = false;
|
|
34
|
+
/** Save current value */
|
|
35
|
+
this.currentValue = '';
|
|
36
|
+
/** Value that must be displayed as selected option */
|
|
37
|
+
this.valueToDisplay = '';
|
|
38
|
+
this.isInitializing = false;
|
|
39
|
+
this.isResetting = false;
|
|
40
|
+
this.focusedOption = null;
|
|
41
|
+
this.isValueFocused = false;
|
|
42
|
+
this.isNoResultsFound = false;
|
|
43
|
+
/** Indicates if the user has interacted with the select (focused/clicked) */
|
|
44
|
+
this.touched = false;
|
|
45
|
+
/** Indicates if the value has been changed by user interaction */
|
|
46
|
+
this.dirty = false;
|
|
47
|
+
this.handleSlotChange = () => {
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
this.initialize();
|
|
50
|
+
this.defineHostWidth();
|
|
51
|
+
}, 0);
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Initial attributes state
|
|
55
|
+
* */
|
|
56
|
+
this.initial = {};
|
|
57
|
+
/** Unique id */
|
|
58
|
+
this.uniqueId = `r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
59
|
+
this.getValidityStateData = (element) => {
|
|
60
|
+
let validityState = '';
|
|
61
|
+
let validityMessage = '';
|
|
62
|
+
for (const state in element.validity) {
|
|
63
|
+
if (element.validity[state]) {
|
|
64
|
+
validityState = state;
|
|
65
|
+
if (this[state + 'Message']) {
|
|
66
|
+
validityMessage = this[state + 'Message'];
|
|
67
|
+
return { validityState, validityMessage };
|
|
68
|
+
}
|
|
69
|
+
validityMessage = element.validationMessage;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { validityState, validityMessage };
|
|
73
|
+
};
|
|
74
|
+
this.validateFormElement = (element = null) => {
|
|
75
|
+
if (element === null)
|
|
76
|
+
return;
|
|
77
|
+
if (this.isNoValidate)
|
|
78
|
+
return;
|
|
79
|
+
if (this.error)
|
|
80
|
+
return;
|
|
81
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
82
|
+
this.validityState = validityState;
|
|
83
|
+
this.validityMessage = validityMessage;
|
|
84
|
+
const isValid = this.validityState === 'valid';
|
|
85
|
+
this.valid = isValid;
|
|
86
|
+
this.invalid = !isValid;
|
|
87
|
+
this.rValidate.emit({
|
|
88
|
+
state: this.validityState,
|
|
89
|
+
message: this.validityMessage
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
// Typeahead buffer + last matched index
|
|
93
|
+
this.typeaheadBuffer = '';
|
|
94
|
+
this.typeaheadTimeout = null;
|
|
95
|
+
this.lastTypeaheadIndex = -1;
|
|
96
|
+
this.contributeToFormData = (event) => {
|
|
97
|
+
appendControlToFormData(this.nativeElement, event.formData);
|
|
98
|
+
};
|
|
99
|
+
this.onValueClick = (e) => {
|
|
100
|
+
var _a;
|
|
101
|
+
if (this.disabled)
|
|
102
|
+
return;
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
// Mark as touched when user clicks on the select
|
|
106
|
+
this.touched = true;
|
|
107
|
+
this.toggle();
|
|
108
|
+
if (!this.isExpanded)
|
|
109
|
+
return;
|
|
110
|
+
if (this.combobox)
|
|
111
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
112
|
+
this.defineListboxPositionState();
|
|
113
|
+
};
|
|
114
|
+
// Returns a handler for a key
|
|
115
|
+
this.keyboardEventHandlerFactory = (code, altKey = false) => {
|
|
116
|
+
switch (code) {
|
|
117
|
+
case 'Enter':
|
|
118
|
+
return () => {
|
|
119
|
+
var _a;
|
|
120
|
+
if (this.isExpanded) {
|
|
121
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
122
|
+
if (newValue !== this.currentValue) {
|
|
123
|
+
this.dirty = true;
|
|
124
|
+
}
|
|
125
|
+
this.setValueFromUserInteraction(newValue);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.expand();
|
|
129
|
+
this.setOptionFocus(this.selectedElement);
|
|
130
|
+
};
|
|
131
|
+
case 'Escape':
|
|
132
|
+
return () => {
|
|
133
|
+
this.collapse();
|
|
134
|
+
this.reportValidity();
|
|
135
|
+
};
|
|
136
|
+
case 'ArrowUp':
|
|
137
|
+
return () => {
|
|
138
|
+
var _a;
|
|
139
|
+
if (!this.isExpanded) {
|
|
140
|
+
this.expand();
|
|
141
|
+
const indexToFocus = this.combobox ? this.optionElements.length - 1 : 0;
|
|
142
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[indexToFocus]);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (this.focusedOption && altKey) {
|
|
146
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
147
|
+
if (newValue !== this.currentValue) {
|
|
148
|
+
this.dirty = true;
|
|
149
|
+
}
|
|
150
|
+
this.setValueFromUserInteraction(newValue);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!this.combobox && this.focusedOption === this.optionElements[0])
|
|
154
|
+
return;
|
|
155
|
+
if (this.focusedOption) {
|
|
156
|
+
this.focusPrevOption();
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
160
|
+
};
|
|
161
|
+
case 'ArrowDown':
|
|
162
|
+
return () => {
|
|
163
|
+
if (!this.isExpanded) {
|
|
164
|
+
this.expand();
|
|
165
|
+
if (altKey)
|
|
166
|
+
return;
|
|
167
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (!this.combobox && this.focusedOption === this.optionElements[this.optionElements.length - 1])
|
|
171
|
+
return;
|
|
172
|
+
if (this.focusedOption) {
|
|
173
|
+
this.focusNextOption();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
177
|
+
};
|
|
178
|
+
case 'Home':
|
|
179
|
+
return () => {
|
|
180
|
+
if (!this.isExpanded) {
|
|
181
|
+
this.expand();
|
|
182
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[0]);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.setOptionFocus(this.optionElements[0]);
|
|
186
|
+
};
|
|
187
|
+
case 'End':
|
|
188
|
+
return () => {
|
|
189
|
+
if (!this.isExpanded) {
|
|
190
|
+
this.expand();
|
|
191
|
+
this.setOptionFocus(this.selectedElement || this.optionElements[this.optionElements.length - 1]);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.setOptionFocus(this.optionElements[this.optionElements.length - 1]);
|
|
195
|
+
};
|
|
196
|
+
case 'PageUp': {
|
|
197
|
+
return () => {
|
|
198
|
+
if (!this.isExpanded)
|
|
199
|
+
return;
|
|
200
|
+
if (this.focusedOption === null)
|
|
201
|
+
return;
|
|
202
|
+
const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
|
|
203
|
+
if (currentIndex === -1)
|
|
204
|
+
return;
|
|
205
|
+
const targetIndex = currentIndex - 10 >= 0 ? currentIndex - 10 : 0;
|
|
206
|
+
this.setOptionFocus(this.optionElements[targetIndex]);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
case 'PageDown': {
|
|
210
|
+
return () => {
|
|
211
|
+
if (!this.isExpanded)
|
|
212
|
+
return;
|
|
213
|
+
if (this.focusedOption === null)
|
|
214
|
+
return;
|
|
215
|
+
const currentIndex = this.optionElementsArray.indexOf(this.focusedOption);
|
|
216
|
+
if (currentIndex === -1)
|
|
217
|
+
return;
|
|
218
|
+
const lastIndex = this.optionElements.length - 1;
|
|
219
|
+
const targetIndex = currentIndex + 10 <= lastIndex ? currentIndex + 10 : lastIndex;
|
|
220
|
+
this.setOptionFocus(this.optionElements[targetIndex]);
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
case 'Tab':
|
|
224
|
+
return () => {
|
|
225
|
+
var _a;
|
|
226
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
227
|
+
if (newValue !== this.currentValue) {
|
|
228
|
+
this.dirty = true;
|
|
229
|
+
}
|
|
230
|
+
this.setValueFromUserInteraction(newValue);
|
|
231
|
+
};
|
|
232
|
+
default:
|
|
233
|
+
// No matching key handler: intentional no-op
|
|
234
|
+
return () => { void 0; };
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
this.onValueKeydown = (e) => {
|
|
238
|
+
e.stopPropagation();
|
|
239
|
+
const preventCodes = [
|
|
240
|
+
'ArrowUp',
|
|
241
|
+
'ArrowDown',
|
|
242
|
+
'Home',
|
|
243
|
+
'End',
|
|
244
|
+
'PageUp',
|
|
245
|
+
'PageDown',
|
|
246
|
+
'Space',
|
|
247
|
+
'Enter',
|
|
248
|
+
'Escape'
|
|
249
|
+
];
|
|
250
|
+
if (preventCodes.includes(e.code)) {
|
|
251
|
+
e.preventDefault();
|
|
252
|
+
}
|
|
253
|
+
else if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
254
|
+
// Tab will also be skipped here
|
|
255
|
+
if (!this.isExpanded)
|
|
256
|
+
this.expand();
|
|
257
|
+
this.handleTypeahead(e.key);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
switch (e.code) {
|
|
261
|
+
case 'Space':
|
|
262
|
+
this.keyboardEventHandlerFactory('Enter')();
|
|
263
|
+
break;
|
|
264
|
+
case 'Tab':
|
|
265
|
+
if (this.focusedOption === null)
|
|
266
|
+
break;
|
|
267
|
+
this.keyboardEventHandlerFactory('Tab')();
|
|
268
|
+
break;
|
|
269
|
+
default:
|
|
270
|
+
this.keyboardEventHandlerFactory(e.code, e.altKey)();
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
this.onComboboxKeydown = (e) => {
|
|
275
|
+
e.stopPropagation();
|
|
276
|
+
const preventCodes = [
|
|
277
|
+
'ArrowUp',
|
|
278
|
+
'ArrowDown',
|
|
279
|
+
'Home',
|
|
280
|
+
'End',
|
|
281
|
+
'PageUp',
|
|
282
|
+
'PageDown',
|
|
283
|
+
'Enter',
|
|
284
|
+
'Escape'
|
|
285
|
+
];
|
|
286
|
+
if (preventCodes.includes(e.code)) {
|
|
287
|
+
e.preventDefault();
|
|
288
|
+
}
|
|
289
|
+
switch (e.code) {
|
|
290
|
+
case 'Tab':
|
|
291
|
+
if (this.focusedOption === null) {
|
|
292
|
+
this.collapse();
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
this.keyboardEventHandlerFactory('Tab')();
|
|
296
|
+
break;
|
|
297
|
+
case 'Escape':
|
|
298
|
+
if (this.isExpanded) {
|
|
299
|
+
this.keyboardEventHandlerFactory('Escape')();
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
this.valueElement.value = '';
|
|
303
|
+
const newValue = '';
|
|
304
|
+
if (newValue !== this.currentValue) {
|
|
305
|
+
this.dirty = true;
|
|
306
|
+
}
|
|
307
|
+
this.setValueFromUserInteraction(newValue);
|
|
308
|
+
this.reportValidity();
|
|
309
|
+
break;
|
|
310
|
+
default:
|
|
311
|
+
this.keyboardEventHandlerFactory(e.code, e.altKey)();
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
this.onValueBlur = () => {
|
|
316
|
+
this.isValueFocused = false;
|
|
317
|
+
const { isBusy, isExpanded } = this;
|
|
318
|
+
if (isBusy || isExpanded)
|
|
319
|
+
return;
|
|
320
|
+
this.reportValidity();
|
|
321
|
+
};
|
|
322
|
+
this.onValueFocus = () => {
|
|
323
|
+
this.isValueFocused = true;
|
|
324
|
+
// Mark as touched when user focuses on the select
|
|
325
|
+
this.touched = true;
|
|
326
|
+
};
|
|
327
|
+
this.filterOptionsListByComboboxValue = (value = '') => {
|
|
328
|
+
const options = Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));
|
|
329
|
+
options.forEach((option) => {
|
|
330
|
+
var _a, _b;
|
|
331
|
+
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();
|
|
332
|
+
const hasMatch = optionText.search(value.toLowerCase()) !== -1;
|
|
333
|
+
option.setAttribute('aria-hidden', `${!hasMatch}`);
|
|
334
|
+
});
|
|
335
|
+
this.isNoResultsFound = options.every((option) => (option === null || option === void 0 ? void 0 : option.getAttribute('aria-hidden')) === 'true');
|
|
336
|
+
if (this.isNoResultsFound) {
|
|
337
|
+
this.statusElement.innerHTML = this.noResultsFound;
|
|
338
|
+
setTimeout(() => {
|
|
339
|
+
this.statusElement.innerText = '';
|
|
340
|
+
}, 1000);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
this.clearComboboxOptions = () => {
|
|
344
|
+
if (!this.combobox)
|
|
345
|
+
return;
|
|
346
|
+
this.filterOptionsListByComboboxValue();
|
|
347
|
+
};
|
|
348
|
+
this.onComboboxChange = (event) => {
|
|
349
|
+
this.filterOptionsListByComboboxValue(event.target.value);
|
|
350
|
+
};
|
|
351
|
+
this.onComboboxInput = (event) => {
|
|
352
|
+
this.filterOptionsListByComboboxValue(event.target.value);
|
|
353
|
+
if (!this.isExpanded) {
|
|
354
|
+
this.expand();
|
|
355
|
+
this.defineListboxPositionState();
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
this.onSubmitForm = (event) => {
|
|
359
|
+
if (this.isNoValidate)
|
|
360
|
+
return;
|
|
361
|
+
this.reportValidity();
|
|
362
|
+
if (this.invalid) {
|
|
363
|
+
event.preventDefault();
|
|
364
|
+
event.stopPropagation();
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
// Clear validation results and emit rReset event
|
|
368
|
+
this.onResetForm = () => {
|
|
369
|
+
// Clear validation results
|
|
370
|
+
this.resetValidation();
|
|
371
|
+
// Reset touched and dirty states
|
|
372
|
+
this.markAsPristine();
|
|
373
|
+
// Restore initial value
|
|
374
|
+
this.setValue(this.initial['value']);
|
|
375
|
+
// Emit rReset
|
|
376
|
+
this.rReset.emit({
|
|
377
|
+
element: this.host,
|
|
378
|
+
value: this.currentValue
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
this.renderSelect = (comboboxAttrs) => {
|
|
382
|
+
var _a, _b;
|
|
383
|
+
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" }))));
|
|
384
|
+
};
|
|
385
|
+
this.renderCombobox = (comboboxAttrs) => {
|
|
386
|
+
var _a, _b, _c;
|
|
387
|
+
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 })));
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
/** Sets the component into `readonly` state */
|
|
391
|
+
async setReadonly() {
|
|
392
|
+
this.collapse();
|
|
393
|
+
this.resetValidation();
|
|
394
|
+
this.isReadonly = true;
|
|
395
|
+
}
|
|
396
|
+
/** Clears readonly state from the component */
|
|
397
|
+
async clearReadonly() {
|
|
398
|
+
this.isReadonly = false;
|
|
399
|
+
}
|
|
400
|
+
handleListboxPositionChange() {
|
|
401
|
+
this.defineListboxPositionState();
|
|
402
|
+
}
|
|
403
|
+
handleExpandedChange() {
|
|
404
|
+
this.expanded ? this.expand() : this.collapse();
|
|
405
|
+
}
|
|
406
|
+
handleReadonlyChange() {
|
|
407
|
+
this.readonly ? this.setReadonly() : this.clearReadonly();
|
|
408
|
+
}
|
|
409
|
+
handleValueChange(value, oldValue) {
|
|
410
|
+
if (this.isInitializing)
|
|
411
|
+
return;
|
|
412
|
+
// Only process if this is not the initial load (oldValue is defined)
|
|
413
|
+
if (oldValue !== undefined && oldValue !== value) {
|
|
414
|
+
// This is a programmatic change from parent attribute
|
|
415
|
+
// Do NOT mark as dirty, do NOT emit rChange
|
|
416
|
+
this._renderSelected(value, false);
|
|
417
|
+
this.clearComboboxOptions();
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/** Listen for custom event triggered by "onClick" event on `<r-select-option>` */
|
|
421
|
+
optionSelectAction(e) {
|
|
422
|
+
e.stopPropagation();
|
|
423
|
+
if (this.disabled)
|
|
424
|
+
return;
|
|
425
|
+
// Mark as dirty only if value actually changes
|
|
426
|
+
if (e.target.value !== this.currentValue) {
|
|
427
|
+
this.dirty = true;
|
|
428
|
+
}
|
|
429
|
+
this.setValueFromUserInteraction(e.target.value);
|
|
430
|
+
}
|
|
431
|
+
tooltipFocusAction() {
|
|
432
|
+
this.collapse();
|
|
433
|
+
this.reportValidity();
|
|
434
|
+
}
|
|
435
|
+
onMouseup(e) {
|
|
436
|
+
if (!this.isExpanded)
|
|
437
|
+
return;
|
|
438
|
+
e.stopPropagation();
|
|
439
|
+
if (!this.host.contains(e.target)) {
|
|
440
|
+
this.collapse();
|
|
441
|
+
this.reportValidity();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
onKeyup(e) {
|
|
445
|
+
if (!this.isExpanded)
|
|
446
|
+
return;
|
|
447
|
+
e.stopPropagation();
|
|
448
|
+
const path = e.composedPath ? e.composedPath() : [];
|
|
449
|
+
const isInsideSelect = path.includes(this.host);
|
|
450
|
+
if (!isInsideSelect) {
|
|
451
|
+
this.collapse();
|
|
452
|
+
this.reportValidity();
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Listen on window scroll
|
|
457
|
+
* and update tooltip position if needed
|
|
458
|
+
*/
|
|
459
|
+
handleScrolling() {
|
|
460
|
+
if (this.isExpanded)
|
|
461
|
+
this.defineListboxPositionState();
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Listen on window resizing
|
|
465
|
+
* and update tooltip position if needed
|
|
466
|
+
*/
|
|
467
|
+
handleResizing() {
|
|
468
|
+
if (this.isExpanded)
|
|
469
|
+
this.defineListboxPositionState();
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Set value of the select programmatically.
|
|
473
|
+
* Does NOT mark as dirty or emit change events.
|
|
474
|
+
* Use this for programmatic value updates.
|
|
475
|
+
*/
|
|
476
|
+
async setValue(value = '') {
|
|
477
|
+
// Clear validation results
|
|
478
|
+
this.resetValidation();
|
|
479
|
+
// Don't emit change event for programmatic updates
|
|
480
|
+
this._renderSelected(value, false);
|
|
481
|
+
this.clearComboboxOptions();
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Internal method to set value from user interaction.
|
|
485
|
+
* Assumes dirty flag is already set by the caller.
|
|
486
|
+
* Will emit rChange if dirty flag is true.
|
|
487
|
+
*/
|
|
488
|
+
setValueFromUserInteraction(value = '') {
|
|
489
|
+
// Clear validation results
|
|
490
|
+
this.resetValidation();
|
|
491
|
+
// Emit change event for user interactions (if dirty is set)
|
|
492
|
+
this._renderSelected(value, true);
|
|
493
|
+
this.clearComboboxOptions();
|
|
494
|
+
}
|
|
495
|
+
/** Set value of the select */
|
|
496
|
+
async getValue() {
|
|
497
|
+
return this.currentValue || '';
|
|
498
|
+
}
|
|
499
|
+
/** Reset select to its initial state */
|
|
500
|
+
async reset() {
|
|
501
|
+
// Clear validation results
|
|
502
|
+
this.resetValidation();
|
|
503
|
+
// Reset touched and dirty states
|
|
504
|
+
this.markAsPristine();
|
|
505
|
+
// Collapse options listbox
|
|
506
|
+
this.collapse();
|
|
507
|
+
// Restore unfiltered list
|
|
508
|
+
this.clearComboboxOptions();
|
|
509
|
+
// If value has not changed --> nothing to reset
|
|
510
|
+
if (this.currentValue === this.initial['value'])
|
|
511
|
+
return;
|
|
512
|
+
// If initial value is not an empty string
|
|
513
|
+
if (this.initial['value'] !== '' && this.initiallySelectedElement) {
|
|
514
|
+
this.isResetting = true;
|
|
515
|
+
this.setValue(this.initial['value']);
|
|
516
|
+
this.isResetting = false;
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
// Clear any selected option
|
|
520
|
+
this.deselectOptions();
|
|
521
|
+
// Set value of the select to null
|
|
522
|
+
this.currentValue = '';
|
|
523
|
+
this.valueToDisplay = '';
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Clears validation results.
|
|
527
|
+
*/
|
|
528
|
+
async resetValidation() {
|
|
529
|
+
// Clear validity message
|
|
530
|
+
this.validityMessage = null;
|
|
531
|
+
// Clear validity state
|
|
532
|
+
this.validityState = null;
|
|
533
|
+
// Reset props to initial
|
|
534
|
+
this.invalid = this.initial['invalid'];
|
|
535
|
+
this.valid = !this.invalid;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Returns whether the select has been touched (focused/clicked by user).
|
|
539
|
+
* @returns A boolean indicating whether the select has been touched.
|
|
540
|
+
*/
|
|
541
|
+
async isTouched() {
|
|
542
|
+
return this.touched;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Returns whether the select value has been changed by user interaction.
|
|
546
|
+
* @returns A boolean indicating whether the select is dirty.
|
|
547
|
+
*/
|
|
548
|
+
async isDirty() {
|
|
549
|
+
return this.dirty;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Marks the select as untouched and pristine (not dirty).
|
|
553
|
+
*/
|
|
554
|
+
async markAsPristine() {
|
|
555
|
+
this.touched = false;
|
|
556
|
+
this.dirty = false;
|
|
557
|
+
}
|
|
558
|
+
/** Validates an element, displays provided message in case value is invalid. */
|
|
559
|
+
async setCustomValidity(message) {
|
|
560
|
+
this.customErrorMessage = message;
|
|
561
|
+
this.validateFormElement(this.nativeElement);
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Validates the textarea without triggering UI and returns a boolean indicating its validity.
|
|
565
|
+
* @returns A boolean indicating whether the textarea is valid.
|
|
566
|
+
*/
|
|
567
|
+
async checkValidity() {
|
|
568
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
569
|
+
return validityState === 'valid';
|
|
570
|
+
}
|
|
571
|
+
/** Check validity and reveal validation state and message */
|
|
572
|
+
async reportValidity() {
|
|
573
|
+
this.validateFormElement(this.nativeElement);
|
|
574
|
+
return this.validityState === 'valid';
|
|
575
|
+
}
|
|
576
|
+
/** Set focus on the element */
|
|
577
|
+
async setFocus() {
|
|
578
|
+
var _a;
|
|
579
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
580
|
+
}
|
|
581
|
+
/** Remove focus from the element */
|
|
582
|
+
async setBlur() {
|
|
583
|
+
var _a;
|
|
584
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
585
|
+
}
|
|
586
|
+
/** Expand options listbox */
|
|
587
|
+
async expand() {
|
|
588
|
+
this.isExpanded = true;
|
|
589
|
+
}
|
|
590
|
+
/** Collapse options listbox */
|
|
591
|
+
async collapse() {
|
|
592
|
+
this.isExpanded = false;
|
|
593
|
+
if (this.isBusy)
|
|
594
|
+
return;
|
|
595
|
+
this.clearOptionsFocus();
|
|
596
|
+
this.setComboboxValueOnCollapse();
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Retrieves the currently focused option within this select component.
|
|
600
|
+
*
|
|
601
|
+
* The focused option is identified by the presence of the `data-focused="true"`
|
|
602
|
+
* attribute on an `r-select-option` element inside the component's host.
|
|
603
|
+
*
|
|
604
|
+
* @returns Promise resolving to the focused `HTMLRSelectOptionElement`, or `null`
|
|
605
|
+
* if no option is currently marked as focused.
|
|
606
|
+
*/
|
|
607
|
+
async getFocusedOption() {
|
|
608
|
+
return this.host.querySelector('r-select-option[data-focused="true"]') || null;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Sets focus to the option at the specified index.
|
|
612
|
+
*
|
|
613
|
+
* Retrieves the option element from the internal optionElements collection
|
|
614
|
+
* and delegates focusing logic to `setOptionFocus`.
|
|
615
|
+
*
|
|
616
|
+
* @param index - Zero-based index of the option to focus. If the index is out of bounds
|
|
617
|
+
* or the corresponding option element is unavailable, the method will no-op.
|
|
618
|
+
*
|
|
619
|
+
* @returns A promise that resolves with the result of `setOptionFocus`, typically indicating
|
|
620
|
+
* success or failure of applying focus (implementation dependent).
|
|
621
|
+
*/
|
|
622
|
+
async setFocusedOption(index) {
|
|
623
|
+
return this.setOptionFocus(this.optionElements[index]);
|
|
624
|
+
}
|
|
625
|
+
clearOptionsFocus() {
|
|
626
|
+
var _a;
|
|
627
|
+
this.focusedOption = null;
|
|
628
|
+
try {
|
|
629
|
+
this.valueElement.ariaActiveDescendantElement = null;
|
|
630
|
+
}
|
|
631
|
+
catch (_b) {
|
|
632
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.removeAttribute('aria-activedescendant');
|
|
633
|
+
}
|
|
634
|
+
this.focusedOptions.forEach(option => option.setBlur());
|
|
635
|
+
}
|
|
636
|
+
setComboboxValueOnCollapse() {
|
|
637
|
+
var _a, _b, _c;
|
|
638
|
+
if (!this.combobox)
|
|
639
|
+
return;
|
|
640
|
+
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)) || '';
|
|
641
|
+
this.clearComboboxOptions();
|
|
642
|
+
}
|
|
643
|
+
get focusedOptions() {
|
|
644
|
+
return Array.from(this.host.querySelectorAll('r-select-option[data-focused="true"]'));
|
|
645
|
+
}
|
|
646
|
+
toggle() {
|
|
647
|
+
this.isExpanded = !this.isExpanded;
|
|
648
|
+
}
|
|
649
|
+
get selectedElement() {
|
|
650
|
+
return this.host.querySelector(`r-select-option[value="${this.currentValue}"]`);
|
|
651
|
+
}
|
|
652
|
+
get initiallySelectedElement() {
|
|
653
|
+
return this.host.querySelector(`r-select-option[value="${this.initial['value']}"]`) || null;
|
|
654
|
+
}
|
|
655
|
+
/** Identify wrapping form element */
|
|
656
|
+
get parentFormEl() {
|
|
657
|
+
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Determine whether this element should be ignored
|
|
661
|
+
* during Constraint Validation API validation.
|
|
662
|
+
* */
|
|
663
|
+
get isNoValidate() {
|
|
664
|
+
var _a;
|
|
665
|
+
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
666
|
+
this.novalidate ||
|
|
667
|
+
false);
|
|
668
|
+
}
|
|
669
|
+
get optionElements() {
|
|
670
|
+
return this.host.querySelectorAll('r-select-option:not([disabled]:not([disabled="false"])):not([aria-hidden="true"])') || null;
|
|
671
|
+
}
|
|
672
|
+
get optionElementsArray() {
|
|
673
|
+
return Array.from(this.optionElements);
|
|
674
|
+
}
|
|
675
|
+
deselectOptions() {
|
|
676
|
+
if (!this.optionElements)
|
|
677
|
+
return;
|
|
678
|
+
this.optionElements.forEach(option => option.clearSelected());
|
|
679
|
+
}
|
|
680
|
+
get isBusy() {
|
|
681
|
+
return this.isInitializing || this.isResetting;
|
|
682
|
+
}
|
|
683
|
+
_renderSelected(value = '', emitValue = true) {
|
|
684
|
+
var _a, _b;
|
|
685
|
+
// Update value of `<r-select>`
|
|
686
|
+
this.currentValue = value;
|
|
687
|
+
if (this.currentValue === null)
|
|
688
|
+
this.host.removeAttribute('value');
|
|
689
|
+
else
|
|
690
|
+
this.host.setAttribute('value', this.currentValue);
|
|
691
|
+
const elementToSelect = this.host.querySelector(`r-select-option[value="${(_a = this.currentValue) === null || _a === void 0 ? void 0 : _a.trim()}"]`);
|
|
692
|
+
this.valueToDisplay = (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.innerHTML) || (elementToSelect === null || elementToSelect === void 0 ? void 0 : elementToSelect.textContent) || this.currentValue || '';
|
|
693
|
+
// Switch `selected` value for each option
|
|
694
|
+
(_b = this.optionElements) === null || _b === void 0 ? void 0 : _b.forEach(option => {
|
|
695
|
+
option.value === value ? option.setSelected() : option.clearSelected();
|
|
696
|
+
});
|
|
697
|
+
this._renderNativeOption();
|
|
698
|
+
if (this.isExpanded)
|
|
699
|
+
this.collapse();
|
|
700
|
+
if (!this.isBusy) {
|
|
701
|
+
this.reportValidity();
|
|
702
|
+
}
|
|
703
|
+
// Only emit rChange if:
|
|
704
|
+
// 1. emitValue is true
|
|
705
|
+
// 2. Not during initialization or reset
|
|
706
|
+
// 3. The component is dirty (user has interacted)
|
|
707
|
+
if (emitValue && !this.isBusy && this.dirty) {
|
|
708
|
+
this.rChange.emit({
|
|
709
|
+
element: this.host,
|
|
710
|
+
value: value
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
setOptionFocus(element = this.selectedElement) {
|
|
715
|
+
if (!element)
|
|
716
|
+
return;
|
|
717
|
+
if (this.optionElements === null)
|
|
718
|
+
return;
|
|
719
|
+
// Helper: fallback to scrollIntoView
|
|
720
|
+
const _scrollIntoViewFallback = (element, container) => {
|
|
721
|
+
const top = element.offsetTop;
|
|
722
|
+
const bottom = top + element.offsetHeight;
|
|
723
|
+
const viewTop = container.scrollTop;
|
|
724
|
+
const viewBottom = viewTop + container.clientHeight;
|
|
725
|
+
if (top < viewTop) {
|
|
726
|
+
container.scrollTop = top;
|
|
727
|
+
}
|
|
728
|
+
else if (bottom > viewBottom) {
|
|
729
|
+
container.scrollTop = bottom - container.clientHeight;
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
// Helper: defines if scrollIntoView can be used or calls optional fallback
|
|
733
|
+
const _scrollIntoView = (element, container) => {
|
|
734
|
+
var _a, _b;
|
|
735
|
+
if (!container)
|
|
736
|
+
return;
|
|
737
|
+
// Try native scrollIntoView first (some browsers optimize this)
|
|
738
|
+
try {
|
|
739
|
+
(_a = element.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(element, {
|
|
740
|
+
block: 'nearest',
|
|
741
|
+
inline: 'nearest'
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
catch (_c) {
|
|
745
|
+
// Older Safari without options signature
|
|
746
|
+
(_b = element.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(element, false);
|
|
747
|
+
}
|
|
748
|
+
// Manual correction if still out of view
|
|
749
|
+
const optRect = element.getBoundingClientRect();
|
|
750
|
+
const contRect = container.getBoundingClientRect();
|
|
751
|
+
const outside = optRect.top < contRect.top || optRect.bottom > contRect.bottom;
|
|
752
|
+
if (outside) {
|
|
753
|
+
_scrollIntoViewFallback(element, container);
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
requestAnimationFrame(() => {
|
|
757
|
+
var _a;
|
|
758
|
+
this.clearOptionsFocus();
|
|
759
|
+
element.setFocus();
|
|
760
|
+
this.focusedOption = element;
|
|
761
|
+
try {
|
|
762
|
+
this.valueElement.ariaActiveDescendantElement = element;
|
|
763
|
+
}
|
|
764
|
+
catch (_b) {
|
|
765
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-activedescendant', element.id);
|
|
766
|
+
}
|
|
767
|
+
_scrollIntoView(element, this.listboxElement);
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
focusPrevOption(currentElement = this.focusedOption || this.selectedElement) {
|
|
771
|
+
if (this.optionElements === null)
|
|
772
|
+
return;
|
|
773
|
+
const currentIndex = this.optionElementsArray.indexOf(currentElement);
|
|
774
|
+
const prevIndex = currentIndex - 1;
|
|
775
|
+
const isPrevIndex = prevIndex >= 0;
|
|
776
|
+
const prevElement = isPrevIndex ? this.optionElements[prevIndex] : this.optionElements[this.optionElements.length - 1];
|
|
777
|
+
this.setOptionFocus(prevElement);
|
|
778
|
+
}
|
|
779
|
+
focusNextOption(currentElement = this.focusedOption || this.selectedElement) {
|
|
780
|
+
if (this.optionElements === null)
|
|
781
|
+
return;
|
|
782
|
+
const currentIndex = this.optionElementsArray.indexOf(currentElement);
|
|
783
|
+
const nextIndex = currentIndex + 1;
|
|
784
|
+
const lastIndex = this.optionElements.length - 1;
|
|
785
|
+
const isNextIndex = nextIndex <= lastIndex;
|
|
786
|
+
const nextElement = isNextIndex ? this.optionElements[nextIndex] : this.optionElements[0];
|
|
787
|
+
this.setOptionFocus(nextElement);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Return option elements whose label starts with the filter text (case-insensitive).
|
|
791
|
+
*/
|
|
792
|
+
filterOptions(options, filter) {
|
|
793
|
+
if (!filter)
|
|
794
|
+
return [];
|
|
795
|
+
const f = filter.toLowerCase();
|
|
796
|
+
return options.filter(o => !o.disabled &&
|
|
797
|
+
(o.textContent || '').trim().toLowerCase().startsWith(f));
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Return the index (within the provided array) of an option matching the filter.
|
|
801
|
+
* If the filter is multiple iterations of the same letter (e.g. 'aaa'), cycle through
|
|
802
|
+
* first-letter matches starting from startIndex.
|
|
803
|
+
* Returns -1 if no match.
|
|
804
|
+
*/
|
|
805
|
+
getIndexByLetter(options, filter, startIndex = 0) {
|
|
806
|
+
if (!options.length || !filter)
|
|
807
|
+
return -1;
|
|
808
|
+
const ordered = [...options.slice(startIndex), ...options.slice(0, startIndex)];
|
|
809
|
+
const matchesFull = this
|
|
810
|
+
.filterOptions(ordered, filter)
|
|
811
|
+
.sort((a, b) => ((a.textContent || '').trim().toLowerCase())
|
|
812
|
+
.localeCompare((b.textContent || '').trim().toLowerCase()));
|
|
813
|
+
const allSame = filter.split('').every(c => c === filter[0]);
|
|
814
|
+
if (matchesFull[0]) {
|
|
815
|
+
return options.indexOf(matchesFull[0]);
|
|
816
|
+
}
|
|
817
|
+
else if (allSame) {
|
|
818
|
+
const firstLetterMatches = this.filterOptions(ordered, filter[0]);
|
|
819
|
+
if (firstLetterMatches[0]) {
|
|
820
|
+
return options.indexOf(firstLetterMatches[0]);
|
|
821
|
+
}
|
|
822
|
+
return -1;
|
|
823
|
+
}
|
|
824
|
+
return -1;
|
|
825
|
+
}
|
|
826
|
+
handleTypeahead(char) {
|
|
827
|
+
const RESET_MS = 500;
|
|
828
|
+
clearTimeout(this.typeaheadTimeout);
|
|
829
|
+
const options = this.optionElementsArray;
|
|
830
|
+
// Append character
|
|
831
|
+
this.typeaheadBuffer += char.toLowerCase();
|
|
832
|
+
const allSame = this.typeaheadBuffer.split('').every(c => c === this.typeaheadBuffer[0]);
|
|
833
|
+
// Starting point for search:
|
|
834
|
+
let startIndex;
|
|
835
|
+
if (allSame && this.lastTypeaheadIndex !== -1) {
|
|
836
|
+
// Cycle through same-letter matches
|
|
837
|
+
startIndex = (this.lastTypeaheadIndex + 1) % options.length;
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
const focusBase = (this.focusedOption || this.selectedElement);
|
|
841
|
+
const baseIndex = options.indexOf(focusBase);
|
|
842
|
+
startIndex = baseIndex === -1 ? 0 : (baseIndex + 1) % options.length;
|
|
843
|
+
}
|
|
844
|
+
const idx = this.getIndexByLetter(options, this.typeaheadBuffer, startIndex);
|
|
845
|
+
if (idx !== -1) {
|
|
846
|
+
this.lastTypeaheadIndex = idx;
|
|
847
|
+
const el = options[idx];
|
|
848
|
+
if (!this.isExpanded)
|
|
849
|
+
this.expand();
|
|
850
|
+
this.setOptionFocus(el);
|
|
851
|
+
}
|
|
852
|
+
// Reset buffer after inactivity
|
|
853
|
+
this.typeaheadTimeout = setTimeout(() => {
|
|
854
|
+
this.typeaheadBuffer = '';
|
|
855
|
+
}, RESET_MS);
|
|
856
|
+
}
|
|
857
|
+
connectFormEventListeners() {
|
|
858
|
+
if (!this.parentFormEl)
|
|
859
|
+
return;
|
|
860
|
+
this.parentFormEl.addEventListener('formdata', this.contributeToFormData);
|
|
861
|
+
this.parentFormEl.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
862
|
+
this.parentFormEl.addEventListener('reset', this.onResetForm);
|
|
863
|
+
}
|
|
864
|
+
disconnectFormEventListeners() {
|
|
865
|
+
if (!this.parentFormEl)
|
|
866
|
+
return;
|
|
867
|
+
this.parentFormEl.removeEventListener('formdata', this.contributeToFormData);
|
|
868
|
+
this.parentFormEl.removeEventListener('submit', this.onSubmitForm);
|
|
869
|
+
this.parentFormEl.removeEventListener('reset', this.onResetForm);
|
|
870
|
+
}
|
|
871
|
+
defineHostWidth() {
|
|
872
|
+
if (this.fullWidth)
|
|
873
|
+
return;
|
|
874
|
+
const nativeWidth = this.host.shadowRoot.querySelector('.r-select--native').getBoundingClientRect().width;
|
|
875
|
+
const valueWidth = (this.combobox ? this.comboboxContainerElement : this.valueElement).getBoundingClientRect().width;
|
|
876
|
+
const listWidth = this.listboxElement.getBoundingClientRect().width;
|
|
877
|
+
const structuralWidth = Math.max(nativeWidth, valueWidth, listWidth);
|
|
878
|
+
this.host.style.setProperty('--width', `${structuralWidth}px`);
|
|
879
|
+
}
|
|
880
|
+
_renderNativeOption() {
|
|
881
|
+
var _a, _b, _c, _d, _e;
|
|
882
|
+
const optionElement = document.createElement("option");
|
|
883
|
+
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));
|
|
884
|
+
optionElement.value = this.currentValue;
|
|
885
|
+
optionElement.selected = true;
|
|
886
|
+
optionElement.appendChild(optionText);
|
|
887
|
+
if (!this.nativeElement)
|
|
888
|
+
return;
|
|
889
|
+
this.nativeElement.innerHTML = '';
|
|
890
|
+
(_d = this.nativeElement) === null || _d === void 0 ? void 0 : _d.appendChild(optionElement);
|
|
891
|
+
this.nativeElement.value = this.currentValue;
|
|
892
|
+
(_e = this.nativeElement) === null || _e === void 0 ? void 0 : _e.setAttribute('value', this.currentValue);
|
|
893
|
+
}
|
|
894
|
+
notVisible(element) {
|
|
895
|
+
return getComputedStyle(element).overflow !== "visible";
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Finds first element's parent with not visible overflow.
|
|
899
|
+
* @param element -- parent element
|
|
900
|
+
* @param initEl -- initial(child) element
|
|
901
|
+
*/
|
|
902
|
+
findOverflowParent(element) {
|
|
903
|
+
var _a, _b;
|
|
904
|
+
if (((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.DOCUMENT_FRAGMENT_NODE) {
|
|
905
|
+
return this.findOverflowParent((_b = element.parentNode) === null || _b === void 0 ? void 0 : _b.host);
|
|
906
|
+
}
|
|
907
|
+
if (this.notVisible(element)) {
|
|
908
|
+
return element;
|
|
909
|
+
}
|
|
910
|
+
if (element.parentElement) {
|
|
911
|
+
return this.findOverflowParent(element.parentElement);
|
|
912
|
+
}
|
|
913
|
+
return null;
|
|
914
|
+
}
|
|
915
|
+
get ariaDescribedBy() {
|
|
916
|
+
const describedBy = `${this.uniqueId}-message`;
|
|
917
|
+
return this.hint ? `${this.uniqueId}-hint ${describedBy}` : describedBy;
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Parent with non visible overflow
|
|
921
|
+
*/
|
|
922
|
+
get overflowedParent() {
|
|
923
|
+
return this.findOverflowParent(this.host.parentElement);
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Available space at the top
|
|
927
|
+
*/
|
|
928
|
+
get top() {
|
|
929
|
+
var _a, _b;
|
|
930
|
+
return (!this.overflowedParent ?
|
|
931
|
+
(_a = this.valueElement) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top :
|
|
932
|
+
Math.abs(this.overflowedParent.getBoundingClientRect().top - ((_b = this.valueElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().top)));
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Available space at the bottom
|
|
936
|
+
*/
|
|
937
|
+
get bottom() {
|
|
938
|
+
var _a;
|
|
939
|
+
function calculateBottomSpace(element) {
|
|
940
|
+
return window.innerHeight - element.getBoundingClientRect().top - element.getBoundingClientRect().height;
|
|
941
|
+
}
|
|
942
|
+
const styles = window.getComputedStyle(this.messageContainer);
|
|
943
|
+
const messageContainerHeight = ((_a = this.messageContainer) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) + parseFloat(styles['marginTop']);
|
|
944
|
+
const calculatedHostBottomSpace = calculateBottomSpace(this.host) + messageContainerHeight;
|
|
945
|
+
return !this.overflowedParent ? calculatedHostBottomSpace + messageContainerHeight : Math.abs(calculateBottomSpace(this.overflowedParent) - calculatedHostBottomSpace);
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Set correct tooltip position.
|
|
949
|
+
* First it checks the available space for a defined position and then sets the new one based on the available space.
|
|
950
|
+
*/
|
|
951
|
+
defineListboxPositionState() {
|
|
952
|
+
var _a, _b;
|
|
953
|
+
const isBottomSpace = ((_a = this.listboxElement) === null || _a === void 0 ? void 0 : _a.offsetHeight) < this.bottom;
|
|
954
|
+
const isTopSpace = ((_b = this.listboxElement) === null || _b === void 0 ? void 0 : _b.offsetHeight) < this.top;
|
|
955
|
+
const isTop = this.listboxPosition === 'top';
|
|
956
|
+
const isBottom = this.listboxPosition === 'bottom';
|
|
957
|
+
/** Don't change the position if there is sufficient space for the listbox
|
|
958
|
+
* or insufficient space for another position.
|
|
959
|
+
* */
|
|
960
|
+
if ((isTop && (isTopSpace || !isBottomSpace)) || (isBottom && (isBottomSpace || !isTopSpace))) {
|
|
961
|
+
this.listboxPositionState = this.listboxPosition;
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
switch (this.listboxPosition) {
|
|
965
|
+
case 'top':
|
|
966
|
+
this.listboxPositionState = !isTopSpace ? 'bottom' : 'top';
|
|
967
|
+
break;
|
|
968
|
+
case 'bottom':
|
|
969
|
+
this.listboxPositionState = !isBottomSpace ? 'top' : 'bottom';
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
initialize() {
|
|
974
|
+
var _a;
|
|
975
|
+
const currentValue = this.value || '';
|
|
976
|
+
this.initial['value'] = this.value || '';
|
|
977
|
+
this.initial['invalid'] = this.invalid || false;
|
|
978
|
+
this.listboxPositionState = this.listboxPosition;
|
|
979
|
+
// Search for the option to select
|
|
980
|
+
const elementToSelect = this.optionElementsArray.find((el) => el.value.trim() === currentValue);
|
|
981
|
+
// Select the matching element if found
|
|
982
|
+
if (elementToSelect) {
|
|
983
|
+
this.isInitializing = true;
|
|
984
|
+
this.setValue(currentValue);
|
|
985
|
+
this.isInitializing = false;
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
if (this.placeholder)
|
|
989
|
+
return;
|
|
990
|
+
if (this.combobox)
|
|
991
|
+
return;
|
|
992
|
+
const firstOption = (_a = this.optionElements) === null || _a === void 0 ? void 0 : _a[0];
|
|
993
|
+
if (firstOption) {
|
|
994
|
+
this.isInitializing = true;
|
|
995
|
+
this.setValue(firstOption === null || firstOption === void 0 ? void 0 : firstOption.value);
|
|
996
|
+
this.isInitializing = false;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
initializeStyleObserver() {
|
|
1000
|
+
if (this.listboxWidthObserver || !this.listboxElement)
|
|
1001
|
+
return;
|
|
1002
|
+
const observerCallback = () => {
|
|
1003
|
+
if (!this.listboxElement)
|
|
1004
|
+
return;
|
|
1005
|
+
// Only recompute if listbox grew beyond current host width
|
|
1006
|
+
const listboxWidth = this.listboxElement.getBoundingClientRect().width;
|
|
1007
|
+
const hostWidth = this.host.getBoundingClientRect().width;
|
|
1008
|
+
if (listboxWidth <= hostWidth)
|
|
1009
|
+
return;
|
|
1010
|
+
this.defineHostWidth();
|
|
1011
|
+
};
|
|
1012
|
+
this.listboxWidthObserver = new StyleObserver(observerCallback);
|
|
1013
|
+
this.listboxWidthObserver
|
|
1014
|
+
.observe([this.listboxElement], ['width']);
|
|
1015
|
+
}
|
|
1016
|
+
get hasError() {
|
|
1017
|
+
var _a;
|
|
1018
|
+
return this.invalid && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1019
|
+
}
|
|
1020
|
+
get hasValidationError() {
|
|
1021
|
+
if (!this.validityState)
|
|
1022
|
+
return false;
|
|
1023
|
+
return this.validityState !== 'valid' && !!(this.validityMessage || this.customErrorMessage);
|
|
1024
|
+
}
|
|
1025
|
+
get hasMessage() {
|
|
1026
|
+
return this.hasError || this.hasValidationError;
|
|
1027
|
+
}
|
|
1028
|
+
get isInteractive() {
|
|
1029
|
+
return !this.disabled && !this.isReadonly;
|
|
1030
|
+
}
|
|
1031
|
+
get hasLeadingSlot() {
|
|
1032
|
+
return !!this.host.querySelector('[slot="leading"]');
|
|
1033
|
+
}
|
|
1034
|
+
get hasOptionIcon() {
|
|
1035
|
+
return !!this.optionElementsArray.find(el => !!el.querySelector('[slot="icon"]'));
|
|
1036
|
+
}
|
|
1037
|
+
get isLeadingSlotRendered() {
|
|
1038
|
+
return this.hasLeadingSlot && this.hasOptionIcon && !this.currentValue;
|
|
1039
|
+
}
|
|
1040
|
+
get isPlaceholder() {
|
|
1041
|
+
var _a, _b;
|
|
1042
|
+
const { placeholder } = this;
|
|
1043
|
+
return (((_b = (_a = this.valueToDisplay) === null || _a === void 0 ? void 0 : _a.trim) === null || _b === void 0 ? void 0 : _b.call(_a)) || placeholder || '') === placeholder;
|
|
1044
|
+
}
|
|
1045
|
+
connectedCallback() {
|
|
1046
|
+
this.connectFormEventListeners();
|
|
1047
|
+
}
|
|
1048
|
+
disconnectedCallback() {
|
|
1049
|
+
this.disconnectFormEventListeners();
|
|
1050
|
+
}
|
|
1051
|
+
componentWillLoad() {
|
|
1052
|
+
this.isExpanded = this.expanded;
|
|
1053
|
+
this.isReadonly = this.readonly;
|
|
1054
|
+
}
|
|
1055
|
+
componentDidLoad() {
|
|
1056
|
+
this.defineListboxPositionState();
|
|
1057
|
+
this.initializeStyleObserver();
|
|
1058
|
+
}
|
|
1059
|
+
render() {
|
|
1060
|
+
var _a;
|
|
1061
|
+
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal } = this;
|
|
1062
|
+
const labelAttr = label ? {
|
|
1063
|
+
fieldIndicator
|
|
1064
|
+
} : {};
|
|
1065
|
+
const isRequired = this.isInteractive ? !!required : false;
|
|
1066
|
+
const comboboxAttrs = {
|
|
1067
|
+
id: `${uniqueId}-value`,
|
|
1068
|
+
tabindex: `${disabled ? -1 : 0}`,
|
|
1069
|
+
'aria-controls': `${uniqueId}-list`,
|
|
1070
|
+
'aria-describedby': this.ariaDescribedBy,
|
|
1071
|
+
'aria-disabled': `${disabled || false}`,
|
|
1072
|
+
'aria-expanded': `${isExpanded || false}`,
|
|
1073
|
+
'aria-invalid': `${invalid || false}`,
|
|
1074
|
+
'aria-readonly': `${!this.isInteractive || false}`,
|
|
1075
|
+
'aria-required': `${isRequired}`,
|
|
1076
|
+
'aria-labelledby': `${uniqueId}-label`
|
|
1077
|
+
};
|
|
1078
|
+
const listboxAttrs = {
|
|
1079
|
+
'aria-label': label
|
|
1080
|
+
};
|
|
1081
|
+
const nativeAttrs = {
|
|
1082
|
+
placeholder,
|
|
1083
|
+
name: this.name,
|
|
1084
|
+
value: this.currentValue,
|
|
1085
|
+
'aria-hidden': 'true',
|
|
1086
|
+
tabindex: '-1',
|
|
1087
|
+
invalid,
|
|
1088
|
+
disabled,
|
|
1089
|
+
required: isRequired
|
|
1090
|
+
};
|
|
1091
|
+
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 &&
|
|
1092
|
+
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)))));
|
|
1093
|
+
}
|
|
1094
|
+
static get is() { return "r-select"; }
|
|
1095
|
+
static get encapsulation() { return "shadow"; }
|
|
1096
|
+
static get originalStyleUrls() {
|
|
1097
|
+
return {
|
|
1098
|
+
"$": ["select.css"]
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
static get styleUrls() {
|
|
1102
|
+
return {
|
|
1103
|
+
"$": ["select.css"]
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
static get properties() {
|
|
1107
|
+
return {
|
|
1108
|
+
"form": {
|
|
1109
|
+
"type": "string",
|
|
1110
|
+
"attribute": "form",
|
|
1111
|
+
"mutable": false,
|
|
1112
|
+
"complexType": {
|
|
1113
|
+
"original": "string",
|
|
1114
|
+
"resolved": "string",
|
|
1115
|
+
"references": {}
|
|
1116
|
+
},
|
|
1117
|
+
"required": false,
|
|
1118
|
+
"optional": true,
|
|
1119
|
+
"docs": {
|
|
1120
|
+
"tags": [],
|
|
1121
|
+
"text": "Specifies the `id` of the `<form>` to which the element belongs"
|
|
1122
|
+
},
|
|
1123
|
+
"getter": false,
|
|
1124
|
+
"setter": false,
|
|
1125
|
+
"reflect": true
|
|
1126
|
+
},
|
|
1127
|
+
"novalidate": {
|
|
1128
|
+
"type": "boolean",
|
|
1129
|
+
"attribute": "novalidate",
|
|
1130
|
+
"mutable": false,
|
|
1131
|
+
"complexType": {
|
|
1132
|
+
"original": "boolean",
|
|
1133
|
+
"resolved": "boolean",
|
|
1134
|
+
"references": {}
|
|
1135
|
+
},
|
|
1136
|
+
"required": false,
|
|
1137
|
+
"optional": true,
|
|
1138
|
+
"docs": {
|
|
1139
|
+
"tags": [],
|
|
1140
|
+
"text": "Specifies if element must be ignored during validation of the form elements"
|
|
1141
|
+
},
|
|
1142
|
+
"getter": false,
|
|
1143
|
+
"setter": false,
|
|
1144
|
+
"reflect": false
|
|
1145
|
+
},
|
|
1146
|
+
"name": {
|
|
1147
|
+
"type": "string",
|
|
1148
|
+
"attribute": "name",
|
|
1149
|
+
"mutable": false,
|
|
1150
|
+
"complexType": {
|
|
1151
|
+
"original": "string",
|
|
1152
|
+
"resolved": "string",
|
|
1153
|
+
"references": {}
|
|
1154
|
+
},
|
|
1155
|
+
"required": false,
|
|
1156
|
+
"optional": true,
|
|
1157
|
+
"docs": {
|
|
1158
|
+
"tags": [],
|
|
1159
|
+
"text": "Name of element (data) within a form"
|
|
1160
|
+
},
|
|
1161
|
+
"getter": false,
|
|
1162
|
+
"setter": false,
|
|
1163
|
+
"reflect": true
|
|
1164
|
+
},
|
|
1165
|
+
"value": {
|
|
1166
|
+
"type": "string",
|
|
1167
|
+
"attribute": "value",
|
|
1168
|
+
"mutable": false,
|
|
1169
|
+
"complexType": {
|
|
1170
|
+
"original": "string",
|
|
1171
|
+
"resolved": "string",
|
|
1172
|
+
"references": {}
|
|
1173
|
+
},
|
|
1174
|
+
"required": false,
|
|
1175
|
+
"optional": true,
|
|
1176
|
+
"docs": {
|
|
1177
|
+
"tags": [],
|
|
1178
|
+
"text": "Selected value"
|
|
1179
|
+
},
|
|
1180
|
+
"getter": false,
|
|
1181
|
+
"setter": false,
|
|
1182
|
+
"reflect": true
|
|
1183
|
+
},
|
|
1184
|
+
"label": {
|
|
1185
|
+
"type": "string",
|
|
1186
|
+
"attribute": "label",
|
|
1187
|
+
"mutable": false,
|
|
1188
|
+
"complexType": {
|
|
1189
|
+
"original": "string",
|
|
1190
|
+
"resolved": "string",
|
|
1191
|
+
"references": {}
|
|
1192
|
+
},
|
|
1193
|
+
"required": true,
|
|
1194
|
+
"optional": false,
|
|
1195
|
+
"docs": {
|
|
1196
|
+
"tags": [],
|
|
1197
|
+
"text": "The text on the label"
|
|
1198
|
+
},
|
|
1199
|
+
"getter": false,
|
|
1200
|
+
"setter": false,
|
|
1201
|
+
"reflect": true
|
|
1202
|
+
},
|
|
1203
|
+
"internal": {
|
|
1204
|
+
"type": "boolean",
|
|
1205
|
+
"attribute": "internal",
|
|
1206
|
+
"mutable": false,
|
|
1207
|
+
"complexType": {
|
|
1208
|
+
"original": "boolean",
|
|
1209
|
+
"resolved": "boolean",
|
|
1210
|
+
"references": {}
|
|
1211
|
+
},
|
|
1212
|
+
"required": false,
|
|
1213
|
+
"optional": true,
|
|
1214
|
+
"docs": {
|
|
1215
|
+
"tags": [],
|
|
1216
|
+
"text": "Specifies if the component is internal"
|
|
1217
|
+
},
|
|
1218
|
+
"getter": false,
|
|
1219
|
+
"setter": false,
|
|
1220
|
+
"reflect": true
|
|
1221
|
+
},
|
|
1222
|
+
"placeholder": {
|
|
1223
|
+
"type": "string",
|
|
1224
|
+
"attribute": "placeholder",
|
|
1225
|
+
"mutable": false,
|
|
1226
|
+
"complexType": {
|
|
1227
|
+
"original": "string",
|
|
1228
|
+
"resolved": "string",
|
|
1229
|
+
"references": {}
|
|
1230
|
+
},
|
|
1231
|
+
"required": false,
|
|
1232
|
+
"optional": true,
|
|
1233
|
+
"docs": {
|
|
1234
|
+
"tags": [],
|
|
1235
|
+
"text": "Text that is presented until an option has been selected"
|
|
1236
|
+
},
|
|
1237
|
+
"getter": false,
|
|
1238
|
+
"setter": false,
|
|
1239
|
+
"reflect": true
|
|
1240
|
+
},
|
|
1241
|
+
"hint": {
|
|
1242
|
+
"type": "string",
|
|
1243
|
+
"attribute": "hint",
|
|
1244
|
+
"mutable": false,
|
|
1245
|
+
"complexType": {
|
|
1246
|
+
"original": "string",
|
|
1247
|
+
"resolved": "string",
|
|
1248
|
+
"references": {}
|
|
1249
|
+
},
|
|
1250
|
+
"required": false,
|
|
1251
|
+
"optional": true,
|
|
1252
|
+
"docs": {
|
|
1253
|
+
"tags": [],
|
|
1254
|
+
"text": "Optional hint, visually presented under the select,\ngiving additional context to the user"
|
|
1255
|
+
},
|
|
1256
|
+
"getter": false,
|
|
1257
|
+
"setter": false,
|
|
1258
|
+
"reflect": true
|
|
1259
|
+
},
|
|
1260
|
+
"disabled": {
|
|
1261
|
+
"type": "boolean",
|
|
1262
|
+
"attribute": "disabled",
|
|
1263
|
+
"mutable": false,
|
|
1264
|
+
"complexType": {
|
|
1265
|
+
"original": "boolean",
|
|
1266
|
+
"resolved": "boolean",
|
|
1267
|
+
"references": {}
|
|
1268
|
+
},
|
|
1269
|
+
"required": false,
|
|
1270
|
+
"optional": true,
|
|
1271
|
+
"docs": {
|
|
1272
|
+
"tags": [],
|
|
1273
|
+
"text": "Prevent user interaction and apply disabled style"
|
|
1274
|
+
},
|
|
1275
|
+
"getter": false,
|
|
1276
|
+
"setter": false,
|
|
1277
|
+
"reflect": true
|
|
1278
|
+
},
|
|
1279
|
+
"required": {
|
|
1280
|
+
"type": "boolean",
|
|
1281
|
+
"attribute": "required",
|
|
1282
|
+
"mutable": false,
|
|
1283
|
+
"complexType": {
|
|
1284
|
+
"original": "boolean",
|
|
1285
|
+
"resolved": "boolean",
|
|
1286
|
+
"references": {}
|
|
1287
|
+
},
|
|
1288
|
+
"required": false,
|
|
1289
|
+
"optional": true,
|
|
1290
|
+
"docs": {
|
|
1291
|
+
"tags": [],
|
|
1292
|
+
"text": "Specifies that select value is required"
|
|
1293
|
+
},
|
|
1294
|
+
"getter": false,
|
|
1295
|
+
"setter": false,
|
|
1296
|
+
"reflect": true
|
|
1297
|
+
},
|
|
1298
|
+
"fieldIndicator": {
|
|
1299
|
+
"type": "string",
|
|
1300
|
+
"attribute": "field-indicator",
|
|
1301
|
+
"mutable": false,
|
|
1302
|
+
"complexType": {
|
|
1303
|
+
"original": "string",
|
|
1304
|
+
"resolved": "string",
|
|
1305
|
+
"references": {}
|
|
1306
|
+
},
|
|
1307
|
+
"required": false,
|
|
1308
|
+
"optional": true,
|
|
1309
|
+
"docs": {
|
|
1310
|
+
"tags": [],
|
|
1311
|
+
"text": "Text of an additional marker in the label"
|
|
1312
|
+
},
|
|
1313
|
+
"getter": false,
|
|
1314
|
+
"setter": false,
|
|
1315
|
+
"reflect": true
|
|
1316
|
+
},
|
|
1317
|
+
"valid": {
|
|
1318
|
+
"type": "boolean",
|
|
1319
|
+
"attribute": "valid",
|
|
1320
|
+
"mutable": true,
|
|
1321
|
+
"complexType": {
|
|
1322
|
+
"original": "boolean",
|
|
1323
|
+
"resolved": "boolean",
|
|
1324
|
+
"references": {}
|
|
1325
|
+
},
|
|
1326
|
+
"required": false,
|
|
1327
|
+
"optional": true,
|
|
1328
|
+
"docs": {
|
|
1329
|
+
"tags": [],
|
|
1330
|
+
"text": "Visual indication of valid state"
|
|
1331
|
+
},
|
|
1332
|
+
"getter": false,
|
|
1333
|
+
"setter": false,
|
|
1334
|
+
"reflect": true
|
|
1335
|
+
},
|
|
1336
|
+
"invalid": {
|
|
1337
|
+
"type": "boolean",
|
|
1338
|
+
"attribute": "invalid",
|
|
1339
|
+
"mutable": true,
|
|
1340
|
+
"complexType": {
|
|
1341
|
+
"original": "boolean",
|
|
1342
|
+
"resolved": "boolean",
|
|
1343
|
+
"references": {}
|
|
1344
|
+
},
|
|
1345
|
+
"required": false,
|
|
1346
|
+
"optional": true,
|
|
1347
|
+
"docs": {
|
|
1348
|
+
"tags": [],
|
|
1349
|
+
"text": "Validity indicator, serving to change UI of the component"
|
|
1350
|
+
},
|
|
1351
|
+
"getter": false,
|
|
1352
|
+
"setter": false,
|
|
1353
|
+
"reflect": true
|
|
1354
|
+
},
|
|
1355
|
+
"error": {
|
|
1356
|
+
"type": "string",
|
|
1357
|
+
"attribute": "error",
|
|
1358
|
+
"mutable": false,
|
|
1359
|
+
"complexType": {
|
|
1360
|
+
"original": "string",
|
|
1361
|
+
"resolved": "string",
|
|
1362
|
+
"references": {}
|
|
1363
|
+
},
|
|
1364
|
+
"required": false,
|
|
1365
|
+
"optional": true,
|
|
1366
|
+
"docs": {
|
|
1367
|
+
"tags": [],
|
|
1368
|
+
"text": "Custom validation error message"
|
|
1369
|
+
},
|
|
1370
|
+
"getter": false,
|
|
1371
|
+
"setter": false,
|
|
1372
|
+
"reflect": true
|
|
1373
|
+
},
|
|
1374
|
+
"fullWidth": {
|
|
1375
|
+
"type": "boolean",
|
|
1376
|
+
"attribute": "full-width",
|
|
1377
|
+
"mutable": false,
|
|
1378
|
+
"complexType": {
|
|
1379
|
+
"original": "boolean",
|
|
1380
|
+
"resolved": "boolean",
|
|
1381
|
+
"references": {}
|
|
1382
|
+
},
|
|
1383
|
+
"required": false,
|
|
1384
|
+
"optional": false,
|
|
1385
|
+
"docs": {
|
|
1386
|
+
"tags": [],
|
|
1387
|
+
"text": "Define if select should render as a text item or a block"
|
|
1388
|
+
},
|
|
1389
|
+
"getter": false,
|
|
1390
|
+
"setter": false,
|
|
1391
|
+
"reflect": true,
|
|
1392
|
+
"defaultValue": "false"
|
|
1393
|
+
},
|
|
1394
|
+
"listboxPosition": {
|
|
1395
|
+
"type": "string",
|
|
1396
|
+
"attribute": "listbox-position",
|
|
1397
|
+
"mutable": false,
|
|
1398
|
+
"complexType": {
|
|
1399
|
+
"original": "ListboxPosition",
|
|
1400
|
+
"resolved": "\"bottom\" | \"top\"",
|
|
1401
|
+
"references": {
|
|
1402
|
+
"ListboxPosition": {
|
|
1403
|
+
"location": "import",
|
|
1404
|
+
"path": "./exports",
|
|
1405
|
+
"id": "src/components/select/exports.ts::ListboxPosition"
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
"required": false,
|
|
1410
|
+
"optional": false,
|
|
1411
|
+
"docs": {
|
|
1412
|
+
"tags": [],
|
|
1413
|
+
"text": "Define wether listbox appears on top or at the bottom of the select"
|
|
1414
|
+
},
|
|
1415
|
+
"getter": false,
|
|
1416
|
+
"setter": false,
|
|
1417
|
+
"reflect": false,
|
|
1418
|
+
"defaultValue": "'bottom'"
|
|
1419
|
+
},
|
|
1420
|
+
"valueMissingMessage": {
|
|
1421
|
+
"type": "string",
|
|
1422
|
+
"attribute": "value-missing-message",
|
|
1423
|
+
"mutable": false,
|
|
1424
|
+
"complexType": {
|
|
1425
|
+
"original": "string",
|
|
1426
|
+
"resolved": "string",
|
|
1427
|
+
"references": {}
|
|
1428
|
+
},
|
|
1429
|
+
"required": false,
|
|
1430
|
+
"optional": true,
|
|
1431
|
+
"docs": {
|
|
1432
|
+
"tags": [],
|
|
1433
|
+
"text": "Set custom message for `valueMissing` property of a ValidityState object (set by `required`) within Constrain Validation API"
|
|
1434
|
+
},
|
|
1435
|
+
"getter": false,
|
|
1436
|
+
"setter": false,
|
|
1437
|
+
"reflect": true
|
|
1438
|
+
},
|
|
1439
|
+
"customErrorMessage": {
|
|
1440
|
+
"type": "string",
|
|
1441
|
+
"attribute": "custom-error-message",
|
|
1442
|
+
"mutable": false,
|
|
1443
|
+
"complexType": {
|
|
1444
|
+
"original": "string",
|
|
1445
|
+
"resolved": "string",
|
|
1446
|
+
"references": {}
|
|
1447
|
+
},
|
|
1448
|
+
"required": false,
|
|
1449
|
+
"optional": true,
|
|
1450
|
+
"docs": {
|
|
1451
|
+
"tags": [],
|
|
1452
|
+
"text": "Set custom message for `customError` property of a ValidityState object indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setCustomValidity() method."
|
|
1453
|
+
},
|
|
1454
|
+
"getter": false,
|
|
1455
|
+
"setter": false,
|
|
1456
|
+
"reflect": true
|
|
1457
|
+
},
|
|
1458
|
+
"expanded": {
|
|
1459
|
+
"type": "boolean",
|
|
1460
|
+
"attribute": "expanded",
|
|
1461
|
+
"mutable": false,
|
|
1462
|
+
"complexType": {
|
|
1463
|
+
"original": "boolean",
|
|
1464
|
+
"resolved": "boolean",
|
|
1465
|
+
"references": {}
|
|
1466
|
+
},
|
|
1467
|
+
"required": false,
|
|
1468
|
+
"optional": true,
|
|
1469
|
+
"docs": {
|
|
1470
|
+
"tags": [],
|
|
1471
|
+
"text": "Defines if select is expanded"
|
|
1472
|
+
},
|
|
1473
|
+
"getter": false,
|
|
1474
|
+
"setter": false,
|
|
1475
|
+
"reflect": false
|
|
1476
|
+
},
|
|
1477
|
+
"readonly": {
|
|
1478
|
+
"type": "boolean",
|
|
1479
|
+
"attribute": "readonly",
|
|
1480
|
+
"mutable": false,
|
|
1481
|
+
"complexType": {
|
|
1482
|
+
"original": "boolean",
|
|
1483
|
+
"resolved": "boolean",
|
|
1484
|
+
"references": {}
|
|
1485
|
+
},
|
|
1486
|
+
"required": false,
|
|
1487
|
+
"optional": true,
|
|
1488
|
+
"docs": {
|
|
1489
|
+
"tags": [],
|
|
1490
|
+
"text": "Defines if select is in readonly state"
|
|
1491
|
+
},
|
|
1492
|
+
"getter": false,
|
|
1493
|
+
"setter": false,
|
|
1494
|
+
"reflect": true
|
|
1495
|
+
},
|
|
1496
|
+
"combobox": {
|
|
1497
|
+
"type": "boolean",
|
|
1498
|
+
"attribute": "combobox",
|
|
1499
|
+
"mutable": false,
|
|
1500
|
+
"complexType": {
|
|
1501
|
+
"original": "boolean",
|
|
1502
|
+
"resolved": "boolean",
|
|
1503
|
+
"references": {}
|
|
1504
|
+
},
|
|
1505
|
+
"required": false,
|
|
1506
|
+
"optional": true,
|
|
1507
|
+
"docs": {
|
|
1508
|
+
"tags": [],
|
|
1509
|
+
"text": "Enable combobox functionality to allow users to reduce the list of options by filtering."
|
|
1510
|
+
},
|
|
1511
|
+
"getter": false,
|
|
1512
|
+
"setter": false,
|
|
1513
|
+
"reflect": true
|
|
1514
|
+
},
|
|
1515
|
+
"toggleButtonAriaLabel": {
|
|
1516
|
+
"type": "string",
|
|
1517
|
+
"attribute": "toggle-button-aria-label",
|
|
1518
|
+
"mutable": false,
|
|
1519
|
+
"complexType": {
|
|
1520
|
+
"original": "string",
|
|
1521
|
+
"resolved": "string",
|
|
1522
|
+
"references": {}
|
|
1523
|
+
},
|
|
1524
|
+
"required": false,
|
|
1525
|
+
"optional": true,
|
|
1526
|
+
"docs": {
|
|
1527
|
+
"tags": [{
|
|
1528
|
+
"name": "default",
|
|
1529
|
+
"text": "\"Toggle combobox\""
|
|
1530
|
+
}],
|
|
1531
|
+
"text": "Defines aria label for combobox toggle button"
|
|
1532
|
+
},
|
|
1533
|
+
"getter": false,
|
|
1534
|
+
"setter": false,
|
|
1535
|
+
"reflect": false,
|
|
1536
|
+
"defaultValue": "'Toggle combobox'"
|
|
1537
|
+
},
|
|
1538
|
+
"noResultsFound": {
|
|
1539
|
+
"type": "string",
|
|
1540
|
+
"attribute": "no-results-found",
|
|
1541
|
+
"mutable": false,
|
|
1542
|
+
"complexType": {
|
|
1543
|
+
"original": "string",
|
|
1544
|
+
"resolved": "string",
|
|
1545
|
+
"references": {}
|
|
1546
|
+
},
|
|
1547
|
+
"required": false,
|
|
1548
|
+
"optional": true,
|
|
1549
|
+
"docs": {
|
|
1550
|
+
"tags": [{
|
|
1551
|
+
"name": "default",
|
|
1552
|
+
"text": "\"No results found\""
|
|
1553
|
+
}],
|
|
1554
|
+
"text": "Defines the text that will be displayed if no results are found"
|
|
1555
|
+
},
|
|
1556
|
+
"getter": false,
|
|
1557
|
+
"setter": false,
|
|
1558
|
+
"reflect": false,
|
|
1559
|
+
"defaultValue": "'No results found'"
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
static get states() {
|
|
1564
|
+
return {
|
|
1565
|
+
"listboxPositionState": {},
|
|
1566
|
+
"validityState": {},
|
|
1567
|
+
"validityMessage": {},
|
|
1568
|
+
"isExpanded": {},
|
|
1569
|
+
"isReadonly": {},
|
|
1570
|
+
"currentValue": {},
|
|
1571
|
+
"valueToDisplay": {},
|
|
1572
|
+
"isInitializing": {},
|
|
1573
|
+
"isResetting": {},
|
|
1574
|
+
"focusedOption": {},
|
|
1575
|
+
"isValueFocused": {},
|
|
1576
|
+
"isNoResultsFound": {},
|
|
1577
|
+
"touched": {},
|
|
1578
|
+
"dirty": {}
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
static get events() {
|
|
1582
|
+
return [{
|
|
1583
|
+
"method": "rValidate",
|
|
1584
|
+
"name": "rValidate",
|
|
1585
|
+
"bubbles": true,
|
|
1586
|
+
"cancelable": true,
|
|
1587
|
+
"composed": true,
|
|
1588
|
+
"docs": {
|
|
1589
|
+
"tags": [],
|
|
1590
|
+
"text": "Emits event after each validation"
|
|
1591
|
+
},
|
|
1592
|
+
"complexType": {
|
|
1593
|
+
"original": "{\n state: string,\n message: string\n }",
|
|
1594
|
+
"resolved": "{ state: string; message: string; }",
|
|
1595
|
+
"references": {}
|
|
1596
|
+
}
|
|
1597
|
+
}, {
|
|
1598
|
+
"method": "rChange",
|
|
1599
|
+
"name": "rChange",
|
|
1600
|
+
"bubbles": true,
|
|
1601
|
+
"cancelable": true,
|
|
1602
|
+
"composed": true,
|
|
1603
|
+
"docs": {
|
|
1604
|
+
"tags": [],
|
|
1605
|
+
"text": "Emits `rChange` event when `<r-select>` value property changes"
|
|
1606
|
+
},
|
|
1607
|
+
"complexType": {
|
|
1608
|
+
"original": "{\n element: HTMLRSelectElement,\n value: any\n }",
|
|
1609
|
+
"resolved": "{ element: HTMLRSelectElement; value: any; }",
|
|
1610
|
+
"references": {
|
|
1611
|
+
"HTMLRSelectElement": {
|
|
1612
|
+
"location": "global",
|
|
1613
|
+
"id": "global::HTMLRSelectElement"
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
}, {
|
|
1618
|
+
"method": "rReset",
|
|
1619
|
+
"name": "rReset",
|
|
1620
|
+
"bubbles": true,
|
|
1621
|
+
"cancelable": true,
|
|
1622
|
+
"composed": true,
|
|
1623
|
+
"docs": {
|
|
1624
|
+
"tags": [],
|
|
1625
|
+
"text": "Emits `rReset` event when `<r-select>` onReset event happens"
|
|
1626
|
+
},
|
|
1627
|
+
"complexType": {
|
|
1628
|
+
"original": "{\n element: HTMLRSelectElement,\n value: any\n }",
|
|
1629
|
+
"resolved": "{ element: HTMLRSelectElement; value: any; }",
|
|
1630
|
+
"references": {
|
|
1631
|
+
"HTMLRSelectElement": {
|
|
1632
|
+
"location": "global",
|
|
1633
|
+
"id": "global::HTMLRSelectElement"
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
}];
|
|
1638
|
+
}
|
|
1639
|
+
static get methods() {
|
|
1640
|
+
return {
|
|
1641
|
+
"setReadonly": {
|
|
1642
|
+
"complexType": {
|
|
1643
|
+
"signature": "() => Promise<void>",
|
|
1644
|
+
"parameters": [],
|
|
1645
|
+
"references": {
|
|
1646
|
+
"Promise": {
|
|
1647
|
+
"location": "global",
|
|
1648
|
+
"id": "global::Promise"
|
|
1649
|
+
}
|
|
1650
|
+
},
|
|
1651
|
+
"return": "Promise<void>"
|
|
1652
|
+
},
|
|
1653
|
+
"docs": {
|
|
1654
|
+
"text": "Sets the component into `readonly` state",
|
|
1655
|
+
"tags": []
|
|
1656
|
+
}
|
|
1657
|
+
},
|
|
1658
|
+
"clearReadonly": {
|
|
1659
|
+
"complexType": {
|
|
1660
|
+
"signature": "() => Promise<void>",
|
|
1661
|
+
"parameters": [],
|
|
1662
|
+
"references": {
|
|
1663
|
+
"Promise": {
|
|
1664
|
+
"location": "global",
|
|
1665
|
+
"id": "global::Promise"
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
"return": "Promise<void>"
|
|
1669
|
+
},
|
|
1670
|
+
"docs": {
|
|
1671
|
+
"text": "Clears readonly state from the component",
|
|
1672
|
+
"tags": []
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
"setValue": {
|
|
1676
|
+
"complexType": {
|
|
1677
|
+
"signature": "(value?: string) => Promise<void>",
|
|
1678
|
+
"parameters": [{
|
|
1679
|
+
"name": "value",
|
|
1680
|
+
"type": "string",
|
|
1681
|
+
"docs": ""
|
|
1682
|
+
}],
|
|
1683
|
+
"references": {
|
|
1684
|
+
"Promise": {
|
|
1685
|
+
"location": "global",
|
|
1686
|
+
"id": "global::Promise"
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
"return": "Promise<void>"
|
|
1690
|
+
},
|
|
1691
|
+
"docs": {
|
|
1692
|
+
"text": "Set value of the select programmatically.\nDoes NOT mark as dirty or emit change events.\nUse this for programmatic value updates.",
|
|
1693
|
+
"tags": []
|
|
1694
|
+
}
|
|
1695
|
+
},
|
|
1696
|
+
"getValue": {
|
|
1697
|
+
"complexType": {
|
|
1698
|
+
"signature": "() => Promise<string>",
|
|
1699
|
+
"parameters": [],
|
|
1700
|
+
"references": {
|
|
1701
|
+
"Promise": {
|
|
1702
|
+
"location": "global",
|
|
1703
|
+
"id": "global::Promise"
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
"return": "Promise<string>"
|
|
1707
|
+
},
|
|
1708
|
+
"docs": {
|
|
1709
|
+
"text": "Set value of the select",
|
|
1710
|
+
"tags": []
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
"reset": {
|
|
1714
|
+
"complexType": {
|
|
1715
|
+
"signature": "() => Promise<void>",
|
|
1716
|
+
"parameters": [],
|
|
1717
|
+
"references": {
|
|
1718
|
+
"Promise": {
|
|
1719
|
+
"location": "global",
|
|
1720
|
+
"id": "global::Promise"
|
|
1721
|
+
}
|
|
1722
|
+
},
|
|
1723
|
+
"return": "Promise<void>"
|
|
1724
|
+
},
|
|
1725
|
+
"docs": {
|
|
1726
|
+
"text": "Reset select to its initial state",
|
|
1727
|
+
"tags": []
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
"resetValidation": {
|
|
1731
|
+
"complexType": {
|
|
1732
|
+
"signature": "() => Promise<void>",
|
|
1733
|
+
"parameters": [],
|
|
1734
|
+
"references": {
|
|
1735
|
+
"Promise": {
|
|
1736
|
+
"location": "global",
|
|
1737
|
+
"id": "global::Promise"
|
|
1738
|
+
}
|
|
1739
|
+
},
|
|
1740
|
+
"return": "Promise<void>"
|
|
1741
|
+
},
|
|
1742
|
+
"docs": {
|
|
1743
|
+
"text": "Clears validation results.",
|
|
1744
|
+
"tags": []
|
|
1745
|
+
}
|
|
1746
|
+
},
|
|
1747
|
+
"isTouched": {
|
|
1748
|
+
"complexType": {
|
|
1749
|
+
"signature": "() => Promise<boolean>",
|
|
1750
|
+
"parameters": [],
|
|
1751
|
+
"references": {
|
|
1752
|
+
"Promise": {
|
|
1753
|
+
"location": "global",
|
|
1754
|
+
"id": "global::Promise"
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
"return": "Promise<boolean>"
|
|
1758
|
+
},
|
|
1759
|
+
"docs": {
|
|
1760
|
+
"text": "Returns whether the select has been touched (focused/clicked by user).",
|
|
1761
|
+
"tags": [{
|
|
1762
|
+
"name": "returns",
|
|
1763
|
+
"text": "A boolean indicating whether the select has been touched."
|
|
1764
|
+
}]
|
|
1765
|
+
}
|
|
1766
|
+
},
|
|
1767
|
+
"isDirty": {
|
|
1768
|
+
"complexType": {
|
|
1769
|
+
"signature": "() => Promise<boolean>",
|
|
1770
|
+
"parameters": [],
|
|
1771
|
+
"references": {
|
|
1772
|
+
"Promise": {
|
|
1773
|
+
"location": "global",
|
|
1774
|
+
"id": "global::Promise"
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
"return": "Promise<boolean>"
|
|
1778
|
+
},
|
|
1779
|
+
"docs": {
|
|
1780
|
+
"text": "Returns whether the select value has been changed by user interaction.",
|
|
1781
|
+
"tags": [{
|
|
1782
|
+
"name": "returns",
|
|
1783
|
+
"text": "A boolean indicating whether the select is dirty."
|
|
1784
|
+
}]
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
"markAsPristine": {
|
|
1788
|
+
"complexType": {
|
|
1789
|
+
"signature": "() => Promise<void>",
|
|
1790
|
+
"parameters": [],
|
|
1791
|
+
"references": {
|
|
1792
|
+
"Promise": {
|
|
1793
|
+
"location": "global",
|
|
1794
|
+
"id": "global::Promise"
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
"return": "Promise<void>"
|
|
1798
|
+
},
|
|
1799
|
+
"docs": {
|
|
1800
|
+
"text": "Marks the select as untouched and pristine (not dirty).",
|
|
1801
|
+
"tags": []
|
|
1802
|
+
}
|
|
1803
|
+
},
|
|
1804
|
+
"setCustomValidity": {
|
|
1805
|
+
"complexType": {
|
|
1806
|
+
"signature": "(message: string) => Promise<void>",
|
|
1807
|
+
"parameters": [{
|
|
1808
|
+
"name": "message",
|
|
1809
|
+
"type": "string",
|
|
1810
|
+
"docs": ""
|
|
1811
|
+
}],
|
|
1812
|
+
"references": {
|
|
1813
|
+
"Promise": {
|
|
1814
|
+
"location": "global",
|
|
1815
|
+
"id": "global::Promise"
|
|
1816
|
+
}
|
|
1817
|
+
},
|
|
1818
|
+
"return": "Promise<void>"
|
|
1819
|
+
},
|
|
1820
|
+
"docs": {
|
|
1821
|
+
"text": "Validates an element, displays provided message in case value is invalid.",
|
|
1822
|
+
"tags": []
|
|
1823
|
+
}
|
|
1824
|
+
},
|
|
1825
|
+
"checkValidity": {
|
|
1826
|
+
"complexType": {
|
|
1827
|
+
"signature": "() => Promise<boolean>",
|
|
1828
|
+
"parameters": [],
|
|
1829
|
+
"references": {
|
|
1830
|
+
"Promise": {
|
|
1831
|
+
"location": "global",
|
|
1832
|
+
"id": "global::Promise"
|
|
1833
|
+
}
|
|
1834
|
+
},
|
|
1835
|
+
"return": "Promise<boolean>"
|
|
1836
|
+
},
|
|
1837
|
+
"docs": {
|
|
1838
|
+
"text": "Validates the textarea without triggering UI and returns a boolean indicating its validity.",
|
|
1839
|
+
"tags": [{
|
|
1840
|
+
"name": "returns",
|
|
1841
|
+
"text": "A boolean indicating whether the textarea is valid."
|
|
1842
|
+
}]
|
|
1843
|
+
}
|
|
1844
|
+
},
|
|
1845
|
+
"reportValidity": {
|
|
1846
|
+
"complexType": {
|
|
1847
|
+
"signature": "() => Promise<boolean>",
|
|
1848
|
+
"parameters": [],
|
|
1849
|
+
"references": {
|
|
1850
|
+
"Promise": {
|
|
1851
|
+
"location": "global",
|
|
1852
|
+
"id": "global::Promise"
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
"return": "Promise<boolean>"
|
|
1856
|
+
},
|
|
1857
|
+
"docs": {
|
|
1858
|
+
"text": "Check validity and reveal validation state and message",
|
|
1859
|
+
"tags": []
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
"setFocus": {
|
|
1863
|
+
"complexType": {
|
|
1864
|
+
"signature": "() => Promise<void>",
|
|
1865
|
+
"parameters": [],
|
|
1866
|
+
"references": {
|
|
1867
|
+
"Promise": {
|
|
1868
|
+
"location": "global",
|
|
1869
|
+
"id": "global::Promise"
|
|
1870
|
+
}
|
|
1871
|
+
},
|
|
1872
|
+
"return": "Promise<void>"
|
|
1873
|
+
},
|
|
1874
|
+
"docs": {
|
|
1875
|
+
"text": "Set focus on the element",
|
|
1876
|
+
"tags": []
|
|
1877
|
+
}
|
|
1878
|
+
},
|
|
1879
|
+
"setBlur": {
|
|
1880
|
+
"complexType": {
|
|
1881
|
+
"signature": "() => Promise<void>",
|
|
1882
|
+
"parameters": [],
|
|
1883
|
+
"references": {
|
|
1884
|
+
"Promise": {
|
|
1885
|
+
"location": "global",
|
|
1886
|
+
"id": "global::Promise"
|
|
1887
|
+
}
|
|
1888
|
+
},
|
|
1889
|
+
"return": "Promise<void>"
|
|
1890
|
+
},
|
|
1891
|
+
"docs": {
|
|
1892
|
+
"text": "Remove focus from the element",
|
|
1893
|
+
"tags": []
|
|
1894
|
+
}
|
|
1895
|
+
},
|
|
1896
|
+
"expand": {
|
|
1897
|
+
"complexType": {
|
|
1898
|
+
"signature": "() => Promise<void>",
|
|
1899
|
+
"parameters": [],
|
|
1900
|
+
"references": {
|
|
1901
|
+
"Promise": {
|
|
1902
|
+
"location": "global",
|
|
1903
|
+
"id": "global::Promise"
|
|
1904
|
+
}
|
|
1905
|
+
},
|
|
1906
|
+
"return": "Promise<void>"
|
|
1907
|
+
},
|
|
1908
|
+
"docs": {
|
|
1909
|
+
"text": "Expand options listbox",
|
|
1910
|
+
"tags": []
|
|
1911
|
+
}
|
|
1912
|
+
},
|
|
1913
|
+
"collapse": {
|
|
1914
|
+
"complexType": {
|
|
1915
|
+
"signature": "() => Promise<void>",
|
|
1916
|
+
"parameters": [],
|
|
1917
|
+
"references": {
|
|
1918
|
+
"Promise": {
|
|
1919
|
+
"location": "global",
|
|
1920
|
+
"id": "global::Promise"
|
|
1921
|
+
}
|
|
1922
|
+
},
|
|
1923
|
+
"return": "Promise<void>"
|
|
1924
|
+
},
|
|
1925
|
+
"docs": {
|
|
1926
|
+
"text": "Collapse options listbox",
|
|
1927
|
+
"tags": []
|
|
1928
|
+
}
|
|
1929
|
+
},
|
|
1930
|
+
"getFocusedOption": {
|
|
1931
|
+
"complexType": {
|
|
1932
|
+
"signature": "() => Promise<HTMLRSelectOptionElement>",
|
|
1933
|
+
"parameters": [],
|
|
1934
|
+
"references": {
|
|
1935
|
+
"Promise": {
|
|
1936
|
+
"location": "global",
|
|
1937
|
+
"id": "global::Promise"
|
|
1938
|
+
},
|
|
1939
|
+
"HTMLRSelectOptionElement": {
|
|
1940
|
+
"location": "global",
|
|
1941
|
+
"id": "global::HTMLRSelectOptionElement"
|
|
1942
|
+
}
|
|
1943
|
+
},
|
|
1944
|
+
"return": "Promise<HTMLRSelectOptionElement>"
|
|
1945
|
+
},
|
|
1946
|
+
"docs": {
|
|
1947
|
+
"text": "Retrieves the currently focused option within this select component.\n\nThe focused option is identified by the presence of the `data-focused=\"true\"`\nattribute on an `r-select-option` element inside the component's host.",
|
|
1948
|
+
"tags": [{
|
|
1949
|
+
"name": "returns",
|
|
1950
|
+
"text": "Promise resolving to the focused `HTMLRSelectOptionElement`, or `null`\nif no option is currently marked as focused."
|
|
1951
|
+
}]
|
|
1952
|
+
}
|
|
1953
|
+
},
|
|
1954
|
+
"setFocusedOption": {
|
|
1955
|
+
"complexType": {
|
|
1956
|
+
"signature": "(index: any) => Promise<void>",
|
|
1957
|
+
"parameters": [{
|
|
1958
|
+
"name": "index",
|
|
1959
|
+
"type": "any",
|
|
1960
|
+
"docs": "- Zero-based index of the option to focus. If the index is out of bounds\nor the corresponding option element is unavailable, the method will no-op."
|
|
1961
|
+
}],
|
|
1962
|
+
"references": {
|
|
1963
|
+
"Promise": {
|
|
1964
|
+
"location": "global",
|
|
1965
|
+
"id": "global::Promise"
|
|
1966
|
+
}
|
|
1967
|
+
},
|
|
1968
|
+
"return": "Promise<void>"
|
|
1969
|
+
},
|
|
1970
|
+
"docs": {
|
|
1971
|
+
"text": "Sets focus to the option at the specified index.\n\nRetrieves the option element from the internal optionElements collection\nand delegates focusing logic to `setOptionFocus`.",
|
|
1972
|
+
"tags": [{
|
|
1973
|
+
"name": "param",
|
|
1974
|
+
"text": "index - Zero-based index of the option to focus. If the index is out of bounds\nor the corresponding option element is unavailable, the method will no-op."
|
|
1975
|
+
}, {
|
|
1976
|
+
"name": "returns",
|
|
1977
|
+
"text": "A promise that resolves with the result of `setOptionFocus`, typically indicating\nsuccess or failure of applying focus (implementation dependent)."
|
|
1978
|
+
}]
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
static get elementRef() { return "host"; }
|
|
1984
|
+
static get watchers() {
|
|
1985
|
+
return [{
|
|
1986
|
+
"propName": "listboxPosition",
|
|
1987
|
+
"methodName": "handleListboxPositionChange"
|
|
1988
|
+
}, {
|
|
1989
|
+
"propName": "expanded",
|
|
1990
|
+
"methodName": "handleExpandedChange"
|
|
1991
|
+
}, {
|
|
1992
|
+
"propName": "readonly",
|
|
1993
|
+
"methodName": "handleReadonlyChange"
|
|
1994
|
+
}, {
|
|
1995
|
+
"propName": "value",
|
|
1996
|
+
"methodName": "handleValueChange"
|
|
1997
|
+
}];
|
|
1998
|
+
}
|
|
1999
|
+
static get listeners() {
|
|
2000
|
+
return [{
|
|
2001
|
+
"name": "optionClick",
|
|
2002
|
+
"method": "optionSelectAction",
|
|
2003
|
+
"target": undefined,
|
|
2004
|
+
"capture": false,
|
|
2005
|
+
"passive": false
|
|
2006
|
+
}, {
|
|
2007
|
+
"name": "rTooltipFocus",
|
|
2008
|
+
"method": "tooltipFocusAction",
|
|
2009
|
+
"target": undefined,
|
|
2010
|
+
"capture": false,
|
|
2011
|
+
"passive": false
|
|
2012
|
+
}, {
|
|
2013
|
+
"name": "mouseup",
|
|
2014
|
+
"method": "onMouseup",
|
|
2015
|
+
"target": "window",
|
|
2016
|
+
"capture": false,
|
|
2017
|
+
"passive": true
|
|
2018
|
+
}, {
|
|
2019
|
+
"name": "keyup",
|
|
2020
|
+
"method": "onKeyup",
|
|
2021
|
+
"target": "window",
|
|
2022
|
+
"capture": false,
|
|
2023
|
+
"passive": false
|
|
2024
|
+
}, {
|
|
2025
|
+
"name": "scroll",
|
|
2026
|
+
"method": "handleScrolling",
|
|
2027
|
+
"target": "window",
|
|
2028
|
+
"capture": false,
|
|
2029
|
+
"passive": true
|
|
2030
|
+
}, {
|
|
2031
|
+
"name": "resize",
|
|
2032
|
+
"method": "handleResizing",
|
|
2033
|
+
"target": "window",
|
|
2034
|
+
"capture": false,
|
|
2035
|
+
"passive": true
|
|
2036
|
+
}];
|
|
2037
|
+
}
|
|
2038
|
+
}
|