@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.8
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/README.md +1 -1
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-32L2QYWQ.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/chunk-55PUDL7D.js +109 -0
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-AH2SKZ7T.js} +14 -1
- package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
- package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
- package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
- package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-LD35BFNK.js} +18 -17
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
- package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
- package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +6 -6
- package/dist/cdn/components/eun-badge.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +2 -2
- package/dist/cdn/components/eun-card.js +4 -4
- package/dist/cdn/components/eun-carousel.js +26 -22
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +11 -8
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +74 -69
- package/dist/cdn/components/eun-counter.js +16 -14
- package/dist/cdn/components/eun-date-picker.js +67 -63
- package/dist/cdn/components/eun-description-list.js +2 -2
- package/dist/cdn/components/eun-divider.js +3 -3
- package/dist/cdn/components/eun-drawer.js +21 -22
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +2 -2
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +10 -10
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +21 -21
- package/dist/cdn/components/eun-input-phone.js +16 -12
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +33 -23
- package/dist/cdn/components/eun-pagination.js +16 -16
- package/dist/cdn/components/eun-password-strength.js +14 -10
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +11 -8
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +276 -0
- package/dist/cdn/components/eun-scheduler-event-editor.js +11 -11
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +28 -28
- package/dist/cdn/components/eun-search.js +36 -32
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +73 -26
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +3 -3
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +5 -4
- package/dist/cdn/components/eun-stepper.js +30 -30
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +4 -4
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +36 -28
- package/dist/cdn/components/eun-time-picker.js +31 -28
- package/dist/cdn/components/eun-toast.js +24 -15
- package/dist/cdn/components/eun-toggle-group.js +75 -37
- package/dist/cdn/components/eun-toggle-item.js +9 -9
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +22 -22
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +4 -3
- package/dist/components/action/button/button.js +6 -9
- package/dist/components/action/button/button.styles.js +13 -8
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +16 -13
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +18 -3
- package/dist/components/action/toggle/toggle-group.styles.js +58 -20
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/alert/alert/alert.d.ts +9 -7
- package/dist/components/alert/alert/alert.js +11 -14
- package/dist/components/alert/alert/alert.styles.js +9 -2
- package/dist/components/alert/drawer/drawer.d.ts +30 -5
- package/dist/components/alert/drawer/drawer.js +48 -13
- package/dist/components/alert/drawer/drawer.styles.js +7 -7
- package/dist/components/alert/modal/modal.d.ts +35 -10
- package/dist/components/alert/modal/modal.js +55 -28
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +12 -15
- package/dist/components/alert/toast/toast.styles.js +18 -9
- package/dist/components/content/badge/badge.js +2 -2
- package/dist/components/content/card/card.js +1 -1
- package/dist/components/content/card/card.styles.js +2 -2
- package/dist/components/content/chip/chip.d.ts +4 -4
- package/dist/components/content/chip/chip.js +11 -10
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/description-list/description-list.js +3 -3
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.js +3 -0
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -0
- package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
- package/dist/components/content/image-carousel/image-carousel.js +29 -28
- package/dist/components/content/password-strength/password-strength.d.ts +21 -6
- package/dist/components/content/password-strength/password-strength.js +37 -16
- package/dist/components/content/password-strength/password-strength.styles.js +4 -0
- package/dist/components/content/tag/tag.js +2 -2
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +31 -15
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/checkbox/check-card.d.ts +1 -0
- package/dist/components/form/checkbox/check-card.js +1 -0
- package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
- package/dist/components/form/checkbox/checkbox-list.js +39 -10
- package/dist/components/form/checkbox/checkbox.d.ts +1 -0
- package/dist/components/form/checkbox/checkbox.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +3 -2
- package/dist/components/form/color-picker/color-picker.d.ts +47 -28
- package/dist/components/form/color-picker/color-picker.js +73 -51
- package/dist/components/form/color-picker/color-picker.styles.js +14 -1
- package/dist/components/form/counter/counter.d.ts +24 -18
- package/dist/components/form/counter/counter.js +61 -61
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +33 -7
- package/dist/components/form/date-picker/date-picker.js +82 -56
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +43 -39
- package/dist/components/form/input/input.js +91 -110
- package/dist/components/form/input-file/input-file.d.ts +26 -13
- package/dist/components/form/input-file/input-file.js +35 -35
- package/dist/components/form/input-file/input-file.styles.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +28 -5
- package/dist/components/form/input-phone/input-phone.js +47 -13
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/radio/radio-card.d.ts +1 -0
- package/dist/components/form/radio/radio-card.js +1 -0
- package/dist/components/form/radio/radio-list.d.ts +23 -7
- package/dist/components/form/radio/radio-list.js +47 -22
- package/dist/components/form/radio/radio.d.ts +1 -0
- package/dist/components/form/radio/radio.js +1 -0
- package/dist/components/form/rating/rating.d.ts +349 -0
- package/dist/components/form/rating/rating.js +665 -0
- package/dist/components/form/rating/rating.styles.d.ts +1 -0
- package/dist/components/form/rating/rating.styles.js +213 -0
- package/dist/components/form/search/search.d.ts +72 -18
- package/dist/components/form/search/search.js +135 -72
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +29 -10
- package/dist/components/form/select/select.js +65 -41
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +15 -1
- package/dist/components/form/slider/slider.d.ts +7 -8
- package/dist/components/form/slider/slider.js +9 -12
- package/dist/components/form/switch/switch.d.ts +1 -0
- package/dist/components/form/switch/switch.js +1 -0
- package/dist/components/form/textarea/textarea.d.ts +90 -23
- package/dist/components/form/textarea/textarea.js +194 -44
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
- package/dist/components/form/time-picker/time-picker-columns.js +8 -8
- package/dist/components/form/time-picker/time-picker.d.ts +30 -9
- package/dist/components/form/time-picker/time-picker.js +66 -40
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +3 -2
- package/dist/components/layout/animate/animate.styles.js +2 -2
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.styles.js +1 -1
- package/dist/components/loader/loader/loader.js +2 -2
- package/dist/components/loader/loader/loader.styles.js +14 -12
- package/dist/components/loader/skeleton/skeleton.js +1 -1
- package/dist/components/navigation/carousel/carousel.d.ts +32 -9
- package/dist/components/navigation/carousel/carousel.js +88 -41
- package/dist/components/navigation/carousel/carousel.styles.js +10 -6
- package/dist/components/navigation/pagination/pagination.d.ts +23 -21
- package/dist/components/navigation/pagination/pagination.js +30 -53
- package/dist/components/navigation/sidebar/sidebar.d.ts +113 -65
- package/dist/components/navigation/sidebar/sidebar.js +161 -118
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +74 -24
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +15 -26
- package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
- package/dist/components/navigation/toolbar/toolbar.d.ts +23 -13
- package/dist/components/navigation/toolbar/toolbar.js +28 -35
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/calendar/calendar.js +1 -1
- package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
- package/dist/features/scheduler/scheduler/scheduler.js +15 -24
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +7 -8
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/i18n/en.d.ts +68 -0
- package/dist/i18n/en.js +68 -0
- package/dist/i18n/fr.js +68 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +9 -6
- package/dist/mixins/check.mixin.js +11 -10
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/disabled.mixin.d.ts +5 -0
- package/dist/mixins/disabled.mixin.js +21 -1
- package/dist/mixins/editable.mixin.js +28 -5
- package/dist/mixins/field-appearance.mixin.js +3 -2
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/form.mixin.d.ts +4 -0
- package/dist/mixins/form.mixin.js +87 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -1
- package/dist/mixins/localizable.mixin.js +1 -1
- package/dist/mixins/radio.mixin.js +11 -10
- package/dist/mixins/readonly.mixin.d.ts +2 -1
- package/dist/mixins/readonly.mixin.js +10 -3
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/alert-ssr.css +187 -0
- package/dist/ssr/badge-ssr.css +67 -0
- package/dist/ssr/breadcrumb-ssr.css +41 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +247 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +250 -0
- package/dist/ssr/collapse-ssr.css +180 -0
- package/dist/ssr/field-ssr.css +202 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +34 -0
- package/dist/ssr/links-ssr.css +44 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +102 -3
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +233 -0
- package/dist/ssr/toolbar-ssr.css +81 -2
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +26 -7
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
- package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
- package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
- package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
- package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
- package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
- package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
|
@@ -9,6 +9,9 @@ import { html, LitElement, nothing } from "lit";
|
|
|
9
9
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
10
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
11
11
|
import { sidebarStyles } from "./sidebar.styles.js";
|
|
12
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
13
|
+
import { cssTimeToMs } from "../../../utils/motion.utils.js";
|
|
14
|
+
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
12
15
|
/**
|
|
13
16
|
* Tag name of the sidebar component.
|
|
14
17
|
*/
|
|
@@ -40,34 +43,40 @@ export const EunomiaSidebarTagName = "eun-sidebar";
|
|
|
40
43
|
* @slot footer - Optional footer content, such as a user menu, fixed below the scrollable body. Omitted entirely when nothing is slotted
|
|
41
44
|
* @prop {'start' | 'end'} [position='start'] - Which edge of the layout the sidebar is pinned against
|
|
42
45
|
* @prop {string} heading - An optional heading, rendered as the header slot's fallback content, and used as the accessible name when set
|
|
43
|
-
* @prop {
|
|
46
|
+
* @prop {'mobile' | 'tablet' | 'laptop' | 'desktop'} hideBelow - Hides the sidebar below this breakpoint, for a layout where another navigation takes over on small screens, such as the toolbar's mobile panel. Also applies before the component loads when sidebar-ssr.css is linked
|
|
47
|
+
* @attr {'mobile' | 'tablet' | 'laptop' | 'desktop'} hide-below - Hides the sidebar below this breakpoint
|
|
48
|
+
* @prop {'light' | 'dark'} [theme='light'] - The sidebar's color scheme. Dark uses the inverse surface, for a sidebar on a dark background
|
|
49
|
+
* @prop {boolean} [collapsible=true] - Whether the built-in toggle button renders at all. The collapse, expand, and toggle methods still work regardless, for driving collapse from elsewhere, such as a page header menu button. Set to false, or the attribute to "false", to rely on resizable alone
|
|
44
50
|
* @prop {'edge' | 'inline'} [togglePlacement='edge'] - Where the built-in toggle button renders: edge floats on the border, and inline sits inside the panel, pinned below the body and footer
|
|
45
51
|
* @attr {'edge' | 'inline'} [toggle-placement='edge'] - Where the built-in toggle button renders: edge floats on the border, and inline sits inside the panel, pinned below the body and footer
|
|
46
52
|
* @prop {'mini' | 'hidden'} [collapseMode='mini'] - The shape the collapsed state takes
|
|
47
53
|
* @attr {'mini' | 'hidden'} [collapse-mode='mini'] - The shape the collapsed state takes
|
|
48
54
|
* @prop {boolean} [collapsed=false] - Whether the sidebar is currently collapsed
|
|
49
|
-
* @prop {string}
|
|
50
|
-
* @attr {string} [
|
|
51
|
-
* @prop {string}
|
|
52
|
-
* @attr {string} [
|
|
53
|
-
* @prop {boolean} [resizable=true] - Whether the border can be dragged, or, once focused, adjusted with arrow keys, to resize the panel
|
|
54
|
-
* @prop {string}
|
|
55
|
-
* @attr {string} [
|
|
56
|
-
* @fires {ChangeEvent} eunchange - Fired whenever collapsed changes, including as a result of dragging or keyboard-resizing
|
|
55
|
+
* @prop {string} [expandLabel] - The accessible label of the toggle button while collapsed. Defaults to the localized string for the current locale (English: "Expand sidebar")
|
|
56
|
+
* @attr {string} [expand-label] - The accessible label of the toggle button while collapsed. Defaults to the localized string for the current locale (English: "Expand sidebar")
|
|
57
|
+
* @prop {string} [collapseLabel] - The accessible label of the toggle button while expanded. Defaults to the localized string for the current locale (English: "Collapse sidebar")
|
|
58
|
+
* @attr {string} [collapse-label] - The accessible label of the toggle button while expanded. Defaults to the localized string for the current locale (English: "Collapse sidebar")
|
|
59
|
+
* @prop {boolean} [resizable=true] - Whether the border can be dragged, or, once focused, adjusted with arrow keys, to resize the panel. Set to false, or the attribute to "false", to turn it off
|
|
60
|
+
* @prop {string} [resizeLabel] - The accessible label of the drag-to-resize border. Defaults to the localized string for the current locale (English: "Resize sidebar")
|
|
61
|
+
* @attr {string} [resize-label] - The accessible label of the drag-to-resize border. Defaults to the localized string for the current locale (English: "Resize sidebar")
|
|
62
|
+
* @fires {ChangeEvent} eunchange - Fired whenever collapsed changes, including as a result of dragging or keyboard-resizing below the mini width. A collapse reached this way takes the shape set by collapseMode, and expanding again returns to --sidebar-width
|
|
57
63
|
* @cssprop [--sidebar-width] - Sets the expanded width of the sidebar, also the floor of the drag-resize range and, once resized, holds the user's chosen width
|
|
58
64
|
* @cssprop [--sidebar-mini-width] - Sets the width of the mini collapsed state, also the floor of the drag-resize range
|
|
59
65
|
* @cssprop [--sidebar-max-width] - Sets the ceiling of the drag-resize range
|
|
60
|
-
* @cssprop [--sidebar-background] - Sets the background color of the sidebar
|
|
66
|
+
* @cssprop [--sidebar-background] - Sets the background color of the sidebar. Use an opaque color, or transparent to show the background behind the sidebar
|
|
61
67
|
* @cssprop [--sidebar-color] - Sets the text color of the sidebar
|
|
62
68
|
* @cssprop [--sidebar-border-color] - Sets the color of the sidebar's side border
|
|
63
69
|
* @cssprop [--sidebar-padding] - Sets the padding of the header, body, and footer
|
|
64
70
|
* @cssprop [--sidebar-padding-block] - Sets the vertical padding, as one length applied to both sides. Ignored when --sidebar-padding is set
|
|
65
71
|
* @cssprop [--sidebar-padding-inline] - Sets the horizontal padding, as one length applied to both sides. Ignored when --sidebar-padding is set
|
|
66
72
|
* @cssprop [--sidebar-gap] - Sets the gap inside the header and footer rows
|
|
73
|
+
* @cssprop [--sidebar-toggle-color] - Sets the color of the toggle button
|
|
74
|
+
* @cssprop [--sidebar-toggle-background-hover] - Sets the background color of the toggle button on hover
|
|
75
|
+
* @cssprop [--sidebar-resize-handle-delay] - Sets how long the pointer must rest on the border before the resize handle shows. Set to 0 to show it right away
|
|
67
76
|
* @cssprop [--sidebar-transition-duration] - Sets the duration of the collapse and resize transition
|
|
68
77
|
* @element eun-sidebar
|
|
69
78
|
*/
|
|
70
|
-
let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
79
|
+
let EunomiaSidebar = class EunomiaSidebar extends LocalizableMixin(LitElement) {
|
|
71
80
|
constructor() {
|
|
72
81
|
super(...arguments);
|
|
73
82
|
/**
|
|
@@ -77,12 +86,20 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
77
86
|
* @default start
|
|
78
87
|
*/
|
|
79
88
|
this.position = "start";
|
|
89
|
+
/**
|
|
90
|
+
* The sidebar's color scheme : `dark` uses the inverse surface, the same
|
|
91
|
+
* one `eun-toolbar`'s own `theme="dark"` does.
|
|
92
|
+
* @default light
|
|
93
|
+
*/
|
|
94
|
+
this.theme = "light";
|
|
80
95
|
/**
|
|
81
96
|
* Whether the built-in toggle button renders at all (see `togglePlacement`
|
|
82
97
|
* for where) ; `collapse()`/`expand()`/`toggleCollapse()` work regardless,
|
|
83
98
|
* for driving collapse from elsewhere (e.g. a page header menu button) —
|
|
84
99
|
* set this to `false` to drop the built-in button entirely and rely on
|
|
85
|
-
* `resizable` (dragging the border past the mini floor) alone.
|
|
100
|
+
* `resizable` (dragging the border past the mini floor) alone. The
|
|
101
|
+
* attribute value `"false"` turns it off too (see {@link
|
|
102
|
+
* defaultTrueConverter}).
|
|
86
103
|
* @default true
|
|
87
104
|
*/
|
|
88
105
|
this.collapsible = true;
|
|
@@ -107,29 +124,15 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
107
124
|
* @default false
|
|
108
125
|
*/
|
|
109
126
|
this.collapsed = false;
|
|
110
|
-
/**
|
|
111
|
-
* Accessible label of the toggle button while collapsed (offering to expand it).
|
|
112
|
-
* @default Expand sidebar
|
|
113
|
-
*/
|
|
114
|
-
this.ariaLabelExpand = "Expand sidebar";
|
|
115
|
-
/**
|
|
116
|
-
* Accessible label of the toggle button while expanded (offering to collapse it).
|
|
117
|
-
* @default Collapse sidebar
|
|
118
|
-
*/
|
|
119
|
-
this.ariaLabelCollapse = "Collapse sidebar";
|
|
120
127
|
/**
|
|
121
128
|
* Whether the border can be dragged (or, once focused, adjusted with the
|
|
122
129
|
* arrow keys) to resize the panel between `--sidebar-mini-width` and
|
|
123
130
|
* `--sidebar-max-width`. Independent of `collapsible`, which only
|
|
124
|
-
* controls the discrete toggle button.
|
|
131
|
+
* controls the discrete toggle button. The attribute value `"false"`
|
|
132
|
+
* turns it off too (see {@link defaultTrueConverter}).
|
|
125
133
|
* @default true
|
|
126
134
|
*/
|
|
127
135
|
this.resizable = true;
|
|
128
|
-
/**
|
|
129
|
-
* Accessible label of the drag-to-resize border.
|
|
130
|
-
* @default Resize sidebar
|
|
131
|
-
*/
|
|
132
|
-
this.ariaLabelResize = "Resize sidebar";
|
|
133
136
|
/**
|
|
134
137
|
* The panel width, in px, right before the current drag-resize started.
|
|
135
138
|
* @internal
|
|
@@ -137,8 +140,7 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
137
140
|
this.dragStartWidth = 0;
|
|
138
141
|
/**
|
|
139
142
|
* The last *unclamped* width computed during a drag, used on release to
|
|
140
|
-
* decide whether the drag went
|
|
141
|
-
* into a full `collapse-mode="hidden"` collapse.
|
|
143
|
+
* decide whether the drag went below the mini floor and collapses.
|
|
142
144
|
* @internal
|
|
143
145
|
*/
|
|
144
146
|
this.lastRawWidth = 0;
|
|
@@ -151,13 +153,6 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
151
153
|
* @internal
|
|
152
154
|
*/
|
|
153
155
|
this.dragStartCollapsed = false;
|
|
154
|
-
/**
|
|
155
|
-
* Whether `draggedHidden` was set right before the current drag started
|
|
156
|
-
* — compared against the final state at release for the same reason
|
|
157
|
-
* `dragStartCollapsed` is.
|
|
158
|
-
* @internal
|
|
159
|
-
*/
|
|
160
|
-
this.dragStartHidden = false;
|
|
161
156
|
/**
|
|
162
157
|
* Whether `pointermove` actually fired at least once since the current
|
|
163
158
|
* `pointerdown` — a plain click on the resize handle (no movement)
|
|
@@ -172,18 +167,13 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
172
167
|
*/
|
|
173
168
|
this.dragging = false;
|
|
174
169
|
/**
|
|
175
|
-
* Whether
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* hide, matching what `collapse-mode="hidden"` already looks like.
|
|
180
|
-
* Reflected so CSS can force `--_width`/`border-color` to win over
|
|
181
|
-
* collapse-mode's own (otherwise fixed) collapsed-state rule. Cleared by
|
|
182
|
-
* any discrete collapse()/expand()/toggleCollapse() (button or API),
|
|
183
|
-
* which always takes precedence over a lingering drag state.
|
|
170
|
+
* Whether the resize handle shows its highlight and resize cursor : set
|
|
171
|
+
* once the pointer has rested on the border for
|
|
172
|
+
* `--sidebar-resize-handle-delay`, or right away on `pointerdown`, so
|
|
173
|
+
* merely crossing the border on the way to the content doesn't flash it.
|
|
184
174
|
* @internal
|
|
185
175
|
*/
|
|
186
|
-
this.
|
|
176
|
+
this.resizeHandleArmed = false;
|
|
187
177
|
/**
|
|
188
178
|
* Whether focus was inside the sidebar right before a `willUpdate` that's
|
|
189
179
|
* about to fully collapse it (`collapse-mode="hidden"`). Captured
|
|
@@ -195,6 +185,30 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
195
185
|
* @internal
|
|
196
186
|
*/
|
|
197
187
|
this.focusWasInsideBeforeHiddenCollapse = false;
|
|
188
|
+
/**
|
|
189
|
+
* Arms the resize handle once the pointer has rested on the border for
|
|
190
|
+
* `--sidebar-resize-handle-delay` (300ms by default).
|
|
191
|
+
* @private
|
|
192
|
+
*/
|
|
193
|
+
this.handleResizePointerEnter = () => {
|
|
194
|
+
this.disarmResizeHandle();
|
|
195
|
+
const delay = cssTimeToMs(getComputedStyle(this).getPropertyValue("--sidebar-resize-handle-delay")) ?? 100;
|
|
196
|
+
if (delay === 0) {
|
|
197
|
+
this.resizeHandleArmed = true;
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.resizeHandleArmTimer = setTimeout(() => {
|
|
201
|
+
this.resizeHandleArmTimer = undefined;
|
|
202
|
+
this.resizeHandleArmed = true;
|
|
203
|
+
}, delay);
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Disarms the resize handle as soon as the pointer leaves the border.
|
|
207
|
+
* @private
|
|
208
|
+
*/
|
|
209
|
+
this.handleResizePointerLeave = () => {
|
|
210
|
+
this.disarmResizeHandle();
|
|
211
|
+
};
|
|
198
212
|
/**
|
|
199
213
|
* Starts a drag-resize : captures the pointer on the handle itself (so
|
|
200
214
|
* subsequent `pointermove`/`pointerup` keep firing there even once the
|
|
@@ -207,6 +221,11 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
207
221
|
if (event.pointerType === "mouse" && event.button !== 0) {
|
|
208
222
|
return;
|
|
209
223
|
}
|
|
224
|
+
if (this.resizeHandleArmTimer !== undefined) {
|
|
225
|
+
clearTimeout(this.resizeHandleArmTimer);
|
|
226
|
+
this.resizeHandleArmTimer = undefined;
|
|
227
|
+
}
|
|
228
|
+
this.resizeHandleArmed = true;
|
|
210
229
|
try {
|
|
211
230
|
this.resizeHandleEl?.setPointerCapture(event.pointerId);
|
|
212
231
|
}
|
|
@@ -214,17 +233,16 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
214
233
|
this.dragStartX = event.clientX;
|
|
215
234
|
this.dragStartWidth = this.currentWidthPx();
|
|
216
235
|
this.dragStartCollapsed = this.collapsed;
|
|
217
|
-
this.dragStartHidden = this.draggedHidden;
|
|
218
236
|
this.lastRawWidth = this.dragStartWidth;
|
|
219
237
|
this.dragMoved = false;
|
|
220
238
|
};
|
|
221
239
|
/**
|
|
222
240
|
* Tracks an in-progress drag-resize, applying the live width as the
|
|
223
241
|
* pointer moves. Direction is flipped for `position="end"`, where
|
|
224
|
-
* dragging left (toward the panel) grows it.
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* it actually
|
|
242
|
+
* dragging left (toward the panel) grows it. Under `collapse-mode="mini"`
|
|
243
|
+
* the panel stops at the mini floor, the narrowest it can ever be ; under
|
|
244
|
+
* `hidden` it tracks all the way down to `0`, previewing the full hide —
|
|
245
|
+
* `handleResizePointerUp` decides whether it actually collapses.
|
|
228
246
|
*
|
|
229
247
|
* @param event the pointermove event.
|
|
230
248
|
* @private
|
|
@@ -238,12 +256,11 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
238
256
|
const delta = event.clientX - this.dragStartX;
|
|
239
257
|
const signedDelta = this.position === "start" ? delta : -delta;
|
|
240
258
|
this.lastRawWidth = this.dragStartWidth + signedDelta;
|
|
241
|
-
this.applyWidth(this.lastRawWidth, 0);
|
|
259
|
+
this.applyWidth(this.lastRawWidth, this.collapseMode === "hidden" ? 0 : this.miniWidthPx());
|
|
242
260
|
};
|
|
243
261
|
/**
|
|
244
262
|
* Ends a drag-resize : a plain click (no movement) is a no-op ; see
|
|
245
|
-
* `settleWidth` for how the final width resolves into `collapsed
|
|
246
|
-
* `draggedHidden`.
|
|
263
|
+
* `settleWidth` for how the final width resolves into `collapsed`.
|
|
247
264
|
*
|
|
248
265
|
* @param event the pointerup/pointercancel event.
|
|
249
266
|
* @private
|
|
@@ -264,7 +281,7 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
264
281
|
if (!this.dragMoved) {
|
|
265
282
|
return;
|
|
266
283
|
}
|
|
267
|
-
this.settleWidth(this.lastRawWidth, this.dragStartCollapsed
|
|
284
|
+
this.settleWidth(this.lastRawWidth, this.dragStartCollapsed);
|
|
268
285
|
};
|
|
269
286
|
/**
|
|
270
287
|
* Keyboard resizing, per the WAI-ARIA window splitter pattern :
|
|
@@ -340,6 +357,14 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
340
357
|
this.collapseToggleEl?.focus();
|
|
341
358
|
}
|
|
342
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Lifecycle hook called when the element is disconnected from the DOM.
|
|
362
|
+
* Clears a pending resize handle arming timer.
|
|
363
|
+
*/
|
|
364
|
+
disconnectedCallback() {
|
|
365
|
+
super.disconnectedCallback();
|
|
366
|
+
this.disarmResizeHandle();
|
|
367
|
+
}
|
|
343
368
|
/**
|
|
344
369
|
* Collapses the sidebar.
|
|
345
370
|
*/
|
|
@@ -366,20 +391,22 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
366
391
|
* @private
|
|
367
392
|
*/
|
|
368
393
|
setCollapsed(collapsed) {
|
|
369
|
-
|
|
370
|
-
const clearingDraggedHidden = this.draggedHidden;
|
|
371
|
-
if (!changing && !clearingDraggedHidden) {
|
|
394
|
+
if (this.collapsed === collapsed) {
|
|
372
395
|
return;
|
|
373
396
|
}
|
|
374
397
|
this.collapsed = collapsed;
|
|
375
|
-
if (clearingDraggedHidden) {
|
|
376
|
-
this.draggedHidden = false;
|
|
377
|
-
this.style.removeProperty("border-color");
|
|
378
|
-
this.style.removeProperty("--sidebar-width");
|
|
379
|
-
this.liveWidthPx = undefined;
|
|
380
|
-
}
|
|
381
398
|
this.dispatchEvent(new ChangeEvent());
|
|
382
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* Drops the width a drag or keyboard resize applied, so the next expand
|
|
402
|
+
* returns to `--sidebar-width` instead of the narrow width the resize
|
|
403
|
+
* collapsed from.
|
|
404
|
+
* @private
|
|
405
|
+
*/
|
|
406
|
+
forgetResizedWidth() {
|
|
407
|
+
this.style.removeProperty("--sidebar-width");
|
|
408
|
+
this.liveWidthPx = undefined;
|
|
409
|
+
}
|
|
383
410
|
/**
|
|
384
411
|
* Reads a length custom property off the host's computed style, parsed
|
|
385
412
|
* as a px number.
|
|
@@ -425,8 +452,7 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
425
452
|
* @private
|
|
426
453
|
*/
|
|
427
454
|
currentWidthPx() {
|
|
428
|
-
if (this.
|
|
429
|
-
(this.collapsed && this.collapseMode === "hidden")) {
|
|
455
|
+
if (this.collapsed && this.collapseMode === "hidden") {
|
|
430
456
|
return 0;
|
|
431
457
|
}
|
|
432
458
|
if (this.collapsed && this.collapseMode === "mini") {
|
|
@@ -439,23 +465,21 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
439
465
|
* `--sidebar-width` override, so a drag tracks the pointer immediately
|
|
440
466
|
* rather than waiting on Lit's render cycle) and reactively (via
|
|
441
467
|
* `liveWidthPx`, so `#resize-handle`'s `aria-valuenow` stays in sync).
|
|
442
|
-
* Also clears `collapsed
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
468
|
+
* Also clears `collapsed` without dispatching : while it reflects, its
|
|
469
|
+
* CSS rule sets `--_width` directly and would otherwise ignore every live
|
|
470
|
+
* update below — `settleWidth`/`settleCollapsedState` restore the correct
|
|
471
|
+
* final truth (and their one authoritative `eunchange`) once the
|
|
472
|
+
* interaction ends.
|
|
447
473
|
*
|
|
448
474
|
* @param px the requested width, in px.
|
|
449
|
-
* @param floor the minimum to clamp to — the mini width by default
|
|
450
|
-
*
|
|
451
|
-
*
|
|
475
|
+
* @param floor the minimum to clamp to — the mini width by default, or
|
|
476
|
+
* `0` during a `collapse-mode="hidden"` drag so it can visually approach
|
|
477
|
+
* a full hide.
|
|
452
478
|
* @private
|
|
453
479
|
*/
|
|
454
480
|
applyWidth(px, floor = this.miniWidthPx()) {
|
|
455
481
|
const clamped = Math.min(Math.max(px, floor), this.maxWidthPx());
|
|
456
482
|
this.collapsed = false;
|
|
457
|
-
this.draggedHidden = false;
|
|
458
|
-
this.style.removeProperty("border-color");
|
|
459
483
|
this.style.setProperty("--sidebar-width", `${clamped}px`);
|
|
460
484
|
this.liveWidthPx = clamped;
|
|
461
485
|
}
|
|
@@ -463,9 +487,10 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
463
487
|
* Reconciles `collapsed` once a *keyboard* resize ends, comparing the
|
|
464
488
|
* interaction's start and end states so exactly one `eunchange` fires
|
|
465
489
|
* for a genuine transition — and none at all for a resize that never
|
|
466
|
-
* crossed the mini floor.
|
|
467
|
-
*
|
|
468
|
-
* `handleResizeKeydown`).
|
|
490
|
+
* crossed the mini floor. Only `collapse-mode="mini"` collapses here :
|
|
491
|
+
* under `hidden`, collapsing would hide the panel entirely, which stays
|
|
492
|
+
* the toggle button's job (see `handleResizeKeydown`). A collapse forgets
|
|
493
|
+
* the resized width, so the next expand returns to `--sidebar-width`.
|
|
469
494
|
*
|
|
470
495
|
* @param widthPx the final width the interaction landed on.
|
|
471
496
|
* @param wasCollapsed whether the sidebar was collapsed when the
|
|
@@ -473,48 +498,55 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
473
498
|
* @private
|
|
474
499
|
*/
|
|
475
500
|
settleCollapsedState(widthPx, wasCollapsed) {
|
|
476
|
-
const collapsed = widthPx <= this.miniWidthPx();
|
|
501
|
+
const collapsed = this.collapseMode === "mini" && widthPx <= this.miniWidthPx();
|
|
502
|
+
if (collapsed) {
|
|
503
|
+
this.forgetResizedWidth();
|
|
504
|
+
}
|
|
477
505
|
this.collapsed = collapsed;
|
|
478
506
|
if (collapsed !== wasCollapsed) {
|
|
479
507
|
this.dispatchEvent(new ChangeEvent());
|
|
480
508
|
}
|
|
481
509
|
}
|
|
482
510
|
/**
|
|
483
|
-
* Reconciles
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
* either flag actually changed from where the interaction started.
|
|
511
|
+
* Reconciles `collapsed` once a *drag* resize ends : a drag that lands
|
|
512
|
+
* below the mini floor collapses into whichever shape `collapse-mode`
|
|
513
|
+
* sets (the icon rail for `mini`, a full hide for `hidden`), and forgets
|
|
514
|
+
* the dragged width so the next expand returns to `--sidebar-width`.
|
|
515
|
+
* Anywhere else keeps the dragged width, clamped to the resize range.
|
|
516
|
+
* Fires exactly one `eunchange` iff `collapsed` actually changed from
|
|
517
|
+
* where the interaction started.
|
|
491
518
|
*
|
|
492
519
|
* @param rawWidth the final unclamped width the drag landed on.
|
|
493
520
|
* @param wasCollapsed whether `collapsed` was set when the drag started.
|
|
494
|
-
* @param wasHidden whether `draggedHidden` was set when the drag started.
|
|
495
521
|
* @private
|
|
496
522
|
*/
|
|
497
|
-
settleWidth(rawWidth, wasCollapsed
|
|
523
|
+
settleWidth(rawWidth, wasCollapsed) {
|
|
498
524
|
const miniWidth = this.miniWidthPx();
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
? 0
|
|
503
|
-
: Math.min(Math.max(rawWidth, miniWidth), this.maxWidthPx());
|
|
504
|
-
this.style.setProperty("--sidebar-width", `${settled}px`);
|
|
505
|
-
if (hidden) {
|
|
506
|
-
this.style.setProperty("border-color", "transparent");
|
|
525
|
+
const collapsed = rawWidth < miniWidth;
|
|
526
|
+
if (collapsed) {
|
|
527
|
+
this.forgetResizedWidth();
|
|
507
528
|
}
|
|
508
529
|
else {
|
|
509
|
-
this.
|
|
530
|
+
const settled = Math.min(rawWidth, this.maxWidthPx());
|
|
531
|
+
this.style.setProperty("--sidebar-width", `${settled}px`);
|
|
532
|
+
this.liveWidthPx = settled;
|
|
510
533
|
}
|
|
511
|
-
this.liveWidthPx = settled;
|
|
512
534
|
this.collapsed = collapsed;
|
|
513
|
-
|
|
514
|
-
if (collapsed !== wasCollapsed || hidden !== wasHidden) {
|
|
535
|
+
if (collapsed !== wasCollapsed) {
|
|
515
536
|
this.dispatchEvent(new ChangeEvent());
|
|
516
537
|
}
|
|
517
538
|
}
|
|
539
|
+
/**
|
|
540
|
+
* Clears {@link resizeHandleArmed} and its pending timer, if any.
|
|
541
|
+
* @private
|
|
542
|
+
*/
|
|
543
|
+
disarmResizeHandle() {
|
|
544
|
+
if (this.resizeHandleArmTimer !== undefined) {
|
|
545
|
+
clearTimeout(this.resizeHandleArmTimer);
|
|
546
|
+
this.resizeHandleArmTimer = undefined;
|
|
547
|
+
}
|
|
548
|
+
this.resizeHandleArmed = false;
|
|
549
|
+
}
|
|
518
550
|
/**
|
|
519
551
|
* The icon for the collapse/expand toggle button : always points toward
|
|
520
552
|
* whichever action it currently performs — inward (toward the panel)
|
|
@@ -588,7 +620,9 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
588
620
|
* @private
|
|
589
621
|
*/
|
|
590
622
|
collapseToggleLabel() {
|
|
591
|
-
return this.collapsed
|
|
623
|
+
return this.collapsed
|
|
624
|
+
? (this.expandLabel ?? this.dictionary.sidebar.expand)
|
|
625
|
+
: (this.collapseLabel ?? this.dictionary.sidebar.collapse);
|
|
592
626
|
}
|
|
593
627
|
/**
|
|
594
628
|
* Renders the toggle button floating on the border, vertically centered
|
|
@@ -641,13 +675,16 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
641
675
|
return html `
|
|
642
676
|
<div
|
|
643
677
|
id="resize-handle"
|
|
678
|
+
class=${ifDefined(this.resizeHandleArmed ? "armed" : undefined)}
|
|
644
679
|
role="separator"
|
|
645
680
|
aria-orientation="vertical"
|
|
646
|
-
aria-label=${this.
|
|
681
|
+
aria-label=${this.resizeLabel ?? this.dictionary.sidebar.resize}
|
|
647
682
|
aria-valuenow=${Math.round(this.currentWidthPx())}
|
|
648
683
|
aria-valuemin=${Math.round(this.miniWidthPx())}
|
|
649
684
|
aria-valuemax=${Math.round(this.maxWidthPx())}
|
|
650
685
|
tabindex="0"
|
|
686
|
+
@pointerenter=${this.handleResizePointerEnter}
|
|
687
|
+
@pointerleave=${this.handleResizePointerLeave}
|
|
651
688
|
@pointerdown=${this.handleResizePointerDown}
|
|
652
689
|
@pointermove=${this.handleResizePointerMove}
|
|
653
690
|
@pointerup=${this.handleResizePointerUp}
|
|
@@ -699,35 +736,41 @@ let EunomiaSidebar = class EunomiaSidebar extends LitElement {
|
|
|
699
736
|
*/
|
|
700
737
|
EunomiaSidebar.styles = sidebarStyles;
|
|
701
738
|
__decorate([
|
|
702
|
-
property({ reflect: true })
|
|
739
|
+
property({ reflect: true, useDefault: true })
|
|
703
740
|
], EunomiaSidebar.prototype, "position", void 0);
|
|
741
|
+
__decorate([
|
|
742
|
+
property({ reflect: true, attribute: "hide-below" })
|
|
743
|
+
], EunomiaSidebar.prototype, "hideBelow", void 0);
|
|
744
|
+
__decorate([
|
|
745
|
+
property({ reflect: true, useDefault: true })
|
|
746
|
+
], EunomiaSidebar.prototype, "theme", void 0);
|
|
704
747
|
__decorate([
|
|
705
748
|
property()
|
|
706
749
|
], EunomiaSidebar.prototype, "heading", void 0);
|
|
707
750
|
__decorate([
|
|
708
|
-
property({
|
|
751
|
+
property({ converter: defaultTrueConverter })
|
|
709
752
|
], EunomiaSidebar.prototype, "collapsible", void 0);
|
|
710
753
|
__decorate([
|
|
711
|
-
property({ reflect: true, attribute: "toggle-placement" })
|
|
754
|
+
property({ reflect: true, attribute: "toggle-placement", useDefault: true })
|
|
712
755
|
], EunomiaSidebar.prototype, "togglePlacement", void 0);
|
|
713
756
|
__decorate([
|
|
714
|
-
property({ reflect: true, attribute: "collapse-mode" })
|
|
757
|
+
property({ reflect: true, attribute: "collapse-mode", useDefault: true })
|
|
715
758
|
], EunomiaSidebar.prototype, "collapseMode", void 0);
|
|
716
759
|
__decorate([
|
|
717
760
|
property({ type: Boolean, reflect: true })
|
|
718
761
|
], EunomiaSidebar.prototype, "collapsed", void 0);
|
|
719
762
|
__decorate([
|
|
720
|
-
property({ attribute: "
|
|
721
|
-
], EunomiaSidebar.prototype, "
|
|
763
|
+
property({ attribute: "expand-label" })
|
|
764
|
+
], EunomiaSidebar.prototype, "expandLabel", void 0);
|
|
722
765
|
__decorate([
|
|
723
|
-
property({ attribute: "
|
|
724
|
-
], EunomiaSidebar.prototype, "
|
|
766
|
+
property({ attribute: "collapse-label" })
|
|
767
|
+
], EunomiaSidebar.prototype, "collapseLabel", void 0);
|
|
725
768
|
__decorate([
|
|
726
|
-
property({
|
|
769
|
+
property({ converter: defaultTrueConverter })
|
|
727
770
|
], EunomiaSidebar.prototype, "resizable", void 0);
|
|
728
771
|
__decorate([
|
|
729
|
-
property({ attribute: "
|
|
730
|
-
], EunomiaSidebar.prototype, "
|
|
772
|
+
property({ attribute: "resize-label" })
|
|
773
|
+
], EunomiaSidebar.prototype, "resizeLabel", void 0);
|
|
731
774
|
__decorate([
|
|
732
775
|
query("#resize-handle")
|
|
733
776
|
], EunomiaSidebar.prototype, "resizeHandleEl", void 0);
|
|
@@ -738,8 +781,8 @@ __decorate([
|
|
|
738
781
|
property({ type: Boolean, reflect: true })
|
|
739
782
|
], EunomiaSidebar.prototype, "dragging", void 0);
|
|
740
783
|
__decorate([
|
|
741
|
-
|
|
742
|
-
], EunomiaSidebar.prototype, "
|
|
784
|
+
state()
|
|
785
|
+
], EunomiaSidebar.prototype, "resizeHandleArmed", void 0);
|
|
743
786
|
__decorate([
|
|
744
787
|
state()
|
|
745
788
|
], EunomiaSidebar.prototype, "liveWidthPx", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sidebarStyles: import("lit").CSSResult;
|
|
1
|
+
export declare const sidebarStyles: import("lit").CSSResult[];
|