@eunomia/elements 1.0.0-beta.9 → 1.0.0
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 +28 -6
- package/dist/angular/forms.d.ts +80 -0
- package/dist/angular/forms.js +267 -0
- package/dist/cdn/components/chunks/chunk-2XPIGFBD.js +1 -0
- package/dist/cdn/components/chunks/chunk-5IUNSTM3.js +1 -0
- package/dist/cdn/components/chunks/chunk-7HXPLZ7C.js +1 -0
- package/dist/cdn/components/chunks/{chunk-J3SZBXM6.js → chunk-A2NO4RSF.js} +7 -7
- package/dist/cdn/components/chunks/{chunk-Q34EQ5HZ.js → chunk-A623JJXJ.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-Y3HOIL64.js → chunk-AW7PU43S.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-FF3I7C3C.js → chunk-DWTNRFWW.js} +1 -3
- package/dist/cdn/components/chunks/chunk-FPNWPMHA.js +1 -0
- package/dist/cdn/components/chunks/chunk-GMWUHGNI.js +319 -0
- package/dist/cdn/components/chunks/{chunk-FQUWHNQT.js → chunk-GXOEPXDW.js} +1 -1
- package/dist/cdn/components/chunks/chunk-HXESKTK2.js +1 -0
- package/dist/cdn/components/chunks/chunk-JDUWKPHW.js +46 -0
- package/dist/cdn/components/chunks/{chunk-D3JJBHXN.js → chunk-JLKCBPD2.js} +2 -2
- package/dist/cdn/components/chunks/chunk-M6ZJHL4Q.js +1 -0
- package/dist/cdn/components/chunks/{chunk-TN3HGHQO.js → chunk-MDSUMP3O.js} +4 -4
- package/dist/cdn/components/chunks/chunk-MSQWOKBB.js +1 -0
- package/dist/cdn/components/chunks/{chunk-3UUZM7X2.js → chunk-NPXRQHUN.js} +3 -3
- package/dist/cdn/components/chunks/chunk-OB7DEGNX.js +1 -0
- package/dist/cdn/components/chunks/{chunk-JANNHW4Q.js → chunk-PADHCLBG.js} +4 -4
- package/dist/cdn/components/chunks/chunk-QMXE3KLT.js +1 -0
- package/dist/cdn/components/chunks/chunk-QNWKRPOW.js +1 -0
- package/dist/cdn/components/chunks/{chunk-KQUUMZ7U.js → chunk-RZF7QQDX.js} +7 -7
- package/dist/cdn/components/chunks/chunk-SCAP7J35.js +1 -0
- package/dist/cdn/components/chunks/chunk-TISMX7UL.js +1 -0
- package/dist/cdn/components/chunks/chunk-TWLI2ZOT.js +1 -0
- package/dist/cdn/components/chunks/chunk-W4VCWRY7.js +210 -0
- package/dist/cdn/components/chunks/{chunk-SZZRMJ65.js → chunk-WEG3KO6T.js} +3 -3
- package/dist/cdn/components/chunks/chunk-WP6ZYBAC.js +1 -0
- package/dist/cdn/components/chunks/{chunk-HGX6GPHM.js → chunk-XCBQ4CKH.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-3UW2LJ7T.js → chunk-XZ3LFOQP.js} +2 -2
- package/dist/cdn/components/eun-alert.js +1 -1
- package/dist/cdn/components/eun-animate.js +92 -180
- package/dist/cdn/components/eun-breadcrumb.js +4 -4
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +188 -115
- package/dist/cdn/components/eun-card.js +1 -1
- package/dist/cdn/components/eun-carousel.js +36 -28
- package/dist/cdn/components/eun-check-card.js +3 -3
- package/dist/cdn/components/eun-checkbox-list.js +2 -2
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +11 -15
- package/dist/cdn/components/eun-collapse.js +21 -10
- package/dist/cdn/components/eun-color-picker.js +32 -32
- package/dist/cdn/components/eun-counter.js +8 -8
- package/dist/cdn/components/eun-date-picker.js +83 -79
- package/dist/cdn/components/eun-description-list.js +1 -1
- package/dist/cdn/components/eun-divider.js +9 -8
- package/dist/cdn/components/eun-drawer.js +8 -6
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +4 -4
- package/dist/cdn/components/eun-fab.js +1 -1
- package/dist/cdn/components/eun-image-card.js +2 -2
- package/dist/cdn/components/eun-image-carousel.js +55 -29
- package/dist/cdn/components/eun-infinite-list.js +2 -2
- package/dist/cdn/components/eun-input-file.js +3 -3
- package/dist/cdn/components/eun-input-phone.js +6 -6
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-label.js +1 -1
- package/dist/cdn/components/eun-link.js +18 -329
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +9 -7
- package/dist/cdn/components/eun-nav-menu.js +363 -0
- package/dist/cdn/components/eun-pagination.js +4 -4
- package/dist/cdn/components/eun-password-strength.js +2 -2
- package/dist/cdn/components/eun-progress-bar.js +1 -1
- package/dist/cdn/components/eun-radio-card.js +4 -4
- package/dist/cdn/components/eun-radio-list.js +1 -1
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +9 -9
- package/dist/cdn/components/eun-scheduler-event-editor.js +113 -77
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +137 -79
- package/dist/cdn/components/eun-search.js +6 -6
- package/dist/cdn/components/eun-select.js +1 -1
- package/dist/cdn/components/eun-sidebar.js +23 -14
- package/dist/cdn/components/eun-slider.js +2 -2
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +2 -2
- package/dist/cdn/components/eun-stepper.js +11 -12
- package/dist/cdn/components/eun-switch.js +2 -2
- package/dist/cdn/components/eun-tab-group.js +1 -1
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +13 -10
- package/dist/cdn/components/eun-tag.js +1 -1
- package/dist/cdn/components/eun-textarea.js +4 -4
- package/dist/cdn/components/eun-time-picker.js +28 -25
- package/dist/cdn/components/eun-toast.js +8 -8
- package/dist/cdn/components/eun-toggle-group.js +8 -2
- package/dist/cdn/components/eun-toggle-item.js +8 -2
- package/dist/cdn/components/eun-toggle.js +4 -1
- package/dist/cdn/components/eun-toolbar.js +114 -36
- package/dist/cdn/components/eun-tooltip.js +1 -1
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/eunomia-theme.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/cdn/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
- package/dist/components/action/button/button.styles.js +2 -2
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -0
- package/dist/components/action/dropdown-button/dropdown-button.js +1 -0
- package/dist/components/action/dropdown-button/dropdown-button.styles.js +5 -4
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +1 -0
- package/dist/components/action/dropdown-button/dropdown-item.js +1 -0
- package/dist/components/action/dropdown-button/dropdown-item.styles.js +4 -4
- package/dist/components/action/link/link.d.ts +2 -1
- package/dist/components/action/link/link.js +2 -1
- package/dist/components/action/link/link.styles.d.ts +40 -1
- package/dist/components/action/link/link.styles.js +83 -60
- package/dist/components/action/shared-styles/button-palette.styles.js +1 -1
- package/dist/components/action/toggle/toggle-group.d.ts +1 -0
- package/dist/components/action/toggle/toggle-group.js +1 -0
- package/dist/components/action/toggle/toggle-group.styles.d.ts +1 -0
- package/dist/components/action/toggle/toggle-group.styles.js +9 -2
- package/dist/components/action/toggle/toggle-item.styles.js +8 -2
- package/dist/components/action/toggle/toggle.d.ts +1 -0
- package/dist/components/action/toggle/toggle.js +1 -0
- package/dist/components/action/toggle/toggle.styles.d.ts +1 -0
- package/dist/components/action/toggle/toggle.styles.js +5 -1
- package/dist/components/alert/drawer/drawer.d.ts +14 -13
- package/dist/components/alert/drawer/drawer.js +20 -28
- package/dist/components/alert/modal/modal.d.ts +14 -13
- package/dist/components/alert/modal/modal.js +20 -28
- package/dist/components/alert/modal/modal.styles.js +1 -1
- package/dist/components/alert/toast/toast.d.ts +5 -5
- package/dist/components/alert/toast/toast.js +9 -10
- package/dist/components/alert/toast/toast.styles.js +3 -3
- package/dist/components/content/card/image-card.styles.js +1 -1
- package/dist/components/content/chip/chip.d.ts +7 -9
- package/dist/components/content/chip/chip.js +11 -14
- package/dist/components/content/chip/chip.styles.js +1 -5
- package/dist/components/content/collapse/collapse.d.ts +5 -0
- package/dist/components/content/collapse/collapse.js +7 -0
- package/dist/components/content/collapse/collapse.styles.d.ts +3 -0
- package/dist/components/content/collapse/collapse.styles.js +13 -1
- package/dist/components/content/description-list/description-list.styles.js +1 -1
- package/dist/components/content/image-carousel/image-carousel.d.ts +60 -13
- package/dist/components/content/image-carousel/image-carousel.js +100 -22
- package/dist/components/content/image-carousel/image-carousel.styles.js +32 -6
- package/dist/components/content/password-strength/password-strength.styles.js +1 -1
- package/dist/components/content/progress-bar/progress-bar.styles.js +1 -1
- package/dist/components/content/shared-styles/card-link.styles.js +1 -1
- package/dist/components/content/shared-styles/tone-surface.styles.js +1 -3
- package/dist/components/form/checkbox/check-card.styles.js +2 -2
- package/dist/components/form/checkbox/checkbox-list.d.ts +3 -1
- package/dist/components/form/checkbox/checkbox-list.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +1 -1
- package/dist/components/form/color-picker/color-picker.d.ts +28 -3
- package/dist/components/form/color-picker/color-picker.js +53 -7
- package/dist/components/form/counter/counter.js +1 -1
- package/dist/components/form/counter/counter.styles.js +2 -2
- package/dist/components/form/date-picker/date-picker-day-grid.styles.js +1 -1
- package/dist/components/form/date-picker/date-picker-month-grid.js +1 -1
- package/dist/components/form/date-picker/date-picker.d.ts +50 -13
- package/dist/components/form/date-picker/date-picker.js +178 -43
- package/dist/components/form/input/input.js +1 -4
- package/dist/components/form/input-file/input-file.styles.js +2 -2
- package/dist/components/form/input-phone/input-phone.js +4 -3
- package/dist/components/form/label/label.styles.js +1 -1
- package/dist/components/form/radio/radio-card.styles.js +2 -2
- package/dist/components/form/radio/radio.styles.js +1 -1
- package/dist/components/form/rating/rating.js +3 -5
- package/dist/components/form/rating/rating.styles.js +2 -2
- package/dist/components/form/search/search.d.ts +1 -7
- package/dist/components/form/search/search.js +2 -12
- package/dist/components/form/shared-styles/field.styles.js +2 -2
- package/dist/components/form/slider/slider.styles.js +1 -1
- package/dist/components/form/switch/switch.styles.js +1 -1
- package/dist/components/form/textarea/textarea.js +1 -5
- package/dist/components/form/textarea/textarea.styles.js +2 -2
- package/dist/components/form/time-picker/time-picker-columns.d.ts +4 -1
- package/dist/components/form/time-picker/time-picker-columns.js +64 -15
- package/dist/components/form/time-picker/time-picker-columns.styles.js +5 -1
- package/dist/components/form/time-picker/time-picker-list.d.ts +4 -1
- package/dist/components/form/time-picker/time-picker-list.js +15 -8
- package/dist/components/form/time-picker/time-picker.d.ts +11 -2
- package/dist/components/form/time-picker/time-picker.js +22 -8
- package/dist/components/layout/animate/animate.d.ts +35 -17
- package/dist/components/layout/animate/animate.js +27 -14
- package/dist/components/layout/animate/animate.styles.d.ts +2 -1
- package/dist/components/layout/animate/animate.styles.js +107 -179
- package/dist/components/layout/divider/divider.d.ts +1 -0
- package/dist/components/layout/divider/divider.js +2 -1
- package/dist/components/layout/divider/divider.styles.js +7 -6
- package/dist/components/layout/infinite-list/infinite-list.styles.js +1 -1
- package/dist/components/navigation/breadcrumb/breadcrumb.styles.js +3 -3
- package/dist/components/navigation/carousel/carousel.d.ts +23 -14
- package/dist/components/navigation/carousel/carousel.js +39 -27
- package/dist/components/navigation/carousel/carousel.styles.js +16 -8
- package/dist/components/navigation/nav-menu/nav-menu.d.ts +201 -0
- package/dist/components/navigation/nav-menu/nav-menu.js +673 -0
- package/dist/components/navigation/nav-menu/nav-menu.styles.d.ts +1 -0
- package/dist/components/navigation/nav-menu/nav-menu.styles.js +352 -0
- package/dist/components/navigation/pagination/pagination.d.ts +3 -0
- package/dist/components/navigation/pagination/pagination.styles.js +2 -2
- package/dist/components/navigation/sidebar/sidebar.d.ts +8 -10
- package/dist/components/navigation/sidebar/sidebar.js +12 -15
- package/dist/components/navigation/sidebar/sidebar.styles.js +13 -4
- package/dist/components/navigation/stepper/step.styles.js +2 -2
- package/dist/components/navigation/stepper/stepper.d.ts +24 -13
- package/dist/components/navigation/stepper/stepper.js +36 -23
- package/dist/components/navigation/stepper/stepper.styles.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.js +1 -1
- package/dist/components/navigation/tabs/tab-panel/tab-panel.styles.js +1 -1
- package/dist/components/navigation/toolbar/toolbar.d.ts +121 -20
- package/dist/components/navigation/toolbar/toolbar.js +176 -45
- package/dist/components/navigation/toolbar/toolbar.styles.js +113 -28
- package/dist/events/editor-state-change.event.d.ts +28 -0
- package/dist/events/editor-state-change.event.js +22 -0
- package/dist/events/event-cancel.event.d.ts +20 -0
- package/dist/events/event-cancel.event.js +17 -0
- package/dist/events/period-change.event.d.ts +14 -6
- package/dist/events/period-change.event.js +9 -6
- package/dist/features/scheduler/calendar/calendar.d.ts +52 -20
- package/dist/features/scheduler/calendar/calendar.js +84 -36
- package/dist/features/scheduler/calendar/calendar.styles.js +5 -2
- package/dist/features/scheduler/scheduler/scheduler.d.ts +69 -4
- package/dist/features/scheduler/scheduler/scheduler.js +172 -47
- package/dist/features/scheduler/scheduler/scheduler.styles.js +6 -0
- package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +18 -20
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +29 -38
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +2 -2
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +102 -18
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +249 -112
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.styles.js +11 -1
- package/dist/features/scheduler/shared/scheduler-event-popover.d.ts +9 -1
- package/dist/features/scheduler/shared/scheduler-event-popover.js +77 -42
- package/dist/features/scheduler/shared/scheduler-event-popover.styles.js +14 -3
- package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +3 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.js +53 -46
- package/dist/features/scheduler/shared/scheduler-hour-grid.styles.js +13 -7
- package/dist/features/scheduler/shared/scheduler-month-view.js +1 -1
- package/dist/features/scheduler/shared/scheduler-month-view.styles.js +13 -7
- package/dist/features/scheduler/shared/scheduler-year-view.d.ts +6 -5
- package/dist/features/scheduler/shared/scheduler-year-view.js +11 -7
- package/dist/features/scheduler/shared/scheduler-year-view.styles.js +57 -3
- package/dist/features/scheduler/shared/scheduler.types.d.ts +5 -9
- package/dist/features/scheduler/shared/scheduler.utils.d.ts +61 -0
- package/dist/features/scheduler/shared/scheduler.utils.js +78 -4
- package/dist/features/table/table/table-native.styles.js +8 -4
- package/dist/features/table/table/table.d.ts +2 -1
- package/dist/features/table/table/table.js +2 -1
- package/dist/features/table/table/table.styles.js +6 -4
- package/dist/i18n/en.d.ts +17 -0
- package/dist/i18n/en.js +17 -0
- package/dist/i18n/fr.js +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -0
- package/dist/jsx.d.ts +48 -6
- package/dist/mixins/anchor-position.mixin.d.ts +17 -0
- package/dist/mixins/anchor-position.mixin.js +45 -7
- package/dist/mixins/button.mixin.js +2 -1
- package/dist/mixins/check.mixin.js +14 -5
- package/dist/mixins/dialog-surface.mixin.d.ts +1 -1
- package/dist/mixins/dialog-surface.mixin.js +5 -5
- package/dist/mixins/form.mixin.js +33 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -0
- package/dist/mixins/localizable.mixin.js +9 -2
- package/dist/mixins/radio.mixin.js +14 -5
- package/dist/mixins/validators.mixin.js +4 -3
- package/dist/react.d.ts +59 -0
- package/dist/react.js +42 -0
- package/dist/ssr/animate-ssr.css +35 -0
- package/dist/ssr/breadcrumb-ssr.css +3 -3
- package/dist/ssr/button-ssr.css +8 -2
- package/dist/ssr/card-ssr.css +1 -1
- package/dist/ssr/carousel-ssr.css +15 -4
- package/dist/ssr/chip-ssr.css +3 -3
- package/dist/ssr/collapse-ssr.css +2 -2
- package/dist/ssr/description-list-ssr.css +1 -1
- package/dist/ssr/divider-ssr.css +23 -0
- package/dist/ssr/field-ssr.css +245 -42
- package/dist/ssr/image-carousel-ssr.css +2 -4
- package/dist/ssr/links-ssr.css +17 -3
- package/dist/ssr/nav-menu-ssr.css +82 -0
- package/dist/ssr/overlay-ssr.css +4 -0
- package/dist/ssr/scheduler-ssr.css +182 -0
- package/dist/ssr/stepper-ssr.css +136 -0
- package/dist/ssr/table-ssr.css +7 -4
- package/dist/ssr/tag-ssr.css +1 -1
- package/dist/ssr/toolbar-ssr.css +7 -5
- package/dist/utils/css-length.utils.d.ts +14 -0
- package/dist/utils/css-length.utils.js +32 -0
- package/dist/utils/form-validation.utils.d.ts +36 -0
- package/dist/utils/form-validation.utils.js +113 -0
- package/dist/utils/implicit-submission.utils.js +2 -14
- package/dist/utils/interactive-content.utils.d.ts +10 -0
- package/dist/utils/interactive-content.utils.js +43 -0
- package/dist/utils/popover.utils.js +3 -2
- package/dist/utils/scroll-lock.utils.d.ts +9 -1
- package/dist/utils/scroll-lock.utils.js +21 -2
- package/dist/utils/theme-generator.utils.d.ts +1 -0
- package/dist/utils/theme-generator.utils.js +23 -10
- package/dist/utils/validity.utils.d.ts +18 -4
- package/dist/utils/validity.utils.js +74 -4
- package/package.json +34 -3
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +2 -2
- package/styles/tools/mixins/layout/eunomia-grid.mixin.scss +116 -8
- package/dist/cdn/components/chunks/chunk-4DRU3IYJ.js +0 -1
- package/dist/cdn/components/chunks/chunk-647ISUF4.js +0 -1
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +0 -1
- package/dist/cdn/components/chunks/chunk-E6UOI36Q.js +0 -1
- package/dist/cdn/components/chunks/chunk-GNAUNTS5.js +0 -1
- package/dist/cdn/components/chunks/chunk-IJJ67C66.js +0 -1
- package/dist/cdn/components/chunks/chunk-J7ETIRSK.js +0 -1
- package/dist/cdn/components/chunks/chunk-JGV7LHEI.js +0 -1
- package/dist/cdn/components/chunks/chunk-L74LXUGL.js +0 -1
- package/dist/cdn/components/chunks/chunk-MY6ORZJR.js +0 -46
- package/dist/cdn/components/chunks/chunk-QWTFP56P.js +0 -1
- package/dist/cdn/components/chunks/chunk-SFX2LQ4K.js +0 -205
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +0 -1
- package/dist/utils/boolean.utils.d.ts +0 -14
- package/dist/utils/boolean.utils.js +0 -20
|
@@ -8,13 +8,13 @@ var EunomiaImageCarousel_1;
|
|
|
8
8
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { html, LitElement, nothing } from "lit";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
+
import { readCssLength } from "../../../utils/css-length.utils.js";
|
|
11
12
|
import { debounce } from "../../../utils/time.utils.js";
|
|
12
13
|
import { createSwipeGesture, } from "../../../utils/swipe-gesture.utils.js";
|
|
13
14
|
import { ImageChangeEvent } from "../../../events/imagechange.event.js";
|
|
14
15
|
import { imageCarouselStyles } from "./image-carousel.styles.js";
|
|
15
16
|
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
16
17
|
import { cssTimeToMs } from "../../../utils/motion.utils.js";
|
|
17
|
-
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
18
18
|
/**
|
|
19
19
|
* Tag name of the image carousel component.
|
|
20
20
|
*/
|
|
@@ -46,13 +46,13 @@ export const EunomiaImageCarouselTagName = "eun-image-carousel";
|
|
|
46
46
|
* @prop {boolean} [magnifier=false] - Enables a hover-to-zoom effect on the main image, for mouse and pen pointers only. Has no effect on touch, which relies on the lightbox instead
|
|
47
47
|
* @prop {number} [magnifierZoom=2.5] - How much the main image scales up under the cursor while hovering, with magnifier on
|
|
48
48
|
* @attr {number} [magnifier-zoom=2.5] - How much the main image scales up under the cursor while hovering, with magnifier on
|
|
49
|
-
* @prop {boolean} [showThumbnails=
|
|
50
|
-
* @attr {boolean} [show-thumbnails=
|
|
51
|
-
* @prop {boolean} [showDots=
|
|
52
|
-
* @attr {boolean} [show-dots=
|
|
53
|
-
* @prop {boolean} [lightbox=
|
|
54
|
-
* @prop {boolean} [lightboxGrid=
|
|
55
|
-
* @attr {boolean} [lightbox-grid=
|
|
49
|
+
* @prop {boolean} [showThumbnails=false] - Shows the thumbnail strip below the main stage, for jumping directly to an image
|
|
50
|
+
* @attr {boolean} [show-thumbnails=false] - Shows the thumbnail strip below the main stage, for jumping directly to an image
|
|
51
|
+
* @prop {boolean} [showDots=false] - Shows pagination dots below the main stage as a position indicator when the thumbnail strip is off. Has no effect while thumbnails are shown, since they already convey the same information
|
|
52
|
+
* @attr {boolean} [show-dots=false] - Shows pagination dots below the main stage as a position indicator when the thumbnail strip is off. Has no effect while thumbnails are shown, since they already convey the same information
|
|
53
|
+
* @prop {boolean} [lightbox=false] - Whether clicking the main image, or its expand control, opens the full-size lightbox
|
|
54
|
+
* @prop {boolean} [lightboxGrid=false] - Shows a scrollable grid of every image alongside the lightbox's own main image, for jumping directly to one without closing it
|
|
55
|
+
* @attr {boolean} [lightbox-grid=false] - Shows a scrollable grid of every image alongside the lightbox's own main image, for jumping directly to one without closing it
|
|
56
56
|
* @prop {boolean} [loop=false] - Wraps the previous and next controls around at the bounds instead of stopping there, on both the main stage and the lightbox
|
|
57
57
|
* @prop {EunomiaImageCarouselTransition} [transition='slide'] - How the main stage and the lightbox animate between images
|
|
58
58
|
* @prop {boolean} [autoplay=false] - Automatically advances to the next image on a set interval. Pauses on hover or focus and while the lightbox is open, but renders no pause or play control of its own, so pair this with a visible control calling the public pause and resume methods, since a moving gallery nobody can stop fails accessibility guidelines
|
|
@@ -76,6 +76,7 @@ export const EunomiaImageCarouselTagName = "eun-image-carousel";
|
|
|
76
76
|
* @cssprop [--image-carousel-border-color] - Sets the border color of the main stage, which has no border by default
|
|
77
77
|
* @cssprop [--image-carousel-thumbnail-size] - Sets the size of each thumbnail
|
|
78
78
|
* @cssprop [--image-carousel-thumbnail-gap] - Sets the gap between thumbnails, and between the strip and the main stage
|
|
79
|
+
* @cssprop [--image-carousel-thumbnail-fade-size] - Sets the width of the fade on the thumbnail strip's edges that still hide thumbnails
|
|
79
80
|
* @cssprop [--image-carousel-thumbnail-border-color] - Sets the border color of the thumbnails and of the lightbox's grid items at rest, transparent by default
|
|
80
81
|
* @cssprop [--image-carousel-thumbnail-active-border-color] - Sets the border color of the active thumbnail and of the lightbox's active grid item
|
|
81
82
|
* @cssprop [--image-carousel-nav-color] - Sets the icon color of the main stage's previous and next controls
|
|
@@ -92,6 +93,8 @@ export const EunomiaImageCarouselTagName = "eun-image-carousel";
|
|
|
92
93
|
* @cssprop [--image-carousel-dot-gap] - Sets the gap between pagination dots
|
|
93
94
|
* @cssprop [--image-carousel-dot-color] - Sets the color of the pagination dots
|
|
94
95
|
* @cssprop [--image-carousel-dot-active-color] - Sets the color of the active pagination dot
|
|
96
|
+
* @cssprop [--image-carousel-focus-outline-color] - Sets the keyboard focus outline color of the stage, controls, thumbnails, dots and lightbox grid items
|
|
97
|
+
* @cssprop [--image-carousel-lightbox-focus-outline-color] - Sets the keyboard focus outline color of the lightbox's previous and next controls
|
|
95
98
|
* @element eun-image-carousel
|
|
96
99
|
*/
|
|
97
100
|
let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel extends LocalizableMixin(LitElement) {
|
|
@@ -127,31 +130,30 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
127
130
|
/**
|
|
128
131
|
* Shows the thumbnail strip below the main stage, for jumping directly
|
|
129
132
|
* to an image.
|
|
130
|
-
* @default
|
|
133
|
+
* @default false
|
|
131
134
|
*/
|
|
132
|
-
this.showThumbnails =
|
|
135
|
+
this.showThumbnails = false;
|
|
133
136
|
/**
|
|
134
137
|
* Shows pagination dots below the main stage as a position indicator
|
|
135
138
|
* (which image, how many total) when `showThumbnails` is off — without
|
|
136
139
|
* either, there'd be no visible way to tell. No effect while thumbnails
|
|
137
|
-
* are shown, which already convey the same information
|
|
138
|
-
*
|
|
139
|
-
* @default true
|
|
140
|
+
* are shown, which already convey the same information.
|
|
141
|
+
* @default false
|
|
140
142
|
*/
|
|
141
|
-
this.showDots =
|
|
143
|
+
this.showDots = false;
|
|
142
144
|
/**
|
|
143
145
|
* Whether clicking the main image (or its expand control) opens the
|
|
144
146
|
* full-size lightbox.
|
|
145
|
-
* @default
|
|
147
|
+
* @default false
|
|
146
148
|
*/
|
|
147
|
-
this.lightbox =
|
|
149
|
+
this.lightbox = false;
|
|
148
150
|
/**
|
|
149
151
|
* Shows a scrollable grid of every image alongside the lightbox's own
|
|
150
152
|
* main image — clicking a tile swaps the lightbox's image without
|
|
151
153
|
* closing it, the same way a classifieds site's photo viewer does.
|
|
152
|
-
* @default
|
|
154
|
+
* @default false
|
|
153
155
|
*/
|
|
154
|
-
this.lightboxGrid =
|
|
156
|
+
this.lightboxGrid = false;
|
|
155
157
|
/**
|
|
156
158
|
* Wraps prev/next around at the bounds instead of stopping there, on
|
|
157
159
|
* both the main stage and the lightbox.
|
|
@@ -230,6 +232,20 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
230
232
|
this.scheduleAnnounce = debounce(() => {
|
|
231
233
|
this.announcement = this.buildAnnouncement();
|
|
232
234
|
}, 150);
|
|
235
|
+
/**
|
|
236
|
+
* Fades out whichever edge of the thumbnail strip still has thumbnails
|
|
237
|
+
* hidden past it, hinting that the strip scrolls that way.
|
|
238
|
+
* @private
|
|
239
|
+
*/
|
|
240
|
+
this.updateThumbnailsFade = () => {
|
|
241
|
+
const strip = this.thumbnailsEl;
|
|
242
|
+
if (!strip) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
const maxScroll = strip.scrollWidth - strip.clientWidth;
|
|
246
|
+
strip.toggleAttribute("data-fade-start", strip.scrollLeft > 1);
|
|
247
|
+
strip.toggleAttribute("data-fade-end", strip.scrollLeft < maxScroll - 1);
|
|
248
|
+
};
|
|
233
249
|
/**
|
|
234
250
|
* Pauses autoplay on hover/focus, without touching {@link manuallyPaused}
|
|
235
251
|
* — it resumes on {@link handleTransientResume}, unless {@link pauseAutoplay}
|
|
@@ -490,6 +506,60 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
490
506
|
onDragCancel: this.handleStageDragCancel,
|
|
491
507
|
});
|
|
492
508
|
}
|
|
509
|
+
this.syncThumbnailsStrip(changed);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Keeps the thumbnail strip's observer on the current strip, refreshes
|
|
513
|
+
* its edge fades, and scrolls the active thumbnail into view whenever
|
|
514
|
+
* the active image changes.
|
|
515
|
+
*
|
|
516
|
+
* @param changed the properties changed in this update.
|
|
517
|
+
* @private
|
|
518
|
+
*/
|
|
519
|
+
syncThumbnailsStrip(changed) {
|
|
520
|
+
const strip = this.thumbnailsEl;
|
|
521
|
+
if (strip !== this.observedThumbnailsEl) {
|
|
522
|
+
this.thumbnailsObserver?.disconnect();
|
|
523
|
+
this.observedThumbnailsEl = strip;
|
|
524
|
+
if (strip && typeof ResizeObserver !== "undefined") {
|
|
525
|
+
this.thumbnailsObserver ??= new ResizeObserver(this.updateThumbnailsFade);
|
|
526
|
+
this.thumbnailsObserver.observe(strip);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (!strip) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
if (changed.has("activeIndex")) {
|
|
533
|
+
this.scrollActiveThumbnailIntoView(strip);
|
|
534
|
+
}
|
|
535
|
+
this.updateThumbnailsFade();
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Scrolls the strip, and only the strip (unlike `scrollIntoView`, which
|
|
539
|
+
* would also scroll the page), just enough to fully show the active
|
|
540
|
+
* thumbnail clear of the edge fades.
|
|
541
|
+
*
|
|
542
|
+
* @param strip the thumbnail strip.
|
|
543
|
+
* @private
|
|
544
|
+
*/
|
|
545
|
+
scrollActiveThumbnailIntoView(strip) {
|
|
546
|
+
const thumb = strip.children[this.activeIndex];
|
|
547
|
+
if (!thumb) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
const start = thumb.offsetLeft - strip.offsetLeft;
|
|
551
|
+
const end = start + thumb.offsetWidth;
|
|
552
|
+
const fade = readCssLength(strip, "--_thumbnailsFade") || 0;
|
|
553
|
+
let target;
|
|
554
|
+
if (start - fade < strip.scrollLeft) {
|
|
555
|
+
target = start - fade;
|
|
556
|
+
}
|
|
557
|
+
else if (end + fade > strip.scrollLeft + strip.clientWidth) {
|
|
558
|
+
target = end + fade - strip.clientWidth;
|
|
559
|
+
}
|
|
560
|
+
if (target !== undefined) {
|
|
561
|
+
strip.scrollTo({ left: Math.max(0, target), behavior: "smooth" });
|
|
562
|
+
}
|
|
493
563
|
}
|
|
494
564
|
/**
|
|
495
565
|
* Whether `el` is one of the prev/next controls (main stage or
|
|
@@ -538,6 +608,8 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
538
608
|
}
|
|
539
609
|
this.swipeGesture?.destroy();
|
|
540
610
|
this.dragPreviewEl?.remove();
|
|
611
|
+
this.thumbnailsObserver?.disconnect();
|
|
612
|
+
this.observedThumbnailsEl = undefined;
|
|
541
613
|
super.disconnectedCallback?.();
|
|
542
614
|
}
|
|
543
615
|
/**
|
|
@@ -1022,6 +1094,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1022
1094
|
id="thumbnails"
|
|
1023
1095
|
role="group"
|
|
1024
1096
|
aria-label=${this.dictionary.imageCarousel.selectImage}
|
|
1097
|
+
@scroll=${this.updateThumbnailsFade}
|
|
1025
1098
|
>
|
|
1026
1099
|
${this.images.map((image, index) => html `
|
|
1027
1100
|
<button
|
|
@@ -1098,6 +1171,8 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1098
1171
|
<eun-modal
|
|
1099
1172
|
id="modal"
|
|
1100
1173
|
hide-actions
|
|
1174
|
+
closeable
|
|
1175
|
+
close-on-backdrop
|
|
1101
1176
|
aria-label=${this.lightboxLabel ??
|
|
1102
1177
|
this.dictionary.imageCarousel.lightbox}
|
|
1103
1178
|
@euncancel=${() => this.handleTransientResume()}
|
|
@@ -1261,16 +1336,16 @@ __decorate([
|
|
|
1261
1336
|
property({ type: Number, attribute: "magnifier-zoom" })
|
|
1262
1337
|
], EunomiaImageCarousel.prototype, "magnifierZoom", void 0);
|
|
1263
1338
|
__decorate([
|
|
1264
|
-
property({
|
|
1339
|
+
property({ type: Boolean, attribute: "show-thumbnails" })
|
|
1265
1340
|
], EunomiaImageCarousel.prototype, "showThumbnails", void 0);
|
|
1266
1341
|
__decorate([
|
|
1267
|
-
property({
|
|
1342
|
+
property({ type: Boolean, attribute: "show-dots" })
|
|
1268
1343
|
], EunomiaImageCarousel.prototype, "showDots", void 0);
|
|
1269
1344
|
__decorate([
|
|
1270
|
-
property({
|
|
1345
|
+
property({ type: Boolean })
|
|
1271
1346
|
], EunomiaImageCarousel.prototype, "lightbox", void 0);
|
|
1272
1347
|
__decorate([
|
|
1273
|
-
property({
|
|
1348
|
+
property({ type: Boolean, attribute: "lightbox-grid" })
|
|
1274
1349
|
], EunomiaImageCarousel.prototype, "lightboxGrid", void 0);
|
|
1275
1350
|
__decorate([
|
|
1276
1351
|
property({ type: Boolean })
|
|
@@ -1317,6 +1392,9 @@ __decorate([
|
|
|
1317
1392
|
__decorate([
|
|
1318
1393
|
query("#stage-images")
|
|
1319
1394
|
], EunomiaImageCarousel.prototype, "stageImagesEl", void 0);
|
|
1395
|
+
__decorate([
|
|
1396
|
+
query("#thumbnails")
|
|
1397
|
+
], EunomiaImageCarousel.prototype, "thumbnailsEl", void 0);
|
|
1320
1398
|
EunomiaImageCarousel = EunomiaImageCarousel_1 = __decorate([
|
|
1321
1399
|
customElement(EunomiaImageCarouselTagName)
|
|
1322
1400
|
], EunomiaImageCarousel);
|
|
@@ -12,6 +12,7 @@ import { cssBelow } from "../../../utils/media.styles.js";
|
|
|
12
12
|
* [--image-carousel-border-color] - Set a custom border color for the main stage (no border by default)
|
|
13
13
|
* [--image-carousel-thumbnail-size] - Set a custom size for each thumbnail
|
|
14
14
|
* [--image-carousel-thumbnail-gap] - Set a custom gap between thumbnails, and between the strip and the main stage
|
|
15
|
+
* [--image-carousel-thumbnail-fade-size] - Set a custom width for the fade on the thumbnail strip's edges that still hide thumbnails
|
|
15
16
|
* [--image-carousel-thumbnail-border-color] - Set a custom border color for the thumbnails and the lightbox's grid items at rest (transparent by default)
|
|
16
17
|
* [--image-carousel-thumbnail-active-border-color] - Set a custom border color for the active thumbnail and the lightbox's active grid item
|
|
17
18
|
* [--image-carousel-nav-color] - Set a custom icon color for the main stage's prev/next controls
|
|
@@ -28,11 +29,18 @@ import { cssBelow } from "../../../utils/media.styles.js";
|
|
|
28
29
|
* [--image-carousel-dot-gap] - Set a custom gap between pagination dots
|
|
29
30
|
* [--image-carousel-dot-color] - Set a custom color for the pagination dots
|
|
30
31
|
* [--image-carousel-dot-active-color] - Set a custom color for the active pagination dot
|
|
32
|
+
* [--image-carousel-focus-outline-color] - Set a custom keyboard focus outline color for the stage, controls, thumbnails, dots and grid items
|
|
33
|
+
* [--image-carousel-lightbox-focus-outline-color] - Set a custom keyboard focus outline color for the lightbox's previous and next controls
|
|
31
34
|
*/
|
|
32
35
|
const base = css `
|
|
33
36
|
:host {
|
|
34
37
|
display: block;
|
|
38
|
+
min-width: 0;
|
|
35
39
|
--_magnifierZoom: 2.5;
|
|
40
|
+
--_focusOutline: var(
|
|
41
|
+
--image-carousel-focus-outline-color,
|
|
42
|
+
var(--eun-color-primary-500, #3d6fff)
|
|
43
|
+
);
|
|
36
44
|
--_transitionDuration: var(--image-carousel-transition-duration, 380ms);
|
|
37
45
|
--_swipe-duration: var(
|
|
38
46
|
--image-carousel-swipe-duration,
|
|
@@ -85,7 +93,7 @@ const base = css `
|
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
#stage:has(#expand-trigger:focus-visible) {
|
|
88
|
-
outline-color: var(--
|
|
96
|
+
outline-color: var(--_focusOutline);
|
|
89
97
|
outline-offset: 2px;
|
|
90
98
|
}
|
|
91
99
|
|
|
@@ -256,7 +264,7 @@ const base = css `
|
|
|
256
264
|
box-shadow: 0 2px 10px rgba(15, 23, 42, 0.28);
|
|
257
265
|
}
|
|
258
266
|
.stage-nav:focus-visible {
|
|
259
|
-
outline-color: var(--
|
|
267
|
+
outline-color: var(--_focusOutline);
|
|
260
268
|
outline-offset: 2px;
|
|
261
269
|
}
|
|
262
270
|
.stage-nav:disabled {
|
|
@@ -288,6 +296,23 @@ const base = css `
|
|
|
288
296
|
gap: var(--image-carousel-thumbnail-gap, var(--eun-space-s, 8px));
|
|
289
297
|
margin-top: var(--image-carousel-thumbnail-gap, var(--eun-space-s, 8px));
|
|
290
298
|
overflow-x: auto;
|
|
299
|
+
contain: inline-size;
|
|
300
|
+
--_thumbnailsFade: var(--image-carousel-thumbnail-fade-size, 32px);
|
|
301
|
+
--_fadeStart: 0px;
|
|
302
|
+
--_fadeEnd: 0px;
|
|
303
|
+
mask-image: linear-gradient(
|
|
304
|
+
to right,
|
|
305
|
+
transparent,
|
|
306
|
+
#000 var(--_fadeStart),
|
|
307
|
+
#000 calc(100% - var(--_fadeEnd)),
|
|
308
|
+
transparent
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
#thumbnails[data-fade-start] {
|
|
312
|
+
--_fadeStart: var(--_thumbnailsFade);
|
|
313
|
+
}
|
|
314
|
+
#thumbnails[data-fade-end] {
|
|
315
|
+
--_fadeEnd: var(--_thumbnailsFade);
|
|
291
316
|
}
|
|
292
317
|
.thumbnail {
|
|
293
318
|
all: unset;
|
|
@@ -325,11 +350,12 @@ const base = css `
|
|
|
325
350
|
);
|
|
326
351
|
}
|
|
327
352
|
.thumbnail:focus-visible {
|
|
328
|
-
outline-color: var(--
|
|
353
|
+
outline-color: var(--_focusOutline);
|
|
329
354
|
}
|
|
330
355
|
|
|
331
356
|
#dots {
|
|
332
357
|
display: flex;
|
|
358
|
+
flex-wrap: wrap;
|
|
333
359
|
align-items: center;
|
|
334
360
|
justify-content: center;
|
|
335
361
|
gap: var(--image-carousel-dot-gap, var(--eun-space-xs, 4px));
|
|
@@ -355,7 +381,7 @@ const base = css `
|
|
|
355
381
|
var(--eun-easing-default, ease);
|
|
356
382
|
}
|
|
357
383
|
.dot:focus-visible {
|
|
358
|
-
outline-color: var(--
|
|
384
|
+
outline-color: var(--_focusOutline);
|
|
359
385
|
}
|
|
360
386
|
.dot[aria-current="true"] {
|
|
361
387
|
width: calc(var(--image-carousel-dot-size, 8px) * 3.5);
|
|
@@ -431,7 +457,7 @@ const base = css `
|
|
|
431
457
|
background: rgba(0, 0, 0, 0.7);
|
|
432
458
|
}
|
|
433
459
|
.lightbox-nav:focus-visible {
|
|
434
|
-
outline-color: #fff;
|
|
460
|
+
outline-color: var(--image-carousel-lightbox-focus-outline-color, #fff);
|
|
435
461
|
}
|
|
436
462
|
.lightbox-nav:disabled {
|
|
437
463
|
cursor: not-allowed;
|
|
@@ -494,7 +520,7 @@ const base = css `
|
|
|
494
520
|
);
|
|
495
521
|
}
|
|
496
522
|
.grid-item:focus-visible {
|
|
497
|
-
outline: 2px solid var(--
|
|
523
|
+
outline: 2px solid var(--_focusOutline);
|
|
498
524
|
outline-offset: 2px;
|
|
499
525
|
}
|
|
500
526
|
|
|
@@ -103,7 +103,7 @@ const base = css `
|
|
|
103
103
|
align-items: center;
|
|
104
104
|
justify-content: space-between;
|
|
105
105
|
gap: var(--eun-space-s, 8px);
|
|
106
|
-
color: var(--progress-bar-corner-color, var(--eun-text-secondary, #
|
|
106
|
+
color: var(--progress-bar-corner-color, var(--eun-text-secondary, #666e8a));
|
|
107
107
|
font-size: var(
|
|
108
108
|
--progress-bar-corner-font-size,
|
|
109
109
|
var(--eun-font-size-xs, 12px)
|
|
@@ -37,7 +37,7 @@ const base = css `
|
|
|
37
37
|
--card-link-badge-background,
|
|
38
38
|
var(--eun-content-hover, #edeff0)
|
|
39
39
|
);
|
|
40
|
-
color: var(--card-link-badge-color, var(--eun-text-secondary, #
|
|
40
|
+
color: var(--card-link-badge-color, var(--eun-text-secondary, #666e8a));
|
|
41
41
|
transform: rotate(-45deg);
|
|
42
42
|
pointer-events: none;
|
|
43
43
|
}
|
|
@@ -36,7 +36,6 @@ import { css } from "lit";
|
|
|
36
36
|
*/
|
|
37
37
|
export const toneSurfaceStyles = css `
|
|
38
38
|
:host {
|
|
39
|
-
/* How each appearance reads the palette slots. */
|
|
40
39
|
--_bg-default: var(--_tint);
|
|
41
40
|
--_fg-default: var(--_accent);
|
|
42
41
|
--_bg-fill: var(--_solid);
|
|
@@ -45,10 +44,9 @@ export const toneSurfaceStyles = css `
|
|
|
45
44
|
--_fg-outline: var(--_accent);
|
|
46
45
|
--_bd-outline: var(--_solid);
|
|
47
46
|
--_bg-flat: var(--eun-content-hover, #edeff0);
|
|
48
|
-
--_fg-flat: var(--eun-text-secondary, #
|
|
47
|
+
--_fg-flat: var(--eun-text-secondary, #666e8a);
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
/* Step 1 : palettes. "medium" is also the fallback before "color" reflects. */
|
|
52
50
|
:host(:not([color]):not([severity])),
|
|
53
51
|
:host([color="medium"]:not([severity])) {
|
|
54
52
|
--_solid: var(--eun-color-grey-700, #484e61);
|
|
@@ -40,12 +40,12 @@ const base = css `
|
|
|
40
40
|
);
|
|
41
41
|
--_hintColor: var(
|
|
42
42
|
--check-card-hint-color,
|
|
43
|
-
var(--eun-text-secondary, #
|
|
43
|
+
var(--eun-text-secondary, #666e8a)
|
|
44
44
|
);
|
|
45
45
|
--_color: var(--eun-text-color, #071621);
|
|
46
46
|
--_iconColor: var(
|
|
47
47
|
--check-card-icon-color,
|
|
48
|
-
var(--eun-text-secondary, #
|
|
48
|
+
var(--eun-text-secondary, #666e8a)
|
|
49
49
|
);
|
|
50
50
|
--_focusIndicator: var(
|
|
51
51
|
--check-card-focus-outline-color,
|
|
@@ -89,8 +89,10 @@ export declare class EunomiaCheckboxList extends EunomiaCheckboxList_base {
|
|
|
89
89
|
get value(): string[];
|
|
90
90
|
/**
|
|
91
91
|
* Setter allowing to check every child whose value is in the given list.
|
|
92
|
+
* `null` or `undefined` (a reset with no default value, or an empty form
|
|
93
|
+
* model) unchecks every child.
|
|
92
94
|
*/
|
|
93
|
-
set value(values: string[]);
|
|
95
|
+
set value(values: string[] | null | undefined);
|
|
94
96
|
/**
|
|
95
97
|
* Lifecycle hook called after the first render.
|
|
96
98
|
* Used to attach event listeners to the options list.
|
|
@@ -136,11 +136,13 @@ let EunomiaCheckboxList = class EunomiaCheckboxList extends FormLabelMixin(Reado
|
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Setter allowing to check every child whose value is in the given list.
|
|
139
|
+
* `null` or `undefined` (a reset with no default value, or an empty form
|
|
140
|
+
* model) unchecks every child.
|
|
139
141
|
*/
|
|
140
142
|
set value(values) {
|
|
141
143
|
void this.updateComplete.then(() => {
|
|
142
144
|
this.fields.forEach((field) => {
|
|
143
|
-
field.checked = values
|
|
145
|
+
field.checked = values?.includes(field.value) ?? false;
|
|
144
146
|
});
|
|
145
147
|
});
|
|
146
148
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { DisabledMixinInterface } from "../../../mixins/disabled.mixin.js";
|
|
3
3
|
import { ReadonlyMixinInterface } from "../../../mixins/readonly.mixin.js";
|
|
4
|
-
import { ValidatorsMixinInterface } from "../../../mixins/validators.mixin.js";
|
|
4
|
+
import { Validity, ValidatorsMixinInterface } from "../../../mixins/validators.mixin.js";
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { EditableMixinInterface } from "../../../mixins/editable.mixin.js";
|
|
@@ -298,6 +298,30 @@ export declare class EunomiaColorPicker extends EunomiaColorPickerMixinBase {
|
|
|
298
298
|
* @internal
|
|
299
299
|
*/
|
|
300
300
|
private get hexDraftInvalid();
|
|
301
|
+
/**
|
|
302
|
+
* The value handed to the native `<input type="color">`, which only
|
|
303
|
+
* accepts a `#rrggbb` hex and logs a warning for anything else.
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
306
|
+
private get nativeValue();
|
|
307
|
+
/**
|
|
308
|
+
* Whether the field is the inline hex text input (no presets), where an
|
|
309
|
+
* invalid draft stays visible after it's confirmed.
|
|
310
|
+
* @internal
|
|
311
|
+
*/
|
|
312
|
+
private get isInlineHexField();
|
|
313
|
+
/**
|
|
314
|
+
* Reads local validation state : an invalid hex typed in the inline
|
|
315
|
+
* field, or an assigned `value` that isn't a color, reports `badInput`.
|
|
316
|
+
*
|
|
317
|
+
* @returns validity state and optional message.
|
|
318
|
+
*/
|
|
319
|
+
checkLocalValidators: () => Validity;
|
|
320
|
+
/**
|
|
321
|
+
* `FormMixin`'s own `formResetCallback` restores `value` ; this also
|
|
322
|
+
* drops an invalid hex draft left in the field.
|
|
323
|
+
*/
|
|
324
|
+
formResetCallback(): void;
|
|
301
325
|
/**
|
|
302
326
|
* The trigger button's accessible name : `label` when set, exactly like
|
|
303
327
|
* every other field. Falls back next to a plain `aria-label` attribute
|
|
@@ -471,8 +495,9 @@ export declare class EunomiaColorPicker extends EunomiaColorPickerMixinBase {
|
|
|
471
495
|
private handleHexInput;
|
|
472
496
|
/**
|
|
473
497
|
* Commits the hex draft to `value` once it normalizes to a real color ;
|
|
474
|
-
* otherwise
|
|
475
|
-
*
|
|
498
|
+
* otherwise keeps it in the input, marked invalid, so the person sees
|
|
499
|
+
* why nothing was applied. An empty draft reverts to the last committed
|
|
500
|
+
* `value`.
|
|
476
501
|
* @private
|
|
477
502
|
*/
|
|
478
503
|
private handleHexCommit;
|
|
@@ -216,6 +216,22 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
216
216
|
* @internal
|
|
217
217
|
*/
|
|
218
218
|
this.presetFocusIndex = -1;
|
|
219
|
+
/**
|
|
220
|
+
* Reads local validation state : an invalid hex typed in the inline
|
|
221
|
+
* field, or an assigned `value` that isn't a color, reports `badInput`.
|
|
222
|
+
*
|
|
223
|
+
* @returns validity state and optional message.
|
|
224
|
+
*/
|
|
225
|
+
this.checkLocalValidators = () => {
|
|
226
|
+
const isValueInvalid = !!this.value && normalizeHexColor(this.value) === null;
|
|
227
|
+
if (isValueInvalid || (this.isInlineHexField && this.hexDraftInvalid)) {
|
|
228
|
+
return {
|
|
229
|
+
validity: { badInput: true },
|
|
230
|
+
message: this.dictionary.validation.invalidColor,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return { validity: {} };
|
|
234
|
+
};
|
|
219
235
|
/**
|
|
220
236
|
* Reacts to the dropdown panel's native `toggle` event : the single
|
|
221
237
|
* source of truth for open/close state. The panel is `popover="auto"`,
|
|
@@ -341,6 +357,32 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
341
357
|
get hexDraftInvalid() {
|
|
342
358
|
return this.hexDraft !== "" && normalizeHexColor(this.hexDraft) === null;
|
|
343
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* The value handed to the native `<input type="color">`, which only
|
|
362
|
+
* accepts a `#rrggbb` hex and logs a warning for anything else.
|
|
363
|
+
* @internal
|
|
364
|
+
*/
|
|
365
|
+
get nativeValue() {
|
|
366
|
+
return normalizeHexColor(this.value ?? "") ?? "#000000";
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Whether the field is the inline hex text input (no presets), where an
|
|
370
|
+
* invalid draft stays visible after it's confirmed.
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
373
|
+
get isInlineHexField() {
|
|
374
|
+
return (!(this.readonlyAvailable && !this.editing) &&
|
|
375
|
+
!this.swatchOnly &&
|
|
376
|
+
this.presets.length === 0);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* `FormMixin`'s own `formResetCallback` restores `value` ; this also
|
|
380
|
+
* drops an invalid hex draft left in the field.
|
|
381
|
+
*/
|
|
382
|
+
formResetCallback() {
|
|
383
|
+
super.formResetCallback();
|
|
384
|
+
this.hexDraft = this.value ?? "";
|
|
385
|
+
}
|
|
344
386
|
/**
|
|
345
387
|
* The trigger button's accessible name : `label` when set, exactly like
|
|
346
388
|
* every other field. Falls back next to a plain `aria-label` attribute
|
|
@@ -393,10 +435,13 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
393
435
|
* `eun-select` uses for its own search text vs. `value`.
|
|
394
436
|
*/
|
|
395
437
|
willUpdate(_changedProperties) {
|
|
396
|
-
super.willUpdate(_changedProperties);
|
|
397
438
|
if (_changedProperties.has("value") && !this.isOpen) {
|
|
398
439
|
this.hexDraft = this.value ?? "";
|
|
399
440
|
}
|
|
441
|
+
if (_changedProperties.has("hexDraft")) {
|
|
442
|
+
this.checkValidity(this.value);
|
|
443
|
+
}
|
|
444
|
+
super.willUpdate(_changedProperties);
|
|
400
445
|
}
|
|
401
446
|
/**
|
|
402
447
|
* The host is never a tab stop of its own : sequential navigation goes
|
|
@@ -604,8 +649,9 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
604
649
|
}
|
|
605
650
|
/**
|
|
606
651
|
* Commits the hex draft to `value` once it normalizes to a real color ;
|
|
607
|
-
* otherwise
|
|
608
|
-
*
|
|
652
|
+
* otherwise keeps it in the input, marked invalid, so the person sees
|
|
653
|
+
* why nothing was applied. An empty draft reverts to the last committed
|
|
654
|
+
* `value`.
|
|
609
655
|
* @private
|
|
610
656
|
*/
|
|
611
657
|
handleHexCommit() {
|
|
@@ -613,7 +659,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
613
659
|
if (normalized) {
|
|
614
660
|
this.handleSelect(normalized);
|
|
615
661
|
}
|
|
616
|
-
else {
|
|
662
|
+
else if (this.hexDraft.trim() === "") {
|
|
617
663
|
this.hexDraft = this.value ?? "";
|
|
618
664
|
}
|
|
619
665
|
}
|
|
@@ -843,7 +889,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
843
889
|
aria-label=${this.nativeInputLabel ??
|
|
844
890
|
this.dictionary.colorPicker.nativeInput}
|
|
845
891
|
?disabled=${this.disabled || this.readonly}
|
|
846
|
-
.value=${live(this.
|
|
892
|
+
.value=${live(this.nativeValue)}
|
|
847
893
|
@input=${this.handleNativeInput}
|
|
848
894
|
/>
|
|
849
895
|
</label>
|
|
@@ -906,7 +952,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
906
952
|
aria-label=${this.nativeInputLabel ??
|
|
907
953
|
this.dictionary.colorPicker.nativeInput}
|
|
908
954
|
?disabled=${this.disabled || this.readonly}
|
|
909
|
-
.value=${live(this.
|
|
955
|
+
.value=${live(this.nativeValue)}
|
|
910
956
|
@input=${this.handleNativeInput}
|
|
911
957
|
/>
|
|
912
958
|
</label>
|
|
@@ -996,7 +1042,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
996
1042
|
aria-describedby=${hasDescription ? "description" : nothing}
|
|
997
1043
|
?disabled=${this.disabled || this.readonly}
|
|
998
1044
|
aria-invalid=${this.showError}
|
|
999
|
-
.value=${live(this.
|
|
1045
|
+
.value=${live(this.nativeValue)}
|
|
1000
1046
|
@input=${this.handleNativeInput}
|
|
1001
1047
|
/>
|
|
1002
1048
|
</label>
|
|
@@ -148,7 +148,7 @@ let EunomiaCounter = class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
148
148
|
"rangeOverflow",
|
|
149
149
|
"stepMismatch",
|
|
150
150
|
"badInput",
|
|
151
|
-
]);
|
|
151
|
+
], this.validationDictionary.validation);
|
|
152
152
|
};
|
|
153
153
|
this.addEventListener("keydown", this.handleImplicitSubmission);
|
|
154
154
|
}
|
|
@@ -26,13 +26,13 @@ const base = css `
|
|
|
26
26
|
--_textColor: var(--counter-text-color, var(--eun-text-color, #071621));
|
|
27
27
|
--_buttonColor: var(
|
|
28
28
|
--counter-button-color,
|
|
29
|
-
var(--eun-text-secondary, #
|
|
29
|
+
var(--eun-text-secondary, #666e8a)
|
|
30
30
|
);
|
|
31
31
|
--_errorColor: var(
|
|
32
32
|
--counter-error-color,
|
|
33
33
|
var(--eun-color-critical-100, #aa0014)
|
|
34
34
|
);
|
|
35
|
-
--_hintColor: var(--counter-hint-color, var(--eun-text-secondary, #
|
|
35
|
+
--_hintColor: var(--counter-hint-color, var(--eun-text-secondary, #666e8a));
|
|
36
36
|
--_focusIndicator: var(
|
|
37
37
|
--counter-focus-outline-color,
|
|
38
38
|
var(--eun-color-primary-500, #3d6fff)
|
|
@@ -12,7 +12,7 @@ export const datePickerDayGridStyles = css `
|
|
|
12
12
|
display: grid;
|
|
13
13
|
}
|
|
14
14
|
#calendar-weekdays span {
|
|
15
|
-
color: var(--date-picker-weekday-color, var(--eun-text-secondary, #
|
|
15
|
+
color: var(--date-picker-weekday-color, var(--eun-text-secondary, #666e8a));
|
|
16
16
|
font-size: var(--eun-font-size-xxs, 10px);
|
|
17
17
|
text-align: center;
|
|
18
18
|
text-transform: uppercase;
|
|
@@ -15,7 +15,7 @@ import { endOfMonth, isSameMonth, isWithinRange, startOfMonth, } from "../../../
|
|
|
15
15
|
* @returns the rendered template.
|
|
16
16
|
*/
|
|
17
17
|
export function renderDatePickerMonthGrid(props) {
|
|
18
|
-
const { displayedYear, locale, previousYearLabel, chooseYearLabel, nextYearLabel } = props;
|
|
18
|
+
const { displayedYear, locale, previousYearLabel, chooseYearLabel, nextYearLabel, } = props;
|
|
19
19
|
const months = Array.from({ length: 12 }, (_, month) => new Date(displayedYear, month, 1));
|
|
20
20
|
return html `
|
|
21
21
|
<div id="calendar">
|