@eunomia/elements 1.0.0-beta.6 → 1.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cdn/components/chunks/{chunk-JYIIWN2P.js → chunk-36KLGY6U.js} +8 -8
- package/dist/cdn/components/chunks/chunk-3BMACIDO.js +1 -0
- package/dist/cdn/components/chunks/{chunk-KDN4O5W2.js → chunk-3PNGQEG4.js} +3 -3
- package/dist/cdn/components/chunks/{chunk-ZKZV2YG5.js → chunk-5XPOGBPL.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-LMVW522V.js → chunk-62RLISRD.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-PMPSJG5V.js → chunk-6FYW5TQU.js} +3 -3
- package/dist/cdn/components/chunks/chunk-AK2DIJX7.js +1 -0
- package/dist/cdn/components/chunks/chunk-B5XMGWM7.js +10 -0
- package/dist/cdn/components/chunks/chunk-BVASCT2V.js +109 -0
- package/dist/cdn/components/chunks/{chunk-VYFR364B.js → chunk-DGI7TKCU.js} +14 -9
- package/dist/cdn/components/chunks/chunk-GVS6IUKC.js +1 -0
- package/dist/cdn/components/chunks/chunk-GWLD2I3P.js +8 -0
- package/dist/cdn/components/chunks/{chunk-UDVB4LAE.js → chunk-I4ERDXSM.js} +5 -3
- package/dist/cdn/components/chunks/{chunk-QZ5SHR3I.js → chunk-J3SZBXM6.js} +2 -2
- package/dist/cdn/components/chunks/{chunk-MOMYII3P.js → chunk-LVKMAHMU.js} +10 -0
- package/dist/cdn/components/chunks/{chunk-XDPRWUKN.js → chunk-MQQJ6DID.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-SZYEBMG6.js → chunk-PXF554MD.js} +1 -1
- package/dist/cdn/components/chunks/chunk-QL5GSW2A.js +1 -0
- package/dist/cdn/components/chunks/{chunk-7KKWYPHY.js → chunk-QXQ25SQS.js} +21 -19
- package/dist/cdn/components/chunks/{chunk-L2ADCEN7.js → chunk-SVGWCKWT.js} +1 -1
- package/dist/cdn/components/chunks/{chunk-MQQ4BGVJ.js → chunk-TFTRCIIK.js} +7 -6
- package/dist/cdn/components/chunks/chunk-TLBXTBMM.js +46 -0
- package/dist/cdn/components/chunks/chunk-UVHVQRPT.js +1 -0
- package/dist/cdn/components/chunks/chunk-WW4BTWMH.js +1 -0
- package/dist/cdn/components/chunks/{chunk-2Y2EU2CI.js → chunk-Z3OFIE7S.js} +1 -1
- package/dist/cdn/components/eun-alert.js +13 -6
- package/dist/cdn/components/eun-animate.js +3 -3
- package/dist/cdn/components/eun-badge.js +1 -1
- package/dist/cdn/components/eun-button.js +1 -1
- package/dist/cdn/components/eun-calendar.js +2 -2
- package/dist/cdn/components/eun-card.js +4 -4
- package/dist/cdn/components/eun-carousel.js +21 -18
- package/dist/cdn/components/eun-check-card.js +1 -1
- package/dist/cdn/components/eun-checkbox-list.js +11 -8
- package/dist/cdn/components/eun-checkbox.js +1 -1
- package/dist/cdn/components/eun-chip.js +3 -3
- package/dist/cdn/components/eun-color-picker.js +60 -68
- package/dist/cdn/components/eun-counter.js +10 -10
- package/dist/cdn/components/eun-date-picker.js +47 -46
- package/dist/cdn/components/eun-description-list.js +2 -2
- package/dist/cdn/components/eun-divider.js +3 -3
- package/dist/cdn/components/eun-drawer.js +5 -5
- package/dist/cdn/components/eun-dropdown-button.js +1 -1
- package/dist/cdn/components/eun-fab.js +2 -2
- package/dist/cdn/components/eun-icon.js +1 -1
- package/dist/cdn/components/eun-image-card.js +1 -1
- package/dist/cdn/components/eun-image-carousel.js +10 -10
- package/dist/cdn/components/eun-infinite-list.js +1 -1
- package/dist/cdn/components/eun-input-file.js +21 -21
- package/dist/cdn/components/eun-input-phone.js +10 -9
- package/dist/cdn/components/eun-input.js +1 -1
- package/dist/cdn/components/eun-link.js +2 -2
- package/dist/cdn/components/eun-loader.js +1 -1
- package/dist/cdn/components/eun-modal.js +13 -13
- package/dist/cdn/components/eun-pagination.js +16 -16
- package/dist/cdn/components/eun-password-strength.js +14 -10
- package/dist/cdn/components/eun-radio-card.js +1 -1
- package/dist/cdn/components/eun-radio-list.js +11 -8
- package/dist/cdn/components/eun-radio.js +1 -1
- package/dist/cdn/components/eun-rating.js +276 -0
- package/dist/cdn/components/eun-scheduler-event-editor.js +10 -10
- package/dist/cdn/components/eun-scheduler-event.js +1 -1
- package/dist/cdn/components/eun-scheduler.js +28 -28
- package/dist/cdn/components/eun-search.js +19 -21
- package/dist/cdn/components/eun-select.js +27 -27
- package/dist/cdn/components/eun-sidebar.js +10 -8
- package/dist/cdn/components/eun-skeleton.js +1 -1
- package/dist/cdn/components/eun-slider.js +3 -3
- package/dist/cdn/components/eun-sliding-card.js +1 -1
- package/dist/cdn/components/eun-step.js +5 -4
- package/dist/cdn/components/eun-stepper.js +25 -25
- package/dist/cdn/components/eun-switch.js +1 -1
- package/dist/cdn/components/eun-tab-group.js +4 -4
- package/dist/cdn/components/eun-tab.js +1 -1
- package/dist/cdn/components/eun-table-action-bar.js +1 -1
- package/dist/cdn/components/eun-table.js +1 -1
- package/dist/cdn/components/eun-tag.js +3 -3
- package/dist/cdn/components/eun-textarea.js +39 -34
- package/dist/cdn/components/eun-time-picker.js +15 -14
- package/dist/cdn/components/eun-toast.js +19 -10
- package/dist/cdn/components/eun-toggle-group.js +6 -4
- package/dist/cdn/components/eun-toggle-item.js +1 -1
- package/dist/cdn/components/eun-toggle.js +2 -2
- package/dist/cdn/components/eun-toolbar.js +5 -5
- package/dist/cdn/components/eun-tooltip.js +3 -3
- package/dist/components/action/button/button.d.ts +2 -1
- package/dist/components/action/button/button.js +3 -2
- package/dist/components/action/button/button.styles.js +10 -5
- package/dist/components/action/dropdown-button/dropdown-button.js +10 -5
- package/dist/components/action/toggle/toggle-group.js +1 -1
- package/dist/components/action/toggle/toggle-group.styles.js +4 -2
- package/dist/components/action/toggle/toggle.js +1 -1
- package/dist/components/alert/alert/alert.d.ts +9 -7
- package/dist/components/alert/alert/alert.js +11 -14
- package/dist/components/alert/alert/alert.styles.js +9 -2
- package/dist/components/alert/drawer/drawer.d.ts +5 -5
- package/dist/components/alert/drawer/drawer.js +8 -12
- package/dist/components/alert/drawer/drawer.styles.js +1 -1
- package/dist/components/alert/modal/modal.d.ts +10 -10
- package/dist/components/alert/modal/modal.js +13 -25
- package/dist/components/alert/toast/toast.d.ts +7 -5
- package/dist/components/alert/toast/toast.js +9 -13
- package/dist/components/alert/toast/toast.styles.js +15 -6
- package/dist/components/content/badge/badge.js +2 -2
- package/dist/components/content/card/card.js +1 -1
- package/dist/components/content/card/card.styles.js +2 -2
- package/dist/components/content/chip/chip.d.ts +4 -4
- package/dist/components/content/chip/chip.js +8 -8
- package/dist/components/content/description-list/description-list.js +3 -3
- package/dist/components/content/icon/icon.d.ts +3 -0
- package/dist/components/content/icon/icon.js +3 -0
- package/dist/components/content/icon/icon.style.d.ts +2 -0
- package/dist/components/content/icon/icon.style.js +4 -0
- package/dist/components/content/image-carousel/image-carousel.d.ts +12 -12
- package/dist/components/content/image-carousel/image-carousel.js +24 -24
- package/dist/components/content/password-strength/password-strength.d.ts +21 -6
- package/dist/components/content/password-strength/password-strength.js +37 -16
- package/dist/components/content/password-strength/password-strength.styles.js +4 -0
- package/dist/components/content/tag/tag.js +2 -2
- package/dist/components/content/tooltip/tooltip.js +3 -3
- package/dist/components/form/checkbox/check-card.d.ts +1 -0
- package/dist/components/form/checkbox/check-card.js +1 -0
- package/dist/components/form/checkbox/checkbox-list.d.ts +17 -0
- package/dist/components/form/checkbox/checkbox-list.js +39 -10
- package/dist/components/form/checkbox/checkbox.d.ts +1 -0
- package/dist/components/form/checkbox/checkbox.js +3 -1
- package/dist/components/form/checkbox/checkbox.styles.js +3 -2
- package/dist/components/form/color-picker/color-picker.d.ts +41 -28
- package/dist/components/form/color-picker/color-picker.js +66 -50
- package/dist/components/form/color-picker/color-picker.styles.js +1 -1
- package/dist/components/form/counter/counter.d.ts +22 -18
- package/dist/components/form/counter/counter.js +59 -61
- package/dist/components/form/date-picker/date-picker.d.ts +27 -6
- package/dist/components/form/date-picker/date-picker.js +75 -54
- package/dist/components/form/input/input.d.ts +38 -39
- package/dist/components/form/input/input.js +85 -109
- package/dist/components/form/input-file/input-file.d.ts +26 -13
- package/dist/components/form/input-file/input-file.js +35 -35
- package/dist/components/form/input-file/input-file.styles.js +4 -4
- package/dist/components/form/input-phone/input-phone.d.ts +22 -5
- package/dist/components/form/input-phone/input-phone.js +41 -13
- package/dist/components/form/radio/radio-card.d.ts +1 -0
- package/dist/components/form/radio/radio-card.js +1 -0
- package/dist/components/form/radio/radio-list.d.ts +23 -7
- package/dist/components/form/radio/radio-list.js +47 -22
- package/dist/components/form/radio/radio.d.ts +1 -0
- package/dist/components/form/radio/radio.js +1 -0
- package/dist/components/form/rating/rating.d.ts +349 -0
- package/dist/components/form/rating/rating.js +665 -0
- package/dist/components/form/rating/rating.styles.d.ts +1 -0
- package/dist/components/form/rating/rating.styles.js +213 -0
- package/dist/components/form/search/search.d.ts +8 -8
- package/dist/components/form/search/search.js +23 -41
- package/dist/components/form/select/select.d.ts +23 -10
- package/dist/components/form/select/select.js +59 -41
- package/dist/components/form/shared-styles/listbox.styles.js +10 -0
- package/dist/components/form/slider/slider.d.ts +7 -8
- package/dist/components/form/slider/slider.js +9 -12
- package/dist/components/form/switch/switch.d.ts +1 -0
- package/dist/components/form/switch/switch.js +1 -0
- package/dist/components/form/textarea/textarea.d.ts +89 -23
- package/dist/components/form/textarea/textarea.js +192 -43
- package/dist/components/form/time-picker/time-picker-columns.d.ts +2 -2
- package/dist/components/form/time-picker/time-picker-columns.js +8 -8
- package/dist/components/form/time-picker/time-picker.d.ts +24 -8
- package/dist/components/form/time-picker/time-picker.js +59 -38
- package/dist/components/layout/animate/animate.js +1 -1
- package/dist/components/layout/animate/animate.styles.js +2 -2
- package/dist/components/layout/divider/divider.js +1 -1
- package/dist/components/layout/divider/divider.styles.js +1 -1
- package/dist/components/loader/loader/loader.js +2 -2
- package/dist/components/loader/loader/loader.styles.js +14 -12
- package/dist/components/loader/skeleton/skeleton.js +1 -1
- package/dist/components/navigation/carousel/carousel.d.ts +31 -7
- package/dist/components/navigation/carousel/carousel.js +74 -35
- package/dist/components/navigation/carousel/carousel.styles.js +5 -2
- package/dist/components/navigation/pagination/pagination.d.ts +23 -21
- package/dist/components/navigation/pagination/pagination.js +30 -53
- package/dist/components/navigation/sidebar/sidebar.d.ts +15 -13
- package/dist/components/navigation/sidebar/sidebar.js +21 -33
- package/dist/components/navigation/sidebar/sidebar.styles.js +5 -3
- package/dist/components/navigation/stepper/step.js +9 -8
- package/dist/components/navigation/stepper/stepper.js +12 -5
- package/dist/components/navigation/tabs/tab-group/tab-group.js +2 -2
- package/dist/components/navigation/tabs/tab-group/tab-group.styles.js +2 -2
- package/dist/components/navigation/toolbar/toolbar.d.ts +13 -13
- package/dist/components/navigation/toolbar/toolbar.js +20 -34
- package/dist/features/scheduler/calendar/calendar.js +1 -1
- package/dist/features/scheduler/scheduler/scheduler.d.ts +7 -7
- package/dist/features/scheduler/scheduler/scheduler.js +15 -24
- package/dist/features/scheduler/scheduler-event/scheduler-event.js +3 -3
- package/dist/features/scheduler/scheduler-event/scheduler-event.styles.js +1 -1
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.d.ts +6 -4
- package/dist/features/scheduler/scheduler-event-editor/scheduler-event-editor.js +6 -7
- package/dist/i18n/en.d.ts +68 -0
- package/dist/i18n/en.js +68 -0
- package/dist/i18n/fr.js +68 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/mixins/button.mixin.js +3 -2
- package/dist/mixins/check.mixin.js +11 -10
- package/dist/mixins/disabled.mixin.d.ts +5 -0
- package/dist/mixins/disabled.mixin.js +21 -1
- package/dist/mixins/editable.mixin.js +28 -5
- package/dist/mixins/field-appearance.mixin.js +3 -2
- package/dist/mixins/form.mixin.d.ts +4 -0
- package/dist/mixins/form.mixin.js +87 -13
- package/dist/mixins/localizable.mixin.d.ts +1 -1
- package/dist/mixins/localizable.mixin.js +1 -1
- package/dist/mixins/radio.mixin.js +11 -10
- package/dist/mixins/readonly.mixin.d.ts +2 -1
- package/dist/mixins/readonly.mixin.js +10 -3
- package/dist/ssr/alert-ssr.css +187 -0
- package/dist/ssr/badge-ssr.css +67 -0
- package/dist/ssr/breadcrumb-ssr.css +41 -0
- package/dist/ssr/card-ssr.css +27 -15
- package/dist/ssr/carousel-ssr.css +238 -0
- package/dist/ssr/checkbox-ssr.css +67 -0
- package/dist/ssr/chip-ssr.css +242 -0
- package/dist/ssr/collapse-ssr.css +151 -0
- package/dist/ssr/field-ssr.css +163 -0
- package/dist/ssr/icon-ssr.css +266 -0
- package/dist/ssr/image-carousel-ssr.css +24 -0
- package/dist/ssr/links-ssr.css +7 -1
- package/dist/ssr/pagination-ssr.css +4 -0
- package/dist/ssr/rating-ssr.css +254 -0
- package/dist/ssr/sidebar-ssr.css +9 -1
- package/dist/ssr/skeleton-ssr.css +63 -0
- package/dist/ssr/tabs-ssr.css +129 -0
- package/dist/ssr/toggle-group-ssr.css +182 -0
- package/dist/ssr/toolbar-ssr.css +31 -2
- package/dist/utils/implicit-submission.utils.d.ts +18 -0
- package/dist/utils/implicit-submission.utils.js +79 -0
- package/dist/utils/listbox-options.utils.d.ts +11 -0
- package/dist/utils/listbox-options.utils.js +41 -3
- package/package.json +26 -7
- package/dist/cdn/components/chunks/chunk-4PI6RDUS.js +0 -1
- package/dist/cdn/components/chunks/chunk-A3X4KD2X.js +0 -1
- package/dist/cdn/components/chunks/chunk-BQFJR2UP.js +0 -110
- package/dist/cdn/components/chunks/chunk-G5SBDQQ3.js +0 -1
- package/dist/cdn/components/chunks/chunk-KSZRQRN4.js +0 -1
- package/dist/cdn/components/chunks/chunk-PE4DAXHQ.js +0 -3
- package/dist/cdn/components/chunks/chunk-RS7TWEMQ.js +0 -1
- package/dist/cdn/components/chunks/chunk-VOTRXBDS.js +0 -38
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as 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 as te,k as Ke,l as ae,m as K,n as re,o as Ge,p as Oe,q as Ne,r as Ie,s as Ve}from"./chunks/chunk-36KLGY6U.js";import"./chunks/chunk-VJCNHMQZ.js";import{a as Te}from"./chunks/chunk-LK5BJ4SH.js";import{a as ke}from"./chunks/chunk-UYZR4JXZ.js";import{b as Me,c as Z}from"./chunks/chunk-624VJYNA.js";import{a as q}from"./chunks/chunk-LYYQAALT.js";import{a as $e,b as Ce}from"./chunks/chunk-WW4BTWMH.js";import{a as we}from"./chunks/chunk-GVS6IUKC.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 z}from"./chunks/chunk-TLBXTBMM.js";import{a as E}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 H,n as k,o as L,p as ge,q as O,r as N,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 Je=["day","month","year"];function He(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:Je}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 Ee(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 ze=w`
|
|
2
2
|
#calendar {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -190,7 +190,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
190
190
|
outline-offset: 2px;
|
|
191
191
|
border-radius: var(--eun-border-radius-s, 5px);
|
|
192
192
|
}
|
|
193
|
-
`;var
|
|
193
|
+
`;var We=w`
|
|
194
194
|
#calendar-weekdays {
|
|
195
195
|
display: grid;
|
|
196
196
|
}
|
|
@@ -219,7 +219,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
219
219
|
var(--eun-text-disabled-color, #8d93aa)
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
`;var
|
|
222
|
+
`;var je=w`
|
|
223
223
|
.calendar-row.row-3 {
|
|
224
224
|
grid-template-columns: repeat(3, 1fr);
|
|
225
225
|
}
|
|
@@ -230,7 +230,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
230
230
|
border-radius: var(--_cellRadius);
|
|
231
231
|
text-transform: capitalize;
|
|
232
232
|
}
|
|
233
|
-
`;var
|
|
233
|
+
`;var Be=w`
|
|
234
234
|
.calendar-row.row-3 {
|
|
235
235
|
grid-template-columns: repeat(3, 1fr);
|
|
236
236
|
}
|
|
@@ -240,7 +240,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
240
240
|
padding: var(--eun-space-xs, 4px);
|
|
241
241
|
border-radius: var(--_cellRadius);
|
|
242
242
|
}
|
|
243
|
-
`;var
|
|
243
|
+
`;var et=w`
|
|
244
244
|
:host {
|
|
245
245
|
display: block;
|
|
246
246
|
width: 100%;
|
|
@@ -506,7 +506,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
506
506
|
var(--_borderColor, var(--eun-color-grey-300, #dee0e7));
|
|
507
507
|
padding: var(--eun-space-m);
|
|
508
508
|
}
|
|
509
|
-
`,
|
|
509
|
+
`,_e=[ke,et],tt=w`
|
|
510
510
|
@supports (anchor-name: --a) {
|
|
511
511
|
#calendar-popover:popover-open {
|
|
512
512
|
position-try-fallbacks: --eun-date-picker-above;
|
|
@@ -518,7 +518,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
518
518
|
bottom: calc(anchor(top) + 4px);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
`,
|
|
521
|
+
`,Ue=tt;function Xe(r){let{displayedMonth:n,weekStartsOn:e,hideWeekends:t,locale:a,todayLabel:i,previousMonthLabel:s,chooseMonthYearLabel:d,nextMonthLabel:c}=r,m=ve(n,e),v=it(e,t,a),f=t?"row-5":"row-7";return u`
|
|
522
522
|
<div id="calendar">
|
|
523
523
|
<div id="calendar-header">
|
|
524
524
|
<button
|
|
@@ -559,7 +559,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
559
559
|
<div id="calendar-grid" role="grid">
|
|
560
560
|
${m.map(p=>u`
|
|
561
561
|
<div class="calendar-row ${f}" role="row">
|
|
562
|
-
${p.filter(y=>!t||!O(y)).map(y=>
|
|
562
|
+
${p.filter(y=>!t||!O(y)).map(y=>rt(y,r))}
|
|
563
563
|
</div>
|
|
564
564
|
`)}
|
|
565
565
|
</div>
|
|
@@ -569,23 +569,23 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
569
569
|
</button>
|
|
570
570
|
</div>
|
|
571
571
|
</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
|
|
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 at(r,n,e){let t=n.end??(n.start?e:null);if(!n.start||!t)return{"range-start":!1,"range-end":!1,"in-range":!1};let a=n.start.getTime()<=t.getTime()?n.start:t,i=n.start.getTime()<=t.getTime()?t:n.start;return{"range-start":H(r,a),"range-end":H(r,i),"in-range":N(D(r),D(a),D(i))}}function rt(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&&H(r,a),P=e==="range"?at(r,i,s):{"range-start":!1,"range-end":!1,"in-range":!1},V=()=>{S||p(r)},_=()=>{S||y(r)};return u`
|
|
573
573
|
<button
|
|
574
574
|
type="button"
|
|
575
|
-
class=${A({"grid-cell":!0,"cell-day":!0,outside:!
|
|
575
|
+
class=${A({"grid-cell":!0,"cell-day":!0,outside:!k(r,t),today:ge(r),selected:Y,...P})}
|
|
576
576
|
role="gridcell"
|
|
577
577
|
tabindex=${H(r,d)?"0":"-1"}
|
|
578
578
|
?disabled=${S}
|
|
579
579
|
aria-disabled=${S?"true":"false"}
|
|
580
|
-
aria-selected=${
|
|
580
|
+
aria-selected=${Y||P["range-start"]||P["range-end"]?"true":"false"}
|
|
581
581
|
aria-label=${r.toLocaleDateString(c,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}
|
|
582
582
|
@click=${V}
|
|
583
583
|
@mouseenter=${_}
|
|
584
|
-
@keydown=${
|
|
584
|
+
@keydown=${Ze=>M(Ze,r)}
|
|
585
585
|
>
|
|
586
586
|
<span class="cell-label">${r.getDate()}</span>
|
|
587
587
|
</button>
|
|
588
|
-
`}function
|
|
588
|
+
`}function it(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 Qe(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
589
|
<div id="calendar">
|
|
590
590
|
<div id="calendar-header">
|
|
591
591
|
<button
|
|
@@ -617,22 +617,22 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
617
617
|
</button>
|
|
618
618
|
</div>
|
|
619
619
|
<div id="calendar-grid" role="grid">
|
|
620
|
-
${
|
|
620
|
+
${st(s,3).map(d=>u`
|
|
621
621
|
<div class="calendar-row row-3" role="row">
|
|
622
|
-
${d.map(c=>
|
|
622
|
+
${d.map(c=>ot(c,r,e))}
|
|
623
623
|
</div>
|
|
624
624
|
`)}
|
|
625
625
|
</div>
|
|
626
626
|
</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
|
|
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 nt(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":N(x(r),x(a),x(i))}}function ot(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"?nt(r,i,s):{"range-start":!1,"range-end":!1,"in-range":!1},P=()=>{M||f(r)},V=()=>{M||p(r)};return u`
|
|
628
628
|
<button
|
|
629
629
|
type="button"
|
|
630
|
-
class=${A({"grid-cell":!0,"cell-month":!0,today:
|
|
630
|
+
class=${A({"grid-cell":!0,"cell-month":!0,today:k(r,new Date),selected:S,...Y})}
|
|
631
631
|
role="gridcell"
|
|
632
|
-
tabindex=${
|
|
633
|
-
?disabled=${
|
|
634
|
-
aria-disabled=${
|
|
635
|
-
aria-selected=${S||
|
|
632
|
+
tabindex=${k(r,d)?"0":"-1"}
|
|
633
|
+
?disabled=${M}
|
|
634
|
+
aria-disabled=${M?"true":"false"}
|
|
635
|
+
aria-selected=${S||Y["range-start"]||Y["range-end"]?"true":"false"}
|
|
636
636
|
aria-label=${r.toLocaleDateString(e,{month:"long",year:"numeric"})}
|
|
637
637
|
@click=${P}
|
|
638
638
|
@mouseenter=${V}
|
|
@@ -642,7 +642,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
642
642
|
>${r.toLocaleDateString(e,{month:"short"})}</span
|
|
643
643
|
>
|
|
644
644
|
</button>
|
|
645
|
-
`}function
|
|
645
|
+
`}function st(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var B=12;function I(r){return Math.floor(r/B)*B}function qe(r){let n=I(r.displayedYear),e=Array.from({length:B},(t,a)=>new Date(n+a,0,1));return u`
|
|
646
646
|
<div id="calendar">
|
|
647
647
|
<div id="calendar-header">
|
|
648
648
|
<button
|
|
@@ -666,37 +666,37 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
666
666
|
</button>
|
|
667
667
|
</div>
|
|
668
668
|
<div id="calendar-grid" role="grid">
|
|
669
|
-
${
|
|
669
|
+
${ut(e,3).map(t=>u`
|
|
670
670
|
<div class="calendar-row row-3" role="row">
|
|
671
|
-
${t.map(a=>
|
|
671
|
+
${t.map(a=>dt(a,r))}
|
|
672
672
|
</div>
|
|
673
673
|
`)}
|
|
674
674
|
</div>
|
|
675
675
|
</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
|
|
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 lt(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":L(r,a),"range-end":L(r,i),"in-range":N(F(r),F(a),F(i))}}function dt(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&&L(r,t),S=e==="range"?lt(r,a,i):{"range-start":!1,"range-end":!1,"in-range":!1},Y=()=>{y||v(r)},P=()=>{y||f(r)};return u`
|
|
677
677
|
<button
|
|
678
678
|
type="button"
|
|
679
|
-
class=${A({"grid-cell":!0,"cell-year":!0,today:L(r,new Date),selected:
|
|
679
|
+
class=${A({"grid-cell":!0,"cell-year":!0,today:L(r,new Date),selected:M,...S})}
|
|
680
680
|
role="gridcell"
|
|
681
681
|
tabindex=${L(r,s)?"0":"-1"}
|
|
682
682
|
?disabled=${y}
|
|
683
683
|
aria-disabled=${y?"true":"false"}
|
|
684
|
-
aria-selected=${
|
|
684
|
+
aria-selected=${M||S["range-start"]||S["range-end"]?"true":"false"}
|
|
685
685
|
aria-label=${String(r.getFullYear())}
|
|
686
|
-
@click=${
|
|
686
|
+
@click=${Y}
|
|
687
687
|
@mouseenter=${P}
|
|
688
688
|
@keydown=${V=>p(V,r)}
|
|
689
689
|
>
|
|
690
690
|
<span class="cell-label">${r.getFullYear()}</span>
|
|
691
691
|
</button>
|
|
692
|
-
`}function lt(r,n){let e=[];for(let t=0;t<r.length;t+=n)e.push(r.slice(t,t+n));return e}var dt="eun-date-picker",ut={day:{min:1,max:31},month:{min:1,max:12}},ct=pe(xe(ce)),ht=me(Te(we(Se(De(ye(ct)))))),o=class extends ht{constructor(){super(...arguments);this.mode="single";this.granularity="day";this.rangeValue={start:null,end:null};this.weekStartsOn=1;this.workWeek=!1;this.noAnimation=!1;this.withTime=!1;this.stepMinute=1;this.todayLabel="Today";this.applyLabel="Apply";this.cancelLabel="Cancel";this.ariaLabelCalendar="Open calendar";this.dayPlaceholder="jj";this.monthPlaceholder="mm";this.yearPlaceholder="yyyy";this.hourPlaceholder="hh";this.minutePlaceholder="mm";this.isOpen=!1;this.isModalOpen=!1;this.displayedAnchor=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.checkLocalValidators=()=>{let e=j(this.granularity);if((this.mode==="single"?[this.segments]:[this.rangeSegments.start,this.rangeSegments.end]).some(i=>pt(i)&&!ie(i,e)))return{validity:{badInput:!0},message:this.dictionary.validation.invalidDate};if(this.isWithTimeActive()){let i=this.resolvedHourFormat();if(mt(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=Re({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:Ce(a,e),minute:t.minute}};this.handleDayKeydown=(e,t)=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.moveFocused(-1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowRight":e.preventDefault(),this.moveFocused(1,$,a=>this.isDayFocusSkippable(a));break;case"ArrowUp":e.preventDefault(),this.moveFocused(-7,$,a=>this.isDayFocusSkippable(a));break;case"ArrowDown":e.preventDefault(),this.moveFocused(7,$,a=>this.isDayFocusSkippable(a));break;case"Home":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay(U(this.focusedDate,this.weekStartsOn),1));break;case"End":e.preventDefault(),this.jumpFocused(this.nearestWorkweekDay($(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(Ye(this.timeSegments.period||"AM"))};this.handlePeriodSegmentKeydown=e=>{switch(e.key){case"ArrowUp":case"ArrowDown":case"Enter":case" ":e.preventDefault(),this.handlePeriodSegmentClick();break;case"a":case"A":e.preventDefault(),this.setPeriodSegment("AM");break;case"p":case"P":e.preventDefault(),this.setPeriodSegment("PM");break;case"ArrowLeft":e.preventDefault(),this.focusPreviousTimeSegment("period");break;case"ArrowRight":e.preventDefault(),this.focusNextTimeSegment("period");break;default:break}}}get defaultValue(){return super.defaultValue}set defaultValue(e){super.defaultValue=e}connectedCallback(){super.connectedCallback?.(),this.mode==="range"&&this.defaultRangeValue&&(this.rangeValue=this.defaultRangeValue)}formResetCallback(){super.formResetCallback(),this.mode==="range"&&(this.rangeValue=this.defaultRangeValue??{start:null,end:null})}willUpdate(e){let t=e.has("segments")||e.has("rangeSegments")||e.has("timeSegments")||e.has("minTime")||e.has("maxTime");if(this.isWithTimeActive()&&(e.has("value")||e.has("timezone")||e.has("hourFormat")||e.has("locale"))){let a=this.resolvedHourFormat();if(this.value){let i=K(this.value,this.timezone);this.timeSegments=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))}getFocusAnchor(){return this.firstSegmentEl??void 0}focus(){super.focus?.(),this.firstSegmentEl?.focus()}isMobileViewport(){return window.matchMedia(he("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 $e(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=Fe(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(!Pe(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:ke(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:M(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=$(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(!Ve(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=gt(t),c;if(i[t]===""||Number.isNaN(s))c=d;else{let p=ut[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 Ie(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=Ae(this.resolvedHourFormat());return Le(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`
|
|
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`
|
|
693
693
|
<div
|
|
694
694
|
class="segment-group time-segment-group"
|
|
695
695
|
role="group"
|
|
696
696
|
aria-label=${this.dictionary.datePicker.time}
|
|
697
697
|
>
|
|
698
698
|
${e.map((t,a)=>{let i=e[a-1];return u`
|
|
699
|
-
${a===0
|
|
699
|
+
${a===0?$:u`<span class="segment-divider" aria-hidden="true"
|
|
700
700
|
>${i==="hour"&&t==="minute"||i==="minute"&&t==="hour"?":":" "}</span
|
|
701
701
|
>`}
|
|
702
702
|
${this.renderTimeSegment(t)}
|
|
@@ -736,9 +736,10 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
736
736
|
data-target=${e}
|
|
737
737
|
role="group"
|
|
738
738
|
aria-label=${t}
|
|
739
|
+
aria-describedby=${this.description?.length?"description":$}
|
|
739
740
|
>
|
|
740
741
|
${a.map((s,d)=>u`
|
|
741
|
-
${d>0?u`<span class="segment-divider" aria-hidden="true">/</span
|
|
742
|
+
${d>0?u`<span class="segment-divider" aria-hidden="true">/</span>`:$}
|
|
742
743
|
${this.renderSegment(e,s,i)}
|
|
743
744
|
`)}
|
|
744
745
|
</div>
|
|
@@ -751,28 +752,28 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
751
752
|
maxlength=${i}
|
|
752
753
|
size=${i}
|
|
753
754
|
placeholder=${this.placeholderFor(t)}
|
|
754
|
-
aria-label=${
|
|
755
|
+
aria-label=${this.dictionary.datePicker[t]}
|
|
755
756
|
.value=${a[t]}
|
|
756
757
|
?disabled=${this.disabled}
|
|
757
758
|
?readonly=${this.readonly}
|
|
758
759
|
@input=${s=>this.handleSegmentInput(s,e,t)}
|
|
759
760
|
@keydown=${s=>this.handleSegmentKeydown(s,e,t)}
|
|
760
761
|
/>
|
|
761
|
-
`}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
|
|
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 Qe(this.monthGridProps());case"year":return qe(this.yearGridProps());default:return Xe(this.dayGridProps())}}headingFor(){let e=this.dictionary.datePicker.heading[this.granularity];return this.mode==="single"?e.single:e.range}renderField(){return u`
|
|
762
763
|
<div
|
|
763
764
|
id="field-wrapper"
|
|
764
765
|
class=${A({"has-range":this.mode==="range"})}
|
|
765
766
|
>
|
|
766
767
|
${this.mode==="single"?this.renderSegmentGroup("value",this.label??this.headingFor()):u`
|
|
767
|
-
${this.renderSegmentGroup("start",
|
|
768
|
+
${this.renderSegmentGroup("start",this.dictionary.datePicker.startDate)}
|
|
768
769
|
<span class="range-separator" aria-hidden="true">–</span>
|
|
769
|
-
${this.renderSegmentGroup("end",
|
|
770
|
+
${this.renderSegmentGroup("end",this.dictionary.datePicker.endDate)}
|
|
770
771
|
`}
|
|
771
|
-
${this.isWithTimeActive()?this.renderTimeSegmentGroup()
|
|
772
|
+
${this.isWithTimeActive()?this.renderTimeSegmentGroup():$}
|
|
772
773
|
<button
|
|
773
774
|
type="button"
|
|
774
775
|
id="calendar-trigger"
|
|
775
|
-
aria-label=${this.
|
|
776
|
+
aria-label=${this.calendarLabel??this.dictionary.datePicker.openCalendar}
|
|
776
777
|
aria-haspopup="dialog"
|
|
777
778
|
aria-expanded=${this.isOpen||this.isModalOpen?"true":"false"}
|
|
778
779
|
?disabled=${this.disabled}
|
|
@@ -781,25 +782,25 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
781
782
|
<eun-icon name="calendar_today" size="16"></eun-icon>
|
|
782
783
|
</button>
|
|
783
784
|
</div>
|
|
784
|
-
`}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
|
|
785
|
+
`}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`
|
|
785
786
|
<div id="time-section">
|
|
786
|
-
${
|
|
787
|
+
${Ie({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})}
|
|
787
788
|
${this.renderTimezoneLabel()}
|
|
788
789
|
</div>
|
|
789
|
-
`}renderTimezoneLabel(){if(!this.timezone||
|
|
790
|
+
`}renderTimezoneLabel(){if(!this.timezone||Oe(this.timezone))return $;let e=this.stagingValue??new Date,t=Ne(e,this.timezone,{locale:this.locale});return u`<p id="timezone-label">${t}</p>`}renderPopoverFooter(){return this.isWithTimeActive()?u`
|
|
790
791
|
<div id="popover-footer" class="modal-footer">
|
|
791
792
|
<eun-button
|
|
792
793
|
appearance="ghost"
|
|
793
794
|
id="popover-cancel"
|
|
794
795
|
@click=${this.handlePopoverCancel}
|
|
795
796
|
>
|
|
796
|
-
${this.cancelLabel}
|
|
797
|
+
${this.cancelLabel??this.dictionary.common.cancel}
|
|
797
798
|
</eun-button>
|
|
798
799
|
<eun-button id="popover-apply" @click=${this.handlePopoverApply}>
|
|
799
800
|
${this.applyLabel}
|
|
800
801
|
</eun-button>
|
|
801
802
|
</div>
|
|
802
|
-
|
|
803
|
+
`:$}render(){return u`
|
|
803
804
|
<div id="wrapper">
|
|
804
805
|
${this.renderFormLabels("calendar-trigger")} ${this.renderField()}
|
|
805
806
|
${this.renderDescription()}
|
|
@@ -816,7 +817,7 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
816
817
|
?open=${this.isModalOpen}
|
|
817
818
|
.closeable=${!1}
|
|
818
819
|
confirm-label=${this.applyLabel}
|
|
819
|
-
cancel-label=${this.cancelLabel}
|
|
820
|
+
cancel-label=${this.cancelLabel??this.dictionary.common.cancel}
|
|
820
821
|
aria-label=${this.label??this.headingFor()}
|
|
821
822
|
@eunconfirm=${this.handleModalConfirm}
|
|
822
823
|
@euncancel=${this.handleModalCancel}
|
|
@@ -833,18 +834,18 @@ import{a as $e,b as J,c as Ce,d as Ye,e as Ae,f as Le,g as ee,h as W,i as Pe,j a
|
|
|
833
834
|
${this.renderGrid()}
|
|
834
835
|
</div>
|
|
835
836
|
${this.renderTimeSection()}
|
|
836
|
-
|
|
837
|
+
`:$}
|
|
837
838
|
<div slot="footer" class="modal-footer">
|
|
838
839
|
<eun-button
|
|
839
840
|
appearance="ghost"
|
|
840
841
|
id="cancel"
|
|
841
842
|
@click=${()=>this.modalEl?.cancel()}
|
|
842
843
|
>
|
|
843
|
-
${this.cancelLabel}
|
|
844
|
+
${this.cancelLabel??this.dictionary.common.cancel}
|
|
844
845
|
</eun-button>
|
|
845
846
|
<eun-button id="confirm" @click=${()=>this.modalEl?.confirm()}>
|
|
846
847
|
${this.applyLabel}
|
|
847
848
|
</eun-button>
|
|
848
849
|
</div>
|
|
849
850
|
</eun-modal>
|
|
850
|
-
`}};o.styles=[
|
|
851
|
+
`}};o.styles=[_e,...q?[]:[Ue],ze,We,je,Be,Ve,z.base,z.errorMessages,z.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(ct)],o);function gt(r){return Object.values(r).some(n=>n.length>0)}function vt(r){return r.hour!==""||r.minute!==""||r.period!==""}function ft(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,ct as EunomiaDatePickerTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as r}from"./chunks/chunk-VG6NAAIV.js";import{b as d}from"./chunks/chunk-PD62MBOJ.js";import"./chunks/chunk-BKZGTCMF.js";import{a as
|
|
1
|
+
import{a as r}from"./chunks/chunk-VG6NAAIV.js";import{b as d}from"./chunks/chunk-PD62MBOJ.js";import"./chunks/chunk-BKZGTCMF.js";import{a as i,f as l,h as n,i as o,j as t}from"./chunks/chunk-YITWLCD3.js";var a=n`
|
|
2
2
|
eun-description-list {
|
|
3
3
|
--_dl-row-gap: var(--description-list-row-gap, var(--eun-space-m, 1rem));
|
|
4
4
|
--_dl-column-gap: var(
|
|
@@ -149,4 +149,4 @@ import{a as r}from"./chunks/chunk-VG6NAAIV.js";import{b as d}from"./chunks/chunk
|
|
|
149
149
|
border-top: none;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
`,s=a;var c="eun-description-list",
|
|
152
|
+
`,s=a;var c="eun-description-list",e=class extends o{constructor(){super(...arguments);this.layout="inline";this.align="start";this.columns=1;this.divided=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),r(this,s)}};i([t({reflect:!0,useDefault:!0})],e.prototype,"layout",2),i([t({reflect:!0,useDefault:!0})],e.prototype,"align",2),i([t({type:Number,reflect:!0,useDefault:!0})],e.prototype,"columns",2),i([t({type:Boolean,reflect:!0})],e.prototype,"divided",2),e=i([l(c)],e);export{e as EunomiaDescriptionList,c as EunomiaDescriptionListTagName};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{a as e,f as i,h as o,j as a,p as
|
|
1
|
+
import{a as e,f as i,h as o,j as a,p as n,u as l}from"./chunks/chunk-YITWLCD3.js";var c=o`
|
|
2
2
|
:host {
|
|
3
3
|
--_color: var(--divider-color, var(--eun-border-color, #dee0e7));
|
|
4
4
|
--_spacing: var(--divider-spacing, var(--eun-space-m, 16px));
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
:host([orientation="horizontal"]) {
|
|
8
|
+
:host(:is([orientation="horizontal"], :not([orientation]))) {
|
|
9
9
|
width: 100%;
|
|
10
10
|
height: 0;
|
|
11
11
|
margin-block: var(--_spacing);
|
|
@@ -20,4 +20,4 @@ import{a as e,f as i,h as o,j as a,p as l,u as n}from"./chunks/chunk-YITWLCD3.js
|
|
|
20
20
|
margin-inline: var(--_spacing);
|
|
21
21
|
border-inline-start: 1px solid var(--_color);
|
|
22
22
|
}
|
|
23
|
-
`,s=c;var p="eun-divider",t=class extends
|
|
23
|
+
`,s=c;var p="eun-divider",t=class extends l{constructor(){super(...arguments);this.orientation="horizontal"}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","separator"),super.connectedCallback?.()}updated(r){super.updated(r),r.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}render(){return n``}};t.styles=s,e([a({reflect:!0,useDefault:!0})],t.prototype,"orientation",2),t=e([i(p)],t);export{t as EunomiaDivider,p as EunomiaDividerTagName};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f,b as h,c as v}from"./chunks/chunk-6VK6SHCG.js";import{a as m}from"./chunks/chunk-N6ZW5CDN.js";import"./chunks/chunk-RIFF2D2F.js";import"./chunks/chunk-UDOZRIJZ.js";import{a as s}from"./chunks/chunk-PPCHQG7P.js";import{a as u}from"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a as o,f as l,h as d,j as a,k as c,l as r,p as i,r as n,u as p}from"./chunks/chunk-YITWLCD3.js";var y=d`
|
|
2
2
|
:host {
|
|
3
3
|
--_width: var(--drawer-width, min(420px, 100vw));
|
|
4
4
|
--_background: var(--drawer-background, var(--eun-surface-color, #ffffff));
|
|
@@ -57,7 +57,7 @@ import{a as u,b as f,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
57
57
|
#surface[closing]::backdrop {
|
|
58
58
|
background-color: rgba(7, 22, 33, 0);
|
|
59
59
|
}
|
|
60
|
-
:host([position="end"]) #surface {
|
|
60
|
+
:host(:is([position="end"], :not([position]))) #surface {
|
|
61
61
|
justify-content: flex-end;
|
|
62
62
|
}
|
|
63
63
|
:host([position="start"]) #surface {
|
|
@@ -141,7 +141,7 @@ import{a as u,b as f,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
141
141
|
transition-duration: 0.01ms;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
`,
|
|
144
|
+
`,g=y;var C="eun-drawer",t=class extends m(u(p)){constructor(){super(...arguments);this.position="end";this.closeable=!0;this.open=!1;this.closeOnBackdrop=!0;this.dirty=!1;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 b=e;if(this.syncingFromPopover=!0,this.open=b.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=>{v(e,this)};this.stopDialogPropagation=e=>{e.stopPropagation()}}willUpdate(e){e.has("dirty")&&this.dirty&&(this.mountConfirmModal=!0)}updated(e){super.updated(e),e.has("open")&&this.syncPopoverOpenState(this.open,this.surfaceEl)}connectedCallback(){super.connectedCallback?.(),this.addEventListener("command",this.handleCommandEvent)}disconnectedCallback(){this.removeEventListener("command",this.handleCommandEvent),this.teardownDialogSurface(this.open),super.disconnectedCallback?.()}show(){this.open=!0}hide(){this.open=!1}requestClose(){if(this.dirty){let e=new h;this.dispatchEvent(e),e.defaultPrevented||this.confirmCloseModalEl?.show();return}this.attemptClose()}attemptClose(){let e=new f;this.dispatchEvent(e),e.defaultPrevented||this.hide()}confirmDiscard(){this.dirty=!1,this.attemptClose()}focusInitialElement(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}(this.panelEl??this.surfaceEl)?.focus()}surfaceAriaLabel(){return this.heading?void 0:this.ariaLabel??void 0}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}hasHeaderContent(){return this.closeable||!!this.heading||this.querySelector('[slot="header"]')!==null}renderHeader(){return i`
|
|
145
145
|
<div id="header">
|
|
146
146
|
<slot name="header">
|
|
147
147
|
${this.heading?i`<h2 id="heading">${this.heading}</h2>`:n}
|
|
@@ -152,7 +152,7 @@ import{a as u,b as f,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
152
152
|
appearance="ghost"
|
|
153
153
|
rounded
|
|
154
154
|
size="xs"
|
|
155
|
-
aria-label=${this.
|
|
155
|
+
aria-label=${this.closeLabel??this.dictionary.common.close}
|
|
156
156
|
@click=${()=>this.requestClose()}
|
|
157
157
|
>
|
|
158
158
|
<eun-icon name="close" size="16"></eun-icon>
|
|
@@ -197,4 +197,4 @@ import{a as u,b as f,c as h}from"./chunks/chunk-6VK6SHCG.js";import{a as v}from"
|
|
|
197
197
|
</div>
|
|
198
198
|
</div>
|
|
199
199
|
${this.mountConfirmModal?this.renderConfirmCloseModal():n}
|
|
200
|
-
`}};t.styles=
|
|
200
|
+
`}};t.styles=g,o([a({reflect:!0,useDefault:!0})],t.prototype,"position",2),o([a()],t.prototype,"heading",2),o([a({type:Boolean})],t.prototype,"closeable",2),o([a({type:Boolean,reflect:!0})],t.prototype,"open",2),o([a({type:Boolean,attribute:"close-on-backdrop"})],t.prototype,"closeOnBackdrop",2),o([a({type:Boolean,reflect:!0})],t.prototype,"dirty",2),o([a({attribute:"close-label"})],t.prototype,"closeLabel",2),o([a({attribute:"confirm-close-heading"})],t.prototype,"confirmCloseHeading",2),o([a({attribute:"confirm-close-description"})],t.prototype,"confirmCloseDescription",2),o([a({attribute:"confirm-close-cancel-label"})],t.prototype,"confirmCloseCancelLabel",2),o([a({attribute:"confirm-close-confirm-label"})],t.prototype,"confirmCloseConfirmLabel",2),o([r("#surface")],t.prototype,"surfaceEl",2),o([r("#panel")],t.prototype,"panelEl",2),o([r("#confirm-close-modal")],t.prototype,"confirmCloseModalEl",2),o([c()],t.prototype,"mountConfirmModal",2),t=o([l(C)],t);export{t as EunomiaDrawer,C as EunomiaDrawerTagName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-
|
|
1
|
+
import{a,b}from"./chunks/chunk-PXF554MD.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
|
|
1
|
+
import{a as f,b as c,c as b}from"./chunks/chunk-Z3OFIE7S.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);
|
|
@@ -198,7 +198,7 @@ import{a as p,b as f,c}from"./chunks/chunk-2Y2EU2CI.js";import{a as b}from"./chu
|
|
|
198
198
|
top: var(--fab-offset, var(--eun-space-l, 32px));
|
|
199
199
|
left: var(--fab-offset, var(--eun-space-l, 32px));
|
|
200
200
|
}
|
|
201
|
-
`,x=[
|
|
201
|
+
`,x=[c,m,g,y];var k="eun-fab",a=class extends f(b(h(p(u)))){constructor(){super(...arguments);this.loadingLabel="Loading\u2026"}updated(e){if(super.updated(e),e.has("label")&&(this.slide=!!this.label),e.has("href")||e.has("disabled")||e.has("loading")){let s=this.disabled||this.loading;this.href&&!s?this.removeAttribute("tabindex"):this.setAttribute("tabindex",s?"-1":"0")}}handleLinkClick(e){this.download||v(this,e,this.href,this.target)}get isBlank(){return!!this.href&&this.target==="_blank"}renderExternalLinkHint(){if(!this.isBlank||this.ariaLabel)return l;let e=this.dictionary.link.opensInNewTab;return i`<span class="sr-only"> (${e})</span>`}renderLabel(){return this.isBlank?i`<span id="label"
|
|
202
202
|
>${this.label}<span id="external-link-icon"
|
|
203
203
|
><eun-icon name="arrow_forward" shape="round" size="12"></eun-icon
|
|
204
204
|
>${this.renderExternalLinkHint()}</span
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c}from"./chunks/chunk-
|
|
1
|
+
import{a,b,c}from"./chunks/chunk-I4ERDXSM.js";import"./chunks/chunk-22D3SRFR.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-YITWLCD3.js";export{c as EunomiaIcon,a as EunomiaIconTagName,b as setIconBaseUrl};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p,b as m}from"./chunks/chunk-
|
|
1
|
+
import{a as p,b as m}from"./chunks/chunk-MQQJ6DID.js";import{a as f}from"./chunks/chunk-3MTUVMM5.js";import{b as u}from"./chunks/chunk-5GKM5DIB.js";import"./chunks/chunk-PPCHQG7P.js";import{a as v}from"./chunks/chunk-O7PHBLH2.js";import"./chunks/chunk-SGM2X2TC.js";import"./chunks/chunk-62RLISRD.js";import"./chunks/chunk-QL5GSW2A.js";import{a,b as n,c as s,f as d,h as l,k as c,p as t,u as h}from"./chunks/chunk-YITWLCD3.js";var b=l`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|