@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.7
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-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-3PNGQEG4.js} +3 -3
- 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-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-BVASCT2V.js +109 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-DGI7TKCU.js} +14 -9
- 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-MOMYII3P.js → chunk-LVKMAHMU.js} +10 -0
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-PXF554MD.js} +1 -1
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.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-WW4BTWMH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-Z3OFIE7S.js} +1 -1
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +3 -3
- 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 +21 -18
- 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 +3 -3
- package/dist/cdn/components/eun-color-picker.js +60 -68
- package/dist/cdn/components/eun-counter.js +10 -10
- package/dist/cdn/components/eun-date-picker.js +47 -46
- 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 +5 -5
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- 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 +10 -9
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +2 -2
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +13 -13
- 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 +10 -10
- 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 +19 -21
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +10 -8
- 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 +25 -25
- 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.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +1 -1
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +39 -34
- package/dist/cdn/components/eun-time-picker.js +15 -14
- package/dist/cdn/components/eun-toast.js +19 -10
- package/dist/cdn/components/eun-toggle-group.js +6 -4
- package/dist/cdn/components/eun-toggle-item.js +1 -1
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +5 -5
- package/dist/cdn/components/eun-tooltip.js +3 -3
- package/dist/components/action/button/button.d.ts +2 -1
- package/dist/components/action/button/button.js +3 -2
- package/dist/components/action/button/button.styles.js +10 -5
- package/dist/components/action/dropdown-button/dropdown-button.js +10 -5
- package/dist/components/action/toggle/toggle-group.js +1 -1
- package/dist/components/action/toggle/toggle-group.styles.js +4 -2
- 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 +5 -5
- package/dist/components/alert/drawer/drawer.js +8 -12
- package/dist/components/alert/drawer/drawer.styles.js +1 -1
- package/dist/components/alert/modal/modal.d.ts +10 -10
- package/dist/components/alert/modal/modal.js +13 -25
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +9 -13
- package/dist/components/alert/toast/toast.styles.js +15 -6
- 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 +8 -8
- 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 +24 -24
- 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.js +3 -3
- 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 +41 -28
- package/dist/components/form/color-picker/color-picker.js +66 -50
- package/dist/components/form/color-picker/color-picker.styles.js +1 -1
- package/dist/components/form/counter/counter.d.ts +22 -18
- package/dist/components/form/counter/counter.js +59 -61
- package/dist/components/form/date-picker/date-picker.d.ts +27 -6
- package/dist/components/form/date-picker/date-picker.js +75 -54
- package/dist/components/form/input/input.d.ts +38 -39
- package/dist/components/form/input/input.js +85 -109
- 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 +22 -5
- package/dist/components/form/input-phone/input-phone.js +41 -13
- 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 +8 -8
- package/dist/components/form/search/search.js +23 -41
- package/dist/components/form/select/select.d.ts +23 -10
- package/dist/components/form/select/select.js +59 -41
- package/dist/components/form/shared-styles/listbox.styles.js +10 -0
- 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 +89 -23
- package/dist/components/form/textarea/textarea.js +192 -43
- 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 +24 -8
- package/dist/components/form/time-picker/time-picker.js +59 -38
- package/dist/components/layout/animate/animate.js +1 -1
- 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 +31 -7
- package/dist/components/navigation/carousel/carousel.js +74 -35
- package/dist/components/navigation/carousel/carousel.styles.js +5 -2
- 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 +15 -13
- package/dist/components/navigation/sidebar/sidebar.js +21 -33
- package/dist/components/navigation/sidebar/sidebar.styles.js +5 -3
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.js +12 -5
- 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 +13 -13
- package/dist/components/navigation/toolbar/toolbar.js +20 -34
- 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 +6 -7
- 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 +2 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.js +3 -2
- package/dist/mixins/check.mixin.js +11 -10
- 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/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/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/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +238 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +242 -0
- package/dist/ssr/collapse-ssr.css +151 -0
- package/dist/ssr/field-ssr.css +163 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +24 -0
- package/dist/ssr/links-ssr.css +7 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +9 -1
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +182 -0
- package/dist/ssr/toolbar-ssr.css +31 -2
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/package.json +26 -7
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.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-VOTRXBDS.js +0 -38
|
@@ -58,14 +58,14 @@ export const EunomiaImageCarouselTagName = "eun-image-carousel";
|
|
|
58
58
|
* @prop {number} [autoplayInterval=4000] - Milliseconds between each autoplay advance
|
|
59
59
|
* @attr {number} [autoplay-interval=4000] - Milliseconds between each autoplay advance
|
|
60
60
|
* @attr {string} aria-label - The accessible name for the main stage. Defaults to the localized string for the current locale (English: "Image gallery")
|
|
61
|
-
* @prop {string} [
|
|
62
|
-
* @attr {string} [
|
|
63
|
-
* @prop {string} [
|
|
64
|
-
* @attr {string} [
|
|
65
|
-
* @prop {string} [
|
|
66
|
-
* @attr {string} [
|
|
67
|
-
* @prop {string} [
|
|
68
|
-
* @attr {string} [
|
|
61
|
+
* @prop {string} [previousLabel] - The accessible label of the previous controls, on both the main stage and the lightbox. Defaults to the localized string for the current locale (English: "Previous image")
|
|
62
|
+
* @attr {string} [previous-label] - The accessible label of the previous controls, on both the main stage and the lightbox. Defaults to the localized string for the current locale (English: "Previous image")
|
|
63
|
+
* @prop {string} [nextLabel] - The accessible label of the next controls, on both the main stage and the lightbox. Defaults to the localized string for the current locale (English: "Next image")
|
|
64
|
+
* @attr {string} [next-label] - The accessible label of the next controls, on both the main stage and the lightbox. Defaults to the localized string for the current locale (English: "Next image")
|
|
65
|
+
* @prop {string} [expandLabel] - The accessible label of the main stage's expand control. Defaults to the localized string for the current locale (English: "View full-size image")
|
|
66
|
+
* @attr {string} [expand-label] - The accessible label of the main stage's expand control. Defaults to the localized string for the current locale (English: "View full-size image")
|
|
67
|
+
* @prop {string} [lightboxLabel] - The accessible name of the lightbox dialog. Defaults to the localized string for the current locale (English: "Image viewer")
|
|
68
|
+
* @attr {string} [lightbox-label] - The accessible name of the lightbox dialog. Defaults to the localized string for the current locale (English: "Image viewer")
|
|
69
69
|
* @fires {ImageChangeEvent} eunimagechange - Fired whenever the active image changes, from either the main stage or the lightbox
|
|
70
70
|
* @cssprop [--image-carousel-aspect-ratio] - Sets the aspect ratio of the main stage
|
|
71
71
|
* @cssprop [--image-carousel-object-fit] - Sets how the main image fits its box
|
|
@@ -968,7 +968,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
968
968
|
type="button"
|
|
969
969
|
id="expand-trigger"
|
|
970
970
|
aria-haspopup="dialog"
|
|
971
|
-
aria-label="${this.
|
|
971
|
+
aria-label="${this.expandLabel ??
|
|
972
972
|
this.dictionary.imageCarousel.expand} (${this.activeIndex +
|
|
973
973
|
1}/${count})"
|
|
974
974
|
@click=${this.handleExpandClick}
|
|
@@ -990,7 +990,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
990
990
|
type="button"
|
|
991
991
|
class="stage-nav"
|
|
992
992
|
id="prev"
|
|
993
|
-
aria-label=${this.
|
|
993
|
+
aria-label=${this.previousLabel ??
|
|
994
994
|
this.dictionary.imageCarousel.previous}
|
|
995
995
|
?disabled=${disablePrev}
|
|
996
996
|
@click=${() => this.previous()}
|
|
@@ -1001,7 +1001,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1001
1001
|
type="button"
|
|
1002
1002
|
class="stage-nav"
|
|
1003
1003
|
id="next"
|
|
1004
|
-
aria-label=${this.
|
|
1004
|
+
aria-label=${this.nextLabel ?? this.dictionary.imageCarousel.next}
|
|
1005
1005
|
?disabled=${disableNext}
|
|
1006
1006
|
@click=${() => this.next()}
|
|
1007
1007
|
>
|
|
@@ -1097,7 +1097,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1097
1097
|
<eun-modal
|
|
1098
1098
|
id="modal"
|
|
1099
1099
|
hide-actions
|
|
1100
|
-
aria-label=${this.
|
|
1100
|
+
aria-label=${this.lightboxLabel ??
|
|
1101
1101
|
this.dictionary.imageCarousel.lightbox}
|
|
1102
1102
|
@euncancel=${() => this.handleTransientResume()}
|
|
1103
1103
|
>
|
|
@@ -1133,7 +1133,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1133
1133
|
type="button"
|
|
1134
1134
|
class="lightbox-nav"
|
|
1135
1135
|
id="lightbox-prev"
|
|
1136
|
-
aria-label=${this.
|
|
1136
|
+
aria-label=${this.previousLabel ??
|
|
1137
1137
|
this.dictionary.imageCarousel.previous}
|
|
1138
1138
|
?disabled=${!this.loop && this.activeIndex <= 0}
|
|
1139
1139
|
@click=${() => this.previous()}
|
|
@@ -1144,7 +1144,7 @@ let EunomiaImageCarousel = EunomiaImageCarousel_1 = class EunomiaImageCarousel e
|
|
|
1144
1144
|
type="button"
|
|
1145
1145
|
class="lightbox-nav"
|
|
1146
1146
|
id="lightbox-next"
|
|
1147
|
-
aria-label=${this.
|
|
1147
|
+
aria-label=${this.nextLabel ??
|
|
1148
1148
|
this.dictionary.imageCarousel.next}
|
|
1149
1149
|
?disabled=${!this.loop && this.activeIndex >= count - 1}
|
|
1150
1150
|
@click=${() => this.next()}
|
|
@@ -1248,7 +1248,7 @@ EunomiaImageCarousel.SWIPE_THRESHOLD = 40;
|
|
|
1248
1248
|
*/
|
|
1249
1249
|
EunomiaImageCarousel.EDGE_RESISTANCE = 0.3;
|
|
1250
1250
|
__decorate([
|
|
1251
|
-
property({ type: Array, reflect: true })
|
|
1251
|
+
property({ type: Array, reflect: true, useDefault: true })
|
|
1252
1252
|
], EunomiaImageCarousel.prototype, "images", void 0);
|
|
1253
1253
|
__decorate([
|
|
1254
1254
|
property({ type: Number, attribute: "active-index" })
|
|
@@ -1275,7 +1275,7 @@ __decorate([
|
|
|
1275
1275
|
property({ type: Boolean })
|
|
1276
1276
|
], EunomiaImageCarousel.prototype, "loop", void 0);
|
|
1277
1277
|
__decorate([
|
|
1278
|
-
property({ reflect: true })
|
|
1278
|
+
property({ reflect: true, useDefault: true })
|
|
1279
1279
|
], EunomiaImageCarousel.prototype, "transition", void 0);
|
|
1280
1280
|
__decorate([
|
|
1281
1281
|
property({ type: Boolean })
|
|
@@ -1284,17 +1284,17 @@ __decorate([
|
|
|
1284
1284
|
property({ type: Number, attribute: "autoplay-interval" })
|
|
1285
1285
|
], EunomiaImageCarousel.prototype, "autoplayInterval", void 0);
|
|
1286
1286
|
__decorate([
|
|
1287
|
-
property({ attribute: "
|
|
1288
|
-
], EunomiaImageCarousel.prototype, "
|
|
1287
|
+
property({ attribute: "previous-label" })
|
|
1288
|
+
], EunomiaImageCarousel.prototype, "previousLabel", void 0);
|
|
1289
1289
|
__decorate([
|
|
1290
|
-
property({ attribute: "
|
|
1291
|
-
], EunomiaImageCarousel.prototype, "
|
|
1290
|
+
property({ attribute: "next-label" })
|
|
1291
|
+
], EunomiaImageCarousel.prototype, "nextLabel", void 0);
|
|
1292
1292
|
__decorate([
|
|
1293
|
-
property({ attribute: "
|
|
1294
|
-
], EunomiaImageCarousel.prototype, "
|
|
1293
|
+
property({ attribute: "expand-label" })
|
|
1294
|
+
], EunomiaImageCarousel.prototype, "expandLabel", void 0);
|
|
1295
1295
|
__decorate([
|
|
1296
|
-
property({ attribute: "
|
|
1297
|
-
], EunomiaImageCarousel.prototype, "
|
|
1296
|
+
property({ attribute: "lightbox-label" })
|
|
1297
|
+
], EunomiaImageCarousel.prototype, "lightboxLabel", void 0);
|
|
1298
1298
|
__decorate([
|
|
1299
1299
|
state()
|
|
1300
1300
|
], EunomiaImageCarousel.prototype, "announcement", void 0);
|
|
@@ -4,6 +4,7 @@ import { PasswordStrengthLevel, PasswordStrengthRule } from "./password-strength
|
|
|
4
4
|
* Tag name of the password strength component.
|
|
5
5
|
*/
|
|
6
6
|
export declare const EunomiaPasswordStrengthTagName = "eun-password-strength";
|
|
7
|
+
declare const EunomiaPasswordStrength_base: import("../../../utils/constructor.type.js").Constructor<import("../../../mixins/localizable.mixin.js").LocalizableMixinInterface> & typeof LitElement;
|
|
7
8
|
/**
|
|
8
9
|
* A visual and assistive technology indicator of how well a password
|
|
9
10
|
* satisfies a set of configurable requirements, graded into levels,
|
|
@@ -21,9 +22,10 @@ export declare const EunomiaPasswordStrengthTagName = "eun-password-strength";
|
|
|
21
22
|
* escape hatch for a level that needs a specific pattern instead.
|
|
22
23
|
*
|
|
23
24
|
* @prop {string} [value=''] - The password to grade
|
|
24
|
-
* @prop {string} [label
|
|
25
|
+
* @prop {string} [label] - A static caption shown next to the current level's name, and used to prefix the message announced to screen readers on every level change. Defaults to the localized string for the current locale (English: "Password strength")
|
|
25
26
|
* @prop {Array<import('./password-strength.type.js').PasswordStrengthRule>} [rules] - The shared pool of requirements levels are scored against by default. Four by default: eight or more characters, upper and lower case, one number, and one special character
|
|
26
|
-
* @prop {Array<import('./password-strength.type.js').PasswordStrengthLevel>} [levels] - The levels to render, ordered from weakest to strongest. Four by default: Weak, Fair, Good, and Strong
|
|
27
|
+
* @prop {Array<import('./password-strength.type.js').PasswordStrengthLevel>} [levels] - The levels to render, ordered from weakest to strongest. Four by default: Weak, Fair, Good, and Strong, named in the current locale
|
|
28
|
+
* @prop {string} [locale] - The locale used to resolve the default caption and level names. Defaults to the shared default locale
|
|
27
29
|
* @prop {boolean} [hideLabel=false] - Hides the always-visible caption and level name. The level name is still announced to screen readers on every change either way
|
|
28
30
|
* @attr {boolean} [hide-label=false] - Hides the always-visible caption and level name
|
|
29
31
|
* @cssprop [--password-strength-gap] - Sets the gap between the segment row and the label
|
|
@@ -42,7 +44,7 @@ export declare const EunomiaPasswordStrengthTagName = "eun-password-strength";
|
|
|
42
44
|
* @cssprop [--password-strength-level-font-weight] - Sets the font weight of the level name
|
|
43
45
|
* @element eun-password-strength
|
|
44
46
|
*/
|
|
45
|
-
export declare class EunomiaPasswordStrength extends
|
|
47
|
+
export declare class EunomiaPasswordStrength extends EunomiaPasswordStrength_base {
|
|
46
48
|
/**
|
|
47
49
|
* Styles to import to the component.
|
|
48
50
|
*
|
|
@@ -59,10 +61,10 @@ export declare class EunomiaPasswordStrength extends LitElement {
|
|
|
59
61
|
/**
|
|
60
62
|
* Static caption shown next to the current level's name, and used to
|
|
61
63
|
* prefix the message announced to screen readers on every level change
|
|
62
|
-
* (e.g. "Password strength: Fair").
|
|
63
|
-
*
|
|
64
|
+
* (e.g. "Password strength: Fair"). Falls back to the localized string
|
|
65
|
+
* for the current locale when unset.
|
|
64
66
|
*/
|
|
65
|
-
label
|
|
67
|
+
label?: string;
|
|
66
68
|
/**
|
|
67
69
|
* The shared pool of regex-based requirements levels are scored against
|
|
68
70
|
* by default (see {@link PasswordStrengthLevel.minScore}). A JS-only
|
|
@@ -107,6 +109,18 @@ export declare class EunomiaPasswordStrength extends LitElement {
|
|
|
107
109
|
* @internal
|
|
108
110
|
*/
|
|
109
111
|
private get currentLevelIndex();
|
|
112
|
+
/**
|
|
113
|
+
* {@link levels}, with the default levels named in the current locale.
|
|
114
|
+
* Custom levels are returned as is.
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
private get resolvedLevels();
|
|
118
|
+
/**
|
|
119
|
+
* {@link label} or its localized fallback, punctuated for the current
|
|
120
|
+
* locale (e.g. "Password strength:").
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
123
|
+
private get caption();
|
|
110
124
|
/**
|
|
111
125
|
* Lifecycle hook called whenever reactive properties change. Speaks the
|
|
112
126
|
* newly-reached level through {@link announcerEl} whenever it actually
|
|
@@ -122,3 +136,4 @@ declare global {
|
|
|
122
136
|
[EunomiaPasswordStrengthTagName]: EunomiaPasswordStrength;
|
|
123
137
|
}
|
|
124
138
|
}
|
|
139
|
+
export {};
|
|
@@ -10,6 +10,7 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
10
10
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
11
11
|
import { passwordStrengthStyles } from "./password-strength.styles.js";
|
|
12
12
|
import { DEFAULT_PASSWORD_STRENGTH_LEVELS, DEFAULT_PASSWORD_STRENGTH_RULES, getPasswordStrengthLevelIndex, } from "./password-strength.type.js";
|
|
13
|
+
import { LocalizableMixin } from "../../../mixins/localizable.mixin.js";
|
|
13
14
|
/**
|
|
14
15
|
* Tag name of the password strength component.
|
|
15
16
|
*/
|
|
@@ -31,9 +32,10 @@ export const EunomiaPasswordStrengthTagName = "eun-password-strength";
|
|
|
31
32
|
* escape hatch for a level that needs a specific pattern instead.
|
|
32
33
|
*
|
|
33
34
|
* @prop {string} [value=''] - The password to grade
|
|
34
|
-
* @prop {string} [label
|
|
35
|
+
* @prop {string} [label] - A static caption shown next to the current level's name, and used to prefix the message announced to screen readers on every level change. Defaults to the localized string for the current locale (English: "Password strength")
|
|
35
36
|
* @prop {Array<import('./password-strength.type.js').PasswordStrengthRule>} [rules] - The shared pool of requirements levels are scored against by default. Four by default: eight or more characters, upper and lower case, one number, and one special character
|
|
36
|
-
* @prop {Array<import('./password-strength.type.js').PasswordStrengthLevel>} [levels] - The levels to render, ordered from weakest to strongest. Four by default: Weak, Fair, Good, and Strong
|
|
37
|
+
* @prop {Array<import('./password-strength.type.js').PasswordStrengthLevel>} [levels] - The levels to render, ordered from weakest to strongest. Four by default: Weak, Fair, Good, and Strong, named in the current locale
|
|
38
|
+
* @prop {string} [locale] - The locale used to resolve the default caption and level names. Defaults to the shared default locale
|
|
37
39
|
* @prop {boolean} [hideLabel=false] - Hides the always-visible caption and level name. The level name is still announced to screen readers on every change either way
|
|
38
40
|
* @attr {boolean} [hide-label=false] - Hides the always-visible caption and level name
|
|
39
41
|
* @cssprop [--password-strength-gap] - Sets the gap between the segment row and the label
|
|
@@ -52,7 +54,7 @@ export const EunomiaPasswordStrengthTagName = "eun-password-strength";
|
|
|
52
54
|
* @cssprop [--password-strength-level-font-weight] - Sets the font weight of the level name
|
|
53
55
|
* @element eun-password-strength
|
|
54
56
|
*/
|
|
55
|
-
let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LitElement {
|
|
57
|
+
let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LocalizableMixin(LitElement) {
|
|
56
58
|
constructor() {
|
|
57
59
|
super(...arguments);
|
|
58
60
|
/**
|
|
@@ -60,13 +62,6 @@ let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LitElement {
|
|
|
60
62
|
* @default ''
|
|
61
63
|
*/
|
|
62
64
|
this.value = "";
|
|
63
|
-
/**
|
|
64
|
-
* Static caption shown next to the current level's name, and used to
|
|
65
|
-
* prefix the message announced to screen readers on every level change
|
|
66
|
-
* (e.g. "Password strength: Fair").
|
|
67
|
-
* @default Password strength
|
|
68
|
-
*/
|
|
69
|
-
this.label = "Password strength";
|
|
70
65
|
/**
|
|
71
66
|
* The shared pool of regex-based requirements levels are scored against
|
|
72
67
|
* by default (see {@link PasswordStrengthLevel.minScore}). A JS-only
|
|
@@ -106,6 +101,30 @@ let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LitElement {
|
|
|
106
101
|
get currentLevelIndex() {
|
|
107
102
|
return getPasswordStrengthLevelIndex(this.value, this.rules, this.levels);
|
|
108
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* {@link levels}, with the default levels named in the current locale.
|
|
106
|
+
* Custom levels are returned as is.
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
get resolvedLevels() {
|
|
110
|
+
if (this.levels !== DEFAULT_PASSWORD_STRENGTH_LEVELS) {
|
|
111
|
+
return this.levels;
|
|
112
|
+
}
|
|
113
|
+
const names = this.dictionary.passwordStrength.levels;
|
|
114
|
+
return this.levels.map((level, index) => ({
|
|
115
|
+
...level,
|
|
116
|
+
label: names[index] ?? level.label,
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* {@link label} or its localized fallback, punctuated for the current
|
|
121
|
+
* locale (e.g. "Password strength:").
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
get caption() {
|
|
125
|
+
const { passwordStrength } = this.dictionary;
|
|
126
|
+
return passwordStrength.caption(this.label ?? passwordStrength.label);
|
|
127
|
+
}
|
|
109
128
|
/**
|
|
110
129
|
* Lifecycle hook called whenever reactive properties change. Speaks the
|
|
111
130
|
* newly-reached level through {@link announcerEl} whenever it actually
|
|
@@ -127,12 +146,14 @@ let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LitElement {
|
|
|
127
146
|
this.previousLevelIndex = index;
|
|
128
147
|
if (this.announcerEl) {
|
|
129
148
|
this.announcerEl.textContent =
|
|
130
|
-
index === -1
|
|
149
|
+
index === -1
|
|
150
|
+
? ""
|
|
151
|
+
: `${this.caption} ${this.resolvedLevels[index].label}`;
|
|
131
152
|
}
|
|
132
153
|
}
|
|
133
154
|
render() {
|
|
134
155
|
const index = this.currentLevelIndex;
|
|
135
|
-
const level = index === -1 ? undefined : this.
|
|
156
|
+
const level = index === -1 ? undefined : this.resolvedLevels[index];
|
|
136
157
|
return html `
|
|
137
158
|
<div id="wrapper" data-severity=${ifDefined(level?.severity)}>
|
|
138
159
|
<div id="segments" role="presentation" aria-hidden="true">
|
|
@@ -145,12 +166,12 @@ let EunomiaPasswordStrength = class EunomiaPasswordStrength extends LitElement {
|
|
|
145
166
|
></span>
|
|
146
167
|
`)}
|
|
147
168
|
</div>
|
|
148
|
-
${this.hideLabel
|
|
169
|
+
${this.hideLabel
|
|
149
170
|
? nothing
|
|
150
171
|
: html `
|
|
151
|
-
<span id="label">
|
|
152
|
-
<span id="caption">${this.
|
|
153
|
-
<span id="level-name">${level
|
|
172
|
+
<span id="label" class=${classMap({ empty: !level })}>
|
|
173
|
+
<span id="caption">${this.caption}</span>
|
|
174
|
+
<span id="level-name">${level?.label ?? "\u00A0"}</span>
|
|
154
175
|
</span>
|
|
155
176
|
`}
|
|
156
177
|
</div>
|
|
@@ -167,13 +167,13 @@ let EunomiaTag = class EunomiaTag extends LitElement {
|
|
|
167
167
|
*/
|
|
168
168
|
EunomiaTag.styles = tagStyles;
|
|
169
169
|
__decorate([
|
|
170
|
-
property({ reflect: true })
|
|
170
|
+
property({ reflect: true, useDefault: true })
|
|
171
171
|
], EunomiaTag.prototype, "color", void 0);
|
|
172
172
|
__decorate([
|
|
173
173
|
property({ reflect: true })
|
|
174
174
|
], EunomiaTag.prototype, "severity", void 0);
|
|
175
175
|
__decorate([
|
|
176
|
-
property({ reflect: true })
|
|
176
|
+
property({ reflect: true, useDefault: true })
|
|
177
177
|
], EunomiaTag.prototype, "appearance", void 0);
|
|
178
178
|
__decorate([
|
|
179
179
|
property()
|
|
@@ -1167,16 +1167,16 @@ __decorate([
|
|
|
1167
1167
|
property({ reflect: true })
|
|
1168
1168
|
], EunomiaTooltip.prototype, "severity", void 0);
|
|
1169
1169
|
__decorate([
|
|
1170
|
-
property({ reflect: true })
|
|
1170
|
+
property({ reflect: true, useDefault: true })
|
|
1171
1171
|
], EunomiaTooltip.prototype, "color", void 0);
|
|
1172
1172
|
__decorate([
|
|
1173
|
-
property({ reflect: true })
|
|
1173
|
+
property({ reflect: true, useDefault: true })
|
|
1174
1174
|
], EunomiaTooltip.prototype, "appearance", void 0);
|
|
1175
1175
|
__decorate([
|
|
1176
1176
|
property({ type: Boolean, reflect: true, attribute: "fixed-color" })
|
|
1177
1177
|
], EunomiaTooltip.prototype, "fixedColor", void 0);
|
|
1178
1178
|
__decorate([
|
|
1179
|
-
property({ reflect: true })
|
|
1179
|
+
property({ reflect: true, useDefault: true })
|
|
1180
1180
|
], EunomiaTooltip.prototype, "placement", void 0);
|
|
1181
1181
|
__decorate([
|
|
1182
1182
|
property()
|
|
@@ -25,6 +25,7 @@ export declare const EunomiaCheckCardTagName = "eun-check-card";
|
|
|
25
25
|
* @prop {boolean} [readonly=false] - Whether the card is read only
|
|
26
26
|
* @prop {boolean} [indeterminate=false] - Whether the card value is indeterminate
|
|
27
27
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
28
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
28
29
|
* @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
|
|
29
30
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden
|
|
30
31
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -36,6 +36,7 @@ export const EunomiaCheckCardTagName = "eun-check-card";
|
|
|
36
36
|
* @prop {boolean} [readonly=false] - Whether the card is read only
|
|
37
37
|
* @prop {boolean} [indeterminate=false] - Whether the card value is indeterminate
|
|
38
38
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
39
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
39
40
|
* @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
|
|
40
41
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden
|
|
41
42
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -30,6 +30,7 @@ declare const EunomiaCheckboxList_base: import("../../../utils/constructor.type.
|
|
|
30
30
|
* @prop {string[]} [defaultValue] - The default selected values
|
|
31
31
|
* @attr {string} [default-value] - The default selected values, as a comma-separated string
|
|
32
32
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
33
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
33
34
|
* @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
|
|
34
35
|
* @attr {boolean} [hide-error=false] - Whether the errors are hidden
|
|
35
36
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<string[]>>} validators - A list of validation rules applied to the group's selected values
|
|
@@ -50,6 +51,11 @@ export declare class EunomiaCheckboxList extends EunomiaCheckboxList_base {
|
|
|
50
51
|
* @readonly
|
|
51
52
|
*/
|
|
52
53
|
static readonly styles: import("lit").CSSResult[];
|
|
54
|
+
/**
|
|
55
|
+
* Every change is a complete choice, so its error shows right away.
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
errorOnChange: boolean;
|
|
53
59
|
/**
|
|
54
60
|
* Configuration options for the component Shadow DOM
|
|
55
61
|
* @internal
|
|
@@ -94,6 +100,17 @@ export declare class EunomiaCheckboxList extends EunomiaCheckboxList_base {
|
|
|
94
100
|
* Cleans up event listeners.
|
|
95
101
|
*/
|
|
96
102
|
disconnectedCallback(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the group's own `disabled`/`readonly` changed in a way to pass
|
|
105
|
+
* on to every child : always once set, but not for the initial `false`,
|
|
106
|
+
* which would otherwise re-enable a child disabled on its own.
|
|
107
|
+
*
|
|
108
|
+
* @param changed - The changed properties of the update.
|
|
109
|
+
* @param name - The property to check.
|
|
110
|
+
* @returns true when the children should take the group's value.
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
113
|
+
private isGroupChange;
|
|
97
114
|
/**
|
|
98
115
|
* Lifecycle hook called whenever reactive properties change.
|
|
99
116
|
* @param _changedProperties - Map of changed properties
|
|
@@ -5,8 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { customElement, property, query } from "lit/decorators.js";
|
|
8
|
-
import { html, LitElement } from "lit";
|
|
8
|
+
import { html, LitElement, nothing } from "lit";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
11
|
import { FormLabelMixin } from "../../../mixins/form-label.mixin.js";
|
|
11
12
|
import { FormMixin, hasErrorDisplayChange, } from "../../../mixins/form.mixin.js";
|
|
12
13
|
import { DisabledMixin } from "../../../mixins/disabled.mixin.js";
|
|
@@ -79,6 +80,7 @@ const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
|
79
80
|
* @prop {string[]} [defaultValue] - The default selected values
|
|
80
81
|
* @attr {string} [default-value] - The default selected values, as a comma-separated string
|
|
81
82
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
83
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
82
84
|
* @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
|
|
83
85
|
* @attr {boolean} [hide-error=false] - Whether the errors are hidden
|
|
84
86
|
* @prop {Array<import('../../../types/form-validators.type.js').Validators<string[]>>} validators - A list of validation rules applied to the group's selected values
|
|
@@ -93,6 +95,11 @@ const Base = DisabledMixin(ValidatorsMixin(LitElement));
|
|
|
93
95
|
let EunomiaCheckboxList = class EunomiaCheckboxList extends FormLabelMixin(ReadonlyMixin(FormMixin(Base))) {
|
|
94
96
|
constructor() {
|
|
95
97
|
super(...arguments);
|
|
98
|
+
/**
|
|
99
|
+
* Every change is a complete choice, so its error shows right away.
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
this.errorOnChange = true;
|
|
96
103
|
/**
|
|
97
104
|
* Indicates whether the elements into the list should be displayed inline.
|
|
98
105
|
* @default false
|
|
@@ -159,18 +166,31 @@ let EunomiaCheckboxList = class EunomiaCheckboxList extends FormLabelMixin(Reado
|
|
|
159
166
|
this.optionsList?.removeEventListener("eunchange", this.handleChangeEvent);
|
|
160
167
|
super.disconnectedCallback?.();
|
|
161
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Whether the group's own `disabled`/`readonly` changed in a way to pass
|
|
171
|
+
* on to every child : always once set, but not for the initial `false`,
|
|
172
|
+
* which would otherwise re-enable a child disabled on its own.
|
|
173
|
+
*
|
|
174
|
+
* @param changed - The changed properties of the update.
|
|
175
|
+
* @param name - The property to check.
|
|
176
|
+
* @returns true when the children should take the group's value.
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
isGroupChange(changed, name) {
|
|
180
|
+
return changed.has(name) && (this[name] || changed.get(name) !== undefined);
|
|
181
|
+
}
|
|
162
182
|
/**
|
|
163
183
|
* Lifecycle hook called whenever reactive properties change.
|
|
164
184
|
* @param _changedProperties - Map of changed properties
|
|
165
185
|
*/
|
|
166
186
|
updated(_changedProperties) {
|
|
167
187
|
super.updated(_changedProperties);
|
|
168
|
-
if (
|
|
188
|
+
if (this.isGroupChange(_changedProperties, "disabled")) {
|
|
169
189
|
this.fields.forEach((field) => {
|
|
170
190
|
field.disabled = this.disabled;
|
|
171
191
|
});
|
|
172
192
|
}
|
|
173
|
-
if (
|
|
193
|
+
if (this.isGroupChange(_changedProperties, "readonly")) {
|
|
174
194
|
this.fields.forEach((field) => {
|
|
175
195
|
field.readonly = this.readonly;
|
|
176
196
|
});
|
|
@@ -182,9 +202,6 @@ let EunomiaCheckboxList = class EunomiaCheckboxList extends FormLabelMixin(Reado
|
|
|
182
202
|
field.validationRequested = showError;
|
|
183
203
|
});
|
|
184
204
|
}
|
|
185
|
-
if (_changedProperties.has("label") && !this.hasAttribute("aria-label")) {
|
|
186
|
-
this.setAttribute("aria-label", `${this.label}. ${this.instructions ?? ""}`);
|
|
187
|
-
}
|
|
188
205
|
if (_changedProperties.has("name")) {
|
|
189
206
|
this.fields.forEach((field) => {
|
|
190
207
|
field.name = this.name;
|
|
@@ -241,22 +258,34 @@ let EunomiaCheckboxList = class EunomiaCheckboxList extends FormLabelMixin(Reado
|
|
|
241
258
|
* @returns The rendered template
|
|
242
259
|
*/
|
|
243
260
|
render() {
|
|
261
|
+
const description = this.renderDescription();
|
|
262
|
+
const describedBy = [
|
|
263
|
+
this.instructions ? "group-instructions" : "",
|
|
264
|
+
description === nothing ? "" : "description",
|
|
265
|
+
]
|
|
266
|
+
.filter(Boolean)
|
|
267
|
+
.join(" ") || undefined;
|
|
244
268
|
return html `
|
|
245
|
-
<fieldset id="fieldset">
|
|
269
|
+
<fieldset id="fieldset" role="presentation">
|
|
246
270
|
<div id="legend">${this.renderFormLabels("options")}</div>
|
|
271
|
+
${this.instructions
|
|
272
|
+
? html `<span id="group-instructions" hidden
|
|
273
|
+
>${this.instructions}</span
|
|
274
|
+
>`
|
|
275
|
+
: nothing}
|
|
247
276
|
<div
|
|
248
277
|
id="options"
|
|
249
278
|
part="options"
|
|
250
279
|
role="group"
|
|
251
280
|
class=${classMap({ inline: this.inline })}
|
|
252
281
|
?disabled=${this.disabled}
|
|
253
|
-
aria-
|
|
254
|
-
aria-describedby
|
|
282
|
+
aria-label=${ifDefined(this.label)}
|
|
283
|
+
aria-describedby=${ifDefined(describedBy)}
|
|
255
284
|
aria-disabled=${this.disabled ? "true" : "false"}
|
|
256
285
|
>
|
|
257
286
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
258
287
|
</div>
|
|
259
|
-
${
|
|
288
|
+
${description}
|
|
260
289
|
</fieldset>
|
|
261
290
|
`;
|
|
262
291
|
}
|
|
@@ -31,6 +31,7 @@ declare const EunomiaCheckboxMixinBase: Constructor<EunomiaCheckboxBase>;
|
|
|
31
31
|
* @prop {boolean} [readonly=false] - Whether the checkbox is read only
|
|
32
32
|
* @prop {boolean} [indeterminate=false] - Whether the checkbox value is indeterminate
|
|
33
33
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
34
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
34
35
|
* @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
|
|
35
36
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden
|
|
36
37
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -34,6 +34,7 @@ const EunomiaCheckboxMixinBase = CheckMixin(ReadonlyMixin(FormMixin(DisabledMixi
|
|
|
34
34
|
* @prop {boolean} [readonly=false] - Whether the checkbox is read only
|
|
35
35
|
* @prop {boolean} [indeterminate=false] - Whether the checkbox value is indeterminate
|
|
36
36
|
* @prop {boolean} [hideError=false] - Whether the errors are hidden. The hint stays visible
|
|
37
|
+
* @prop {boolean} [invalid=false] - Shows the field as invalid without any message, for an error displayed elsewhere
|
|
37
38
|
* @prop {string} [error] - An error computed outside the field, by the form or by the server. While set, the field is invalid and shows this message right away
|
|
38
39
|
* @attr {boolean} [hide-error=false] - Whether the error message is hidden
|
|
39
40
|
* @prop {boolean} [required=false] - Whether a selection is required
|
|
@@ -97,7 +98,8 @@ let EunomiaCheckbox = class EunomiaCheckbox extends EunomiaCheckboxMixinBase {
|
|
|
97
98
|
*/
|
|
98
99
|
updated(_changedProperties) {
|
|
99
100
|
super.updated?.(_changedProperties);
|
|
100
|
-
if (_changedProperties.has("indeterminate")
|
|
101
|
+
if (_changedProperties.has("indeterminate") ||
|
|
102
|
+
_changedProperties.has("checked")) {
|
|
101
103
|
this.setAttribute("aria-checked", !this.checked && this.indeterminate ? "mixed" : String(this.checked));
|
|
102
104
|
}
|
|
103
105
|
if (_changedProperties.has("label")) {
|
|
@@ -111,8 +111,9 @@ const base = css `
|
|
|
111
111
|
--_focusIndicator: var(--_errorColor);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
:host([aria-disabled="true"][aria-checked="true"]) #checkbox-component
|
|
115
|
-
|
|
114
|
+
:host([aria-disabled="true"][aria-checked="true"]) #checkbox-component,
|
|
115
|
+
:host([aria-disabled="true"][aria-checked="mixed"]) #checkbox-component {
|
|
116
|
+
--_icon: var(--eun-text-disabled-color, #8d93aa);
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
:host([aria-readonly="true"][aria-checked="true"]) #checkbox-component {
|