@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
|
@@ -16,6 +16,8 @@ import { FormMixin } from "../../../mixins/form.mixin.js";
|
|
|
16
16
|
import { FormLabelMixin, } from "../../../mixins/form-label.mixin.js";
|
|
17
17
|
import { EditableMixin, } from "../../../mixins/editable.mixin.js";
|
|
18
18
|
import { FieldAppearanceMixin, } from "../../../mixins/field-appearance.mixin.js";
|
|
19
|
+
import { RoundedMixin, } from "../../../mixins/rounded.mixin.js";
|
|
20
|
+
import { FieldSizeMixin, } from "../../../mixins/field-size.mixin.js";
|
|
19
21
|
import { AnchorPositionMixin, } from "../../../mixins/anchor-position.mixin.js";
|
|
20
22
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
21
23
|
import { formLabelsStyles } from "../shared-styles/form-labels.styles.js";
|
|
@@ -24,6 +26,7 @@ import { isWebKit } from "../../../utils/browser.utils.js";
|
|
|
24
26
|
import { normalizeHexColor } from "../../../utils/color.utils.js";
|
|
25
27
|
import { parseListboxOptions, } from "../../../utils/listbox-options.utils.js";
|
|
26
28
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
29
|
+
import { LocalizableMixin, } from "../../../mixins/localizable.mixin.js";
|
|
27
30
|
/**
|
|
28
31
|
* Tag name of the color picker component.
|
|
29
32
|
*/
|
|
@@ -33,7 +36,7 @@ export const EunomiaColorPickerTagName = "eun-color-picker";
|
|
|
33
36
|
* @internal
|
|
34
37
|
*/
|
|
35
38
|
const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
36
|
-
const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base))))));
|
|
39
|
+
const EunomiaColorPickerMixinBase = LocalizableMixin(AnchorPositionMixin(RoundedMixin(FieldSizeMixin(FieldAppearanceMixin(FormLabelMixin(ReadonlyMixin(EditableMixin(FormMixin(Base)))))))));
|
|
37
40
|
/**
|
|
38
41
|
* A field for picking a color, as a `#rrggbb` hex string. Declare preset
|
|
39
42
|
* swatches as light DOM `option` children, exactly like `eun-select` does
|
|
@@ -70,6 +73,8 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(For
|
|
|
70
73
|
* @prop {string} defaultValue - The default value applied when the field connects, and restored on form reset
|
|
71
74
|
* @attr {string} [default-value] - The default value
|
|
72
75
|
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
76
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
77
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
73
78
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
74
79
|
* @prop {string} instructions - Instructions displayed below the label
|
|
75
80
|
* @prop {string} name - The field name
|
|
@@ -77,12 +82,13 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(For
|
|
|
77
82
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
78
83
|
* @prop {boolean} [required=false] - Whether a color is required
|
|
79
84
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
85
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
80
86
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
81
87
|
* @prop {Array<Validators<string>>} validators - The list of validation rules applied to the field value
|
|
82
88
|
* @prop {boolean} [readonlyAvailable=false] - Whether the field can switch between a static display and an editable one
|
|
83
89
|
* @attr {boolean} [readonly-available=false] - Whether the field can switch between a static display and an editable one
|
|
84
|
-
* @prop {string} [emptyValueLabel
|
|
85
|
-
* @attr {string} [empty-value-label
|
|
90
|
+
* @prop {string} [emptyValueLabel] - Text displayed in place of the value when empty. Defaults to the localized string for the current locale (English: "No color selected")
|
|
91
|
+
* @attr {string} [empty-value-label] - Text displayed in place of the value when empty. Defaults to the localized string for the current locale (English: "No color selected")
|
|
86
92
|
* @prop {string} [swatchesLabel='Presets'] - Heading shown above the preset swatches, while any are declared
|
|
87
93
|
* @attr {string} [swatches-label='Presets'] - Heading shown above the preset swatches
|
|
88
94
|
* @prop {string} [customLabel='Custom'] - Heading shown above the custom color row
|
|
@@ -91,10 +97,10 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(For
|
|
|
91
97
|
* @attr {string} [native-input-label='Pick a custom color'] - Accessible label for the native OS color picker
|
|
92
98
|
* @prop {string} [hexInputLabel='Hex color'] - Accessible label for the hex text input
|
|
93
99
|
* @attr {string} [hex-input-label='Hex color'] - Accessible label for the hex text input
|
|
94
|
-
* @prop {string} [confirmLabel
|
|
95
|
-
* @attr {string} [confirm-label
|
|
96
|
-
* @prop {string} [cancelLabel
|
|
97
|
-
* @attr {string} [cancel-label
|
|
100
|
+
* @prop {string} [confirmLabel] - The label of the confirm button in edit mode. Defaults to the localized string for the current locale (English: "Confirm")
|
|
101
|
+
* @attr {string} [confirm-label] - The label of the confirm button in edit mode. Defaults to the localized string for the current locale (English: "Confirm")
|
|
102
|
+
* @prop {string} [cancelLabel] - The label of the cancel button in edit mode. Defaults to the localized string for the current locale (English: "Cancel")
|
|
103
|
+
* @attr {string} [cancel-label] - The label of the cancel button in edit mode. Defaults to the localized string for the current locale (English: "Cancel")
|
|
98
104
|
* @prop {boolean} [noAnimation=false] - Disables the dropdown panel's open and close height transition, on top of the automatic reduced motion handling
|
|
99
105
|
* @attr {boolean} [no-animation=false] - Disables the dropdown panel's open and close height transition
|
|
100
106
|
* @prop {boolean} [swatchOnly=false] - Renders as a native input type="color" styled as a plain swatch, with no panel, no presets, and no hex input at all — only the browser/OS's own color picker. Presets declared as option children are ignored while this is set
|
|
@@ -122,11 +128,13 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(For
|
|
|
122
128
|
* @cssprop [--field-edit-confirm-color] - Sets the color of the confirm button in readonly-available edit mode
|
|
123
129
|
* @cssprop [--field-edit-cancel-color] - Sets the color of the cancel button in readonly-available edit mode
|
|
124
130
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the dropdown panel, past which it scrolls
|
|
131
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the dropdown panel, independent of the field's own radius
|
|
125
132
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close animation
|
|
126
133
|
* @cssprop [--color-picker-swatch-size=20px] - Sets the diameter of every swatch
|
|
127
134
|
* @cssprop [--eun-viewport-inset-top] - Reserves space, such as a page's sticky header height, that the dropdown panel keeps clear of at the top of the viewport
|
|
128
135
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport
|
|
129
136
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
137
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
130
138
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
131
139
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
132
140
|
* @element eun-color-picker
|
|
@@ -134,11 +142,6 @@ const EunomiaColorPickerMixinBase = AnchorPositionMixin(FieldAppearanceMixin(For
|
|
|
134
142
|
let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixinBase {
|
|
135
143
|
constructor() {
|
|
136
144
|
super(...arguments);
|
|
137
|
-
/**
|
|
138
|
-
* Text displayed in place of the value when empty.
|
|
139
|
-
* @default No color selected
|
|
140
|
-
*/
|
|
141
|
-
this.emptyValueLabel = "No color selected";
|
|
142
145
|
/**
|
|
143
146
|
* Heading shown above the preset swatches, while any are declared.
|
|
144
147
|
* @default Presets
|
|
@@ -159,16 +162,6 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
159
162
|
* @default Hex color
|
|
160
163
|
*/
|
|
161
164
|
this.hexInputLabel = "Hex color";
|
|
162
|
-
/**
|
|
163
|
-
* Label of the confirm button in edit mode.
|
|
164
|
-
* @default Confirm
|
|
165
|
-
*/
|
|
166
|
-
this.confirmLabel = "Confirm";
|
|
167
|
-
/**
|
|
168
|
-
* Label of the cancel button in edit mode.
|
|
169
|
-
* @default Cancel
|
|
170
|
-
*/
|
|
171
|
-
this.cancelLabel = "Cancel";
|
|
172
165
|
/**
|
|
173
166
|
* Disables the dropdown panel's open/close height transition, both set
|
|
174
167
|
* explicitly and whenever the browser reports `prefers-reduced-motion:
|
|
@@ -197,7 +190,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
197
190
|
* opposite trade-off from `swatchOnly`. The leading native color swatch
|
|
198
191
|
* that normally sits before the trigger button is gone entirely (the
|
|
199
192
|
* button itself shows a plain decorative swatch instead), and the panel
|
|
200
|
-
* drops its hex input, leaving only the preset
|
|
193
|
+
* drops its hex input, leaving only the preset listbox : nothing
|
|
201
194
|
* outside the curated palette is reachable at all, not even by typing a
|
|
202
195
|
* hex value. Has no effect without at least one `option` declared —
|
|
203
196
|
* with none, {@link renderInlineCustomField} already offers nothing but
|
|
@@ -209,7 +202,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
209
202
|
this.presetsOnly = false;
|
|
210
203
|
/**
|
|
211
204
|
* Renders the declared `option` presets directly as the field itself,
|
|
212
|
-
* the exact swatch
|
|
205
|
+
* the exact swatch listbox {@link renderPresets} already renders
|
|
213
206
|
* inside the panel, just in place of a trigger button and a panel to
|
|
214
207
|
* open. No native color swatch, no hex input, no button, no popover of
|
|
215
208
|
* any kind, since there is nothing left for one to open. Takes priority
|
|
@@ -234,6 +227,13 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
234
227
|
* @internal
|
|
235
228
|
*/
|
|
236
229
|
this.hexDraft = "";
|
|
230
|
+
/**
|
|
231
|
+
* The preset swatch last moved to with the keyboard, which holds the
|
|
232
|
+
* swatches' single tab stop ; `-1` until then, leaving it on the selected
|
|
233
|
+
* swatch (or the first one).
|
|
234
|
+
* @internal
|
|
235
|
+
*/
|
|
236
|
+
this.presetFocusIndex = -1;
|
|
237
237
|
/**
|
|
238
238
|
* Reacts to the dropdown panel's native `toggle` event : the single
|
|
239
239
|
* source of truth for open/close state. The panel is `popover="auto"`,
|
|
@@ -382,7 +382,10 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
382
382
|
if (this.ariaLabel) {
|
|
383
383
|
return this.ariaLabel;
|
|
384
384
|
}
|
|
385
|
-
return this.swatchOnly
|
|
385
|
+
return this.swatchOnly
|
|
386
|
+
? this.value ||
|
|
387
|
+
(this.emptyValueLabel ?? this.dictionary.colorPicker.noColor)
|
|
388
|
+
: undefined;
|
|
386
389
|
}
|
|
387
390
|
/**
|
|
388
391
|
* Lifecycle hook called when the element is connected to the DOM.
|
|
@@ -413,6 +416,14 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
413
416
|
this.hexDraft = this.value ?? "";
|
|
414
417
|
}
|
|
415
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
421
|
+
* straight to the controls inside, in both directions, and
|
|
422
|
+
* {@link focus} covers a direct call on the host.
|
|
423
|
+
*/
|
|
424
|
+
get hostTabStop() {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
416
427
|
/**
|
|
417
428
|
* Returns the field element to focus/anchor on validation errors.
|
|
418
429
|
*/
|
|
@@ -549,6 +560,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
549
560
|
* @private
|
|
550
561
|
*/
|
|
551
562
|
handleSelect(value) {
|
|
563
|
+
this.presetFocusIndex = -1;
|
|
552
564
|
this.value = value;
|
|
553
565
|
this.hexDraft = value;
|
|
554
566
|
this.dispatchEvent(new ChangeEvent(this.value));
|
|
@@ -557,13 +569,11 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
557
569
|
/**
|
|
558
570
|
* Moves focus among preset swatches on Arrow/Home/End, without picking
|
|
559
571
|
* anything : browsing the palette with the keyboard is deliberately
|
|
560
|
-
* non-destructive,
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
* {@link renderSwatchRadiogroup}), so this is an alternative to Tab/
|
|
566
|
-
* Shift+Tab for moving between them, not the only way to reach one.
|
|
572
|
+
* non-destructive, as a listbox whose selection doesn't follow focus.
|
|
573
|
+
* Picking only ever happens through an explicit activation instead, a
|
|
574
|
+
* click or an Enter/Space press, both already wired through the button's
|
|
575
|
+
* own native `click` handling. The swatches share a single Tab stop,
|
|
576
|
+
* which follows the focus (see {@link renderSwatchListbox}).
|
|
567
577
|
* @param event the native keyboard event.
|
|
568
578
|
* @param index the index of the swatch that received the key press.
|
|
569
579
|
* @private
|
|
@@ -590,6 +600,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
590
600
|
return;
|
|
591
601
|
}
|
|
592
602
|
event.preventDefault();
|
|
603
|
+
this.presetFocusIndex = nextIndex;
|
|
593
604
|
this.presetButtonEls[nextIndex]?.focus();
|
|
594
605
|
}
|
|
595
606
|
/**
|
|
@@ -646,11 +657,11 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
646
657
|
class="confirm"
|
|
647
658
|
size="s"
|
|
648
659
|
color="primary"
|
|
649
|
-
appearance="
|
|
660
|
+
appearance="soft"
|
|
650
661
|
rounded
|
|
651
662
|
type="button"
|
|
652
663
|
@click=${this.handleConfirmClick}
|
|
653
|
-
>${this.confirmLabel}</eun-button
|
|
664
|
+
>${this.confirmLabel ?? this.dictionary.common.confirm}</eun-button
|
|
654
665
|
>
|
|
655
666
|
<eun-button
|
|
656
667
|
class="cancel"
|
|
@@ -659,7 +670,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
659
670
|
rounded
|
|
660
671
|
type="button"
|
|
661
672
|
@click=${this.handleCancelClick}
|
|
662
|
-
>${this.cancelLabel}</eun-button
|
|
673
|
+
>${this.cancelLabel ?? this.dictionary.common.cancel}</eun-button
|
|
663
674
|
>
|
|
664
675
|
</div>
|
|
665
676
|
`;
|
|
@@ -687,14 +698,16 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
687
698
|
? nothing
|
|
688
699
|
: html `
|
|
689
700
|
<span class=${classMap({ empty: !this.value })}
|
|
690
|
-
>${this.value ||
|
|
701
|
+
>${this.value ||
|
|
702
|
+
(this.emptyValueLabel ??
|
|
703
|
+
this.dictionary.colorPicker.noColor)}</span
|
|
691
704
|
>
|
|
692
705
|
`}
|
|
693
706
|
</div>
|
|
694
707
|
`;
|
|
695
708
|
}
|
|
696
709
|
/**
|
|
697
|
-
* Renders the preset swatch
|
|
710
|
+
* Renders the preset swatch listbox, while any presets are declared.
|
|
698
711
|
* @param presets the parsed preset options.
|
|
699
712
|
* @returns the rendered template.
|
|
700
713
|
* @private
|
|
@@ -703,43 +716,47 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
703
716
|
return html `
|
|
704
717
|
<div>
|
|
705
718
|
<span id="swatches-label">${this.swatchesLabel}</span>
|
|
706
|
-
${this.
|
|
719
|
+
${this.renderSwatchListbox(presets, this.swatchesLabel, false)}
|
|
707
720
|
</div>
|
|
708
721
|
`;
|
|
709
722
|
}
|
|
710
723
|
/**
|
|
711
|
-
* Renders the preset swatch
|
|
724
|
+
* Renders the preset swatch listbox itself, shared between
|
|
712
725
|
* {@link renderPresets} (inside the panel, under its own "Presets"
|
|
713
726
|
* heading) and {@link renderInlinePresetsField} (as the whole field,
|
|
714
727
|
* with no heading of its own since the field's own label already names
|
|
715
728
|
* it).
|
|
716
729
|
* @param presets the preset options to render.
|
|
717
|
-
* @param ariaLabel the
|
|
730
|
+
* @param ariaLabel the listbox's accessible name.
|
|
718
731
|
* @param hasDescription whether a hint/error `#description` is being
|
|
719
732
|
* rendered alongside the field, so it can be wired to `aria-describedby`
|
|
720
|
-
* directly on the
|
|
733
|
+
* directly on the listbox ; only relevant when it stands in for the
|
|
721
734
|
* whole field on its own, see {@link renderInlinePresetsField}.
|
|
722
735
|
* @returns the rendered template.
|
|
723
736
|
* @private
|
|
724
737
|
*/
|
|
725
|
-
|
|
738
|
+
renderSwatchListbox(presets, ariaLabel, hasDescription) {
|
|
739
|
+
const selectedIndex = presets.findIndex((preset) => preset.value === this.value);
|
|
740
|
+
const tabStop = this.presetFocusIndex >= 0 && this.presetFocusIndex < presets.length
|
|
741
|
+
? this.presetFocusIndex
|
|
742
|
+
: Math.max(selectedIndex, 0);
|
|
726
743
|
return html `
|
|
727
744
|
<div
|
|
728
745
|
id="swatches"
|
|
729
|
-
role="
|
|
746
|
+
role="listbox"
|
|
730
747
|
aria-label=${ifDefined(ariaLabel)}
|
|
731
748
|
aria-describedby=${hasDescription ? "description" : nothing}
|
|
732
749
|
>
|
|
733
750
|
${presets.map((preset, index) => {
|
|
734
|
-
const
|
|
751
|
+
const selected = index === selectedIndex;
|
|
735
752
|
return html `
|
|
736
753
|
<button
|
|
737
754
|
type="button"
|
|
738
755
|
class="swatch-button"
|
|
739
|
-
role="
|
|
740
|
-
aria-
|
|
756
|
+
role="option"
|
|
757
|
+
aria-selected=${selected ? "true" : "false"}
|
|
741
758
|
aria-label=${preset.label}
|
|
742
|
-
tabindex
|
|
759
|
+
tabindex=${index === tabStop ? "0" : "-1"}
|
|
743
760
|
style="--_optionColor: ${preset.value}"
|
|
744
761
|
@click=${() => this.handleSelect(preset.value)}
|
|
745
762
|
@keydown=${(event) => this.handlePresetKeydown(event, index)}
|
|
@@ -792,7 +809,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
792
809
|
}
|
|
793
810
|
/**
|
|
794
811
|
* Renders the declared `option` presets directly as the field itself,
|
|
795
|
-
* the same swatch
|
|
812
|
+
* the same swatch listbox {@link renderPresets} renders inside the
|
|
796
813
|
* panel, just in place of a trigger button and a panel to open at all.
|
|
797
814
|
* Used whenever {@link presetsInline} is set and at least one preset is
|
|
798
815
|
* declared (see {@link render}).
|
|
@@ -804,7 +821,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
804
821
|
renderInlinePresetsField(hasDescription) {
|
|
805
822
|
return html `
|
|
806
823
|
<div id="field-wrapper">
|
|
807
|
-
${this.
|
|
824
|
+
${this.renderSwatchListbox(this.presets, this.triggerAccessibleLabel, hasDescription)}
|
|
808
825
|
</div>
|
|
809
826
|
${this.readonlyAvailable ? this.renderEditActions() : nothing}
|
|
810
827
|
`;
|
|
@@ -907,7 +924,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
907
924
|
<button
|
|
908
925
|
type="button"
|
|
909
926
|
id="field"
|
|
910
|
-
aria-haspopup="
|
|
927
|
+
aria-haspopup="dialog"
|
|
911
928
|
aria-expanded=${this.isOpen}
|
|
912
929
|
aria-label=${ifDefined(this.triggerAccessibleLabel)}
|
|
913
930
|
aria-describedby=${hasDescription ? "description" : nothing}
|
|
@@ -927,7 +944,8 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
927
944
|
`
|
|
928
945
|
: nothing}
|
|
929
946
|
<span id="value-text" class=${classMap({ empty: !this.value })}>
|
|
930
|
-
${this.value ||
|
|
947
|
+
${this.value ||
|
|
948
|
+
(this.emptyValueLabel ?? this.dictionary.colorPicker.noColor)}
|
|
931
949
|
</span>
|
|
932
950
|
<span
|
|
933
951
|
id="field-arrow"
|
|
@@ -940,6 +958,7 @@ let EunomiaColorPicker = class EunomiaColorPicker extends EunomiaColorPickerMixi
|
|
|
940
958
|
${this.readonlyAvailable ? this.renderEditActions() : nothing}
|
|
941
959
|
<div
|
|
942
960
|
id="listbox"
|
|
961
|
+
role="dialog"
|
|
943
962
|
popover="auto"
|
|
944
963
|
aria-label=${ifDefined(this.label)}
|
|
945
964
|
@toggle=${this.handlePopoverToggle}
|
|
@@ -1083,6 +1102,9 @@ __decorate([
|
|
|
1083
1102
|
__decorate([
|
|
1084
1103
|
state()
|
|
1085
1104
|
], EunomiaColorPicker.prototype, "hexDraft", void 0);
|
|
1105
|
+
__decorate([
|
|
1106
|
+
state()
|
|
1107
|
+
], EunomiaColorPicker.prototype, "presetFocusIndex", void 0);
|
|
1086
1108
|
__decorate([
|
|
1087
1109
|
query("#field")
|
|
1088
1110
|
], EunomiaColorPicker.prototype, "fieldEl", void 0);
|
|
@@ -105,7 +105,7 @@ const colorPicker = css `
|
|
|
105
105
|
outline var(--eun-duration-m, 200ms) var(--eun-easing-out, ease-out),
|
|
106
106
|
border var(--eun-duration-m, 200ms) var(--eun-easing-out, ease-out);
|
|
107
107
|
}
|
|
108
|
-
.swatch-button[aria-
|
|
108
|
+
.swatch-button[aria-selected="true"] .swatch {
|
|
109
109
|
border-color: var(--eun-color-primary-500, #3d6fff);
|
|
110
110
|
border-width: calc(var(--eun-border-width-m, 1.5px) * 2);
|
|
111
111
|
}
|
|
@@ -126,6 +126,19 @@ const colorPicker = css `
|
|
|
126
126
|
#native-swatch .swatch {
|
|
127
127
|
pointer-events: none;
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
button#field #trigger-swatch,
|
|
131
|
+
#field-wrapper > #custom-row .swatch {
|
|
132
|
+
--_fieldSwatchSize: min(
|
|
133
|
+
var(--color-picker-swatch-size, 20px),
|
|
134
|
+
calc(var(--_lineHeight) + 2 * var(--_paddingBlock))
|
|
135
|
+
);
|
|
136
|
+
width: var(--_fieldSwatchSize);
|
|
137
|
+
height: var(--_fieldSwatchSize);
|
|
138
|
+
}
|
|
139
|
+
#field-wrapper > #custom-row #native-swatch {
|
|
140
|
+
display: flex;
|
|
141
|
+
}
|
|
129
142
|
#native-input {
|
|
130
143
|
position: absolute;
|
|
131
144
|
inset: 0;
|
|
@@ -5,7 +5,9 @@ import { ValidatorsMixinInterface, Validity } from "../../../mixins/validators.m
|
|
|
5
5
|
import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
8
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
8
9
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
10
|
+
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
9
11
|
/**
|
|
10
12
|
* Tag name of the counter component.
|
|
11
13
|
*/
|
|
@@ -14,13 +16,14 @@ export declare const EunomiaCounterTagName = "eun-counter";
|
|
|
14
16
|
* Type of the counter base used to declare every necessary Mixin interface elements.
|
|
15
17
|
* @internal
|
|
16
18
|
*/
|
|
17
|
-
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface & FieldAppearanceMixinInterface;
|
|
19
|
+
type EunomiaCounterBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<number> & FormMixinInterface<number> & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & LocalizableMixinInterface;
|
|
18
20
|
declare const EunomiaCounterMixinBase: Constructor<EunomiaCounterBase>;
|
|
19
21
|
/**
|
|
20
22
|
* A numeric field with increment and decrement buttons, built on a native
|
|
21
23
|
* number input.
|
|
22
24
|
*
|
|
23
25
|
* @prop {'outline' | 'flat' | 'underline'} [appearance='outline'] - How the field's surface is drawn: a bordered box, a muted background with no border, or a bottom border only
|
|
26
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
24
27
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
25
28
|
* @prop {string} instructions - Instructions displayed below the label
|
|
26
29
|
* @prop {string} name - The field name
|
|
@@ -34,13 +37,14 @@ declare const EunomiaCounterMixinBase: Constructor<EunomiaCounterBase>;
|
|
|
34
37
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
35
38
|
* @prop {boolean} [required=false] - Whether the field is required
|
|
36
39
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
40
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
37
41
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
38
42
|
* @attr {boolean} [hide-error=false] - Whether the errors are hidden
|
|
39
43
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<number>>} validators - The list of validation rules applied to the field value
|
|
40
|
-
* @prop {string} [
|
|
41
|
-
* @attr {string} [
|
|
42
|
-
* @prop {string} [
|
|
43
|
-
* @attr {string} [
|
|
44
|
+
* @prop {string} [incrementLabel] - The accessible label of the increment button. Defaults to the localized string for the current locale (English: "Increase value")
|
|
45
|
+
* @attr {string} [increment-label] - The accessible label of the increment button. Defaults to the localized string for the current locale (English: "Increase value")
|
|
46
|
+
* @prop {string} [decrementLabel] - The accessible label of the decrement button. Defaults to the localized string for the current locale (English: "Decrease value")
|
|
47
|
+
* @attr {string} [decrement-label] - The accessible label of the decrement button. Defaults to the localized string for the current locale (English: "Decrease value")
|
|
44
48
|
* @fires {ChangeEvent} eunchange - Fired on every value change
|
|
45
49
|
* @cssprop [--counter-background] - Sets the background color of the field
|
|
46
50
|
* @cssprop [--counter-border-color] - Sets the border color of the field
|
|
@@ -81,14 +85,14 @@ export declare class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
81
85
|
step: number;
|
|
82
86
|
/**
|
|
83
87
|
* Accessible label of the increment button.
|
|
84
|
-
*
|
|
88
|
+
* Falls back to the localized string for the current locale when unset.
|
|
85
89
|
*/
|
|
86
|
-
|
|
90
|
+
incrementLabel?: string;
|
|
87
91
|
/**
|
|
88
92
|
* Accessible label of the decrement button.
|
|
89
|
-
*
|
|
93
|
+
* Falls back to the localized string for the current locale when unset.
|
|
90
94
|
*/
|
|
91
|
-
|
|
95
|
+
decrementLabel?: string;
|
|
92
96
|
/**
|
|
93
97
|
* The current numeric value, `undefined` while empty (e.g. after the
|
|
94
98
|
* field is cleared by the user). Overrides the `value` accessor
|
|
@@ -121,17 +125,13 @@ export declare class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
121
125
|
* @readonly
|
|
122
126
|
*/
|
|
123
127
|
private readonly fieldEl?;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
128
|
-
* it. See `eun-input`'s identical pattern : the host stays in the tab
|
|
129
|
-
* order (`DisabledMixin`) rather than being excluded via `tabindex="-1"`,
|
|
130
|
-
* which broke Tab from reaching the field entirely for this
|
|
131
|
-
* form-associated component, instead of just skipping the host.
|
|
128
|
+
constructor();
|
|
129
|
+
/**
|
|
130
|
+
* Submits the owning form on Enter in the field, as a native number
|
|
131
|
+
* input does, since the browser never does it from a shadow root.
|
|
132
132
|
* @private
|
|
133
133
|
*/
|
|
134
|
-
private
|
|
134
|
+
private readonly handleImplicitSubmission;
|
|
135
135
|
/**
|
|
136
136
|
* Reads native HTML constraint validation from the underlying field
|
|
137
137
|
* element (`required`, `min`, `max`, `step`, `badInput`).
|
|
@@ -139,6 +139,12 @@ export declare class EunomiaCounter extends EunomiaCounterMixinBase {
|
|
|
139
139
|
* @returns validity state and optional message.
|
|
140
140
|
*/
|
|
141
141
|
checkLocalValidators: () => Validity;
|
|
142
|
+
/**
|
|
143
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
144
|
+
* straight to the controls inside, in both directions, and
|
|
145
|
+
* {@link focus} covers a direct call on the host.
|
|
146
|
+
*/
|
|
147
|
+
protected get hostTabStop(): boolean;
|
|
142
148
|
/**
|
|
143
149
|
* Returns the field element to focus/anchor on validation errors.
|
|
144
150
|
*
|