@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,492 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BnETQtSf.js');
|
|
4
|
+
|
|
5
|
+
const iconButtonCss = ":host{display:inline-flex;vertical-align:top;--r-icon-button--color:inherit}:host(:hover:not([disabled]:not([disabled=false])):not(:active)){--r-icon-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host(:active:not([disabled]:not([disabled=false]))){--r-icon-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host(:focus-within:not(:active):not([disabled]:not([disabled=false]))){box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);outline:2px solid var(--r-border-focused, #0071e3);outline-offset:2px}:host([disabled]:not([disabled=false])){opacity:0.4;--r-icon-button--cursor:not-allowed;--r-icon-button--box-shadow:none;--r-icon-button--background-color:transparent}:host([variant=contained]){--r-icon-button--color:var(--r-icon-inverse, #fff);--r-icon-button--background-color:var(--r-background-interactive-regular, #282828);--r-icon-button--box-shadow:none}:host([variant=contained]:hover:not([disabled]:not([disabled=false]))){--r-icon-button--color:var(--r-icon-regular, #282828);--r-icon-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([variant=contained]:active:not([disabled]:not([disabled=false]))){--r-icon-button--color:var(--r-icon-regular, #282828);--r-icon-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([variant=contained][disabled]:not([disabled=false])){--r-icon-button--color:var(--r-icon-inverse, #fff);--r-icon-button--background-color:var(--r-background-interactive-regular, #282828)}:host([size=s]){--r-icon-button--height:1.5rem;--r-icon-button--width:1.5rem}:host([size=m]){--r-icon-button--height:2.25rem;--r-icon-button--width:2.25rem}:host([size=l]){--r-icon-button--height:2.75rem;--r-icon-button--width:2.75rem}.r-icon-button{display:var(--r-icon-button--display, inline-flex);align-items:var(--r-icon-button--align-items, center);justify-content:var(--r-icon-button--justify-content, center);outline:var(--r-icon-button--outline, none);cursor:var(--r-icon-button--cursor, pointer);pointer-events:var(--r-icon-button--pointer-events, initial);padding:var(--r-icon-button--padding, 0);border:var(--r-icon-button--border, none);color:var(--r-icon-button--color, inherit);background-color:var(--r-icon-button--background-color, transparent);box-sizing:var(--r-icon-button--box-sizing, border-box);border-width:var(--r-icon-button--border-width, 1px);border-style:var(--r-icon-button--border-style, solid);border-color:var(--r-icon-button--border-color, transparent);border-radius:var(--r-icon-button--border-radius, 50%);z-index:var(--r-icon-button--z-index, initial);width:var(--r-icon-button--width, 2.25rem);height:var(--r-icon-button--height, 2.25rem)}.r-icon-button--target-area{position:var(--r-icon-button--target-area--position, absolute);background:var(--r-icon-button--target-area--background, rgba(0, 0, 0, 0));width:var(--r-icon-button--target-area--width, 2.75rem);height:var(--r-icon-button--target-area--height, 2.75rem);z-index:var(--r-icon-button--target-area--z-index, 1)}.r-icon-button--icon{display:flex;align-items:center;justify-content:center}.visually-hidden{position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}";
|
|
6
|
+
|
|
7
|
+
const IconButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.rClick = index.createEvent(this, "rClick");
|
|
11
|
+
/**
|
|
12
|
+
* Defines the size of the icon used within the button.
|
|
13
|
+
*/
|
|
14
|
+
this.size = 'm';
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use the `<r-tooltip>` component as a wrapper instead.
|
|
17
|
+
* Sets position for the tooltip.
|
|
18
|
+
* - `top`: Tooltip appears above the button.
|
|
19
|
+
* - `bottom`: Tooltip appears below the button.
|
|
20
|
+
* - `left`: Tooltip appears to the left of the button.
|
|
21
|
+
* - `right`: Tooltip appears to the right of the button.
|
|
22
|
+
*/
|
|
23
|
+
this.tooltipPosition = 'top';
|
|
24
|
+
/**
|
|
25
|
+
* Defines the visual style of the button.
|
|
26
|
+
* - `standard`: Default button style.
|
|
27
|
+
* - `contained`: Button with a contained background.
|
|
28
|
+
*/
|
|
29
|
+
this.variant = 'standard';
|
|
30
|
+
this._handleClick = (event) => {
|
|
31
|
+
if (this.disabled) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.rClick.emit();
|
|
36
|
+
};
|
|
37
|
+
this.onFocus = () => {
|
|
38
|
+
this.setFocus();
|
|
39
|
+
};
|
|
40
|
+
this.onBlur = () => {
|
|
41
|
+
this.setBlur();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Simulate a button click */
|
|
45
|
+
async triggerClick() {
|
|
46
|
+
var _a;
|
|
47
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.click();
|
|
48
|
+
}
|
|
49
|
+
/** Set focus on the button */
|
|
50
|
+
async setFocus() {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
53
|
+
}
|
|
54
|
+
/** Remove focus from the button */
|
|
55
|
+
async setBlur() {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const { name, size, disabled, tooltipText, tooltipPosition } = this;
|
|
61
|
+
const buttonAttrs = {
|
|
62
|
+
disabled,
|
|
63
|
+
};
|
|
64
|
+
const iconAttrs = {
|
|
65
|
+
name,
|
|
66
|
+
size
|
|
67
|
+
};
|
|
68
|
+
const buttonTemplate = () => (index.h("button", Object.assign({ key: 'df699957ba93858e755bfdf29de83a3ab9718fe3', type: "button", tabindex: !this.disabled && this.rTabindex || null, class: "r-icon-button", "aria-label": this.host.getAttribute('aria-label') || null }, buttonAttrs, { onClick: this._handleClick, onFocus: this.onFocus, onBlur: this.onBlur, ref: (el) => (this.nativeElement = el) }), name ?
|
|
69
|
+
index.h("r-icon", Object.assign({}, iconAttrs))
|
|
70
|
+
:
|
|
71
|
+
index.h("r-icon", { size: size, class: "r-icon-button--icon" }, index.h("slot", null)), index.h("span", { key: '86e9640751a2e75f24ba6eb1d75850251f629579', class: "r-icon-button--label visually-hidden" }, this.label), index.h("span", { key: '509e3f6870a4da1e788082a8af5a50c93e8360b5', class: "r-icon-button--target-area" })));
|
|
72
|
+
return (index.h(index.Host, { key: 'e829d0c5038ebe4893b998b832bbff3c62335327' }, !disabled && tooltipText ?
|
|
73
|
+
index.h("r-tooltip", { text: tooltipText, position: tooltipPosition }, buttonTemplate())
|
|
74
|
+
:
|
|
75
|
+
buttonTemplate()));
|
|
76
|
+
}
|
|
77
|
+
get host() { return index.getElement(this); }
|
|
78
|
+
};
|
|
79
|
+
IconButton.style = iconButtonCss;
|
|
80
|
+
|
|
81
|
+
const tooltipCss = ":host{display:inline-block}:host slot{display:contents}:host([data-position=bottom]){--r-tooltip--arrow--transform:rotate(0)}:host([data-position=right]){--r-tooltip--arrow--transform:rotate(270deg)}:host([data-position=left]){--r-tooltip--arrow--transform:rotate(90deg)}.r-tooltip{position:var(--r-tooltip--position, relative)}.r-tooltip:has(.r-tooltip--content--visible){--r-tooltip--content--display:flex;--r-tooltip--content--z-index:1060;--r-tooltip--arrow--display:flex}.r-tooltip--trigger{color:var(--r-tooltip--trigger--color, inherit);box-shadow:var(--r-tooltip--trigger--box-shadow, none);outline:var(--r-tooltip--trigger--outline, none);outline-offset:var(--r-tooltip--trigger--outline-offset, 0)}.r-tooltip--trigger:focus{--r-tooltip--trigger--box-shadow:0 0 0 6px var(--r-border-focused-outlined);--r-tooltip--trigger--outline:2px solid var(--r-border-focused);--r-tooltip--trigger--outline-offset:2px}.r-tooltip--content{position:var(--r-tooltip--content--position, fixed);display:var(--r-tooltip--content--display, none);justify-content:var(--r-tooltip--content--justify-content, center);align-items:var(--r-tooltip--content--align-items, center);color:var(--r-tooltip--content--color, var(--r-text-inverse));background-color:var(--r-tooltip--content--background-color, var(--r-background-inverse));font-family:var(--r-tooltip--content--font-family, var(--r-font-family-text));font-weight:var(--r-tooltip--content--font-weight, var(--r-font-weight-regular));font-size:var(--r-tooltip--content--font-size, var(--r-font-size-200));line-height:var(--r-tooltip--content--line-height, var(--r-line-height-s));min-width:var(--r-tooltip--content--min-width, 32px);max-width:var(--r-tooltip--content--max-width, 300px);min-height:var(--r-tooltip--content--min-height, 32px);padding:var(--r-tooltip--content--padding, var(--r-spacing-050) var(--r-spacing-100));width:var(--r-tooltip--content--width, max-content);word-break:var(--r-tooltip--content--word-break, break-word);box-sizing:var(--r-tooltip--content--box-sizing, border-box);z-index:var(--r-tooltip--content--z-index, 0);white-space:var(--r-tooltip--content--white-space, normal)}.r-tooltip--arrow{display:var(--r-tooltip--arrow--display, none);position:var(--r-tooltip--arrow--position, fixed);width:var(--r-tooltip--arrow--width, 12px);height:var(--r-tooltip--arrow--height, 12px);transform:var(--r-tooltip--arrow--transform, rotate(180deg));z-index:var(--r-tooltip--content--z-index)}.r-tooltip--arrow:after{content:var(--r-tooltip--arrow--inner-content, \"\");display:var(--r-tooltip--arrow--inner--display, block);width:var(--r-tooltip--arrow--inner--width, 12px);height:var(--r-tooltip--arrow--inner--height, 6px);background-color:var(--r-tooltip--arrow--inner--background-color, var(--r-background-inverse));clip-path:var(--r-tooltip--arrow--inner--clip-path, polygon(50% 0%, 0% 100%, 100% 100%));border-radius:var(--r-tooltip--arrow--inner--border-radius, 0);align-self:var(--r-tooltip--arrow--inner--align-self, flex-end)}";
|
|
82
|
+
|
|
83
|
+
const OFFSET = 20;
|
|
84
|
+
const Tooltip = class {
|
|
85
|
+
constructor(hostRef) {
|
|
86
|
+
index.registerInstance(this, hostRef);
|
|
87
|
+
this.rTooltipFocus = index.createEvent(this, "rTooltipFocus");
|
|
88
|
+
/** Tooltip display text */
|
|
89
|
+
this.text = '';
|
|
90
|
+
/** Specifies tooltip position */
|
|
91
|
+
this.position = 'top';
|
|
92
|
+
this.arrowPositionState = 'left';
|
|
93
|
+
this.isShown = false;
|
|
94
|
+
this.uniqueId = `r-tooltip-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
95
|
+
this.getOffsetLeft = (arrowPosition) => {
|
|
96
|
+
var _a, _b, _c;
|
|
97
|
+
const offsetLeft = Math.abs(((_a = this.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) - ((_c = (_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c.width));
|
|
98
|
+
switch (arrowPosition) {
|
|
99
|
+
case 'center':
|
|
100
|
+
return offsetLeft / 2;
|
|
101
|
+
case 'right':
|
|
102
|
+
return offsetLeft;
|
|
103
|
+
default:
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
this.alignTooltipPosition = () => {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
const elementRect = (_a = this.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
110
|
+
const tooltipRect = (_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
111
|
+
const offsetLeft = this.getOffsetLeft(this.arrowPositionState);
|
|
112
|
+
const hostHeight = (elementRect === null || elementRect === void 0 ? void 0 : elementRect.height) + this.arrowHeight || 0;
|
|
113
|
+
switch (this.positionState) {
|
|
114
|
+
case 'top':
|
|
115
|
+
this.alignPosition(this.tooltip, -offsetLeft, -this.tooltipContainerHeight);
|
|
116
|
+
break;
|
|
117
|
+
case 'bottom':
|
|
118
|
+
this.alignPosition(this.tooltip, -offsetLeft, hostHeight);
|
|
119
|
+
break;
|
|
120
|
+
case 'left':
|
|
121
|
+
this.tooltip.style.left = `${elementRect.left - tooltipRect.width - this.arrowWidth}px`;
|
|
122
|
+
this.tooltip.style.top = `${elementRect.top + elementRect.height / 2 - tooltipRect.height / 2}px`;
|
|
123
|
+
break;
|
|
124
|
+
case 'right':
|
|
125
|
+
this.tooltip.style.left = `${elementRect.left + elementRect.width + this.arrowWidth}px`;
|
|
126
|
+
this.tooltip.style.top = `${elementRect.top + elementRect.height / 2 - tooltipRect.height / 2}px`;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
this.alignArrowPosition = () => {
|
|
131
|
+
var _a, _b, _c, _d;
|
|
132
|
+
const elementRect = (_a = this.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
133
|
+
const tooltipRect = (_b = this.tooltip) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
|
134
|
+
const hostHeight = (elementRect === null || elementRect === void 0 ? void 0 : elementRect.height) || 0;
|
|
135
|
+
const offsetLeft = Math.abs((elementRect === null || elementRect === void 0 ? void 0 : elementRect.width) - ((_d = (_c = this.arrow) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.width)) / 2;
|
|
136
|
+
const arrowCenterY = (elementRect === null || elementRect === void 0 ? void 0 : elementRect.top) + elementRect.height / 2 - this.arrowHeight / 2;
|
|
137
|
+
switch (this.positionState) {
|
|
138
|
+
case 'top':
|
|
139
|
+
this.alignPosition(this.arrow, offsetLeft, -this.arrowHeight);
|
|
140
|
+
break;
|
|
141
|
+
case 'bottom':
|
|
142
|
+
this.alignPosition(this.arrow, offsetLeft, hostHeight);
|
|
143
|
+
break;
|
|
144
|
+
case 'left':
|
|
145
|
+
this.arrow.style.left = `${tooltipRect.left + tooltipRect.width}px`;
|
|
146
|
+
this.arrow.style.top = `${arrowCenterY}px`;
|
|
147
|
+
break;
|
|
148
|
+
case 'right':
|
|
149
|
+
this.arrow.style.left = `${tooltipRect.left - this.arrowWidth}px`;
|
|
150
|
+
this.arrow.style.top = `${arrowCenterY}px`;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
this.alignPosition = (element, offsetLeft, offsetTop) => {
|
|
155
|
+
var _a;
|
|
156
|
+
if (!element) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
let elementOffset = (_a = this.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
160
|
+
let left = elementOffset.left + offsetLeft;
|
|
161
|
+
let top = elementOffset.top + offsetTop;
|
|
162
|
+
element.style.left = `${left > 0 ? left : 0}px`;
|
|
163
|
+
element.style.top = `${top}px`;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Listen on hovering tooltip element and update tooltip position if needed
|
|
167
|
+
*/
|
|
168
|
+
this.handleHover = () => {
|
|
169
|
+
this.showTooltip();
|
|
170
|
+
this.setCorrectPosition();
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Listen on focusing tooltip element and update tooltip position if needed
|
|
174
|
+
*/
|
|
175
|
+
this.handleFocus = () => {
|
|
176
|
+
this.showTooltip();
|
|
177
|
+
this.setCorrectPosition();
|
|
178
|
+
this.rTooltipFocus.emit({ element: this.element });
|
|
179
|
+
};
|
|
180
|
+
this.showTooltip = () => {
|
|
181
|
+
var _a;
|
|
182
|
+
this.isShown = true;
|
|
183
|
+
this.tooltip.classList.add('r-tooltip--content--visible');
|
|
184
|
+
this.updateZIndex();
|
|
185
|
+
const interactiveElement = this.getInteractiveElement(this.activeElement);
|
|
186
|
+
interactiveElement === null || interactiveElement === void 0 ? void 0 : interactiveElement.setAttribute('aria-description', (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.innerText);
|
|
187
|
+
};
|
|
188
|
+
this.removeTooltip = () => {
|
|
189
|
+
this.isShown = false;
|
|
190
|
+
this.tooltip.style.width = 'max-content';
|
|
191
|
+
this.tooltip.style.zIndex = '';
|
|
192
|
+
this.arrow.style.zIndex = '';
|
|
193
|
+
this.tooltip.classList.remove('r-tooltip--content--visible');
|
|
194
|
+
const interactiveElement = this.getInteractiveElement(this.activeElement);
|
|
195
|
+
interactiveElement === null || interactiveElement === void 0 ? void 0 : interactiveElement.removeAttribute('aria-description');
|
|
196
|
+
};
|
|
197
|
+
this.handleScroll = () => {
|
|
198
|
+
if (!this.isShown) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (!this.isOnScreen) {
|
|
202
|
+
this.removeTooltip();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
this.setCorrectPosition();
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Watch on position value change and update tooltip position if needed
|
|
210
|
+
*/
|
|
211
|
+
handleVerticalPosition() {
|
|
212
|
+
this.setCorrectPosition();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Listen on window scroll and update tooltip position if needed
|
|
216
|
+
*/
|
|
217
|
+
handleScrolling() {
|
|
218
|
+
this.setCorrectPosition();
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Listen on window resizing and update tooltip position if needed
|
|
222
|
+
*/
|
|
223
|
+
handleResizing() {
|
|
224
|
+
this.setCorrectPosition();
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Listen on window keydown and hide tooltip if needed
|
|
228
|
+
*/
|
|
229
|
+
handleKeydown(event) {
|
|
230
|
+
if (this.isShown && event.key === 'Escape') {
|
|
231
|
+
this.removeTooltip();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Parent with non visible overflow
|
|
236
|
+
*/
|
|
237
|
+
get overflowedParent() {
|
|
238
|
+
return this.findOverflowParent(this.element.parentElement);
|
|
239
|
+
}
|
|
240
|
+
get arrowWidth() {
|
|
241
|
+
var _a;
|
|
242
|
+
return ((_a = this.arrow) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
243
|
+
}
|
|
244
|
+
get arrowHeight() {
|
|
245
|
+
var _a;
|
|
246
|
+
return ((_a = this.arrow) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) || 0;
|
|
247
|
+
}
|
|
248
|
+
get tooltipContainerWidth() {
|
|
249
|
+
var _a, _b;
|
|
250
|
+
return ((_b = (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.width) + this.arrowWidth || 0;
|
|
251
|
+
}
|
|
252
|
+
get tooltipContainerHeight() {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
return ((_b = (_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.height) + this.arrowHeight || 0;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Available space at the top
|
|
258
|
+
*/
|
|
259
|
+
get top() {
|
|
260
|
+
return this.element.getBoundingClientRect().top;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Available space on the left
|
|
264
|
+
*/
|
|
265
|
+
get left() {
|
|
266
|
+
return this.element.getBoundingClientRect().left;
|
|
267
|
+
}
|
|
268
|
+
get isOnScreen() {
|
|
269
|
+
const parent = this.overflowedParent || document.documentElement;
|
|
270
|
+
const parentRect = parent.getBoundingClientRect();
|
|
271
|
+
const elementRect = this.element.getBoundingClientRect();
|
|
272
|
+
const isVerticallyVisible = elementRect.top >= parentRect.top && elementRect.bottom <= parentRect.bottom;
|
|
273
|
+
const isHorizontallyVisible = elementRect.left >= parentRect.left && elementRect.right <= parentRect.right;
|
|
274
|
+
return isVerticallyVisible && isHorizontallyVisible;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Available space at the bottom
|
|
278
|
+
*/
|
|
279
|
+
get bottom() {
|
|
280
|
+
function calculateBottomSpace(element) {
|
|
281
|
+
return window.innerHeight - element.getBoundingClientRect().top - element.getBoundingClientRect().height;
|
|
282
|
+
}
|
|
283
|
+
return calculateBottomSpace(this.element);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Available space on the right
|
|
287
|
+
*/
|
|
288
|
+
get right() {
|
|
289
|
+
function calculateRightSpace(element) {
|
|
290
|
+
return window.innerWidth - element.getBoundingClientRect().left - element.getBoundingClientRect().width;
|
|
291
|
+
}
|
|
292
|
+
return calculateRightSpace(this.element);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Defines which horizontal placement is available
|
|
296
|
+
*/
|
|
297
|
+
get horizontalPlacement() {
|
|
298
|
+
return this.tooltipContainerWidth + OFFSET < this.left ? 'left' : 'right';
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Defines which vertical placement is available
|
|
302
|
+
*/
|
|
303
|
+
get verticalPlacement() {
|
|
304
|
+
return this.tooltipContainerHeight + OFFSET < this.top ? 'top' : 'bottom';
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Checks if there is enough space for placing tooltip vertically
|
|
308
|
+
*/
|
|
309
|
+
get isEnoughSpaceVertically() {
|
|
310
|
+
return this.tooltipContainerHeight + OFFSET < this.top || this.tooltipContainerHeight + OFFSET < this.bottom;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Checks if there is enough space for placing tooltip horizontally
|
|
314
|
+
*/
|
|
315
|
+
get isEnoughSpaceHorizontally() {
|
|
316
|
+
return this.tooltipContainerWidth + OFFSET < this.left || this.tooltipContainerWidth + OFFSET < this.right;
|
|
317
|
+
}
|
|
318
|
+
get activeElement() {
|
|
319
|
+
return this.element.querySelector('r-button, r-icon-button, a, button, [tabindex]:not([tabindex="-1"])');
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Gets the actual interactive element (button/link) from within r-button or r-icon-button shadow DOM,
|
|
323
|
+
* or returns the element itself if it's already interactive
|
|
324
|
+
*/
|
|
325
|
+
getInteractiveElement(element) {
|
|
326
|
+
if (!element)
|
|
327
|
+
return null;
|
|
328
|
+
if (element.tagName === 'R-BUTTON' || element.tagName === 'R-ICON-BUTTON') {
|
|
329
|
+
const shadowRoot = element.shadowRoot;
|
|
330
|
+
if (shadowRoot) {
|
|
331
|
+
return shadowRoot.querySelector('button, a');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return element;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Define position state
|
|
338
|
+
*/
|
|
339
|
+
componentWillLoad() {
|
|
340
|
+
this.positionState = this.position;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Listen to active child element
|
|
344
|
+
*/
|
|
345
|
+
componentDidLoad() {
|
|
346
|
+
var _a, _b, _c;
|
|
347
|
+
(_a = this.activeElement) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', () => {
|
|
348
|
+
this.handleFocus();
|
|
349
|
+
});
|
|
350
|
+
(_b = this.activeElement) === null || _b === void 0 ? void 0 : _b.addEventListener('blur', () => {
|
|
351
|
+
this.removeTooltip();
|
|
352
|
+
});
|
|
353
|
+
(_c = this.overflowedParent) === null || _c === void 0 ? void 0 : _c.addEventListener('scroll', () => {
|
|
354
|
+
this.handleScroll();
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Finds first element's parent with not visible overflow.
|
|
359
|
+
* @param element -- parent element
|
|
360
|
+
* @param initEl -- initial(child) element
|
|
361
|
+
*/
|
|
362
|
+
findOverflowParent(element) {
|
|
363
|
+
var _a, _b;
|
|
364
|
+
function notVisible(element) {
|
|
365
|
+
return getComputedStyle(element).overflow !== "visible";
|
|
366
|
+
}
|
|
367
|
+
if (!element) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
if (((_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.nodeType) === Node.DOCUMENT_FRAGMENT_NODE) {
|
|
371
|
+
return this.findOverflowParent((_b = element.parentNode) === null || _b === void 0 ? void 0 : _b.host);
|
|
372
|
+
}
|
|
373
|
+
if (notVisible(element)) {
|
|
374
|
+
return element;
|
|
375
|
+
}
|
|
376
|
+
if (element.parentElement) {
|
|
377
|
+
return this.findOverflowParent(element.parentElement);
|
|
378
|
+
}
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Checks the alternative tooltip position.
|
|
383
|
+
* For example: If defined position is "top" and there is no free space for this position at the top of the component,
|
|
384
|
+
* first it checks available vertical space to place tooltip at the bottom.
|
|
385
|
+
* If there is no available space at the bottom, it checks the available space horizontally and sets it horizontally.
|
|
386
|
+
*/
|
|
387
|
+
getAlternativePosition() {
|
|
388
|
+
switch (this.position) {
|
|
389
|
+
case 'top':
|
|
390
|
+
return this.isEnoughSpaceVertically ? 'bottom' : this.horizontalPlacement;
|
|
391
|
+
case 'bottom':
|
|
392
|
+
return this.isEnoughSpaceVertically ? 'top' : this.horizontalPlacement;
|
|
393
|
+
case 'left':
|
|
394
|
+
return this.isEnoughSpaceHorizontally ? 'right' : this.verticalPlacement;
|
|
395
|
+
case 'right':
|
|
396
|
+
return this.isEnoughSpaceHorizontally ? 'left' : this.verticalPlacement;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Set correct tooltip position.
|
|
401
|
+
* First it checks the available space for a defined position and then sets the new one based on the available space.
|
|
402
|
+
*/
|
|
403
|
+
setCorrectPosition() {
|
|
404
|
+
if (!this.tooltip || !this.isShown) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
switch (this.position) {
|
|
408
|
+
case 'top':
|
|
409
|
+
this.positionState = this.tooltipContainerHeight + OFFSET < this.top ? this.position : this.getAlternativePosition();
|
|
410
|
+
break;
|
|
411
|
+
case 'bottom':
|
|
412
|
+
this.positionState = this.tooltipContainerHeight + OFFSET < this.bottom ? this.position : this.getAlternativePosition();
|
|
413
|
+
break;
|
|
414
|
+
case 'left':
|
|
415
|
+
this.positionState = this.tooltipContainerWidth + OFFSET < this.left ? this.position : this.getAlternativePosition();
|
|
416
|
+
break;
|
|
417
|
+
case 'right':
|
|
418
|
+
this.positionState = this.tooltipContainerWidth + OFFSET < this.right ? this.position : this.getAlternativePosition();
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
421
|
+
this.adjustArrowPosition();
|
|
422
|
+
this.alignTooltipPosition();
|
|
423
|
+
this.alignArrowPosition();
|
|
424
|
+
// Allow tooltip content wrap and recalculate position
|
|
425
|
+
if (this.tooltip.style.width === 'fit-content') {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
this.tooltip.style.width = 'fit-content';
|
|
429
|
+
this.alignTooltipPosition();
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Adjusts arrow correct position.
|
|
433
|
+
* For bottom & top tooltip positions there are 3 possible arrow.
|
|
434
|
+
* For right & left tooltip positions there is only one position = "center".
|
|
435
|
+
*/
|
|
436
|
+
adjustArrowPosition() {
|
|
437
|
+
const isEnoughTooltipSpaceLeft = this.tooltipContainerWidth / 2 + OFFSET < this.left;
|
|
438
|
+
const isEnoughTooltipSpaceRight = this.tooltipContainerWidth / 2 + OFFSET < this.right;
|
|
439
|
+
if (isEnoughTooltipSpaceLeft && isEnoughTooltipSpaceRight || !isEnoughTooltipSpaceLeft && !isEnoughTooltipSpaceRight || this.positionState === 'left' || this.positionState === 'right') {
|
|
440
|
+
this.arrowPositionState = 'center';
|
|
441
|
+
}
|
|
442
|
+
else if (!isEnoughTooltipSpaceLeft) {
|
|
443
|
+
this.arrowPositionState = 'left';
|
|
444
|
+
}
|
|
445
|
+
else if (!isEnoughTooltipSpaceRight) {
|
|
446
|
+
this.arrowPositionState = 'right';
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
updateZIndex() {
|
|
450
|
+
const dialogs = document.querySelectorAll('dialog[open]');
|
|
451
|
+
let highestZIndex = 0;
|
|
452
|
+
dialogs.forEach((dialog) => {
|
|
453
|
+
const htmlDialog = dialog;
|
|
454
|
+
if (htmlDialog.open) {
|
|
455
|
+
const style = getComputedStyle(htmlDialog);
|
|
456
|
+
const zIndex = parseInt(style.zIndex, 10);
|
|
457
|
+
if (!isNaN(zIndex) && zIndex > highestZIndex) {
|
|
458
|
+
highestZIndex = zIndex;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
const tooltipZIndex = highestZIndex > 0 ? highestZIndex + 10 : 1060;
|
|
463
|
+
this.tooltip.style.zIndex = `${tooltipZIndex}`;
|
|
464
|
+
this.arrow.style.zIndex = `${tooltipZIndex}`;
|
|
465
|
+
}
|
|
466
|
+
render() {
|
|
467
|
+
const { text, arrowPositionState, positionState, isShown, uniqueId } = this;
|
|
468
|
+
const hostAttrs = {
|
|
469
|
+
'data-arrow-position': arrowPositionState,
|
|
470
|
+
'data-position': positionState
|
|
471
|
+
};
|
|
472
|
+
const triggerAttrs = {
|
|
473
|
+
tabindex: !this.activeElement ? 0 : null,
|
|
474
|
+
role: !this.activeElement ? 'button' : null,
|
|
475
|
+
'aria-describedby': !this.activeElement && isShown ? uniqueId : null
|
|
476
|
+
};
|
|
477
|
+
const contentAttrs = {
|
|
478
|
+
id: uniqueId,
|
|
479
|
+
role: 'tooltip',
|
|
480
|
+
'aria-hidden': `${!isShown}`
|
|
481
|
+
};
|
|
482
|
+
return (index.h(index.Host, Object.assign({ key: '19155344b057a413834706bf19dd5a1bc082549d' }, hostAttrs, { onMouseenter: this.handleHover, onMouseleave: this.removeTooltip }), index.h("div", { key: '298c77b5c9611aba36d3df450f2c4ebda728113a', class: "r-tooltip" }, index.h("div", Object.assign({ key: 'e97a5fb30b6b67cde30734b02acdd1f354d58219', class: "r-tooltip--trigger", onFocus: this.handleFocus, onBlur: this.removeTooltip }, triggerAttrs), index.h("slot", { key: '3ad175db2674badbe9e022f52794a6f16afee7f5' })), index.h("div", Object.assign({ key: '6ed4995a7765422ff604e8da0797f651c12b1e8a', class: "r-tooltip--content", ref: (el) => this.tooltip = el }, contentAttrs), text), index.h("div", { key: '98e5991e801b1e54138c2a5156061237cafa2459', ref: (el) => this.arrow = el, class: "r-tooltip--arrow" }))));
|
|
483
|
+
}
|
|
484
|
+
get element() { return index.getElement(this); }
|
|
485
|
+
static get watchers() { return {
|
|
486
|
+
"position": ["handleVerticalPosition"]
|
|
487
|
+
}; }
|
|
488
|
+
};
|
|
489
|
+
Tooltip.style = tooltipCss;
|
|
490
|
+
|
|
491
|
+
exports.r_icon_button = IconButton;
|
|
492
|
+
exports.r_tooltip = Tooltip;
|