@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,107 @@
|
|
|
1
|
+
import { r as registerInstance, h, F as Fragment, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
+
|
|
3
|
+
const listItemCss = ":host([alignment=top]){--r-list-item--trailing-text--font-weight:bold;--r-list-item--trailing--align-self:start}:host([alignment=bottom]) .r-list-item{--r-list-item--trailing--align-self:end}:host([divider]:not([divider=false])){--r-list-item--border-color:var(--r-border-soft, #686868);--r-list-item--border-width:0 0 1px 0}:host([active]) .r-list-item{--r-list-item--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([variant=navitem]:not([active]):hover:not([disabled]:not([disabled=false])))>.r-list-item,:host([href]:not([active]):hover:not([disabled]:not([disabled=false])))>.r-list-item{--r-list-item--cursor:pointer;--r-list-item--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([variant=navitem][has-sub-items]:hover:not([disabled]:not([disabled=false])))>.r-list-item-wrapper>.r-list-item{--r-list-item--cursor:pointer;--r-list-item--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([variant=navitem][has-sub-items]:has([active]):hover:not([disabled]:not([disabled=false])))>.r-list-item-wrapper>.r-list-item{--r-list-item--cursor:pointer;--r-list-item--background-color:transparent}:host([variant=navitem][expanded])>.r-list-item-wrapper>.r-list-item{--r-list-item--headline--font-weight:600;--r-list-item--trailing-icon--transform:rotate(180deg);--r-list-item--trailing-icon--color:var(--r-icon-regular, #282828)}:host([variant=navitem][active-parent]:not([expanded])),:host([variant=navitem][active]:not([expanded])){--r-list-item--background-color:var(--r-background-interactive-activated, rgba(40, 40, 40, 0.08))}:host([variant=subitem]) .r-list-item{--r-list-item--margin-left:27px;--r-list-item--border-width:0 0 0 1px;--r-list-item--border-color:var(--r-border-soft, #686868)}:host([variant=subitem][active]) .r-list-item{--r-list-item--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host(:focus-within) .r-list-item[href]{--r-list-item--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-list-item--outline:2px solid var(--r-border-focused, #0071e3);--r-list-item--outline-offset:2px}:host([disabled]:not([disabled=false])){cursor:not-allowed;--r-list-item--background-color:transparent}:host([disabled]:not([disabled=false])[divider]:not([divider=false])){--r-list-item--border-color:rgba(104,104,104, 0.4);--r-list-item--leading-icon--color:rgba(104,104,104, 0.4)}:host([truncate-description]:not([truncate-description=false])){--r-list-item--description--white-space:nowrap}:host{display:var(--display, block);pointer-events:var(--pointer-events, auto);outline:var(--outline, none);font-family:var(--font-family, var(--r-font-family-text, system-ui));line-height:var(--line-height, var(--r-line-height-m, 1.5));color:var(--color, var(--r-text-regular, #282828))}.r-list-item{display:var(--r-list-item--display, flex);align-items:var(--r-list-item--align-items, center);justify-content:var(--r-list-item--justify-content, center);gap:var(--r-list-item--gap, var(--r-spacing-100, 1rem));width:var(--r-list-item--width, inherit);padding:var(--r-list-item--padding, var(--r-spacing-100, 1rem));margin-left:var(--r-list-item--margin-left, 0);opacity:var(--r-list-item--opacity, 1);color:var(--r-list-item--color, inherit);box-shadow:var(--r-list-item--box-shadow, none);outline:var(--r-list-item--outline, none);outline-offset:var(--r-list-item--outline-offset, 0);text-decoration:var(--r-list-item--text-decoration, none);text-align:var(--r-list-item--text-align, left);background-color:var(--r-list-item--background-color, transparent);border-style:var(--r-list-item--border-style, solid);border-width:var(--r-list-item--border-width, 0);border-color:var(--r-list-item--border-color, transparent);cursor:var(--r-list-item--cursor, inherit);font-weight:var(--r-list-item--font-weight, var(--r-font-weight-regular, 400));font-family:var(--r-list-item--font-family, var(--r-font-family-text, system-ui))}.r-list-item:focus-visible{--r-list-item--box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);--r-list-item--outline:2px solid var(--r-border-focused, #0071e3);--r-list-item--outline-offset:2px}.r-list-item--leading{display:var(--r-list-item--leading--display, flex);align-items:var(--r-list-item--leading--align-items, center);color:var(--r-list-item--leading--color, var(--r-icon-soft, #686868))}.r-list-item--leading-icon{color:var(--r-list-item--leading-icon--color, var(--r-icon-soft, #686868))}.r-list-item--trailing{display:var(--r-list-item--trailing--display, flex);align-self:var(--r-list-item--trailing--align-self, center);gap:var(--r-list-item--trailing--gap, var(--r-spacing-050, 0.5rem));color:var(--r-list-item--trailing--color, inherit)}.r-list-item--trailing-icon{transition:var(--r-list-item--trailing-icon--transition, transform 250ms ease-in-out);transform:var(--r-list-item--trailing-icon--transform, rotate(0deg));color:var(--r-list-item--trailing-icon--color, inherit)}.r-list-item--trailing-text{font-weight:var(--r-list-item--trailing-text--font-weight, 400);white-space:var(--r-list-item--trailing-text--white-space, nowrap)}.r-list-item--trailing ::slotted(*){display:var(--r-list-item--trailing-slotted--display, flex);gap:var(--r-list-item--trailing-slotted--display, var(--r-spacing-050, 0.5rem))}.r-list-item--text{display:var(--r-list-item--text--display, flex);flex-grow:var(--r-list-item--text--flex-grow, 1);flex-direction:var(--r-list-item--text--flex-direction, column);gap:var(--r-list-item--text--gap, 0.125rem);white-space:var(--r-list-item--text--white-space, normal);overflow:var(--r-list-item--text--overflow, hidden);text-overflow:var(--r-list-item--text--text-overflow, ellipsis);font-weight:var(--r-list-item--trailing-text--font-weight, inherit)}.r-list-item--sr-text{display:var(--r-list-item--sr-text--display, none)}.r-list-item--headline{font-size:var(--r-list-item--headline--font-size, 1rem);font-weight:var(--r-list-item--headline--font-weight, 600);line-height:var(--r-list-item--headline--line-height, 1.5);color:var(--r-list-item--headline--color, inherit)}.r-list-item--description{font-size:var(--r-list-item--description--font-size, 1rem);font-weight:var(--r-list-item--description--font-weight, 400);line-height:var(--r-list-item--description--line-height, 1.5);color:var(--r-list-item--description--color, var(--r-text-regular, #282828));white-space:var(--r-list-item--description--white-space, normal);overflow:var(--r-list-item--description--overflow, hidden);text-overflow:var(--r-list-item--description--text-overflow, ellipsis)}.r-list-item--description ::slotted(a){color:var(--r-list-item--description--color, inherit)}.r-list-item-wrapper{width:var(--r-list-item-wrapper--width, 100%)}.sub-items{margin:var(--r-sub-items--margin, 0);padding:var(--r-sub-items--padding, 0);list-style-type:var(--r-sub-items--list-style-type, \"\")}.sub-items[aria-hidden=true]{display:none}.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}@media (prefers-reduced-motion){.r-list-item--trailing-icon{transition:none}}";
|
|
4
|
+
|
|
5
|
+
const RListItem = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
/** Controls the style variation of the list item, such as regular or subitem. */
|
|
9
|
+
this.variant = 'list-item';
|
|
10
|
+
/** Determines whether the list item is expanded to show its subitems. It can be toggled programmatically or through user interaction. */
|
|
11
|
+
this.expanded = false;
|
|
12
|
+
/** Unique id for each subItem list */
|
|
13
|
+
this.uniqueSubmitemsId = `r-list-item-subitems-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
14
|
+
this.isEl = (selector) => {
|
|
15
|
+
return this.host.querySelector(selector) !== null;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Method to toggle sub-items of the list-item */
|
|
19
|
+
async toggleSubitems() {
|
|
20
|
+
if (this.disabled)
|
|
21
|
+
return;
|
|
22
|
+
if (this.variant === 'subitem')
|
|
23
|
+
return;
|
|
24
|
+
this.expanded = !this.expanded;
|
|
25
|
+
}
|
|
26
|
+
get isLeadingIcon() {
|
|
27
|
+
return !!this.leadingIcon || !!this.leadingIconSrc;
|
|
28
|
+
}
|
|
29
|
+
get isLeadingSlot() {
|
|
30
|
+
return this.isEl('[slot="leading"]');
|
|
31
|
+
}
|
|
32
|
+
get isLeading() {
|
|
33
|
+
return (this.isLeadingIcon && !this.hideLeadingIcon) || this.isLeadingSlot;
|
|
34
|
+
}
|
|
35
|
+
get isTrailingIcon() {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return ((_a = this.trailingIcon) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = this.trailingIconSrc) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
38
|
+
}
|
|
39
|
+
get isTrailingSlot() {
|
|
40
|
+
return this.isEl('[slot="trailing"]');
|
|
41
|
+
}
|
|
42
|
+
get isTrailing() {
|
|
43
|
+
var _a;
|
|
44
|
+
return this.isTrailingIcon || ((_a = this.trailingText) === null || _a === void 0 ? void 0 : _a.length) > 0 || this.isTrailingSlot;
|
|
45
|
+
}
|
|
46
|
+
get isTextSlot() {
|
|
47
|
+
return this.isEl('[slot="text"]');
|
|
48
|
+
}
|
|
49
|
+
get isHeadlineSlot() {
|
|
50
|
+
return this.isEl('[slot="headline"]');
|
|
51
|
+
}
|
|
52
|
+
get isDescriptionSlot() {
|
|
53
|
+
return this.isEl('[slot="description"]');
|
|
54
|
+
}
|
|
55
|
+
get headlineContent() {
|
|
56
|
+
var _a;
|
|
57
|
+
return ((_a = this.host.querySelector('[slot="headline"]')) === null || _a === void 0 ? void 0 : _a.textContent) || this.headline;
|
|
58
|
+
}
|
|
59
|
+
get hasSubitems() {
|
|
60
|
+
return this.isEl('[variant="subitem"]');
|
|
61
|
+
}
|
|
62
|
+
get subItems() {
|
|
63
|
+
var _a;
|
|
64
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[variant="subitem"]');
|
|
65
|
+
}
|
|
66
|
+
/** Function to set tabindex for sub-items */
|
|
67
|
+
setTabIndexOnSubItems() {
|
|
68
|
+
if (this.hasSubitems) {
|
|
69
|
+
this.subItems.forEach((element) => {
|
|
70
|
+
var _a;
|
|
71
|
+
(_a = element.shadowRoot.querySelector('a.r-list-item')) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', this.disabled ? '-1' : null);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
componentDidLoad() {
|
|
76
|
+
this.setTabIndexOnSubItems();
|
|
77
|
+
}
|
|
78
|
+
get tagName() {
|
|
79
|
+
if (this.hasSubitems) {
|
|
80
|
+
return 'button';
|
|
81
|
+
}
|
|
82
|
+
return this.href && !this.disabled ? 'a' : 'div';
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
const { leadingIcon, leadingIconSrc, trailingIcon, trailingIconSrc, headline, trailingText, description } = this;
|
|
86
|
+
const TagName = this.tagName;
|
|
87
|
+
const itemAttrs = Object.assign(Object.assign(Object.assign({ href: TagName === 'a' ? this.href : null, 'aria-current': this.active && TagName === 'a' ? 'page' : null }, (this.disabled ? { role: 'link', 'aria-disabled': 'true' } : null)), (this.hasSubitems ? { 'aria-expanded': `${this.expanded}` } : null)), (this.hasSubitems ? { 'aria-controls': `${this.uniqueSubmitemsId}` } : null));
|
|
88
|
+
const ListItemContent = (h(TagName, Object.assign({ class: "r-list-item" }, itemAttrs, { onClick: () => this.hasSubitems && this.toggleSubitems() }), this.isLeading &&
|
|
89
|
+
h("span", { class: "r-list-item--leading" }, h("slot", { name: "leading" }, this.isLeadingIcon && !this.hideLeadingIcon &&
|
|
90
|
+
h("r-icon", { class: "r-list-item--leading-icon", name: leadingIcon, src: leadingIconSrc }))), h("span", { class: "r-list-item--text" }, !this.isTextSlot ?
|
|
91
|
+
h(Fragment, null, (this.isHeadlineSlot || headline) &&
|
|
92
|
+
h("span", { class: "r-list-item--headline" }, h("slot", { name: "headline" }, headline)), (description || this.isDescriptionSlot) &&
|
|
93
|
+
h("span", { class: "r-list-item--description" }, h("slot", { name: "description" }, description)))
|
|
94
|
+
:
|
|
95
|
+
h("slot", { name: "text" })), h("span", { class: "r-list-item--sr-text visually-hidden" }, this.headlineContent), this.isTrailing &&
|
|
96
|
+
h("span", { class: "r-list-item--trailing" }, h("slot", { name: "trailing" }, this.isTrailingIcon && !trailingText &&
|
|
97
|
+
h("r-icon", { class: "r-list-item--trailing-icon", name: trailingIcon, src: trailingIconSrc }), trailingText && !this.isTrailingIcon &&
|
|
98
|
+
h("span", { class: "r-list-item--trailing-text" }, trailingText)))));
|
|
99
|
+
if (!this.hasSubitems)
|
|
100
|
+
return h(Host, null, ListItemContent);
|
|
101
|
+
return (h(Host, null, h("div", { class: "r-list-item-wrapper" }, ListItemContent, h("ul", { "aria-hidden": `${!this.expanded}`, id: this.uniqueSubmitemsId, class: "sub-items" }, h("slot", null)))));
|
|
102
|
+
}
|
|
103
|
+
get host() { return getElement(this); }
|
|
104
|
+
};
|
|
105
|
+
RListItem.style = listItemCss;
|
|
106
|
+
|
|
107
|
+
export { RListItem as r_list_item };
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement, F as Fragment } from './index-CTxpqopm.js';
|
|
2
|
+
|
|
3
|
+
const paginationCss = ":host{--r-pagination--display:flex;--r-pagination--list-style:none;--r-pagination--align-items:center;--r-pagination--justify-content:center;--r-pagination--font-family:var(--r-font-family-text);--r-pagination--margin:0 auto;--r-pagination--flex-direction:column;--r-pagination--width:100%;--r-pagination--max-width:664px;--r-pagination--margin:0 auto;--r-pagination--items-list--display:flex;--r-paginaition--items-list--justify-content:center;--r-paginaition--items-list--align-items:center;--r-paginaition--items-list--list-style-type:none;--r-paginaition--items-list--padding:0;--r-paginaition--items-list--margin:0;--r-pagination--item--width:var(--r-spacing-300, 3rem);--r-pagination--item--height:var(--r-spacing-300, 3rem);--r-pagination--item--border-radius:0;--r-pagination--button--border-width:0;--r-pagination--button--padding:0;--r-pagination--header--display:flex;--r-pagination--header--align-items:center;--r-pagination--header--justify-content:space-between;--r-pagination--header--min-width:287px;--r-pagination--footer--display:flex;--r-pagination--footer--justify-content:center;--r-pagination--footer--width:100%;--r-pagination--item--disabled-text:none;--r-pagination--font-size:var(--r-font-size-200);display:block}:host([variant=minimized]){--r-pagination--max-width:440px}:host([variant=standard]){--r-pagination--max-width:560px}:host([variant=maximized]){--r-pagination--max-width:664px}.r-pagination r-select{--r-select--font-size:var(--r-pagination--font-size, 12px);--r-select-option--font-size:var(--r-pagination--font-size, 12px)}.r-pagination{align-items:var(--r-pagination--align-items);display:var(--r-pagination--display);flex-direction:var(--r-pagination--flex-direction);font-family:var(--r-pagination--font-family);font-size:var(--r-pagination--font-size);justify-content:var(--r-pagination--justify-content);list-style:var(--r-pagination--list-style);margin:var(--r-pagination--margin);max-width:var(--r-pagination--max-width);user-select:var(--r-pagination--item--disabled-text);width:var(--r-pagination--width)}.r-pagination--footer{align-items:var(--r-pagination--header--align-items);display:var(--r-pagination--footer--display);justify-content:var(--r-pagination--footer--justify-content)}.r-pagination--header{align-items:var(--r-pagination--header--align-items);display:var(--r-pagination--header--display);justify-content:var(--r-pagination--header--justify-content);font-family:var(--r-pagination--font-family);min-width:var(--r-pagination--header--min-width)}.r-pagination--header--select{min-width:auto;--width:unset !important}.r-pagination--header label{font-size:var(--r-pagination--font-size)}.r-pagination--items-list{display:var(--r-pagination--items-list--display);justify-content:var(--r-paginaition--items-list--justify-content);align-items:var(--r-paginaition--items-list--align-items);list-style-type:var(--r-paginaition--items-list--list-style-type);padding:var(--r-paginaition--items-list--padding);margin:var(--r-paginaition--items-list--margin)}.r-pagination--item.active{--r-button--color:var(--r-text-regular);--r-button--background-color:var(--r-background-interactive-activated);font-weight:var(--r-font-weight-semibold)}.r-pagination--item.number{--r-button--font-size:0.813rem}.r-pagination--item{--r-icon-button--height:var(--r-pagination--item--height);--r-icon-button--width:var(--r-pagination--item--width);--r-icon-button--border-radius:var(--r-pagination--item--border-radius);--r-button--width:var(--r-pagination--item--width);--r-button--height:var(--r-pagination--item--height);--r-button--border-width:var(--r-pagination--button--border-width);--r-button--padding:var(--r-pagination--button--padding)}.visually-hidden{position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}";
|
|
4
|
+
|
|
5
|
+
const RPagination = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.rChange = createEvent(this, "rChange");
|
|
9
|
+
this.rNumberClick = createEvent(this, "rNumberClick");
|
|
10
|
+
this.rArrowClick = createEvent(this, "rArrowClick");
|
|
11
|
+
this.rItemsPerPageChange = createEvent(this, "rItemsPerPageChange");
|
|
12
|
+
/** UI: Arrows present/absent */
|
|
13
|
+
this.arrows = true;
|
|
14
|
+
/** Total amount of pages to select from */
|
|
15
|
+
this.totalResults = 1;
|
|
16
|
+
/** Current page number */
|
|
17
|
+
this.pageActive = 1;
|
|
18
|
+
/** Amount of items to show per page */
|
|
19
|
+
this.itemsPerPage = 5;
|
|
20
|
+
/** Items per page options for dropdown */
|
|
21
|
+
this.itemsPerPageOptions = [5, 10, 15, 20, 25, 50, 100];
|
|
22
|
+
// @Prop() variant?: PaginationVariant;
|
|
23
|
+
/** Allows selection between different pagination styles: minimized, standard, maximized */
|
|
24
|
+
this.variant = 'standard';
|
|
25
|
+
/** UI: Result Line and select field present/absent */
|
|
26
|
+
this.resultsLine = false;
|
|
27
|
+
/** Text to show in beginning of resultLine */
|
|
28
|
+
this.startText = 'Showing';
|
|
29
|
+
/** Text to display between currently shown results and total amount of results */
|
|
30
|
+
this.middleText = 'of';
|
|
31
|
+
/** Text to display after total results */
|
|
32
|
+
this.endText = 'results';
|
|
33
|
+
/** Text to show in select */
|
|
34
|
+
this.selectText = 'page';
|
|
35
|
+
/** Position of the list box */
|
|
36
|
+
this.listBoxPosition = 'top';
|
|
37
|
+
/** Label for Previous Page button. Important to ensure accessibility for screen reader users. */
|
|
38
|
+
this.previousPageButtonLabel = 'Go to the previous page';
|
|
39
|
+
/** Label for Next Page button. Important to ensure accessibility for screen reader users.*/
|
|
40
|
+
this.nextPageButtonLabel = 'Go to the next page';
|
|
41
|
+
/** Label for First Page button. Important to ensure accessibility for screen reader users.*/
|
|
42
|
+
this.firstPageButtonLabel = 'Go to the first page';
|
|
43
|
+
/** Label for Last Page button. Important to ensure accessibility for screen reader users.*/
|
|
44
|
+
this.lastPageButtonLabel = 'Go to the last page';
|
|
45
|
+
/** Label for Page number buttons. Important to ensure accessibility for screen reader users.*/
|
|
46
|
+
this.pageLabel = 'Page';
|
|
47
|
+
/** Label for Ellipsis stepper. Important to ensure accessibility for screen reader users.*/
|
|
48
|
+
this.ellipsisLabel = 'Ellipsis indicating skipped pages';
|
|
49
|
+
/** Label for Items per page select. */
|
|
50
|
+
this.itemsPerPageLabel = 'Items per page';
|
|
51
|
+
this.resizeObserver = null;
|
|
52
|
+
this.handleItemsPerPageChange = (event) => {
|
|
53
|
+
const newItemsPerPage = parseInt(event.detail.value, 10);
|
|
54
|
+
this.itemsPerPage = newItemsPerPage;
|
|
55
|
+
this.rItemsPerPageChange.emit(this.itemsPerPage);
|
|
56
|
+
this.setPaginationState();
|
|
57
|
+
};
|
|
58
|
+
this._activateStep = (index) => {
|
|
59
|
+
if (index < 1 || index > this.total || this.pageActive === index)
|
|
60
|
+
return; // Prevent invalid or redundant updates
|
|
61
|
+
this.pageActive = index;
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
this.setPaginationState(); // Ensure state updates correctly
|
|
64
|
+
requestAnimationFrame(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
// Ensure the correct button is focused AFTER the state updates
|
|
67
|
+
const newActiveButton = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`.r-pagination--item[data-index="${this.pageActive}"]`);
|
|
68
|
+
if (newActiveButton) {
|
|
69
|
+
newActiveButton.focus();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
this.handleItemChange = e => {
|
|
75
|
+
const buttonElement = e.target.closest('r-icon-button') || e.target.closest('r-button');
|
|
76
|
+
const index = Number(buttonElement.getAttribute('data-index'));
|
|
77
|
+
if (index === null)
|
|
78
|
+
return;
|
|
79
|
+
this._activateStep(index);
|
|
80
|
+
requestAnimationFrame(() => {
|
|
81
|
+
const focusTarget = this.getFocusTargetAfterNavigation(buttonElement);
|
|
82
|
+
focusTarget === null || focusTarget === void 0 ? void 0 : focusTarget.setFocus();
|
|
83
|
+
});
|
|
84
|
+
if (buttonElement.classList.contains('number')) {
|
|
85
|
+
this.rNumberClick.emit(this.paginationState);
|
|
86
|
+
}
|
|
87
|
+
if (buttonElement.classList.contains('arrow')) {
|
|
88
|
+
const direction = buttonElement.classList.contains('next') ? 'next' : 'previous';
|
|
89
|
+
this.rArrowClick.emit(Object.assign(Object.assign({}, this.paginationState), { direction }));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
this.syncHeaderWidth = () => {
|
|
93
|
+
requestAnimationFrame(() => {
|
|
94
|
+
if (this.headerRef && this.footerRef) {
|
|
95
|
+
const footerWidth = this.footerRef.offsetWidth;
|
|
96
|
+
this.headerRef.style.width = `${footerWidth}px`;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
get isNoPreviousPage() {
|
|
102
|
+
return this.previous === null;
|
|
103
|
+
}
|
|
104
|
+
get isNoNextPage() {
|
|
105
|
+
return this.next === null;
|
|
106
|
+
}
|
|
107
|
+
get isNotFirstPage() {
|
|
108
|
+
return this.first === null;
|
|
109
|
+
}
|
|
110
|
+
get isNotLastPage() {
|
|
111
|
+
return this.last === null;
|
|
112
|
+
}
|
|
113
|
+
get paginationState() {
|
|
114
|
+
const { total, active, previous, next, first, last, arrows } = this;
|
|
115
|
+
return { total, active, previous, next, first, last, arrows };
|
|
116
|
+
}
|
|
117
|
+
// State recalculation
|
|
118
|
+
setPaginationState() {
|
|
119
|
+
// Correctly calculate total pages based on items per page
|
|
120
|
+
this.total = Math.ceil(this.totalResults / this.itemsPerPage);
|
|
121
|
+
// Ensure the active page does not exceed the total pages
|
|
122
|
+
if (this.pageActive > this.total) {
|
|
123
|
+
this.pageActive = this.total;
|
|
124
|
+
}
|
|
125
|
+
// Set the reveal value based on variant and screen size
|
|
126
|
+
switch (this.variant) {
|
|
127
|
+
case 'minimized':
|
|
128
|
+
{
|
|
129
|
+
this.arrows = false;
|
|
130
|
+
this.resultsLine = false;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case 'standard': {
|
|
134
|
+
this.arrows = true;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case 'maximized': {
|
|
138
|
+
this.arrows = true;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
default: {
|
|
142
|
+
console.warn('No variant specified. Defaulting to "standard".');
|
|
143
|
+
this.variant = 'standard';
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Update pagination-related state variables
|
|
148
|
+
this.active = this.pageActive;
|
|
149
|
+
this.previous = this.active - 1 > 0 ? this.active - 1 : null;
|
|
150
|
+
this.next = this.active + 1 > this.total ? null : this.active + 1;
|
|
151
|
+
this.first = this.variant === 'maximized' && this.active !== 1 ? 1 : null;
|
|
152
|
+
this.last = this.variant === 'maximized' && this.active !== this.total ? this.total : null;
|
|
153
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
154
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
155
|
+
this.syncHeaderWidth();
|
|
156
|
+
});
|
|
157
|
+
if (this.footerRef) {
|
|
158
|
+
this.resizeObserver.observe(this.footerRef);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Emit updated pagination state
|
|
162
|
+
this.rChange.emit(this.paginationState);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Determines the appropriate focus target after navigation based on button states.
|
|
166
|
+
* Handles edge cases where navigation buttons become disabled.
|
|
167
|
+
*/
|
|
168
|
+
getFocusTargetAfterNavigation(buttonElement) {
|
|
169
|
+
var _a, _b, _c, _d, _e;
|
|
170
|
+
const isArrowButton = buttonElement.classList.contains('arrow');
|
|
171
|
+
const isNextButton = buttonElement.classList.contains('next');
|
|
172
|
+
const isPrevButton = buttonElement.classList.contains('previous');
|
|
173
|
+
const isFirstButton = buttonElement.classList.contains('first');
|
|
174
|
+
const isLastButton = buttonElement.classList.contains('last');
|
|
175
|
+
const willNextBeDisabled = this.next === null;
|
|
176
|
+
const willPrevBeDisabled = this.previous === null;
|
|
177
|
+
const willLastBeDisabled = this.active === this.total;
|
|
178
|
+
const willFirstBeDisabled = this.first === null;
|
|
179
|
+
if (isNextButton && willNextBeDisabled) {
|
|
180
|
+
return (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`.r-pagination--item.number[data-index="${this.total}"]`);
|
|
181
|
+
}
|
|
182
|
+
if (isPrevButton && willPrevBeDisabled) {
|
|
183
|
+
return (_b = this.el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector(`.r-pagination--item.number[data-index="1"]`);
|
|
184
|
+
}
|
|
185
|
+
if (isLastButton && willLastBeDisabled) {
|
|
186
|
+
return (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector(`.r-pagination--item.number[data-index="${this.total}"]`);
|
|
187
|
+
}
|
|
188
|
+
if (isFirstButton && willFirstBeDisabled) {
|
|
189
|
+
return (_d = this.el.shadowRoot) === null || _d === void 0 ? void 0 : _d.querySelector('.r-pagination--item.number[data-index="1"]');
|
|
190
|
+
}
|
|
191
|
+
return isArrowButton ? buttonElement : (_e = this.el.shadowRoot) === null || _e === void 0 ? void 0 : _e.querySelector(`.r-pagination--item[data-index="${this.pageActive}"]`);
|
|
192
|
+
}
|
|
193
|
+
handlePropsChange() {
|
|
194
|
+
this.setPaginationState();
|
|
195
|
+
}
|
|
196
|
+
componentWillLoad() {
|
|
197
|
+
this.setPaginationState();
|
|
198
|
+
}
|
|
199
|
+
disconnectedCallback() {
|
|
200
|
+
if (this.resizeObserver) {
|
|
201
|
+
this.resizeObserver.disconnect();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
componentDidRender() {
|
|
205
|
+
this.syncHeaderWidth();
|
|
206
|
+
}
|
|
207
|
+
render() {
|
|
208
|
+
const { active, previous, next, first, itemsPerPage, itemsPerPageOptions, startText, middleText, endText, selectText, listBoxPosition } = this;
|
|
209
|
+
const itemTemplate = (type, index) => {
|
|
210
|
+
if (type === 'number') {
|
|
211
|
+
return (h("li", null, h("r-button", { class: "r-pagination--item number", "data-index": index, variant: "secondary", onRClick: this.handleItemChange }, h("span", { class: "visually-hidden" }, this.pageLabel), " ", index)));
|
|
212
|
+
}
|
|
213
|
+
if (type === 'active') {
|
|
214
|
+
return (h("li", null, h("r-button", { "data-index": index, class: "r-pagination--item number active", rAriaCurrent: "page" }, h("span", { class: "visually-hidden" }, this.pageLabel), " ", index)));
|
|
215
|
+
}
|
|
216
|
+
if (type === 'stepper') {
|
|
217
|
+
return (h("li", { "aria-label": this.ellipsisLabel, class: "r-pagination--item stepper" }, "..."));
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const renderNumbers = () => {
|
|
221
|
+
const totalPages = Math.ceil(this.totalResults / itemsPerPage);
|
|
222
|
+
const maxVisiblePages = 10;
|
|
223
|
+
const items = [];
|
|
224
|
+
const startEdge = 1;
|
|
225
|
+
const endEdge = totalPages;
|
|
226
|
+
const _createItem = (value) => {
|
|
227
|
+
const item = value + 1; // Convert to 1-indexed
|
|
228
|
+
const type = item === active ? 'active' : 'number';
|
|
229
|
+
return itemTemplate(type, item);
|
|
230
|
+
};
|
|
231
|
+
// Case: total pages are less than or equal to maxVisiblePages
|
|
232
|
+
if (totalPages <= maxVisiblePages) {
|
|
233
|
+
return h("ul", { class: "r-pagination--items-list" }, [...Array(totalPages).keys()].map(_createItem));
|
|
234
|
+
}
|
|
235
|
+
// Always add startEdge
|
|
236
|
+
items.push(itemTemplate(active === startEdge ? 'active' : 'number', startEdge));
|
|
237
|
+
const showStartStepper = active > 5;
|
|
238
|
+
const showEndStepper = active < totalPages - 5;
|
|
239
|
+
// Case: active page is near the beginning
|
|
240
|
+
if (!showStartStepper) {
|
|
241
|
+
for (let i = 2; i <= 8; i++) {
|
|
242
|
+
items.push(_createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
243
|
+
}
|
|
244
|
+
items.push(itemTemplate('stepper', null));
|
|
245
|
+
}
|
|
246
|
+
// Case: active page is near the end
|
|
247
|
+
else if (!showEndStepper) {
|
|
248
|
+
items.push(itemTemplate('stepper', null));
|
|
249
|
+
for (let i = totalPages - 7; i < totalPages; i++) {
|
|
250
|
+
items.push(_createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// Case: active page is in the middle
|
|
254
|
+
else {
|
|
255
|
+
items.push(itemTemplate('stepper', null));
|
|
256
|
+
for (let i = active - 2; i <= active + 2; i++) {
|
|
257
|
+
items.push(_createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
258
|
+
}
|
|
259
|
+
items.push(itemTemplate('stepper', null));
|
|
260
|
+
}
|
|
261
|
+
// Always add endEdge
|
|
262
|
+
items.push(itemTemplate(active === endEdge ? 'active' : 'number', endEdge));
|
|
263
|
+
// Ensure the total number of items is 10
|
|
264
|
+
if (items.length > maxVisiblePages) {
|
|
265
|
+
items.splice(1, items.length - maxVisiblePages - 1); // Remove excess items while keeping steppers
|
|
266
|
+
}
|
|
267
|
+
else if (items.length < maxVisiblePages) {
|
|
268
|
+
// Add additional pages if the total number of items is less than 10
|
|
269
|
+
const additionalPages = maxVisiblePages - items.length;
|
|
270
|
+
if (showStartStepper && showEndStepper) {
|
|
271
|
+
for (let i = active + 3; i <= active + 2 + additionalPages; i++) {
|
|
272
|
+
if (i < totalPages) {
|
|
273
|
+
items.splice(items.length - 2, 0, _createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else if (showStartStepper) {
|
|
278
|
+
for (let i = active + 3; i <= active + 2 + additionalPages; i++) {
|
|
279
|
+
if (i < totalPages) {
|
|
280
|
+
items.splice(items.length - 1, 0, _createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else if (showEndStepper) {
|
|
285
|
+
for (let i = active - 3; i >= active - 2 - additionalPages; i--) {
|
|
286
|
+
if (i > 1) {
|
|
287
|
+
items.splice(1, 0, _createItem(i - 1)); // Convert to 0-indexed for _createItem
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return h("ul", { class: "r-pagination--items-list" }, items);
|
|
293
|
+
};
|
|
294
|
+
const renderHeader = () => {
|
|
295
|
+
const startItem = Math.min((active - 1) * itemsPerPage + 1, this.totalResults);
|
|
296
|
+
const endItem = Math.min(active * itemsPerPage, this.totalResults);
|
|
297
|
+
return (h(Fragment, null, h("div", { ref: el => (this.headerRef = el), class: "r-pagination--header" }, h("div", { class: "results-info", "aria-live": "polite" }, startText ? startText : 'Showing', " ", startItem, "\u2013", endItem, " ", middleText ? middleText : 'of', " ", this.totalResults, " ", endText ? endText : 'results'), h("div", null, h("r-select", { class: "r-pagination--header--select", value: this.itemsPerPage.toString(), id: "items-per-page", onRChange: this.handleItemsPerPageChange, label: this.itemsPerPageLabel, "listbox-position": listBoxPosition }, itemsPerPageOptions.map(option => (h("r-select-option", { value: option.toString() }, option, "/", selectText ? selectText : 'page'))))))));
|
|
298
|
+
};
|
|
299
|
+
const isLastPage = active === this.total;
|
|
300
|
+
const renderList = () => {
|
|
301
|
+
if (this.variant === 'minimized') {
|
|
302
|
+
return (h(Fragment, null, h("div", { ref: el => (this.footerRef = el), class: "r-pagination--footer" }, renderNumbers())));
|
|
303
|
+
}
|
|
304
|
+
return (h(Fragment, null, h("div", { ref: el => (this.footerRef = el), class: "r-pagination--footer" }, this.variant === 'maximized' && (h("r-icon-button", { "data-index": first, name: "angle-left-with-vertical-line", size: "s", disabled: this.isNotFirstPage, label: this.firstPageButtonLabel, class: "r-pagination--item arrow first", onRClick: this.handleItemChange })), h("r-icon-button", { "data-index": previous, name: "angle-left", size: "s", disabled: this.isNoPreviousPage, label: this.previousPageButtonLabel, class: "r-pagination--item arrow previous", onRClick: this.handleItemChange }), renderNumbers(), h("r-icon-button", { "data-index": next, name: "angle-right", size: "s", disabled: this.isNoNextPage, label: this.nextPageButtonLabel, class: "r-pagination--item arrow next", onRClick: this.handleItemChange }), this.variant === 'maximized' && (h("r-icon-button", { "data-index": this.total, name: "angle-right-with-vertical-line", size: "s", disabled: isLastPage, label: this.lastPageButtonLabel, class: "r-pagination--item arrow last", onRClick: this.handleItemChange })))));
|
|
305
|
+
};
|
|
306
|
+
return (h(Host, { role: "navigation" }, h("div", { class: "r-pagination" }, this.resultsLine && renderHeader(), renderList())));
|
|
307
|
+
}
|
|
308
|
+
get el() { return getElement(this); }
|
|
309
|
+
static get watchers() { return {
|
|
310
|
+
"totalResults": ["handlePropsChange"],
|
|
311
|
+
"itemsPerPage": ["handlePropsChange"],
|
|
312
|
+
"variant": ["handlePropsChange"],
|
|
313
|
+
"pageActive": ["handlePropsChange"]
|
|
314
|
+
}; }
|
|
315
|
+
};
|
|
316
|
+
RPagination.style = paginationCss;
|
|
317
|
+
|
|
318
|
+
export { RPagination as r_pagination };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CTxpqopm.js';
|
|
2
|
+
|
|
3
|
+
const panelCss = ":host{--r-panel--min-width:18.75rem;--r-panel--background-color:var(--r-background-soft, #F3F1F0);--r-panel--display:flex;--r-panel--flex-direction:column;--r-panel--position:fixed;--r-panel--align-items:flex-start;--r-panel--top:0;--r-panel--padding:8px 0;--r-panel--width:18.75rem;--r-panel--height:100%;--r-panel--color:var(--r-text-regular, #282828);--r-panel--transition:all 250ms ease-in-out;--r-panel--transform:none;--r-panel--font-family:var(--r-font-family-text);--r-panel--left:0;--r-panel--header--display:flex;--r-panel--header--padding:12px 16px;--r-panel--header--justify-content:space-between;--r-panel--header--align-items:center;--r-panel--header--align-self:stretch;--r-panel--header--icon-rotate:none;--r-panel--header--flex-direction:row;--r-panel--header--gap:3.125rem;--r-panel--header--logo--img--width:100%;--r-panel--header--logo--img--height:auto;--r-panel--header--logo--img--expanded--width:12rem;--r-panel--header--logo--img--collapsed--width:1.875rem;--r-panel--header--height:unset;--r-panel--body--display:block;--r-panel--body--flex-grow:1;--r-panel--body--align-self:stretch;--r-panel--body--overflow:auto;--r-panel--body--padding:4px 8px 0;--r-panel--body-header--color:var(--r-text-soft, #686868);--r-panel--body-header--font-size:var(--r-font-size-400, 1rem);--r-panel--body-header--font-weight:var(--r-font-weight-regular, 400);--r-panel--body-header--padding:16px 0;--r-panel--body-header--width:16.75rem;--r-panel--body-header--margin:0px;--r-panel--footer--dispay:flex;--r-panel--footer--width:100%;--r-panel--footer--padding:16px 16px 24px;--r-panel--footer--flex-direction:column;--r-panel--footer--justify-content:center;--r-panel--footer-gap:var(--spacing-100, 1rem);--r-panel--footer--align-self:stretch;--r-panel--footer--text-align:center}:host([variant=drawer]) r-button{--r-button--padding:0.625rem;--r-button--background:var(--r-background-interactive-softer, #E7E4E2);--r-button--border-radius:10%;--r-button--slot--position:relative;--r-button--left:5%}:host([variant=drawer][collapsed]){--r-panel--width:var(--r-spacing-450, 4.5rem);--r-panel--header--display:none;--r-panel--header--icon-rotate:rotate(180deg);--r-panel--header--logo--expaned--display:none;--r-panel--header--logo--collapsed--display:block;--r-panel--header--flex-direction:column;--r-panel--header--gap:0.625rem;--r-list-item--epxanded--background-color:rgba(40, 40, 40, 0.08)}:host([variant=drawer][collapsed]) r-button{--r-button--slot--position:inherit;transition:transform 250ms ease-in-out}:host([variant=modal][collapsed]){--r-panel--transform:translate(-100%)}:host([collapsed]:not([variant=modal])){--r-panel--min-width:0;--r-list-item--sr-text--display:block;--r-list-item--text--display:none;--r-list-item--trailing--display:none}:host([variant=drawer]:not([has-header]):not([collapsed])),:host([variant=drawer][has-header=false]:not([collapsed])){--r-panel--header--height:var(--spacing-150, 1.5rem);--r-panel--header--padding:12px 8px 0 16px}:host([variant=drawer]:not([has-header]):not([collapsed])) r-button,:host([variant=drawer][has-header=false]:not([collapsed])) r-button{--r-button--top:20%;--r-button--left:97%}:host([collapsed]){--r-list-item--active-parent--background-color:rgba(40, 40, 40, 0.08)}.r-panel{z-index:2;min-width:var(--r-panel--min-width);background-color:var(--r-panel--background-color);display:var(--r-panel--display);flex-direction:var(--r-panel--flex-direction);align-items:var(--r-panel--align-items);width:var(--r-panel--width);height:var(--r-panel--height);position:var(--r-panel--position);top:var(--r-panel--top);padding:var(--r-panel--padding);color:var(--r-panel--color);transition:var(--r-panel--transition);transform:var(--r-panel--transform);left:var(--r-panel--left);font-family:var(--r-panel--font-family);box-sizing:border-box}.r-panel .logo-wrapper .logo-expanded{width:var(--r-panel--header--logo--img--expanded--width)}.r-panel .logo-wrapper .logo-collapsed{width:var(--r-panel--header--logo--img--collapsed--width)}.r-panel .logo-wrapper img{width:var(--r-panel--header--logo--img--width);height:var(--r-panel--header--logo--img--height)}.r-panel .logo-wrapper:focus,.r-panel .logo-wrapper:focus-visible{box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);outline:2px solid var(--r-border-focused, #0071e3);outline-offset:2px}.r-panel--header{display:flex;padding:var(--r-panel--header--padding);justify-content:var(--r-panel--header--justify-content);align-items:var(--r-panel--header--align-items);align-self:var(--r-panel--header--align-self);flex-direction:var(--r-panel--header--flex-direction);gap:var(--r-panel--header--gap);height:var(--r-panel--header--height)}.r-panel--header r-button{--r-button--padding:0;transform:var(--r-panel--header--icon-rotate);background:var(--r-button--background);position:var(--r-button--slot--position);left:var(--r-button--left);top:var(--r-button--top);border-radius:var(--r-button--border-radius)}.r-panel--body{flex-grow:var(--r-panel--body--flex-grow);align-self:var(--r-panel--body--align-self);display:var(--r-panel--body--display);overflow:var(--r-panel--body--overflow);padding:var(--r-panel--body--padding)}.r-panel--body ::slotted(.header){color:var(--r-panel--body-header--color);font-size:var(--r-panel--body-header--font-size);font-weight:var(--r-panel--body-header--font-weight);padding:var(--r-panel--body-header--padding);display:var(--r-panel--header--display);width:var(--r-panel--body-header--width);margin:var(--r-panel--body-header--margin)}.r-panel--footer{width:var(--r-panel--footer--width)}.r-panel ::slotted([slot=footer]){display:var(--r-panel--footer--dispay);padding:var(--r-panel--footer--padding);flex-direction:var(--r-panel--footer--flex-direction);justify-content:var(--r-panel--footer--justify-content);gap:var(--r-panel--footer-gap);align-self:var(--r-panel--footer--align-self);text-align:var(--r-panel--footer--text-align)}.r-panel ::slotted(ul){margin:var(--r-panel--item-list--margin, 0);padding:var(--r-panel--item-list--padding, 0);list-style-type:var(--r-panel--item-list--list-style-type, \"\")}@media (prefers-reduced-motion){.r-panel,:host([variant=drawer][collapsed]) r-button{transition:none}}";
|
|
4
|
+
|
|
5
|
+
const Panel = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.panelStateChanged = createEvent(this, "panelStateChanged");
|
|
9
|
+
/** A boolean property that indicates whether the component includes a header */
|
|
10
|
+
this.hasHeader = false;
|
|
11
|
+
/** A boolean property that indicates whether the navitems are active of not */
|
|
12
|
+
this.active = false;
|
|
13
|
+
/** A boolean property that indicates whether the component includes a footer */
|
|
14
|
+
this.hasFooter = false;
|
|
15
|
+
/** Presentational style */
|
|
16
|
+
this.variant = 'visible';
|
|
17
|
+
/** A boolean property that determines the collapsed state of the component. The default state is `false`. */
|
|
18
|
+
this.collapsed = false;
|
|
19
|
+
/** Aria-label text for collapse */
|
|
20
|
+
this.labelCollapse = 'Collapse panel';
|
|
21
|
+
/** Aria-label text for expand */
|
|
22
|
+
this.labelExpand = 'Expand panel';
|
|
23
|
+
this.isCollapsed = this.collapsed;
|
|
24
|
+
// Pre-bound method for event listeners
|
|
25
|
+
this.updateCurrentLocationBound = this.updateCurrentLocation.bind(this);
|
|
26
|
+
this.handleSemiCollapsedButtonClick = () => {
|
|
27
|
+
this.togglePanel();
|
|
28
|
+
const parentPanels = document.querySelectorAll('r-list-item[expanded]');
|
|
29
|
+
if (this.isCollapsed) {
|
|
30
|
+
parentPanels.forEach(parentPanel => {
|
|
31
|
+
parentPanel.removeAttribute('expanded');
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
parentPanels.forEach(parentPanel => {
|
|
36
|
+
parentPanel.setAttribute('expanded', '');
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
this.handleFullyCollapsedButtonClick = () => {
|
|
41
|
+
this.collapsePanel();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
toggleSubItems(event) {
|
|
45
|
+
const target = event.target;
|
|
46
|
+
if (target.tagName === 'R-LIST-ITEM' && this.isCollapsed && this.variant) {
|
|
47
|
+
const hasSubItems = target.hasAttribute('has-sub-items');
|
|
48
|
+
if (hasSubItems) {
|
|
49
|
+
this.expandPanel();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Expand/Collapse Panel */
|
|
54
|
+
async togglePanel() {
|
|
55
|
+
this.isCollapsed = !this.isCollapsed;
|
|
56
|
+
}
|
|
57
|
+
/** Expand Panel */
|
|
58
|
+
async expandPanel() {
|
|
59
|
+
this.isCollapsed = false;
|
|
60
|
+
}
|
|
61
|
+
/** Collapse Panel */
|
|
62
|
+
async collapsePanel() {
|
|
63
|
+
this.isCollapsed = true;
|
|
64
|
+
}
|
|
65
|
+
handleCollapseChange(collapsed) {
|
|
66
|
+
this.isCollapsed = collapsed;
|
|
67
|
+
// Save the state to localStorage whenever it changes
|
|
68
|
+
if (this.variant === 'drawer' || this.variant === 'modal') {
|
|
69
|
+
localStorage.setItem('panelState', JSON.stringify(collapsed));
|
|
70
|
+
this.panelStateChanged.emit({ collapsed });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
watchVariant(newVariant) {
|
|
74
|
+
this.isCollapsed = newVariant === 'modal';
|
|
75
|
+
}
|
|
76
|
+
handleDocumentClick(event) {
|
|
77
|
+
this.handleClickOutside(event);
|
|
78
|
+
}
|
|
79
|
+
getNavLinks() {
|
|
80
|
+
return document.querySelectorAll('r-list-item[href]');
|
|
81
|
+
}
|
|
82
|
+
get isVariantCollapsible() {
|
|
83
|
+
return this.variant === 'modal';
|
|
84
|
+
}
|
|
85
|
+
/*
|
|
86
|
+
* Collapse the panel when a click occurs outside of it (in mobile/when variant is 'modal'):
|
|
87
|
+
* Check if the clicked target is not an R-BUTTON element (that is the button[hamburger] that toggles the panel in mobile)
|
|
88
|
+
* Check if the click happened outside of the host element
|
|
89
|
+
* Ensure the variant is 'modal' and the panel is currently expanded
|
|
90
|
+
*/
|
|
91
|
+
handleClickOutside(event) {
|
|
92
|
+
if (event.target.tagName !== 'R-BUTTON' &&
|
|
93
|
+
!this.host.contains(event.target) &&
|
|
94
|
+
this.isVariantCollapsible &&
|
|
95
|
+
!this.isCollapsed) {
|
|
96
|
+
this.collapsePanel();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
componentWillLoad() {
|
|
100
|
+
this.isCollapsed = this.isVariantCollapsible;
|
|
101
|
+
if (this.variant === 'drawer') {
|
|
102
|
+
const savedState = localStorage.getItem('panelState');
|
|
103
|
+
this.isCollapsed = savedState ? JSON.parse(savedState) : this.isCollapsed;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
componentWillRender() {
|
|
107
|
+
window.addEventListener('popstate', this.updateCurrentLocationBound);
|
|
108
|
+
window.addEventListener('hashchange', this.updateCurrentLocationBound);
|
|
109
|
+
this.highlightCurrentLink();
|
|
110
|
+
}
|
|
111
|
+
componentDidRender() {
|
|
112
|
+
this.highlightCurrentLink();
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
window.removeEventListener('popstate', this.updateCurrentLocationBound);
|
|
116
|
+
window.removeEventListener('hashchange', this.updateCurrentLocationBound);
|
|
117
|
+
}
|
|
118
|
+
updateCurrentLocation() {
|
|
119
|
+
this.currentLocation = window.location.hash ? window.location.hash.slice(1) : window.location.href;
|
|
120
|
+
this.highlightCurrentLink();
|
|
121
|
+
}
|
|
122
|
+
// Highlight the current link based on the current URL
|
|
123
|
+
// Scroll the active link into view
|
|
124
|
+
highlightCurrentLink() {
|
|
125
|
+
const navLinks = this.getNavLinks();
|
|
126
|
+
navLinks.forEach((link) => {
|
|
127
|
+
if (link instanceof HTMLElement) {
|
|
128
|
+
const linkHref = link.getAttribute('href');
|
|
129
|
+
const isActive = linkHref === this.currentLocation || linkHref === window.location.pathname + window.location.hash;
|
|
130
|
+
this.updateLinkState(link, isActive);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const activeLink = document.querySelector('.active');
|
|
134
|
+
if (activeLink) {
|
|
135
|
+
activeLink.scrollIntoView({
|
|
136
|
+
behavior: 'smooth',
|
|
137
|
+
block: 'end'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Update link attributes based on active state
|
|
142
|
+
updateLinkState(link, isActive) {
|
|
143
|
+
if (isActive) {
|
|
144
|
+
link.setAttribute('active', '');
|
|
145
|
+
link.classList.add('active');
|
|
146
|
+
this.expandParentMenus(link);
|
|
147
|
+
this.highlightParent(link);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
link.removeAttribute('active');
|
|
151
|
+
link.classList.remove('active');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
highlightParent(link) {
|
|
155
|
+
const parentActive = link.parentElement;
|
|
156
|
+
if (parentActive && parentActive.tagName === 'R-LIST-ITEM') {
|
|
157
|
+
parentActive.setAttribute('active-parent', '');
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
expandParentMenus(link) {
|
|
161
|
+
var _a;
|
|
162
|
+
let parentPanel = link.closest('r-list-item[has-sub-items]');
|
|
163
|
+
while (parentPanel && !this.isCollapsed) {
|
|
164
|
+
parentPanel.setAttribute('expanded', '');
|
|
165
|
+
parentPanel = (_a = parentPanel.parentElement) === null || _a === void 0 ? void 0 : _a.closest('r-panel');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
render() {
|
|
169
|
+
return (h(Host, { key: '44996078c23da8ce9b5b48044d24d45778e688b4', role: "navigation", collapsed: this.isCollapsed }, h("div", { key: 'a217b08d3fda5e4f8761d971074e3de797363f32', class: "r-panel" }, h("div", { key: '8ff71b762feffd1cc9478014e011fc60875a5e3d', class: "r-panel--header" }, this.hasHeader && (h("a", { key: '9ad8475299e9f04341cc1c4b5b9e65551f2f6ca2', class: "logo-wrapper", href: this.logoLink }, this.isCollapsed ?
|
|
170
|
+
h("slot", { name: "logo-collapsed" })
|
|
171
|
+
:
|
|
172
|
+
h("slot", { name: "logo-expanded" }))), this.variant === 'modal' ? (h("r-button", { class: "r-panel--trigger", variant: "blank", icon: "cross", rAriaLabel: `${this.labelCollapse}`, onClick: this.handleFullyCollapsedButtonClick })) : this.variant === 'drawer' ? (h("r-button", { class: "r-panel--trigger", variant: "blank", icon: "angle-left", rAriaLabel: this.isCollapsed ? `${this.labelExpand}` : `${this.labelCollapse}`, onClick: this.handleSemiCollapsedButtonClick })) : this.variant === 'visible' ? (null) : null), h("div", { key: '14b5a3ee0e11eda6585a84e0f05aa682950fbce2', class: "r-panel--body" }, h("slot", { key: 'e008d4f4796415779cd8e3dbda696b966b4ac184' })), this.hasFooter && !this.isCollapsed && (h("div", { key: '702c5859f2a7aa60903ec1df29f8977cf46dd0b8', class: "r-panel--footer" }, h("slot", { key: '347796d3e0bbffed77ae9368270f6e27eb93e156', name: "footer" }))))));
|
|
173
|
+
}
|
|
174
|
+
get host() { return getElement(this); }
|
|
175
|
+
static get watchers() { return {
|
|
176
|
+
"isCollapsed": ["handleCollapseChange"],
|
|
177
|
+
"variant": ["watchVariant"]
|
|
178
|
+
}; }
|
|
179
|
+
};
|
|
180
|
+
Panel.style = panelCss;
|
|
181
|
+
|
|
182
|
+
export { Panel as r_panel };
|