@eunomia/elements 1.0.0-beta.7 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/components/chunks/{chunk-3PNGQEG4.js → chunk-32L2QYWQ.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-Z3OFIE7S.js → chunk-3UUZM7X2.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-BVASCT2V.js → chunk-55PUDL7D.js} +13 -13
- package/dist/cdn/components/chunks/chunk-5LA5DQMP.js +1 -0
- package/dist/cdn/components/chunks/chunk-5LXGJVJR.js +1 -0
- package/dist/cdn/components/chunks/chunk-6TIEBY34.js +1 -0
- package/dist/cdn/components/chunks/{chunk-LVKMAHMU.js → chunk-AH2SKZ7T.js} +4 -1
- package/dist/cdn/components/chunks/chunk-JAGZL7JH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-DGI7TKCU.js → chunk-LD35BFNK.js} +5 -9
- package/dist/cdn/components/chunks/chunk-P6LGU3FT.js +1 -0
- package/dist/cdn/components/chunks/{chunk-UYZR4JXZ.js → chunk-QSZO4GIH.js} +45 -9
- package/dist/cdn/components/chunks/{chunk-PXF554MD.js → chunk-QYB6Z6FG.js} +5 -5
- package/dist/cdn/components/chunks/{chunk-RIFF2D2F.js → chunk-RGC3I6MK.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-N6ZW5CDN.js → chunk-TCSB2MLU.js} +1 -1
- package/dist/cdn/components/chunks/chunk-WIUERJII.js +1 -0
- package/dist/cdn/components/eun-animate.js +4 -4
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-carousel.js +10 -9
- package/dist/cdn/components/eun-chip.js +17 -11
- package/dist/cdn/components/eun-collapse.js +1 -1
- package/dist/cdn/components/eun-color-picker.js +18 -5
- package/dist/cdn/components/eun-counter.js +10 -8
- package/dist/cdn/components/eun-date-picker.js +46 -43
- package/dist/cdn/components/eun-drawer.js +19 -20
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-dropdown-item.js +3 -3
- package/dist/cdn/components/eun-fab.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +4 -4
- package/dist/cdn/components/eun-input-phone.js +11 -8
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +59 -13
- package/dist/cdn/components/eun-modal.js +23 -13
- package/dist/cdn/components/eun-scheduler-event-editor.js +1 -1
- package/dist/cdn/components/eun-search.js +34 -28
- package/dist/cdn/components/eun-select.js +3 -3
- package/dist/cdn/components/eun-sidebar.js +66 -21
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-stepper.js +16 -16
- package/dist/cdn/components/eun-tab-panel.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +2 -2
- package/dist/cdn/components/eun-textarea.js +16 -13
- package/dist/cdn/components/eun-time-picker.js +25 -23
- package/dist/cdn/components/eun-toast.js +8 -8
- package/dist/cdn/components/eun-toggle-group.js +71 -35
- package/dist/cdn/components/eun-toggle-item.js +8 -8
- package/dist/cdn/components/eun-toolbar.js +20 -20
- package/dist/cdn/components/eun-tooltip.js +6 -6
- package/dist/cdn/styles/eunomia-themes.css +1 -1
- package/dist/cdn/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/eunomia/eunomia.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/fire/eunomia-fire.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/forest/eunomia-forest.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/gold/eunomia-gold.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/ocean/eunomia-ocean.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/salmon/eunomia-salmon.theme.css +1 -1
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/styles/themes/prebuilt-themes/violet/eunomia-violet.theme.css +1 -1
- package/dist/components/action/button/button.d.ts +2 -2
- package/dist/components/action/button/button.js +3 -7
- package/dist/components/action/button/button.styles.js +3 -3
- package/dist/components/action/dropdown-button/dropdown-button.d.ts +4 -6
- package/dist/components/action/dropdown-button/dropdown-button.js +6 -8
- package/dist/components/action/dropdown-button/dropdown-item.d.ts +10 -2
- package/dist/components/action/dropdown-button/dropdown-item.js +24 -9
- package/dist/components/action/link/link.d.ts +10 -1
- package/dist/components/action/link/link.js +13 -1
- package/dist/components/action/link/link.styles.js +50 -3
- package/dist/components/action/toggle/toggle-group.d.ts +12 -2
- package/dist/components/action/toggle/toggle-group.js +17 -2
- package/dist/components/action/toggle/toggle-group.styles.js +54 -18
- package/dist/components/action/toggle/toggle-item.js +1 -3
- package/dist/components/action/toggle/toggle-item.styles.js +7 -7
- package/dist/components/alert/drawer/drawer.d.ts +25 -0
- package/dist/components/alert/drawer/drawer.js +42 -3
- package/dist/components/alert/drawer/drawer.styles.js +6 -6
- package/dist/components/alert/modal/modal.d.ts +25 -0
- package/dist/components/alert/modal/modal.js +42 -3
- package/dist/components/alert/modal/modal.styles.js +17 -6
- package/dist/components/alert/toast/toast.js +3 -2
- package/dist/components/alert/toast/toast.styles.js +3 -3
- package/dist/components/content/chip/chip.js +3 -2
- package/dist/components/content/chip/chip.styles.js +9 -3
- package/dist/components/content/image-carousel/image-carousel.js +5 -4
- package/dist/components/content/tooltip/tooltip.d.ts +16 -9
- package/dist/components/content/tooltip/tooltip.js +28 -12
- package/dist/components/content/tooltip/tooltip.styles.js +1 -1
- package/dist/components/form/color-picker/color-picker.d.ts +7 -1
- package/dist/components/form/color-picker/color-picker.js +8 -2
- package/dist/components/form/color-picker/color-picker.styles.js +13 -0
- package/dist/components/form/counter/counter.d.ts +3 -1
- package/dist/components/form/counter/counter.js +3 -1
- package/dist/components/form/counter/counter.styles.js +6 -4
- package/dist/components/form/date-picker/date-picker.d.ts +6 -1
- package/dist/components/form/date-picker/date-picker.js +7 -2
- package/dist/components/form/date-picker/date-picker.styles.js +9 -6
- package/dist/components/form/input/input.d.ts +6 -1
- package/dist/components/form/input/input.js +7 -2
- package/dist/components/form/input-phone/input-phone.d.ts +7 -1
- package/dist/components/form/input-phone/input-phone.js +7 -1
- package/dist/components/form/input-phone/input-phone.styles.js +6 -3
- package/dist/components/form/search/search.d.ts +64 -10
- package/dist/components/form/search/search.js +112 -31
- package/dist/components/form/search/search.styles.js +2 -0
- package/dist/components/form/select/select.d.ts +7 -1
- package/dist/components/form/select/select.js +7 -1
- package/dist/components/form/shared-styles/field.styles.js +45 -8
- package/dist/components/form/shared-styles/listbox.styles.js +5 -1
- package/dist/components/form/textarea/textarea.d.ts +1 -0
- package/dist/components/form/textarea/textarea.js +2 -1
- package/dist/components/form/textarea/textarea.styles.js +3 -0
- package/dist/components/form/time-picker/time-picker.d.ts +6 -1
- package/dist/components/form/time-picker/time-picker.js +7 -2
- package/dist/components/form/time-picker/time-picker.styles.js +7 -5
- package/dist/components/layout/animate/animate.js +2 -1
- package/dist/components/navigation/carousel/carousel.d.ts +1 -2
- package/dist/components/navigation/carousel/carousel.js +14 -6
- package/dist/components/navigation/carousel/carousel.styles.js +5 -4
- package/dist/components/navigation/sidebar/sidebar.d.ts +98 -52
- package/dist/components/navigation/sidebar/sidebar.js +140 -85
- package/dist/components/navigation/sidebar/sidebar.styles.d.ts +1 -1
- package/dist/components/navigation/sidebar/sidebar.styles.js +69 -21
- package/dist/components/navigation/stepper/stepper.d.ts +1 -3
- package/dist/components/navigation/stepper/stepper.js +3 -21
- package/dist/components/navigation/toolbar/toolbar.d.ts +10 -0
- package/dist/components/navigation/toolbar/toolbar.js +8 -1
- package/dist/components/navigation/toolbar/toolbar.styles.js +18 -17
- package/dist/events/select.event.d.ts +3 -2
- package/dist/events/select.event.js +2 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +1 -1
- package/dist/features/table/table/table.js +1 -1
- package/dist/features/table/table-action-bar/table-action-bar.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/mixins/button.mixin.d.ts +1 -1
- package/dist/mixins/button.mixin.js +6 -4
- package/dist/mixins/dialog-surface.mixin.d.ts +8 -0
- package/dist/mixins/field-size.mixin.d.ts +19 -0
- package/dist/mixins/field-size.mixin.js +33 -0
- package/dist/mixins/rounded.mixin.d.ts +18 -0
- package/dist/mixins/rounded.mixin.js +32 -0
- package/dist/ssr/button-ssr.css +5 -5
- package/dist/ssr/carousel-ssr.css +9 -0
- package/dist/ssr/chip-ssr.css +8 -0
- package/dist/ssr/collapse-ssr.css +29 -0
- package/dist/ssr/field-ssr.css +43 -4
- package/dist/ssr/image-carousel-ssr.css +10 -0
- package/dist/ssr/links-ssr.css +38 -1
- package/dist/ssr/sidebar-ssr.css +95 -4
- package/dist/ssr/toggle-group-ssr.css +64 -13
- package/dist/ssr/toolbar-ssr.css +50 -0
- package/dist/types/variant.type.d.ts +4 -1
- package/dist/utils/boolean.utils.d.ts +14 -0
- package/dist/utils/boolean.utils.js +20 -0
- package/dist/utils/dropdown-menu.utils.d.ts +1 -1
- package/dist/utils/focusable-elements.utils.d.ts +12 -0
- package/dist/utils/focusable-elements.utils.js +26 -0
- package/dist/utils/input-modality.utils.d.ts +13 -0
- package/dist/utils/input-modality.utils.js +34 -0
- package/dist/utils/theme-generator.utils.d.ts +8 -2
- package/dist/utils/theme-generator.utils.js +30 -9
- package/package.json +1 -1
- package/styles/themes/mixins/eunomia-neutrals.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/eunomia/eunomia-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/fire/eunomia-fire-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/forest/eunomia-forest-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/gold/eunomia-gold-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/ocean/eunomia-ocean-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/salmon/eunomia-salmon-dark.mixin.scss +6 -2
- package/styles/themes/prebuilt-themes/violet/eunomia-violet-dark.mixin.scss +6 -2
- package/dist/cdn/components/chunks/chunk-6VK6SHCG.js +0 -1
- package/dist/cdn/components/chunks/chunk-UDOZRIJZ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as Pe,b as J,c as Le,d as Re,e as Fe,f as Ke,g as ee,h as W,i as Ge,j as te,k as Oe,l as ae,m as K,n as re,o as Ie,p as Ne,q as He,r as Ve,s as ze}from"./chunks/chunk-36KLGY6U.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as Me}from"./chunks/chunk-LK5BJ4SH.js";import{a as ke}from"./chunks/chunk-WIUERJII.js";import{a as $e}from"./chunks/chunk-QSZO4GIH.js";import{b as Ce,c as Z}from"./chunks/chunk-624VJYNA.js";import{a as q}from"./chunks/chunk-LYYQAALT.js";import{a as Ye,b as Ae}from"./chunks/chunk-WW4BTWMH.js";import{a as we}from"./chunks/chunk-GVS6IUKC.js";import{a as Te}from"./chunks/chunk-P6LGU3FT.js";import{a as Se}from"./chunks/chunk-BO3JOEWM.js";import{b as be,c as ye,d as De,e as xe,f as E}from"./chunks/chunk-TLBXTBMM.js";import{a as z}from"./chunks/chunk-YYCEPZUN.js";import{a as me}from"./chunks/chunk-3BMACIDO.js";import{a as D,c as U,d as x,e as X,f as F,g as Q,h as C,k as T,l as g,m as V,n as k,o as P,p as ge,q as O,r as I,s as ve,t as fe}from"./chunks/chunk-MJ4RDZLL.js";import{b as pe}from"./chunks/chunk-BKZGTCMF.js";import"./chunks/chunk-PPCHQG7P.js";import"./chunks/chunk-SD2H5UDZ.js";import{a as A}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import{a as he}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as l,f as ue,h as w,j as h,k as b,l as R,p as u,r as $,u as ce}from"./chunks/chunk-YITWLCD3.js";var tt=["day","month","year"];function Ee(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:tt}function j(r){switch(r){case"year":return["year"];case"month":return["month","year"];default:return["day","month","year"]}}function ie(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"),s=i?Number(r.day):1;if(i&&(!Number.isInteger(s)||s<1||s>31))return null;let d=new Date(e,a-1,s);return d.getFullYear()!==e||d.getMonth()!==a-1||i&&d.getDate()!==s?null:d}function We(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 je=w`
|
|
2
2
|
#calendar {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -190,7 +190,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
190
190
|
outline-offset: 2px;
|
|
191
191
|
border-radius: var(--eun-border-radius-s, 5px);
|
|
192
192
|
}
|
|
193
|
-
`;var
|
|
193
|
+
`;var _e=w`
|
|
194
194
|
#calendar-weekdays {
|
|
195
195
|
display: grid;
|
|
196
196
|
}
|
|
@@ -219,7 +219,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
219
219
|
var(--eun-text-disabled-color, #8d93aa)
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
`;var
|
|
222
|
+
`;var Be=w`
|
|
223
223
|
.calendar-row.row-3 {
|
|
224
224
|
grid-template-columns: repeat(3, 1fr);
|
|
225
225
|
}
|
|
@@ -230,7 +230,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
230
230
|
border-radius: var(--_cellRadius);
|
|
231
231
|
text-transform: capitalize;
|
|
232
232
|
}
|
|
233
|
-
`;var
|
|
233
|
+
`;var Ue=w`
|
|
234
234
|
.calendar-row.row-3 {
|
|
235
235
|
grid-template-columns: repeat(3, 1fr);
|
|
236
236
|
}
|
|
@@ -240,7 +240,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
240
240
|
padding: var(--eun-space-xs, 4px);
|
|
241
241
|
border-radius: var(--_cellRadius);
|
|
242
242
|
}
|
|
243
|
-
`;var
|
|
243
|
+
`;var at=w`
|
|
244
244
|
:host {
|
|
245
245
|
display: block;
|
|
246
246
|
width: 100%;
|
|
@@ -250,15 +250,15 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
250
250
|
display: flex;
|
|
251
251
|
align-items: center;
|
|
252
252
|
gap: var(--eun-space-xs, 4px);
|
|
253
|
-
width: 100%;
|
|
254
253
|
color: var(--_textColor);
|
|
255
254
|
background-color: var(--_background);
|
|
256
255
|
border: var(--eun-border-width-m, 1.5px) solid var(--_borderColor);
|
|
257
256
|
border-radius: var(--_borderRadius);
|
|
258
|
-
padding: var(--
|
|
259
|
-
var(--
|
|
257
|
+
padding: var(--_paddingBlock) calc(var(--_defaultPaddingInline) / 2)
|
|
258
|
+
var(--_paddingBlock) var(--_defaultPaddingInline);
|
|
260
259
|
outline: 1px solid transparent;
|
|
261
|
-
box-sizing:
|
|
260
|
+
box-sizing: content-box;
|
|
261
|
+
height: var(--_lineHeight);
|
|
262
262
|
transition:
|
|
263
263
|
border-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease),
|
|
264
264
|
outline-color var(--eun-duration-s, 150ms) var(--eun-easing-default, ease);
|
|
@@ -313,9 +313,10 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
313
313
|
box-sizing: content-box;
|
|
314
314
|
border: none;
|
|
315
315
|
background: none;
|
|
316
|
-
padding:
|
|
316
|
+
padding: 0 1px;
|
|
317
317
|
color: inherit;
|
|
318
318
|
font: inherit;
|
|
319
|
+
line-height: var(--_lineHeight);
|
|
319
320
|
text-align: center;
|
|
320
321
|
outline: none;
|
|
321
322
|
overflow: visible;
|
|
@@ -343,10 +344,11 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
343
344
|
box-sizing: content-box;
|
|
344
345
|
border: none;
|
|
345
346
|
background: none;
|
|
346
|
-
padding:
|
|
347
|
+
padding: 0 1px;
|
|
347
348
|
width: 2.5ch;
|
|
348
349
|
color: inherit;
|
|
349
350
|
font: inherit;
|
|
351
|
+
line-height: var(--_lineHeight);
|
|
350
352
|
text-align: center;
|
|
351
353
|
outline: none;
|
|
352
354
|
cursor: pointer;
|
|
@@ -362,6 +364,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
362
364
|
padding-inline: 2px;
|
|
363
365
|
}
|
|
364
366
|
#calendar-trigger {
|
|
367
|
+
--icon-size: min(16px, var(--_lineHeight));
|
|
365
368
|
display: flex;
|
|
366
369
|
align-items: center;
|
|
367
370
|
justify-content: center;
|
|
@@ -506,7 +509,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
506
509
|
var(--_borderColor, var(--eun-color-grey-300, #dee0e7));
|
|
507
510
|
padding: var(--eun-space-m);
|
|
508
511
|
}
|
|
509
|
-
`,
|
|
512
|
+
`,Xe=[$e,at],rt=w`
|
|
510
513
|
@supports (anchor-name: --a) {
|
|
511
514
|
#calendar-popover:popover-open {
|
|
512
515
|
position-try-fallbacks: --eun-date-picker-above;
|
|
@@ -518,7 +521,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
518
521
|
bottom: calc(anchor(top) + 4px);
|
|
519
522
|
}
|
|
520
523
|
}
|
|
521
|
-
`,
|
|
524
|
+
`,Qe=rt;function qe(r){let{displayedMonth:n,weekStartsOn:e,hideWeekends:t,locale:a,todayLabel:i,previousMonthLabel:s,chooseMonthYearLabel:d,nextMonthLabel:c}=r,m=ve(n,e),v=ot(e,t,a),f=t?"row-5":"row-7";return u`
|
|
522
525
|
<div id="calendar">
|
|
523
526
|
<div id="calendar-header">
|
|
524
527
|
<button
|
|
@@ -559,7 +562,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
559
562
|
<div id="calendar-grid" role="grid">
|
|
560
563
|
${m.map(p=>u`
|
|
561
564
|
<div class="calendar-row ${f}" role="row">
|
|
562
|
-
${p.filter(y=>!t||!O(y)).map(y=>
|
|
565
|
+
${p.filter(y=>!t||!O(y)).map(y=>nt(y,r))}
|
|
563
566
|
</div>
|
|
564
567
|
`)}
|
|
565
568
|
</div>
|
|
@@ -569,23 +572,23 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
569
572
|
</button>
|
|
570
573
|
</div>
|
|
571
574
|
</div>
|
|
572
|
-
`}function ne(r,n,e,t){return n&&D(r).getTime()<D(n).getTime()||e&&D(r).getTime()>D(e).getTime()?!0:!!t?.(r)}function
|
|
575
|
+
`}function ne(r,n,e,t){return n&&D(r).getTime()<D(n).getTime()||e&&D(r).getTime()>D(e).getTime()?!0:!!t?.(r)}function it(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":V(r,a),"range-end":V(r,i),"in-range":I(D(r),D(a),D(i))}}function nt(r,n){let{mode:e,displayedMonth:t,value:a,rangeValue:i,hoverDate:s,focusedDate:d,locale:c,minDate:m,maxDate:v,isDateDisabled:f,onDayClick:p,onDayHover:y,onDayKeydown:M}=n,S=ne(r,m,v,f),Y=e==="single"&&!!a&&V(r,a),L=e==="range"?it(r,i,s):{"range-start":!1,"range-end":!1,"in-range":!1},H=()=>{S||p(r)},B=()=>{S||y(r)};return u`
|
|
573
576
|
<button
|
|
574
577
|
type="button"
|
|
575
|
-
class=${A({"grid-cell":!0,"cell-day":!0,outside:!k(r,t),today:ge(r),selected:Y,...
|
|
578
|
+
class=${A({"grid-cell":!0,"cell-day":!0,outside:!k(r,t),today:ge(r),selected:Y,...L})}
|
|
576
579
|
role="gridcell"
|
|
577
|
-
tabindex=${
|
|
580
|
+
tabindex=${V(r,d)?"0":"-1"}
|
|
578
581
|
?disabled=${S}
|
|
579
582
|
aria-disabled=${S?"true":"false"}
|
|
580
|
-
aria-selected=${Y||
|
|
583
|
+
aria-selected=${Y||L["range-start"]||L["range-end"]?"true":"false"}
|
|
581
584
|
aria-label=${r.toLocaleDateString(c,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}
|
|
582
|
-
@click=${
|
|
583
|
-
@mouseenter=${
|
|
584
|
-
@keydown=${
|
|
585
|
+
@click=${H}
|
|
586
|
+
@mouseenter=${B}
|
|
587
|
+
@keydown=${et=>M(et,r)}
|
|
585
588
|
>
|
|
586
589
|
<span class="cell-label">${r.getDate()}</span>
|
|
587
590
|
</button>
|
|
588
|
-
`}function
|
|
591
|
+
`}function ot(r,n,e){let t=new Date(1970,0,4);return Array.from({length:7},(a,i)=>C(t,r+i)).filter(a=>!n||!O(a)).map(a=>a.toLocaleDateString(e,{weekday:"short"}))}function Ze(r){let{displayedYear:n,locale:e,previousYearLabel:t,chooseYearLabel:a,nextYearLabel:i}=r,s=Array.from({length:12},(d,c)=>new Date(n,c,1));return u`
|
|
589
592
|
<div id="calendar">
|
|
590
593
|
<div id="calendar-header">
|
|
591
594
|
<button
|
|
@@ -617,14 +620,14 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
617
620
|
</button>
|
|
618
621
|
</div>
|
|
619
622
|
<div id="calendar-grid" role="grid">
|
|
620
|
-
${
|
|
623
|
+
${dt(s,3).map(d=>u`
|
|
621
624
|
<div class="calendar-row row-3" role="row">
|
|
622
|
-
${d.map(c=>
|
|
625
|
+
${d.map(c=>lt(c,r,e))}
|
|
623
626
|
</div>
|
|
624
627
|
`)}
|
|
625
628
|
</div>
|
|
626
629
|
</div>
|
|
627
|
-
`}function oe(r,n,e,t){return n&&X(r).getTime()<x(n).getTime()||e&&x(r).getTime()>X(e).getTime()?!0:!!t?.(x(r))}function
|
|
630
|
+
`}function oe(r,n,e,t){return n&&X(r).getTime()<x(n).getTime()||e&&x(r).getTime()>X(e).getTime()?!0:!!t?.(x(r))}function st(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":k(r,a),"range-end":k(r,i),"in-range":I(x(r),x(a),x(i))}}function lt(r,n,e){let{mode:t,value:a,rangeValue:i,hoverDate:s,focusedDate:d,minDate:c,maxDate:m,isDateDisabled:v,onMonthClick:f,onMonthHover:p,onMonthKeydown:y}=n,M=oe(r,c,m,v),S=t==="single"&&!!a&&k(r,a),Y=t==="range"?st(r,i,s):{"range-start":!1,"range-end":!1,"in-range":!1},L=()=>{M||f(r)},H=()=>{M||p(r)};return u`
|
|
628
631
|
<button
|
|
629
632
|
type="button"
|
|
630
633
|
class=${A({"grid-cell":!0,"cell-month":!0,today:k(r,new Date),selected:S,...Y})}
|
|
@@ -634,15 +637,15 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
634
637
|
aria-disabled=${M?"true":"false"}
|
|
635
638
|
aria-selected=${S||Y["range-start"]||Y["range-end"]?"true":"false"}
|
|
636
639
|
aria-label=${r.toLocaleDateString(e,{month:"long",year:"numeric"})}
|
|
637
|
-
@click=${
|
|
638
|
-
@mouseenter=${
|
|
639
|
-
@keydown=${
|
|
640
|
+
@click=${L}
|
|
641
|
+
@mouseenter=${H}
|
|
642
|
+
@keydown=${B=>y(B,r)}
|
|
640
643
|
>
|
|
641
644
|
<span class="cell-label"
|
|
642
645
|
>${r.toLocaleDateString(e,{month:"short"})}</span
|
|
643
646
|
>
|
|
644
647
|
</button>
|
|
645
|
-
`}function
|
|
648
|
+
`}function dt(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 N(r){return Math.floor(r/_)*_}function Je(r){let n=N(r.displayedYear),e=Array.from({length:_},(t,a)=>new Date(n+a,0,1));return u`
|
|
646
649
|
<div id="calendar">
|
|
647
650
|
<div id="calendar-header">
|
|
648
651
|
<button
|
|
@@ -654,7 +657,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
654
657
|
<eun-icon name="chevron_left" size="16"></eun-icon>
|
|
655
658
|
</button>
|
|
656
659
|
<span id="grid-label"
|
|
657
|
-
>${n}–${n+
|
|
660
|
+
>${n}–${n+_-1}</span
|
|
658
661
|
>
|
|
659
662
|
<button
|
|
660
663
|
type="button"
|
|
@@ -666,30 +669,30 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
666
669
|
</button>
|
|
667
670
|
</div>
|
|
668
671
|
<div id="calendar-grid" role="grid">
|
|
669
|
-
${
|
|
672
|
+
${ht(e,3).map(t=>u`
|
|
670
673
|
<div class="calendar-row row-3" role="row">
|
|
671
|
-
${t.map(a=>
|
|
674
|
+
${t.map(a=>ct(a,r))}
|
|
672
675
|
</div>
|
|
673
676
|
`)}
|
|
674
677
|
</div>
|
|
675
678
|
</div>
|
|
676
|
-
`}function se(r,n,e,t){return n&&Q(r).getTime()<F(n).getTime()||e&&F(r).getTime()>Q(e).getTime()?!0:!!t?.(F(r))}function
|
|
679
|
+
`}function se(r,n,e,t){return n&&Q(r).getTime()<F(n).getTime()||e&&F(r).getTime()>Q(e).getTime()?!0:!!t?.(F(r))}function ut(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":P(r,a),"range-end":P(r,i),"in-range":I(F(r),F(a),F(i))}}function ct(r,n){let{mode:e,value:t,rangeValue:a,hoverDate:i,focusedDate:s,minDate:d,maxDate:c,isDateDisabled:m,onYearClick:v,onYearHover:f,onYearKeydown:p}=n,y=se(r,d,c,m),M=e==="single"&&!!t&&P(r,t),S=e==="range"?ut(r,a,i):{"range-start":!1,"range-end":!1,"in-range":!1},Y=()=>{y||v(r)},L=()=>{y||f(r)};return u`
|
|
677
680
|
<button
|
|
678
681
|
type="button"
|
|
679
|
-
class=${A({"grid-cell":!0,"cell-year":!0,today:
|
|
682
|
+
class=${A({"grid-cell":!0,"cell-year":!0,today:P(r,new Date),selected:M,...S})}
|
|
680
683
|
role="gridcell"
|
|
681
|
-
tabindex=${
|
|
684
|
+
tabindex=${P(r,s)?"0":"-1"}
|
|
682
685
|
?disabled=${y}
|
|
683
686
|
aria-disabled=${y?"true":"false"}
|
|
684
687
|
aria-selected=${M||S["range-start"]||S["range-end"]?"true":"false"}
|
|
685
688
|
aria-label=${String(r.getFullYear())}
|
|
686
689
|
@click=${Y}
|
|
687
|
-
@mouseenter=${
|
|
688
|
-
@keydown=${
|
|
690
|
+
@mouseenter=${L}
|
|
691
|
+
@keydown=${H=>p(H,r)}
|
|
689
692
|
>
|
|
690
693
|
<span class="cell-label">${r.getFullYear()}</span>
|
|
691
694
|
</button>
|
|
692
|
-
`}function ut(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var ct="eun-date-picker",ht={day:{min:1,max:31},month:{min:1,max:12}},pt=me(xe(ce)),mt=he(Te(we(Se(De(ye(pt)))))),o=class extends mt{constructor(){super();this.errorOnChange=!0;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.dayPlaceholder="jj";this.monthPlaceholder="mm";this.yearPlaceholder="yyyy";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=x(new Date);this.focusedDate=D(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.handleImplicitSubmission=e=>{let t=this.internals.form,a=e.composedPath()[0];!t||this.isOpen||!(a instanceof Element&&a.matches(".segment"))||!$e(e)||(e.preventDefault(),Ce(t))};this.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>gt(i)&&!ie(i,e)))return{validity:{badInput:!0},message:this.dictionary.validation.invalidDate};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(vt(this.timeSegments)&&!W(this.timeSegments,i))return{validity:{badInput:!0},message:"Enter a valid time"};if(this.value){let{hour:s,minute:d}=K(this.value,this.timezone),c=Ke({hour:s,minute:d},te(this.minTime),te(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=this.dictionary.validation.valueMissing),{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}=J(t.hour);this.stagingTime={hour:Ae(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,C,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,C,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(U(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(C(U(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(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,T,i=>this.isMonthDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,T,i=>this.isMonthDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,T,i=>this.isMonthDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,T,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(T(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=T(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=T(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=x(e),this.jumpFocused(this.nearestWorkweekDay(D(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(Le(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}};this.addEventListener("keydown",this.handleImplicitSubmission)}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=ee(i.hour,i.minute,a)}else this.timeSegments=ee(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)}),be(e)&&this.setAttribute("aria-invalid",String(this.showError))}get hostTabStop(){return!1}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(pe("tablet")).matches}isDayDisabled(e){return ne(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return oe(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return se(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=D(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 Ye(this.locale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=K(e,this.timezone);return re({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??ae())}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 E(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 E(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:s,minute:d}=K(this.value,this.timezone);i={hour:s,minute:d}}else i={hour:0,minute:0};return re({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:i.hour,minute:i.minute},this.timezone??ae())}commitTypedTime(e,t){this.value=Ge(this.value??new Date,this.timezone,e,t),this.dispatchEvent(new E(this.value)),(this.isOpen||this.isModalOpen)&&this.resetStaging()}commitTimeSegmentGroupIfComplete(e){let t=this.resolvedHourFormat();if(!Fe(e,t))return;let a=W(e,t);a&&this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Me(e,"--date-picker-panel-transition-duration","m",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:Z(e),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:Z(e),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:k(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=x(this.focusedDate));break}}moveFocused(e,t,a){let i=e>0?1:-1,s=t(this.focusedDate,e);for(let d=0;a(s)&&d<1e3;d+=1)s=t(s,i);this.focusedDate=s,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=C(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[s,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:s,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,s=a==="year"?4:2,d=i.value.replace(/\D/g,"").slice(0,s);i.value=d;let m={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,m),d.length===s&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,m)}commitSegmentGroupIfComplete(e,t){let a=j(this.granularity);if(!Ee(t,a))return;let i=ie(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),s=Number(i[t]),d=ft(t),c;if(i[t]===""||Number.isNaN(s))c=d;else{let p=ht[t];c=s+a,p&&c>p.max?c=p.min:p&&c<p.min?c=p.max:p||(c=Math.max(0,c))}let m=t==="year"?4:2,v=String(c).padStart(m,"0").slice(-m),f={...i,[t]:v};this.writeSegmentGroup(e,f),this.commitSegmentGroupIfComplete(e,f)}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 He(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 s={...this.timeSegments,[t]:i};this.timeSegments=s,i.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(s)}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(),s=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},d=Number(this.timeSegments[e]),c;if(this.timeSegments[e]===""||Number.isNaN(d)){let v=K(this.value??new Date,this.timezone),f=a===12?J(v.hour).hour:v.hour;c=e==="hour"?f:v.minute}else c=d+t,c>s.max?c=s.min:c<s.min&&(c=s.max);let m={...this.timeSegments,[e]:String(c).padStart(2,"0")};this.timeSegments=m,this.commitTimeSegmentGroupIfComplete(m)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Pe(this.resolvedHourFormat());return Re(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`
|
|
695
|
+
`}function ht(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var pt="eun-date-picker",mt={day:{min:1,max:31},month:{min:1,max:12}},gt=me(xe(ce)),vt=he(Me(Te(ke(we(Se(De(ye(gt)))))))),o=class extends vt{constructor(){super();this.errorOnChange=!0;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.dayPlaceholder="jj";this.monthPlaceholder="mm";this.yearPlaceholder="yyyy";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=x(new Date);this.focusedDate=D(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.handleImplicitSubmission=e=>{let t=this.internals.form,a=e.composedPath()[0];!t||this.isOpen||!(a instanceof Element&&a.matches(".segment"))||!Ye(e)||(e.preventDefault(),Ae(t))};this.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>ft(i)&&!ie(i,e)))return{validity:{badInput:!0},message:this.dictionary.validation.invalidDate};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(bt(this.timeSegments)&&!W(this.timeSegments,i))return{validity:{badInput:!0},message:"Enter a valid time"};if(this.value){let{hour:s,minute:d}=K(this.value,this.timezone),c=Oe({hour:s,minute:d},te(this.minTime),te(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=this.dictionary.validation.valueMissing),{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}=J(t.hour);this.stagingTime={hour:Le(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,C,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,C,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,C,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(U(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(C(U(this.focusedDate,this.weekStartsOn),6),-1));break;case"PageUp":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(this.focusedDate,e.shiftKey?-12:-1),1));break;case"PageDown":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(T(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,T,i=>this.isMonthDisabled(i));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,T,i=>this.isMonthDisabled(i));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-3,T,i=>this.isMonthDisabled(i));break;case"ArrowDown":e.preventDefault(),this.moveFocused(3,T,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(N(this.focusedDate.getFullYear()),0,1));break;case"End":e.preventDefault(),this.jumpFocused(new Date(N(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(T(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=T(this.displayedAnchor,-1)};this.handleNextMonth=()=>{this.displayedAnchor=T(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=x(e),this.jumpFocused(this.nearestWorkweekDay(D(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(Re(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}};this.addEventListener("keydown",this.handleImplicitSubmission)}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=ee(i.hour,i.minute,a)}else this.timeSegments=ee(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)}),be(e)&&this.setAttribute("aria-invalid",String(this.showError))}get hostTabStop(){return!1}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(pe("tablet")).matches}isDayDisabled(e){return ne(e,this.minDate,this.maxDate,this.isDateDisabled)}isMonthDisabled(e){return oe(e,this.minDate,this.maxDate,this.isDateDisabled)}isYearDisabled(e){return se(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=D(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 Pe(this.locale,this.hourFormat)}composeWithTime(e){let t=this.stagingTime??{hour:0,minute:0},a=K(e,this.timezone);return re({year:a.year,month:a.month,day:a.day,hour:t.hour,minute:t.minute},this.timezone??ae())}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:s,minute:d}=K(this.value,this.timezone);i={hour:s,minute:d}}else i={hour:0,minute:0};return re({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:i.hour,minute:i.minute},this.timezone??ae())}commitTypedTime(e,t){this.value=Ie(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(!Ge(e,t))return;let a=W(e,t);a&&this.commitTypedTime(a.hour,a.minute)}popoverAnimationDuration(e){return this.noAnimation||window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:Ce(e,"--date-picker-panel-transition-duration","m",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:Z(e),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:Z(e),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":P(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=this.focusedDate);break;case"year":N(this.focusedDate.getFullYear())!==N(this.displayedAnchor.getFullYear())&&(this.displayedAnchor=this.focusedDate);break;default:k(this.focusedDate,this.displayedAnchor)||(this.displayedAnchor=x(this.focusedDate));break}}moveFocused(e,t,a){let i=e>0?1:-1,s=t(this.focusedDate,e);for(let d=0;a(s)&&d<1e3;d+=1)s=t(s,i);this.focusedDate=s,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=C(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[s,d]=e.getTime()<a.getTime()?[e,a]:[a,e];this.stagingRange={start:s,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,s=a==="year"?4:2,d=i.value.replace(/\D/g,"").slice(0,s);i.value=d;let m={...this.readSegmentGroup(t),[a]:d};this.writeSegmentGroup(t,m),d.length===s&&this.focusNextSegment(t,a),this.commitSegmentGroupIfComplete(t,m)}commitSegmentGroupIfComplete(e,t){let a=j(this.granularity);if(!We(t,a))return;let i=ie(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),s=Number(i[t]),d=yt(t),c;if(i[t]===""||Number.isNaN(s))c=d;else{let p=mt[t];c=s+a,p&&c>p.max?c=p.min:p&&c<p.min?c=p.max:p||(c=Math.max(0,c))}let m=t==="year"?4:2,v=String(c).padStart(m,"0").slice(-m),f={...i,[t]:v};this.writeSegmentGroup(e,f),this.commitSegmentGroupIfComplete(e,f)}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 Ee(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 s={...this.timeSegments,[t]:i};this.timeSegments=s,i.length===2&&this.focusNextTimeSegment(t),this.commitTimeSegmentGroupIfComplete(s)}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(),s=e==="hour"?a===12?{min:1,max:12}:{min:0,max:23}:{min:0,max:59},d=Number(this.timeSegments[e]),c;if(this.timeSegments[e]===""||Number.isNaN(d)){let v=K(this.value??new Date,this.timezone),f=a===12?J(v.hour).hour:v.hour;c=e==="hour"?f:v.minute}else c=d+t,c>s.max?c=s.min:c<s.min&&(c=s.max);let m={...this.timeSegments,[e]:String(c).padStart(2,"0")};this.timeSegments=m,this.commitTimeSegmentGroupIfComplete(m)}setPeriodSegment(e){if(this.disabled||this.readonly)return;let t={...this.timeSegments,period:e};this.timeSegments=t,this.commitTimeSegmentGroupIfComplete(t)}visibleTimeSegmentOrder(){let e=Fe(this.resolvedHourFormat());return Ke(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`
|
|
693
696
|
<div
|
|
694
697
|
class="segment-group time-segment-group"
|
|
695
698
|
role="group"
|
|
@@ -759,7 +762,7 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
759
762
|
@input=${s=>this.handleSegmentInput(s,e,t)}
|
|
760
763
|
@keydown=${s=>this.handleSegmentKeydown(s,e,t)}
|
|
761
764
|
/>
|
|
762
|
-
`}dayGridProps(){return{mode:this.mode,displayedMonth:this.displayedAnchor,value:this.stagingValue,rangeValue:this.stagingRange,hoverDate:this.hoverDate,focusedDate:this.focusedDate,weekStartsOn:this.weekStartsOn,hideWeekends:this.workWeek,locale:this.locale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,todayLabel:this.todayLabel,previousMonthLabel:this.dictionary.datePicker.previousMonth,chooseMonthYearLabel:this.dictionary.datePicker.chooseMonthYear,nextMonthLabel:this.dictionary.datePicker.nextMonth,onDayClick:e=>this.handleDayClick(e),onDayHover:this.handleHover,onDayKeydown:this.handleDayKeydown,onPreviousMonth:this.handlePreviousMonth,onNextMonth:this.handleNextMonth,onToday:this.handleToday,onLabelClick:this.enterMonthNav}}monthGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:x(this.displayedAnchor),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,locale:this.locale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearLabel:this.dictionary.datePicker.previousYear,chooseYearLabel:this.dictionary.datePicker.chooseYear,nextYearLabel:this.dictionary.datePicker.nextYear,onMonthClick:e?t=>this.handleMonthClick(t):this.handleQuickNavMonthClick,onMonthHover:this.handleHover,onMonthKeydown:e?this.handleMonthKeydown:(t,a)=>this.handleMonthKeydown(t,a,this.handleQuickNavMonthClick),onPreviousYear:this.handlePreviousYear,onNextYear:this.handleNextYear,onLabelClick:this.enterYearNav}}yearGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:new Date(this.displayedAnchor.getFullYear(),0,1),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearsLabel:this.dictionary.datePicker.previousYears,nextYearsLabel:this.dictionary.datePicker.nextYears,onYearClick:e?t=>this.handleYearClick(t):this.handleQuickNavYearClick,onYearHover:this.handleHover,onYearKeydown:e?this.handleYearKeydown:(t,a)=>this.handleYearKeydown(t,a,this.handleQuickNavYearClick),onPreviousPage:this.handlePreviousYearsPage,onNextPage:this.handleNextYearsPage}}renderGrid(){switch(this.navLevel){case"month":return
|
|
765
|
+
`}dayGridProps(){return{mode:this.mode,displayedMonth:this.displayedAnchor,value:this.stagingValue,rangeValue:this.stagingRange,hoverDate:this.hoverDate,focusedDate:this.focusedDate,weekStartsOn:this.weekStartsOn,hideWeekends:this.workWeek,locale:this.locale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,todayLabel:this.todayLabel,previousMonthLabel:this.dictionary.datePicker.previousMonth,chooseMonthYearLabel:this.dictionary.datePicker.chooseMonthYear,nextMonthLabel:this.dictionary.datePicker.nextMonth,onDayClick:e=>this.handleDayClick(e),onDayHover:this.handleHover,onDayKeydown:this.handleDayKeydown,onPreviousMonth:this.handlePreviousMonth,onNextMonth:this.handleNextMonth,onToday:this.handleToday,onLabelClick:this.enterMonthNav}}monthGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:x(this.displayedAnchor),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,locale:this.locale,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearLabel:this.dictionary.datePicker.previousYear,chooseYearLabel:this.dictionary.datePicker.chooseYear,nextYearLabel:this.dictionary.datePicker.nextYear,onMonthClick:e?t=>this.handleMonthClick(t):this.handleQuickNavMonthClick,onMonthHover:this.handleHover,onMonthKeydown:e?this.handleMonthKeydown:(t,a)=>this.handleMonthKeydown(t,a,this.handleQuickNavMonthClick),onPreviousYear:this.handlePreviousYear,onNextYear:this.handleNextYear,onLabelClick:this.enterYearNav}}yearGridProps(){let e=this.navLevel===this.granularity;return{mode:e?this.mode:"single",displayedYear:this.displayedAnchor.getFullYear(),value:e?this.stagingValue:new Date(this.displayedAnchor.getFullYear(),0,1),rangeValue:e?this.stagingRange:{start:null,end:null},hoverDate:e?this.hoverDate:null,focusedDate:this.focusedDate,minDate:this.minDate,maxDate:this.maxDate,isDateDisabled:this.isDateDisabled,previousYearsLabel:this.dictionary.datePicker.previousYears,nextYearsLabel:this.dictionary.datePicker.nextYears,onYearClick:e?t=>this.handleYearClick(t):this.handleQuickNavYearClick,onYearHover:this.handleHover,onYearKeydown:e?this.handleYearKeydown:(t,a)=>this.handleYearKeydown(t,a,this.handleQuickNavYearClick),onPreviousPage:this.handlePreviousYearsPage,onNextPage:this.handleNextYearsPage}}renderGrid(){switch(this.navLevel){case"month":return Ze(this.monthGridProps());case"year":return Je(this.yearGridProps());default:return qe(this.dayGridProps())}}headingFor(){let e=this.dictionary.datePicker.heading[this.granularity];return this.mode==="single"?e.single:e.range}renderField(){return u`
|
|
763
766
|
<div
|
|
764
767
|
id="field-wrapper"
|
|
765
768
|
class=${A({"has-range":this.mode==="range"})}
|
|
@@ -779,15 +782,15 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
779
782
|
?disabled=${this.disabled}
|
|
780
783
|
@click=${this.handleTriggerClick}
|
|
781
784
|
>
|
|
782
|
-
<eun-icon name="calendar_today"
|
|
785
|
+
<eun-icon name="calendar_today"></eun-icon>
|
|
783
786
|
</button>
|
|
784
787
|
</div>
|
|
785
788
|
`}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=fe(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 $;let e=this.resolvedHourFormat(),t=this.stagingTime??{hour:0,minute:0},a=t.hour<12?"AM":"PM";return u`
|
|
786
789
|
<div id="time-section">
|
|
787
|
-
${
|
|
790
|
+
${Ve({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})}
|
|
788
791
|
${this.renderTimezoneLabel()}
|
|
789
792
|
</div>
|
|
790
|
-
`}renderTimezoneLabel(){if(!this.timezone||
|
|
793
|
+
`}renderTimezoneLabel(){if(!this.timezone||Ne(this.timezone))return $;let e=this.stagingValue??new Date,t=He(e,this.timezone,{locale:this.locale});return u`<p id="timezone-label">${t}</p>`}renderPopoverFooter(){return this.isWithTimeActive()?u`
|
|
791
794
|
<div id="popover-footer" class="modal-footer">
|
|
792
795
|
<eun-button
|
|
793
796
|
appearance="ghost"
|
|
@@ -848,4 +851,4 @@ import{a as Ye,b as J,c as Ae,d as Le,e as Pe,f as Re,g as ee,h as W,i as Fe,j a
|
|
|
848
851
|
</eun-button>
|
|
849
852
|
</div>
|
|
850
853
|
</eun-modal>
|
|
851
|
-
`}};o.styles=[
|
|
854
|
+
`}};o.styles=[Xe,...q?[]:[Qe],je,_e,Be,Ue,ze,E.base,E.errorMessages,E.hintMessages],o.SWIPE_THRESHOLD_PX=40,l([h({reflect:!0,useDefault:!0})],o.prototype,"mode",2),l([h({reflect:!0,useDefault:!0})],o.prototype,"granularity",2),l([h({attribute:"default-value",converter:{fromAttribute:e=>le(e),toAttribute:e=>e?de(e):null}})],o.prototype,"defaultValue",1),l([h({attribute:!1})],o.prototype,"rangeValue",2),l([h({type:Number,attribute:"week-starts-on"})],o.prototype,"weekStartsOn",2),l([h({type:Boolean,attribute:"work-week"})],o.prototype,"workWeek",2),l([h({type:Boolean,reflect:!0,attribute:"no-animation"})],o.prototype,"noAnimation",2),l([h({type:Boolean,reflect:!0,attribute:"with-time"})],o.prototype,"withTime",2),l([h()],o.prototype,"timezone",2),l([h({type:Number,attribute:"hour-format"})],o.prototype,"hourFormat",2),l([h({type:Number,attribute:"step-minute"})],o.prototype,"stepMinute",2),l([h({attribute:"min-time"})],o.prototype,"minTime",2),l([h({attribute:"max-time"})],o.prototype,"maxTime",2),l([h({attribute:!1})],o.prototype,"minDate",2),l([h({attribute:!1})],o.prototype,"maxDate",2),l([h({attribute:!1})],o.prototype,"isDateDisabled",2),l([h({attribute:"today-label"})],o.prototype,"todayLabel",2),l([h({attribute:"apply-label"})],o.prototype,"applyLabel",2),l([h({attribute:"cancel-label"})],o.prototype,"cancelLabel",2),l([h({attribute:"calendar-label"})],o.prototype,"calendarLabel",2),l([h({attribute:"day-placeholder"})],o.prototype,"dayPlaceholder",2),l([h({attribute:"month-placeholder"})],o.prototype,"monthPlaceholder",2),l([h({attribute:"year-placeholder"})],o.prototype,"yearPlaceholder",2),l([h({attribute:"hour-placeholder"})],o.prototype,"hourPlaceholder",2),l([h({attribute:"minute-placeholder"})],o.prototype,"minutePlaceholder",2),l([h({attribute:"default-range-value",converter:{fromAttribute:e=>{if(!e)return;let[t,a]=e.split(",").map(i=>i.trim());return{start:le(t),end:le(a)}},toAttribute:e=>e?`${de(e.start)},${de(e.end)}`:null}})],o.prototype,"defaultRangeValue",2),l([b()],o.prototype,"isOpen",2),l([b()],o.prototype,"isModalOpen",2),l([b()],o.prototype,"displayedAnchor",2),l([b()],o.prototype,"focusedDate",2),l([b()],o.prototype,"navLevel",2),l([b()],o.prototype,"hoverDate",2),l([b()],o.prototype,"stagingValue",2),l([b()],o.prototype,"stagingRange",2),l([b()],o.prototype,"stagingTime",2),l([b()],o.prototype,"segments",2),l([b()],o.prototype,"rangeSegments",2),l([b()],o.prototype,"timeSegments",2),l([R("#calendar-trigger")],o.prototype,"triggerEl",2),l([R("#calendar-popover")],o.prototype,"popoverEl",2),l([R("#field-wrapper")],o.prototype,"fieldWrapperEl",2),l([R("#modal-date")],o.prototype,"modalEl",2),l([R("#calendar-swipe-area")],o.prototype,"swipeAreaEl",2),l([R(".segment")],o.prototype,"firstSegmentEl",2),o=l([ue(pt)],o);function ft(r){return Object.values(r).some(n=>n.length>0)}function bt(r){return r.hour!==""||r.minute!==""||r.period!==""}function yt(r){let n=new Date;switch(r){case"year":return n.getFullYear();case"month":return n.getMonth()+1;default:return n.getDate()}}function le(r){if(!r)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}function de(r){return r?r.toISOString().slice(0,10):""}export{o as EunomiaDatePicker,pt as EunomiaDatePickerTagName};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as v,b as m,c as g,d as y,e as C}from"./chunks/chunk-JAGZL7JH.js";import{a as b}from"./chunks/chunk-TCSB2MLU.js";import"./chunks/chunk-RGC3I6MK.js";import{a as h}from"./chunks/chunk-5LXGJVJR.js";import{a as s}from"./chunks/chunk-PPCHQG7P.js";import{a as l}from"./chunks/chunk-6TIEBY34.js";import{a as f}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as o,f as d,h as c,j as i,k as p,l as n,p as a,r,u}from"./chunks/chunk-YITWLCD3.js";var E=c`
|
|
2
2
|
:host {
|
|
3
3
|
--_width: var(--drawer-width, min(420px, 100vw));
|
|
4
4
|
--_background: var(--drawer-background, var(--eun-surface-color, #ffffff));
|
|
5
5
|
--_color: var(--drawer-color, var(--eun-text-color, #071621));
|
|
6
6
|
--_paddingBlock: var(
|
|
7
7
|
--drawer-padding,
|
|
8
|
-
var(--drawer-padding-block, var(--eun-space-
|
|
8
|
+
var(--drawer-padding-block, var(--eun-space-l, 32px))
|
|
9
9
|
);
|
|
10
10
|
--_paddingInline: var(
|
|
11
11
|
--drawer-padding,
|
|
12
|
-
var(--drawer-padding-inline, var(--eun-space-
|
|
12
|
+
var(--drawer-padding-inline, var(--eun-space-l, 32px))
|
|
13
13
|
);
|
|
14
14
|
--_gap: var(--drawer-gap, var(--eun-space-m, 16px));
|
|
15
15
|
--_transitionDuration: var(
|
|
@@ -102,7 +102,8 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
102
102
|
align-items: flex-start;
|
|
103
103
|
justify-content: space-between;
|
|
104
104
|
gap: var(--_gap);
|
|
105
|
-
padding: var(--_paddingBlock) var(--_paddingInline)
|
|
105
|
+
padding: var(--_paddingBlock) var(--_paddingInline)
|
|
106
|
+
var(--drawer-header-padding-bottom, var(--_gap));
|
|
106
107
|
}
|
|
107
108
|
#heading {
|
|
108
109
|
margin: 0;
|
|
@@ -117,7 +118,7 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
117
118
|
flex: 1;
|
|
118
119
|
min-height: 0;
|
|
119
120
|
overflow-y: auto;
|
|
120
|
-
padding: var(--
|
|
121
|
+
padding: var(--eun-space-xs, 4px) var(--_paddingInline);
|
|
121
122
|
font-size: var(--eun-font-size-s, 14px);
|
|
122
123
|
}
|
|
123
124
|
#footer {
|
|
@@ -129,8 +130,6 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
#confirm-close-modal {
|
|
132
|
-
--modal-padding: var(--eun-space-l, 32px) var(--eun-space-m, 16px)
|
|
133
|
-
var(--eun-space-m, 16px) var(--eun-space-l, 32px);
|
|
134
133
|
--modal-gap: var(--eun-space-m, 16px);
|
|
135
134
|
--modal-backdrop-blur: 6px;
|
|
136
135
|
}
|
|
@@ -141,12 +140,12 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
141
140
|
transition-duration: 0.01ms;
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
`,
|
|
143
|
+
`,x=E;var _="eun-drawer",t=class extends b(f(u)){constructor(){super(...arguments);this.position="end";this.closeable=!0;this.open=!1;this.closeOnBackdrop=!0;this.dirty=!1;this.initialFocus="auto";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 k=e;if(this.syncingFromPopover=!0,this.open=k.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=>{g(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?.(),y(),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 m;this.dispatchEvent(e),e.defaultPrevented||this.confirmCloseModalEl?.show();return}this.attemptClose()}attemptClose(){let e=new v;this.dispatchEvent(e),e.defaultPrevented||this.hide()}confirmDiscard(){this.dirty=!1,this.attemptClose()}focusFirstField(){if(this.initialFocus!=="first-field"||!C())return!1;let[e]=this.bodyEl?h(this.bodyEl):[];return e?.focus(),e!==void 0}focusInitialElement(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.focusFirstField()||(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 a`
|
|
145
144
|
<div id="header">
|
|
146
145
|
<slot name="header">
|
|
147
|
-
${this.heading?
|
|
146
|
+
${this.heading?a`<h2 id="heading">${this.heading}</h2>`:r}
|
|
148
147
|
</slot>
|
|
149
|
-
${this.closeable?
|
|
148
|
+
${this.closeable?a`
|
|
150
149
|
<eun-button
|
|
151
150
|
id="close-button"
|
|
152
151
|
appearance="ghost"
|
|
@@ -157,9 +156,9 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
157
156
|
>
|
|
158
157
|
<eun-icon name="close" size="16"></eun-icon>
|
|
159
158
|
</eun-button>
|
|
160
|
-
`:
|
|
159
|
+
`:r}
|
|
161
160
|
</div>
|
|
162
|
-
`}renderConfirmCloseModal(){return
|
|
161
|
+
`}renderConfirmCloseModal(){return a`
|
|
163
162
|
<eun-modal
|
|
164
163
|
id="confirm-close-modal"
|
|
165
164
|
kind="alert"
|
|
@@ -170,20 +169,20 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
170
169
|
@eunconfirm=${this.handleDiscardConfirmed}
|
|
171
170
|
@euncancel=${this.stopDialogPropagation}
|
|
172
171
|
>
|
|
173
|
-
${this.confirmCloseDescription?
|
|
172
|
+
${this.confirmCloseDescription?a`<p>${this.confirmCloseDescription}</p>`:r}
|
|
174
173
|
<slot name="confirm-close"></slot>
|
|
175
174
|
</eun-modal>
|
|
176
|
-
`}renderPanelContent(){return
|
|
177
|
-
${this.hasHeaderContent()?this.renderHeader():
|
|
175
|
+
`}renderPanelContent(){return a`
|
|
176
|
+
${this.hasHeaderContent()?this.renderHeader():r}
|
|
178
177
|
<div id="body">
|
|
179
178
|
<slot></slot>
|
|
180
179
|
</div>
|
|
181
|
-
${this.hasFooterContent()?
|
|
180
|
+
${this.hasFooterContent()?a`
|
|
182
181
|
<div id="footer">
|
|
183
182
|
<slot name="footer"></slot>
|
|
184
183
|
</div>
|
|
185
|
-
`:
|
|
186
|
-
`}render(){return
|
|
184
|
+
`:r}
|
|
185
|
+
`}render(){return a`
|
|
187
186
|
<div id="surface" popover="manual" @toggle=${this.handleToggle}>
|
|
188
187
|
<div
|
|
189
188
|
id="panel"
|
|
@@ -196,5 +195,5 @@ import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"
|
|
|
196
195
|
${this.renderPanelContent()}
|
|
197
196
|
</div>
|
|
198
197
|
</div>
|
|
199
|
-
${this.mountConfirmModal?this.renderConfirmCloseModal():
|
|
200
|
-
`}};t.styles=
|
|
198
|
+
${this.mountConfirmModal?this.renderConfirmCloseModal():r}
|
|
199
|
+
`}};t.styles=x,o([i({reflect:!0,useDefault:!0})],t.prototype,"position",2),o([i()],t.prototype,"heading",2),o([i({converter:l})],t.prototype,"closeable",2),o([i({type:Boolean,reflect:!0})],t.prototype,"open",2),o([i({converter:l,attribute:"close-on-backdrop"})],t.prototype,"closeOnBackdrop",2),o([i({type:Boolean,reflect:!0})],t.prototype,"dirty",2),o([i({attribute:"initial-focus",reflect:!0,useDefault:!0})],t.prototype,"initialFocus",2),o([n("#body")],t.prototype,"bodyEl",2),o([i({attribute:"close-label"})],t.prototype,"closeLabel",2),o([i({attribute:"confirm-close-heading"})],t.prototype,"confirmCloseHeading",2),o([i({attribute:"confirm-close-description"})],t.prototype,"confirmCloseDescription",2),o([i({attribute:"confirm-close-cancel-label"})],t.prototype,"confirmCloseCancelLabel",2),o([i({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([p()],t.prototype,"mountConfirmModal",2),t=o([d(_)],t);export{t as EunomiaDrawer,_ as EunomiaDrawerTagName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-QYB6Z6FG.js";import"./chunks/chunk-5LA5DQMP.js";import"./chunks/chunk-EUWUDCBZ.js";import"./chunks/chunk-624VJYNA.js";import"./chunks/chunk-UP4M7TER.js";import"./chunks/chunk-PPCHQG7P.js";import"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-YITWLCD3.js";export{b as EunomiaDropdownButton,a as EunomiaDropdownButtonTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f,b as y,d as g,e as S,f as m}from"./chunks/chunk-EUWUDCBZ.js";import{c as d}from"./chunks/chunk-624VJYNA.js";import{a as
|
|
1
|
+
import{a as f,b as y,d as g,e as S,f as m}from"./chunks/chunk-EUWUDCBZ.js";import{c as d}from"./chunks/chunk-624VJYNA.js";import{a as i,f as p,h as c,j as s,k as l,l as h,n as b,p as r,r as u,u as v}from"./chunks/chunk-YITWLCD3.js";var T=c`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
white-space: nowrap;
|
|
@@ -123,7 +123,7 @@ import{a as f,b as y,d as g,e as S,f as m}from"./chunks/chunk-EUWUDCBZ.js";impor
|
|
|
123
123
|
opacity: 1;
|
|
124
124
|
transform: translate(0, 0) scale(1);
|
|
125
125
|
}
|
|
126
|
-
`,x=T;var w="eun-dropdown-item",n=class extends v{constructor(){super(...arguments);this.disabled=!1;this.active=!1;this.hasSubmenu=!1;this.openChildKey=null;this.handleSubmenuToggle=e=>{if(e.newState==="open"){this.setAttribute("aria-expanded","true"),this.toggleAttribute("data-submenu-open",!0),this.container?.notifySubmenuOpened(this.
|
|
126
|
+
`,x=T;var w="eun-dropdown-item",n=class extends v{constructor(){super(...arguments);this.disabled=!1;this.active=!1;this.hasSubmenu=!1;this.openChildKey=null;this.handleSubmenuToggle=e=>{if(e.newState==="open"){this.setAttribute("aria-expanded","true"),this.toggleAttribute("data-submenu-open",!0),this.container?.notifySubmenuOpened(this.value),this.positionOwnSubmenu(),this.updateComplete.then(()=>y(this.submenuItems,0));return}this.setAttribute("aria-expanded","false"),this.toggleAttribute("data-submenu-open",!1),this.container?.notifySubmenuClosed(this.value),this.closeOtherSubmenus(null)};this.handleClick=()=>{this.disabled||(this.hasSubmenu?this.toggleOwnSubmenu():this.container?.selectByKey(this.value))};this.handleKeydown=e=>{let t=this.container;if(!t)return;let o=t.tagName===w.toUpperCase()?t:void 0;S(e,t.menuEntries,{onSelect:()=>t.selectByKey(this.value),onOpenSubmenu:()=>this.openSubmenu(),onClose:o?()=>{o.closeSubmenu(),this.updateComplete.then(()=>o.focus())}:void 0,onTabAway:()=>this.tabAway()})};this.handleMouseEnter=()=>{if(clearTimeout(this.closeSubmenuTimer),!this.hasSubmenu){this.closeSubmenuTimer=setTimeout(()=>{this.container?.closeOtherSubmenus(null)},150);return}this.disabled||this.submenuEl?.matches(":popover-open")||(clearTimeout(this.openSubmenuTimer),this.openSubmenuTimer=setTimeout(()=>this.openSubmenu(),150))};this.handleMouseLeave=()=>{clearTimeout(this.openSubmenuTimer),this.hasSubmenu&&this.scheduleCloseOwnSubmenu()};this.handleSubmenuSlotChange=()=>{this.hasSubmenu=this.submenuItems.length>0}}get key(){return this.value}set key(e){this.value=e}get container(){return this.parentElement?.closest(f)}connectedCallback(){super.connectedCallback?.(),this.hasAttribute("role")||this.setAttribute("role","menuitem"),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown),this.addEventListener("mouseenter",this.handleMouseEnter),this.addEventListener("mouseleave",this.handleMouseLeave)}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown),this.removeEventListener("mouseenter",this.handleMouseEnter),this.removeEventListener("mouseleave",this.handleMouseLeave),clearTimeout(this.openSubmenuTimer),clearTimeout(this.closeSubmenuTimer),super.disconnectedCallback?.()}firstUpdated(){this.hasSubmenu=this.submenuItems.length>0}updated(e){super.updated(e),e.has("disabled")&&(this.disabled?this.removeAttribute("tabindex"):this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")),e.has("hasSubmenu")&&(this.hasSubmenu?(this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded","false")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded")))}openSubmenu(){if(!this.hasSubmenu||this.disabled||!this.submenuEl)return;let e=this.submenuEl,t=this.submenuAnimation!==void 0;this.submenuAnimation?.cancel(),this.submenuAnimation=void 0;let o=!e.matches(":popover-open");!o&&!t||(clearTimeout(this.openSubmenuTimer),clearTimeout(this.closeSubmenuTimer),this.container?.closeOtherSubmenus(this.value),o&&e.showPopover(),this.playSubmenuOpenAnimation(e))}playSubmenuOpenAnimation(e){e.style.removeProperty("pointer-events");let t=m(e);if(t===0)return;let o=e.style.getPropertyValue("--_submenuOffsetX")||"-4px";this.submenuAnimation=e.animate([{opacity:0,transform:`translate(${o}, 0) scale(0.96)`},{opacity:1,transform:"translate(0, 0) scale(1)"}],{duration:t,easing:d(e),fill:"forwards"})}closeSubmenu(){clearTimeout(this.openSubmenuTimer),clearTimeout(this.closeSubmenuTimer);let e=this.submenuEl;this.submenuAnimation?.cancel(),this.submenuAnimation=void 0,e?.matches(":popover-open")&&this.playSubmenuCloseAnimation(e)}playSubmenuCloseAnimation(e){e.style.pointerEvents="none";let t=m(e),o=e.style.getPropertyValue("--_submenuOffsetX")||"-4px";if(t===0){e.hidePopover();return}let a=e.animate([{opacity:1,transform:"translate(0, 0) scale(1)"},{opacity:0,transform:`translate(${o}, 0) scale(0.96)`}],{duration:t,easing:d(e),fill:"forwards"});this.submenuAnimation=a,a.finished.then(()=>{this.submenuAnimation===a&&(this.submenuAnimation=void 0),e.hidePopover()}).catch(()=>{})}repositionSubmenu(){this.submenuEl?.matches(":popover-open")&&this.positionOwnSubmenu(),this.openChildKey&&this.submenuItems.find(e=>e.value===this.openChildKey)?.repositionSubmenu()}get menuEntries(){return this.submenuItems??[]}closeOtherSubmenus(e){!this.openChildKey||this.openChildKey===e||(this.submenuItems.find(t=>t.value===this.openChildKey)?.closeSubmenu(),this.openChildKey=null)}notifySubmenuOpened(e){this.openChildKey=e}notifySubmenuClosed(e){this.openChildKey===e&&(this.openChildKey=null)}selectByKey(e){this.container?.selectByKey(e)}tabAway(){this.container?.tabAway()}positionOwnSubmenu(){if(!this.submenuEl)return;let{top:e,left:t,offsetX:o}=g(this.getBoundingClientRect(),this.submenuEl.getBoundingClientRect(),4);this.submenuEl.style.setProperty("--_submenuTop",`${e}px`),this.submenuEl.style.setProperty("--_submenuLeft",`${t}px`),this.submenuEl.style.setProperty("--_submenuOffsetX",`${o}px`)}toggleOwnSubmenu(){this.submenuEl?.matches(":popover-open")?this.closeSubmenu():this.openSubmenu()}scheduleCloseOwnSubmenu(){clearTimeout(this.closeSubmenuTimer),this.closeSubmenuTimer=setTimeout(()=>this.closeSubmenu(),150)}render(){return r`
|
|
127
127
|
<span class="content" part="item">
|
|
128
128
|
<slot name="icon">
|
|
129
129
|
${this.icon?r`<eun-icon
|
|
@@ -152,4 +152,4 @@ import{a as f,b as y,d as g,e as S,f as m}from"./chunks/chunk-EUWUDCBZ.js";impor
|
|
|
152
152
|
>
|
|
153
153
|
<slot name="submenu" @slotchange=${this.handleSubmenuSlotChange}></slot>
|
|
154
154
|
</ul>
|
|
155
|
-
`}};n.styles=x,
|
|
155
|
+
`}};n.styles=x,i([s({reflect:!0})],n.prototype,"value",2),i([s({attribute:"key"})],n.prototype,"key",1),i([s()],n.prototype,"label",2),i([s()],n.prototype,"icon",2),i([s()],n.prototype,"description",2),i([s({type:Boolean,reflect:!0})],n.prototype,"disabled",2),i([s({type:Boolean,reflect:!0})],n.prototype,"active",2),i([l()],n.prototype,"hasSubmenu",2),i([l()],n.prototype,"openChildKey",2),i([b({slot:"submenu"})],n.prototype,"submenuItems",2),i([h(".submenu")],n.prototype,"submenuEl",2),n=i([p(w)],n);export{n as EunomiaDropdownItem,w as EunomiaDropdownItemTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f,b as c,c as b}from"./chunks/chunk-
|
|
1
|
+
import{a as f,b as c,c as b}from"./chunks/chunk-3UUZM7X2.js";import{a as h}from"./chunks/chunk-3BMACIDO.js";import{a as v}from"./chunks/chunk-5GKM5DIB.js";import{a as t}from"./chunks/chunk-PPCHQG7P.js";import{a as p}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as o,f as d,h as r,j as n,p as i,r as l,u}from"./chunks/chunk-YITWLCD3.js";var m=r`
|
|
2
2
|
:host {
|
|
3
3
|
--_focusIndicator: var(--fab-focus-outline, var(--_solid));
|
|
4
4
|
--_hoverFromCustom: color-mix(in srgb, var(--fab-background) 88%, black);
|