@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h,b as v,c as b}from"./chunks/chunk-6VK6SHCG.js";import{a as g}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js";import"./chunks/chunk-UDOZRIJZ.js";import{a as n}from"./chunks/chunk-PPCHQG7P.js";import{a as m}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as t,f as d,h as p,j as i,k as u,l,p as r,r as a,u as f}from"./chunks/chunk-YITWLCD3.js";var s=class c extends Event{static{this.eventName="eunconfirm"}constructor(){super(c.eventName,{bubbles:!0,composed:!0,cancelable:!0})}};var C=p`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -141,12 +141,12 @@ import{a as m,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as b}from"
|
|
|
141
141
|
transition-duration: 0.01ms;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
`,
|
|
144
|
+
`,x=C;var k="eun-modal",e=class extends g(m(f)){constructor(){super(...arguments);this.open=!1;this.kind="dialog";this.closeOnBackdrop=!0;this.dirty=!1;this.hideActions=!1;this.closeable=!0;this.confirmColor="primary";this.confirmCloseHeading="Discard changes?";this.confirmCloseDescription="You have unsaved changes. This action can't be undone.";this.confirmCloseCancelLabel="Keep editing";this.confirmCloseConfirmLabel="Discard";this.mountConfirmModal=!1;this.handleDiscardConfirmed=o=>{o.stopPropagation(),this.confirmDiscard()};this.stopDialogPropagation=o=>{o.stopPropagation()};this.handleToggle=o=>{let y=o;if(this.syncingFromPopover=!0,this.open=y.newState==="open",this.syncingFromPopover=!1,this.open){this.openDialogSurface({surfaceEl:this.surfaceEl,onEscape:()=>this.requestClose(),onOutsideClick:()=>{this.closeOnBackdrop&&this.requestClose()}}),this.updateComplete.then(()=>this.focusInitialElement());return}this.closeDialogSurface()};this.handleCommandEvent=o=>{b(o,this)}}willUpdate(o){o.has("dirty")&&this.dirty&&(this.mountConfirmModal=!0)}updated(o){super.updated(o),o.has("open")&&this.syncPopoverOpenState(this.open,this.surfaceEl)}connectedCallback(){super.connectedCallback?.(),this.addEventListener("command",this.handleCommandEvent)}disconnectedCallback(){this.removeEventListener("command",this.handleCommandEvent),this.teardownDialogSurface(this.open),super.disconnectedCallback?.()}show(){this.open=!0}hide(){this.open=!1}confirm(){let o=new s;this.dispatchEvent(o),o.defaultPrevented||(this.open=!1)}cancel(){let o=new h;this.dispatchEvent(o),o.defaultPrevented||(this.open=!1)}requestClose(){if(this.dirty){let o=new v;this.dispatchEvent(o),o.defaultPrevented||this.confirmCloseModalEl?.show();return}this.cancel()}confirmDiscard(){this.dirty=!1,this.cancel()}focusInitialElement(){let o=this.querySelector("[autofocus]");if(o){o.focus();return}if(!this.hideActions){this.cancelButtonEl?.focus();return}this.surfaceEl?.focus()}renderHeader(){return!this.heading&&!this.description?a:r`
|
|
145
145
|
<div id="header">
|
|
146
|
-
${this.heading?
|
|
147
|
-
${this.description?
|
|
146
|
+
${this.heading?r`<h2 id="heading">${this.heading}</h2>`:a}
|
|
147
|
+
${this.description?r`<p id="description">${this.description}</p>`:a}
|
|
148
148
|
</div>
|
|
149
|
-
`}renderConfirmCloseModal(){return
|
|
149
|
+
`}renderConfirmCloseModal(){return r`
|
|
150
150
|
<eun-modal
|
|
151
151
|
id="confirm-close-modal"
|
|
152
152
|
kind="alert"
|
|
@@ -157,10 +157,10 @@ import{a as m,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as b}from"
|
|
|
157
157
|
@eunconfirm=${this.handleDiscardConfirmed}
|
|
158
158
|
@euncancel=${this.stopDialogPropagation}
|
|
159
159
|
>
|
|
160
|
-
${this.confirmCloseDescription?
|
|
160
|
+
${this.confirmCloseDescription?r`<p>${this.confirmCloseDescription}</p>`:a}
|
|
161
161
|
<slot name="confirm-close"></slot>
|
|
162
162
|
</eun-modal>
|
|
163
|
-
`}render(){return
|
|
163
|
+
`}render(){return r`
|
|
164
164
|
<div
|
|
165
165
|
id="surface"
|
|
166
166
|
popover="manual"
|
|
@@ -172,13 +172,13 @@ import{a as m,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as b}from"
|
|
|
172
172
|
tabindex="-1"
|
|
173
173
|
@toggle=${this.handleToggle}
|
|
174
174
|
>
|
|
175
|
-
${this.closeable?
|
|
175
|
+
${this.closeable?r`
|
|
176
176
|
<eun-button
|
|
177
177
|
id="close-button"
|
|
178
178
|
appearance="ghost"
|
|
179
179
|
rounded
|
|
180
180
|
size="xs"
|
|
181
|
-
aria-label=${this.
|
|
181
|
+
aria-label=${this.closeLabel??this.dictionary.common.close}
|
|
182
182
|
@click=${()=>this.requestClose()}
|
|
183
183
|
>
|
|
184
184
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -188,7 +188,7 @@ import{a as m,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as b}from"
|
|
|
188
188
|
<div id="body">
|
|
189
189
|
<slot></slot>
|
|
190
190
|
</div>
|
|
191
|
-
${this.hideActions?a:
|
|
191
|
+
${this.hideActions?a:r`
|
|
192
192
|
<div id="actions">
|
|
193
193
|
<slot name="footer">
|
|
194
194
|
<eun-button
|
|
@@ -196,16 +196,16 @@ import{a as m,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as b}from"
|
|
|
196
196
|
appearance="ghost"
|
|
197
197
|
color=${n(this.cancelColor)}
|
|
198
198
|
@click=${()=>this.requestClose()}
|
|
199
|
-
>${this.cancelLabel}</eun-button
|
|
199
|
+
>${this.cancelLabel??this.dictionary.common.cancel}</eun-button
|
|
200
200
|
>
|
|
201
201
|
<eun-button
|
|
202
202
|
color=${this.confirmColor}
|
|
203
203
|
@click=${()=>this.confirm()}
|
|
204
|
-
>${this.confirmLabel}</eun-button
|
|
204
|
+
>${this.confirmLabel??this.dictionary.common.confirm}</eun-button
|
|
205
205
|
>
|
|
206
206
|
</slot>
|
|
207
207
|
</div>
|
|
208
208
|
`}
|
|
209
209
|
</div>
|
|
210
210
|
${this.mountConfirmModal?this.renderConfirmCloseModal():a}
|
|
211
|
-
`}};e.styles=
|
|
211
|
+
`}};e.styles=x,t([i({type:Boolean,reflect:!0})],e.prototype,"open",2),t([i()],e.prototype,"heading",2),t([i()],e.prototype,"description",2),t([i({reflect:!0,useDefault:!0})],e.prototype,"kind",2),t([i({type:Boolean,attribute:"close-on-backdrop"})],e.prototype,"closeOnBackdrop",2),t([i({type:Boolean,reflect:!0})],e.prototype,"dirty",2),t([i({type:Boolean,attribute:"hide-actions"})],e.prototype,"hideActions",2),t([i({type:Boolean,reflect:!0})],e.prototype,"closeable",2),t([i({attribute:"cancel-label"})],e.prototype,"cancelLabel",2),t([i({attribute:"confirm-label"})],e.prototype,"confirmLabel",2),t([i({attribute:"confirm-color"})],e.prototype,"confirmColor",2),t([i({attribute:"cancel-color"})],e.prototype,"cancelColor",2),t([i({attribute:"close-label"})],e.prototype,"closeLabel",2),t([i({attribute:"confirm-close-heading"})],e.prototype,"confirmCloseHeading",2),t([i({attribute:"confirm-close-description"})],e.prototype,"confirmCloseDescription",2),t([i({attribute:"confirm-close-cancel-label"})],e.prototype,"confirmCloseCancelLabel",2),t([i({attribute:"confirm-close-confirm-label"})],e.prototype,"confirmCloseConfirmLabel",2),t([l("#surface")],e.prototype,"surfaceEl",2),t([l("#cancel-button")],e.prototype,"cancelButtonEl",2),t([l("#confirm-close-modal")],e.prototype,"confirmCloseModalEl",2),t([u()],e.prototype,"mountConfirmModal",2),e=t([d(k)],e);export{e as EunomiaModal,k as EunomiaModalTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as S}from"./chunks/chunk-PPCHQG7P.js";import{a as N}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a,f as x,h as $,j as i,p as n,r as p,u as z}from"./chunks/chunk-YITWLCD3.js";var g=class b extends Event{static{this.eventName="eunpagechange"}constructor(d){super(b.eventName,{bubbles:!0,composed:!1}),this.page=d}};var h=class b extends Event{static{this.eventName="eunpagesizechange"}constructor(d){super(b.eventName,{bubbles:!0,composed:!1}),this.pageSize=d}};var w=$`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
@@ -128,19 +128,19 @@ import{a as N}from"./chunks/chunk-PPCHQG7P.js";import{a,f as y,h as $,j as r,p a
|
|
|
128
128
|
#page-size eun-select {
|
|
129
129
|
width: 100%;
|
|
130
130
|
}
|
|
131
|
-
`;var
|
|
131
|
+
`;var E="eun-pagination",t=class extends N(z){constructor(){super(...arguments);this.page=1;this.totalPages=1;this.siblingCount=1;this.boundaryCount=1;this.hidePrevNext=!1;this.hideFirstLast=!1;this.disabled=!1;this.showLabels=!1;this.pageSizeOptions=[];this.pageSizeLabel="Items per page"}getPageItems(){let e=(f,y)=>f>y?[]:Array.from({length:y-f+1},(I,k)=>f+k),{page:o,totalPages:s,siblingCount:c,boundaryCount:r}=this;if(r*2+c*2+3>=s)return e(1,s);let u=Math.max(o-c,r+2),m=Math.min(o+c,s-r-1),L=u>r+2,C=m<s-r-1,l=[...e(1,r)];return L?l.push("start-ellipsis"):l.push(...e(r+1,u-1)),l.push(...e(u,m)),C?l.push("end-ellipsis"):l.push(...e(m+1,s-r)),l.push(...e(s-r+1,s)),l}requestPage(e){e===this.page||e<1||e>this.totalPages||this.dispatchEvent(new g(e))}handlePageSizeChange(e){let o=Number(e.target.value);Number.isNaN(o)||this.dispatchEvent(new h(o))}renderControl(e,o,s,c,r){let v=n`<eun-icon name=${s} size="16"></eun-icon>`,u=this.showLabels?n`<span class="label">${o}</span>`:p;return n`
|
|
132
132
|
<li>
|
|
133
133
|
<button
|
|
134
134
|
type="button"
|
|
135
135
|
class="control"
|
|
136
|
-
aria-label=${
|
|
136
|
+
aria-label=${S(this.showLabels?void 0:o)}
|
|
137
137
|
?disabled=${this.disabled||c}
|
|
138
138
|
@click=${()=>this.requestPage(e)}
|
|
139
139
|
>
|
|
140
|
-
${
|
|
140
|
+
${r==="start"?n`${v}${u}`:n`${u}${v}`}
|
|
141
141
|
</button>
|
|
142
142
|
</li>
|
|
143
|
-
`}renderPageSizeSelector(){return
|
|
143
|
+
`}renderPageSizeSelector(){return n`
|
|
144
144
|
<div id="page-size">
|
|
145
145
|
<eun-select
|
|
146
146
|
label=${this.pageSizeLabel}
|
|
@@ -148,39 +148,39 @@ import{a as N}from"./chunks/chunk-PPCHQG7P.js";import{a,f as y,h as $,j as r,p a
|
|
|
148
148
|
?disabled=${this.disabled}
|
|
149
149
|
@eunchange=${this.handlePageSizeChange}
|
|
150
150
|
>
|
|
151
|
-
${this.pageSizeOptions.map(e=>
|
|
151
|
+
${this.pageSizeOptions.map(e=>n`<option value=${e}>${e}</option>`)}
|
|
152
152
|
</eun-select>
|
|
153
153
|
</div>
|
|
154
|
-
`}renderItem(e){return e==="start-ellipsis"||e==="end-ellipsis"?
|
|
154
|
+
`}renderItem(e){return e==="start-ellipsis"||e==="end-ellipsis"?n`<li><span class="ellipsis" aria-hidden="true">…</span></li>`:e===this.page?n`
|
|
155
155
|
<li>
|
|
156
156
|
<span
|
|
157
157
|
class="page current"
|
|
158
158
|
aria-current="page"
|
|
159
|
-
aria-label="${this.
|
|
159
|
+
aria-label="${this.pageLabel??this.dictionary.pagination.page} ${e}"
|
|
160
160
|
>${e}</span
|
|
161
161
|
>
|
|
162
162
|
</li>
|
|
163
|
-
`:
|
|
163
|
+
`:n`
|
|
164
164
|
<li>
|
|
165
165
|
<button
|
|
166
166
|
type="button"
|
|
167
167
|
class="control page"
|
|
168
|
-
aria-label="${this.
|
|
168
|
+
aria-label="${this.pageLabel??this.dictionary.pagination.page} ${e}"
|
|
169
169
|
?disabled=${this.disabled}
|
|
170
170
|
@click=${()=>this.requestPage(e)}
|
|
171
171
|
>
|
|
172
172
|
${e}
|
|
173
173
|
</button>
|
|
174
174
|
</li>
|
|
175
|
-
`}render(){return
|
|
175
|
+
`}render(){return n`
|
|
176
176
|
<nav aria-label=${this.ariaLabel??"Pagination"}>
|
|
177
177
|
${this.pageSizeOptions.length?this.renderPageSizeSelector():p}
|
|
178
178
|
<ul id="list" role="list">
|
|
179
|
-
${this.hideFirstLast?p:this.renderControl(1,this.
|
|
180
|
-
${this.hidePrevNext?p:this.renderControl(this.page-1,this.
|
|
179
|
+
${this.hideFirstLast?p:this.renderControl(1,this.firstLabel??this.dictionary.pagination.first,"first_page",this.page<=1,"start")}
|
|
180
|
+
${this.hidePrevNext?p:this.renderControl(this.page-1,this.previousLabel??this.dictionary.pagination.previous,"chevron_left",this.page<=1,"start")}
|
|
181
181
|
${this.getPageItems().map(e=>this.renderItem(e))}
|
|
182
|
-
${this.hidePrevNext?p:this.renderControl(this.page+1,this.
|
|
183
|
-
${this.hideFirstLast?p:this.renderControl(this.totalPages,this.
|
|
182
|
+
${this.hidePrevNext?p:this.renderControl(this.page+1,this.nextLabel??this.dictionary.pagination.next,"chevron_right",this.page>=this.totalPages,"end")}
|
|
183
|
+
${this.hideFirstLast?p:this.renderControl(this.totalPages,this.lastLabel??this.dictionary.pagination.last,"last_page",this.page>=this.totalPages,"end")}
|
|
184
184
|
</ul>
|
|
185
185
|
</nav>
|
|
186
|
-
`}};t.styles=[
|
|
186
|
+
`}};t.styles=[w],a([i({type:Number})],t.prototype,"page",2),a([i({type:Number,attribute:"total-pages"})],t.prototype,"totalPages",2),a([i({type:Number,attribute:"sibling-count"})],t.prototype,"siblingCount",2),a([i({type:Number,attribute:"boundary-count"})],t.prototype,"boundaryCount",2),a([i({type:Boolean,attribute:"hide-prev-next"})],t.prototype,"hidePrevNext",2),a([i({type:Boolean,attribute:"hide-first-last"})],t.prototype,"hideFirstLast",2),a([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),a([i({type:Boolean,attribute:"show-labels",reflect:!0})],t.prototype,"showLabels",2),a([i({type:Number,attribute:"page-size"})],t.prototype,"pageSize",2),a([i({type:Array,attribute:"page-size-options"})],t.prototype,"pageSizeOptions",2),a([i({attribute:"page-size-label"})],t.prototype,"pageSizeLabel",2),a([i({attribute:"previous-label"})],t.prototype,"previousLabel",2),a([i({attribute:"next-label"})],t.prototype,"nextLabel",2),a([i({attribute:"first-label"})],t.prototype,"firstLabel",2),a([i({attribute:"last-label"})],t.prototype,"lastLabel",2),a([i({attribute:"page-label"})],t.prototype,"pageLabel",2),t=a([x(E)],t);export{t as EunomiaPagination,E as EunomiaPaginationTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as x}from"./chunks/chunk-PPCHQG7P.js";import{a as d}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as w}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as s,f as u,h as g,j as l,l as h,p,r as f,u as m}from"./chunks/chunk-YITWLCD3.js";var R=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: 100%;
|
|
@@ -81,6 +81,10 @@ import{a as f}from"./chunks/chunk-PPCHQG7P.js";import{a as x}from"./chunks/chunk
|
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
#label.empty {
|
|
85
|
+
visibility: hidden;
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
#caption {
|
|
85
89
|
color: var(
|
|
86
90
|
--password-strength-caption-color,
|
|
@@ -116,19 +120,19 @@ import{a as f}from"./chunks/chunk-PPCHQG7P.js";import{a as x}from"./chunks/chunk
|
|
|
116
120
|
transition: none;
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
|
-
`,
|
|
120
|
-
<div id="wrapper" data-severity=${
|
|
123
|
+
`,b=R;var y=[{label:"At least 8 characters",regex:/.{8,}/},{label:"Upper and lower case letters",regex:/(?=.*[a-z])(?=.*[A-Z])/},{label:"At least one number",regex:/\d/},{label:"At least one special character",regex:/[^A-Za-z0-9]/}],c=[{label:"Weak",severity:"critical"},{label:"Fair",severity:"warning"},{label:"Good",severity:"info"},{label:"Strong",severity:"success"}];function T(a,i){return i.reduce((e,r)=>e+(r.regex.test(a)?1:0),0)}function S(a,i,e){if(!a)return-1;let r=T(a,i),n=0;return e.forEach((o,v)=>{(o.rules?.length?o.rules.every(L=>L.regex.test(a)):r>=(o.minScore??v+1))&&(n=v)}),n}var _="eun-password-strength",t=class extends w(m){constructor(){super(...arguments);this.value="";this.rules=y;this.levels=c;this.hideLabel=!1;this.previousLevelIndex=-1}get currentLevelIndex(){return S(this.value,this.rules,this.levels)}get resolvedLevels(){if(this.levels!==c)return this.levels;let e=this.dictionary.passwordStrength.levels;return this.levels.map((r,n)=>({...r,label:e[n]??r.label}))}get caption(){let{passwordStrength:e}=this.dictionary;return e.caption(this.label??e.label)}updated(e){if(super.updated(e),!e.has("value")&&!e.has("rules")&&!e.has("levels"))return;let r=this.currentLevelIndex;r!==this.previousLevelIndex&&(this.previousLevelIndex=r,this.announcerEl&&(this.announcerEl.textContent=r===-1?"":`${this.caption} ${this.resolvedLevels[r].label}`))}render(){let e=this.currentLevelIndex,r=e===-1?void 0:this.resolvedLevels[e];return p`
|
|
124
|
+
<div id="wrapper" data-severity=${x(r?.severity)}>
|
|
121
125
|
<div id="segments" role="presentation" aria-hidden="true">
|
|
122
|
-
${this.levels.map((
|
|
126
|
+
${this.levels.map((n,o)=>p`
|
|
123
127
|
<span
|
|
124
|
-
class=${
|
|
128
|
+
class=${d({segment:!0,filled:o<=e})}
|
|
125
129
|
></span>
|
|
126
130
|
`)}
|
|
127
131
|
</div>
|
|
128
|
-
${this.hideLabel
|
|
129
|
-
<span id="label">
|
|
130
|
-
<span id="caption">${this.
|
|
131
|
-
<span id="level-name">${r
|
|
132
|
+
${this.hideLabel?f:p`
|
|
133
|
+
<span id="label" class=${d({empty:!r})}>
|
|
134
|
+
<span id="caption">${this.caption}</span>
|
|
135
|
+
<span id="level-name">${r?.label??"\xA0"}</span>
|
|
132
136
|
</span>
|
|
133
137
|
`}
|
|
134
138
|
</div>
|
|
@@ -138,4 +142,4 @@ import{a as f}from"./chunks/chunk-PPCHQG7P.js";import{a as x}from"./chunks/chunk
|
|
|
138
142
|
aria-live="polite"
|
|
139
143
|
class="visually-hidden"
|
|
140
144
|
></div>
|
|
141
|
-
`}};t.styles=[
|
|
145
|
+
`}};t.styles=[b],s([l()],t.prototype,"value",2),s([l()],t.prototype,"label",2),s([l({type:Array})],t.prototype,"rules",2),s([l({type:Array})],t.prototype,"levels",2),s([l({type:Boolean,attribute:"hide-label"})],t.prototype,"hideLabel",2),s([h("#announcer")],t.prototype,"announcerEl",2),t=s([u(_)],t);export{t as EunomiaPasswordStrength,_ as EunomiaPasswordStrengthTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as u}from"./chunks/chunk-
|
|
1
|
+
import{b as u}from"./chunks/chunk-6FYW5TQU.js";import{a as s}from"./chunks/chunk-FOILAXLL.js";import{f as a}from"./chunks/chunk-TLBXTBMM.js";import"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-3BMACIDO.js";import{a as l}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-QL5GSW2A.js";import{a as o,f as d,h as i,j as c,n,p as e,r as t}from"./chunks/chunk-YITWLCD3.js";var p=i`
|
|
2
2
|
:host {
|
|
3
3
|
--_borderWidth: var(--radio-card-border-width, 1px);
|
|
4
4
|
--_borderColor: var(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as k}from"./chunks/chunk-ZBN4HTWP.js";import{a as $}from"./chunks/chunk-BO3JOEWM.js";import{b as g,c as y,d as E,e as C,f as u}from"./chunks/chunk-TLBXTBMM.js";import{a as b}from"./chunks/chunk-YYCEPZUN.js";import{a as m}from"./chunks/chunk-3BMACIDO.js";import{a as h}from"./chunks/chunk-PPCHQG7P.js";import{a as v}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-QL5GSW2A.js";import{a as r,f as c,h as p,j as o,l as f,p as n,r as d,u as l}from"./chunks/chunk-YITWLCD3.js";var V=p`
|
|
2
2
|
:host {
|
|
3
3
|
--_container-gap: var(--radio-list-gap, var(--eun-space-s, 8px));
|
|
4
4
|
--_options-gap: var(--radio-list-options-gap, var(--eun-space-s, 8px));
|
|
@@ -7,17 +7,20 @@ import{a as A}from"./chunks/chunk-ZBN4HTWP.js";import{a as E}from"./chunks/chunk
|
|
|
7
7
|
var(--eun-color-critical-100, #aa0014)
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
|
-
`,
|
|
11
|
-
<fieldset id="fieldset">
|
|
10
|
+
`,A=V;var M="eun-radio-list",w="eun-radio",x="eun-radio-card",R=m(C(l)),s=class extends $(E(y(R))){constructor(){super(...arguments);this.errorOnChange=!0;this.inline=!1;this.handleChangeEvent=e=>{!e.target||e.target===this||(e.stopPropagation(),this.setActive(e.target))}}get fields(){return Array.from(this.querySelectorAll(`:scope > ${w}, :scope > ${x}`))}get active(){return this.fields.find(e=>e.checked)}get value(){return this.active?.value}set value(e){this.updateComplete.then(()=>{this.fields.forEach(t=>{t.checked=t.value===e})})}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}firstUpdated(){this.fields.forEach(e=>{e.name=this.name,e.id=e.id||`radio-${this.name}-${e.value}`}),this.defaultValue!==void 0&&(this.fields.forEach(e=>{e.checked=e.value===this.defaultValue}),this.value=this.defaultValue,this.sendChangeEvent()),Promise.all(this.fields.map(e=>e.updateComplete)).then(()=>{this.setFocus(),this.checkValidity(this.value)})}connectedCallback(){super.connectedCallback?.(),this.addEventListener("eunchange",this.handleChangeEvent,{capture:!0}),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){this.removeEventListener("eunchange",this.handleChangeEvent),this.removeEventListener("keydown",this.handleKeydown),super.disconnectedCallback?.()}isGroupChange(e,t){return e.has(t)&&(this[t]||e.get(t)!==void 0)}updated(e){if(super.updated(e),this.isGroupChange(e,"disabled")&&(this.fields.forEach(t=>{t.disabled=this.disabled}),this.setFocus()),this.isGroupChange(e,"readonly")&&(this.fields.forEach(t=>{t.readonly=this.readonly}),this.setFocus()),g(e)){let{showError:t}=this;this.fields.forEach(i=>{i.valid=!t,i.validationRequested=t})}e.has("name")&&this.fields.forEach(t=>{t.name=this.name})}getFocusAnchor(){return this.querySelector(`${w}, ${x}`)}focus(){super.focus?.(),(this.active??this.fields[0])?.focus?.()}handleKeydown(e){let t=this.fields.filter(a=>!a.disabled&&!a.readonly);if(!t.length)return;let i=t.findIndex(a=>a.checked);switch(e.key){case" ":{if(e.preventDefault(),i!==-1)return;i=0;break}case"ArrowDown":case"ArrowRight":{e.preventDefault(),i=i===-1?0:(i+1)%t.length;break}case"ArrowUp":case"ArrowLeft":{e.preventDefault(),i=i===-1?t.length-1:(t.length+i-1)%t.length;break}default:return}this.setActive(t[i],!0)}setFocus(){if(!this.fields.length||(this.fields.forEach(t=>{t.setAttribute("tabindex","-1")}),this.readonly||this.disabled))return;let e=this.active??this.fields.find(t=>!t.disabled&&!t.readonly);e&&!e.disabled&&!e.readonly&&e.setAttribute("tabindex","0")}setActive(e,t=!1){this.disabled||this.readonly||!e||!this.optionsList||(t&&e.focus(),this.fields.forEach(i=>{let a=i===e;i.checked=a,i.setAttribute("tabindex",a?"0":"-1")}),this.sendChangeEvent())}formResetCallback(){super.formResetCallback?.(),this.updateComplete.then(()=>{this.setFocus(),this.sendChangeEvent()})}sendChangeEvent(){this.checkValidity(this.value),this.dispatchEvent(new b(this.value))}handleSlotChange(){this.fields.forEach(e=>{e.name=this.name,e.id=e.id||`radio-${this.name}-${e.value}`})}render(){let e=this.renderDescription(),t=[this.instructions?"group-instructions":"",e===d?"":"description"].filter(Boolean).join(" ")||void 0;return n`
|
|
11
|
+
<fieldset id="fieldset" role="presentation">
|
|
12
12
|
<div id="legend">${this.renderFormLabels("options")}</div>
|
|
13
|
+
${this.instructions?n`<span id="group-instructions" hidden
|
|
14
|
+
>${this.instructions}</span
|
|
15
|
+
>`:d}
|
|
13
16
|
<div
|
|
14
17
|
id="options"
|
|
15
18
|
part="options"
|
|
16
19
|
role="radiogroup"
|
|
17
|
-
class=${
|
|
20
|
+
class=${v({inline:this.inline})}
|
|
18
21
|
?disabled=${this.disabled}
|
|
19
|
-
aria-
|
|
20
|
-
aria-describedby
|
|
22
|
+
aria-label=${h(this.label)}
|
|
23
|
+
aria-describedby=${h(t)}
|
|
21
24
|
aria-disabled=${this.disabled?"true":"false"}
|
|
22
25
|
aria-readonly=${this.readonly?"true":"false"}
|
|
23
26
|
aria-required=${this.required?"true":"false"}
|
|
@@ -25,6 +28,6 @@ import{a as A}from"./chunks/chunk-ZBN4HTWP.js";import{a as E}from"./chunks/chunk
|
|
|
25
28
|
>
|
|
26
29
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
27
30
|
</div>
|
|
28
|
-
${
|
|
31
|
+
${e}
|
|
29
32
|
</fieldset>
|
|
30
|
-
`}};s.styles=[
|
|
33
|
+
`}};s.styles=[A,k,u.base,u.errorMessages],s.shadowRootOptions={...l.shadowRootOptions,delegatesFocus:!0},r([o({type:Boolean,reflect:!0})],s.prototype,"inline",2),r([f("#options")],s.prototype,"optionsList",2),r([o({attribute:"default-value"})],s.prototype,"defaultValue",1),s=r([c(M)],s);export{s as EunomiaRadioList,M as EunomiaRadioListTagName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-6FYW5TQU.js";import"./chunks/chunk-TLBXTBMM.js";import"./chunks/chunk-YYCEPZUN.js";import"./chunks/chunk-3BMACIDO.js";import"./chunks/chunk-QL5GSW2A.js";import"./chunks/chunk-YITWLCD3.js";export{b as EunomiaRadio,a as EunomiaRadioTagName};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import{a as _}from"./chunks/chunk-B5XMGWM7.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as E}from"./chunks/chunk-BO3JOEWM.js";import{c as T,d as L,e as C,f as c}from"./chunks/chunk-TLBXTBMM.js";import{a as I}from"./chunks/chunk-YYCEPZUN.js";import{a as S}from"./chunks/chunk-3BMACIDO.js";import{a as w}from"./chunks/chunk-22D3SRFR.js";import{a as M}from"./chunks/chunk-PPCHQG7P.js";import{a as m}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as k}from"./chunks/chunk-62RLISRD.js";import{a as $}from"./chunks/chunk-QL5GSW2A.js";import{a,f as v,h as b,j as s,k as y,l as g,p as l,r as d,u as x}from"./chunks/chunk-YITWLCD3.js";var V=b`
|
|
2
|
+
:host {
|
|
3
|
+
--_iconSize: var(--rating-size, 24px);
|
|
4
|
+
--_gap: var(--rating-gap, var(--eun-space-xs, 4px));
|
|
5
|
+
--_color: var(--rating-color, var(--eun-color-primary-500, #3d6fff));
|
|
6
|
+
--_emptyColor: var(
|
|
7
|
+
--rating-empty-color,
|
|
8
|
+
color-mix(
|
|
9
|
+
in srgb,
|
|
10
|
+
var(--eun-text-color, #071621) 55%,
|
|
11
|
+
var(--eun-surface-color, #ffffff)
|
|
12
|
+
)
|
|
13
|
+
);
|
|
14
|
+
--_errorColor: var(
|
|
15
|
+
--rating-error-color,
|
|
16
|
+
var(--eun-color-critical-100, #aa0014)
|
|
17
|
+
);
|
|
18
|
+
--_hintColor: var(--rating-hint-color, var(--eun-text-secondary, #484e61));
|
|
19
|
+
--_focusIndicator: var(
|
|
20
|
+
--rating-focus-outline-color,
|
|
21
|
+
var(--eun-color-primary-500, #3d6fff)
|
|
22
|
+
);
|
|
23
|
+
font-family: var(--eun-font-family, "Mulish", sans-serif);
|
|
24
|
+
font-size: var(--eun-font-size-s, 14px);
|
|
25
|
+
display: inline-block;
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#wrapper {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: var(--eun-space-xs, 4px);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#control {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--eun-space-s, 8px);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#items {
|
|
43
|
+
display: flex;
|
|
44
|
+
gap: var(--_gap);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.item {
|
|
49
|
+
position: relative;
|
|
50
|
+
flex: none;
|
|
51
|
+
width: var(--_iconSize);
|
|
52
|
+
height: var(--_iconSize);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([display-only]) #items {
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.icon {
|
|
60
|
+
position: absolute;
|
|
61
|
+
inset: 0;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.icon eun-icon {
|
|
66
|
+
--icon-size: var(--_iconSize);
|
|
67
|
+
display: block;
|
|
68
|
+
width: var(--_iconSize);
|
|
69
|
+
height: var(--_iconSize);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.empty {
|
|
73
|
+
--icon-color: var(--_emptyColor);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.fill {
|
|
77
|
+
position: absolute;
|
|
78
|
+
inset-block: 0;
|
|
79
|
+
inset-inline-start: 0;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
--icon-color: var(--_color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.fill eun-icon {
|
|
85
|
+
flex: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
input {
|
|
89
|
+
position: absolute;
|
|
90
|
+
inset-block: 0;
|
|
91
|
+
inset-inline-start: 0;
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 100%;
|
|
94
|
+
margin: 0;
|
|
95
|
+
opacity: 0;
|
|
96
|
+
appearance: none;
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
input.half {
|
|
101
|
+
width: 50%;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
input.end {
|
|
105
|
+
inset-inline-start: 50%;
|
|
106
|
+
width: 50%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.focus-ring {
|
|
110
|
+
position: absolute;
|
|
111
|
+
inset: -3px;
|
|
112
|
+
border-radius: var(--eun-border-radius-s, 4px);
|
|
113
|
+
outline: 2px solid transparent;
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
transition: outline-color var(--eun-duration-s, 150ms)
|
|
116
|
+
var(--eun-easing-default, ease);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.focus-ring.half {
|
|
120
|
+
inset-inline-end: 50%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
input:focus-visible + .focus-ring {
|
|
124
|
+
outline-color: var(--_focusIndicator);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#clear {
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
min-width: 24px;
|
|
132
|
+
min-height: 24px;
|
|
133
|
+
padding: 2px;
|
|
134
|
+
border: none;
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
background: transparent;
|
|
137
|
+
color: var(--eun-text-secondary, #484e61);
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
outline: 2px solid transparent;
|
|
140
|
+
outline-offset: 2px;
|
|
141
|
+
--icon-size: 18px;
|
|
142
|
+
transition:
|
|
143
|
+
background-color var(--eun-duration-s, 150ms)
|
|
144
|
+
var(--eun-easing-default, ease),
|
|
145
|
+
outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#clear:hover {
|
|
149
|
+
background: var(--eun-content-hover, #9696961a);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
#clear:active {
|
|
153
|
+
background: var(--eun-content-pressed, #e4e6e8);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
#clear:focus-visible {
|
|
157
|
+
outline-color: var(--_focusIndicator);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#items[aria-invalid="true"] {
|
|
161
|
+
--_emptyColor: var(--_errorColor);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([aria-readonly="true"]) {
|
|
165
|
+
--_color: var(--eun-readonly-color, #666e8a);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:host([aria-readonly="true"]) #items {
|
|
169
|
+
cursor: default;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([aria-disabled="true"]) {
|
|
173
|
+
--_color: var(--eun-text-disabled-color, #8d93aa);
|
|
174
|
+
--_emptyColor: var(--eun-disabled-content, #c1c9d6);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([aria-disabled="true"]) #items {
|
|
178
|
+
cursor: not-allowed;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@media (forced-colors: active) {
|
|
182
|
+
.fill {
|
|
183
|
+
--icon-color: CanvasText;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.empty {
|
|
187
|
+
--icon-color: CanvasText;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
input:focus-visible + .focus-ring,
|
|
191
|
+
#clear:focus-visible {
|
|
192
|
+
outline-color: Highlight;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
:host([aria-disabled="true"]) .icon eun-icon {
|
|
196
|
+
--icon-color: GrayText;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`,N=V;var F="eun-rating",z=S(C(x)),H=k(E(L(T(z)))),n=class extends H{constructor(){super(...arguments);this.errorOnChange=!0;this.max=5;this.step=1;this.displayOnly=!1;this.clearable=!1;this.icon="star";this.emptyIcon="star_border";this.handleClick=e=>{if(this.locked||e.target instanceof HTMLInputElement)return;let t=this.valueAtPointer(e);t!==void 0&&(this.pick(t),this.radioFor(t)?.focus({preventScroll:!0}))};this.handlePointerMove=e=>{this.locked||e.pointerType!=="mouse"||(this.hoverValue=this.valueAtPointer(e))};this.handlePointerLeave=()=>{this.hoverValue=void 0};this.handleChange=e=>{this.locked||this.pick(Number(e.target.value))};this.handleRadioClick=e=>{this.readonly&&e.preventDefault()};this.handleKeydown=e=>{if(!(e.target instanceof HTMLInputElement))return;let t=this.resolvedStep,i=getComputedStyle(this).direction==="rtl",o=this.value??0,r;switch(e.key){case"ArrowRight":r=o+(i?-t:t);break;case"ArrowLeft":r=o+(i?t:-t);break;case"ArrowDown":r=o+t;break;case"ArrowUp":r=o-t;break;case"Home":r=t;break;case"End":r=this.count;break;case" ":this.readonly&&e.preventDefault();return;default:return}if(e.preventDefault(),this.readonly)return;let u=Math.min(this.count,Math.max(t,r));this.pick(u),this.radioFor(u)?.focus()};this.handleClear=async()=>{this.pick(void 0),await this.updateComplete,this.focus()}}get value(){return super.value}set value(e){super.value=this.clamp(e)}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}get count(){let e=Math.round(this.max);return Number.isFinite(e)&&e>=1?e:5}get resolvedStep(){return Number(this.step)===.5?.5:1}clamp(e){if(e==null||e==="")return;let t=Number(e);if(!(!Number.isFinite(t)||t<=0))return Math.min(t,this.count)}snap(e){let t=this.clamp(e);if(t===void 0||this.displayOnly)return t;let i=this.resolvedStep;return Math.min(this.count,Math.max(i,Math.round(t/i)*i))}format(e){let t=this.locale??$();try{return new Intl.NumberFormat(t,{maximumFractionDigits:2}).format(e)}catch{return String(e)}}valueText(e){return this.dictionary.rating.valueText(this.format(e),this.format(this.count))}radioFor(e){let t=this.itemsEl?.querySelectorAll("input");return Array.from(t??[]).find(i=>Number(i.value)===e)??null}get tabStopValue(){return this.value??this.resolvedStep}get hostTabStop(){return!1}getFocusAnchor(){return this.radioFor(this.tabStopValue)??void 0}focus(e){super.focus?.(e),this.radioFor(this.tabStopValue)?.focus(e)}pick(e){e!==this.value&&(this.value=e,this.dispatchEvent(new I(this.value)))}get locked(){return this.disabled||this.readonly||this.displayOnly}valueAtPointer(e){let t=getComputedStyle(this).direction==="rtl",i=e.target.closest(".item");if(!i){let p;return this.itemsEl?.querySelectorAll(".item").forEach(h=>{let f=h.getBoundingClientRect();(t?f.right>=e.clientX:f.left<=e.clientX)&&(p=h)}),p?Number(p.dataset.index):void 0}let o=Number(i.dataset.index);if(this.resolvedStep===1)return o;let r=i.getBoundingClientRect(),u=r.width?(e.clientX-r.left)/r.width:1;return(t?1-u:u)<=.5?o-.5:o}willUpdate(e){if(["value","valueState","max","step","displayOnly"].some(t=>e.has(t))){let t=this.snap(this.value);t!==this.value&&(this.value=t)}(e.has("disabled")||e.has("readonly"))&&(this.hoverValue=void 0),super.willUpdate(e)}renderIcon(e){return l`
|
|
200
|
+
<span class="icon" aria-hidden="true">
|
|
201
|
+
<eun-icon class="empty" name=${this.emptyIcon}></eun-icon>
|
|
202
|
+
<span class="fill" style=${w({width:`${e*100}%`})}>
|
|
203
|
+
<eun-icon name=${this.icon}></eun-icon>
|
|
204
|
+
</span>
|
|
205
|
+
</span>
|
|
206
|
+
`}renderRadio(e){let t=!Number.isInteger(e),i=m({half:t,end:!t&&this.resolvedStep===.5});return l`
|
|
207
|
+
<input
|
|
208
|
+
type="radio"
|
|
209
|
+
name="rating"
|
|
210
|
+
class=${i}
|
|
211
|
+
.value=${String(e)}
|
|
212
|
+
.checked=${_(this.value===e)}
|
|
213
|
+
?disabled=${this.disabled}
|
|
214
|
+
tabindex=${e===this.tabStopValue?"0":"-1"}
|
|
215
|
+
aria-label=${this.valueText(e)}
|
|
216
|
+
@click=${this.handleRadioClick}
|
|
217
|
+
/>
|
|
218
|
+
<span class="focus-ring ${t?"half":""}" aria-hidden="true"></span>
|
|
219
|
+
`}renderDisplay(){let{rating:e}=this.dictionary,t=this.value,i=t===void 0?e.noValue:this.valueText(t);return l`
|
|
220
|
+
<div
|
|
221
|
+
id="items"
|
|
222
|
+
part="items"
|
|
223
|
+
role="img"
|
|
224
|
+
aria-label=${e.summary(this.label||e.label,i)}
|
|
225
|
+
>
|
|
226
|
+
${Array.from({length:this.count},(o,r)=>l`<span class="item">
|
|
227
|
+
${this.renderIcon(Math.min(1,Math.max(0,(t??0)-r)))}
|
|
228
|
+
</span>`)}
|
|
229
|
+
</div>
|
|
230
|
+
`}renderClear(){return!this.clearable||this.value===void 0||this.locked?d:l`
|
|
231
|
+
<button
|
|
232
|
+
type="button"
|
|
233
|
+
id="clear"
|
|
234
|
+
part="clear"
|
|
235
|
+
aria-label=${this.clearLabel??this.dictionary.rating.clear}
|
|
236
|
+
@click=${this.handleClear}
|
|
237
|
+
>
|
|
238
|
+
<eun-icon name="close" aria-hidden="true"></eun-icon>
|
|
239
|
+
</button>
|
|
240
|
+
`}render(){if(this.displayOnly)return l`<div id="wrapper">${this.renderDisplay()}</div>`;let e=this.renderDescription(),t=[this.instructions?"group-instructions":"",e===d?"":"description"].filter(Boolean).join(" ")||void 0,i=this.hoverValue??this.value??0;return l`
|
|
241
|
+
<div id="wrapper">
|
|
242
|
+
${this.renderFormLabels()}
|
|
243
|
+
${this.instructions?l`<span id="group-instructions" hidden
|
|
244
|
+
>${this.instructions}</span
|
|
245
|
+
>`:d}
|
|
246
|
+
<div id="control">
|
|
247
|
+
<div
|
|
248
|
+
id="items"
|
|
249
|
+
part="items"
|
|
250
|
+
role="radiogroup"
|
|
251
|
+
class=${m({preview:this.hoverValue!==void 0})}
|
|
252
|
+
aria-label=${this.label||this.dictionary.rating.label}
|
|
253
|
+
aria-describedby=${M(t)}
|
|
254
|
+
aria-required=${this.required?"true":d}
|
|
255
|
+
aria-readonly=${this.readonly?"true":d}
|
|
256
|
+
aria-disabled=${this.disabled?"true":d}
|
|
257
|
+
aria-invalid=${this.showError?"true":"false"}
|
|
258
|
+
@click=${this.handleClick}
|
|
259
|
+
@change=${this.handleChange}
|
|
260
|
+
@keydown=${this.handleKeydown}
|
|
261
|
+
@pointermove=${this.handlePointerMove}
|
|
262
|
+
@pointerleave=${this.handlePointerLeave}
|
|
263
|
+
>
|
|
264
|
+
${Array.from({length:this.count},(o,r)=>{let u=r+1;return l`
|
|
265
|
+
<span class="item" data-index=${u}>
|
|
266
|
+
${this.renderIcon(Math.min(1,Math.max(0,i-r)))}
|
|
267
|
+
${this.resolvedStep===.5?this.renderRadio(u-.5):d}
|
|
268
|
+
${this.renderRadio(u)}
|
|
269
|
+
</span>
|
|
270
|
+
`})}
|
|
271
|
+
</div>
|
|
272
|
+
${this.renderClear()}
|
|
273
|
+
</div>
|
|
274
|
+
${e}
|
|
275
|
+
</div>
|
|
276
|
+
`}};n.styles=[N,c.base,c.errorMessages,c.hintMessages],a([s({type:Number})],n.prototype,"max",2),a([s({type:Number})],n.prototype,"step",2),a([s({type:Boolean,attribute:"display-only",reflect:!0})],n.prototype,"displayOnly",2),a([s({type:Boolean,reflect:!0})],n.prototype,"clearable",2),a([s({attribute:"clear-label"})],n.prototype,"clearLabel",2),a([s()],n.prototype,"icon",2),a([s({attribute:"empty-icon"})],n.prototype,"emptyIcon",2),a([y()],n.prototype,"hoverValue",2),a([s({type:Number})],n.prototype,"value",1),a([s({attribute:"default-value",type:Number})],n.prototype,"defaultValue",1),a([g("#items")],n.prototype,"itemsEl",2),n=a([v(F)],n);export{n as EunomiaRating,F as EunomiaRatingTagName};
|