@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunks/chunk-LK5BJ4SH.js";import{b as O,c as $}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-IJJ67C66.js";import{a as w}from"./chunks/chunk-BRSNQMCD.js";import{a as
|
|
1
|
+
import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunks/chunk-LK5BJ4SH.js";import{b as O,c as $}from"./chunks/chunk-624VJYNA.js";import{a as A}from"./chunks/chunk-IJJ67C66.js";import{a as w}from"./chunks/chunk-BRSNQMCD.js";import{a as M,b as P,d as y,e as T,f as S}from"./chunks/chunk-647ISUF4.js";import{j as E}from"./chunks/chunk-MJ4RDZLL.js";import{b as C}from"./chunks/chunk-BKZGTCMF.js";import{a as c}from"./chunks/chunk-PPCHQG7P.js";import{a as k}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as i,f as D,h as g,j as o,k as p,l as h,p as s,r as d,u as L}from"./chunks/chunk-YITWLCD3.js";var j=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -128,7 +128,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
128
128
|
clip: rect(0 0 0 0);
|
|
129
129
|
white-space: nowrap;
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
131
|
+
`,V=j;var U=g`
|
|
132
132
|
#event-popover {
|
|
133
133
|
box-sizing: border-box;
|
|
134
134
|
width: var(--scheduler-popover-width, 300px);
|
|
@@ -251,10 +251,10 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
251
251
|
gap: var(--eun-space-s, 8px);
|
|
252
252
|
padding: 0 var(--eun-space-m, 16px) var(--eun-space-m, 16px);
|
|
253
253
|
}
|
|
254
|
-
`,
|
|
254
|
+
`,_=U;function N(l){let{event:n,locale:e,editLabel:a,deleteLabel:r,closeLabel:u,priorityLabels:v,readonly:m,onEdit:b,onDelete:Q,onClose:I}=l;return s`
|
|
255
255
|
<div
|
|
256
256
|
class="event-popover-bar"
|
|
257
|
-
style="--_accent: var(--eun-color-${
|
|
257
|
+
style="--_accent: var(--eun-color-${n.color}-600);"
|
|
258
258
|
></div>
|
|
259
259
|
<eun-button
|
|
260
260
|
id="event-popover-close"
|
|
@@ -267,49 +267,49 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
267
267
|
<eun-icon name="close" size="16"></eun-icon>
|
|
268
268
|
</eun-button>
|
|
269
269
|
<div class="event-popover-body">
|
|
270
|
-
<h3 class="event-popover-title">${
|
|
270
|
+
<h3 class="event-popover-title">${n.title}</h3>
|
|
271
271
|
<div class="event-popover-row">
|
|
272
272
|
<eun-icon name="schedule" size="16"></eun-icon>
|
|
273
|
-
<span>${B(
|
|
273
|
+
<span>${B(n,e)}</span>
|
|
274
274
|
</div>
|
|
275
|
-
${
|
|
275
|
+
${n.location?s`
|
|
276
276
|
<div class="event-popover-row">
|
|
277
277
|
<eun-icon name="location_on" size="16"></eun-icon>
|
|
278
|
-
<span>${
|
|
278
|
+
<span>${n.location}</span>
|
|
279
279
|
</div>
|
|
280
280
|
`:d}
|
|
281
|
-
${
|
|
281
|
+
${n.description?s`
|
|
282
282
|
<div class="event-popover-row">
|
|
283
283
|
<eun-icon name="description" size="16"></eun-icon>
|
|
284
|
-
<span>${
|
|
284
|
+
<span>${n.description}</span>
|
|
285
285
|
</div>
|
|
286
286
|
`:d}
|
|
287
|
-
${
|
|
287
|
+
${n.notes?s`
|
|
288
288
|
<div class="event-popover-row">
|
|
289
289
|
<eun-icon name="notes" size="16"></eun-icon>
|
|
290
|
-
<span>${
|
|
290
|
+
<span>${n.notes}</span>
|
|
291
291
|
</div>
|
|
292
292
|
`:d}
|
|
293
|
-
${
|
|
293
|
+
${n.priority?s`
|
|
294
294
|
<div class="event-popover-row">
|
|
295
295
|
<eun-icon name="priority_high" size="16"></eun-icon>
|
|
296
296
|
<eun-tag
|
|
297
297
|
size="s"
|
|
298
298
|
hide-icon
|
|
299
299
|
color="primary"
|
|
300
|
-
.severity=${
|
|
301
|
-
>${v[
|
|
300
|
+
.severity=${M[n.priority]}
|
|
301
|
+
>${v[n.priority]??n.priority}</eun-tag
|
|
302
302
|
>
|
|
303
303
|
</div>
|
|
304
304
|
`:d}
|
|
305
|
-
${
|
|
305
|
+
${n.guests&&n.guests.length>0?s`
|
|
306
306
|
<div class="event-popover-row">
|
|
307
307
|
<eun-icon name="group" size="16"></eun-icon>
|
|
308
308
|
<ul class="event-popover-guests">
|
|
309
|
-
${
|
|
309
|
+
${n.guests.map(f=>s`
|
|
310
310
|
<li class="event-popover-guest" data-status=${f.status}>
|
|
311
311
|
<eun-icon
|
|
312
|
-
name=${
|
|
312
|
+
name=${P[f.status]}
|
|
313
313
|
size="14"
|
|
314
314
|
aria-hidden="true"
|
|
315
315
|
></eun-icon>
|
|
@@ -331,16 +331,16 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
331
331
|
>${r}</eun-button
|
|
332
332
|
>
|
|
333
333
|
<eun-button color="primary" size="s" rounded @click=${b}
|
|
334
|
-
>${
|
|
334
|
+
>${a}</eun-button
|
|
335
335
|
>
|
|
336
336
|
</div>
|
|
337
337
|
`}
|
|
338
|
-
`}function B(l,
|
|
338
|
+
`}function B(l,n){let e={weekday:"long",day:"numeric",month:"long"};if(S(l)){let v=l.start.toLocaleDateString(n,e),m=l.end.toLocaleDateString(n,e),b=v===m?v:`${v} \u2013 ${m}`;return l.allDay?`All day \xB7 ${b}`:b}let a=l.start.toLocaleDateString(n,e),r=l.start.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit"}),u=l.end.toLocaleTimeString(n,{hour:"numeric",minute:"2-digit"});return`${a} \xB7 ${r} \u2013 ${u}`}var q="eun-scheduler",R=["day","week","work-week","month","year"],t=class extends k(z(L)){constructor(){super(...arguments);this.events=[];this.view="week";this.displayedDate=new Date;this.weekStartsOn=1;this.dayStartHour=0;this.dayEndHour=24;this.slotDuration=30;this.readonly=!1;this.noAnimation=!1;this.todayLabel="Today";this.newEventLabel="New event";this.viewDayLabel="Day";this.viewWeekLabel="Week";this.viewWorkWeekLabel="Work week";this.viewMonthLabel="Month";this.viewYearLabel="Year";this.applyLabel="Apply";this.deleteLabel="Delete";this.editLabel="Edit";this.moreEventsLabel="+{count} more";this.eventAppearance="default";this.isDrawerOpen=!1;this.isModalOpen=!1;this.editingEvent=null;this.createStart=W(new Date);this.createEnd=E(this.createStart,1);this.editorDirty=!1;this.isMobile=!1;this.selectedEvent=null;this.handleMobileMediaChange=e=>{this.isMobile=e.matches};this.handleToday=()=>{this.displayedDate=new Date};this.handlePrevious=()=>this.navigate(-1);this.handleNext=()=>this.navigate(1);this.handleViewChange=e=>{let[a]=e.target.value;a&&(this.view=a)};this.handleMobileViewSelect=e=>{this.view=e.key};this.handleCalendarPeriodChange=()=>{this.calendarEl&&(this.view!==this.calendarEl.view&&(this.view=this.calendarEl.view),this.displayedDate=this.calendarEl.displayedDate)};this.handleCalendarEventClick=e=>{this.openEventPopover(e.event,e.anchor)};this.handleCalendarSlotClick=e=>{this.openCreateEditor(e.start)};this.handleEventPopoverToggle=e=>{if(e.newState==="open"){this.popoverTriggerEl&&this.eventPopoverEl&&(this.anchorFloatingElement(this.popoverTriggerEl,this.eventPopoverEl,{axis:"horizontal",forceFallback:!0}),this.observeAnchorVisibility(this.popoverTriggerEl,()=>this.closeEventPopover()));return}this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.popoverTriggerEl?.focus(),this.popoverTriggerEl=void 0};this.handlePopoverEdit=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.openEditEditor(e)};this.handlePopoverDelete=()=>{let e=this.selectedEvent;this.closeEventPopover(),e&&this.dispatchEvent(new x(e.id))};this.handlePopoverClose=()=>{this.closeEventPopover()};this.handleEditorCreate=e=>{this.dispatchEvent(new H(e.event)),this.closeEditor()};this.handleEditorUpdate=e=>{this.dispatchEvent(new w(e.event)),this.closeEditor()};this.handleCalendarEventMove=e=>{this.dispatchEvent(new w(e.event))};this.handleEditorDelete=e=>{this.dispatchEvent(new x(e.eventId)),this.closeEditor()};this.handleEditorInput=()=>{this.editorDirty=this.drawerEditorEl?.dirty??!1};this.handleDrawerSave=()=>{this.drawerEditorEl?.requestSave()};this.handleDrawerCancel=()=>{this.closeEditor()};this.handleDrawerDelete=()=>{this.drawerEditorEl?.requestDelete()};this.handleModalSave=()=>{this.modalEditorEl?.requestSave()};this.handleModalDelete=()=>{this.modalEditorEl?.requestDelete()};this.handleModalCancel=()=>{this.closeEditor()}}updated(e){if(super.updated(e),e.has("view")||e.has("displayedDate")||e.has("weekStartsOn")){let a=y(this.view,this.displayedDate,this.weekStartsOn);this.dispatchEvent(new A(this.view,a.start,a.end))}}updateMobileMediaQuery(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),this.mobileMediaQuery=window.matchMedia(C("tablet")),this.mobileMediaQuery.addEventListener("change",this.handleMobileMediaChange),this.isMobile=this.mobileMediaQuery.matches}connectedCallback(){super.connectedCallback?.(),this.updateMobileMediaQuery()}disconnectedCallback(){this.mobileMediaQuery?.removeEventListener("change",this.handleMobileMediaChange),super.disconnectedCallback?.()}navigate(e){this.displayedDate=T(this.view,this.displayedDate,e)}openCreateEditor(e){this.readonly||(this.editingEvent=null,this.createStart=e,this.createEnd=E(e,1),this.openEditorSurface())}openEditEditor(e){this.readonly||(this.editingEvent=e,this.openEditorSurface())}openEventPopover(e,a){this.selectedEvent=e,this.popoverTriggerEl=a,this.updateComplete.then(()=>{let r=this.eventPopoverEl;if(!r)return;let u=this.eventPopoverAnimation!==void 0;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0;let v=!r.matches(":popover-open");v&&r.showPopover(),(v||u)&&this.playEventPopoverOpenAnimation(r)})}eventPopoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:O(e,"--scheduler-popover-transition-duration","s",160)}playEventPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let a=this.eventPopoverAnimationDuration(e);a!==0&&(this.eventPopoverAnimation=e.animate([{opacity:0,transform:"scale(0.98)"},{opacity:1,transform:"scale(1)"}],{duration:a,easing:$(e),fill:"forwards"}))}closeEventPopover(){let e=this.eventPopoverEl;this.eventPopoverAnimation?.cancel(),this.eventPopoverAnimation=void 0,e?.matches(":popover-open")&&this.playEventPopoverCloseAnimation(e)}playEventPopoverCloseAnimation(e){e.style.pointerEvents="none";let a=this.eventPopoverAnimationDuration(e);if(a===0){e.hidePopover();return}let r=e.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:a,easing:$(e),fill:"forwards"});this.eventPopoverAnimation=r,r.finished.then(()=>{this.eventPopoverAnimation===r&&(this.eventPopoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}openEditorSurface(){this.editorDirty=!1,this.isMobile?this.isModalOpen=!0:this.isDrawerOpen=!0}closeEditor(){this.isDrawerOpen=!1,this.isModalOpen=!1,this.editingEvent=null,this.editorDirty=!1}renderNavArrows(){return s`
|
|
339
339
|
<div id="header-nav-arrows">
|
|
340
340
|
<eun-button
|
|
341
341
|
appearance="ghost"
|
|
342
342
|
size="s"
|
|
343
|
-
aria-label=${this.
|
|
343
|
+
aria-label=${this.previousLabel??this.dictionary.scheduler.previous}
|
|
344
344
|
@click=${this.handlePrevious}
|
|
345
345
|
>
|
|
346
346
|
<eun-icon name="chevron_left" size="18"></eun-icon>
|
|
@@ -351,7 +351,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
351
351
|
<eun-button
|
|
352
352
|
appearance="ghost"
|
|
353
353
|
size="s"
|
|
354
|
-
aria-label=${this.
|
|
354
|
+
aria-label=${this.nextLabel??this.dictionary.scheduler.next}
|
|
355
355
|
@click=${this.handleNext}
|
|
356
356
|
>
|
|
357
357
|
<eun-icon name="chevron_right" size="18"></eun-icon>
|
|
@@ -386,7 +386,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
386
386
|
appearance="flat"
|
|
387
387
|
size="s"
|
|
388
388
|
label=${this.viewLabel(this.view)}
|
|
389
|
-
.options=${R.map(
|
|
389
|
+
.options=${R.map(a=>({key:a,label:this.viewLabel(a)}))}
|
|
390
390
|
@eunselect=${this.handleMobileViewSelect}
|
|
391
391
|
></eun-dropdown-button>
|
|
392
392
|
</div>
|
|
@@ -395,7 +395,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
395
395
|
<eun-toggle-group
|
|
396
396
|
single
|
|
397
397
|
aria-label=${this.dictionary.scheduler.calendarView}
|
|
398
|
-
.options=${R.map(
|
|
398
|
+
.options=${R.map(a=>({label:this.viewLabel(a),value:a}))}
|
|
399
399
|
.value=${[this.view]}
|
|
400
400
|
@eunchange=${this.handleViewChange}
|
|
401
401
|
></eun-toggle-group>
|
|
@@ -452,7 +452,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
452
452
|
>`:d}
|
|
453
453
|
<span style="flex: 1 1 auto;"></span>
|
|
454
454
|
<eun-button appearance="ghost" @click=${this.handleDrawerCancel}
|
|
455
|
-
>${this.cancelLabel}</eun-button
|
|
455
|
+
>${this.cancelLabel??this.dictionary.common.cancel}</eun-button
|
|
456
456
|
>
|
|
457
457
|
<eun-button color="primary" @click=${this.handleDrawerSave}
|
|
458
458
|
>${this.applyLabel}</eun-button
|
|
@@ -483,7 +483,7 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
483
483
|
>`:d}
|
|
484
484
|
<span style="flex: 1 1 auto;"></span>
|
|
485
485
|
<eun-button color="secondary" @click=${this.handleModalCancel}
|
|
486
|
-
>${this.cancelLabel}</eun-button
|
|
486
|
+
>${this.cancelLabel??this.dictionary.common.cancel}</eun-button
|
|
487
487
|
>
|
|
488
488
|
<eun-button color="primary" @click=${this.handleModalSave}
|
|
489
489
|
>${this.applyLabel}</eun-button
|
|
@@ -492,6 +492,6 @@ import{a as H,b as x}from"./chunks/chunk-IKAZYVB7.js";import{a as z}from"./chunk
|
|
|
492
492
|
</eun-modal>
|
|
493
493
|
|
|
494
494
|
<div id="event-popover" popover @toggle=${this.handleEventPopoverToggle}>
|
|
495
|
-
${this.selectedEvent?
|
|
495
|
+
${this.selectedEvent?N({event:this.selectedEvent,locale:this.locale,editLabel:this.editLabel,deleteLabel:this.deleteLabel,closeLabel:this.closeLabel??this.dictionary.common.close,priorityLabels:{low:"Low",medium:"Medium",high:"High",critical:"Critical"},readonly:this.readonly,onEdit:this.handlePopoverEdit,onDelete:this.handlePopoverDelete,onClose:this.handlePopoverClose}):d}
|
|
496
496
|
</div>
|
|
497
|
-
`}viewLabel(e){switch(e){case"day":return this.viewDayLabel;case"week":return this.viewWeekLabel;case"work-week":return this.viewWorkWeekLabel;case"month":return this.viewMonthLabel;case"year":return this.viewYearLabel;default:return e}}};t.styles=[
|
|
497
|
+
`}viewLabel(e){switch(e){case"day":return this.viewDayLabel;case"week":return this.viewWeekLabel;case"work-week":return this.viewWorkWeekLabel;case"month":return this.viewMonthLabel;case"year":return this.viewYearLabel;default:return e}}};t.styles=[V,_],i([o({attribute:!1})],t.prototype,"events",2),i([o({reflect:!0,useDefault:!0})],t.prototype,"view",2),i([o({attribute:!1})],t.prototype,"displayedDate",2),i([o({type:Number,attribute:"week-starts-on"})],t.prototype,"weekStartsOn",2),i([o({type:Number,attribute:"day-start-hour"})],t.prototype,"dayStartHour",2),i([o({type:Number,attribute:"day-end-hour"})],t.prototype,"dayEndHour",2),i([o({type:Number,attribute:"slot-duration"})],t.prototype,"slotDuration",2),i([o({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([o({type:Boolean,reflect:!0,attribute:"no-animation"})],t.prototype,"noAnimation",2),i([o({attribute:"today-label"})],t.prototype,"todayLabel",2),i([o({attribute:"new-event-label"})],t.prototype,"newEventLabel",2),i([o({attribute:"previous-label"})],t.prototype,"previousLabel",2),i([o({attribute:"next-label"})],t.prototype,"nextLabel",2),i([o({attribute:"view-day-label"})],t.prototype,"viewDayLabel",2),i([o({attribute:"view-week-label"})],t.prototype,"viewWeekLabel",2),i([o({attribute:"view-work-week-label"})],t.prototype,"viewWorkWeekLabel",2),i([o({attribute:"view-month-label"})],t.prototype,"viewMonthLabel",2),i([o({attribute:"view-year-label"})],t.prototype,"viewYearLabel",2),i([o({attribute:"apply-label"})],t.prototype,"applyLabel",2),i([o({attribute:"cancel-label"})],t.prototype,"cancelLabel",2),i([o({attribute:"delete-label"})],t.prototype,"deleteLabel",2),i([o({attribute:"edit-label"})],t.prototype,"editLabel",2),i([o({attribute:"close-label"})],t.prototype,"closeLabel",2),i([o({attribute:"more-events-label"})],t.prototype,"moreEventsLabel",2),i([o({attribute:"event-appearance"})],t.prototype,"eventAppearance",2),i([p()],t.prototype,"isDrawerOpen",2),i([p()],t.prototype,"isModalOpen",2),i([p()],t.prototype,"editingEvent",2),i([p()],t.prototype,"createStart",2),i([p()],t.prototype,"createEnd",2),i([p()],t.prototype,"editorDirty",2),i([p()],t.prototype,"isMobile",2),i([h("#editor")],t.prototype,"drawerEditorEl",2),i([h("#editor-mobile")],t.prototype,"modalEditorEl",2),i([p()],t.prototype,"selectedEvent",2),i([h("#event-popover")],t.prototype,"eventPopoverEl",2),i([h("#calendar")],t.prototype,"calendarEl",2),t=i([D(q)],t);function W(l){let n=new Date(l);return n.setHours(n.getHours()+1,0,0,0),n}function F(l,n,e,a,r){switch(l){case"day":return e.toLocaleDateString(r,{weekday:"long",day:"numeric",month:"long",year:"numeric"});case"year":return String(n.getFullYear());case"month":return n.toLocaleDateString(r,{month:"long",year:"numeric"});default:return`${e.toLocaleDateString(r,{day:"numeric",month:"short"})} \u2013 ${a.toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric"})}`}}export{t as EunomiaScheduler,q as EunomiaSchedulerTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as g}from"./chunks/chunk-55PUDL7D.js";import{a as I}from"./chunks/chunk-5LA5DQMP.js";import{a as L,b as k,c as T}from"./chunks/chunk-GWLD2I3P.js";import"./chunks/chunk-UVHVQRPT.js";import{a as w,b as A}from"./chunks/chunk-AH2SKZ7T.js";import"./chunks/chunk-L74LXUGL.js";import{a as y}from"./chunks/chunk-LK5BJ4SH.js";import"./chunks/chunk-WIUERJII.js";import"./chunks/chunk-QSZO4GIH.js";import{b as O,c}from"./chunks/chunk-624VJYNA.js";import{a as u}from"./chunks/chunk-LYYQAALT.js";import"./chunks/chunk-WW4BTWMH.js";import"./chunks/chunk-GVS6IUKC.js";import"./chunks/chunk-P6LGU3FT.js";import"./chunks/chunk-BO3JOEWM.js";import"./chunks/chunk-TLBXTBMM.js";import{a as x}from"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-3BMACIDO.js";import{a as d}from"./chunks/chunk-PPCHQG7P.js";import{a as m}from"./chunks/chunk-6TIEBY34.js";import{a as v}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as r,f,h as b,j as s,k as h,l as a,p as o,r as l}from"./chunks/chunk-YITWLCD3.js";var C=b`
|
|
2
2
|
#shortcut-hint {
|
|
3
3
|
flex-shrink: 0;
|
|
4
4
|
display: inline-flex;
|
|
@@ -107,6 +107,8 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
|
|
|
107
107
|
position: relative;
|
|
108
108
|
}
|
|
109
109
|
#panel-field #field {
|
|
110
|
+
box-sizing: border-box;
|
|
111
|
+
height: auto;
|
|
110
112
|
width: 100%;
|
|
111
113
|
border: none;
|
|
112
114
|
border-radius: 0;
|
|
@@ -138,24 +140,22 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
|
|
|
138
140
|
gap: var(--eun-space-xs, 4px);
|
|
139
141
|
padding: var(--eun-space-s, 8px) var(--eun-space-m, 16px);
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
${a.group}
|
|
143
|
-
</li>`)),t.push(o`
|
|
143
|
+
`,D=C;var P="eun-search",i=class extends y(g){constructor(){super(...arguments);this.type="search";this.icon="search";this.clearable=!0;this.shortcut=!1;this.panel=!1;this.loading=!1;this.loadingLabel="Loading\u2026";this.suggestions=!1;this.noResultsLabel="No results";this.filter="contains";this.isOpen=!1;this.highlightedIndex=-1;this.optionsObserver=new MutationObserver(()=>{this.highlightedIndex>=this.filteredOptions.length&&(this.highlightedIndex=-1),this.requestUpdate()});this.handleTriggerClick=()=>{this.disabled||this.openPanel()};this.handleFieldPointerDown=()=>{this.fieldPointerDownAt=performance.now()};this.handleSuggestionsFieldActivate=()=>{!this.suggestions||this.panel||this.isOpen||this.openSuggestions()};this.handleSuggestionsFocusOut=()=>{requestAnimationFrame(()=>{this.matches(":focus-within")||this.closeSuggestions()})};this.handleSuggestionsInput=()=>{!this.suggestions||this.panel||(this.highlightedIndex=-1,this.isOpen||this.openSuggestions())};this.handleSuggestionsKeydown=e=>{if(!(!this.suggestions||this.panel))switch(e.key){case"ArrowDown":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.min(this.highlightedIndex+1,this.filteredOptions.length-1));break}case"ArrowUp":{e.preventDefault(),this.isOpen||this.openSuggestions(),this.filteredOptions.length&&(this.highlightedIndex=Math.max(this.highlightedIndex-1,0));break}case"Enter":{let t=this.filteredOptions[this.highlightedIndex];t&&(e.preventDefault(),this.handleSelect(t));break}default:break}};this.handleSuggestionsPopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.listboxEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.listboxEl,{forceFallback:u}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closeSuggestions());return}if(this.fieldPointerDownAt!==void 0&&performance.now()-this.fieldPointerDownAt<i.FIELD_POINTER_DOWN_WINDOW_MS){this.fieldPointerDownAt=void 0,this.openSuggestions();return}this.isOpen=!1,this.highlightedIndex=-1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility()};this.handleShortcut=e=>{!this.shortcut||this.disabled||(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"&&(e.preventDefault(),this.panel?this.openPanel():this.focus())}}connectedCallback(){super.connectedCallback?.(),window.addEventListener("keydown",this.handleShortcut),this.optionsObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label"]})}disconnectedCallback(){window.removeEventListener("keydown",this.handleShortcut),this.optionsObserver.disconnect(),super.disconnectedCallback?.()}willUpdate(e){super.willUpdate(e),this.type!=="search"&&(this.type="search")}focusTarget(){if(this.panel){let[e]=this.triggerSlot?.assignedElements()??[];return e instanceof HTMLElement?e:this.triggerEl}return super.focusTarget()}openPanel(){this.modalEl?.show()}closePanel(){this.modalEl?.hide()}firstUpdated(e){super.firstUpdated(e);let t=this.shadowRoot?.getElementById("field");t&&(t.addEventListener("pointerdown",this.handleFieldPointerDown),t.addEventListener("focus",this.handleSuggestionsFieldActivate),t.addEventListener("click",this.handleSuggestionsFieldActivate),t.addEventListener("input",this.handleSuggestionsInput),t.addEventListener("keydown",this.handleSuggestionsKeydown),this.addEventListener("focusout",this.handleSuggestionsFocusOut))}get options(){return L(this.children)}get effectiveQuery(){return(this.value??"").trim().toLowerCase()}get filteredOptions(){let e=this.effectiveQuery;return!e||this.filter==="none"?this.options:this.options.filter(t=>t.label.toLowerCase().includes(e))}openSuggestions(){if(this.disabled||this.readonly){this.fieldPointerDownAt=void 0;return}let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")||e?.showPopover(),e&&this.playListboxOpenAnimation(e)}static listboxAnimationDuration(e){return window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:O(e,"--field-listbox-transition-duration","m",200)}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let t=i.listboxAnimationDuration(e);t!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:c(e),fill:"forwards"}))}closeSuggestions(){let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")&&this.playListboxCloseAnimation(e)}playListboxCloseAnimation(e){e.style.pointerEvents="none";let t=i.listboxAnimationDuration(e);if(t===0){e.hidePopover();return}let n=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:c(e),fill:"forwards"});this.listboxAnimation=n,n.finished.then(()=>{this.listboxAnimation===n&&(this.listboxAnimation=void 0),e.hidePopover()}).catch(()=>{})}handleSelect(e){this.value=e.label,this.dispatchEvent(new x(this.value)),this.dispatchEvent(new I(e.value)),this.closeSuggestions()}renderSuggestionOptionRows(e){let t=this.effectiveQuery;return T(e,(n,p)=>o`
|
|
144
144
|
<li
|
|
145
|
-
id="listbox-option-${
|
|
145
|
+
id="listbox-option-${p}"
|
|
146
146
|
role="option"
|
|
147
|
-
aria-selected=${
|
|
148
|
-
class=${
|
|
149
|
-
@mousedown=${
|
|
150
|
-
@mouseenter=${()=>{this.highlightedIndex=
|
|
147
|
+
aria-selected=${n.label.toLowerCase()===t}
|
|
148
|
+
class=${v({highlighted:p===this.highlightedIndex,selected:n.label.toLowerCase()===t})}
|
|
149
|
+
@mousedown=${$=>{$.preventDefault(),this.handleSelect(n)}}
|
|
150
|
+
@mouseenter=${()=>{this.highlightedIndex=p}}
|
|
151
151
|
>
|
|
152
|
-
${
|
|
152
|
+
${k(n.label,t)}
|
|
153
153
|
</li>
|
|
154
|
-
`)}
|
|
154
|
+
`)}renderSuggestionsListbox(){return o`
|
|
155
155
|
<ul
|
|
156
156
|
id="listbox"
|
|
157
157
|
role="listbox"
|
|
158
|
-
aria-label=${
|
|
158
|
+
aria-label=${d(this.label)}
|
|
159
159
|
popover="auto"
|
|
160
160
|
@toggle=${this.handleSuggestionsPopoverToggle}
|
|
161
161
|
>
|
|
@@ -174,32 +174,36 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
|
|
|
174
174
|
>${this.shortcutLabel}</kbd
|
|
175
175
|
>`:l}hasTrailingAddon(){return this.loading||this.panel||this.shortcut}renderTriggerIndicator(){return this.shortcut?o`<kbd id="shortcut-hint" aria-hidden="true"
|
|
176
176
|
>${this.shortcutLabel}</kbd
|
|
177
|
-
>`:l}updated(e){super.updated(e);let t=this.shadowRoot?.getElementById("field");t&&(this.shortcut&&!this.panel?t.hasAttribute("aria-keyshortcuts")||t.setAttribute("aria-keyshortcuts","Control+K Meta+K"):t.removeAttribute("aria-keyshortcuts"),this.panel?t.hasAttribute("autofocus")||t.setAttribute("autofocus",""):t.removeAttribute("autofocus"),this.syncSuggestionsAria(t))}syncSuggestionsAria(e){if(!this.suggestions||this.panel){e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-activedescendant");return}e.setAttribute("role","combobox"),e.setAttribute("aria-expanded",this.isOpen?"true":"false"),e.setAttribute("aria-controls","listbox"),this.highlightedIndex>=0?e.setAttribute("aria-activedescendant",`listbox-option-${this.highlightedIndex}`):e.removeAttribute("aria-activedescendant")}render(){if(!this.panel)return super.render();let e=this.renderDescription();return o`
|
|
177
|
+
>`:l}updated(e){super.updated(e);let t=this.shadowRoot?.getElementById("field");t&&(this.shortcut&&!this.panel?t.hasAttribute("aria-keyshortcuts")||t.setAttribute("aria-keyshortcuts","Control+K Meta+K"):t.removeAttribute("aria-keyshortcuts"),this.panel?t.hasAttribute("autofocus")||t.setAttribute("autofocus",""):t.removeAttribute("autofocus"),this.syncSuggestionsAria(t))}syncSuggestionsAria(e){if(!this.suggestions||this.panel){e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls"),e.removeAttribute("aria-autocomplete"),e.removeAttribute("aria-activedescendant");return}e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",this.isOpen?"true":"false"),e.setAttribute("aria-controls","listbox"),this.highlightedIndex>=0?e.setAttribute("aria-activedescendant",`listbox-option-${this.highlightedIndex}`):e.removeAttribute("aria-activedescendant")}render(){if(!this.panel)return super.render();let e=this.renderDescription();return o`
|
|
178
178
|
<div id="wrapper">
|
|
179
179
|
${this.renderFormLabels("search-trigger")}
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
180
|
+
<slot name="trigger" @click=${this.handleTriggerClick}>
|
|
181
|
+
<button
|
|
182
|
+
id="search-trigger"
|
|
183
|
+
part="trigger"
|
|
184
|
+
type="button"
|
|
185
|
+
aria-haspopup="dialog"
|
|
186
|
+
aria-label=${d(this.label)}
|
|
187
|
+
aria-keyshortcuts=${d(this.shortcut?"Control+K Meta+K":void 0)}
|
|
188
|
+
?disabled=${this.disabled}
|
|
189
|
+
>
|
|
190
|
+
${this.icon?o`<eun-icon
|
|
191
|
+
id="trigger-icon"
|
|
192
|
+
name=${this.icon}
|
|
193
|
+
size="16"
|
|
194
|
+
></eun-icon>`:l}
|
|
195
|
+
<span id="trigger-text" class="empty"
|
|
196
|
+
>${this.placeholder||""}</span
|
|
197
|
+
>
|
|
198
|
+
${this.renderTriggerIndicator()}
|
|
199
|
+
</button>
|
|
200
|
+
</slot>
|
|
197
201
|
<eun-modal
|
|
198
202
|
id="panel"
|
|
199
203
|
kind="search"
|
|
200
204
|
hide-actions
|
|
201
205
|
.closeable=${!1}
|
|
202
|
-
aria-label=${this.label||this.
|
|
206
|
+
aria-label=${this.label||(this.panelLabel??this.dictionary.search.panel)}
|
|
203
207
|
>
|
|
204
208
|
<div id="panel-field">
|
|
205
209
|
${this.renderField(e!==l)}
|
|
@@ -210,4 +214,4 @@ import{b as f}from"./chunks/chunk-BQFJR2UP.js";import{a as k,b as T}from"./chunk
|
|
|
210
214
|
</eun-modal>
|
|
211
215
|
${e}
|
|
212
216
|
</div>
|
|
213
|
-
`}};i.styles=[
|
|
217
|
+
`}};i.styles=[g.styles,w,...u?[]:[A],D],i.FIELD_POINTER_DOWN_WINDOW_MS=100,r([s({reflect:!0,converter:{toAttribute:()=>null}})],i.prototype,"type",2),r([s()],i.prototype,"icon",2),r([s({converter:m})],i.prototype,"clearable",2),r([s({type:Boolean})],i.prototype,"shortcut",2),r([s({type:Boolean})],i.prototype,"panel",2),r([s({attribute:"panel-label"})],i.prototype,"panelLabel",2),r([s({type:Boolean,reflect:!0})],i.prototype,"loading",2),r([s({attribute:"loading-label"})],i.prototype,"loadingLabel",2),r([s({type:Boolean,reflect:!0})],i.prototype,"suggestions",2),r([s({attribute:"no-results-label"})],i.prototype,"noResultsLabel",2),r([s()],i.prototype,"filter",2),r([h()],i.prototype,"isOpen",2),r([h()],i.prototype,"highlightedIndex",2),r([a("#panel")],i.prototype,"modalEl",2),r([a("#field-wrapper")],i.prototype,"fieldWrapperEl",2),r([a('slot[name="trigger"]')],i.prototype,"triggerSlot",2),r([a("#search-trigger")],i.prototype,"triggerEl",2),r([a("#listbox")],i.prototype,"listboxEl",2),i=r([f(P)],i);export{i as EunomiaSearch,P as EunomiaSearchTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as P,b as V,c as B}from"./chunks/chunk-GWLD2I3P.js";import{a as A}from"./chunks/chunk-UVHVQRPT.js";import{a as R,b as H}from"./chunks/chunk-AH2SKZ7T.js";import{a as D}from"./chunks/chunk-LK5BJ4SH.js";import{a as E}from"./chunks/chunk-WIUERJII.js";import{a as F}from"./chunks/chunk-QSZO4GIH.js";import{b as N,c as g}from"./chunks/chunk-624VJYNA.js";import{a as b}from"./chunks/chunk-LYYQAALT.js";import{a as k}from"./chunks/chunk-GVS6IUKC.js";import{a as C}from"./chunks/chunk-P6LGU3FT.js";import{a as T}from"./chunks/chunk-BO3JOEWM.js";import{c as $,d as I,e as O,f as u}from"./chunks/chunk-TLBXTBMM.js";import{a as f}from"./chunks/chunk-YYCEPZUN.js";import{a as M}from"./chunks/chunk-3BMACIDO.js";import{a as p}from"./chunks/chunk-PPCHQG7P.js";import{a as d}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as w}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as n,f as x,h as y,j as r,k as h,l as c,n as m,p as o,r as l,u as L}from"./chunks/chunk-YITWLCD3.js";var z=y`
|
|
2
2
|
#field {
|
|
3
3
|
padding-inline-end: calc(var(--eun-space-l, 32px) * 1.2);
|
|
4
4
|
}
|
|
@@ -105,38 +105,38 @@ import{a as H,b as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as A}from"./chunk
|
|
|
105
105
|
outline-offset: 2px;
|
|
106
106
|
border-radius: var(--eun-border-radius-m);
|
|
107
107
|
}
|
|
108
|
-
`,
|
|
109
|
-
${r.group}
|
|
110
|
-
</li>`));let x=this.isSelected(r);i.push(o`
|
|
108
|
+
`,W=[F,R,...b?[]:[H],z];var q="eun-select",K=M(O(L)),Q=w(D(C(E(k(T(I(A($(K))))))))),t=class extends Q{constructor(){super(...arguments);this.errorOnChange=!0;this.searchable=!1;this.native=!1;this.multiple=!1;this.noAnimation=!1;this.searchPlaceholder="Search\u2026";this.selectPlaceholder="Select\u2026";this.noResultsLabel="No results";this.loading=!1;this.loadingLabel="Loading\u2026";this.searchQuery="";this.isOpen=!1;this.highlightedIndex=-1;this.typeaheadBuffer="";this.handleIconSlotChange=()=>{this.requestUpdate()};this.handleActionsSlotChange=()=>{this.requestUpdate()};this.handleHostFocus=()=>{this.fieldEl?.focus()};this.handleWindowBlur=()=>{this.isOpen&&this.closeListbox()};this.handleFocusOut=()=>{this.isOpen&&requestAnimationFrame(()=>{this.matches(":focus-within")||this.closeListbox()})};this.handleFieldPointerDown=()=>{this.fieldPointerDownAt=performance.now()};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.listboxEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.listboxEl,{forceFallback:b}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closeListbox());return}if(this.fieldPointerDownAt!==void 0&&performance.now()-this.fieldPointerDownAt<t.FIELD_POINTER_DOWN_WINDOW_MS){this.fieldPointerDownAt=void 0,this.openListbox();return}this.isOpen=!1,this.searchQuery=this.selectedLabel,this.highlightedIndex=-1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.readonlyAvailable&&this.editing&&this.cancelEdit()};this.handleConfirmClick=()=>{this.closeListbox(),this.confirmEdit()}}get defaultValue(){return super.defaultValue}set defaultValue(e){let i=this.hasAttribute("multiple")&&typeof e=="string"?e.split(",").filter(Boolean):e;super.defaultValue=i}get value(){return super.value}set value(e){let i=this.hasAttribute("multiple")&&typeof e=="string"?e.split(",").filter(Boolean):e;super.value=i}connectedCallback(){super.connectedCallback?.(),this.addEventListener("focus",this.handleHostFocus),window.addEventListener("blur",this.handleWindowBlur)}disconnectedCallback(){this.removeEventListener("focus",this.handleHostFocus),window.removeEventListener("blur",this.handleWindowBlur),clearTimeout(this.typeaheadTimer),super.disconnectedCallback?.()}get options(){return P(this.children)}get selectedValues(){return this.multiple?this.value??[]:this.value?[this.value]:[]}isSelected(e){return this.selectedValues.includes(e.value)}get selectedLabel(){let e=this.selectedValues;return this.options.filter(i=>e.includes(i.value)).map(i=>i.label).join(", ")}get hasConfirmSlot(){return this.querySelector('[slot="confirm"]')!==null}get hasConfirmContent(){return this.hasConfirmSlot||!!(this.confirmLabel??this.dictionary.common.confirm)}get effectiveQuery(){if(!this.searchable)return"";let e=this.searchQuery.trim().toLowerCase();return e&&e!==this.selectedLabel.toLowerCase()?e:""}get filteredOptions(){let e=this.effectiveQuery;return e?this.options.filter(i=>i.label.toLowerCase().includes(e)):this.options}get effectivePlaceholder(){return this.placeholder??(this.searchable?this.searchPlaceholder:this.selectPlaceholder)}willUpdate(e){super.willUpdate(e),e.has("value")&&this.searchable&&!this.isOpen&&(this.searchQuery=this.selectedLabel)}firstUpdated(e){super.firstUpdated(e),this.syncOptions()}updated(e){super.updated(e),e.has("editing")&&this.editing&&(this.native?(this.syncOptions(),this.fieldEl?.focus()):this.openListbox()),this.native&&(e.has("value")&&this.fieldEl instanceof HTMLSelectElement&&(this.fieldEl.value=this.value??""),(e.has("readonly")||e.has("disabled"))&&(this.disabled||this.readonly?this.setAttribute("tabindex","-1"):this.removeAttribute("tabindex")))}get hostTabStop(){return!1}getFocusAnchor(){return this.fieldEl??void 0}focus(){super.focus?.(),this.fieldEl?.focus()}openListbox(){if(this.disabled||this.readonly){this.fieldPointerDownAt=void 0;return}let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")||e?.showPopover(),e&&this.playListboxOpenAnimation(e),this.fieldEl?.focus(),this.fieldEl instanceof HTMLInputElement&&this.fieldEl.select()}listboxAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:N(e,"--field-listbox-transition-duration","m",200)}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let i=this.listboxAnimationDuration(e);i!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:i,easing:g(e),fill:"forwards"}))}closeListbox(){let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")&&this.playListboxCloseAnimation(e)}playListboxCloseAnimation(e){e.style.pointerEvents="none";let i=this.listboxAnimationDuration(e);if(i===0){e.hidePopover();return}let s=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:i,easing:g(e),fill:"forwards"});this.listboxAnimation=s,s.finished.then(()=>{this.listboxAnimation===s&&(this.listboxAnimation=void 0),e.hidePopover()}).catch(()=>{})}handleFieldActivate(){this.isOpen||this.openListbox()}handleFieldInput(e){this.searchable&&(this.searchQuery=e.target.value,this.highlightedIndex=-1,this.isOpen||this.openListbox())}handleSelect(e){if(this.multiple){let i=this.selectedValues;this.value=i.includes(e.value)?i.filter(s=>s!==e.value):[...i,e.value],this.dispatchEvent(new f(this.value));return}this.value=e.value,this.dispatchEvent(new f(this.value)),this.closeListbox(),this.readonlyAvailable&&this.confirmEdit()}handleNativeChange(e){this.value=e.target.value,this.dispatchEvent(new f(this.value)),this.readonlyAvailable&&this.confirmEdit()}syncOptions(){if(!this.native||!(this.fieldEl instanceof HTMLSelectElement))return;let e=Array.from(this.children).filter(i=>i instanceof HTMLOptionElement||i instanceof HTMLOptGroupElement);this.fieldEl.replaceChildren(...e.map(i=>i.cloneNode(!0))),this.fieldEl.value=this.value??""}handleSlotChange(){this.syncOptions()}handleKeydown(e){switch(e.key){case"ArrowDown":{e.preventDefault(),this.isOpen||this.openListbox();let i=this.filteredOptions;i.length&&(this.highlightedIndex=Math.min(this.highlightedIndex+1,i.length-1));break}case"ArrowUp":{e.preventDefault(),this.isOpen||this.openListbox(),this.filteredOptions.length&&(this.highlightedIndex=Math.max(this.highlightedIndex-1,0));break}case"Home":{if(this.searchable)return;e.preventDefault(),this.isOpen||this.openListbox(),this.filteredOptions.length&&(this.highlightedIndex=0);break}case"End":{if(this.searchable)return;e.preventDefault(),this.isOpen||this.openListbox();let i=this.filteredOptions;i.length&&(this.highlightedIndex=i.length-1);break}case"Enter":{e.preventDefault();let i=this.filteredOptions[this.highlightedIndex];i&&this.handleSelect(i);break}case" ":{if(this.searchable||this.typeaheadBuffer){this.searchable||this.handleTypeahead(e);break}if(e.preventDefault(),!this.isOpen){this.openListbox();break}let i=this.filteredOptions[this.highlightedIndex];i&&this.handleSelect(i);break}default:this.searchable||this.handleTypeahead(e);break}}handleTypeahead(e){if(e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;e.preventDefault(),this.isOpen||this.openListbox();let i=this.filteredOptions;if(!i.length)return;clearTimeout(this.typeaheadTimer),this.typeaheadBuffer+=e.key.toLowerCase(),this.typeaheadTimer=setTimeout(()=>{this.typeaheadBuffer=""},600);let s=(this.highlightedIndex+1)%i.length,a=[...i.slice(s),...i.slice(0,s)].findIndex(v=>v.label.toLowerCase().startsWith(this.typeaheadBuffer));a!==-1&&(this.highlightedIndex=(s+a)%i.length)}renderHighlighted(e){return V(e,this.effectiveQuery)}renderOptionRows(e){return B(e,(i,s)=>{let a=this.isSelected(i);return o`
|
|
111
109
|
<li
|
|
112
|
-
id="listbox-option-${
|
|
110
|
+
id="listbox-option-${s}"
|
|
113
111
|
role="option"
|
|
114
|
-
aria-selected=${
|
|
115
|
-
class=${d({highlighted:
|
|
116
|
-
@mousedown=${
|
|
117
|
-
@mouseenter=${()=>{this.highlightedIndex=
|
|
112
|
+
aria-selected=${a}
|
|
113
|
+
class=${d({highlighted:s===this.highlightedIndex,selected:a})}
|
|
114
|
+
@mousedown=${v=>{v.preventDefault(),this.handleSelect(i)}}
|
|
115
|
+
@mouseenter=${()=>{this.highlightedIndex=s}}
|
|
118
116
|
>
|
|
119
117
|
${this.multiple?o`<span class="option-checkbox" aria-hidden="true"
|
|
120
118
|
><eun-icon name="check" size="12px"></eun-icon
|
|
121
|
-
></span>`:
|
|
122
|
-
${this.searchable?this.renderHighlighted(
|
|
119
|
+
></span>`:l}
|
|
120
|
+
${this.searchable?this.renderHighlighted(i.label):i.label}
|
|
123
121
|
</li>
|
|
124
|
-
`
|
|
122
|
+
`})}get showConfirmLink(){return this.editing||this.multiple&&this.isOpen}renderConfirmLink(){return this.hasConfirmContent?o`
|
|
125
123
|
<button type="button" id="confirm-link" @click=${this.handleConfirmClick}>
|
|
126
|
-
<slot name="confirm"
|
|
124
|
+
<slot name="confirm"
|
|
125
|
+
>${this.confirmLabel??this.dictionary.common.confirm}</slot
|
|
126
|
+
>
|
|
127
127
|
</button>
|
|
128
|
-
`:
|
|
128
|
+
`:l}renderReadonlyDisplay(){let e=this.selectedLabel;return o`
|
|
129
129
|
<div
|
|
130
130
|
id="readonly-display"
|
|
131
131
|
role="button"
|
|
132
132
|
tabindex="0"
|
|
133
|
-
aria-label=${
|
|
133
|
+
aria-label=${p(this.label)}
|
|
134
134
|
@click=${this.startEdit}
|
|
135
135
|
@keydown=${i=>(i.key==="Enter"||i.key===" ")&&this.startEdit()}
|
|
136
136
|
>
|
|
137
137
|
<slot name="readonly-content">
|
|
138
138
|
<span class=${d({empty:!e})}
|
|
139
|
-
>${e||this.emptyValueLabel}</span
|
|
139
|
+
>${e||(this.emptyValueLabel??this.dictionary.common.noValue)}</span
|
|
140
140
|
>
|
|
141
141
|
</slot>
|
|
142
142
|
</div>
|
|
@@ -156,18 +156,18 @@ import{a as H,b as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as A}from"./chunk
|
|
|
156
156
|
class=${d({"has-icon":!!this.icon||!!this.iconSlotEls?.length,"has-confirm":this.showConfirmLink})}
|
|
157
157
|
>
|
|
158
158
|
<slot name="icon" @slotchange=${this.handleIconSlotChange}>
|
|
159
|
-
${this.icon?o`<eun-icon id="icon" name=${this.icon} size="16"></eun-icon>`:
|
|
159
|
+
${this.icon?o`<eun-icon id="icon" name=${this.icon} size="16"></eun-icon>`:l}
|
|
160
160
|
</slot>
|
|
161
161
|
<select
|
|
162
162
|
id="field"
|
|
163
163
|
.value=${this.value??""}
|
|
164
|
-
aria-describedby=${e?"description":
|
|
164
|
+
aria-describedby=${e?"description":l}
|
|
165
165
|
?disabled=${this.disabled||this.readonly}
|
|
166
166
|
?required=${this.required}
|
|
167
167
|
aria-invalid=${this.showError}
|
|
168
168
|
@change=${this.handleNativeChange}
|
|
169
169
|
></select>
|
|
170
|
-
${this.showConfirmLink?this.renderConfirmLink():
|
|
170
|
+
${this.showConfirmLink?this.renderConfirmLink():l}
|
|
171
171
|
${this.renderTrailingIndicator()}
|
|
172
172
|
</div>
|
|
173
173
|
`}renderField(e){let i=this.filteredOptions;return o`
|
|
@@ -176,18 +176,18 @@ import{a as H,b as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as A}from"./chunk
|
|
|
176
176
|
class=${d({"has-icon":!!this.icon||!!this.iconSlotEls?.length,"has-confirm":this.showConfirmLink})}
|
|
177
177
|
>
|
|
178
178
|
<slot name="icon" @slotchange=${this.handleIconSlotChange}>
|
|
179
|
-
${this.icon?o`<eun-icon id="icon" name=${this.icon} size="16"></eun-icon>`:
|
|
179
|
+
${this.icon?o`<eun-icon id="icon" name=${this.icon} size="16"></eun-icon>`:l}
|
|
180
180
|
</slot>
|
|
181
181
|
<input
|
|
182
182
|
id="field"
|
|
183
183
|
type="text"
|
|
184
184
|
role="combobox"
|
|
185
|
-
aria-label=${
|
|
185
|
+
aria-label=${p(this.label)}
|
|
186
186
|
aria-expanded=${this.isOpen}
|
|
187
187
|
aria-controls="listbox"
|
|
188
188
|
aria-autocomplete=${this.searchable?"list":"none"}
|
|
189
189
|
aria-activedescendant=${this.highlightedIndex>=0?`listbox-option-${this.highlightedIndex}`:""}
|
|
190
|
-
aria-describedby=${e?"description":
|
|
190
|
+
aria-describedby=${e?"description":l}
|
|
191
191
|
autocomplete="off"
|
|
192
192
|
.value=${this.searchable?this.searchQuery:this.selectedLabel}
|
|
193
193
|
placeholder=${this.effectivePlaceholder}
|
|
@@ -201,13 +201,13 @@ import{a as H,b as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as A}from"./chunk
|
|
|
201
201
|
@input=${this.handleFieldInput}
|
|
202
202
|
@keydown=${this.handleKeydown}
|
|
203
203
|
/>
|
|
204
|
-
${this.showConfirmLink?this.renderConfirmLink():
|
|
204
|
+
${this.showConfirmLink?this.renderConfirmLink():l}
|
|
205
205
|
${this.renderTrailingIndicator()}
|
|
206
206
|
</div>
|
|
207
207
|
<ul
|
|
208
208
|
id="listbox"
|
|
209
209
|
role="listbox"
|
|
210
|
-
aria-label=${
|
|
210
|
+
aria-label=${p(this.label)}
|
|
211
211
|
aria-multiselectable=${this.multiple?"true":"false"}
|
|
212
212
|
popover="auto"
|
|
213
213
|
@toggle=${this.handlePopoverToggle}
|
|
@@ -228,10 +228,10 @@ import{a as H,b as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as A}from"./chunk
|
|
|
228
228
|
${this.loadingLabel}
|
|
229
229
|
</li>`]:e.length?this.renderOptionRows(e):[o`<li id="listbox-empty" class="no-results" role="presentation">
|
|
230
230
|
${this.noResultsLabel}
|
|
231
|
-
</li>`]}render(){let e=this.readonlyAvailable&&!this.editing,i=this.renderDescription(),
|
|
231
|
+
</li>`]}render(){let e=this.readonlyAvailable&&!this.editing,i=this.renderDescription(),s=i!==l,a;return e?a=this.renderReadonlyDisplay():this.native?a=this.renderNativeField(s):a=this.renderField(s),o`
|
|
232
232
|
<div id="wrapper" @focusout=${this.handleFocusOut}>
|
|
233
233
|
${this.renderFormLabels(e?void 0:"field")}
|
|
234
|
-
${
|
|
234
|
+
${a} ${i}
|
|
235
235
|
<slot hidden @slotchange=${this.handleSlotChange}></slot>
|
|
236
236
|
</div>
|
|
237
|
-
`}};t.styles=[
|
|
237
|
+
`}};t.styles=[W,u.base,u.errorMessages,u.hintMessages],t.FIELD_POINTER_DOWN_WINDOW_MS=100,n([r({attribute:"default-value"})],t.prototype,"defaultValue",1),n([r()],t.prototype,"value",1),n([r({type:Boolean,reflect:!0})],t.prototype,"searchable",2),n([r({type:Boolean,reflect:!0})],t.prototype,"native",2),n([r({type:Boolean,reflect:!0})],t.prototype,"multiple",2),n([r({type:Boolean,reflect:!0,attribute:"no-animation"})],t.prototype,"noAnimation",2),n([r()],t.prototype,"icon",2),n([r()],t.prototype,"placeholder",2),n([r({attribute:"search-placeholder"})],t.prototype,"searchPlaceholder",2),n([r({attribute:"select-placeholder"})],t.prototype,"selectPlaceholder",2),n([r({attribute:"empty-value-label"})],t.prototype,"emptyValueLabel",2),n([r({attribute:"no-results-label"})],t.prototype,"noResultsLabel",2),n([r({attribute:"confirm-label"})],t.prototype,"confirmLabel",2),n([r({type:Boolean,reflect:!0})],t.prototype,"loading",2),n([r({attribute:"loading-label"})],t.prototype,"loadingLabel",2),n([h()],t.prototype,"searchQuery",2),n([h()],t.prototype,"isOpen",2),n([h()],t.prototype,"highlightedIndex",2),n([c("#field")],t.prototype,"fieldEl",2),n([c("#field-wrapper")],t.prototype,"fieldWrapperEl",2),n([c("#listbox")],t.prototype,"listboxEl",2),n([m({slot:"icon"})],t.prototype,"iconSlotEls",2),n([m({slot:"actions"})],t.prototype,"actionsSlotEls",2),t=n([x(q)],t);export{t as EunomiaSelect,q as EunomiaSelectTagName};
|