@eunomia/elements 1.0.0-beta.4 → 1.0.0-beta.5
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/dist/cdn/components/chunks/{chunk-SIHZFOTK.js → chunk-2XASWWKR.js} +1 -1
- package/dist/cdn/components/chunks/chunk-32DTNR52.js +1 -0
- package/dist/cdn/components/chunks/chunk-3MTUVMM5.js +1 -0
- package/dist/cdn/components/chunks/chunk-5GKM5DIB.js +1 -0
- package/dist/cdn/components/chunks/{chunk-GSJEJLFA.js → chunk-6ETDXUH2.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-EJIX2D4Z.js → chunk-AIS3UICU.js} +7 -7
- package/dist/cdn/components/chunks/{chunk-BMQOI7HX.js → chunk-DKOPI7QA.js} +99 -55
- package/dist/cdn/components/chunks/{chunk-NHFWATVN.js → chunk-EAKYD33D.js} +3 -3
- package/dist/cdn/components/chunks/{chunk-EOWBYZV7.js → chunk-IDKZKLJR.js} +5 -5
- package/dist/cdn/components/chunks/chunk-JRGM3W7I.js +53 -0
- package/dist/cdn/components/chunks/{chunk-UAGCQF23.js → chunk-L65WUTXM.js} +5 -5
- package/dist/cdn/components/chunks/chunk-LFCXUVDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-YGUJJ25C.js → chunk-MPQP4R54.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-RJCJXB7Y.js → chunk-NBIENHLV.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-4MXL6PZC.js → chunk-OW7XKDCH.js} +13 -13
- package/dist/cdn/components/chunks/{chunk-IJ5WFMK4.js → chunk-SD2WHGPF.js} +7 -6
- package/dist/cdn/components/chunks/chunk-SJWRE6PW.js +1 -0
- package/dist/cdn/components/eun-animate.js +5 -3
- package/dist/cdn/components/eun-badge.js +7 -7
- package/dist/cdn/components/eun-breadcrumb-item.js +1 -1
- package/dist/cdn/components/eun-breadcrumb.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +13 -13
- package/dist/cdn/components/eun-card.js +42 -3
- package/dist/cdn/components/eun-carousel.js +2 -2
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +1 -1
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +1 -1
- package/dist/cdn/components/eun-collapse.js +39 -20
- package/dist/cdn/components/eun-color-picker.js +3 -3
- package/dist/cdn/components/eun-counter.js +8 -8
- package/dist/cdn/components/eun-date-picker.js +19 -19
- package/dist/cdn/components/eun-drawer.js +9 -9
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-fab.js +6 -6
- 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 +3 -3
- package/dist/cdn/components/eun-input-file.js +1 -1
- package/dist/cdn/components/eun-input-phone.js +18 -18
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +116 -18
- package/dist/cdn/components/eun-modal.js +15 -15
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +1 -1
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-scheduler-event-editor.js +7 -7
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +18 -18
- package/dist/cdn/components/eun-search.js +15 -15
- package/dist/cdn/components/eun-select.js +2 -2
- package/dist/cdn/components/eun-slider.js +1 -1
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +1 -1
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +1 -1
- package/dist/cdn/components/eun-textarea.js +2 -2
- package/dist/cdn/components/eun-time-picker.js +11 -11
- package/dist/cdn/components/eun-toggle-group.js +30 -22
- package/dist/cdn/components/eun-toggle-item.js +10 -8
- package/dist/cdn/components/eun-toggle.js +1 -1
- package/dist/cdn/components/eun-toolbar.js +1 -1
- package/dist/components/action/button/button.d.ts +44 -17
- package/dist/components/action/button/button.js +100 -22
- package/dist/components/action/button/button.styles.js +77 -39
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +8 -8
- package/dist/components/action/dropdown-button/dropdown-button.js +7 -7
- package/dist/components/action/fab/fab.d.ts +7 -6
- package/dist/components/action/fab/fab.js +11 -8
- package/dist/components/action/fab/fab.styles.js +4 -4
- package/dist/components/action/link/link.d.ts +65 -6
- package/dist/components/action/link/link.js +176 -20
- package/dist/components/action/link/link.styles.js +86 -1
- package/dist/components/action/shared-styles/button-palette.styles.d.ts +3 -3
- package/dist/components/action/shared-styles/button-palette.styles.js +14 -14
- package/dist/components/action/toggle/toggle-group.d.ts +15 -5
- package/dist/components/action/toggle/toggle-group.js +42 -17
- package/dist/components/action/toggle/toggle-group.styles.d.ts +2 -1
- package/dist/components/action/toggle/toggle-group.styles.js +15 -7
- package/dist/components/action/toggle/toggle-item.d.ts +4 -4
- package/dist/components/action/toggle/toggle-item.js +2 -2
- package/dist/components/action/toggle/toggle-item.styles.js +8 -6
- package/dist/components/alert/drawer/drawer.js +1 -1
- package/dist/components/alert/modal/modal.d.ts +8 -8
- package/dist/components/alert/modal/modal.js +11 -11
- package/dist/components/content/badge/badge.d.ts +6 -6
- package/dist/components/content/badge/badge.js +4 -4
- package/dist/components/content/badge/badge.styles.js +4 -4
- package/dist/components/content/card/card.d.ts +32 -4
- package/dist/components/content/card/card.js +64 -4
- package/dist/components/content/card/card.styles.js +33 -1
- package/dist/components/content/card/image-card.d.ts +2 -1
- package/dist/components/content/card/image-card.js +1 -0
- package/dist/components/content/card/sliding-card.d.ts +2 -1
- package/dist/components/content/card/sliding-card.js +1 -0
- package/dist/components/content/collapse/collapse.d.ts +29 -11
- package/dist/components/content/collapse/collapse.js +53 -23
- package/dist/components/content/collapse/collapse.styles.js +13 -0
- package/dist/components/content/icon/icon.d.ts +12 -2
- package/dist/components/content/icon/icon.js +52 -22
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -1
- package/dist/components/content/shared-styles/card-link.styles.js +1 -0
- package/dist/components/form/color-picker/color-picker.d.ts +3 -3
- package/dist/components/form/color-picker/color-picker.js +4 -4
- package/dist/components/form/counter/counter.d.ts +3 -3
- package/dist/components/form/counter/counter.js +3 -3
- package/dist/components/form/counter/counter.styles.js +5 -5
- package/dist/components/form/date-picker/date-picker.d.ts +3 -3
- package/dist/components/form/date-picker/date-picker.js +3 -3
- package/dist/components/form/date-picker/date-picker.styles.js +5 -5
- package/dist/components/form/input/input.d.ts +3 -3
- package/dist/components/form/input/input.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +3 -3
- package/dist/components/form/input-phone/input-phone.js +3 -3
- package/dist/components/form/input-phone/input-phone.styles.js +12 -12
- package/dist/components/form/search/search.styles.js +3 -3
- package/dist/components/form/select/select.d.ts +3 -3
- package/dist/components/form/select/select.js +3 -3
- package/dist/components/form/shared-styles/field.styles.js +5 -5
- package/dist/components/form/textarea/textarea.d.ts +3 -3
- package/dist/components/form/textarea/textarea.js +4 -4
- package/dist/components/form/time-picker/time-picker.d.ts +3 -3
- package/dist/components/form/time-picker/time-picker.js +3 -3
- package/dist/components/form/time-picker/time-picker.styles.js +5 -5
- package/dist/components/layout/animate/animate.d.ts +8 -0
- package/dist/components/layout/animate/animate.js +20 -8
- package/dist/features/scheduler/calendar/calendar.d.ts +6 -6
- package/dist/features/scheduler/calendar/calendar.js +9 -9
- package/dist/features/scheduler/scheduler/scheduler.d.ts +6 -6
- package/dist/features/scheduler/scheduler/scheduler.js +13 -13
- package/dist/features/scheduler/scheduler-event/scheduler-event.d.ts +10 -8
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +7 -7
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +6 -6
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +5 -5
- package/dist/features/scheduler/shared/scheduler-event-popover.js +2 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.d.ts +2 -2
- package/dist/features/scheduler/shared/scheduler-hour-grid.js +3 -3
- package/dist/features/scheduler/shared/scheduler-month-view.d.ts +3 -3
- package/dist/features/scheduler/shared/scheduler-month-view.js +2 -2
- package/dist/features/table/table/table.types.d.ts +7 -3
- package/dist/features/table/table-action-bar/table-action-bar.js +3 -3
- package/dist/features/table/table-managed/table-managed.js +2 -2
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/fr.js +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/jsx.d.ts +1 -1
- package/dist/mixins/button.mixin.d.ts +10 -9
- package/dist/mixins/button.mixin.js +14 -6
- package/dist/mixins/card-link.mixin.d.ts +3 -2
- package/dist/mixins/card-link.mixin.js +12 -5
- package/dist/mixins/disabled.mixin.d.ts +3 -3
- package/dist/mixins/disabled.mixin.js +10 -5
- package/dist/mixins/field-appearance.mixin.d.ts +19 -0
- package/dist/mixins/{field-variant.mixin.js → field-appearance.mixin.js} +11 -11
- package/dist/ssr/animate-ssr.css +26 -72
- package/dist/ssr/links-ssr.css +35 -0
- package/dist/ssr/overlay-ssr.css +0 -41
- package/dist/ssr/rich-text.css +38 -0
- package/dist/ssr/sidebar-ssr.css +0 -38
- package/dist/ssr/toolbar-ssr.css +73 -39
- package/dist/types/variant.type.d.ts +26 -10
- package/dist/utils/navigation.utils.d.ts +14 -0
- package/dist/utils/navigation.utils.js +33 -0
- package/dist/utils/new-tab-anchor.controller.d.ts +44 -0
- package/dist/utils/new-tab-anchor.controller.js +102 -0
- package/dist/utils/severity-icon.utils.d.ts +1 -1
- package/dist/utils/severity-icon.utils.js +1 -1
- package/dist/utils/theme-generator.utils.d.ts +3 -1
- package/dist/utils/theme-generator.utils.js +3 -1
- package/package.json +8 -2
- package/dist/cdn/components/chunks/chunk-2JLDJFYD.js +0 -48
- package/dist/cdn/components/chunks/chunk-ATH2OAMU.js +0 -1
- package/dist/cdn/components/chunks/chunk-BKHD4S57.js +0 -1
- package/dist/cdn/components/chunks/chunk-T7WABJEJ.js +0 -1
- package/dist/cdn/components/chunks/chunk-XSMCT4DF.js +0 -1
- package/dist/mixins/field-variant.mixin.d.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as y}from"./chunks/chunk-UDOZRIJZ.js";import{b as u}from"./chunks/chunk-LYYQAALT.js";import{a as s}from"./chunks/chunk-YYCEPZUN.js";import{e as m}from"./chunks/chunk-LGLQ36QB.js";import{a as c}from"./chunks/chunk-A4EQSU36.js";import"./chunks/chunk-SGM2X2TC.js";import{a as t,f as v,g as f,h as o,i as g,j as l,l as d,n as r,p as i,s as b}from"./chunks/chunk-XH6NREVZ.js";var x=f`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: 100%;
|
|
@@ -115,11 +115,24 @@ import{a as g}from"./chunks/chunk-UDOZRIJZ.js";import{b as p}from"./chunks/chunk
|
|
|
115
115
|
text-overflow: ellipsis;
|
|
116
116
|
font-size: var(--eun-font-size-s, 14px);
|
|
117
117
|
}
|
|
118
|
+
#heading ::slotted(*) {
|
|
119
|
+
margin: 0;
|
|
120
|
+
font: inherit;
|
|
121
|
+
color: inherit;
|
|
122
|
+
}
|
|
118
123
|
#subheading {
|
|
119
124
|
font-size: var(--eun-font-size-xs, 14px);
|
|
120
125
|
font-weight: var(--eun-font-weight-m);
|
|
121
126
|
color: var(--_subheadingColor);
|
|
122
127
|
}
|
|
128
|
+
#subheading.hidden {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
#subheading ::slotted(*) {
|
|
132
|
+
margin: 0;
|
|
133
|
+
font: inherit;
|
|
134
|
+
color: inherit;
|
|
135
|
+
}
|
|
123
136
|
#actions {
|
|
124
137
|
display: flex;
|
|
125
138
|
align-items: center;
|
|
@@ -201,7 +214,13 @@ import{a as g}from"./chunks/chunk-UDOZRIJZ.js";import{b as p}from"./chunks/chunk
|
|
|
201
214
|
transition: none;
|
|
202
215
|
}
|
|
203
216
|
}
|
|
204
|
-
`;var
|
|
217
|
+
`;var w="eun-collapse",n=class extends b{constructor(){super(...arguments);this.chevronIcon="add";this.open=!1;this.disabled=!1;this.independent=!1;this.panelHidden=!1;this.deferPanelHidden=!1;this.openedViaFocus=!1;this.handleSlotChange=()=>{this.requestUpdate()};this.handlePanelTransitionEnd=e=>{e.target!==this.panelEl||e.propertyName!=="grid-template-rows"||(this.panelEl?.removeEventListener("transitionend",this.handlePanelTransitionEnd),this.open||(this.panelHidden=!0))};this.toggle=()=>{this.disabled||(this.openedViaFocus=!1,this.open=!this.open,this.dispatchEvent(new s))};this.handleBeforeMatch=()=>{this.open=!0,this.dispatchEvent(new s)};this.handleHeaderKeydown=e=>{if(e.key!=="Tab"||e.shiftKey||this.open||!this.panelContentEl)return;let[a]=y(this.panelContentEl,{requireRendered:!1});a&&(e.preventDefault(),this.openedViaFocus=!0,this.open=!0,this.dispatchEvent(new s),this.updateComplete.then(()=>a.focus()))};this.handleFocusOut=e=>{!this.openedViaFocus||e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||(this.openedViaFocus=!1,this.open=!1,this.dispatchEvent(new s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("focusout",this.handleFocusOut)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focusout",this.handleFocusOut),this.panelEl?.removeEventListener("transitionend",this.handlePanelTransitionEnd)}willUpdate(e){if(!e.has("open")&&!e.has("disabled")){this.deferPanelHidden=!1;return}let a=e.get("open");if(!(!this.open&&!this.disabled&&u)){this.panelHidden=!1,this.deferPanelHidden=!1;return}let h=a===!0&&!this.open,_=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!h||_){this.panelHidden=!0,this.deferPanelHidden=!1;return}this.deferPanelHidden=!0}updated(e){super.updated(e),e.has("open")&&!this.open&&document.activeElement&&this.contains(document.activeElement)&&this.headerEl?.focus(),this.deferPanelHidden&&this.panelEl?.addEventListener("transitionend",this.handlePanelTransitionEnd)}renderHeadingWrapper(e){switch(this.level){case 2:return r`<h2>${e}</h2>`;case 3:return r`<h3>${e}</h3>`;case 4:return r`<h4>${e}</h4>`;case 5:return r`<h5>${e}</h5>`;case 6:return r`<h6>${e}</h6>`;default:return e}}renderTag(){let e=[...this.querySelectorAll(':scope > [slot="tag"]')],a=e.some(h=>h.localName.includes("-")),p=r`<slot name="tag" @slotchange=${this.handleSlotChange}
|
|
218
|
+
>${this.tag}</slot
|
|
219
|
+
>`;return a?p:!this.tag&&!e.length?r`<slot
|
|
220
|
+
name="tag"
|
|
221
|
+
class="hidden"
|
|
222
|
+
@slotchange=${this.handleSlotChange}
|
|
223
|
+
></slot>`:r`<eun-tag color="primary" size="s" rounded>${p}</eun-tag>`}render(){let e=r`
|
|
205
224
|
<button
|
|
206
225
|
type="button"
|
|
207
226
|
id="header"
|
|
@@ -217,26 +236,26 @@ import{a as g}from"./chunks/chunk-UDOZRIJZ.js";import{b as p}from"./chunks/chunk
|
|
|
217
236
|
class=${c({hidden:!this.icon&&!this.iconSlotEls.length})}
|
|
218
237
|
@slotchange=${this.handleSlotChange}
|
|
219
238
|
>
|
|
220
|
-
${this.icon?r`<eun-icon name=${this.icon} size="20"></eun-icon>`:
|
|
239
|
+
${this.icon?r`<eun-icon name=${this.icon} size="20"></eun-icon>`:i}
|
|
221
240
|
</slot>
|
|
222
241
|
<span id="heading-group">
|
|
223
|
-
<span id="heading"
|
|
224
|
-
|
|
242
|
+
<span id="heading"
|
|
243
|
+
><slot name="heading">${this.heading}</slot></span
|
|
244
|
+
>
|
|
245
|
+
<span
|
|
246
|
+
id="subheading"
|
|
247
|
+
class=${c({hidden:!this.subheading&&!this.subheadingSlotEls.length})}
|
|
248
|
+
><slot name="subheading" @slotchange=${this.handleSlotChange}
|
|
249
|
+
>${this.subheading}</slot
|
|
250
|
+
></span
|
|
251
|
+
>
|
|
225
252
|
</span>
|
|
226
253
|
</span>
|
|
227
254
|
<span id="actions">
|
|
228
|
-
|
|
229
|
-
name="tag"
|
|
230
|
-
class=${c({hidden:!this.tag&&!this.tagSlotEls.length})}
|
|
231
|
-
@slotchange=${this.handleSlotChange}
|
|
232
|
-
>
|
|
233
|
-
${this.tag?r`<eun-tag color="primary" size="s" rounded
|
|
234
|
-
>${this.tag}</eun-tag
|
|
235
|
-
>`:a}
|
|
236
|
-
</slot>
|
|
255
|
+
${this.renderTag()}
|
|
237
256
|
<span id="chevron">
|
|
238
257
|
<slot name="chevron" @slotchange=${this.handleSlotChange}>
|
|
239
|
-
${this.chevronSlotEls.length?
|
|
258
|
+
${this.chevronSlotEls.length?i:r`<eun-icon
|
|
240
259
|
name=${this.chevronIcon}
|
|
241
260
|
size="20"
|
|
242
261
|
></eun-icon>`}
|
|
@@ -249,18 +268,18 @@ import{a as g}from"./chunks/chunk-UDOZRIJZ.js";import{b as p}from"./chunks/chunk
|
|
|
249
268
|
${this.renderHeadingWrapper(e)}
|
|
250
269
|
<div
|
|
251
270
|
id="panel"
|
|
252
|
-
?inert=${!this.open&&(this.disabled||!
|
|
253
|
-
hidden=${this.panelHidden?"until-found":
|
|
271
|
+
?inert=${!this.open&&(this.disabled||!u)}
|
|
272
|
+
hidden=${this.panelHidden?"until-found":i}
|
|
254
273
|
@beforematch=${this.handleBeforeMatch}
|
|
255
274
|
>
|
|
256
275
|
<div id="panel-inner">
|
|
257
276
|
<div id="panel-content">
|
|
258
277
|
${this.richText?r`<div id="rich-text">
|
|
259
|
-
${
|
|
260
|
-
</div>`:
|
|
278
|
+
${m(this.richText)}
|
|
279
|
+
</div>`:i}
|
|
261
280
|
<slot></slot>
|
|
262
281
|
</div>
|
|
263
282
|
</div>
|
|
264
283
|
</div>
|
|
265
284
|
</div>
|
|
266
|
-
`}};
|
|
285
|
+
`}};n.styles=[x],t([o()],n.prototype,"heading",2),t([o()],n.prototype,"subheading",2),t([o({type:Number})],n.prototype,"level",2),t([o()],n.prototype,"icon",2),t([o()],n.prototype,"tag",2),t([o({attribute:"chevron-icon"})],n.prototype,"chevronIcon",2),t([o({attribute:"rich-text"})],n.prototype,"richText",2),t([o({type:Boolean,reflect:!0})],n.prototype,"open",2),t([o({type:Boolean,reflect:!0})],n.prototype,"disabled",2),t([o({type:Boolean,reflect:!0})],n.prototype,"independent",2),t([l("#header")],n.prototype,"headerEl",2),t([l("#panel-content")],n.prototype,"panelContentEl",2),t([l("#panel")],n.prototype,"panelEl",2),t([g()],n.prototype,"panelHidden",2),t([d({slot:"icon"})],n.prototype,"iconSlotEls",2),t([d({slot:"subheading"})],n.prototype,"subheadingSlotEls",2),t([d({slot:"chevron"})],n.prototype,"chevronSlotEls",2),n=t([v(w)],n);export{n as EunomiaCollapse,w as EunomiaCollapseTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunks/chunk-KBH5PCUO.js";import{a as _}from"./chunks/chunk-E4IS25H7.js";import{a as
|
|
1
|
+
import{a as P}from"./chunks/chunk-KBH5PCUO.js";import{a as _}from"./chunks/chunk-E4IS25H7.js";import{a as N,b as V}from"./chunks/chunk-5XJGYXW7.js";import{a as k,b as H}from"./chunks/chunk-T4PTHUYF.js";import{a as S}from"./chunks/chunk-LK5BJ4SH.js";import{a as z}from"./chunks/chunk-L65WUTXM.js";import{a as x}from"./chunks/chunk-LYYQAALT.js";import{a as B}from"./chunks/chunk-LFCXUVDO.js";import{a as F}from"./chunks/chunk-GW3VP2L7.js";import{a as O,c as D,d as R,e as y}from"./chunks/chunk-OAULRKHQ.js";import{a as C}from"./chunks/chunk-YYCEPZUN.js";import{a as M}from"./chunks/chunk-32DTNR52.js";import{a as c}from"./chunks/chunk-A4EQSU36.js";import{a as b,b as I,c as T}from"./chunks/chunk-SGM2X2TC.js";import{a as h}from"./chunks/chunk-5EVP7YNE.js";import{a as s,f as $,g as L,h as p,i as g,j as m,k as E,n as d,o as v,p as l,s as A}from"./chunks/chunk-XH6NREVZ.js";var f=I(class extends T{constructor(n){if(super(n),n.type!==b.PROPERTY&&n.type!==b.ATTRIBUTE&&n.type!==b.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!k(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[o]){if(o===v||o===l)return o;let e=n.element,t=n.name;if(n.type===b.PROPERTY){if(o===e[t])return v}else if(n.type===b.BOOLEAN_ATTRIBUTE){if(!!o===e.hasAttribute(t))return v}else if(n.type===b.ATTRIBUTE&&e.getAttribute(t)===o+"")return v;return H(n),o}});var U=L`
|
|
2
2
|
button#field {
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
display: flex;
|
|
@@ -193,12 +193,12 @@ import{a as P}from"./chunks/chunk-KBH5PCUO.js";import{a as _}from"./chunks/chunk
|
|
|
193
193
|
outline: 2px solid var(--_focusIndicator);
|
|
194
194
|
outline-offset: 2px;
|
|
195
195
|
}
|
|
196
|
-
`,K=[
|
|
196
|
+
`,K=[z,N,...x?[]:[V],U];function w(n){let o=n.trim();if(!o)return null;if(/^#[0-9a-f]{6}$/i.test(o))return o.toLowerCase();if(/^#[0-9a-f]{3}$/i.test(o)){let[i,r,u]=o.slice(1);return`#${i}${i}${r}${r}${u}${u}`.toLowerCase()}let e=o.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i);if(!e)return null;let t=i=>Math.min(255,Math.max(0,Math.round(Number(i)))).toString(16).padStart(2,"0");return`#${t(e[1])}${t(e[2])}${t(e[3])}`}var Y="eun-color-picker",j=M(R(A)),G=S(B(F(O(_(D(j)))))),a=class extends G{constructor(){super(...arguments);this.emptyValueLabel="No color selected";this.swatchesLabel="Presets";this.customLabel="Custom";this.nativeInputLabel="Pick a custom color";this.hexInputLabel="Hex color";this.confirmLabel="Confirm";this.cancelLabel="Cancel";this.noAnimation=!1;this.swatchOnly=!1;this.presetsOnly=!1;this.presetsInline=!1;this.isOpen=!1;this.hexDraft="";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 t=Array.isArray(e)?e[0]:e;super.defaultValue=t}get presets(){return P(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: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??"")}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){if(this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 0;let t=getComputedStyle(e).getPropertyValue("--field-listbox-transition-duration").trim();if(t){let i=t.endsWith("ms")?Number.parseFloat(t):Number.parseFloat(t)*1e3;if(Number.isFinite(i)&&i>=0)return i}return 200}playListboxOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.listboxAnimationDuration(e);t!==0&&(this.listboxAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:"ease",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 t=this.listboxAnimationDuration(e);if(t===0){e.hidePopover();return}let i=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:"ease",fill:"forwards"});this.listboxAnimation=i,i.finished.then(()=>{this.listboxAnimation===i&&(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.value=e,this.hexDraft=e,this.dispatchEvent(new C(this.value)),this.closeListbox()}handlePresetKeydown(e,t){let i=this.presets,r;switch(e.key){case"ArrowRight":case"ArrowDown":r=(t+1)%i.length;break;case"ArrowLeft":case"ArrowUp":r=(t-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;default:return}e.preventDefault(),this.presetButtonEls[r]?.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 d`
|
|
197
197
|
<div id="edit-actions">
|
|
198
198
|
<eun-button
|
|
199
199
|
class="confirm"
|
|
200
200
|
size="s"
|
|
201
|
-
|
|
201
|
+
color="primary"
|
|
202
202
|
appearance="default"
|
|
203
203
|
rounded
|
|
204
204
|
type="button"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk-
|
|
1
|
+
import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk-LFCXUVDO.js";import{a as y}from"./chunks/chunk-GW3VP2L7.js";import{a as h,c as v,d as x,e as d}from"./chunks/chunk-OAULRKHQ.js";import{a as u}from"./chunks/chunk-YYCEPZUN.js";import{a as m}from"./chunks/chunk-32DTNR52.js";import{a as o}from"./chunks/chunk-5EVP7YNE.js";import{a as i,f as c,g as p,h as n,j as b,n as l,p as s,s as f}from"./chunks/chunk-XH6NREVZ.js";var k=p`
|
|
2
2
|
:host {
|
|
3
3
|
--_borderColor: var(
|
|
4
4
|
--counter-border-color,
|
|
@@ -162,25 +162,25 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
162
162
|
cursor: default;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
:host([
|
|
165
|
+
:host([appearance="flat"]) {
|
|
166
166
|
--_background: var(--counter-background, var(--eun-content-hover, #edeff0));
|
|
167
167
|
}
|
|
168
|
-
:host([
|
|
168
|
+
:host([appearance="flat"]) #field-wrapper:not(:focus-within) {
|
|
169
169
|
border-color: transparent;
|
|
170
170
|
}
|
|
171
|
-
:host([
|
|
171
|
+
:host([appearance="flat"]) #field-wrapper:has(#field[aria-invalid="true"]) {
|
|
172
172
|
box-shadow: inset 0 0 0 var(--eun-border-width-m, 1.5px) var(--_errorColor);
|
|
173
173
|
}
|
|
174
|
-
:host([
|
|
174
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
175
175
|
border: none;
|
|
176
176
|
outline: none;
|
|
177
177
|
border-radius: 0;
|
|
178
178
|
border-bottom: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
179
179
|
}
|
|
180
|
-
:host([
|
|
180
|
+
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
181
181
|
outline: none;
|
|
182
182
|
}
|
|
183
|
-
`,M=k;var I="eun-counter",$=m(x(f)),C=w(y(h(v($)))),
|
|
183
|
+
`,M=k;var I="eun-counter",$=m(x(f)),C=w(y(h(v($)))),t=class extends C{constructor(){super(...arguments);this.step=1;this.ariaLabelIncrement="Increase value";this.ariaLabelDecrement="Decrease value";this.handleHostFocus=()=>{this.fieldEl?.focus()};this.checkLocalValidators=()=>g(this.fieldEl,["valueMissing","rangeUnderflow","rangeOverflow","stepMismatch","badInput"])}get value(){return super.value}set value(e){super.value=e}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.addEventListener("focus",this.handleHostFocus)}disconnectedCallback(){this.removeEventListener("focus",this.handleHostFocus),super.disconnectedCallback?.()}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,a=r===""?void 0:Number(r);this.value=a===void 0||Number.isNaN(a)?void 0:a,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),a=!this.disabled&&!this.readonly&&!(this.value!==void 0&&this.max!==void 0&&this.value>=this.max),_=!Number.isInteger(this.step);return l`
|
|
184
184
|
<div id="field-wrapper">
|
|
185
185
|
<button
|
|
186
186
|
type="button"
|
|
@@ -225,4 +225,4 @@ import{a as g}from"./chunks/chunk-L74LXUGL.js";import{a as w}from"./chunks/chunk
|
|
|
225
225
|
${this.renderFormLabels("field")}
|
|
226
226
|
${this.renderField(e!==s)} ${e}
|
|
227
227
|
</div>
|
|
228
|
-
`}};
|
|
228
|
+
`}};t.styles=[M,d.base,d.errorMessages,d.hintMessages],i([n({type:Number})],t.prototype,"min",2),i([n({type:Number})],t.prototype,"max",2),i([n({type:Number})],t.prototype,"step",2),i([n({attribute:"aria-label-increment"})],t.prototype,"ariaLabelIncrement",2),i([n({attribute:"aria-label-decrement"})],t.prototype,"ariaLabelDecrement",2),i([n({type:Number})],t.prototype,"value",1),i([n({attribute:"default-value",type:Number})],t.prototype,"defaultValue",1),i([b("#field")],t.prototype,"fieldEl",2),t=i([c(I)],t);export{t as EunomiaCounter,I as EunomiaCounterTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as ee,k as Ye,l as te,m as K,n as ae,o as Ae,p as Le,q as Pe,r as Re,s as Fe}from"./chunks/chunk-S2UCEWNG.js";import"./chunks/chunk-SD2H5UDZ.js";import
|
|
1
|
+
import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as ee,k as Ye,l as te,m as K,n as ae,o as Ae,p as Le,q as Pe,r as Re,s as Fe}from"./chunks/chunk-S2UCEWNG.js";import"./chunks/chunk-SD2H5UDZ.js";import"./chunks/chunk-T4PTHUYF.js";import{a as xe}from"./chunks/chunk-LK5BJ4SH.js";import{a as Se}from"./chunks/chunk-L65WUTXM.js";import{a as q}from"./chunks/chunk-LYYQAALT.js";import{a as De}from"./chunks/chunk-LFCXUVDO.js";import{a as ye}from"./chunks/chunk-GW3VP2L7.js";import{a as ve,c as fe,d as be,e as E}from"./chunks/chunk-OAULRKHQ.js";import{a as z}from"./chunks/chunk-YYCEPZUN.js";import{a as ce}from"./chunks/chunk-32DTNR52.js";import{a as b,c as B,d as y,e as X,f as F,g as Q,h as $,k as w,l as g,m as H,n as T,o as L,p as pe,q as O,r as N,s as me,t as ge}from"./chunks/chunk-MJ4RDZLL.js";import{a as A}from"./chunks/chunk-A4EQSU36.js";import"./chunks/chunk-SGM2X2TC.js";import{a as he}from"./chunks/chunk-SJWRE6PW.js";import"./chunks/chunk-5EVP7YNE.js";import{a as s,f as de,g as S,h,i as v,j as R,n as u,p as Y,s as ue}from"./chunks/chunk-XH6NREVZ.js";var Ue=["day","month","year"];function Ke(r){let e=new Intl.DateTimeFormat(r,{day:"numeric",month:"numeric",year:"numeric"}).formatToParts(new Date(2e3,0,2)).map(t=>t.type).filter(t=>t==="day"||t==="month"||t==="year");return e.length===3?e:Ue}function j(r){switch(r){case"year":return["year"];case"month":return["month","year"];default:return["day","month","year"]}}function re(r,n=["day","month","year"]){let e=Number(r.year);if(!Number.isInteger(e)||e<1)return null;let t=n.includes("month"),a=t?Number(r.month):1;if(t&&(!Number.isInteger(a)||a<1||a>12))return null;let i=n.includes("day"),l=i?Number(r.day):1;if(i&&(!Number.isInteger(l)||l<1||l>31))return null;let d=new Date(e,a-1,l);return d.getFullYear()!==e||d.getMonth()!==a-1||i&&d.getDate()!==l?null:d}function Ge(r,n=["day","month","year"]){return n.every(e=>r[e].length===(e==="year"?4:2))}function G(r){return r?{day:String(r.getDate()).padStart(2,"0"),month:String(r.getMonth()+1).padStart(2,"0"),year:String(r.getFullYear()).padStart(4,"0")}:{day:"",month:"",year:""}}var Oe=S`
|
|
2
2
|
#calendar {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -219,7 +219,7 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
219
219
|
var(--eun-text-disabled-color, #8d93aa)
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
`;var
|
|
222
|
+
`;var Ie=S`
|
|
223
223
|
.calendar-row.row-3 {
|
|
224
224
|
grid-template-columns: repeat(3, 1fr);
|
|
225
225
|
}
|
|
@@ -230,7 +230,7 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
230
230
|
border-radius: var(--_cellRadius);
|
|
231
231
|
text-transform: capitalize;
|
|
232
232
|
}
|
|
233
|
-
`;var
|
|
233
|
+
`;var Ve=S`
|
|
234
234
|
.calendar-row.row-3 {
|
|
235
235
|
grid-template-columns: repeat(3, 1fr);
|
|
236
236
|
}
|
|
@@ -287,22 +287,22 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
287
287
|
:host([aria-invalid="true"]) #field-wrapper:focus-within {
|
|
288
288
|
outline-color: var(--_errorColor);
|
|
289
289
|
}
|
|
290
|
-
:host([
|
|
290
|
+
:host([appearance="flat"]) {
|
|
291
291
|
--_background: var(--field-background, var(--eun-content-hover, #edeff0));
|
|
292
292
|
}
|
|
293
|
-
:host([
|
|
293
|
+
:host([appearance="flat"]) #field-wrapper {
|
|
294
294
|
border-color: transparent;
|
|
295
295
|
}
|
|
296
|
-
:host([
|
|
296
|
+
:host([appearance="flat"][aria-invalid="true"]) #field-wrapper {
|
|
297
297
|
box-shadow: inset 0 0 0 var(--eun-border-width-m, 1.5px) var(--_errorColor);
|
|
298
298
|
}
|
|
299
|
-
:host([
|
|
299
|
+
:host([appearance="underline"]) #field-wrapper {
|
|
300
300
|
border: none;
|
|
301
301
|
outline: none;
|
|
302
302
|
border-bottom: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
303
303
|
border-radius: 0;
|
|
304
304
|
}
|
|
305
|
-
:host([
|
|
305
|
+
:host([appearance="underline"]) #field-wrapper:focus-within {
|
|
306
306
|
outline: none;
|
|
307
307
|
}
|
|
308
308
|
.segment-group {
|
|
@@ -515,7 +515,7 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
515
515
|
bottom: calc(anchor(top) + 4px);
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
`,ze=Xe;function Ee(r){let{displayedMonth:n,weekStartsOn:e,hideWeekends:t,locale:a,todayLabel:i,previousMonthLabel:l,chooseMonthYearLabel:d,nextMonthLabel:c}=r,p=
|
|
518
|
+
`,ze=Xe;function Ee(r){let{displayedMonth:n,weekStartsOn:e,hideWeekends:t,locale:a,todayLabel:i,previousMonthLabel:l,chooseMonthYearLabel:d,nextMonthLabel:c}=r,p=me(n,e),k=Ze(e,t,a),D=t?"row-5":"row-7";return u`
|
|
519
519
|
<div id="calendar">
|
|
520
520
|
<div id="calendar-header">
|
|
521
521
|
<button
|
|
@@ -566,17 +566,17 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
566
566
|
</button>
|
|
567
567
|
</div>
|
|
568
568
|
</div>
|
|
569
|
-
`}function ie(r,n,e,t){return n&&b(r).getTime()<b(n).getTime()||e&&b(r).getTime()>b(e).getTime()?!0:!!t?.(r)}function Qe(r,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,i=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":H(r,a),"range-end":H(r,i),"in-range":N(b(r),b(a),b(i))}}function qe(r,n){let{mode:e,displayedMonth:t,value:a,rangeValue:i,hoverDate:l,focusedDate:d,locale:c,minDate:p,maxDate:k,isDateDisabled:D,onDayClick:m,onDayHover:f,onDayKeydown:M}=n,x=ie(r,p,k,D),C=e==="single"&&!!a&&H(r,a),P=e==="range"?Qe(r,i,l):{"range-start":!1,"range-end":!1,"in-range":!1},
|
|
569
|
+
`}function ie(r,n,e,t){return n&&b(r).getTime()<b(n).getTime()||e&&b(r).getTime()>b(e).getTime()?!0:!!t?.(r)}function Qe(r,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,i=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":H(r,a),"range-end":H(r,i),"in-range":N(b(r),b(a),b(i))}}function qe(r,n){let{mode:e,displayedMonth:t,value:a,rangeValue:i,hoverDate:l,focusedDate:d,locale:c,minDate:p,maxDate:k,isDateDisabled:D,onDayClick:m,onDayHover:f,onDayKeydown:M}=n,x=ie(r,p,k,D),C=e==="single"&&!!a&&H(r,a),P=e==="range"?Qe(r,i,l):{"range-start":!1,"range-end":!1,"in-range":!1},V=()=>{x||m(r)},U=()=>{x||f(r)};return u`
|
|
570
570
|
<button
|
|
571
571
|
type="button"
|
|
572
|
-
class=${A({"grid-cell":!0,"cell-day":!0,outside:!T(r,t),today:
|
|
572
|
+
class=${A({"grid-cell":!0,"cell-day":!0,outside:!T(r,t),today:pe(r),selected:C,...P})}
|
|
573
573
|
role="gridcell"
|
|
574
574
|
tabindex=${H(r,d)?"0":"-1"}
|
|
575
575
|
?disabled=${x}
|
|
576
576
|
aria-disabled=${x?"true":"false"}
|
|
577
577
|
aria-selected=${C||P["range-start"]||P["range-end"]?"true":"false"}
|
|
578
578
|
aria-label=${r.toLocaleDateString(c,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}
|
|
579
|
-
@click=${
|
|
579
|
+
@click=${V}
|
|
580
580
|
@mouseenter=${U}
|
|
581
581
|
@keydown=${_e=>M(_e,r)}
|
|
582
582
|
>
|
|
@@ -621,7 +621,7 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
621
621
|
`)}
|
|
622
622
|
</div>
|
|
623
623
|
</div>
|
|
624
|
-
`}function ne(r,n,e,t){return n&&X(r).getTime()<y(n).getTime()||e&&y(r).getTime()>X(e).getTime()?!0:!!t?.(y(r))}function Je(r,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,i=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":T(r,a),"range-end":T(r,i),"in-range":N(y(r),y(a),y(i))}}function et(r,n,e){let{mode:t,value:a,rangeValue:i,hoverDate:l,focusedDate:d,minDate:c,maxDate:p,isDateDisabled:k,onMonthClick:D,onMonthHover:m,onMonthKeydown:f}=n,M=ne(r,c,p,k),x=t==="single"&&!!a&&T(r,a),C=t==="range"?Je(r,i,l):{"range-start":!1,"range-end":!1,"in-range":!1},P=()=>{M||D(r)},
|
|
624
|
+
`}function ne(r,n,e,t){return n&&X(r).getTime()<y(n).getTime()||e&&y(r).getTime()>X(e).getTime()?!0:!!t?.(y(r))}function Je(r,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,i=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":T(r,a),"range-end":T(r,i),"in-range":N(y(r),y(a),y(i))}}function et(r,n,e){let{mode:t,value:a,rangeValue:i,hoverDate:l,focusedDate:d,minDate:c,maxDate:p,isDateDisabled:k,onMonthClick:D,onMonthHover:m,onMonthKeydown:f}=n,M=ne(r,c,p,k),x=t==="single"&&!!a&&T(r,a),C=t==="range"?Je(r,i,l):{"range-start":!1,"range-end":!1,"in-range":!1},P=()=>{M||D(r)},V=()=>{M||m(r)};return u`
|
|
625
625
|
<button
|
|
626
626
|
type="button"
|
|
627
627
|
class=${A({"grid-cell":!0,"cell-month":!0,today:T(r,new Date),selected:x,...C})}
|
|
@@ -632,14 +632,14 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
632
632
|
aria-selected=${x||C["range-start"]||C["range-end"]?"true":"false"}
|
|
633
633
|
aria-label=${r.toLocaleDateString(e,{month:"long",year:"numeric"})}
|
|
634
634
|
@click=${P}
|
|
635
|
-
@mouseenter=${
|
|
635
|
+
@mouseenter=${V}
|
|
636
636
|
@keydown=${U=>f(U,r)}
|
|
637
637
|
>
|
|
638
638
|
<span class="cell-label"
|
|
639
639
|
>${r.toLocaleDateString(e,{month:"short"})}</span
|
|
640
640
|
>
|
|
641
641
|
</button>
|
|
642
|
-
`}function tt(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var _=12;function
|
|
642
|
+
`}function tt(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var _=12;function I(r){return Math.floor(r/_)*_}function je(r){let n=I(r.displayedYear),e=Array.from({length:_},(t,a)=>new Date(n+a,0,1));return u`
|
|
643
643
|
<div id="calendar">
|
|
644
644
|
<div id="calendar-header">
|
|
645
645
|
<button
|
|
@@ -682,11 +682,11 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
682
682
|
aria-label=${String(r.getFullYear())}
|
|
683
683
|
@click=${C}
|
|
684
684
|
@mouseenter=${P}
|
|
685
|
-
@keydown=${
|
|
685
|
+
@keydown=${V=>m(V,r)}
|
|
686
686
|
>
|
|
687
687
|
<span class="cell-label">${r.getFullYear()}</span>
|
|
688
688
|
</button>
|
|
689
|
-
`}function it(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var nt="eun-date-picker",ot={day:{min:1,max:31},month:{min:1,max:12}},st=ce(be(ue)),lt=ge(xe(De(ye(ve(fe(st)))))),o=class extends lt{constructor(){super(...arguments);this.mode="single";this.granularity="day";this.rangeValue={start:null,end:null};this.weekStartsOn=1;this.workWeek=!1;this.noAnimation=!1;this.withTime=!1;this.stepMinute=1;this.todayLabel="Today";this.applyLabel="Apply";this.cancelLabel="Cancel";this.ariaLabelCalendar="Open calendar";this.dayPlaceholder="jj";this.monthPlaceholder="mm";this.yearPlaceholder="yyyy";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=y(new Date);this.focusedDate=b(new Date);this.navLevel=this.granularity;this.hoverDate=null;this.stagingValue=null;this.stagingRange={start:null,end:null};this.stagingTime=null;this.segments={day:"",month:"",year:""};this.rangeSegments={start:{day:"",month:"",year:""},end:{day:"",month:"",year:""}};this.timeSegments={hour:"",minute:"",period:""};this.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>dt(i)&&!re(i,e)))return{validity:{badInput:!0},message:"Enter a valid date"};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(ut(this.timeSegments)&&!W(this.timeSegments,i))return{validity:{badInput:!0},message:"Enter a valid time"};if(this.value){let{hour:l,minute:d}=K(this.value,this.timezone),c=Ye({hour:l,minute:d},ee(this.minTime),ee(this.maxTime));if(!c.valid)return c.violation==="min"?{validity:{rangeUnderflow:!0},message:`Time must be at or after ${this.minTime}`}:{validity:{rangeOverflow:!0},message:`Time must be at or before ${this.maxTime}`}}}return{validity:{}}};this.buildCommonValidators=()=>{let e=this.mode==="range"?!this.rangeValue.start||!this.rangeValue.end:this.value===void 0||this.value===null,t={},a;return this.required&&e&&(t.valueMissing=!0,a="Field value is missing"),{validity:t,message:a}};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let a=!e.matches(":popover-open");a&&e.showPopover(),(a||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:q}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.focusCalendarCell());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handlePopoverApply=()=>{this.commitStaged(),this.closePopover()};this.handlePopoverCancel=()=>{this.closePopover()};this.handleTimeHourChange=e=>{this.stagingTime={hour:e,minute:this.stagingTime?.minute??0}};this.handleTimeMinuteChange=e=>{this.stagingTime={hour:this.stagingTime?.hour??0,minute:e}};this.handleTimePeriodChange=e=>{let t=this.stagingTime??{hour:0,minute:0},{hour:a}=Z(t.hour);this.stagingTime={hour:Te(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,$,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,$,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(B(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay($(B(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(w(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(w(this.focusedDate,e.shiftKey?12:1),1));break;case"Enter":case" ":e.preventDefault(),this.handleDayClick(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleMonthKeydown=(e,t,a=i=>this.handleMonthClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,w,i=>this.isMonthDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,w,i=>this.isMonthDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,w,i=>this.isMonthDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,w,i=>this.isMonthDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),11,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?-10:-1));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?10:1));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleYearKeydown=(e,t,a=i=>this.handleYearClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,g,i=>this.isYearDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,g,i=>this.isYearDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,g,i=>this.isYearDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,g,i=>this.isYearDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(V(this.focusedDate.getFullYear()),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(V(this.focusedDate.getFullYear())+11,0,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,-12));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,12));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.enterMonthNav=()=>{this.navLevel="month"};this.enterYearNav=()=>{this.navLevel="year"};this.handleQuickNavMonthClick=e=>{if(this.isMonthDisabled(e))return;let t=(e.getFullYear()-this.focusedDate.getFullYear())*12+(e.getMonth()-this.focusedDate.getMonth());this.jumpFocused(w(this.focusedDate,t)),this.navLevel="day"};this.handleQuickNavYearClick=e=>{if(this.isYearDisabled(e))return;let t=e.getFullYear()-this.focusedDate.getFullYear();this.jumpFocused(g(this.focusedDate,t)),this.navLevel="month"};this.handleHover=e=>{this.hoverDate=e};this.handlePreviousMonth=()=>{this.displayedAnchor=w(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=w(this.displayedAnchor,1)};this.handlePreviousYear=()=>{this.displayedAnchor=g(this.displayedAnchor,-1)};this.handleNextYear=()=>{this.displayedAnchor=g(this.displayedAnchor,1)};this.handlePreviousYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,-12)};this.handleNextYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,12)};this.handleToday=()=>{let e=new Date;this.displayedAnchor=y(e),this.jumpFocused(this.nearestWorkweekDay(b(e),1))};this.navigateGridPrevious=()=>{switch(this.navLevel){case"month":this.handlePreviousYear();break;case"year":this.handlePreviousYearsPage();break;default:this.handlePreviousMonth();break}};this.navigateGridNext=()=>{switch(this.navLevel){case"month":this.handleNextYear();break;case"year":this.handleNextYearsPage();break;default:this.handleNextMonth();break}};this.swipeStart=null;this.handleSwipeStart=e=>{e.pointerType==="touch"&&(this.swipeStart={x:e.clientX,y:e.clientY})};this.handleSwipeEnd=e=>{let t=this.swipeStart;if(this.swipeStart=null,e.pointerType!=="touch"||!t)return;let a=e.clientX-t.x,i=e.clientY-t.y;Math.abs(a)<o.SWIPE_THRESHOLD_PX||Math.abs(a)<Math.abs(i)||(a<0?(this.navigateGridNext(),this.playSwipeAnimation("next")):(this.navigateGridPrevious(),this.playSwipeAnimation("previous")))};this.handleSwipeCancel=()=>{this.swipeStart=null};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(ke(this.timeSegments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousTimeSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextTimeSegment("period");break;default:break}}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.mode==="range"&&this.defaultRangeValue&&(this.rangeValue=this.defaultRangeValue)}formResetCallback(){super.formResetCallback(),this.mode==="range"&&(this.rangeValue=this.defaultRangeValue??{start:null,end:null})}willUpdate(e){let t=e.has("segments")||e.has("rangeSegments")||e.has("timeSegments")||e.has("minTime")||e.has("maxTime");if(this.isWithTimeActive()&&(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale"))){let a=this.resolvedHourFormat();if(this.value){let i=K(this.value,this.timezone);this.timeSegments=J(i.hour,i.minute,a)}else this.timeSegments=J(null,null,a);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),e.has("value")&&this.mode==="single"&&(this.segments=G(this.value??null)),e.has("rangeValue")&&this.mode==="range"&&(this.rangeSegments={start:G(this.rangeValue.start),end:G(this.rangeValue.end)}),(e.has("valid")||e.has("hideError")||e.has("disabled"))&&this.setAttribute("aria-invalid",String(!this.hideError&&!this.disabled&&!this.valid))}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia("(max-width: 767px)").matches}isDayDisabled(e){return ie(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return ne(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return oe(e,this.minDate,this.maxDate,this.isDateDisabled)}resetStaging(){this.stagingValue=this.value??null,this.stagingRange={start:this.rangeValue.start,end:this.rangeValue.end},this.hoverDate=null,this.navLevel=this.granularity;let e=this.mode==="single"?this.value??new Date:this.rangeValue.start??new Date;if(this.displayedAnchor=e,this.focusedDate=b(e),this.isWithTimeActive()){let t=this.mode==="single"?this.value:this.rangeValue.start;if(t){let{hour:a,minute:i}=K(t,this.timezone);this.stagingTime={hour:a,minute:i}}else this.stagingTime={hour:0,minute:0}}}isWithTimeActive(){return this.withTime&&this.granularity==="day"}resolvedHourFormat(){return we(this.locale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=K(e,this.timezone);return ae({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??te())}commitStaged(){this.mode==="single"?(this.value=this.isWithTimeActive()&&this.stagingValue?this.composeWithTime(this.stagingValue):this.stagingValue,this.segments=G(this.value)):(this.rangeValue=this.stagingRange,this.rangeSegments={start:G(this.stagingRange.start),end:G(this.stagingRange.end)}),this.dispatchEvent(new z(this.mode==="single"?this.value:this.rangeValue))}commitTypedDate(e,t){e==="value"?this.value=this.isWithTimeActive()?this.composeTypedDateTime(t):t:this.rangeValue={...this.rangeValue,[e]:t},this.dispatchEvent(new z(e==="value"?this.value:this.rangeValue)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}composeTypedDateTime(e){let t=this.resolvedHourFormat(),i=W(this.timeSegments,t);if(!i)if(this.value){let{hour:l,minute:d}=K(this.value,this.timezone);i={hour:l,minute:d}}else i={hour:0,minute:0};return ae({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:i.hour,minute:i.minute},this.timezone??te())}commitTypedTime(e,t){this.value=Ae(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new z(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitTimeSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!Ce(e,t))return;let a=W(e,t);a&&this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){if(this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 0;let t=getComputedStyle(e).getPropertyValue("--date-picker-panel-transition-duration").trim();if(t){let a=t.endsWith("ms")?Number.parseFloat(t):Number.parseFloat(t)*1e3;if(Number.isFinite(a)&&a>=0)return a}return 200}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:"ease",fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let a=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:"ease",fill:"forwards"});this.popoverAnimation=a,a.finished.then(()=>{this.popoverAnimation===a&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusCalendarCell(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('.grid-cell[tabindex="0"]')?.focus({preventScroll:!0})}syncDisplayedAnchor(){switch(this.granularity){case"month":L(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=this.focusedDate);break;case"year":V(this.focusedDate.getFullYear())!==V(this.displayedAnchor.getFullYear())&&(this.displayedAnchor=this.focusedDate);break;default:T(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=y(this.focusedDate));break}}moveFocused(e,t,a){let i=e>0?1:-1,l=t(this.focusedDate,e);for(let d=0;a(l)&&d<1e3;d+=1)l=t(l,i);this.focusedDate=l,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}jumpFocused(e){this.focusedDate=e,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}isDayFocusSkippable(e){return this.isDayDisabled(e)||this.workWeek&&O(e)}nearestWorkweekDay(e,t){if(!this.workWeek)return e;let a=e;for(let i=0;O(a)&&i<2;i+=1)a=$(a,t);return a}commitCell(e){this.focusedDate=e;let t;if(this.mode==="single")this.stagingValue=e,t=!0;else{let{start:a,end:i}=this.stagingRange;if(!a||i)this.stagingRange={start:e,end:null},this.hoverDate=null,t=!1;else{let[l,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:l,end:d},t=!0}}this.isModalOpen||this.isWithTimeActive()&&this.isOpen||t&&(this.commitStaged(),this.closePopover())}handleDayClick(e){this.isDayDisabled(e)||this.commitCell(e)}handleMonthClick(e){this.isMonthDisabled(e)||this.commitCell(e)}handleYearClick(e){this.isYearDisabled(e)||this.commitCell(e)}playSwipeAnimation(e){this.updateComplete.then(()=>{let t=this.swipeAreaEl;t&&(t.classList.remove("slide-in-next","slide-in-previous"),t.getBoundingClientRect(),t.classList.add(e==="next"?"slide-in-next":"slide-in-previous"))})}handleSegmentInput(e,t,a){let i=e.target,l=a==="year"?4:2,d=i.value.replace(/\D/g,"").slice(0,l);i.value=d;let p={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,p),d.length===l&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,p)}commitSegmentGroupIfComplete(e,t){let a=j(this.granularity);if(!Ge(t,a))return;let i=re(t,a);i&&this.commitTypedDate(e,i)}handleSegmentKeydown(e,t,a){let i=e.target;e.key==="Backspace"&&i.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t,a)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t,a)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,a,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,a,-1))}adjustSegment(e,t,a){let i=this.readSegmentGroup(e),l=Number(i[t]),d=ct(t),c;if(i[t]===""||Number.isNaN(l))c=d;else{let m=ot[t];c=l+a,m&&c>m.max?c=m.min:m&&c<m.min?c=m.max:m||(c=Math.max(0,c))}let p=t==="year"?4:2,k=String(c).padStart(p,"0").slice(-p),D={...i,[t]:k};this.writeSegmentGroup(e,D),this.commitSegmentGroupIfComplete(e,D)}readSegmentGroup(e){return e==="value"?this.segments:this.rangeSegments[e]}writeSegmentGroup(e,t){e==="value"?this.segments=t:this.rangeSegments={...this.rangeSegments,[e]:t}}visibleSegmentOrder(){let e=j(this.granularity);return Ke(this.locale).filter(t=>e.includes(t))}focusPreviousSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i<=0||this.focusSegment(e,a[i-1])}focusNextSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i===-1||i>=a.length-1||this.focusSegment(e,a[i+1])}focusSegment(e,t){this.shadowRoot?.querySelector(`.segment-group[data-target="${e}"] .segment-${t}`)?.focus()}handleTimeSegmentInput(e,t){let a=e.target,i=a.value.replace(/\D/g,"").slice(0,2);a.value=i;let l={...this.timeSegments,[t]:i};this.timeSegments=l,i.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(l)}handleTimeSegmentKeydown(e,t){let a=e.target;e.key==="Backspace"&&a.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousTimeSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextTimeSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustTimeSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustTimeSegment(t,-1))}adjustTimeSegment(e,t){let a=this.resolvedHourFormat(),i=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},l=Number(this.timeSegments[e]),d;if(this.timeSegments[e]===""||Number.isNaN(l)){let p=K(this.value??new Date,this.timezone);d=e==="hour"?a===12?Z(p.hour).hour:p.hour:p.minute}else d=l+t,d>i.max?d=i.min:d<i.min&&(d=i.max);let c={...this.timeSegments,[e]:String(d).padStart(2,"0")};this.timeSegments=c,this.commitTimeSegmentGroupIfComplete(c)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Me(this.resolvedHourFormat());return $e(this.locale).filter(t=>e.includes(t))}focusPreviousTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a<=0||this.focusTimeSegment(t[a-1])}focusNextTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a===-1||a>=t.length-1||this.focusTimeSegment(t[a+1])}focusTimeSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}renderTimeSegmentGroup(){let e=this.visibleTimeSegmentOrder();return u`
|
|
689
|
+
`}function it(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var nt="eun-date-picker",ot={day:{min:1,max:31},month:{min:1,max:12}},st=ce(be(ue)),lt=he(xe(De(ye(ve(fe(st)))))),o=class extends lt{constructor(){super(...arguments);this.mode="single";this.granularity="day";this.rangeValue={start:null,end:null};this.weekStartsOn=1;this.workWeek=!1;this.noAnimation=!1;this.withTime=!1;this.stepMinute=1;this.todayLabel="Today";this.applyLabel="Apply";this.cancelLabel="Cancel";this.ariaLabelCalendar="Open calendar";this.dayPlaceholder="jj";this.monthPlaceholder="mm";this.yearPlaceholder="yyyy";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=y(new Date);this.focusedDate=b(new Date);this.navLevel=this.granularity;this.hoverDate=null;this.stagingValue=null;this.stagingRange={start:null,end:null};this.stagingTime=null;this.segments={day:"",month:"",year:""};this.rangeSegments={start:{day:"",month:"",year:""},end:{day:"",month:"",year:""}};this.timeSegments={hour:"",minute:"",period:""};this.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>dt(i)&&!re(i,e)))return{validity:{badInput:!0},message:"Enter a valid date"};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(ut(this.timeSegments)&&!W(this.timeSegments,i))return{validity:{badInput:!0},message:"Enter a valid time"};if(this.value){let{hour:l,minute:d}=K(this.value,this.timezone),c=Ye({hour:l,minute:d},ee(this.minTime),ee(this.maxTime));if(!c.valid)return c.violation==="min"?{validity:{rangeUnderflow:!0},message:`Time must be at or after ${this.minTime}`}:{validity:{rangeOverflow:!0},message:`Time must be at or before ${this.maxTime}`}}}return{validity:{}}};this.buildCommonValidators=()=>{let e=this.mode==="range"?!this.rangeValue.start||!this.rangeValue.end:this.value===void 0||this.value===null,t={},a;return this.required&&e&&(t.valueMissing=!0,a="Field value is missing"),{validity:t,message:a}};this.handleTriggerClick=()=>{if(!(this.disabled||this.readonly)){if(this.resetStaging(),this.isMobileViewport()){this.isModalOpen=!0;return}this.updateComplete.then(()=>{let e=this.popoverEl;if(!e)return;let t=this.popoverAnimation!==void 0;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0;let a=!e.matches(":popover-open");a&&e.showPopover(),(a||t)&&this.playPopoverOpenAnimation(e)})}};this.handlePopoverToggle=e=>{if(e.newState==="open"){this.isOpen=!0,this.fieldWrapperEl&&this.popoverEl&&this.anchorFloatingElement(this.fieldWrapperEl,this.popoverEl,{forceFallback:q}),this.observeAnchorVisibility(this.fieldWrapperEl,()=>this.closePopover()),this.updateComplete.then(()=>this.focusCalendarCell());return}this.isOpen=!1,this.unanchorFloatingElement(),this.unobserveAnchorVisibility(),this.triggerEl?.focus()};this.handleModalConfirm=()=>{this.commitStaged(),this.isModalOpen=!1};this.handleModalCancel=()=>{this.isModalOpen=!1};this.handlePopoverApply=()=>{this.commitStaged(),this.closePopover()};this.handlePopoverCancel=()=>{this.closePopover()};this.handleTimeHourChange=e=>{this.stagingTime={hour:e,minute:this.stagingTime?.minute??0}};this.handleTimeMinuteChange=e=>{this.stagingTime={hour:this.stagingTime?.hour??0,minute:e}};this.handleTimePeriodChange=e=>{let t=this.stagingTime??{hour:0,minute:0},{hour:a}=Z(t.hour);this.stagingTime={hour:Te(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,$,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,$,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(B(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay($(B(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(w(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(w(this.focusedDate,e.shiftKey?12:1),1));break;case"Enter":case" ":e.preventDefault(),this.handleDayClick(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleMonthKeydown=(e,t,a=i=>this.handleMonthClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,w,i=>this.isMonthDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,w,i=>this.isMonthDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,w,i=>this.isMonthDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,w,i=>this.isMonthDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(this.focusedDate.getFullYear(),11,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?-10:-1));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,e.shiftKey?10:1));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.handleYearKeydown=(e,t,a=i=>this.handleYearClick(i))=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,g,i=>this.isYearDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,g,i=>this.isYearDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,g,i=>this.isYearDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,g,i=>this.isYearDisabled(i));break;case"Home":e.preventDefault(),this.jumpFocused(new Date(I(this.focusedDate.getFullYear()),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(I(this.focusedDate.getFullYear())+11,0,1));break;case"PageUp":e.preventDefault(),this.jumpFocused(g(this.focusedDate,-12));break;case"PageDown":e.preventDefault(),this.jumpFocused(g(this.focusedDate,12));break;case"Enter":case" ":e.preventDefault(),a(t);break;case"Escape":e.preventDefault(),this.closePopover();break;default:break}};this.enterMonthNav=()=>{this.navLevel="month"};this.enterYearNav=()=>{this.navLevel="year"};this.handleQuickNavMonthClick=e=>{if(this.isMonthDisabled(e))return;let t=(e.getFullYear()-this.focusedDate.getFullYear())*12+(e.getMonth()-this.focusedDate.getMonth());this.jumpFocused(w(this.focusedDate,t)),this.navLevel="day"};this.handleQuickNavYearClick=e=>{if(this.isYearDisabled(e))return;let t=e.getFullYear()-this.focusedDate.getFullYear();this.jumpFocused(g(this.focusedDate,t)),this.navLevel="month"};this.handleHover=e=>{this.hoverDate=e};this.handlePreviousMonth=()=>{this.displayedAnchor=w(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=w(this.displayedAnchor,1)};this.handlePreviousYear=()=>{this.displayedAnchor=g(this.displayedAnchor,-1)};this.handleNextYear=()=>{this.displayedAnchor=g(this.displayedAnchor,1)};this.handlePreviousYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,-12)};this.handleNextYearsPage=()=>{this.displayedAnchor=g(this.displayedAnchor,12)};this.handleToday=()=>{let e=new Date;this.displayedAnchor=y(e),this.jumpFocused(this.nearestWorkweekDay(b(e),1))};this.navigateGridPrevious=()=>{switch(this.navLevel){case"month":this.handlePreviousYear();break;case"year":this.handlePreviousYearsPage();break;default:this.handlePreviousMonth();break}};this.navigateGridNext=()=>{switch(this.navLevel){case"month":this.handleNextYear();break;case"year":this.handleNextYearsPage();break;default:this.handleNextMonth();break}};this.swipeStart=null;this.handleSwipeStart=e=>{e.pointerType==="touch"&&(this.swipeStart={x:e.clientX,y:e.clientY})};this.handleSwipeEnd=e=>{let t=this.swipeStart;if(this.swipeStart=null,e.pointerType!=="touch"||!t)return;let a=e.clientX-t.x,i=e.clientY-t.y;Math.abs(a)<o.SWIPE_THRESHOLD_PX||Math.abs(a)<Math.abs(i)||(a<0?(this.navigateGridNext(),this.playSwipeAnimation("next")):(this.navigateGridPrevious(),this.playSwipeAnimation("previous")))};this.handleSwipeCancel=()=>{this.swipeStart=null};this.handlePeriodSegmentClick=()=>{this.setPeriodSegment(ke(this.timeSegments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousTimeSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextTimeSegment("period");break;default:break}}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.mode==="range"&&this.defaultRangeValue&&(this.rangeValue=this.defaultRangeValue)}formResetCallback(){super.formResetCallback(),this.mode==="range"&&(this.rangeValue=this.defaultRangeValue??{start:null,end:null})}willUpdate(e){let t=e.has("segments")||e.has("rangeSegments")||e.has("timeSegments")||e.has("minTime")||e.has("maxTime");if(this.isWithTimeActive()&&(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale"))){let a=this.resolvedHourFormat();if(this.value){let i=K(this.value,this.timezone);this.timeSegments=J(i.hour,i.minute,a)}else this.timeSegments=J(null,null,a);t=!0}t&&this.checkValidity(this.value??null),super.willUpdate(e)}updated(e){super.updated(e),e.has("value")&&this.mode==="single"&&(this.segments=G(this.value??null)),e.has("rangeValue")&&this.mode==="range"&&(this.rangeSegments={start:G(this.rangeValue.start),end:G(this.rangeValue.end)}),(e.has("valid")||e.has("hideError")||e.has("disabled"))&&this.setAttribute("aria-invalid",String(!this.hideError&&!this.disabled&&!this.valid))}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia("(max-width: 767px)").matches}isDayDisabled(e){return ie(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return ne(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return oe(e,this.minDate,this.maxDate,this.isDateDisabled)}resetStaging(){this.stagingValue=this.value??null,this.stagingRange={start:this.rangeValue.start,end:this.rangeValue.end},this.hoverDate=null,this.navLevel=this.granularity;let e=this.mode==="single"?this.value??new Date:this.rangeValue.start??new Date;if(this.displayedAnchor=e,this.focusedDate=b(e),this.isWithTimeActive()){let t=this.mode==="single"?this.value:this.rangeValue.start;if(t){let{hour:a,minute:i}=K(t,this.timezone);this.stagingTime={hour:a,minute:i}}else this.stagingTime={hour:0,minute:0}}}isWithTimeActive(){return this.withTime&&this.granularity==="day"}resolvedHourFormat(){return we(this.locale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=K(e,this.timezone);return ae({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??te())}commitStaged(){this.mode==="single"?(this.value=this.isWithTimeActive()&&this.stagingValue?this.composeWithTime(this.stagingValue):this.stagingValue,this.segments=G(this.value)):(this.rangeValue=this.stagingRange,this.rangeSegments={start:G(this.stagingRange.start),end:G(this.stagingRange.end)}),this.dispatchEvent(new z(this.mode==="single"?this.value:this.rangeValue))}commitTypedDate(e,t){e==="value"?this.value=this.isWithTimeActive()?this.composeTypedDateTime(t):t:this.rangeValue={...this.rangeValue,[e]:t},this.dispatchEvent(new z(e==="value"?this.value:this.rangeValue)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}composeTypedDateTime(e){let t=this.resolvedHourFormat(),i=W(this.timeSegments,t);if(!i)if(this.value){let{hour:l,minute:d}=K(this.value,this.timezone);i={hour:l,minute:d}}else i={hour:0,minute:0};return ae({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:i.hour,minute:i.minute},this.timezone??te())}commitTypedTime(e,t){this.value=Ae(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new z(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitTimeSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!Ce(e,t))return;let a=W(e,t);a&&this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){if(this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return 0;let t=getComputedStyle(e).getPropertyValue("--date-picker-panel-transition-duration").trim();if(t){let a=t.endsWith("ms")?Number.parseFloat(t):Number.parseFloat(t)*1e3;if(Number.isFinite(a)&&a>=0)return a}return 200}playPopoverOpenAnimation(e){e.style.removeProperty("pointer-events");let t=this.popoverAnimationDuration(e);t!==0&&(this.popoverAnimation=e.animate([{opacity:0,transform:"scaleY(0.01)"},{opacity:1,transform:"scaleY(1)"}],{duration:t,easing:"ease",fill:"forwards"}))}closePopover(){let e=this.popoverEl;this.popoverAnimation?.cancel(),this.popoverAnimation=void 0,e?.matches(":popover-open")&&this.playPopoverCloseAnimation(e)}playPopoverCloseAnimation(e){e.style.pointerEvents="none";let t=this.popoverAnimationDuration(e);if(t===0){e.hidePopover();return}let a=e.animate([{opacity:1,transform:"scaleY(1)"},{opacity:0,transform:"scaleY(0.01)"}],{duration:t,easing:"ease",fill:"forwards"});this.popoverAnimation=a,a.finished.then(()=>{this.popoverAnimation===a&&(this.popoverAnimation=void 0),e.hidePopover()}).catch(()=>{})}focusCalendarCell(){(this.isModalOpen?this.shadowRoot:this.popoverEl)?.querySelector('.grid-cell[tabindex="0"]')?.focus({preventScroll:!0})}syncDisplayedAnchor(){switch(this.granularity){case"month":L(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=this.focusedDate);break;case"year":I(this.focusedDate.getFullYear())!==I(this.displayedAnchor.getFullYear())&&(this.displayedAnchor=this.focusedDate);break;default:T(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=y(this.focusedDate));break}}moveFocused(e,t,a){let i=e>0?1:-1,l=t(this.focusedDate,e);for(let d=0;a(l)&&d<1e3;d+=1)l=t(l,i);this.focusedDate=l,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}jumpFocused(e){this.focusedDate=e,this.syncDisplayedAnchor(),this.updateComplete.then(()=>this.focusCalendarCell())}isDayFocusSkippable(e){return this.isDayDisabled(e)||this.workWeek&&O(e)}nearestWorkweekDay(e,t){if(!this.workWeek)return e;let a=e;for(let i=0;O(a)&&i<2;i+=1)a=$(a,t);return a}commitCell(e){this.focusedDate=e;let t;if(this.mode==="single")this.stagingValue=e,t=!0;else{let{start:a,end:i}=this.stagingRange;if(!a||i)this.stagingRange={start:e,end:null},this.hoverDate=null,t=!1;else{let[l,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:l,end:d},t=!0}}this.isModalOpen||this.isWithTimeActive()&&this.isOpen||t&&(this.commitStaged(),this.closePopover())}handleDayClick(e){this.isDayDisabled(e)||this.commitCell(e)}handleMonthClick(e){this.isMonthDisabled(e)||this.commitCell(e)}handleYearClick(e){this.isYearDisabled(e)||this.commitCell(e)}playSwipeAnimation(e){this.updateComplete.then(()=>{let t=this.swipeAreaEl;t&&(t.classList.remove("slide-in-next","slide-in-previous"),t.getBoundingClientRect(),t.classList.add(e==="next"?"slide-in-next":"slide-in-previous"))})}handleSegmentInput(e,t,a){let i=e.target,l=a==="year"?4:2,d=i.value.replace(/\D/g,"").slice(0,l);i.value=d;let p={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,p),d.length===l&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,p)}commitSegmentGroupIfComplete(e,t){let a=j(this.granularity);if(!Ge(t,a))return;let i=re(t,a);i&&this.commitTypedDate(e,i)}handleSegmentKeydown(e,t,a){let i=e.target;e.key==="Backspace"&&i.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousSegment(t,a)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextSegment(t,a)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustSegment(t,a,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustSegment(t,a,-1))}adjustSegment(e,t,a){let i=this.readSegmentGroup(e),l=Number(i[t]),d=ct(t),c;if(i[t]===""||Number.isNaN(l))c=d;else{let m=ot[t];c=l+a,m&&c>m.max?c=m.min:m&&c<m.min?c=m.max:m||(c=Math.max(0,c))}let p=t==="year"?4:2,k=String(c).padStart(p,"0").slice(-p),D={...i,[t]:k};this.writeSegmentGroup(e,D),this.commitSegmentGroupIfComplete(e,D)}readSegmentGroup(e){return e==="value"?this.segments:this.rangeSegments[e]}writeSegmentGroup(e,t){e==="value"?this.segments=t:this.rangeSegments={...this.rangeSegments,[e]:t}}visibleSegmentOrder(){let e=j(this.granularity);return Ke(this.locale).filter(t=>e.includes(t))}focusPreviousSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i<=0||this.focusSegment(e,a[i-1])}focusNextSegment(e,t){let a=this.visibleSegmentOrder(),i=a.indexOf(t);i===-1||i>=a.length-1||this.focusSegment(e,a[i+1])}focusSegment(e,t){this.shadowRoot?.querySelector(`.segment-group[data-target="${e}"] .segment-${t}`)?.focus()}handleTimeSegmentInput(e,t){let a=e.target,i=a.value.replace(/\D/g,"").slice(0,2);a.value=i;let l={...this.timeSegments,[t]:i};this.timeSegments=l,i.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(l)}handleTimeSegmentKeydown(e,t){let a=e.target;e.key==="Backspace"&&a.value===""||e.key==="ArrowLeft"?(e.preventDefault(),this.focusPreviousTimeSegment(t)):e.key==="ArrowRight"?(e.preventDefault(),this.focusNextTimeSegment(t)):e.key==="ArrowUp"?(e.preventDefault(),this.adjustTimeSegment(t,1)):e.key==="ArrowDown"&&(e.preventDefault(),this.adjustTimeSegment(t,-1))}adjustTimeSegment(e,t){let a=this.resolvedHourFormat(),i=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},l=Number(this.timeSegments[e]),d;if(this.timeSegments[e]===""||Number.isNaN(l)){let p=K(this.value??new Date,this.timezone);d=e==="hour"?a===12?Z(p.hour).hour:p.hour:p.minute}else d=l+t,d>i.max?d=i.min:d<i.min&&(d=i.max);let c={...this.timeSegments,[e]:String(d).padStart(2,"0")};this.timeSegments=c,this.commitTimeSegmentGroupIfComplete(c)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Me(this.resolvedHourFormat());return $e(this.locale).filter(t=>e.includes(t))}focusPreviousTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a<=0||this.focusTimeSegment(t[a-1])}focusNextTimeSegment(e){let t=this.visibleTimeSegmentOrder(),a=t.indexOf(e);a===-1||a>=t.length-1||this.focusTimeSegment(t[a+1])}focusTimeSegment(e){this.shadowRoot?.querySelector(`.segment-${e}`)?.focus()}renderTimeSegmentGroup(){let e=this.visibleTimeSegmentOrder();return u`
|
|
690
690
|
<div
|
|
691
691
|
class="segment-group time-segment-group"
|
|
692
692
|
role="group"
|
|
@@ -778,7 +778,7 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
778
778
|
<eun-icon name="calendar_today" size="16"></eun-icon>
|
|
779
779
|
</button>
|
|
780
780
|
</div>
|
|
781
|
-
`}previewFormatOptions(){switch(this.granularity){case"year":return{year:"numeric"};case"month":return{month:"short",year:"numeric"};default:return{weekday:"short",month:"short",day:"numeric",year:"numeric"}}}formatCoarseRangePreview(){let{start:e,end:t}=this.stagingRange;if(!e)return"";let a=this.previewFormatOptions(),i=t??e;return`${e.toLocaleDateString(this.locale,a)} \u2013 ${i.toLocaleDateString(this.locale,a)}`}renderModalDatePreview(){let e=this.dictionary.datePicker.modalPreview[this.granularity],t;return this.mode==="single"?t=this.stagingValue?this.stagingValue.toLocaleDateString(this.locale,this.previewFormatOptions()):e.single:this.stagingRange.start?this.granularity==="day"?t=
|
|
781
|
+
`}previewFormatOptions(){switch(this.granularity){case"year":return{year:"numeric"};case"month":return{month:"short",year:"numeric"};default:return{weekday:"short",month:"short",day:"numeric",year:"numeric"}}}formatCoarseRangePreview(){let{start:e,end:t}=this.stagingRange;if(!e)return"";let a=this.previewFormatOptions(),i=t??e;return`${e.toLocaleDateString(this.locale,a)} \u2013 ${i.toLocaleDateString(this.locale,a)}`}renderModalDatePreview(){let e=this.dictionary.datePicker.modalPreview[this.granularity],t;return this.mode==="single"?t=this.stagingValue?this.stagingValue.toLocaleDateString(this.locale,this.previewFormatOptions()):e.single:this.stagingRange.start?this.granularity==="day"?t=ge(this.stagingRange.start,this.stagingRange.end??this.stagingRange.start,this.locale):t=this.formatCoarseRangePreview():t=e.range,u`<div id="modal-date-preview">${t}</div>`}renderTimeSection(){if(!this.isWithTimeActive())return Y;let e=this.resolvedHourFormat(),t=this.stagingTime??{hour:0,minute:0},a=t.hour<12?"AM":"PM";return u`
|
|
782
782
|
<div id="time-section">
|
|
783
783
|
${Re({visual:"buttons",format:e,hour:t.hour,minute:t.minute,period:a,stepMinute:this.stepMinute,disabled:this.disabled,noAnimation:this.noAnimation,onHourChange:this.handleTimeHourChange,onMinuteChange:this.handleTimeMinuteChange,onPeriodChange:this.handleTimePeriodChange})}
|
|
784
784
|
${this.renderTimezoneLabel()}
|
|
@@ -844,4 +844,4 @@ import{a as we,b as Z,c as Te,d as ke,e as Me,f as $e,g as J,h as W,i as Ce,j as
|
|
|
844
844
|
</eun-button>
|
|
845
845
|
</div>
|
|
846
846
|
</eun-modal>
|
|
847
|
-
`}};o.styles=[He,...q?[]:[ze],Oe,Ne,Ve,
|
|
847
|
+
`}};o.styles=[He,...q?[]:[ze],Oe,Ne,Ie,Ve,Fe,E.base,E.errorMessages,E.hintMessages],o.SWIPE_THRESHOLD_PX=40,s([h({reflect:!0})],o.prototype,"mode",2),s([h({reflect:!0})],o.prototype,"granularity",2),s([h({attribute:"default-value",converter:{fromAttribute:e=>se(e),toAttribute:e=>e?le(e):null}})],o.prototype,"defaultValue",1),s([h({attribute:!1})],o.prototype,"rangeValue",2),s([h({type:Number,attribute:"week-starts-on"})],o.prototype,"weekStartsOn",2),s([h({type:Boolean,attribute:"work-week"})],o.prototype,"workWeek",2),s([h({type:Boolean,reflect:!0,attribute:"no-animation"})],o.prototype,"noAnimation",2),s([h({type:Boolean,reflect:!0,attribute:"with-time"})],o.prototype,"withTime",2),s([h()],o.prototype,"timezone",2),s([h({type:Number,attribute:"hour-format"})],o.prototype,"hourFormat",2),s([h({type:Number,attribute:"step-minute"})],o.prototype,"stepMinute",2),s([h({attribute:"min-time"})],o.prototype,"minTime",2),s([h({attribute:"max-time"})],o.prototype,"maxTime",2),s([h({attribute:!1})],o.prototype,"minDate",2),s([h({attribute:!1})],o.prototype,"maxDate",2),s([h({attribute:!1})],o.prototype,"isDateDisabled",2),s([h({attribute:"today-label"})],o.prototype,"todayLabel",2),s([h({attribute:"apply-label"})],o.prototype,"applyLabel",2),s([h({attribute:"cancel-label"})],o.prototype,"cancelLabel",2),s([h({attribute:"aria-label-calendar"})],o.prototype,"ariaLabelCalendar",2),s([h({attribute:"day-placeholder"})],o.prototype,"dayPlaceholder",2),s([h({attribute:"month-placeholder"})],o.prototype,"monthPlaceholder",2),s([h({attribute:"year-placeholder"})],o.prototype,"yearPlaceholder",2),s([h({attribute:"hour-placeholder"})],o.prototype,"hourPlaceholder",2),s([h({attribute:"minute-placeholder"})],o.prototype,"minutePlaceholder",2),s([h({attribute:"default-range-value",converter:{fromAttribute:e=>{if(!e)return;let[t,a]=e.split(",").map(i=>i.trim());return{start:se(t),end:se(a)}},toAttribute:e=>e?`${le(e.start)},${le(e.end)}`:null}})],o.prototype,"defaultRangeValue",2),s([v()],o.prototype,"isOpen",2),s([v()],o.prototype,"isModalOpen",2),s([v()],o.prototype,"displayedAnchor",2),s([v()],o.prototype,"focusedDate",2),s([v()],o.prototype,"navLevel",2),s([v()],o.prototype,"hoverDate",2),s([v()],o.prototype,"stagingValue",2),s([v()],o.prototype,"stagingRange",2),s([v()],o.prototype,"stagingTime",2),s([v()],o.prototype,"segments",2),s([v()],o.prototype,"rangeSegments",2),s([v()],o.prototype,"timeSegments",2),s([R("#calendar-trigger")],o.prototype,"triggerEl",2),s([R("#calendar-popover")],o.prototype,"popoverEl",2),s([R("#field-wrapper")],o.prototype,"fieldWrapperEl",2),s([R("#modal-date")],o.prototype,"modalEl",2),s([R("#calendar-swipe-area")],o.prototype,"swipeAreaEl",2),s([R(".segment")],o.prototype,"firstSegmentEl",2),o=s([de(nt)],o);function dt(r){return Object.values(r).some(n=>n.length>0)}function ut(r){return r.hour!==""||r.minute!==""||r.period!==""}function ct(r){let n=new Date;switch(r){case"year":return n.getFullYear();case"month":return n.getMonth()+1;default:return n.getDate()}}function ht(r){return r.charAt(0).toUpperCase()+r.slice(1)}function se(r){if(!r)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}function le(r){return r?r.toISOString().slice(0,10):""}export{o as EunomiaDatePicker,nt as EunomiaDatePickerTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js";import"./chunks/chunk-UDOZRIJZ.js";import{a as s}from"./chunks/chunk-5EVP7YNE.js";import{a as o,f as l,g as d,h as a,i as c,j as
|
|
1
|
+
import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js";import"./chunks/chunk-UDOZRIJZ.js";import{a as s}from"./chunks/chunk-5EVP7YNE.js";import{a as o,f as l,g as d,h as a,i as c,j as n,n as i,p as r,s as p}from"./chunks/chunk-XH6NREVZ.js";var b=d`
|
|
2
2
|
:host {
|
|
3
3
|
--_width: var(--drawer-width, min(420px, 100vw));
|
|
4
4
|
--_background: var(--drawer-background, var(--eun-surface-color, #ffffff));
|
|
@@ -130,7 +130,7 @@ import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
130
130
|
`,m=b;var y="eun-drawer",t=class extends v(p){constructor(){super(...arguments);this.position="end";this.closeable=!0;this.open=!1;this.closeOnBackdrop=!0;this.dirty=!1;this.ariaLabelClose="Close";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=e=>{e.stopPropagation(),this.confirmDiscard()};this.handleToggle=e=>{let g=e;if(this.syncingFromPopover=!0,this.open=g.newState==="open",this.syncingFromPopover=!1,this.open){this.openDialogSurface({surfaceEl:this.panelEl,onEscape:()=>this.requestClose(),onOutsideClick:()=>{this.closeOnBackdrop&&this.requestClose()}}),this.updateComplete.then(()=>this.focusInitialElement());return}this.closeDialogSurface()};this.handleCommandEvent=e=>{h(e,this)};this.stopDialogPropagation=e=>{e.stopPropagation()}}willUpdate(e){e.has("dirty")&&this.dirty&&(this.mountConfirmModal=!0)}updated(e){super.updated(e),e.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}requestClose(){if(this.dirty){let e=new u;this.dispatchEvent(e),e.defaultPrevented||this.confirmCloseModalEl?.show();return}this.attemptClose()}attemptClose(){let e=new f;this.dispatchEvent(e),e.defaultPrevented||this.hide()}confirmDiscard(){this.dirty=!1,this.attemptClose()}focusInitialElement(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}(this.panelEl??this.surfaceEl)?.focus()}surfaceAriaLabel(){return this.heading?void 0:this.ariaLabel??void 0}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}hasHeaderContent(){return this.closeable||!!this.heading||this.querySelector('[slot="header"]')!==null}renderHeader(){return i`
|
|
131
131
|
<div id="header">
|
|
132
132
|
<slot name="header">
|
|
133
|
-
${this.heading?i`<h2 id="heading">${this.heading}</h2>`:
|
|
133
|
+
${this.heading?i`<h2 id="heading">${this.heading}</h2>`:r}
|
|
134
134
|
</slot>
|
|
135
135
|
${this.closeable?i`
|
|
136
136
|
<eun-button
|
|
@@ -143,7 +143,7 @@ import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
143
143
|
>
|
|
144
144
|
<eun-icon name="close" size="16"></eun-icon>
|
|
145
145
|
</eun-button>
|
|
146
|
-
`:
|
|
146
|
+
`:r}
|
|
147
147
|
</div>
|
|
148
148
|
`}renderConfirmCloseModal(){return i`
|
|
149
149
|
<eun-modal
|
|
@@ -152,15 +152,15 @@ import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
152
152
|
heading=${this.confirmCloseHeading}
|
|
153
153
|
cancel-label=${this.confirmCloseCancelLabel}
|
|
154
154
|
confirm-label=${this.confirmCloseConfirmLabel}
|
|
155
|
-
confirm-
|
|
155
|
+
confirm-color="critical"
|
|
156
156
|
@eunconfirm=${this.handleDiscardConfirmed}
|
|
157
157
|
@euncancel=${this.stopDialogPropagation}
|
|
158
158
|
>
|
|
159
|
-
${this.confirmCloseDescription?i`<p>${this.confirmCloseDescription}</p>`:
|
|
159
|
+
${this.confirmCloseDescription?i`<p>${this.confirmCloseDescription}</p>`:r}
|
|
160
160
|
<slot name="confirm-close"></slot>
|
|
161
161
|
</eun-modal>
|
|
162
162
|
`}renderPanelContent(){return i`
|
|
163
|
-
${this.hasHeaderContent()?this.renderHeader():
|
|
163
|
+
${this.hasHeaderContent()?this.renderHeader():r}
|
|
164
164
|
<div id="body">
|
|
165
165
|
<slot></slot>
|
|
166
166
|
</div>
|
|
@@ -168,7 +168,7 @@ import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
168
168
|
<div id="footer">
|
|
169
169
|
<slot name="footer"></slot>
|
|
170
170
|
</div>
|
|
171
|
-
`:
|
|
171
|
+
`:r}
|
|
172
172
|
`}render(){return i`
|
|
173
173
|
<div id="surface" popover="manual" @toggle=${this.handleToggle}>
|
|
174
174
|
<div
|
|
@@ -182,5 +182,5 @@ import{a as f,b as u,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
182
182
|
${this.renderPanelContent()}
|
|
183
183
|
</div>
|
|
184
184
|
</div>
|
|
185
|
-
${this.mountConfirmModal?this.renderConfirmCloseModal():
|
|
186
|
-
`}};t.styles=m,o([a({reflect:!0})],t.prototype,"position",2),o([a()],t.prototype,"heading",2),o([a({type:Boolean})],t.prototype,"closeable",2),o([a({type:Boolean,reflect:!0})],t.prototype,"open",2),o([a({type:Boolean,attribute:"close-on-backdrop"})],t.prototype,"closeOnBackdrop",2),o([a({type:Boolean,reflect:!0})],t.prototype,"dirty",2),o([a({attribute:"aria-label-close"})],t.prototype,"ariaLabelClose",2),o([a({attribute:"confirm-close-heading"})],t.prototype,"confirmCloseHeading",2),o([a({attribute:"confirm-close-description"})],t.prototype,"confirmCloseDescription",2),o([a({attribute:"confirm-close-cancel-label"})],t.prototype,"confirmCloseCancelLabel",2),o([a({attribute:"confirm-close-confirm-label"})],t.prototype,"confirmCloseConfirmLabel",2),o([
|
|
185
|
+
${this.mountConfirmModal?this.renderConfirmCloseModal():r}
|
|
186
|
+
`}};t.styles=m,o([a({reflect:!0})],t.prototype,"position",2),o([a()],t.prototype,"heading",2),o([a({type:Boolean})],t.prototype,"closeable",2),o([a({type:Boolean,reflect:!0})],t.prototype,"open",2),o([a({type:Boolean,attribute:"close-on-backdrop"})],t.prototype,"closeOnBackdrop",2),o([a({type:Boolean,reflect:!0})],t.prototype,"dirty",2),o([a({attribute:"aria-label-close"})],t.prototype,"ariaLabelClose",2),o([a({attribute:"confirm-close-heading"})],t.prototype,"confirmCloseHeading",2),o([a({attribute:"confirm-close-description"})],t.prototype,"confirmCloseDescription",2),o([a({attribute:"confirm-close-cancel-label"})],t.prototype,"confirmCloseCancelLabel",2),o([a({attribute:"confirm-close-confirm-label"})],t.prototype,"confirmCloseConfirmLabel",2),o([n("#surface")],t.prototype,"surfaceEl",2),o([n("#panel")],t.prototype,"panelEl",2),o([n("#confirm-close-modal")],t.prototype,"confirmCloseModalEl",2),o([c()],t.prototype,"mountConfirmModal",2),t=o([l(y)],t);export{t as EunomiaDrawer,y as EunomiaDrawerTagName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-MPQP4R54.js";import"./chunks/chunk-CEDHJUUH.js";import"./chunks/chunk-UP4M7TER.js";import"./chunks/chunk-A4EQSU36.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-5EVP7YNE.js";import"./chunks/chunk-XH6NREVZ.js";export{b as EunomiaDropdownButton,a as EunomiaDropdownButtonTagName};
|