@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 x}from"./chunks/chunk-ZBN4HTWP.js";import{a as C}from"./chunks/chunk-BO3JOEWM.js";import{b,c as g,d as E,e as y,f as l}from"./chunks/chunk-TLBXTBMM.js";import{a as v}from"./chunks/chunk-YYCEPZUN.js";import{a as m}from"./chunks/chunk-3BMACIDO.js";import{a as n}from"./chunks/chunk-PPCHQG7P.js";import{a as f}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-QL5GSW2A.js";import{a as s,f as h,h as c,j as p,l as u,p as o,r as a,u as r}from"./chunks/chunk-YITWLCD3.js";var L=c`
|
|
2
2
|
:host {
|
|
3
3
|
--_container-gap: var(--checkbox-list-gap, var(--eun-space-s, 8px));
|
|
4
4
|
--_options-gap: var(--checkbox-list-options-gap, var(--eun-space-s, 8px));
|
|
@@ -7,21 +7,24 @@ import{a as y}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
|
+
`,k=L;var S="eun-checkbox-list",$="eun-checkbox",M="eun-check-card",V=m(y(r)),i=class extends C(E(g(V))){constructor(){super(...arguments);this.errorOnChange=!0;this.inline=!1;this.handleChangeEvent=e=>{e.stopPropagation(),this.sendChangeEvent()}}get fields(){return Array.from(this.querySelectorAll(`:scope > ${$}, :scope > ${M}`))}get value(){return this.fields.filter(e=>e.checked).map(e=>e.valueState??e.value)}set value(e){this.updateComplete.then(()=>{this.fields.forEach(t=>{t.checked=e.includes(t.value)})})}firstUpdated(){if(this.optionsList?.addEventListener("eunchange",this.handleChangeEvent),this.defaultValue&&this.defaultValue.length>0){let e=this.defaultValue??[];this.fields.forEach(t=>{t.checked=e.includes(t.value)}),this.value=this.defaultValue,this.sendChangeEvent()}}disconnectedCallback(){this.optionsList?.removeEventListener("eunchange",this.handleChangeEvent),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.isGroupChange(e,"readonly")&&this.fields.forEach(t=>{t.readonly=this.readonly}),b(e)){let{showError:t}=this;this.fields.forEach(d=>{d.valid=!t,d.validationRequested=t})}e.has("name")&&this.fields.forEach(t=>{t.name=this.name})}getFocusAnchor(){return this.querySelector(`${$}, ${M}`)}focus(){super.focus?.(),this.fields[0]?.focus?.()}formResetCallback(){super.formResetCallback?.(),this.updateComplete.then(()=>{this.sendChangeEvent()})}sendChangeEvent(){this.checkValidity(this.value),this.dispatchEvent(new v(this.value))}handleSlotChange(){this.fields.forEach(e=>{e.name=this.name})}render(){let e=this.renderDescription(),t=[this.instructions?"group-instructions":"",e===a?"":"description"].filter(Boolean).join(" ")||void 0;return o`
|
|
11
|
+
<fieldset id="fieldset" role="presentation">
|
|
12
12
|
<div id="legend">${this.renderFormLabels("options")}</div>
|
|
13
|
+
${this.instructions?o`<span id="group-instructions" hidden
|
|
14
|
+
>${this.instructions}</span
|
|
15
|
+
>`:a}
|
|
13
16
|
<div
|
|
14
17
|
id="options"
|
|
15
18
|
part="options"
|
|
16
19
|
role="group"
|
|
17
|
-
class=${
|
|
20
|
+
class=${f({inline:this.inline})}
|
|
18
21
|
?disabled=${this.disabled}
|
|
19
|
-
aria-
|
|
20
|
-
aria-describedby
|
|
22
|
+
aria-label=${n(this.label)}
|
|
23
|
+
aria-describedby=${n(t)}
|
|
21
24
|
aria-disabled=${this.disabled?"true":"false"}
|
|
22
25
|
>
|
|
23
26
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
24
27
|
</div>
|
|
25
|
-
${
|
|
28
|
+
${e}
|
|
26
29
|
</fieldset>
|
|
27
|
-
`}};
|
|
30
|
+
`}};i.styles=[k,x,l.base,l.errorMessages],i.shadowRootOptions={...r.shadowRootOptions,delegatesFocus:!0},s([p({type:Boolean,reflect:!0})],i.prototype,"inline",2),s([u("#options")],i.prototype,"optionsList",2),i=s([h(S)],i);export{i as EunomiaCheckboxList,S as EunomiaCheckboxListTagName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-TFTRCIIK.js";import"./chunks/chunk-AK2DIJX7.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 EunomiaCheckbox,a as EunomiaCheckboxTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m}from"./chunks/chunk-FF3I7C3C.js";import{a as h}from"./chunks/chunk-YQU6RVX4.js";import{a as
|
|
1
|
+
import{a as m}from"./chunks/chunk-FF3I7C3C.js";import{a as h}from"./chunks/chunk-YQU6RVX4.js";import{a as u}from"./chunks/chunk-UP4M7TER.js";import{a as v}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a,f as l,h as s,j as t,k as p,n as c,p as i,r as n,u as d}from"./chunks/chunk-YITWLCD3.js";var g=s`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
max-width: 100%;
|
|
@@ -142,7 +142,7 @@ import{a as m}from"./chunks/chunk-FF3I7C3C.js";import{a as h}from"./chunks/chunk
|
|
|
142
142
|
:host([disabled]) #chip {
|
|
143
143
|
opacity: 0.6;
|
|
144
144
|
}
|
|
145
|
-
`,b=[m,g];var f="eun-chip",x={s:14,m:16,l:18},S={s:12,m:14,l:16},e=class extends
|
|
145
|
+
`,b=[m,g];var f="eun-chip",x={s:14,m:16,l:18},S={s:12,m:14,l:16},e=class extends v(d){constructor(){super(...arguments);this.color="medium";this.fixedColor=!1;this.appearance="default";this.hideIcon=!1;this.avatarAlt="";this.avatarShape="circle";this.rounded=!0;this.removable=!0;this.disabled=!1;this.labelText="";this.handleIconSlotChange=()=>{this.requestUpdate()};this.updateLabelText=()=>{this.labelText=this.textContent?.trim()??""};this.handleRemove=()=>{this.dispatchEvent(new h)}}connectedCallback(){super.connectedCallback(),this.updateLabelText()}getRemoveLabel(){let r=this.removeLabel??this.dictionary.chip.remove;return this.labelText?`${r} ${this.labelText}`:r}getSize(){return this.size??"m"}getIconName(){if(!this.hideIcon)return u(this.icon,this.severity)}hasIconSlotted(){return!this.hideIcon&&this.iconSlotEls.length>0}getLeadingKind(){return this.avatarSrc||this.avatarInitials?"avatar":this.getIconName()||this.hasIconSlotted()?"icon":"none"}renderLeadingVisual(){let r=this.getSize();if(this.avatarSrc)return i`
|
|
146
146
|
<span id="avatar" data-shape=${this.avatarShape}>
|
|
147
147
|
<img src=${this.avatarSrc} alt=${this.avatarAlt} />
|
|
148
148
|
</span>
|
|
@@ -182,4 +182,4 @@ import{a as m}from"./chunks/chunk-FF3I7C3C.js";import{a as h}from"./chunks/chunk
|
|
|
182
182
|
</eun-button>
|
|
183
183
|
`:n}
|
|
184
184
|
</div>
|
|
185
|
-
`}};e.styles=b,a([t({reflect:!0})],e.prototype,"color",2),a([t({type:Boolean,reflect:!0,attribute:"fixed-color"})],e.prototype,"fixedColor",2),a([t({reflect:!0})],e.prototype,"severity",2),a([t({reflect:!0})],e.prototype,"appearance",2),a([t({reflect:!0})],e.prototype,"size",2),a([t()],e.prototype,"icon",2),a([t({type:Boolean,attribute:"hide-icon"})],e.prototype,"hideIcon",2),a([t({attribute:"avatar-src"})],e.prototype,"avatarSrc",2),a([t({attribute:"avatar-alt"})],e.prototype,"avatarAlt",2),a([t({attribute:"avatar-shape"})],e.prototype,"avatarShape",2),a([t({attribute:"avatar-initials"})],e.prototype,"avatarInitials",2),a([t({type:Boolean,reflect:!0})],e.prototype,"rounded",2),a([t({type:Boolean,reflect:!0})],e.prototype,"removable",2),a([t({type:Boolean,reflect:!0})],e.prototype,"disabled",2),a([t({attribute:"
|
|
185
|
+
`}};e.styles=b,a([t({reflect:!0,useDefault:!0})],e.prototype,"color",2),a([t({type:Boolean,reflect:!0,attribute:"fixed-color"})],e.prototype,"fixedColor",2),a([t({reflect:!0})],e.prototype,"severity",2),a([t({reflect:!0,useDefault:!0})],e.prototype,"appearance",2),a([t({reflect:!0})],e.prototype,"size",2),a([t()],e.prototype,"icon",2),a([t({type:Boolean,attribute:"hide-icon"})],e.prototype,"hideIcon",2),a([t({attribute:"avatar-src"})],e.prototype,"avatarSrc",2),a([t({attribute:"avatar-alt"})],e.prototype,"avatarAlt",2),a([t({attribute:"avatar-shape"})],e.prototype,"avatarShape",2),a([t({attribute:"avatar-initials"})],e.prototype,"avatarInitials",2),a([t({type:Boolean,reflect:!0})],e.prototype,"rounded",2),a([t({type:Boolean,reflect:!0})],e.prototype,"removable",2),a([t({type:Boolean,reflect:!0})],e.prototype,"disabled",2),a([t({attribute:"remove-label"})],e.prototype,"removeLabel",2),a([p()],e.prototype,"labelText",2),a([c({slot:"icon"})],e.prototype,"iconSlotEls",2),e=a([l(f)],e);export{e as EunomiaChip,f as EunomiaChipTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as V}from"./chunks/chunk-GWLD2I3P.js";import{a as u}from"./chunks/chunk-B5XMGWM7.js";import{a as H}from"./chunks/chunk-UVHVQRPT.js";import{a as z,b as B}from"./chunks/chunk-LVKMAHMU.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as R}from"./chunks/chunk-LK5BJ4SH.js";import{a as S}from"./chunks/chunk-UYZR4JXZ.js";import{b as K,c as g}from"./chunks/chunk-624VJYNA.js";import{a as x}from"./chunks/chunk-LYYQAALT.js";import{a as _}from"./chunks/chunk-GVS6IUKC.js";import{a as O}from"./chunks/chunk-BO3JOEWM.js";import{c as D,d as T,e as k,f as m}from"./chunks/chunk-TLBXTBMM.js";import{a as F}from"./chunks/chunk-YYCEPZUN.js";import{a as C}from"./chunks/chunk-3BMACIDO.js";import{a as d}from"./chunks/chunk-PPCHQG7P.js";import{a as p}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as M}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a,f as L,h as I,j as l,k as v,l as f,m as E,p as n,r as o,u as A}from"./chunks/chunk-YITWLCD3.js";var W=I`
|
|
2
2
|
button#field {
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
display: flex;
|
|
@@ -97,7 +97,7 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
97
97
|
outline var(--eun-duration-m, 200ms) var(--eun-easing-out, ease-out),
|
|
98
98
|
border var(--eun-duration-m, 200ms) var(--eun-easing-out, ease-out);
|
|
99
99
|
}
|
|
100
|
-
.swatch-button[aria-
|
|
100
|
+
.swatch-button[aria-selected="true"] .swatch {
|
|
101
101
|
border-color: var(--eun-color-primary-500, #3d6fff);
|
|
102
102
|
border-width: calc(var(--eun-border-width-m, 1.5px) * 2);
|
|
103
103
|
}
|
|
@@ -194,7 +194,7 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
194
194
|
outline: 2px solid var(--_focusIndicator);
|
|
195
195
|
outline-offset: 2px;
|
|
196
196
|
}
|
|
197
|
-
`,
|
|
197
|
+
`,N=[S,z,...x?[]:[B],W];function w($){let c=$.trim();if(!c)return null;if(/^#[0-9a-f]{6}$/i.test(c))return c.toLowerCase();if(/^#[0-9a-f]{3}$/i.test(c)){let[r,s,h]=c.slice(1);return`#${r}${r}${s}${s}${h}${h}`.toLowerCase()}let e=c.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(!e)return null;let i=r=>Math.min(255,Math.max(0,Math.round(Number(r)))).toString(16).padStart(2,"0");return`#${i(e[1])}${i(e[2])}${i(e[3])}`}var q="eun-color-picker",U=C(k(A)),Y=M(R(_(O(T(H(D(U))))))),t=class extends Y{constructor(){super(...arguments);this.swatchesLabel="Presets";this.customLabel="Custom";this.nativeInputLabel="Pick a custom color";this.hexInputLabel="Hex color";this.noAnimation=!1;this.swatchOnly=!1;this.presetsOnly=!1;this.presetsInline=!1;this.isOpen=!1;this.hexDraft="";this.presetFocusIndex=-1;this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.listboxEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.listboxEl,{forceFallback:x}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closeListbox());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility()};this.handleWindowBlur=()=>{this.isOpen&&this.closeListbox()};this.handleFocusOut=()=>{this.isOpen&&requestAnimationFrame(()=>{document.activeElement!==this&&this.closeListbox()})};this.handleConfirmClick=()=>{this.closeListbox(),this.confirmEdit()};this.handleCancelClick=()=>{this.closeListbox(),this.cancelEdit()}}get defaultValue(){return super.defaultValue}set defaultValue(e){let i=Array.isArray(e)?e[0]:e;super.defaultValue=i}get presets(){return V(this.children)}get hexDraftInvalid(){return this.hexDraft!==""&&w(this.hexDraft)===null}get triggerAccessibleLabel(){return this.label?this.label:this.ariaLabel?this.ariaLabel:this.swatchOnly?this.value||(this.emptyValueLabel??this.dictionary.colorPicker.noColor):void 0}connectedCallback(){super.connectedCallback?.(),window.addEventListener("blur",this.handleWindowBlur)}disconnectedCallback(){window.removeEventListener("blur",this.handleWindowBlur),super.disconnectedCallback?.()}willUpdate(e){super.willUpdate(e),e.has("value")&&!this.isOpen&&(this.hexDraft=this.value??"")}get hostTabStop(){return!1}getFocusAnchor(){return this.fieldEl??void 0}focus(){super.focus?.(),this.fieldEl?.focus()}openListbox(){if(this.disabled||this.readonly)return;this.hexDraft=this.value??"";let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")||e?.showPopover(),e&&this.playListboxOpenAnimation(e)}listboxAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:K(e,"--field-listbox-transition-duration","m",200)}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let i=this.listboxAnimationDuration(e);i!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:i,easing:g(e),fill:"forwards"}))}closeListbox(){let e=this.listboxEl;this.listboxAnimation?.cancel(),this.listboxAnimation=void 0,e?.matches(":popover-open")&&this.playListboxCloseAnimation(e)}playListboxCloseAnimation(e){e.style.pointerEvents="none";let i=this.listboxAnimationDuration(e);if(i===0){e.hidePopover();return}let r=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:i,easing:g(e),fill:"forwards"});this.listboxAnimation=r,r.finished.then(()=>{this.listboxAnimation===r&&(this.listboxAnimation=void 0),e.hidePopover()}).catch(()=>{})}handleFieldActivate(){this.isOpen||this.openListbox()}handleFieldKeydown(e){e.key==="ArrowDown"&&!this.isOpen&&(e.preventDefault(),this.openListbox())}handleSelect(e){this.presetFocusIndex=-1,this.value=e,this.hexDraft=e,this.dispatchEvent(new F(this.value)),this.closeListbox()}handlePresetKeydown(e,i){let r=this.presets,s;switch(e.key){case"ArrowRight":case"ArrowDown":s=(i+1)%r.length;break;case"ArrowLeft":case"ArrowUp":s=(i-1+r.length)%r.length;break;case"Home":s=0;break;case"End":s=r.length-1;break;default:return}e.preventDefault(),this.presetFocusIndex=s,this.presetButtonEls[s]?.focus()}handleNativeInput(e){this.handleSelect(e.target.value)}handleHexInput(e){this.hexDraft=e.target.value}handleHexCommit(){let e=w(this.hexDraft);e?this.handleSelect(e):this.hexDraft=this.value??""}handleSlotChange(){this.requestUpdate()}renderEditActions(){return n`
|
|
198
198
|
<div id="edit-actions">
|
|
199
199
|
<eun-button
|
|
200
200
|
class="confirm"
|
|
@@ -204,7 +204,7 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
204
204
|
rounded
|
|
205
205
|
type="button"
|
|
206
206
|
@click=${this.handleConfirmClick}
|
|
207
|
-
>${this.confirmLabel}</eun-button
|
|
207
|
+
>${this.confirmLabel??this.dictionary.common.confirm}</eun-button
|
|
208
208
|
>
|
|
209
209
|
<eun-button
|
|
210
210
|
class="cancel"
|
|
@@ -213,57 +213,57 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
213
213
|
rounded
|
|
214
214
|
type="button"
|
|
215
215
|
@click=${this.handleCancelClick}
|
|
216
|
-
>${this.cancelLabel}</eun-button
|
|
216
|
+
>${this.cancelLabel??this.dictionary.common.cancel}</eun-button
|
|
217
217
|
>
|
|
218
218
|
</div>
|
|
219
|
-
`}renderReadonlyDisplay(){return
|
|
219
|
+
`}renderReadonlyDisplay(){return n`
|
|
220
220
|
<div
|
|
221
221
|
id="readonly-display"
|
|
222
222
|
role="button"
|
|
223
223
|
tabindex="0"
|
|
224
|
-
aria-label=${
|
|
224
|
+
aria-label=${d(this.triggerAccessibleLabel)}
|
|
225
225
|
@click=${this.startEdit}
|
|
226
226
|
@keydown=${e=>(e.key==="Enter"||e.key===" ")&&this.startEdit()}
|
|
227
227
|
>
|
|
228
228
|
<span
|
|
229
|
-
class=${
|
|
230
|
-
style="--_swatchColor: ${
|
|
229
|
+
class=${p({swatch:!0,empty:!this.value})}
|
|
230
|
+
style="--_swatchColor: ${d(this.value)}"
|
|
231
231
|
></span>
|
|
232
|
-
${this.swatchOnly?o:
|
|
233
|
-
<span class=${
|
|
234
|
-
>${this.value||this.emptyValueLabel}</span
|
|
232
|
+
${this.swatchOnly?o:n`
|
|
233
|
+
<span class=${p({empty:!this.value})}
|
|
234
|
+
>${this.value||(this.emptyValueLabel??this.dictionary.colorPicker.noColor)}</span
|
|
235
235
|
>
|
|
236
236
|
`}
|
|
237
237
|
</div>
|
|
238
|
-
`}renderPresets(e){return
|
|
238
|
+
`}renderPresets(e){return n`
|
|
239
239
|
<div>
|
|
240
240
|
<span id="swatches-label">${this.swatchesLabel}</span>
|
|
241
|
-
${this.
|
|
241
|
+
${this.renderSwatchListbox(e,this.swatchesLabel,!1)}
|
|
242
242
|
</div>
|
|
243
|
-
`}
|
|
243
|
+
`}renderSwatchListbox(e,i,r){let s=e.findIndex(b=>b.value===this.value),h=this.presetFocusIndex>=0&&this.presetFocusIndex<e.length?this.presetFocusIndex:Math.max(s,0);return n`
|
|
244
244
|
<div
|
|
245
245
|
id="swatches"
|
|
246
|
-
role="
|
|
247
|
-
aria-label=${
|
|
248
|
-
aria-describedby=${
|
|
246
|
+
role="listbox"
|
|
247
|
+
aria-label=${d(i)}
|
|
248
|
+
aria-describedby=${r?"description":o}
|
|
249
249
|
>
|
|
250
|
-
${e.map((
|
|
250
|
+
${e.map((b,y)=>n`
|
|
251
251
|
<button
|
|
252
252
|
type="button"
|
|
253
253
|
class="swatch-button"
|
|
254
|
-
role="
|
|
255
|
-
aria-
|
|
256
|
-
aria-label=${
|
|
257
|
-
tabindex
|
|
258
|
-
style="--_optionColor: ${
|
|
259
|
-
@click=${()=>this.handleSelect(
|
|
260
|
-
@keydown=${
|
|
254
|
+
role="option"
|
|
255
|
+
aria-selected=${y===s?"true":"false"}
|
|
256
|
+
aria-label=${b.label}
|
|
257
|
+
tabindex=${y===h?"0":"-1"}
|
|
258
|
+
style="--_optionColor: ${b.value}"
|
|
259
|
+
@click=${()=>this.handleSelect(b.value)}
|
|
260
|
+
@keydown=${P=>this.handlePresetKeydown(P,y)}
|
|
261
261
|
>
|
|
262
262
|
<span class="swatch"></span>
|
|
263
263
|
</button>
|
|
264
|
-
`
|
|
264
|
+
`)}
|
|
265
265
|
</div>
|
|
266
|
-
`}renderHexRow(){return
|
|
266
|
+
`}renderHexRow(){return n`
|
|
267
267
|
<div>
|
|
268
268
|
<span id="custom-label">${this.customLabel}</span>
|
|
269
269
|
<input
|
|
@@ -273,31 +273,31 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
273
273
|
aria-invalid=${!this.hideError&&!this.disabled&&this.hexDraftInvalid||this.showError}
|
|
274
274
|
?disabled=${this.disabled}
|
|
275
275
|
?readonly=${this.readonly}
|
|
276
|
-
.value=${
|
|
276
|
+
.value=${u(this.hexDraft)}
|
|
277
277
|
@input=${this.handleHexInput}
|
|
278
278
|
@change=${this.handleHexCommit}
|
|
279
279
|
@keydown=${e=>{e.key==="Enter"&&(e.preventDefault(),this.handleHexCommit())}}
|
|
280
280
|
/>
|
|
281
281
|
</div>
|
|
282
|
-
`}renderInlinePresetsField(e){return
|
|
282
|
+
`}renderInlinePresetsField(e){return n`
|
|
283
283
|
<div id="field-wrapper">
|
|
284
|
-
${this.
|
|
284
|
+
${this.renderSwatchListbox(this.presets,this.triggerAccessibleLabel,e)}
|
|
285
285
|
</div>
|
|
286
286
|
${this.readonlyAvailable?this.renderEditActions():o}
|
|
287
|
-
`}renderInlineCustomField(e){return
|
|
287
|
+
`}renderInlineCustomField(e){return n`
|
|
288
288
|
<div id="field-wrapper">
|
|
289
289
|
<div id="custom-row">
|
|
290
290
|
<label id="native-swatch">
|
|
291
291
|
<span
|
|
292
|
-
class=${
|
|
293
|
-
style="--_swatchColor: ${
|
|
292
|
+
class=${p({swatch:!0,empty:!this.value})}
|
|
293
|
+
style="--_swatchColor: ${d(this.value)}"
|
|
294
294
|
></span>
|
|
295
295
|
<input
|
|
296
296
|
type="color"
|
|
297
297
|
id="native-input"
|
|
298
298
|
aria-label=${this.nativeInputLabel}
|
|
299
299
|
?disabled=${this.disabled||this.readonly}
|
|
300
|
-
.value=${
|
|
300
|
+
.value=${u(this.value||"#000000")}
|
|
301
301
|
@input=${this.handleNativeInput}
|
|
302
302
|
/>
|
|
303
303
|
</label>
|
|
@@ -310,28 +310,28 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
310
310
|
aria-invalid=${!this.hideError&&!this.disabled&&this.hexDraftInvalid||this.showError}
|
|
311
311
|
?disabled=${this.disabled}
|
|
312
312
|
?readonly=${this.readonly}
|
|
313
|
-
.value=${
|
|
313
|
+
.value=${u(this.hexDraft)}
|
|
314
314
|
@input=${this.handleHexInput}
|
|
315
315
|
@change=${this.handleHexCommit}
|
|
316
|
-
@keydown=${
|
|
316
|
+
@keydown=${i=>{i.key==="Enter"&&(i.preventDefault(),this.handleHexCommit())}}
|
|
317
317
|
/>
|
|
318
318
|
</div>
|
|
319
319
|
</div>
|
|
320
320
|
${this.readonlyAvailable?this.renderEditActions():o}
|
|
321
|
-
`}renderField(e){return
|
|
321
|
+
`}renderField(e){return n`
|
|
322
322
|
<div id="field-wrapper">
|
|
323
|
-
${this.presetsOnly?o:
|
|
323
|
+
${this.presetsOnly?o:n`
|
|
324
324
|
<label id="native-swatch">
|
|
325
325
|
<span
|
|
326
|
-
class=${
|
|
327
|
-
style="--_swatchColor: ${
|
|
326
|
+
class=${p({swatch:!0,empty:!this.value})}
|
|
327
|
+
style="--_swatchColor: ${d(this.value)}"
|
|
328
328
|
></span>
|
|
329
329
|
<input
|
|
330
330
|
type="color"
|
|
331
331
|
id="native-input"
|
|
332
332
|
aria-label=${this.nativeInputLabel}
|
|
333
333
|
?disabled=${this.disabled||this.readonly}
|
|
334
|
-
.value=${
|
|
334
|
+
.value=${u(this.value||"#000000")}
|
|
335
335
|
@input=${this.handleNativeInput}
|
|
336
336
|
/>
|
|
337
337
|
</label>
|
|
@@ -339,9 +339,9 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
339
339
|
<button
|
|
340
340
|
type="button"
|
|
341
341
|
id="field"
|
|
342
|
-
aria-haspopup="
|
|
342
|
+
aria-haspopup="dialog"
|
|
343
343
|
aria-expanded=${this.isOpen}
|
|
344
|
-
aria-label=${
|
|
344
|
+
aria-label=${d(this.triggerAccessibleLabel)}
|
|
345
345
|
aria-describedby=${e?"description":o}
|
|
346
346
|
?disabled=${this.disabled}
|
|
347
347
|
aria-required=${this.required?"true":"false"}
|
|
@@ -349,19 +349,19 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
349
349
|
@click=${this.handleFieldActivate}
|
|
350
350
|
@keydown=${this.handleFieldKeydown}
|
|
351
351
|
>
|
|
352
|
-
${this.presetsOnly?
|
|
352
|
+
${this.presetsOnly?n`
|
|
353
353
|
<span
|
|
354
354
|
id="trigger-swatch"
|
|
355
|
-
class=${
|
|
356
|
-
style="--_swatchColor: ${
|
|
355
|
+
class=${p({swatch:!0,empty:!this.value})}
|
|
356
|
+
style="--_swatchColor: ${d(this.value)}"
|
|
357
357
|
></span>
|
|
358
358
|
`:o}
|
|
359
|
-
<span id="value-text" class=${
|
|
360
|
-
${this.value||this.emptyValueLabel}
|
|
359
|
+
<span id="value-text" class=${p({empty:!this.value})}>
|
|
360
|
+
${this.value||(this.emptyValueLabel??this.dictionary.colorPicker.noColor)}
|
|
361
361
|
</span>
|
|
362
362
|
<span
|
|
363
363
|
id="field-arrow"
|
|
364
|
-
class=${
|
|
364
|
+
class=${p({open:this.isOpen})}
|
|
365
365
|
aria-hidden="true"
|
|
366
366
|
>▾</span
|
|
367
367
|
>
|
|
@@ -370,47 +370,39 @@ import{a as P}from"./chunks/chunk-PE4DAXHQ.js";import{a as B}from"./chunks/chunk
|
|
|
370
370
|
${this.readonlyAvailable?this.renderEditActions():o}
|
|
371
371
|
<div
|
|
372
372
|
id="listbox"
|
|
373
|
+
role="dialog"
|
|
373
374
|
popover="auto"
|
|
374
|
-
aria-label=${
|
|
375
|
+
aria-label=${d(this.label)}
|
|
375
376
|
@toggle=${this.handlePopoverToggle}
|
|
376
377
|
>
|
|
377
378
|
${this.renderPresets(this.presets)}
|
|
378
379
|
${this.presetsOnly?o:this.renderHexRow()}
|
|
379
380
|
</div>
|
|
380
|
-
`}renderSwatchOnlyField(e){return
|
|
381
|
+
`}renderSwatchOnlyField(e){return n`
|
|
381
382
|
<div id="field-wrapper">
|
|
382
383
|
<label id="swatch-only-trigger">
|
|
383
384
|
<span
|
|
384
385
|
id="trigger-swatch"
|
|
385
|
-
class=${
|
|
386
|
-
style="--_swatchColor: ${
|
|
386
|
+
class=${p({swatch:!0,empty:!this.value})}
|
|
387
|
+
style="--_swatchColor: ${d(this.value)}"
|
|
387
388
|
></span>
|
|
388
389
|
<input
|
|
389
390
|
type="color"
|
|
390
391
|
id="field"
|
|
391
|
-
aria-label=${
|
|
392
|
+
aria-label=${d(this.triggerAccessibleLabel)}
|
|
392
393
|
aria-describedby=${e?"description":o}
|
|
393
394
|
?disabled=${this.disabled||this.readonly}
|
|
394
395
|
aria-invalid=${this.showError}
|
|
395
|
-
.value=${
|
|
396
|
+
.value=${u(this.value||"#000000")}
|
|
396
397
|
@input=${this.handleNativeInput}
|
|
397
398
|
/>
|
|
398
399
|
</label>
|
|
399
400
|
</div>
|
|
400
401
|
${this.readonlyAvailable?this.renderEditActions():o}
|
|
401
|
-
`}render(){let e=this.readonlyAvailable&&!this.editing,
|
|
402
|
+
`}render(){let e=this.readonlyAvailable&&!this.editing,i=this.renderDescription(),r=i!==o,s,h=this.presets.length>0;return e?s=this.renderReadonlyDisplay():this.swatchOnly?s=this.renderSwatchOnlyField(r):this.presetsInline&&h?s=this.renderInlinePresetsField(r):h?s=this.renderField(r):s=this.renderInlineCustomField(r),n`
|
|
402
403
|
<div id="wrapper" @focusout=${this.handleFocusOut}>
|
|
403
404
|
${this.renderFormLabels(e?void 0:"field")}
|
|
404
|
-
${
|
|
405
|
+
${s} ${i}
|
|
405
406
|
<slot hidden @slotchange=${this.handleSlotChange}></slot>
|
|
406
407
|
</div>
|
|
407
|
-
`}};
|
|
408
|
-
/*! Bundled license information:
|
|
409
|
-
|
|
410
|
-
lit-html/directives/live.js:
|
|
411
|
-
(**
|
|
412
|
-
* @license
|
|
413
|
-
* Copyright 2020 Google LLC
|
|
414
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
415
|
-
*)
|
|
416
|
-
*/
|
|
408
|
+
`}};t.styles=[N,m.base,m.errorMessages,m.hintMessages],a([l({attribute:"default-value"})],t.prototype,"defaultValue",1),a([l({attribute:"empty-value-label"})],t.prototype,"emptyValueLabel",2),a([l({attribute:"swatches-label"})],t.prototype,"swatchesLabel",2),a([l({attribute:"custom-label"})],t.prototype,"customLabel",2),a([l({attribute:"native-input-label"})],t.prototype,"nativeInputLabel",2),a([l({attribute:"hex-input-label"})],t.prototype,"hexInputLabel",2),a([l({attribute:"confirm-label"})],t.prototype,"confirmLabel",2),a([l({attribute:"cancel-label"})],t.prototype,"cancelLabel",2),a([l({type:Boolean,reflect:!0,attribute:"no-animation"})],t.prototype,"noAnimation",2),a([l({type:Boolean,reflect:!0,attribute:"swatch-only"})],t.prototype,"swatchOnly",2),a([l({type:Boolean,reflect:!0,attribute:"presets-only"})],t.prototype,"presetsOnly",2),a([l({type:Boolean,reflect:!0,attribute:"presets-inline"})],t.prototype,"presetsInline",2),a([v()],t.prototype,"isOpen",2),a([v()],t.prototype,"hexDraft",2),a([v()],t.prototype,"presetFocusIndex",2),a([f("#field")],t.prototype,"fieldEl",2),a([f("#field-wrapper")],t.prototype,"fieldWrapperEl",2),a([f("#listbox")],t.prototype,"listboxEl",2),a([E(".swatch-button")],t.prototype,"presetButtonEls",2),t=a([L(q)],t);export{t as EunomiaColorPicker,q as EunomiaColorPickerTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as M}from"./chunks/chunk-L74LXUGL.js";import{a as I,b as _}from"./chunks/chunk-WW4BTWMH.js";import{a as g}from"./chunks/chunk-GVS6IUKC.js";import{a as w}from"./chunks/chunk-BO3JOEWM.js";import{c as v,d as x,e as y,f as d}from"./chunks/chunk-TLBXTBMM.js";import{a as u}from"./chunks/chunk-YYCEPZUN.js";import{a as h}from"./chunks/chunk-3BMACIDO.js";import{a}from"./chunks/chunk-PPCHQG7P.js";import{a as b}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as t,f as c,h as p,j as n,l as m,p as l,r as s,u as f}from"./chunks/chunk-YITWLCD3.js";var L=p`
|
|
2
2
|
:host {
|
|
3
3
|
--_borderColor: var(
|
|
4
4
|
--counter-border-color,
|
|
@@ -181,13 +181,13 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
181
181
|
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
182
182
|
outline: none;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
184
|
+
`,k=L;var C="eun-counter",E=h(y(f)),V=b(g(w(x(v(E))))),i=class extends V{constructor(){super();this.step=1;this.handleImplicitSubmission=e=>{let r=this.internals.form;!r||e.composedPath()[0]!==this.fieldEl||!I(e)||(e.preventDefault(),_(r))};this.checkLocalValidators=()=>M(this.fieldEl,["valueMissing","rangeUnderflow","rangeOverflow","stepMismatch","badInput"]);this.addEventListener("keydown",this.handleImplicitSubmission)}get value(){return super.value}set value(e){super.value=e}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}get hostTabStop(){return!1}getFocusAnchor(){return this.fieldEl??void 0}focus(){super.focus?.(),this.fieldEl?.focus()}roundToStep(e){let r=(String(this.step).split(".")[1]??"").length;return r?Number(e.toFixed(r)):e}clamp(e){let r=e;return this.min!==void 0&&(r=Math.max(r,this.min)),this.max!==void 0&&(r=Math.min(r,this.max)),this.roundToStep(r)}commitValue(e){this.value=e,this.dispatchEvent(new u(this.value))}stepBy(e){if(this.disabled||this.readonly)return;let r=this.value??this.min??0;this.commitValue(this.clamp(r+e*this.step))}handleInput(e){let r=e.target.value,o=r===""?void 0:Number(r);this.value=o===void 0||Number.isNaN(o)?void 0:o,this.dispatchEvent(new u(this.value))}handleKeydown(e){this.disabled||this.readonly||(e.key==="Home"&&this.min!==void 0?(e.preventDefault(),this.commitValue(this.min)):e.key==="End"&&this.max!==void 0&&(e.preventDefault(),this.commitValue(this.max)))}renderField(e){let r=!this.disabled&&!this.readonly&&!(this.value!==void 0&&this.min!==void 0&&this.value<=this.min),o=!this.disabled&&!this.readonly&&!(this.value!==void 0&&this.max!==void 0&&this.value>=this.max),$=!Number.isInteger(this.step);return l`
|
|
185
185
|
<div id="field-wrapper">
|
|
186
186
|
<button
|
|
187
187
|
type="button"
|
|
188
188
|
id="decrement"
|
|
189
189
|
tabindex="-1"
|
|
190
|
-
aria-label=${this.
|
|
190
|
+
aria-label=${this.decrementLabel??this.dictionary.counter.decrement}
|
|
191
191
|
?disabled=${!r}
|
|
192
192
|
@click=${()=>this.stepBy(-1)}
|
|
193
193
|
>
|
|
@@ -200,12 +200,12 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
200
200
|
?disabled=${this.disabled}
|
|
201
201
|
?readonly=${this.readonly}
|
|
202
202
|
?required=${this.required}
|
|
203
|
-
min=${
|
|
204
|
-
max=${
|
|
203
|
+
min=${a(this.min)}
|
|
204
|
+
max=${a(this.max)}
|
|
205
205
|
step=${this.step}
|
|
206
|
-
inputmode=${
|
|
206
|
+
inputmode=${$?"decimal":"numeric"}
|
|
207
207
|
aria-invalid=${this.showError}
|
|
208
|
-
aria-label=${
|
|
208
|
+
aria-label=${a(this.label)}
|
|
209
209
|
aria-describedby=${e?"description":s}
|
|
210
210
|
@input=${this.handleInput}
|
|
211
211
|
@keydown=${this.handleKeydown}
|
|
@@ -214,8 +214,8 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
214
214
|
type="button"
|
|
215
215
|
id="increment"
|
|
216
216
|
tabindex="-1"
|
|
217
|
-
aria-label=${this.
|
|
218
|
-
?disabled=${!
|
|
217
|
+
aria-label=${this.incrementLabel??this.dictionary.counter.increment}
|
|
218
|
+
?disabled=${!o}
|
|
219
219
|
@click=${()=>this.stepBy(1)}
|
|
220
220
|
>
|
|
221
221
|
<eun-icon name="add" size="16"></eun-icon>
|
|
@@ -226,4 +226,4 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
226
226
|
${this.renderFormLabels("field")}
|
|
227
227
|
${this.renderField(e!==s)} ${e}
|
|
228
228
|
</div>
|
|
229
|
-
`}};
|
|
229
|
+
`}};i.styles=[k,d.base,d.errorMessages,d.hintMessages],t([n({type:Number})],i.prototype,"min",2),t([n({type:Number})],i.prototype,"max",2),t([n({type:Number})],i.prototype,"step",2),t([n({attribute:"increment-label"})],i.prototype,"incrementLabel",2),t([n({attribute:"decrement-label"})],i.prototype,"decrementLabel",2),t([n({type:Number})],i.prototype,"value",1),t([n({attribute:"default-value",type:Number})],i.prototype,"defaultValue",1),t([m("#field")],i.prototype,"fieldEl",2),i=t([c(C)],i);export{i as EunomiaCounter,C as EunomiaCounterTagName};
|