@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,147 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
+
|
|
3
|
+
const buttonCss = ":host{display:inline-flex;vertical-align:top;opacity:1;outline:none}:host(:focus-within:not(:active)){--r-button--box-shadow:0 0 0 1px var(--r-border-focused-outlined, #fff),\n 0 0 0 3px var(--r-border-focused),\n 0 0 0 4px var(--r-border-focused-outlined, #fff);--r-button--outline:2px solid var(--r-border-focused);--r-button--outline-offset:2px}:host(:hover:not(:active):not([disabled]:not([disabled=false]))){--r-button--border-color:var(--r-border-soft, #686868);--r-button--color:var(--r-text-regular, #282828);--r-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([disabled]:not([disabled=false])){--r-button--opacity:0.4;--r-button--cursor:not-allowed;--r-button--box-shadow:none}:host([size=small]){--r-button--font-size:var(--r-font-size-300, 0.875rem);--r-button--padding:0.642em 0.857em;--r-button--height:2.75rem}:host([icon-position=end]){--r-button--slot--flex-direction:row-reverse}:host([data-icon-only=start]){--r-button--padding:0.875em}:host([variant=secondary]){--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:var(--r-border-regular, #282828);--r-button--background-color:rgba(0,0,0,0)}:host([variant=secondary]:not([disabled]:not([disabled=false])):hover){--r-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04));--r-button--border-color:var(--r-border-soft, #686868)}:host([variant=secondary] .r-button:not([aria-disabled=true]):active){--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:var(--r-border-soft, #686868);--r-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([variant=text]){--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:rgba(0,0,0,0);--r-button--background-color:rgba(0,0,0,0);--r-button--slot--position:relative;--r-button--slot--text-decoration:underline}:host([variant=text]:hover:not([disabled]:not([disabled=false]))){--r-button--border-color:var(--r-border-soft, #686868);--r-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([variant=text] .r-button:not([aria-disabled=true]):active){--r-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));--r-button--border-color:var(--r-border-soft, #686868)}:host([variant=text][text-position=left]){--r-button--padding:0.875em var(--spacing-175, 1.75rem) 0.875em 0}:host([variant=text][text-position=right]){--r-button--padding:0.875em 0 0.875em var(--spacing-175, 1.75rem)}:host([variant=text-inline]){--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:transparent;--r-button--background-color:transparent;--r-button--padding:0 0 0.5rem 0;--r-button--height:auto;--r-button--slot--text-decoration:underline}:host([variant=text-inline]:hover:not([disabled]:not([disabled=false]))){--r-button--slot--text-decoration:none;--r-button--border-color:transparent;--r-button--background-color:transparent}:host([variant=text-inline]:active:not([disabled]:not([disabled=false]))){--r-button--border-color:transparent;--r-button--background-color:transparent}:host([variant=blank]){--r-button--color:var(--r-text-regular, #282828);--r-button--border-color:rgba(0,0,0,0);--r-button--background-color:rgba(0,0,0,0);--r-button--border-width:0;--r-button--padding:0}:host([variant=blank]) .r-button:active{--r-button--border-width:0;--r-button--background-color:rgba(0,0,0,0)}:host([variant=blank]:hover:not([disabled]:not([disabled=false]))){--r-button--color:var(--r-text-regular, #282828)}:host([expanded]),:host([full-width]:not([full-width=false])){display:block;--r-button--display:flex;--r-button--width:100%}.r-button{display:var(--r-button--display, inline-flex);align-items:var(--r-button--align-items, center);justify-content:var(--r-button--justify-content, center);width:var(--r-button--width, auto);height:var(--r-button--height, 3rem);position:var(--r-button--position, static);top:var(--r-button--top, auto);left:var(--r-button--left, auto);box-sizing:var(--r-button--box-sizing, border-box);outline:var(--r-button--outline, none);outline-offset:var(--r-button--outline-offset, 0);cursor:var(--r-button--cursor, pointer);font-family:var(--r-button--font-family, var(--r-font-family-text, system-ui));font-weight:var(--r-button--font-weight, 400);text-align:var(--r-button--text-align, center);text-transform:var(--r-button--text-transform, uppercase);text-decoration:var(--r-button--text-decoration, none);background-color:var(--r-button--background-color, var(--r-background-interactive-regular, #282828));border-width:var(--r-button--border-width, 1px);border-style:var(--r-button--border-style, solid);border-color:var(--r-button--border-color, var(--r-border-strong, #000));color:var(--r-button--color, var(--r-text-inverse, #fff));font-size:var(--r-button--font-size, var(--r-font-size-400, 1rem));line-height:var(--r-button--line-height, 1);letter-spacing:var(--r-button--letter-spacing, 0.04em);padding:var(--r-button--padding, 0.875em var(--r-spacing-175, 1.75rem));box-shadow:var(--r-button--box-shadow, none);pointer-events:var(--r-button--pointer-events, auto);z-index:var(--r-button--z-index, initial);vertical-align:var(--r-button--vertical-align, top);opacity:var(--r-button--opacity, 1)}.r-button:not([aria-disabled=true]):active{--r-button--color:var(--r-button--color--active, var(--r-text-regular, #282828));--r-button--background-color:var(--r-button--background-color--active, var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12)));--r-button--border-color:var(--r-button--border-color--active, var(--r-border-soft, #686868))}.r-button--slot{position:var(--r-button--slot--position, relative);display:var(--r-button--slot--display, flex);flex:var(--r-button--slot--flex, 1);flex-direction:var(--r-button--slot--flex-direction, row);align-items:var(--r-button--slot--align-items, center);justify-content:var(--r-button--slot--justify-content, center);gap:var(--r-button--gap, 0.5em);font-weight:var(--r-button--slot--font-weight, var(--r-font-weight-regular, 400));text-decoration:var(--r-button--slot--text-decoration, none);text-decoration-color:var(--r-button--slot--text-decoration-color, var(--r-button-color, inherit));text-underline-offset:var(--r-button--slot--text-underline-offset, 0.5rem)}";
|
|
4
|
+
|
|
5
|
+
const Button = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.rClick = createEvent(this, "rClick");
|
|
9
|
+
/**
|
|
10
|
+
* Button behavior, corresponding to
|
|
11
|
+
* [native `type` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
|
|
12
|
+
*/
|
|
13
|
+
this.type = 'button';
|
|
14
|
+
/** Visual size */
|
|
15
|
+
this.size = 'large';
|
|
16
|
+
/** Presentational style */
|
|
17
|
+
this.variant = 'primary';
|
|
18
|
+
/** Position of an icon within button.
|
|
19
|
+
* Only use it when 'icon' is specified.
|
|
20
|
+
* */
|
|
21
|
+
this.iconPosition = 'start';
|
|
22
|
+
this._activateTmpButton = (formEl) => {
|
|
23
|
+
if (!formEl) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const { type } = this;
|
|
27
|
+
switch (type) {
|
|
28
|
+
case 'submit':
|
|
29
|
+
case 'reset': {
|
|
30
|
+
/* Create temporary button inside the <form>
|
|
31
|
+
and either submit or reset it based on button type */
|
|
32
|
+
const tmpButton = document.createElement('button');
|
|
33
|
+
tmpButton.type = type;
|
|
34
|
+
tmpButton.style.display = 'none';
|
|
35
|
+
formEl.appendChild(tmpButton);
|
|
36
|
+
tmpButton.click();
|
|
37
|
+
tmpButton.remove();
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Handles button action based on its type attribute
|
|
44
|
+
* @param {Event} event event<Event> from onClick on the component
|
|
45
|
+
*/
|
|
46
|
+
this.handleClick = (event) => {
|
|
47
|
+
if (this.disabled)
|
|
48
|
+
return;
|
|
49
|
+
if (!this.hasShadowDom)
|
|
50
|
+
return;
|
|
51
|
+
if (!this.isLink && this.isResetOrSubmit) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
this._activateTmpButton(this.formEl);
|
|
54
|
+
}
|
|
55
|
+
this.rClick.emit();
|
|
56
|
+
};
|
|
57
|
+
this.handleSlotChange = () => {
|
|
58
|
+
this.host.setAttribute('data-icon-only', `${this.isIconOnly}`);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
handleIconChange() {
|
|
62
|
+
this.host.setAttribute('data-icon-only', `${this.isIconOnly}`);
|
|
63
|
+
}
|
|
64
|
+
/** Simulate a button click */
|
|
65
|
+
async triggerClick() {
|
|
66
|
+
var _a;
|
|
67
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.click();
|
|
68
|
+
}
|
|
69
|
+
/** Set focus on the button */
|
|
70
|
+
async setFocus() {
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
73
|
+
}
|
|
74
|
+
/** Remove focus from the button */
|
|
75
|
+
async setBlur() {
|
|
76
|
+
var _a;
|
|
77
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
78
|
+
}
|
|
79
|
+
get hasText() {
|
|
80
|
+
return this.host.textContent.trim().length > 0;
|
|
81
|
+
}
|
|
82
|
+
get hasIcon() {
|
|
83
|
+
const isIconInSlot = this.host.querySelector('r-icon') !== null;
|
|
84
|
+
const isIconInShadow = this.host.shadowRoot.querySelector('r-icon') !== null;
|
|
85
|
+
return isIconInSlot || isIconInShadow;
|
|
86
|
+
}
|
|
87
|
+
get isIconOnly() {
|
|
88
|
+
return this.hasIcon && !this.hasText;
|
|
89
|
+
}
|
|
90
|
+
get isLink() {
|
|
91
|
+
return typeof this.href === 'string';
|
|
92
|
+
}
|
|
93
|
+
get hasShadowDom() {
|
|
94
|
+
const { host } = this;
|
|
95
|
+
return !!host.shadowRoot && !!host.attachShadow;
|
|
96
|
+
}
|
|
97
|
+
get formEl() {
|
|
98
|
+
const { form, host } = this;
|
|
99
|
+
/** If form attr contains form id */
|
|
100
|
+
if (typeof form === 'string') {
|
|
101
|
+
const formEl = document.getElementById(form);
|
|
102
|
+
if (formEl instanceof HTMLFormElement) {
|
|
103
|
+
return formEl;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** If form attr is not defined checking for form as parent */
|
|
107
|
+
if (typeof form === 'undefined') {
|
|
108
|
+
const formEl = host.closest('form');
|
|
109
|
+
if (formEl instanceof HTMLFormElement) {
|
|
110
|
+
return formEl;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
get isResetOrSubmit() {
|
|
116
|
+
return this.type === 'submit' || this.type === 'reset';
|
|
117
|
+
}
|
|
118
|
+
get hasIconSlot() {
|
|
119
|
+
return !!this.host.querySelector('[slot="icon"]');
|
|
120
|
+
}
|
|
121
|
+
get ariaCurrentValue() {
|
|
122
|
+
const { rAriaCurrent } = this;
|
|
123
|
+
return !rAriaCurrent || rAriaCurrent === "false" ? null : rAriaCurrent;
|
|
124
|
+
}
|
|
125
|
+
componentDidLoad() {
|
|
126
|
+
this.host.dataset.iconOnly = `${this.isIconOnly}`;
|
|
127
|
+
}
|
|
128
|
+
render() {
|
|
129
|
+
const { type, disabled, form, href, target, isLink, icon, iconPosition, rAriaLabel } = this;
|
|
130
|
+
const linkAttr = disabled ? { 'aria-disabled': 'true', role: 'link' } : { href, target };
|
|
131
|
+
const btnAttr = { 'aria-disabled': `${disabled || false}`, disabled, type, form };
|
|
132
|
+
const attrs = isLink ? Object.assign({}, linkAttr) : Object.assign({}, btnAttr);
|
|
133
|
+
const iconAttrs = {
|
|
134
|
+
name: icon,
|
|
135
|
+
position: iconPosition
|
|
136
|
+
};
|
|
137
|
+
const TagName = isLink ? 'a' : 'button';
|
|
138
|
+
return (h(Host, { key: 'e93ad739417293917e59c26f213c0fbf784ed4d7' }, h(TagName, Object.assign({ key: 'c447e81e5900ad18d0af96025d6f5634fd1e5d2f', class: "r-button" }, attrs, { "aria-label": rAriaLabel || null, "aria-current": this.ariaCurrentValue, ref: (el) => (this.nativeElement = el), onClick: this.handleClick }), h("span", { key: '4f2706c98face1c8ef1cc72ae186501f49540d39', class: "r-button--slot" }, icon && h("r-icon", Object.assign({ key: '916942e6657fa1f7e342d120111a381db7200470', name: icon }, iconAttrs, { size: "s" })), this.hasIconSlot && h("slot", { key: '961c37f8d825639256a8234dbae92bdc926c7263', name: "icon" }), h("div", { key: '19189a21d18b0145d6990dd3bfecfd8d85d37aa9', style: { display: 'contents' } }, h("slot", { key: 'da586b1e067dac24d0fb81e59599d3ee83a536f4', onSlotchange: this.handleSlotChange }))))));
|
|
139
|
+
}
|
|
140
|
+
get host() { return getElement(this); }
|
|
141
|
+
static get watchers() { return {
|
|
142
|
+
"icon": ["handleIconChange"]
|
|
143
|
+
}; }
|
|
144
|
+
};
|
|
145
|
+
Button.style = buttonCss;
|
|
146
|
+
|
|
147
|
+
export { Button as r_button };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
+
|
|
3
|
+
const checkboxGroupCss = ":host([show-select-all]:not([show-select-all=false])){--r-checkbox-group--content--margin-left:calc(1.5rem + 1rem);--r-checkbox-group--content--padding-left:var(--r-spacing-100, 1rem);--r-checkbox-group--label--hint--margin-bottom:0}:host([invalid]:not([invalid=false])) ::slotted(r-checkbox){--r-checkbox--box--border-color:var(--r-status-error-regular, #b00c15);--r-checkbox--box--background-color:var(--r-status-error-soft, #fef6f6);--r-checkbox--marker--color:var(--r-status-error-regular, #b00c15)}.r-checkbox-group{display:var(--r-checkbox-group--display, flex);flex-direction:var(--r-checkbox-group--flex-direction, column);border:var(--r-checkbox-group--border, none);margin:var(--r-checkbox-group--margin, 0);padding:var(--r-checkbox-group--padding, 0);width:var(--r-checkbox-group--width, 100%)}.r-checkbox-group--label{padding:var(--r-checkbox-group--label--padding, 0);display:var(--r-checkbox-group--label--display, block);width:var(--r-checkbox-group--label--width, 100%);margin:var(--r-checkbox-group--label--margin, 0);padding:var(--r-checkbox-group--label--padding, 0)}.r-checkbox-group--label r-hint{--r-hint--margin-bottom:var(--r-checkbox-group--label--hint--margin-bottom, var(--r-spacing-100, 1rem))}.r-checkbox-group--content{margin-left:var(--r-checkbox-group--content--margin-left, 0);display:var(--r-checkbox-group--content--display, flex);flex-direction:var(--r-checkbox-group--content--flex-direction, column);gap:var(--r-checkbox-group--content--gap, var(--r-spacing-050, 0.5rem));padding-left:var(--r-checkbox-group--content--padding-left, 0)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
4
|
+
|
|
5
|
+
const CheckboxGroup = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.rValidate = createEvent(this, "rValidate");
|
|
9
|
+
/**
|
|
10
|
+
* Specifies `value` property of the 'select-all', representing the group as a whole.
|
|
11
|
+
* */
|
|
12
|
+
this.value = '';
|
|
13
|
+
/**
|
|
14
|
+
* Specifies whether the `value` is required.
|
|
15
|
+
*/
|
|
16
|
+
this.required = false;
|
|
17
|
+
this.indeterminate = false;
|
|
18
|
+
this.allChecked = false;
|
|
19
|
+
this.noChecked = false;
|
|
20
|
+
this.validityState = '';
|
|
21
|
+
this.validityMessage = '';
|
|
22
|
+
this.uniqueId = `r-checkbox-group-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
23
|
+
this.initial = {};
|
|
24
|
+
this.renderMessage = () => {
|
|
25
|
+
const variant = this.valid ? 'success' : 'error';
|
|
26
|
+
return (h("r-hint", { variant: variant, role: "alert", "aria-live": "polite", id: `${this.uniqueId}-message`, class: this.message ? null : 'visually-hidden' }, this.message));
|
|
27
|
+
};
|
|
28
|
+
this.getValidityStateData = () => {
|
|
29
|
+
let validityState = '';
|
|
30
|
+
let validityMessage = '';
|
|
31
|
+
const isValid = this.checkboxes.some(checkbox => checkbox.checked);
|
|
32
|
+
if (this.required && !isValid) {
|
|
33
|
+
validityState = 'valueMissing';
|
|
34
|
+
validityMessage = this.valueMissingMessage || 'Please select at least one option.';
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
validityState = 'valid';
|
|
38
|
+
validityMessage = null;
|
|
39
|
+
}
|
|
40
|
+
return { validityState, validityMessage };
|
|
41
|
+
};
|
|
42
|
+
this.validateGroup = () => {
|
|
43
|
+
if (this.isNoValidate || !this.required)
|
|
44
|
+
return;
|
|
45
|
+
const { validityState, validityMessage } = this.getValidityStateData();
|
|
46
|
+
this.validityState = validityState;
|
|
47
|
+
this.validityMessage = validityMessage;
|
|
48
|
+
const isValid = this.validityState === 'valid';
|
|
49
|
+
this.valid = isValid;
|
|
50
|
+
this.invalid = !isValid;
|
|
51
|
+
this.noChecked = !isValid;
|
|
52
|
+
this.rValidate.emit({
|
|
53
|
+
state: this.validityState,
|
|
54
|
+
message: this.validityMessage
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
this.onSubmitForm = (event) => {
|
|
58
|
+
if (this.isNoValidate)
|
|
59
|
+
return;
|
|
60
|
+
this.validateGroup();
|
|
61
|
+
if (this.invalid) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.onResetForm = () => {
|
|
67
|
+
this.resetValidity();
|
|
68
|
+
this.resetToInitial();
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Validates the checkbox group, displays provided message in case value is invalid. */
|
|
72
|
+
async setCustomValidity(message) {
|
|
73
|
+
this.customErrorMessage = message;
|
|
74
|
+
this.validateGroup();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validates the checkbox group without triggering UI and returns a boolean indicating its validity.
|
|
78
|
+
* @returns A boolean indicating whether the checkbox is valid.
|
|
79
|
+
*/
|
|
80
|
+
async checkValidity() {
|
|
81
|
+
const { validityState } = this.getValidityStateData();
|
|
82
|
+
return validityState === 'valid';
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Resets the validity state and message of the radio group.
|
|
86
|
+
* This method clears the validity message and state, and sets the invalid
|
|
87
|
+
* property to its initial value.
|
|
88
|
+
*/
|
|
89
|
+
async resetValidity() {
|
|
90
|
+
this.validityMessage = null;
|
|
91
|
+
this.validityState = null;
|
|
92
|
+
this.invalid = this.initial['invalid'];
|
|
93
|
+
this.valid = !this.invalid;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @returns {HTMLRCheckboxElement[]} - Returns all checkboxes in the slot.
|
|
97
|
+
*/
|
|
98
|
+
get checkboxes() {
|
|
99
|
+
return Array.from(this.host.querySelectorAll('r-checkbox'));
|
|
100
|
+
}
|
|
101
|
+
get hasMessage() {
|
|
102
|
+
return this.message !== null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Checks all checkboxes in the slot.
|
|
106
|
+
*/
|
|
107
|
+
async checkAll() {
|
|
108
|
+
this.checkboxes.forEach(checkbox => {
|
|
109
|
+
checkbox.check();
|
|
110
|
+
});
|
|
111
|
+
this.allChecked = true;
|
|
112
|
+
this.noChecked = false;
|
|
113
|
+
this.indeterminate = false;
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Unchecks all checkboxes in the slot.
|
|
118
|
+
*/
|
|
119
|
+
async uncheckAll() {
|
|
120
|
+
this.checkboxes.forEach(checkbox => {
|
|
121
|
+
var _a;
|
|
122
|
+
(_a = checkbox === null || checkbox === void 0 ? void 0 : checkbox.uncheck) === null || _a === void 0 ? void 0 : _a.call(checkbox);
|
|
123
|
+
});
|
|
124
|
+
this.allChecked = false;
|
|
125
|
+
this.noChecked = true;
|
|
126
|
+
this.indeterminate = false;
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
handleCheckboxChange(event) {
|
|
130
|
+
if (!event.target)
|
|
131
|
+
return;
|
|
132
|
+
const isSelectAllElement = event.detail.element.id === `${this.uniqueId}-select-all`;
|
|
133
|
+
if (isSelectAllElement) {
|
|
134
|
+
this.updateCheckAllState(event.detail.checked);
|
|
135
|
+
setTimeout(this.validateGroup, 0);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.updateCheckboxesState(event);
|
|
139
|
+
if (this.required) {
|
|
140
|
+
this.validateGroup();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
updateCheckAllState(checked) {
|
|
144
|
+
checked ? this.checkAll() : this.uncheckAll();
|
|
145
|
+
}
|
|
146
|
+
updateCheckboxesState(event) {
|
|
147
|
+
const { checkboxes } = this;
|
|
148
|
+
const checkedCheckboxes = checkboxes.filter(checkbox => checkbox.checked);
|
|
149
|
+
const isCheckbox = event.target.tagName.toLowerCase() === 'r-checkbox';
|
|
150
|
+
const isInGroup = checkboxes.includes(event.target);
|
|
151
|
+
if (!isCheckbox)
|
|
152
|
+
return;
|
|
153
|
+
if (!isInGroup)
|
|
154
|
+
return;
|
|
155
|
+
this.allChecked = checkedCheckboxes.length === checkboxes.length;
|
|
156
|
+
this.indeterminate = checkedCheckboxes.length > 0 && checkedCheckboxes.length < checkboxes.length;
|
|
157
|
+
this.noChecked = checkedCheckboxes.length === 0;
|
|
158
|
+
}
|
|
159
|
+
get message() {
|
|
160
|
+
const { validityMessage, invalid, error, customErrorMessage } = this;
|
|
161
|
+
let message = null;
|
|
162
|
+
if (invalid) {
|
|
163
|
+
message = error || customErrorMessage || validityMessage || null;
|
|
164
|
+
}
|
|
165
|
+
return message;
|
|
166
|
+
}
|
|
167
|
+
get parentFormEl() {
|
|
168
|
+
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
169
|
+
}
|
|
170
|
+
get isNoValidate() {
|
|
171
|
+
var _a;
|
|
172
|
+
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
173
|
+
this.novalidate ||
|
|
174
|
+
false);
|
|
175
|
+
}
|
|
176
|
+
resetToInitial() {
|
|
177
|
+
this.invalid = this.initial['invalid'];
|
|
178
|
+
this.checked = this.initial['checked'];
|
|
179
|
+
this.indeterminate = this.initial['indeterminate'];
|
|
180
|
+
this.updateCheckAllState(this.initial['checked']);
|
|
181
|
+
}
|
|
182
|
+
connectedCallback() {
|
|
183
|
+
var _a, _b;
|
|
184
|
+
this.initial['invalid'] = this.invalid;
|
|
185
|
+
this.initial['checked'] = this.checked;
|
|
186
|
+
this.initial['indeterminate'] = this.indeterminate;
|
|
187
|
+
this.updateCheckAllState(this.initial['checked']);
|
|
188
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
189
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.addEventListener('reset', this.onResetForm);
|
|
190
|
+
}
|
|
191
|
+
disconnectedCallback() {
|
|
192
|
+
var _a, _b;
|
|
193
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('submit', this.onSubmitForm);
|
|
194
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('reset', this.onResetForm);
|
|
195
|
+
}
|
|
196
|
+
get groupDescribedby() {
|
|
197
|
+
const { uniqueId, hint, hasMessage } = this;
|
|
198
|
+
if (hasMessage && hint)
|
|
199
|
+
return `${uniqueId}-message ${uniqueId}-hint`;
|
|
200
|
+
if (hasMessage)
|
|
201
|
+
return `${uniqueId}-message`;
|
|
202
|
+
if (hint)
|
|
203
|
+
return `${uniqueId}-hint`;
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
render() {
|
|
207
|
+
const { label, fieldIndicator, help, helpIcon, helpIconColor, hint, uniqueId, form, name, value } = this;
|
|
208
|
+
const renderLabel = () => {
|
|
209
|
+
const labelAttrs = {
|
|
210
|
+
fieldIndicator,
|
|
211
|
+
help,
|
|
212
|
+
helpIcon,
|
|
213
|
+
helpIconColor,
|
|
214
|
+
};
|
|
215
|
+
return (label ?
|
|
216
|
+
h("r-label", Object.assign({ id: `${uniqueId}-label`, class: "r-radio-group--label" }, labelAttrs), label)
|
|
217
|
+
:
|
|
218
|
+
null);
|
|
219
|
+
};
|
|
220
|
+
const renderHint = () => hint ? (h("r-hint", { id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note", "aria-hidden": "true" }, hint)) : null;
|
|
221
|
+
const checkAllAttrs = {
|
|
222
|
+
form,
|
|
223
|
+
name,
|
|
224
|
+
value
|
|
225
|
+
};
|
|
226
|
+
return (h(Host, null, h("div", { class: "r-checkbox-group", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-invalid": `${this.invalid || false}`, "aria-describedby": this.groupDescribedby }, h("div", { class: "r-checkbox-group--label", id: `${uniqueId}-group-label` }, this.showSelectAll ?
|
|
227
|
+
h("r-checkbox", Object.assign({ id: `${uniqueId}-select-all` }, checkAllAttrs, { checked: this.allChecked, indeterminate: this.indeterminate }), renderLabel(), renderHint())
|
|
228
|
+
:
|
|
229
|
+
h(Fragment, null, h("r-checkbox", Object.assign({}, checkAllAttrs, { checked: this.allChecked, indeterminate: this.indeterminate, class: "visually-hidden" }), this.label), renderLabel(), renderHint())), h("div", { class: "r-checkbox-group--content" }, h("span", { style: { display: 'contents' } }, h("slot", null)), this.renderMessage()))));
|
|
230
|
+
}
|
|
231
|
+
get host() { return getElement(this); }
|
|
232
|
+
};
|
|
233
|
+
CheckboxGroup.style = checkboxGroupCss;
|
|
234
|
+
|
|
235
|
+
export { CheckboxGroup as r_checkbox_group };
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
+
import { a as appendControlToFormData } from './formData-DvLT8-y3.js';
|
|
3
|
+
|
|
4
|
+
const checkboxCss = ":host{display:block;user-select:none;box-sizing:border-box;font-family:var(--r-font-family-text);font-size:var(--r-font-size-400);text-align:left;color:var(--r-text-regular);cursor:pointer}:host ::slotted(a),:host ::slotted(a:visited),:host ::slotted(a:hover),:host ::slotted(a:focus),:host ::slotted(a:active){color:var(--r-text-regular)}:host slot{display:contents}:host(:hover:not([disabled]:not([disabled=false]))){--r-checkbox--box--background-color:var(--r-background-interactive-hovered)}:host(:focus-within:not(:active)){box-shadow:0 0 0 3px var(--r-border-focused-outlined, #fff), inset 0 0 0 1px var(--r-border-focused-outlined, #fff);outline:2px solid var(--r-border-focused, #0071e3);outline-offset:2px;--r-checkbox--box--box-shadow:0 0 0 3px var(--r-border-focused-outlined, #fff), inset 0 0 0 1px var(--r-border-focused-outlined, #fff);--r-checkbox--box--outline:2px solid var(--r-border-focused, #0071e3);--r-checkbox--box--outline-offset:2px}:host(:active:not([disabled]:not([disabled=false]))){--r-checkbox--box--background-color:var(--r-background-interactive-pressed)}:host([invalid]:not([invalid=false])){--r-checkbox--box--border-color:var(--r-status-error-regular);--r-checkbox--box--background-color:var(--r-status-error-soft);--r-checkbox--marker--color:var(--r-status-error-regular)}:host([disabled]:not([disabled=false])){--r-checkbox--box--opacity:0.4;--r-checkbox--cursor:not-allowed;--r-checkbox--label-container--cursor:not-allowed;--r-checkbox--label--cursor:not-allowed;cursor:not-allowed}.r-checkbox{position:var(--r-checkbox--position, relative);display:var(--r-checkbox--display, flex);gap:var(--r-checkbox--gap, var(--r-spacing-100, 1rem));cursor:var(--r-checkbox--cursor, pointer);padding:var(--r-checkbox--padding, var(--r-spacing-100, 1rem));min-height:var(--r-checkbox--min-height, var(--r-spacing-150, 1.5rem))}.r-checkbox--input{position:var(--r-checkbox--input--position, absolute);top:var(--r-checkbox--input--top, var(--r-checkbox--padding));left:var(--r-checkbox--input--left, var(--r-checkbox--padding));opacity:var(--r-checkbox--input--opacity, 0);width:var(--r-checkbox--input--width, 1.5rem);height:var(--r-checkbox--input--height, 1.5rem);box-sizing:var(--r-checkbox--input--box-sizing, border-box);padding:var(--r-checkbox--input--padding, 0);margin:var(--r-checkbox--input--margin, 0)}.r-checkbox--box{position:var(--r-checkbox--box--position, relative);display:var(--r-checkbox--box--display, flex);align-items:var(--r-checkbox--box--align-items, center);justify-content:var(--r-checkbox--box--justify-content, center);left:var(--r-checkbox--box--left, 0);top:var(--r-checkbox--box--top, 0);height:var(--r-checkbox--box--height, 1.5rem);width:var(--r-checkbox--box--width, 1.5rem);min-width:var(--r-checkbox--box--min-width, 1.5rem);background-color:var(--r-checkbox--box--background-color, var(--r-background-interactive-softest, #fff));border-width:var(--r-checkbox--box--border-width, 0.0625rem);border-style:var(--r-checkbox--box--border-style, solid);border-color:var(--r-checkbox--box--border-color, var(--r-border-soft, #686868));outline:var(--r-checkbox--box--outline, none);outline-offset:var(--r-checkbox--box--outline-offset, 0);box-sizing:var(--r-checkbox--box--box-sizing, border-box);box-shadow:var(--r-checkbox--box--box-shadow, none);opacity:var(--r-checkbox--box--opacity, 1)}.r-checkbox--description{cursor:var(--r-checkbox--label-container--cursor, pointer);flex:var(--r-checkbox--label-container--flex, 1);line-height:var(--r-checkbox--label-container--line-height, 1.5);display:var(--r-checkbox--label-container--display, flex);flex-direction:var(--r-checkbox--label-container--flex-direction, column);gap:var(--r-checkbox--label-container--gap, var(--r-spacing-025, 0.25rem))}.r-checkbox--label{cursor:var(--r-checkbox--label--cursor, pointer)}.r-checkbox--message{margin-top:var(--r-checkbox--message--margin-top, var(--r-spacing-025, 0.25rem))}:host(.visually-hidden),.visually-hidden{position:absolute;width:0.0625rem;height:0.0625rem;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}";
|
|
5
|
+
|
|
6
|
+
const Checkbox = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.rChange = createEvent(this, "rChange");
|
|
10
|
+
this.rReset = createEvent(this, "rReset");
|
|
11
|
+
this.rValidate = createEvent(this, "rValidate");
|
|
12
|
+
/** Automatically focus the checkbox when the component is mounted. Note: Only one element per page should have autofocus set to true, following browser standard behavior. */
|
|
13
|
+
this.autofocus = false;
|
|
14
|
+
this.validityState = '';
|
|
15
|
+
this.validityMessage = '';
|
|
16
|
+
this.touched = false;
|
|
17
|
+
// Private properties
|
|
18
|
+
this.initial = {};
|
|
19
|
+
this.uniqueId = `r-checkbox-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
20
|
+
// Private methods
|
|
21
|
+
this.getValidityStateData = (element) => {
|
|
22
|
+
let validityState = '';
|
|
23
|
+
let validityMessage = '';
|
|
24
|
+
for (const state in element.validity) {
|
|
25
|
+
if (element.validity[state]) {
|
|
26
|
+
validityState = state;
|
|
27
|
+
if (this[state + 'Message']) {
|
|
28
|
+
validityMessage = this[state + 'Message'];
|
|
29
|
+
return { validityState, validityMessage };
|
|
30
|
+
}
|
|
31
|
+
validityMessage = element.validationMessage;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { validityState, validityMessage };
|
|
35
|
+
};
|
|
36
|
+
this.validateFormElement = (element = null) => {
|
|
37
|
+
if (element === null)
|
|
38
|
+
return;
|
|
39
|
+
if (this.isNoValidate)
|
|
40
|
+
return;
|
|
41
|
+
if (this.error)
|
|
42
|
+
return;
|
|
43
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
44
|
+
this.validityState = validityState;
|
|
45
|
+
this.validityMessage = validityMessage;
|
|
46
|
+
const isValid = this.validityState === 'valid';
|
|
47
|
+
this.valid = isValid;
|
|
48
|
+
this.invalid = !isValid;
|
|
49
|
+
this.rValidate.emit({
|
|
50
|
+
state: this.validityState,
|
|
51
|
+
message: this.validityMessage
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
this.handleClick = (event) => {
|
|
55
|
+
if (this.disabled)
|
|
56
|
+
return;
|
|
57
|
+
const target = event.target;
|
|
58
|
+
if (target.tagName !== 'A') {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
this.toggleChecked();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
this.onSubmitForm = (event) => {
|
|
64
|
+
if (this.isNoValidate)
|
|
65
|
+
return;
|
|
66
|
+
this.validateFormElement(this.nativeElement);
|
|
67
|
+
// If data is not valid -> prevent form submittion
|
|
68
|
+
if (this.invalid) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
event.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
this.onResetForm = () => {
|
|
74
|
+
this.validityState = null;
|
|
75
|
+
this.validityMessage = null;
|
|
76
|
+
this.checked = this.initial['checked'];
|
|
77
|
+
this.invalid = this.initial['invalid'];
|
|
78
|
+
this.valid = !this.invalid;
|
|
79
|
+
const { host, value, checked } = this;
|
|
80
|
+
this.rReset.emit({ element: host, value, checked });
|
|
81
|
+
};
|
|
82
|
+
this.contributeToFormData = (event) => {
|
|
83
|
+
appendControlToFormData(this.nativeElement || this.host, event.formData);
|
|
84
|
+
};
|
|
85
|
+
this.applyAutofocus = () => {
|
|
86
|
+
queueMicrotask(() => {
|
|
87
|
+
this.setFocus();
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Public Methods
|
|
92
|
+
/**
|
|
93
|
+
* Asynchronously retrieves the validity state of the checkbox.
|
|
94
|
+
*
|
|
95
|
+
* This method updates the internal validity state and message by calling `getValidityStateData`
|
|
96
|
+
* with the native element, and then returns an object containing the current validity state and message.
|
|
97
|
+
*
|
|
98
|
+
* @returns A promise that resolves to an object containing the validity state and message.
|
|
99
|
+
* The object has two properties:
|
|
100
|
+
* - `state`: A string representing the validity state.
|
|
101
|
+
* - `message`: A string containing the validity message.
|
|
102
|
+
*/
|
|
103
|
+
async getValidityState() {
|
|
104
|
+
const { validityState, validityMessage } = this.getValidityStateData(this.nativeElement);
|
|
105
|
+
this.validityState = validityState;
|
|
106
|
+
this.validityMessage = validityMessage;
|
|
107
|
+
return {
|
|
108
|
+
state: this.validityState,
|
|
109
|
+
message: this.validityMessage
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Sets focus on the checkbox element.
|
|
114
|
+
*/
|
|
115
|
+
async setFocus() {
|
|
116
|
+
var _a;
|
|
117
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Removes focus from the checkbox element.
|
|
121
|
+
*/
|
|
122
|
+
async setBlur() {
|
|
123
|
+
var _a;
|
|
124
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Checks the checkbox element.
|
|
128
|
+
*/
|
|
129
|
+
async check() {
|
|
130
|
+
this.checked = true;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Unchecks the checkbox element.
|
|
134
|
+
*/
|
|
135
|
+
async uncheck() {
|
|
136
|
+
this.checked = false;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Toggles the checked state of the checkbox element.
|
|
140
|
+
*/
|
|
141
|
+
async toggleChecked() {
|
|
142
|
+
this.touched = true;
|
|
143
|
+
this.checked = !this.checked;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Sets the indeterminate state of the checkbox element.
|
|
147
|
+
*/
|
|
148
|
+
async setIndeterminate() {
|
|
149
|
+
this.indeterminate = true;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Sets the indeterminate state of the checkbox element.
|
|
153
|
+
*/
|
|
154
|
+
async clearIndeterminate() {
|
|
155
|
+
this.indeterminate = false;
|
|
156
|
+
}
|
|
157
|
+
/** Validates an element, displays provided message in case value is invalid. */
|
|
158
|
+
async setCustomValidity(message) {
|
|
159
|
+
this.customErrorMessage = message;
|
|
160
|
+
this.validateFormElement(this.nativeElement);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Validates the checkbox without triggering UI and returns a boolean indicating its validity.
|
|
164
|
+
* @returns A boolean indicating whether the checkbox is valid.
|
|
165
|
+
*/
|
|
166
|
+
async checkValidity() {
|
|
167
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
168
|
+
return validityState === 'valid';
|
|
169
|
+
}
|
|
170
|
+
// Watchers
|
|
171
|
+
async handleCheckedChange() {
|
|
172
|
+
// Only proceed if checkbox has been interacted with
|
|
173
|
+
if (!this.touched)
|
|
174
|
+
return;
|
|
175
|
+
if (this.disabled)
|
|
176
|
+
return;
|
|
177
|
+
const { host, value, checked } = this;
|
|
178
|
+
this.rChange.emit({ element: host, value, checked });
|
|
179
|
+
// Update native element checked state
|
|
180
|
+
if (this.nativeElement) {
|
|
181
|
+
this.nativeElement.checked = checked;
|
|
182
|
+
}
|
|
183
|
+
// Validate if required
|
|
184
|
+
if (this.required && !this.isNoValidate) {
|
|
185
|
+
this.validateFormElement(this.nativeElement);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Getters
|
|
189
|
+
/** Identify wrapping form element */
|
|
190
|
+
get parentFormEl() {
|
|
191
|
+
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
192
|
+
}
|
|
193
|
+
/** Determine whether this element should be ignored during Constraint Validation API validation. */
|
|
194
|
+
get isNoValidate() {
|
|
195
|
+
var _a;
|
|
196
|
+
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
197
|
+
this.novalidate ||
|
|
198
|
+
false);
|
|
199
|
+
}
|
|
200
|
+
get hasErrorMessage() {
|
|
201
|
+
var _a;
|
|
202
|
+
return typeof this.error === 'string' && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
203
|
+
}
|
|
204
|
+
get hasCustomErrorMessage() {
|
|
205
|
+
var _a;
|
|
206
|
+
return typeof this.customErrorMessage === 'string' && ((_a = this.customErrorMessage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
207
|
+
}
|
|
208
|
+
get hasValidationError() {
|
|
209
|
+
var _a;
|
|
210
|
+
return this.validityState && this.validityState !== 'valid' && ((_a = this.validityMessage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
211
|
+
}
|
|
212
|
+
get hasInvalidMessage() {
|
|
213
|
+
if (!this.invalid)
|
|
214
|
+
return false;
|
|
215
|
+
return this.hasErrorMessage || this.hasCustomErrorMessage || this.hasValidationError;
|
|
216
|
+
}
|
|
217
|
+
connectFormEventListeners() {
|
|
218
|
+
var _a, _b, _c;
|
|
219
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('formdata', this.contributeToFormData);
|
|
220
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
221
|
+
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.addEventListener('reset', this.onResetForm);
|
|
222
|
+
}
|
|
223
|
+
disconnectFormEventListeners() {
|
|
224
|
+
var _a, _b, _c;
|
|
225
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('formdata', this.contributeToFormData);
|
|
226
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('submit', this.onSubmitForm);
|
|
227
|
+
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('reset', this.onResetForm);
|
|
228
|
+
}
|
|
229
|
+
// Lifecycle methods
|
|
230
|
+
componentWillLoad() {
|
|
231
|
+
this.initial['checked'] = this.checked;
|
|
232
|
+
this.initial['invalid'] = this.invalid;
|
|
233
|
+
}
|
|
234
|
+
componentDidLoad() {
|
|
235
|
+
if (this.nativeElement) {
|
|
236
|
+
this.nativeElement.indeterminate = this.indeterminate;
|
|
237
|
+
}
|
|
238
|
+
if (this.autofocus)
|
|
239
|
+
this.applyAutofocus();
|
|
240
|
+
}
|
|
241
|
+
connectedCallback() {
|
|
242
|
+
this.connectFormEventListeners();
|
|
243
|
+
}
|
|
244
|
+
disconnectedCallback() {
|
|
245
|
+
this.disconnectFormEventListeners();
|
|
246
|
+
}
|
|
247
|
+
render() {
|
|
248
|
+
const { error, name, value, disabled, required, uniqueId, checked, indeterminate, autofocus } = this;
|
|
249
|
+
const inputAttrs = {
|
|
250
|
+
name,
|
|
251
|
+
value,
|
|
252
|
+
disabled,
|
|
253
|
+
required,
|
|
254
|
+
checked,
|
|
255
|
+
indeterminate,
|
|
256
|
+
autofocus
|
|
257
|
+
};
|
|
258
|
+
return (h(Host, { key: 'caf581918e9dabe998fde4118ba5d890e731cd4d', onClick: this.handleClick }, h("div", { key: 'a5f144a25be70960a5bde7b16b3a85aa57c24b9d', class: "r-checkbox" }, h("input", Object.assign({ key: 'd1505294bfc6b3f9b296c03df184078a061dcedd', class: "r-checkbox--input", type: "checkbox" }, inputAttrs, { id: `${uniqueId}-input`, ref: el => this.nativeElement = el, "aria-describedby": this.hasInvalidMessage ? `${uniqueId}-message` : null, "aria-required": `${this.required || false}`, "aria-invalid": `${this.invalid || false}` })), h("div", { key: '8fc3f4f251db2bc58f15851881d0122552c83a04', class: "r-checkbox--box", "aria-hidden": "true" }, this.checked ?
|
|
259
|
+
h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M8.80019 15.8988L4.6002 11.6988L3.2002 13.0988L8.80019 18.6988L20.8002 6.69883L19.4002 5.29883L8.80019 15.8988Z", fill: "currentColor" }))
|
|
260
|
+
: this.indeterminate ?
|
|
261
|
+
h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("rect", { x: "4", y: "11", width: "16", height: "2", fill: "currentColor" }))
|
|
262
|
+
: null), h("div", { key: 'e64607f95963658e0bbddd32564fd003d5d26b10', class: "r-checkbox--description" }, h("label", { key: 'ea592fe0ce74007f0a23ba9aaed73059597e9891', class: "r-checkbox--label", id: `${uniqueId}-label`, htmlFor: `${uniqueId}-input` }, h("slot", { key: 'e795b6c1e51724e95840532666e7fc3e29fd52a5' })), h("div", { key: 'ea461714f04e42bc81d488c7050783007d1edbe9', id: `${uniqueId}-message`, class: !this.hasInvalidMessage ? 'visually-hidden' : 'r-checkbox--message', "aria-live": "polite", "aria-atomic": "true" }, this.hasInvalidMessage &&
|
|
263
|
+
h("r-hint", { key: '7ed7bd758187daacd72d93f3aba91e9c9123c9fd', variant: "error" }, error || this.customErrorMessage || this.validityMessage))))));
|
|
264
|
+
}
|
|
265
|
+
get host() { return getElement(this); }
|
|
266
|
+
static get watchers() { return {
|
|
267
|
+
"checked": ["handleCheckedChange"]
|
|
268
|
+
}; }
|
|
269
|
+
};
|
|
270
|
+
Checkbox.style = checkboxCss;
|
|
271
|
+
|
|
272
|
+
export { Checkbox as r_checkbox };
|