@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
|
@@ -13,10 +13,12 @@ import { EunomiaInput } from "../input/input.js";
|
|
|
13
13
|
import { searchStyles } from "./search.styles.js";
|
|
14
14
|
import { AnchorPositionMixin } from "../../../mixins/anchor-position.mixin.js";
|
|
15
15
|
import { ChangeEvent } from "../../../events/change.event.js";
|
|
16
|
+
import { SelectEvent } from "../../../events/select.event.js";
|
|
16
17
|
import { listboxStyles, listboxAnchorPositioningStyles, } from "../shared-styles/listbox.styles.js";
|
|
17
|
-
import { parseListboxOptions, renderHighlightedLabel, } from "../../../utils/listbox-options.utils.js";
|
|
18
|
+
import { parseListboxOptions, renderHighlightedLabel, renderListboxRows, } from "../../../utils/listbox-options.utils.js";
|
|
18
19
|
import { isWebKit } from "../../../utils/browser.utils.js";
|
|
19
20
|
import { resolveDurationMs, resolveEasing, } from "../../../utils/motion.utils.js";
|
|
21
|
+
import { defaultTrueConverter } from "../../../utils/boolean.utils.js";
|
|
20
22
|
/**
|
|
21
23
|
* Tag name of the search component.
|
|
22
24
|
*/
|
|
@@ -39,15 +41,20 @@ export const EunomiaSearchTagName = "eun-search";
|
|
|
39
41
|
*
|
|
40
42
|
* @slot [icon] - Replaces the leading icon entirely with any content, not just an icon element. Falls back to icon when empty. Applies to the real field, inline or inside the panel modal. The compact panel trigger button always shows the plain icon glyph, since it can't project the same slotted content a second time
|
|
41
43
|
* @slot results - Content rendered below the field inside the panel, such as a result list. Only relevant when panel is set
|
|
44
|
+
* @slot trigger - Replaces the panel's built-in trigger button, for example with an icon button. A click on it opens the panel, and focus returns to it on close. Give it its own accessible name. Only relevant when panel is set
|
|
45
|
+
* @csspart trigger - The panel's built-in trigger button, shown while nothing is slotted in trigger
|
|
42
46
|
* @prop {boolean} [shortcut=false] - Enables the Ctrl+K or Cmd+K global shortcut and its visual key hint badge
|
|
43
47
|
* @prop {boolean} [panel=false] - Opens a modal command palette panel on shortcut or click instead of focusing inline
|
|
44
|
-
* @prop {string} [
|
|
48
|
+
* @prop {string} [panelLabel] - The accessible name of the panel's dialog, used when label isn't set. Defaults to the localized string for the current locale (English: "Search")
|
|
45
49
|
* @prop {boolean} [loading=false] - Whether a search request is currently in flight. Shows a spinning loading indicator in place of the clear button or shortcut hint on the inline field only. Ignored on the panel trigger and the panel's own field, which stay static, so reflect the loading state on the results slot instead
|
|
46
50
|
* @prop {string} [loadingLabel='Loading…'] - The accessible label announced by the loading indicator while loading is set
|
|
47
51
|
* @prop {boolean} [suggestions=false] - Opens a dropdown listbox showing light DOM option and optgroup children matching the typed value, highlighting the matched substring. Ignored while panel is set
|
|
48
52
|
* @prop {string} [noResultsLabel='No results'] - Text displayed in the dropdown when no option matches, while suggestions is set
|
|
49
|
-
* @
|
|
53
|
+
* @prop {'contains' | 'none'} [filter='contains'] - How the suggestions are filtered against the typed value. Contains keeps the options whose label contains it, none shows every option as is, for results already filtered by a server
|
|
54
|
+
* @fires {ChangeEvent} eunchange - Fired on every value change, typed or picked from the suggestions
|
|
55
|
+
* @fires {SelectEvent} eunselect - Fired when a suggestion is picked, with the option's value as key
|
|
50
56
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the suggestions dropdown, past which it scrolls. Shared with the select component
|
|
57
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the suggestions dropdown, independent of the field's own radius. Shared with the select component
|
|
51
58
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the suggestions dropdown's open and close transition. Shared with the select component
|
|
52
59
|
* @cssprop [--field-match-color] - Sets the color of the matched search substring, highlighted while suggestions is set. Shared with the select component
|
|
53
60
|
* @cssprop [--field-match-background] - Sets the background of the matched search substring, none by default. Shared with the select component
|
|
@@ -64,7 +71,8 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
64
71
|
/**
|
|
65
72
|
* Always `"search"` — enforced in `willUpdate`, since `EunomiaInput` declares
|
|
66
73
|
* `type` as a plain property (not an accessor), which TypeScript doesn't
|
|
67
|
-
* allow overriding as a getter/setter pair from a subclass.
|
|
74
|
+
* allow overriding as a getter/setter pair from a subclass. Never
|
|
75
|
+
* reflected, since it can't differ from its default.
|
|
68
76
|
* @default search
|
|
69
77
|
*/
|
|
70
78
|
this.type = "search";
|
|
@@ -97,13 +105,6 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
97
105
|
* @default false
|
|
98
106
|
*/
|
|
99
107
|
this.panel = false;
|
|
100
|
-
/**
|
|
101
|
-
* Accessible name of the panel's dialog, used as `eun-modal`'s `aria-label`
|
|
102
|
-
* since the panel renders no visible heading. Ignored when `label` is set
|
|
103
|
-
* (used instead, since it already names the field itself).
|
|
104
|
-
* @default Search
|
|
105
|
-
*/
|
|
106
|
-
this.ariaLabelPanel = "Search";
|
|
107
108
|
/**
|
|
108
109
|
* Indicates whether a search request is currently in flight. Shows a
|
|
109
110
|
* spinning `eun-loader` in place of the clear button/shortcut hint on the
|
|
@@ -129,9 +130,10 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
129
130
|
* mechanic (`AnchorPositionMixin`, CSS Anchor Positioning with a JS
|
|
130
131
|
* fallback) as `eun-select`'s own dropdown, sharing its CSS custom
|
|
131
132
|
* properties (`--field-listbox-max-height`, `--field-match-*`, etc.).
|
|
132
|
-
* Picking a suggestion sets `value` to its label
|
|
133
|
-
*
|
|
134
|
-
*
|
|
133
|
+
* Picking a suggestion sets `value` to its label, then fires `eunselect`
|
|
134
|
+
* with the option's own `value` attribute, so two options sharing a label
|
|
135
|
+
* stay distinguishable. Ignored while `panel` is set — combining the two
|
|
136
|
+
* isn't supported.
|
|
135
137
|
* @default false
|
|
136
138
|
*/
|
|
137
139
|
this.suggestions = false;
|
|
@@ -141,6 +143,14 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
141
143
|
* @default No results
|
|
142
144
|
*/
|
|
143
145
|
this.noResultsLabel = "No results";
|
|
146
|
+
/**
|
|
147
|
+
* How the suggestions are filtered against the typed value : `contains`
|
|
148
|
+
* keeps the options whose label contains it, `none` shows every option as
|
|
149
|
+
* is, for results a server already filtered, possibly on another field
|
|
150
|
+
* than the label.
|
|
151
|
+
* @default contains
|
|
152
|
+
*/
|
|
153
|
+
this.filter = "contains";
|
|
144
154
|
/**
|
|
145
155
|
* Whether the suggestions dropdown is currently open.
|
|
146
156
|
* @internal
|
|
@@ -152,6 +162,29 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
152
162
|
* @internal
|
|
153
163
|
*/
|
|
154
164
|
this.highlightedIndex = -1;
|
|
165
|
+
/**
|
|
166
|
+
* Re-renders the suggestions whenever the light DOM `option`/`optgroup`
|
|
167
|
+
* children change, since they aren't reactive properties : a consumer
|
|
168
|
+
* replacing them with a server's results would otherwise stay unseen until
|
|
169
|
+
* some unrelated property changed.
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
this.optionsObserver = new MutationObserver(() => {
|
|
173
|
+
if (this.highlightedIndex >= this.filteredOptions.length) {
|
|
174
|
+
this.highlightedIndex = -1;
|
|
175
|
+
}
|
|
176
|
+
this.requestUpdate();
|
|
177
|
+
});
|
|
178
|
+
/**
|
|
179
|
+
* Opens the panel on a click anywhere in the `trigger` slot, its slotted
|
|
180
|
+
* content or the built-in button it falls back to, unless disabled.
|
|
181
|
+
* @private
|
|
182
|
+
*/
|
|
183
|
+
this.handleTriggerClick = () => {
|
|
184
|
+
if (!this.disabled) {
|
|
185
|
+
this.openPanel();
|
|
186
|
+
}
|
|
187
|
+
};
|
|
155
188
|
/**
|
|
156
189
|
* Records that the field itself was the pointerdown target — see
|
|
157
190
|
* {@link fieldPointerDownAt}.
|
|
@@ -171,6 +204,25 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
171
204
|
}
|
|
172
205
|
this.openSuggestions();
|
|
173
206
|
};
|
|
207
|
+
/**
|
|
208
|
+
* Closes the dropdown once focus has left the component entirely, e.g.
|
|
209
|
+
* `Tab`-ing away, same as `eun-select`'s own `handleFocusOut` : the
|
|
210
|
+
* Popover API's light-dismiss only reacts to outside clicks, not to focus
|
|
211
|
+
* moving via the keyboard. `closeSuggestions` checks the popover itself
|
|
212
|
+
* rather than `isOpen`, which only follows the asynchronous `toggle`
|
|
213
|
+
* event. Checked a frame later, since the newly focused
|
|
214
|
+
* element hasn't received focus yet when `focusout` fires. Picking an
|
|
215
|
+
* option never gets here, its row cancels `mousedown` so the field keeps
|
|
216
|
+
* focus.
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
this.handleSuggestionsFocusOut = () => {
|
|
220
|
+
requestAnimationFrame(() => {
|
|
221
|
+
if (!this.matches(":focus-within")) {
|
|
222
|
+
this.closeSuggestions();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
};
|
|
174
226
|
/**
|
|
175
227
|
* Opens the dropdown and resets the highlight on every keystroke. Bound to
|
|
176
228
|
* the field's native `input` event (rather than reacting to `value`
|
|
@@ -295,9 +347,17 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
295
347
|
connectedCallback() {
|
|
296
348
|
super.connectedCallback?.();
|
|
297
349
|
window.addEventListener("keydown", this.handleShortcut);
|
|
350
|
+
this.optionsObserver.observe(this, {
|
|
351
|
+
childList: true,
|
|
352
|
+
subtree: true,
|
|
353
|
+
characterData: true,
|
|
354
|
+
attributes: true,
|
|
355
|
+
attributeFilter: ["value", "label"],
|
|
356
|
+
});
|
|
298
357
|
}
|
|
299
358
|
disconnectedCallback() {
|
|
300
359
|
window.removeEventListener("keydown", this.handleShortcut);
|
|
360
|
+
this.optionsObserver.disconnect();
|
|
301
361
|
super.disconnectedCallback?.();
|
|
302
362
|
}
|
|
303
363
|
/**
|
|
@@ -313,18 +373,19 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
313
373
|
}
|
|
314
374
|
}
|
|
315
375
|
/**
|
|
316
|
-
*
|
|
376
|
+
* Sends a direct `focus()` call on the host to
|
|
317
377
|
* the collapsed trigger button while `panel` is set, instead of the
|
|
318
378
|
* inherited default (the native field) : that field lives inside the
|
|
319
379
|
* still-closed modal at this point, and focusing hidden popover content
|
|
320
380
|
* is a no-op — leaving focus stranded on the (invisible) host with
|
|
321
381
|
* nowhere to land, e.g. on a Shift+Tab back onto it from just past the
|
|
322
|
-
* trigger.
|
|
382
|
+
* trigger. A trigger slotted in `trigger` takes its place.
|
|
323
383
|
* @protected
|
|
324
384
|
*/
|
|
325
385
|
focusTarget() {
|
|
326
386
|
if (this.panel) {
|
|
327
|
-
|
|
387
|
+
const [slotted] = this.triggerSlot?.assignedElements() ?? [];
|
|
388
|
+
return slotted instanceof HTMLElement ? slotted : this.triggerEl;
|
|
328
389
|
}
|
|
329
390
|
return super.focusTarget();
|
|
330
391
|
}
|
|
@@ -363,6 +424,7 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
363
424
|
field.addEventListener("click", this.handleSuggestionsFieldActivate);
|
|
364
425
|
field.addEventListener("input", this.handleSuggestionsInput);
|
|
365
426
|
field.addEventListener("keydown", this.handleSuggestionsKeydown);
|
|
427
|
+
this.addEventListener("focusout", this.handleSuggestionsFocusOut);
|
|
366
428
|
}
|
|
367
429
|
/**
|
|
368
430
|
* The available suggestions, parsed from the light DOM `option`/`optgroup`
|
|
@@ -386,12 +448,12 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
386
448
|
}
|
|
387
449
|
/**
|
|
388
450
|
* Options filtered by {@link effectiveQuery}. Shows every option when the
|
|
389
|
-
* field is empty
|
|
451
|
+
* field is empty, or when {@link filter} is `none`.
|
|
390
452
|
* @internal
|
|
391
453
|
*/
|
|
392
454
|
get filteredOptions() {
|
|
393
455
|
const query = this.effectiveQuery;
|
|
394
|
-
if (!query) {
|
|
456
|
+
if (!query || this.filter === "none") {
|
|
395
457
|
return this.options;
|
|
396
458
|
}
|
|
397
459
|
return this.options.filter((option) => option.label.toLowerCase().includes(query));
|
|
@@ -507,22 +569,22 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
507
569
|
});
|
|
508
570
|
}
|
|
509
571
|
/**
|
|
510
|
-
* Picks a suggestion : sets `value` to its label
|
|
511
|
-
*
|
|
512
|
-
*
|
|
572
|
+
* Picks a suggestion : sets `value` to its label, fires `eunchange` with
|
|
573
|
+
* it like a keystroke would, then `eunselect` with the option's own
|
|
574
|
+
* `value`, and closes the dropdown.
|
|
513
575
|
*
|
|
514
576
|
* @param option the chosen option.
|
|
515
577
|
* @private
|
|
516
578
|
*/
|
|
517
579
|
handleSelect(option) {
|
|
518
580
|
this.value = option.label;
|
|
519
|
-
this.dispatchEvent(new ChangeEvent());
|
|
581
|
+
this.dispatchEvent(new ChangeEvent(this.value));
|
|
582
|
+
this.dispatchEvent(new SelectEvent(option.value));
|
|
520
583
|
this.closeSuggestions();
|
|
521
584
|
}
|
|
522
585
|
/**
|
|
523
|
-
* Renders the dropdown's option rows,
|
|
524
|
-
*
|
|
525
|
-
* and highlighting the matched substring — same rendering as
|
|
586
|
+
* Renders the dropdown's option rows, grouped under their `optgroup`
|
|
587
|
+
* label (see {@link renderListboxRows}), and highlighting the matched substring — same rendering as
|
|
526
588
|
* `eun-select`'s own `renderOptionRows`, minus the `multiple` checkbox
|
|
527
589
|
* (search has no multi-select concept) and the `selected` state now
|
|
528
590
|
* meaning "exactly matches the current value" rather than "is the stored
|
|
@@ -533,40 +595,27 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
533
595
|
* @private
|
|
534
596
|
*/
|
|
535
597
|
renderSuggestionOptionRows(options) {
|
|
536
|
-
const rows = [];
|
|
537
598
|
const query = this.effectiveQuery;
|
|
538
|
-
|
|
539
|
-
options.forEach((option, index) => {
|
|
540
|
-
if (option.group !== lastGroup) {
|
|
541
|
-
lastGroup = option.group;
|
|
542
|
-
if (option.group) {
|
|
543
|
-
rows.push(html `<li class="group-label" role="presentation">
|
|
544
|
-
${option.group}
|
|
545
|
-
</li>`);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
rows.push(html `
|
|
599
|
+
return renderListboxRows(options, (option, index) => html `
|
|
549
600
|
<li
|
|
550
601
|
id="listbox-option-${index}"
|
|
551
602
|
role="option"
|
|
552
603
|
aria-selected=${option.label.toLowerCase() === query}
|
|
553
604
|
class=${classMap({
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
605
|
+
highlighted: index === this.highlightedIndex,
|
|
606
|
+
selected: option.label.toLowerCase() === query,
|
|
607
|
+
})}
|
|
557
608
|
@mousedown=${(event) => {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
609
|
+
event.preventDefault();
|
|
610
|
+
this.handleSelect(option);
|
|
611
|
+
}}
|
|
561
612
|
@mouseenter=${() => {
|
|
562
|
-
|
|
563
|
-
|
|
613
|
+
this.highlightedIndex = index;
|
|
614
|
+
}}
|
|
564
615
|
>
|
|
565
616
|
${renderHighlightedLabel(option.label, query)}
|
|
566
617
|
</li>
|
|
567
618
|
`);
|
|
568
|
-
});
|
|
569
|
-
return rows;
|
|
570
619
|
}
|
|
571
620
|
/**
|
|
572
621
|
* Renders the suggestions dropdown panel itself — only ever rendered
|
|
@@ -782,10 +831,12 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
782
831
|
field.removeAttribute("role");
|
|
783
832
|
field.removeAttribute("aria-expanded");
|
|
784
833
|
field.removeAttribute("aria-controls");
|
|
834
|
+
field.removeAttribute("aria-autocomplete");
|
|
785
835
|
field.removeAttribute("aria-activedescendant");
|
|
786
836
|
return;
|
|
787
837
|
}
|
|
788
838
|
field.setAttribute("role", "combobox");
|
|
839
|
+
field.setAttribute("aria-autocomplete", "list");
|
|
789
840
|
field.setAttribute("aria-expanded", this.isOpen ? "true" : "false");
|
|
790
841
|
field.setAttribute("aria-controls", "listbox");
|
|
791
842
|
if (this.highlightedIndex >= 0) {
|
|
@@ -797,12 +848,14 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
797
848
|
}
|
|
798
849
|
/**
|
|
799
850
|
* Renders the search component: the inherited inline field, or — when
|
|
800
|
-
* `panel` is set — a trigger
|
|
851
|
+
* `panel` is set — a trigger (the `trigger` slot, falling back to a
|
|
852
|
+
* built-in button) plus a `eun-modal[kind=search]`
|
|
801
853
|
* (flush, no padding, no close button) containing the real field (reused
|
|
802
854
|
* via `renderField`, wrapped for its own full-width/no-border styling) and
|
|
803
855
|
* a `results` slot.
|
|
804
856
|
* @returns The rendered HTML template
|
|
805
857
|
*/
|
|
858
|
+
/* eslint-disable lit-a11y/click-events-have-key-events */
|
|
806
859
|
render() {
|
|
807
860
|
if (!this.panel) {
|
|
808
861
|
return super.render();
|
|
@@ -811,31 +864,36 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
811
864
|
return html `
|
|
812
865
|
<div id="wrapper">
|
|
813
866
|
${this.renderFormLabels("search-trigger")}
|
|
814
|
-
<
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
867
|
+
<slot name="trigger" @click=${this.handleTriggerClick}>
|
|
868
|
+
<button
|
|
869
|
+
id="search-trigger"
|
|
870
|
+
part="trigger"
|
|
871
|
+
type="button"
|
|
872
|
+
aria-haspopup="dialog"
|
|
873
|
+
aria-label=${ifDefined(this.label)}
|
|
874
|
+
aria-keyshortcuts=${ifDefined(this.shortcut ? "Control+K Meta+K" : undefined)}
|
|
875
|
+
?disabled=${this.disabled}
|
|
876
|
+
>
|
|
877
|
+
${this.icon
|
|
824
878
|
? html `<eun-icon
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
879
|
+
id="trigger-icon"
|
|
880
|
+
name=${this.icon}
|
|
881
|
+
size="16"
|
|
882
|
+
></eun-icon>`
|
|
829
883
|
: nothing}
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
884
|
+
<span id="trigger-text" class="empty"
|
|
885
|
+
>${this.placeholder || ""}</span
|
|
886
|
+
>
|
|
887
|
+
${this.renderTriggerIndicator()}
|
|
888
|
+
</button>
|
|
889
|
+
</slot>
|
|
833
890
|
<eun-modal
|
|
834
891
|
id="panel"
|
|
835
892
|
kind="search"
|
|
836
893
|
hide-actions
|
|
837
894
|
.closeable=${false}
|
|
838
|
-
aria-label=${this.label ||
|
|
895
|
+
aria-label=${this.label ||
|
|
896
|
+
(this.panelLabel ?? this.dictionary.search.panel)}
|
|
839
897
|
>
|
|
840
898
|
<div id="panel-field">
|
|
841
899
|
${this.renderField(description !== nothing)}
|
|
@@ -858,7 +916,6 @@ let EunomiaSearch = EunomiaSearch_1 = class EunomiaSearch extends AnchorPosition
|
|
|
858
916
|
EunomiaSearch.styles = [
|
|
859
917
|
EunomiaInput.styles,
|
|
860
918
|
listboxStyles,
|
|
861
|
-
// Never shipped to WebKit — see listboxAnchorPositioningStyles's own doc.
|
|
862
919
|
...(isWebKit ? [] : [listboxAnchorPositioningStyles]),
|
|
863
920
|
searchStyles,
|
|
864
921
|
];
|
|
@@ -869,13 +926,13 @@ EunomiaSearch.styles = [
|
|
|
869
926
|
*/
|
|
870
927
|
EunomiaSearch.FIELD_POINTER_DOWN_WINDOW_MS = 100;
|
|
871
928
|
__decorate([
|
|
872
|
-
property({ reflect: true })
|
|
929
|
+
property({ reflect: true, converter: { toAttribute: () => null } })
|
|
873
930
|
], EunomiaSearch.prototype, "type", void 0);
|
|
874
931
|
__decorate([
|
|
875
932
|
property()
|
|
876
933
|
], EunomiaSearch.prototype, "icon", void 0);
|
|
877
934
|
__decorate([
|
|
878
|
-
property({
|
|
935
|
+
property({ converter: defaultTrueConverter })
|
|
879
936
|
], EunomiaSearch.prototype, "clearable", void 0);
|
|
880
937
|
__decorate([
|
|
881
938
|
property({ type: Boolean })
|
|
@@ -884,8 +941,8 @@ __decorate([
|
|
|
884
941
|
property({ type: Boolean })
|
|
885
942
|
], EunomiaSearch.prototype, "panel", void 0);
|
|
886
943
|
__decorate([
|
|
887
|
-
property({ attribute: "
|
|
888
|
-
], EunomiaSearch.prototype, "
|
|
944
|
+
property({ attribute: "panel-label" })
|
|
945
|
+
], EunomiaSearch.prototype, "panelLabel", void 0);
|
|
889
946
|
__decorate([
|
|
890
947
|
property({ type: Boolean, reflect: true })
|
|
891
948
|
], EunomiaSearch.prototype, "loading", void 0);
|
|
@@ -898,6 +955,9 @@ __decorate([
|
|
|
898
955
|
__decorate([
|
|
899
956
|
property({ attribute: "no-results-label" })
|
|
900
957
|
], EunomiaSearch.prototype, "noResultsLabel", void 0);
|
|
958
|
+
__decorate([
|
|
959
|
+
property()
|
|
960
|
+
], EunomiaSearch.prototype, "filter", void 0);
|
|
901
961
|
__decorate([
|
|
902
962
|
state()
|
|
903
963
|
], EunomiaSearch.prototype, "isOpen", void 0);
|
|
@@ -910,6 +970,9 @@ __decorate([
|
|
|
910
970
|
__decorate([
|
|
911
971
|
query("#field-wrapper")
|
|
912
972
|
], EunomiaSearch.prototype, "fieldWrapperEl", void 0);
|
|
973
|
+
__decorate([
|
|
974
|
+
query('slot[name="trigger"]')
|
|
975
|
+
], EunomiaSearch.prototype, "triggerSlot", void 0);
|
|
913
976
|
__decorate([
|
|
914
977
|
query("#search-trigger")
|
|
915
978
|
], EunomiaSearch.prototype, "triggerEl", void 0);
|
|
@@ -6,9 +6,12 @@ import { FormMixinInterface } from "../../../mixins/form.mixin.js";
|
|
|
6
6
|
import { FormLabelMixinInterface } from "../../../mixins/form-label.mixin.js";
|
|
7
7
|
import { EditableMixinInterface } from "../../../mixins/editable.mixin.js";
|
|
8
8
|
import { FieldAppearanceMixinInterface } from "../../../mixins/field-appearance.mixin.js";
|
|
9
|
+
import { RoundedMixinInterface } from "../../../mixins/rounded.mixin.js";
|
|
10
|
+
import { FieldSizeMixinInterface } from "../../../mixins/field-size.mixin.js";
|
|
9
11
|
import { AnchorPositionMixinInterface } from "../../../mixins/anchor-position.mixin.js";
|
|
10
12
|
import { EunomiaIconName } from "../../content/icon/icon.type.js";
|
|
11
13
|
import { Constructor } from "../../../utils/constructor.type.js";
|
|
14
|
+
import { LocalizableMixinInterface } from "../../../mixins/localizable.mixin.js";
|
|
12
15
|
/**
|
|
13
16
|
* Tag name of the select component.
|
|
14
17
|
*/
|
|
@@ -22,7 +25,7 @@ type SelectValue = string | string[];
|
|
|
22
25
|
* Type of the select base used to declare every necessary Mixin interface elements.
|
|
23
26
|
* @internal
|
|
24
27
|
*/
|
|
25
|
-
type EunomiaSelectBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<SelectValue> & FormMixinInterface<SelectValue> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & AnchorPositionMixinInterface;
|
|
28
|
+
type EunomiaSelectBase = LitElement & DisabledMixinInterface & ReadonlyMixinInterface & ValidatorsMixinInterface<SelectValue> & FormMixinInterface<SelectValue> & EditableMixinInterface & FormLabelMixinInterface & FieldAppearanceMixinInterface & RoundedMixinInterface & FieldSizeMixinInterface & AnchorPositionMixinInterface & LocalizableMixinInterface;
|
|
26
29
|
declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
|
|
27
30
|
/**
|
|
28
31
|
* A field that picks one or more values from a list of option and optgroup
|
|
@@ -50,6 +53,8 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
|
|
|
50
53
|
* @prop {boolean} [native=false] - Renders the field as a real select, using the browser's own dropdown instead of the listbox panel. Takes priority over searchable and multiple, neither of which a native dropdown can support
|
|
51
54
|
* @prop {boolean} [multiple=false] - Whether more than one option can be picked at once. Each option then renders a checkbox, and picking one toggles it without closing the dropdown, so value becomes an array of every picked option's value. Ignored while native is set
|
|
52
55
|
* @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
|
|
56
|
+
* @prop {boolean} [rounded=false] - Whether the field is fully rounded, as a pill. A custom border radius still wins over it
|
|
57
|
+
* @prop {'xs' | 's' | 'm' | 'l' | 'xl'} [size='m'] - The field size. A field and a button of the same size share the same height
|
|
53
58
|
* @prop {string} label - The title label of the field, rendered through the label component
|
|
54
59
|
* @prop {string} instructions - Instructions displayed below the label
|
|
55
60
|
* @prop {string} name - The field name
|
|
@@ -60,6 +65,7 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
|
|
|
60
65
|
* @prop {boolean} [readonly=false] - Whether the field is read only
|
|
61
66
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
62
67
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
68
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
63
69
|
* @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
|
|
64
70
|
* @prop {Array<Validators<string | string[]>>} validators - The list of validation rules applied to the field value
|
|
65
71
|
* @prop {EunomiaIconName} icon - An optional leading icon
|
|
@@ -70,10 +76,10 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
|
|
|
70
76
|
* @attr {string} [select-placeholder='Select…'] - The fallback for placeholder when searchable isn't set
|
|
71
77
|
* @prop {boolean} [readonlyAvailable=false] - Whether the field can switch between a static display and an editable one
|
|
72
78
|
* @attr {boolean} [readonly-available=false] - Whether the field can switch between a static display and an editable one
|
|
73
|
-
* @prop {string} [emptyValueLabel
|
|
79
|
+
* @prop {string} [emptyValueLabel] - Text displayed in place of the value when readonly and empty. Defaults to the localized string for the current locale (English: "No value set")
|
|
74
80
|
* @prop {string} [noResultsLabel='No results'] - Text displayed in the dropdown when no option matches the search
|
|
75
|
-
* @prop {string} [confirmLabel
|
|
76
|
-
* @attr {string} [confirm-label
|
|
81
|
+
* @prop {string} [confirmLabel] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely. Defaults to the localized string for the current locale (English: "Confirm")
|
|
82
|
+
* @attr {string} [confirm-label] - The label of the confirm button, shown while editing in readonlyAvailable mode or while multiple and the dropdown is open. Set to an empty string to hide the button entirely. Defaults to the localized string for the current locale (English: "Confirm")
|
|
77
83
|
* @prop {boolean} [noAnimation=false] - Disables the dropdown panel's open and close height transition, on top of the automatic reduced motion handling
|
|
78
84
|
* @prop {boolean} [loading=false] - Whether options are currently being fetched. Shows a spinning loading indicator in place of the dropdown arrow, and a single disabled loading row instead of the option list. Has no effect while native, beyond the arrow swap
|
|
79
85
|
* @prop {string} [loadingLabel='Loading…'] - The accessible label announced by the loading indicator while loading is set
|
|
@@ -102,10 +108,12 @@ declare const EunomiaSelectMixinBase: Constructor<EunomiaSelectBase>;
|
|
|
102
108
|
* @cssprop [--field-confirm-link-color] - Sets the color of the confirm slot's link, while editing in readonlyAvailable mode
|
|
103
109
|
* @cssprop [--field-confirm-link-color-hover] - Sets the hover color of the confirm slot's link
|
|
104
110
|
* @cssprop [--field-listbox-max-height=260px] - Sets the maximum height of the dropdown panel, past which it scrolls
|
|
111
|
+
* @cssprop [--field-listbox-border-radius] - Sets the corner radius of the dropdown panel, independent of the field's own radius
|
|
105
112
|
* @cssprop [--field-listbox-transition-duration=200ms] - Sets the duration of the dropdown panel's open and close height transition, disabled entirely by the no-animation attribute or reduced motion settings
|
|
106
113
|
* @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. Set on the root or an ancestor rather than on the field itself
|
|
107
114
|
* @cssprop [--eun-viewport-inset-bottom] - The same as eun-viewport-inset-top, reserved at the bottom of the viewport, such as for a sticky footer
|
|
108
115
|
* @cssprop [--field-font-size] - Sets the font size of the field's value and placeholder
|
|
116
|
+
* @cssprop [--field-line-height] - Sets the line height of the field's value and placeholder
|
|
109
117
|
* @cssprop [--field-label-font-size] - Sets the font size of the label
|
|
110
118
|
* @cssprop [--field-message-font-size] - Sets the font size of the hint, error messages and instructions
|
|
111
119
|
* @element eun-select
|
|
@@ -119,6 +127,11 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
|
|
|
119
127
|
* @readonly
|
|
120
128
|
*/
|
|
121
129
|
static readonly styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
|
|
130
|
+
/**
|
|
131
|
+
* Every change is a complete choice, so its error shows right away.
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
errorOnChange: boolean;
|
|
122
135
|
/**
|
|
123
136
|
* The default value applied on connection and form reset. Overrides the
|
|
124
137
|
* `defaultValue` accessor inherited from `FormMixin` only to drop its
|
|
@@ -215,9 +228,9 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
|
|
|
215
228
|
selectPlaceholder: string;
|
|
216
229
|
/**
|
|
217
230
|
* Text displayed in place of the value when readonly and empty.
|
|
218
|
-
*
|
|
231
|
+
* Falls back to the localized string for the current locale when unset.
|
|
219
232
|
*/
|
|
220
|
-
emptyValueLabel
|
|
233
|
+
emptyValueLabel?: string;
|
|
221
234
|
/**
|
|
222
235
|
* Text displayed in the dropdown when no option matches the search.
|
|
223
236
|
* @default No results
|
|
@@ -231,9 +244,9 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
|
|
|
231
244
|
* Set to an empty string to hide the button entirely — e.g. for a
|
|
232
245
|
* `readonlyAvailable` field where picking an option is already confirmation
|
|
233
246
|
* enough on its own, and the extra button would just be clutter.
|
|
234
|
-
*
|
|
247
|
+
* Falls back to the localized string for the current locale when unset.
|
|
235
248
|
*/
|
|
236
|
-
confirmLabel
|
|
249
|
+
confirmLabel?: string;
|
|
237
250
|
/**
|
|
238
251
|
* Indicates whether options are currently being fetched (e.g. a
|
|
239
252
|
* server-filtered `searchable` field). Shows a spinning `eun-loader` in
|
|
@@ -483,6 +496,12 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
|
|
|
483
496
|
* @param _changedProperties - Map of changed properties
|
|
484
497
|
*/
|
|
485
498
|
protected updated(_changedProperties: PropertyValues): void;
|
|
499
|
+
/**
|
|
500
|
+
* The host is never a tab stop of its own : sequential navigation goes
|
|
501
|
+
* straight to the controls inside, in both directions, and
|
|
502
|
+
* {@link focus} covers a direct call on the host.
|
|
503
|
+
*/
|
|
504
|
+
protected get hostTabStop(): boolean;
|
|
486
505
|
/**
|
|
487
506
|
* Returns the field element to focus/anchor on validation errors.
|
|
488
507
|
*
|
|
@@ -707,8 +726,8 @@ export declare class EunomiaSelect extends EunomiaSelectMixinBase {
|
|
|
707
726
|
*/
|
|
708
727
|
private renderHighlighted;
|
|
709
728
|
/**
|
|
710
|
-
* Renders the dropdown's option rows,
|
|
711
|
-
*
|
|
729
|
+
* Renders the dropdown's option rows, grouped under their `optgroup`
|
|
730
|
+
* label (see {@link renderListboxRows}).
|
|
712
731
|
*
|
|
713
732
|
* @param options the options to render, already filtered.
|
|
714
733
|
* @returns the rendered rows.
|