@beeq/core 1.8.0-beta.11 → 1.8.0-beta.13
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/beeq/beeq.esm.js +1 -1
- package/dist/beeq/{p-42fd96c3.entry.js → p-01050fbd.entry.js} +2 -2
- package/dist/beeq/{p-7bc123c9.entry.js → p-2951eb56.entry.js} +2 -2
- package/dist/beeq/{p-e8410587.entry.js → p-9a7ddcd2.entry.js} +2 -2
- package/dist/beeq/{p-b71d2d9a.entry.js → p-fc0af6bb.entry.js} +2 -2
- package/dist/cjs/bq-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +1 -1
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/components/bq-accordion-group.js +1 -114
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +1 -311
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +1 -220
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +1 -139
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge.js +1 -7
- package/dist/components/bq-badge.js.map +1 -1
- package/dist/components/bq-breadcrumb-item.js +1 -96
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +1 -112
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button.js +1 -7
- package/dist/components/bq-button.js.map +1 -1
- package/dist/components/bq-card.js +1 -86
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +1 -207
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -390
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -252
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider.js +1 -7
- package/dist/components/bq-divider.js.map +1 -1
- package/dist/components/bq-drawer.js +1 -249
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown.js +1 -7
- package/dist/components/bq-dropdown.js.map +1 -1
- package/dist/components/bq-empty-state.js +1 -125
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon.js +1 -7
- package/dist/components/bq-icon.js.map +1 -1
- package/dist/components/bq-input.js +1 -266
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +1 -245
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -64
- package/dist/components/bq-option-group.js.map +1 -1
- package/dist/components/bq-option-list.js +1 -7
- package/dist/components/bq-option-list.js.map +1 -1
- package/dist/components/bq-option.js +1 -137
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +1 -82
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel.js +1 -7
- package/dist/components/bq-panel.js.map +1 -1
- package/dist/components/bq-progress.js +1 -130
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +1 -207
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +1 -136
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +1 -452
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +1 -125
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +1 -144
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +1 -307
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +1 -167
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +1 -82
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +1 -119
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -108
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +1 -175
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +1 -232
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +1 -170
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag.js +1 -7
- package/dist/components/bq-tag.js.map +1 -1
- package/dist/components/bq-textarea.js +1 -210
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +1 -213
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip.js +1 -7
- package/dist/components/bq-tooltip.js.map +1 -1
- package/dist/components/index.js +1 -1246
- package/dist/components/index.js.map +1 -1
- package/dist/components/p-073153b0.js +6 -0
- package/dist/components/p-073153b0.js.map +1 -0
- package/dist/components/p-0b976755.js +6 -0
- package/dist/components/p-0b976755.js.map +1 -0
- package/dist/components/p-1a5d4394.js +6 -0
- package/dist/components/p-1a5d4394.js.map +1 -0
- package/dist/components/p-1c8b6eb4.js +6 -0
- package/dist/components/p-1c8b6eb4.js.map +1 -0
- package/dist/components/p-1defeea3.js +6 -0
- package/dist/components/p-1defeea3.js.map +1 -0
- package/dist/components/p-31df5ea1.js +6 -0
- package/dist/components/p-31df5ea1.js.map +1 -0
- package/dist/components/p-33c55e15.js +6 -0
- package/dist/components/p-33c55e15.js.map +1 -0
- package/dist/components/p-4299eebe.js +6 -0
- package/dist/components/p-4299eebe.js.map +1 -0
- package/dist/components/p-57621be1.js +6 -0
- package/dist/components/p-57621be1.js.map +1 -0
- package/dist/components/p-687da041.js +6 -0
- package/dist/components/p-687da041.js.map +1 -0
- package/dist/components/p-756ea6e3.js +6 -0
- package/dist/components/p-756ea6e3.js.map +1 -0
- package/dist/components/p-90b96691.js +6 -0
- package/dist/components/p-90b96691.js.map +1 -0
- package/dist/components/p-99829fc7.js +6 -0
- package/dist/components/p-99829fc7.js.map +1 -0
- package/dist/components/p-9e40fcc3.js +6 -0
- package/dist/components/p-9e40fcc3.js.map +1 -0
- package/dist/components/p-a5dc1c94.js +6 -0
- package/dist/components/p-a5dc1c94.js.map +1 -0
- package/dist/components/p-a8cad5ab.js +6 -0
- package/dist/components/p-a8cad5ab.js.map +1 -0
- package/dist/components/p-ac2aea4d.js +6 -0
- package/dist/components/p-ac2aea4d.js.map +1 -0
- package/dist/components/p-af062402.js +6 -0
- package/dist/components/p-af062402.js.map +1 -0
- package/dist/components/p-b8a8243f.js +7 -0
- package/dist/components/p-b8a8243f.js.map +1 -0
- package/dist/components/p-b9b47a5c.js +6 -0
- package/dist/components/p-b9b47a5c.js.map +1 -0
- package/dist/components/p-c78ae3c2.js +6 -0
- package/dist/components/p-c78ae3c2.js.map +1 -0
- package/dist/components/p-d7ce7165.js +6 -0
- package/dist/components/p-d7ce7165.js.map +1 -0
- package/dist/components/p-ecd27cf2.js +6 -0
- package/dist/components/p-ecd27cf2.js.map +1 -0
- package/dist/components/p-edfd9767.js +6 -0
- package/dist/components/p-edfd9767.js.map +1 -0
- package/dist/esm/bq-date-picker.entry.js +1 -1
- package/dist/esm/bq-dialog.entry.js +1 -1
- package/dist/esm/bq-drawer.entry.js +1 -1
- package/dist/esm/bq-select.entry.js +1 -1
- package/dist/hydrate/index.js +4 -4
- package/dist/hydrate/index.mjs +4 -4
- package/dist/stencil.config.js +4 -1
- package/dist/stencil.config.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/bq-badge2.js +0 -125
- package/dist/components/bq-badge2.js.map +0 -1
- package/dist/components/bq-button2.js +0 -208
- package/dist/components/bq-button2.js.map +0 -1
- package/dist/components/bq-divider2.js +0 -159
- package/dist/components/bq-divider2.js.map +0 -1
- package/dist/components/bq-dropdown2.js +0 -155
- package/dist/components/bq-dropdown2.js.map +0 -1
- package/dist/components/bq-icon2.js +0 -315
- package/dist/components/bq-icon2.js.map +0 -1
- package/dist/components/bq-option-list2.js +0 -76
- package/dist/components/bq-option-list2.js.map +0 -1
- package/dist/components/bq-panel2.js +0 -135
- package/dist/components/bq-panel2.js.map +0 -1
- package/dist/components/bq-steps.types.js +0 -10
- package/dist/components/bq-steps.types.js.map +0 -1
- package/dist/components/bq-tab.types.js +0 -11
- package/dist/components/bq-tab.types.js.map +0 -1
- package/dist/components/bq-tag2.js +0 -271
- package/dist/components/bq-tag2.js.map +0 -1
- package/dist/components/bq-tooltip2.js +0 -178
- package/dist/components/bq-tooltip2.js.map +0 -1
- package/dist/components/cssVariables.js +0 -34
- package/dist/components/cssVariables.js.map +0 -1
- package/dist/components/debounce.js +0 -73
- package/dist/components/debounce.js.map +0 -1
- package/dist/components/event.js +0 -18
- package/dist/components/event.js.map +0 -1
- package/dist/components/index2.js +0 -2138
- package/dist/components/index2.js.map +0 -1
- package/dist/components/isDefined.js +0 -19
- package/dist/components/isDefined.js.map +0 -1
- package/dist/components/isHTMLElement.js +0 -17
- package/dist/components/isHTMLElement.js.map +0 -1
- package/dist/components/isNil.js +0 -16
- package/dist/components/isNil.js.map +0 -1
- package/dist/components/isString.js +0 -21
- package/dist/components/isString.js.map +0 -1
- package/dist/components/props.js +0 -27
- package/dist/components/props.js.map +0 -1
- package/dist/components/slot.js +0 -85
- package/dist/components/slot.js.map +0 -1
- package/dist/components/transition.js +0 -131
- package/dist/components/transition.js.map +0 -1
- /package/dist/beeq/{p-42fd96c3.entry.js.map → p-01050fbd.entry.js.map} +0 -0
- /package/dist/beeq/{p-7bc123c9.entry.js.map → p-2951eb56.entry.js.map} +0 -0
- /package/dist/beeq/{p-e8410587.entry.js.map → p-9a7ddcd2.entry.js.map} +0 -0
- /package/dist/beeq/{p-b71d2d9a.entry.js.map → p-fc0af6bb.entry.js.map} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -2,1250 +2,5 @@
|
|
|
2
2
|
* Built by Endavans
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
|
-
export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
6
|
-
export { g as getBasePath, s as setBasePath } from './bq-icon2.js';
|
|
7
|
-
export { BqSlider, c as clamp, defineCustomElement as defineCustomElementBqSlider } from './bq-slider.js';
|
|
8
|
-
export { a as getCSSVariableValue, g as getColorCSSVariable } from './cssVariables.js';
|
|
9
|
-
export { d as debounce, s as setRafTimeout } from './debounce.js';
|
|
10
|
-
export { i as isEventTargetChildOfElement } from './event.js';
|
|
11
|
-
export { BqTabGroup, defineCustomElement as defineCustomElementBqTabGroup, g as getNextElement } from './bq-tab-group.js';
|
|
12
|
-
import { i as isDefined } from './isDefined.js';
|
|
13
|
-
export { i as isDefined } from './isDefined.js';
|
|
14
|
-
import { i as isNil } from './isNil.js';
|
|
15
|
-
export { i as isNil } from './isNil.js';
|
|
16
|
-
export { i as isHTMLElement } from './isHTMLElement.js';
|
|
17
|
-
export { i as isString } from './isString.js';
|
|
18
|
-
export { v as validatePropValue } from './props.js';
|
|
19
|
-
export { g as getInnerHTML, a as getTextContent, h as hasSlot, b as hasSlotContent } from './slot.js';
|
|
20
|
-
export { e as enter, l as leave, t as toggle } from './transition.js';
|
|
21
|
-
export { BqAccordion, defineCustomElement as defineCustomElementBqAccordion } from './bq-accordion.js';
|
|
22
|
-
export { BqAccordionGroup, defineCustomElement as defineCustomElementBqAccordionGroup } from './bq-accordion-group.js';
|
|
23
|
-
export { BqAlert, defineCustomElement as defineCustomElementBqAlert } from './bq-alert.js';
|
|
24
|
-
export { BqAvatar, defineCustomElement as defineCustomElementBqAvatar } from './bq-avatar.js';
|
|
25
|
-
export { BqBadge, defineCustomElement as defineCustomElementBqBadge } from './bq-badge.js';
|
|
26
|
-
export { BqBreadcrumb, defineCustomElement as defineCustomElementBqBreadcrumb } from './bq-breadcrumb.js';
|
|
27
|
-
export { BqBreadcrumbItem, defineCustomElement as defineCustomElementBqBreadcrumbItem } from './bq-breadcrumb-item.js';
|
|
28
|
-
export { BqButton, defineCustomElement as defineCustomElementBqButton } from './bq-button.js';
|
|
29
|
-
export { BqCard, defineCustomElement as defineCustomElementBqCard } from './bq-card.js';
|
|
30
|
-
export { BqCheckbox, defineCustomElement as defineCustomElementBqCheckbox } from './bq-checkbox.js';
|
|
31
|
-
export { BqDatePicker, defineCustomElement as defineCustomElementBqDatePicker } from './bq-date-picker.js';
|
|
32
|
-
export { BqDialog, defineCustomElement as defineCustomElementBqDialog } from './bq-dialog.js';
|
|
33
|
-
export { BqDivider, defineCustomElement as defineCustomElementBqDivider } from './bq-divider.js';
|
|
34
|
-
export { BqDrawer, defineCustomElement as defineCustomElementBqDrawer } from './bq-drawer.js';
|
|
35
|
-
export { BqDropdown, defineCustomElement as defineCustomElementBqDropdown } from './bq-dropdown.js';
|
|
36
|
-
export { BqEmptyState, defineCustomElement as defineCustomElementBqEmptyState } from './bq-empty-state.js';
|
|
37
|
-
export { BqIcon, defineCustomElement as defineCustomElementBqIcon } from './bq-icon.js';
|
|
38
|
-
export { BqInput, defineCustomElement as defineCustomElementBqInput } from './bq-input.js';
|
|
39
|
-
export { BqNotification, defineCustomElement as defineCustomElementBqNotification } from './bq-notification.js';
|
|
40
|
-
export { BqOption, defineCustomElement as defineCustomElementBqOption } from './bq-option.js';
|
|
41
|
-
export { BqOptionGroup, defineCustomElement as defineCustomElementBqOptionGroup } from './bq-option-group.js';
|
|
42
|
-
export { BqOptionList, defineCustomElement as defineCustomElementBqOptionList } from './bq-option-list.js';
|
|
43
|
-
export { BqPageTitle, defineCustomElement as defineCustomElementBqPageTitle } from './bq-page-title.js';
|
|
44
|
-
export { BqPanel, defineCustomElement as defineCustomElementBqPanel } from './bq-panel.js';
|
|
45
|
-
export { BqProgress, defineCustomElement as defineCustomElementBqProgress } from './bq-progress.js';
|
|
46
|
-
export { BqRadio, defineCustomElement as defineCustomElementBqRadio } from './bq-radio.js';
|
|
47
|
-
export { BqRadioGroup, defineCustomElement as defineCustomElementBqRadioGroup } from './bq-radio-group.js';
|
|
48
|
-
export { BqSelect, defineCustomElement as defineCustomElementBqSelect } from './bq-select.js';
|
|
49
|
-
export { BqSideMenu, defineCustomElement as defineCustomElementBqSideMenu } from './bq-side-menu.js';
|
|
50
|
-
export { BqSideMenuItem, defineCustomElement as defineCustomElementBqSideMenuItem } from './bq-side-menu-item.js';
|
|
51
|
-
export { BqSpinner, defineCustomElement as defineCustomElementBqSpinner } from './bq-spinner.js';
|
|
52
|
-
export { BqStatus, defineCustomElement as defineCustomElementBqStatus } from './bq-status.js';
|
|
53
|
-
export { BqStepItem, defineCustomElement as defineCustomElementBqStepItem } from './bq-step-item.js';
|
|
54
|
-
export { BqSteps, defineCustomElement as defineCustomElementBqSteps } from './bq-steps.js';
|
|
55
|
-
export { BqSwitch, defineCustomElement as defineCustomElementBqSwitch } from './bq-switch.js';
|
|
56
|
-
export { BqTab, defineCustomElement as defineCustomElementBqTab } from './bq-tab.js';
|
|
57
|
-
export { BqTag, defineCustomElement as defineCustomElementBqTag } from './bq-tag.js';
|
|
58
|
-
export { BqTextarea, defineCustomElement as defineCustomElementBqTextarea } from './bq-textarea.js';
|
|
59
|
-
export { BqToast, defineCustomElement as defineCustomElementBqToast } from './bq-toast.js';
|
|
60
|
-
export { BqTooltip, defineCustomElement as defineCustomElementBqTooltip } from './bq-tooltip.js';
|
|
61
|
-
|
|
62
|
-
class te {
|
|
63
|
-
/**
|
|
64
|
-
* @type {T}
|
|
65
|
-
*/
|
|
66
|
-
#t;
|
|
67
|
-
#e = /* @__PURE__ */ new Set();
|
|
68
|
-
/**
|
|
69
|
-
* @param {T} current
|
|
70
|
-
*/
|
|
71
|
-
constructor(t) {
|
|
72
|
-
this.#t = t;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @return {T}
|
|
76
|
-
*/
|
|
77
|
-
get current() {
|
|
78
|
-
return this.#t;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @param {T} value
|
|
82
|
-
*/
|
|
83
|
-
set current(t) {
|
|
84
|
-
this.#t != t && (this.#t = t, this.#e.forEach((n) => n(t)));
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @type {import("hooks").Ref["on"]}
|
|
88
|
-
*/
|
|
89
|
-
on(t) {
|
|
90
|
-
return this.#e.add(t), () => this.#e.delete(t);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
const Mt = (e) => new te(e), tt = Symbol.for("atomico.hooks");
|
|
94
|
-
globalThis[tt] = globalThis[tt] || {};
|
|
95
|
-
let k = globalThis[tt];
|
|
96
|
-
const ee = Symbol.for("Atomico.suspense"), At = Symbol.for("Atomico.effect"), ne = Symbol.for("Atomico.layoutEffect"), Ft = Symbol.for("Atomico.insertionEffect"), O = (e, t, n) => {
|
|
97
|
-
const { i: s, hooks: r } = k.c, o = r[s] = r[s] || {};
|
|
98
|
-
return o.value = e(o.value), o.effect = t, o.tag = n, k.c.i++, r[s].value;
|
|
99
|
-
}, se = (e) => O((t = Mt(e)) => t), _ = () => O((e = Mt(k.c.host)) => e), Rt = () => k.c.update, oe = (e, t, n = 0) => {
|
|
100
|
-
let s = {}, r = !1;
|
|
101
|
-
const o = () => r, c = (i, f) => {
|
|
102
|
-
for (const d in s) {
|
|
103
|
-
const l = s[d];
|
|
104
|
-
l.effect && l.tag === i && (l.value = l.effect(l.value, f));
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
return { load: (i) => {
|
|
108
|
-
k.c = { host: t, hooks: s, update: e, i: 0, id: n };
|
|
109
|
-
let f;
|
|
110
|
-
try {
|
|
111
|
-
r = !1, f = i();
|
|
112
|
-
} catch (d) {
|
|
113
|
-
if (d !== ee)
|
|
114
|
-
throw d;
|
|
115
|
-
r = !0;
|
|
116
|
-
} finally {
|
|
117
|
-
k.c = null;
|
|
118
|
-
}
|
|
119
|
-
return f;
|
|
120
|
-
}, cleanEffects: (i) => (c(Ft, i), () => (c(ne, i), () => {
|
|
121
|
-
c(At, i);
|
|
122
|
-
})), isSuspense: o };
|
|
123
|
-
}, M = Symbol.for;
|
|
124
|
-
function It(e, t) {
|
|
125
|
-
const n = e.length;
|
|
126
|
-
if (n !== t.length)
|
|
127
|
-
return !1;
|
|
128
|
-
for (let s = 0; s < n; s++) {
|
|
129
|
-
let r = e[s], o = t[s];
|
|
130
|
-
if (r !== o)
|
|
131
|
-
return !1;
|
|
132
|
-
}
|
|
133
|
-
return !0;
|
|
134
|
-
}
|
|
135
|
-
const w = (e) => typeof e == "function", R = (e) => typeof e == "object", { isArray: re } = Array, et = (e, t) => (t ? e instanceof HTMLStyleElement : !0) && "hydrate" in (e?.dataset || {});
|
|
136
|
-
function Ut(e, t) {
|
|
137
|
-
let n;
|
|
138
|
-
const s = (r) => {
|
|
139
|
-
let { length: o } = r;
|
|
140
|
-
for (let c = 0; c < o; c++) {
|
|
141
|
-
const u = r[c];
|
|
142
|
-
if (u && Array.isArray(u))
|
|
143
|
-
s(u);
|
|
144
|
-
else {
|
|
145
|
-
const a = typeof u;
|
|
146
|
-
if (u == null || a === "function" || a === "boolean")
|
|
147
|
-
continue;
|
|
148
|
-
a === "string" || a === "number" ? (n == null && (n = ""), n += u) : (n != null && (t(n), n = null), t(u));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
s(e), n != null && t(n);
|
|
153
|
-
}
|
|
154
|
-
const $t = (e, t, n) => (e.addEventListener(t, n), () => e.removeEventListener(t, n));
|
|
155
|
-
class Lt {
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
* @param {HTMLElement} target
|
|
159
|
-
* @param {string} message
|
|
160
|
-
* @param {string} value
|
|
161
|
-
*/
|
|
162
|
-
constructor(t, n, s) {
|
|
163
|
-
this.message = n, this.target = t, this.value = s;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
class _t extends Lt {
|
|
167
|
-
}
|
|
168
|
-
class ce extends Lt {
|
|
169
|
-
}
|
|
170
|
-
const q = "Custom", ie = null, ae = { true: 1, "": 1, 1: 1 };
|
|
171
|
-
function le(e, t, n, s, r) {
|
|
172
|
-
const {
|
|
173
|
-
type: o,
|
|
174
|
-
reflect: c,
|
|
175
|
-
event: u,
|
|
176
|
-
value: a,
|
|
177
|
-
attr: i = ue(t)
|
|
178
|
-
} = n?.name != q && R(n) && n != ie ? n : { type: n }, f = o?.name === q && o.map, d = a != null ? o == Function || !w(a) ? () => a : a : null;
|
|
179
|
-
Object.defineProperty(e, t, {
|
|
180
|
-
configurable: !0,
|
|
181
|
-
/**
|
|
182
|
-
* @this {import("dom").AtomicoThisInternal}
|
|
183
|
-
* @param {any} newValue
|
|
184
|
-
*/
|
|
185
|
-
set(l) {
|
|
186
|
-
const m = this[t];
|
|
187
|
-
d && o != Boolean && l == null && (l = d());
|
|
188
|
-
const { error: v, value: p } = (f ? he : me)(
|
|
189
|
-
o,
|
|
190
|
-
l
|
|
191
|
-
);
|
|
192
|
-
if (v && p != null)
|
|
193
|
-
throw new _t(
|
|
194
|
-
this,
|
|
195
|
-
`The value defined for prop '${t}' must be of type '${o.name}'`,
|
|
196
|
-
p
|
|
197
|
-
);
|
|
198
|
-
m != p && (this._props[t] = p ?? void 0, this.update(), u && jt(this, u), this.updated.then(() => {
|
|
199
|
-
c && (this._ignoreAttr = i, fe(this, o, i, this[t]), this._ignoreAttr = null);
|
|
200
|
-
}));
|
|
201
|
-
},
|
|
202
|
-
/**
|
|
203
|
-
* @this {import("dom").AtomicoThisInternal}
|
|
204
|
-
*/
|
|
205
|
-
get() {
|
|
206
|
-
return this._props[t];
|
|
207
|
-
}
|
|
208
|
-
}), d && (r[t] = d()), s[i] = { prop: t, type: o };
|
|
209
|
-
}
|
|
210
|
-
const jt = (e, { type: t, base: n = CustomEvent, ...s }) => e.dispatchEvent(new n(t, s)), ue = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), fe = (e, t, n, s) => s == null || t == Boolean && !s ? e.removeAttribute(n) : e.setAttribute(
|
|
211
|
-
n,
|
|
212
|
-
t?.name === q && t?.serialize ? t?.serialize(s) : R(s) ? JSON.stringify(s) : t == Boolean ? "" : s
|
|
213
|
-
), de = (e, t) => e == Boolean ? !!ae[t] : e == Number ? Number(t) : e == String ? t : e == Array || e == Object ? JSON.parse(t) : e.name == q ? t : (
|
|
214
|
-
// TODO: If when defining reflect the prop can also be of type string?
|
|
215
|
-
new e(t)
|
|
216
|
-
), he = ({ map: e }, t) => {
|
|
217
|
-
try {
|
|
218
|
-
return { value: e(t), error: !1 };
|
|
219
|
-
} catch {
|
|
220
|
-
return { value: t, error: !0 };
|
|
221
|
-
}
|
|
222
|
-
}, me = (e, t) => e == null || t == null ? { value: t, error: !1 } : e != String && t === "" ? { value: void 0, error: !1 } : e == Object || e == Array || e == Symbol ? {
|
|
223
|
-
value: t,
|
|
224
|
-
error: {}.toString.call(t) !== `[object ${e.name}]`
|
|
225
|
-
} : t instanceof e ? {
|
|
226
|
-
value: t,
|
|
227
|
-
error: e == Number && Number.isNaN(t.valueOf())
|
|
228
|
-
} : e == String || e == Number || e == Boolean ? {
|
|
229
|
-
value: t,
|
|
230
|
-
error: e == Number ? typeof t != "number" ? !0 : Number.isNaN(t) : e == String ? typeof t != "string" : typeof t != "boolean"
|
|
231
|
-
} : { value: t, error: !0 };
|
|
232
|
-
let ye = 0;
|
|
233
|
-
const pe = (e) => {
|
|
234
|
-
const t = (e?.dataset || {})?.hydrate || "";
|
|
235
|
-
return t || "c" + ye++;
|
|
236
|
-
}, j = (e, t = HTMLElement) => {
|
|
237
|
-
const n = {}, s = {}, r = "prototype" in t && t.prototype instanceof Element, o = r ? t : "base" in t ? t.base : HTMLElement, { props: c, styles: u } = r ? e : t;
|
|
238
|
-
class a extends o {
|
|
239
|
-
constructor() {
|
|
240
|
-
super(), this._setup(), this._render = () => e({ ...this._props });
|
|
241
|
-
for (const f in s)
|
|
242
|
-
this[f] = s[f];
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* @returns {import("core").Sheets[]}
|
|
246
|
-
*/
|
|
247
|
-
static get styles() {
|
|
248
|
-
return [super.styles, u];
|
|
249
|
-
}
|
|
250
|
-
async _setup() {
|
|
251
|
-
if (this._props)
|
|
252
|
-
return;
|
|
253
|
-
this._props = {};
|
|
254
|
-
let f, d;
|
|
255
|
-
this.mounted = new Promise(
|
|
256
|
-
(h) => this.mount = () => {
|
|
257
|
-
h(), f != this.parentNode && (d != f ? this.unmounted.then(this.update) : this.update()), f = this.parentNode;
|
|
258
|
-
}
|
|
259
|
-
), this.unmounted = new Promise(
|
|
260
|
-
(h) => this.unmount = () => {
|
|
261
|
-
h(), (f != this.parentNode || !this.isConnected) && (l.cleanEffects(!0)()(), d = this.parentNode, f = null);
|
|
262
|
-
}
|
|
263
|
-
), this.symbolId = this.symbolId || Symbol(), this.symbolIdParent = Symbol();
|
|
264
|
-
const l = oe(
|
|
265
|
-
() => this.update(),
|
|
266
|
-
this,
|
|
267
|
-
pe(this)
|
|
268
|
-
);
|
|
269
|
-
let m, v = !0;
|
|
270
|
-
const p = et(this);
|
|
271
|
-
this.update = () => (m || (m = !0, this.updated = (this.updated || this.mounted).then(() => {
|
|
272
|
-
try {
|
|
273
|
-
const h = l.load(this._render), b = l.cleanEffects();
|
|
274
|
-
return h && //@ts-ignore
|
|
275
|
-
h.render(this, this.symbolId, p), m = !1, v && !l.isSuspense() && (v = !1, !p && be(this)), b();
|
|
276
|
-
} finally {
|
|
277
|
-
m = !1;
|
|
278
|
-
}
|
|
279
|
-
}).then(
|
|
280
|
-
/**
|
|
281
|
-
* @param {import("internal/hooks.js").CleanUseEffects} [cleanUseEffect]
|
|
282
|
-
*/
|
|
283
|
-
(h) => {
|
|
284
|
-
h && h();
|
|
285
|
-
}
|
|
286
|
-
)), this.updated), this.update();
|
|
287
|
-
}
|
|
288
|
-
connectedCallback() {
|
|
289
|
-
this.mount(), super.connectedCallback && super.connectedCallback();
|
|
290
|
-
}
|
|
291
|
-
disconnectedCallback() {
|
|
292
|
-
super.disconnectedCallback && super.disconnectedCallback(), this.unmount();
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* @this {import("dom").AtomicoThisInternal}
|
|
296
|
-
* @param {string} attr
|
|
297
|
-
* @param {(string|null)} oldValue
|
|
298
|
-
* @param {(string|null)} value
|
|
299
|
-
*/
|
|
300
|
-
attributeChangedCallback(f, d, l) {
|
|
301
|
-
if (n[f]) {
|
|
302
|
-
if (f === this._ignoreAttr || d === l)
|
|
303
|
-
return;
|
|
304
|
-
const { prop: m, type: v } = n[f];
|
|
305
|
-
try {
|
|
306
|
-
this[m] = de(v, l);
|
|
307
|
-
} catch {
|
|
308
|
-
throw new ce(
|
|
309
|
-
this,
|
|
310
|
-
`The value defined as attr '${f}' cannot be parsed by type '${v.name}'`,
|
|
311
|
-
l
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
} else
|
|
315
|
-
super.attributeChangedCallback(f, d, l);
|
|
316
|
-
}
|
|
317
|
-
static get props() {
|
|
318
|
-
return { ...super.props, ...c };
|
|
319
|
-
}
|
|
320
|
-
static get observedAttributes() {
|
|
321
|
-
const f = super.observedAttributes || [];
|
|
322
|
-
for (const d in c)
|
|
323
|
-
le(this.prototype, d, c[d], n, s);
|
|
324
|
-
return Object.keys(n).concat(f);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
return a;
|
|
328
|
-
};
|
|
329
|
-
function be(e) {
|
|
330
|
-
const { styles: t } = e.constructor, { shadowRoot: n } = e;
|
|
331
|
-
if (n && t.length) {
|
|
332
|
-
const s = [];
|
|
333
|
-
Ut(t, (r) => {
|
|
334
|
-
r && (r instanceof Element ? n.appendChild(r.cloneNode(!0)) : s.push(r));
|
|
335
|
-
}), s.length && (n.adoptedStyleSheets = s);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
const Yt = (e) => (t, n) => {
|
|
339
|
-
O(
|
|
340
|
-
/**
|
|
341
|
-
* Clean the effect hook
|
|
342
|
-
* @type {import("internal/hooks.js").CollectorEffect}
|
|
343
|
-
*/
|
|
344
|
-
([s, r] = []) => ((r || !r) && (r && It(r, n) ? s = s || !0 : (w(s) && s(), s = null)), [s, n]),
|
|
345
|
-
/**
|
|
346
|
-
* @returns {any}
|
|
347
|
-
*/
|
|
348
|
-
([s, r], o) => o ? (w(s) && s(), []) : [s || t(), r],
|
|
349
|
-
e
|
|
350
|
-
);
|
|
351
|
-
}, $ = Yt(At), ge = Yt(Ft);
|
|
352
|
-
class Bt extends Array {
|
|
353
|
-
/**
|
|
354
|
-
*
|
|
355
|
-
* @param {any} initialState
|
|
356
|
-
* @param {(nextState: any, state:any[], mount: boolean )=>void} mapState
|
|
357
|
-
*/
|
|
358
|
-
constructor(t, n) {
|
|
359
|
-
let s = !0;
|
|
360
|
-
const r = (o) => {
|
|
361
|
-
try {
|
|
362
|
-
n(o, this, s);
|
|
363
|
-
} finally {
|
|
364
|
-
s = !1;
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
super(void 0, r, n), r(t);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* The following code allows a mutable approach to useState
|
|
371
|
-
* and useProp this with the idea of allowing an alternative
|
|
372
|
-
* approach similar to Vue or Qwik of state management
|
|
373
|
-
* @todo pending review with the community
|
|
374
|
-
*/
|
|
375
|
-
// get value() {
|
|
376
|
-
// return this[0];
|
|
377
|
-
// }
|
|
378
|
-
// set value(nextState) {
|
|
379
|
-
// this[2](nextState, this);
|
|
380
|
-
// }
|
|
381
|
-
}
|
|
382
|
-
const rt = (e) => {
|
|
383
|
-
const t = Rt();
|
|
384
|
-
return O(
|
|
385
|
-
(n = new Bt(e, (s, r, o) => {
|
|
386
|
-
s = w(s) ? s(r[0]) : s, s !== r[0] && (r[0] = s, o || t());
|
|
387
|
-
})) => n
|
|
388
|
-
);
|
|
389
|
-
}, T = (e, t) => {
|
|
390
|
-
const [n] = O(([s, r, o = 0] = []) => ((!r || r && !It(r, t)) && (s = e()), [s, t, o]));
|
|
391
|
-
return n;
|
|
392
|
-
}, ct = (e) => {
|
|
393
|
-
const { current: t } = _();
|
|
394
|
-
if (!(e in t))
|
|
395
|
-
throw new _t(
|
|
396
|
-
t,
|
|
397
|
-
`For useProp("${e}"), the prop does not exist on the host.`,
|
|
398
|
-
e
|
|
399
|
-
);
|
|
400
|
-
return O(
|
|
401
|
-
(n = new Bt(t[e], (s, r) => {
|
|
402
|
-
s = w(s) ? s(t[e]) : s, t[e] = s;
|
|
403
|
-
})) => (n[0] = t[e], n)
|
|
404
|
-
);
|
|
405
|
-
}, C = (e, t = {}) => {
|
|
406
|
-
const n = _();
|
|
407
|
-
return n[e] || (n[e] = (s = t.detail) => jt(n.current, {
|
|
408
|
-
type: e,
|
|
409
|
-
...t,
|
|
410
|
-
detail: s
|
|
411
|
-
})), n[e];
|
|
412
|
-
}, nt = M("atomico/options");
|
|
413
|
-
globalThis[nt] = globalThis[nt] || {
|
|
414
|
-
sheet: !!document.adoptedStyleSheets
|
|
415
|
-
};
|
|
416
|
-
const qt = globalThis[nt], Ee = {
|
|
417
|
-
checked: 1,
|
|
418
|
-
value: 1,
|
|
419
|
-
selected: 1
|
|
420
|
-
}, ve = {
|
|
421
|
-
list: 1,
|
|
422
|
-
type: 1,
|
|
423
|
-
size: 1,
|
|
424
|
-
form: 1,
|
|
425
|
-
width: 1,
|
|
426
|
-
height: 1,
|
|
427
|
-
src: 1,
|
|
428
|
-
href: 1,
|
|
429
|
-
slot: 1
|
|
430
|
-
}, De = {
|
|
431
|
-
shadowDom: 1,
|
|
432
|
-
staticNode: 1,
|
|
433
|
-
cloneNode: 1,
|
|
434
|
-
children: 1,
|
|
435
|
-
key: 1
|
|
436
|
-
}, B = {}, st = [];
|
|
437
|
-
class ot extends Text {
|
|
438
|
-
}
|
|
439
|
-
const Se = M("atomico/id"), I = M("atomico/type"), Z = M("atomico/ref"), xt = M("atomico/vnode"), we = () => {
|
|
440
|
-
};
|
|
441
|
-
function Ce(e, t, n) {
|
|
442
|
-
return Ht(this, e, t, n);
|
|
443
|
-
}
|
|
444
|
-
const zt = (e, t, ...n) => {
|
|
445
|
-
const s = t || B;
|
|
446
|
-
let { children: r } = s;
|
|
447
|
-
if (r = r ?? (n.length ? n : st), e === we)
|
|
448
|
-
return r;
|
|
449
|
-
const o = e ? e instanceof Node ? 1 : (
|
|
450
|
-
//@ts-ignore
|
|
451
|
-
e.prototype instanceof HTMLElement && 2
|
|
452
|
-
) : 0;
|
|
453
|
-
if (o === !1 && e instanceof Function)
|
|
454
|
-
return e(
|
|
455
|
-
r != st ? { children: r, ...s } : s
|
|
456
|
-
);
|
|
457
|
-
const c = qt.render || Ce;
|
|
458
|
-
return {
|
|
459
|
-
[I]: xt,
|
|
460
|
-
type: e,
|
|
461
|
-
props: s,
|
|
462
|
-
children: r,
|
|
463
|
-
key: s.key,
|
|
464
|
-
// key for lists by keys
|
|
465
|
-
// define if the node declares its shadowDom
|
|
466
|
-
shadow: s.shadowDom,
|
|
467
|
-
// allows renderings to run only once
|
|
468
|
-
static: s.staticNode,
|
|
469
|
-
// defines whether the type is a childNode `1` or a constructor `2`
|
|
470
|
-
raw: o,
|
|
471
|
-
// defines whether to use the second parameter for document.createElement
|
|
472
|
-
is: s.is,
|
|
473
|
-
// clone the node if it comes from a reference
|
|
474
|
-
clone: s.cloneNode,
|
|
475
|
-
render: c
|
|
476
|
-
};
|
|
477
|
-
};
|
|
478
|
-
function Ht(e, t, n = Se, s, r) {
|
|
479
|
-
let o;
|
|
480
|
-
if (t && t[n] && t[n].vnode == e || e[I] != xt)
|
|
481
|
-
return t;
|
|
482
|
-
(e || !t) && (r = r || e.type == "svg", o = e.type != "host" && (e.raw == 1 ? (t && e.clone ? t[Z] : t) != e.type : e.raw == 2 ? !(t instanceof e.type) : t ? t[Z] || t.localName != e.type : !t), o && e.type != null && (e.raw == 1 && e.clone ? (s = !0, t = e.type.cloneNode(!0), t[Z] = e.type) : t = e.raw == 1 ? e.type : e.raw == 2 ? new e.type() : r ? document.createElementNS(
|
|
483
|
-
"http://www.w3.org/2000/svg",
|
|
484
|
-
e.type
|
|
485
|
-
) : document.createElement(
|
|
486
|
-
e.type,
|
|
487
|
-
e.is ? { is: e.is } : void 0
|
|
488
|
-
)));
|
|
489
|
-
const c = t[n] ? t[n] : B, { vnode: u = B, cycle: a = 0 } = c;
|
|
490
|
-
let { fragment: i, handlers: f } = c;
|
|
491
|
-
const { children: d = st, props: l = B } = u;
|
|
492
|
-
if (f = o ? {} : f || {}, e.static && !o)
|
|
493
|
-
return t;
|
|
494
|
-
if (e.shadow && !t.shadowRoot && // @ts-ignore
|
|
495
|
-
t.attachShadow({ mode: "open", ...e.shadow }), e.props != l && Ne(t, l, e.props, f, r), e.children !== d) {
|
|
496
|
-
const m = e.shadow ? t.shadowRoot : t;
|
|
497
|
-
i = Pe(
|
|
498
|
-
e.children,
|
|
499
|
-
/**
|
|
500
|
-
* @todo for hydration use attribute and send childNodes
|
|
501
|
-
*/
|
|
502
|
-
i,
|
|
503
|
-
m,
|
|
504
|
-
n,
|
|
505
|
-
// add support to foreignObject, children will escape from svg
|
|
506
|
-
!a && s,
|
|
507
|
-
r && e.type == "foreignObject" ? !1 : r
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
return t[n] = { vnode: e, handlers: f, fragment: i, cycle: a + 1 }, t;
|
|
511
|
-
}
|
|
512
|
-
function Te(e, t) {
|
|
513
|
-
const n = new ot(""), s = new ot("");
|
|
514
|
-
let r;
|
|
515
|
-
if (e[t ? "prepend" : "append"](n), t) {
|
|
516
|
-
let { lastElementChild: o } = e;
|
|
517
|
-
for (; o; ) {
|
|
518
|
-
const { previousElementSibling: c } = o;
|
|
519
|
-
if (et(o, !0) && !et(c, !0)) {
|
|
520
|
-
r = o;
|
|
521
|
-
break;
|
|
522
|
-
}
|
|
523
|
-
o = c;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return r ? r.before(s) : e.append(s), {
|
|
527
|
-
markStart: n,
|
|
528
|
-
markEnd: s
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
function Pe(e, t, n, s, r, o) {
|
|
532
|
-
e = e == null ? null : re(e) ? e : [e];
|
|
533
|
-
const c = t || Te(n, r), { markStart: u, markEnd: a, keyes: i } = c;
|
|
534
|
-
let f;
|
|
535
|
-
const d = i && /* @__PURE__ */ new Set();
|
|
536
|
-
let l = u;
|
|
537
|
-
if (e && Ut(e, (m) => {
|
|
538
|
-
if (typeof m == "object" && !m[I])
|
|
539
|
-
return;
|
|
540
|
-
const v = m[I] && m.key, p = i && v != null && i.get(v);
|
|
541
|
-
l != a && l === p ? d.delete(l) : l = l == a ? a : l.nextSibling;
|
|
542
|
-
const h = i ? p : l;
|
|
543
|
-
let b = h;
|
|
544
|
-
if (m[I])
|
|
545
|
-
b = Ht(m, h, s, r, o);
|
|
546
|
-
else {
|
|
547
|
-
const A = m + "";
|
|
548
|
-
!(b instanceof Text) || b instanceof ot ? b = new Text(A) : b.data != A && (b.data = A);
|
|
549
|
-
}
|
|
550
|
-
b != l && (i && d.delete(b), !h || i ? (n.insertBefore(b, l), i && l != a && d.add(l)) : h == a ? n.insertBefore(b, a) : (n.replaceChild(b, h), l = b)), v != null && (f = f || /* @__PURE__ */ new Map(), f.set(v, b));
|
|
551
|
-
}), l = l == a ? a : l.nextSibling, t && l != a)
|
|
552
|
-
for (; l != a; ) {
|
|
553
|
-
const m = l;
|
|
554
|
-
l = l.nextSibling, m.remove();
|
|
555
|
-
}
|
|
556
|
-
return d && d.forEach((m) => m.remove()), c.keyes = f, c;
|
|
557
|
-
}
|
|
558
|
-
function Ne(e, t, n, s, r) {
|
|
559
|
-
for (const o in t)
|
|
560
|
-
!(o in n) && Dt(e, o, t[o], null, r, s);
|
|
561
|
-
for (const o in n)
|
|
562
|
-
Dt(e, o, t[o], n[o], r, s);
|
|
563
|
-
}
|
|
564
|
-
function Dt(e, t, n, s, r, o) {
|
|
565
|
-
if (t = t == "class" && !r ? "className" : t, n = n ?? null, s = s ?? null, t in e && Ee[t] && (n = e[t]), !(s === n || De[t] || t[0] == "_"))
|
|
566
|
-
if (t[0] == "o" && t[1] == "n" && (w(s) || w(n)))
|
|
567
|
-
ke(e, t.slice(2), s, o);
|
|
568
|
-
else if (t == "ref")
|
|
569
|
-
s && (w(s) ? s(e) : s.current = e);
|
|
570
|
-
else if (t == "style") {
|
|
571
|
-
const { style: c } = e;
|
|
572
|
-
n = n || "", s = s || "";
|
|
573
|
-
const u = R(n), a = R(s);
|
|
574
|
-
if (u)
|
|
575
|
-
for (const i in n)
|
|
576
|
-
if (a)
|
|
577
|
-
!(i in s) && St(c, i, null);
|
|
578
|
-
else
|
|
579
|
-
break;
|
|
580
|
-
if (a)
|
|
581
|
-
for (const i in s) {
|
|
582
|
-
const f = s[i];
|
|
583
|
-
u && n[i] === f || St(c, i, f);
|
|
584
|
-
}
|
|
585
|
-
else
|
|
586
|
-
c.cssText = s;
|
|
587
|
-
} else {
|
|
588
|
-
const c = t[0] == "$" ? t.slice(1) : t;
|
|
589
|
-
c === t && (!r && !ve[t] && t in e || w(s) || w(n)) ? e[t] = s ?? "" : s == null ? e.removeAttribute(c) : e.setAttribute(
|
|
590
|
-
c,
|
|
591
|
-
R(s) ? JSON.stringify(s) : s
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
function ke(e, t, n, s) {
|
|
596
|
-
if (s.handleEvent || (s.handleEvent = (r) => s[r.type].call(e, r)), n) {
|
|
597
|
-
if (!s[t]) {
|
|
598
|
-
const r = n.capture || n.once || n.passive ? Object.assign({}, n) : null;
|
|
599
|
-
e.addEventListener(t, s, r);
|
|
600
|
-
}
|
|
601
|
-
s[t] = n;
|
|
602
|
-
} else
|
|
603
|
-
s[t] && (e.removeEventListener(t, s), delete s[t]);
|
|
604
|
-
}
|
|
605
|
-
function St(e, t, n) {
|
|
606
|
-
let s = "setProperty";
|
|
607
|
-
n == null && (s = "removeProperty", n = null), ~t.indexOf("-") ? e[s](t, n) : e[t] = n;
|
|
608
|
-
}
|
|
609
|
-
const wt = {};
|
|
610
|
-
function z(e, ...t) {
|
|
611
|
-
const n = (e.raw || e).reduce(
|
|
612
|
-
(s, r, o) => s + r + (t[o] || ""),
|
|
613
|
-
""
|
|
614
|
-
);
|
|
615
|
-
return wt[n] = wt[n] || Oe(n);
|
|
616
|
-
}
|
|
617
|
-
function Oe(e) {
|
|
618
|
-
if (qt.sheet) {
|
|
619
|
-
const t = new CSSStyleSheet();
|
|
620
|
-
return t.replaceSync(e), t;
|
|
621
|
-
} else {
|
|
622
|
-
const t = document.createElement("style");
|
|
623
|
-
return t.textContent = e, t;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
const Me = zt("host", { style: "display: contents" }), W = M("atomico/context"), Ae = (e, t) => {
|
|
627
|
-
const n = _();
|
|
628
|
-
ge(
|
|
629
|
-
() => $t(
|
|
630
|
-
n.current,
|
|
631
|
-
"ConnectContext",
|
|
632
|
-
/**
|
|
633
|
-
* @param {CustomEvent<import("context").DetailConnectContext>} event
|
|
634
|
-
*/
|
|
635
|
-
(s) => {
|
|
636
|
-
e === s.detail.id && (s.stopPropagation(), s.detail.connect(t));
|
|
637
|
-
}
|
|
638
|
-
),
|
|
639
|
-
[e]
|
|
640
|
-
);
|
|
641
|
-
}, Fe = (e) => {
|
|
642
|
-
const t = C("ConnectContext", {
|
|
643
|
-
bubbles: !0,
|
|
644
|
-
composed: !0
|
|
645
|
-
}), n = () => {
|
|
646
|
-
let o;
|
|
647
|
-
return t({
|
|
648
|
-
id: e,
|
|
649
|
-
connect(c) {
|
|
650
|
-
o = c;
|
|
651
|
-
}
|
|
652
|
-
}), o;
|
|
653
|
-
}, [s, r] = rt(
|
|
654
|
-
n
|
|
655
|
-
);
|
|
656
|
-
return $(() => {
|
|
657
|
-
s || (e[W] || (e[W] = customElements.whenDefined(
|
|
658
|
-
new e().localName
|
|
659
|
-
)), e[W].then(
|
|
660
|
-
() => r(n)
|
|
661
|
-
));
|
|
662
|
-
}, [e]), s;
|
|
663
|
-
}, Re = (e) => {
|
|
664
|
-
const t = Fe(e), n = Rt();
|
|
665
|
-
return $(() => {
|
|
666
|
-
if (t)
|
|
667
|
-
return $t(t, "UpdatedValue", n);
|
|
668
|
-
}, [t]), (t || e).value;
|
|
669
|
-
}, Ie = (e) => {
|
|
670
|
-
const t = j(
|
|
671
|
-
() => (Ae(t, _().current), Me),
|
|
672
|
-
{
|
|
673
|
-
props: {
|
|
674
|
-
value: {
|
|
675
|
-
type: Object,
|
|
676
|
-
event: { type: "UpdatedValue" },
|
|
677
|
-
value: () => e
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
);
|
|
682
|
-
return t.value = e, t;
|
|
683
|
-
}, y = (e, t, n) => (t == null ? t = { key: n } : t.key = n, zt(e, t)), U = y, Kt = z`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, Jt = z`.vh{position:absolute;transform:scale(0)}`;
|
|
684
|
-
function it() {
|
|
685
|
-
return E.from(/* @__PURE__ */ new Date());
|
|
686
|
-
}
|
|
687
|
-
function at(e, t = 0) {
|
|
688
|
-
const n = S(e), s = n.getUTCDay(), r = (s < t ? 7 : 0) + s - t;
|
|
689
|
-
return n.setUTCDate(n.getUTCDate() - r), E.from(n);
|
|
690
|
-
}
|
|
691
|
-
function Zt(e, t = 0) {
|
|
692
|
-
return at(e, t).add({ days: 6 });
|
|
693
|
-
}
|
|
694
|
-
function Wt(e) {
|
|
695
|
-
return E.from(new Date(Date.UTC(e.year, e.month, 0)));
|
|
696
|
-
}
|
|
697
|
-
function H(e, t, n) {
|
|
698
|
-
return t && E.compare(e, t) < 0 ? t : n && E.compare(e, n) > 0 ? n : e;
|
|
699
|
-
}
|
|
700
|
-
const Ue = { days: 1 };
|
|
701
|
-
function $e(e, t = 0) {
|
|
702
|
-
let n = at(e.toPlainDate(), t);
|
|
703
|
-
const s = Zt(Wt(e), t), r = [];
|
|
704
|
-
for (; E.compare(n, s) < 0; ) {
|
|
705
|
-
const o = [];
|
|
706
|
-
for (let c = 0; c < 7; c++)
|
|
707
|
-
o.push(n), n = n.add(Ue);
|
|
708
|
-
r.push(o);
|
|
709
|
-
}
|
|
710
|
-
return r;
|
|
711
|
-
}
|
|
712
|
-
function S(e) {
|
|
713
|
-
return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1));
|
|
714
|
-
}
|
|
715
|
-
const Le = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, X = (e, t) => e.toString().padStart(t, "0");
|
|
716
|
-
class E {
|
|
717
|
-
constructor(t, n, s) {
|
|
718
|
-
this.year = t, this.month = n, this.day = s;
|
|
719
|
-
}
|
|
720
|
-
// this is an incomplete implementation that only handles arithmetic on a single unit at a time.
|
|
721
|
-
// i didn't want to get into more complex arithmetic since it get tricky fast
|
|
722
|
-
// this is enough to serve my needs and will still be a drop-in replacement when actual Temporal API lands
|
|
723
|
-
add(t) {
|
|
724
|
-
const n = S(this);
|
|
725
|
-
if ("days" in t)
|
|
726
|
-
return n.setUTCDate(this.day + t.days), E.from(n);
|
|
727
|
-
let { year: s, month: r } = this;
|
|
728
|
-
"months" in t ? (r = this.month + t.months, n.setUTCMonth(r - 1)) : (s = this.year + t.years, n.setUTCFullYear(s));
|
|
729
|
-
const o = E.from(S({ year: s, month: r, day: 1 }));
|
|
730
|
-
return H(E.from(n), o, Wt(o));
|
|
731
|
-
}
|
|
732
|
-
toString() {
|
|
733
|
-
return `${X(this.year, 4)}-${X(this.month, 2)}-${X(this.day, 2)}`;
|
|
734
|
-
}
|
|
735
|
-
toPlainYearMonth() {
|
|
736
|
-
return new K(this.year, this.month);
|
|
737
|
-
}
|
|
738
|
-
equals(t) {
|
|
739
|
-
return E.compare(this, t) === 0;
|
|
740
|
-
}
|
|
741
|
-
static compare(t, n) {
|
|
742
|
-
return t.year < n.year ? -1 : t.year > n.year ? 1 : t.month < n.month ? -1 : t.month > n.month ? 1 : t.day < n.day ? -1 : t.day > n.day ? 1 : 0;
|
|
743
|
-
}
|
|
744
|
-
static from(t) {
|
|
745
|
-
if (typeof t == "string") {
|
|
746
|
-
const n = t.match(Le);
|
|
747
|
-
if (!n)
|
|
748
|
-
throw new TypeError(t);
|
|
749
|
-
const [, s, r, o] = n;
|
|
750
|
-
return new E(
|
|
751
|
-
parseInt(s, 10),
|
|
752
|
-
parseInt(r, 10),
|
|
753
|
-
parseInt(o, 10)
|
|
754
|
-
);
|
|
755
|
-
}
|
|
756
|
-
return new E(
|
|
757
|
-
t.getUTCFullYear(),
|
|
758
|
-
t.getUTCMonth() + 1,
|
|
759
|
-
t.getUTCDate()
|
|
760
|
-
);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
class K {
|
|
764
|
-
constructor(t, n) {
|
|
765
|
-
this.year = t, this.month = n;
|
|
766
|
-
}
|
|
767
|
-
add(t) {
|
|
768
|
-
const n = S(this), s = (t.months ?? 0) + (t.years ?? 0) * 12;
|
|
769
|
-
return n.setUTCMonth(n.getUTCMonth() + s), new K(n.getUTCFullYear(), n.getUTCMonth() + 1);
|
|
770
|
-
}
|
|
771
|
-
equals(t) {
|
|
772
|
-
return this.year === t.year && this.month === t.month;
|
|
773
|
-
}
|
|
774
|
-
toPlainDate() {
|
|
775
|
-
return new E(this.year, this.month, 1);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
function x(e, t) {
|
|
779
|
-
if (t)
|
|
780
|
-
try {
|
|
781
|
-
return e.from(t);
|
|
782
|
-
} catch {
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
function P(e) {
|
|
786
|
-
const [t, n] = ct(e);
|
|
787
|
-
return [T(() => x(E, t), [t]), (o) => n(o?.toString())];
|
|
788
|
-
}
|
|
789
|
-
function _e(e) {
|
|
790
|
-
const [t = "", n] = ct(e);
|
|
791
|
-
return [T(() => {
|
|
792
|
-
const [o, c] = t.split("/"), u = x(E, o), a = x(E, c);
|
|
793
|
-
return u && a ? [u, a] : [];
|
|
794
|
-
}, [t]), (o) => n(`${o[0]}/${o[1]}`)];
|
|
795
|
-
}
|
|
796
|
-
function je(e) {
|
|
797
|
-
const [t = "", n] = ct(e);
|
|
798
|
-
return [T(() => {
|
|
799
|
-
const o = [];
|
|
800
|
-
for (const c of t.trim().split(/\s+/)) {
|
|
801
|
-
const u = x(E, c);
|
|
802
|
-
u && o.push(u);
|
|
803
|
-
}
|
|
804
|
-
return o;
|
|
805
|
-
}, [t]), (o) => n(o.join(" "))];
|
|
806
|
-
}
|
|
807
|
-
function L(e, t) {
|
|
808
|
-
return T(
|
|
809
|
-
() => new Intl.DateTimeFormat(t, { timeZone: "UTC", ...e }),
|
|
810
|
-
[t, e]
|
|
811
|
-
);
|
|
812
|
-
}
|
|
813
|
-
function Ct(e, t, n) {
|
|
814
|
-
const s = L(e, n);
|
|
815
|
-
return T(() => {
|
|
816
|
-
const r = [], o = /* @__PURE__ */ new Date();
|
|
817
|
-
for (var c = 0; c < 7; c++) {
|
|
818
|
-
const u = (o.getUTCDay() - t + 7) % 7;
|
|
819
|
-
r[u] = s.format(o), o.setUTCDate(o.getUTCDate() + 1);
|
|
820
|
-
}
|
|
821
|
-
return r;
|
|
822
|
-
}, [t, s]);
|
|
823
|
-
}
|
|
824
|
-
const Tt = (e, t, n) => H(e, t, n) === e, Pt = (e) => e.target.matches(":dir(ltr)"), Ye = { month: "long", day: "numeric" }, Be = { month: "long" }, qe = { weekday: "narrow" }, xe = { weekday: "long" }, G = { bubbles: !0 };
|
|
825
|
-
function ze({ props: e, context: t }) {
|
|
826
|
-
const { offset: n } = e, {
|
|
827
|
-
firstDayOfWeek: s,
|
|
828
|
-
isDateDisallowed: r,
|
|
829
|
-
min: o,
|
|
830
|
-
max: c,
|
|
831
|
-
page: u,
|
|
832
|
-
locale: a,
|
|
833
|
-
focusedDate: i
|
|
834
|
-
} = t, f = it(), d = Ct(xe, s, a), l = Ct(qe, s, a), m = L(Ye, a), v = L(Be, a), p = T(
|
|
835
|
-
() => u.start.add({ months: n }),
|
|
836
|
-
[u, n]
|
|
837
|
-
), h = T(
|
|
838
|
-
() => $e(p, s),
|
|
839
|
-
[p, s]
|
|
840
|
-
), b = C("focusday", G), A = C("selectday", G), Xt = C("hoverday", G);
|
|
841
|
-
function mt(g) {
|
|
842
|
-
b(H(g, o, c));
|
|
843
|
-
}
|
|
844
|
-
function Gt(g) {
|
|
845
|
-
let D;
|
|
846
|
-
switch (g.key) {
|
|
847
|
-
case "ArrowRight":
|
|
848
|
-
D = i.add({ days: Pt(g) ? 1 : -1 });
|
|
849
|
-
break;
|
|
850
|
-
case "ArrowLeft":
|
|
851
|
-
D = i.add({ days: Pt(g) ? -1 : 1 });
|
|
852
|
-
break;
|
|
853
|
-
case "ArrowDown":
|
|
854
|
-
D = i.add({ days: 7 });
|
|
855
|
-
break;
|
|
856
|
-
case "ArrowUp":
|
|
857
|
-
D = i.add({ days: -7 });
|
|
858
|
-
break;
|
|
859
|
-
case "PageUp":
|
|
860
|
-
D = i.add(g.shiftKey ? { years: -1 } : { months: -1 });
|
|
861
|
-
break;
|
|
862
|
-
case "PageDown":
|
|
863
|
-
D = i.add(g.shiftKey ? { years: 1 } : { months: 1 });
|
|
864
|
-
break;
|
|
865
|
-
case "Home":
|
|
866
|
-
D = at(i, s);
|
|
867
|
-
break;
|
|
868
|
-
case "End":
|
|
869
|
-
D = Zt(i, s);
|
|
870
|
-
break;
|
|
871
|
-
default:
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
mt(D), g.preventDefault();
|
|
875
|
-
}
|
|
876
|
-
function Qt(g) {
|
|
877
|
-
const D = p.equals(g);
|
|
878
|
-
if (!t.showOutsideDays && !D)
|
|
879
|
-
return;
|
|
880
|
-
const Vt = g.equals(i), yt = g.equals(f), pt = S(g), Y = r?.(pt), bt = !Tt(g, o, c);
|
|
881
|
-
let gt = "", N;
|
|
882
|
-
if (t.type === "range") {
|
|
883
|
-
const [F, J] = t.value, Et = F?.equals(g), vt = J?.equals(g);
|
|
884
|
-
N = F && J && Tt(g, F, J), gt = `${Et ? "range-start" : ""} ${vt ? "range-end" : ""} ${N && !Et && !vt ? "range-inner" : ""}`;
|
|
885
|
-
} else
|
|
886
|
-
t.type === "multi" ? N = t.value.some((F) => F.equals(g)) : N = t.value?.equals(g);
|
|
887
|
-
return {
|
|
888
|
-
part: `${`button day ${// we don't want outside days to ever be shown as selected
|
|
889
|
-
D ? N ? "selected" : "" : "outside"} ${Y ? "disallowed" : ""} ${yt ? "today" : ""}`} ${gt}`,
|
|
890
|
-
tabindex: D && Vt ? 0 : -1,
|
|
891
|
-
disabled: bt,
|
|
892
|
-
"aria-disabled": Y ? "true" : void 0,
|
|
893
|
-
"aria-pressed": D && N,
|
|
894
|
-
"aria-current": yt ? "date" : void 0,
|
|
895
|
-
"aria-label": m.format(pt),
|
|
896
|
-
onkeydown: Gt,
|
|
897
|
-
onclick() {
|
|
898
|
-
Y || A(g), mt(g);
|
|
899
|
-
},
|
|
900
|
-
onmouseover() {
|
|
901
|
-
!Y && !bt && Xt(g);
|
|
902
|
-
}
|
|
903
|
-
};
|
|
904
|
-
}
|
|
905
|
-
return {
|
|
906
|
-
weeks: h,
|
|
907
|
-
yearMonth: p,
|
|
908
|
-
daysLong: d,
|
|
909
|
-
daysShort: l,
|
|
910
|
-
formatter: v,
|
|
911
|
-
getDayProps: Qt
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
const Q = it(), lt = Ie({
|
|
915
|
-
type: "date",
|
|
916
|
-
firstDayOfWeek: 1,
|
|
917
|
-
isDateDisallowed: () => !1,
|
|
918
|
-
focusedDate: Q,
|
|
919
|
-
page: { start: Q.toPlainYearMonth(), end: Q.toPlainYearMonth() }
|
|
920
|
-
});
|
|
921
|
-
customElements.define("calendar-month-ctx", lt);
|
|
922
|
-
const He = j(
|
|
923
|
-
(e) => {
|
|
924
|
-
const t = Re(lt), n = se(), s = ze({ props: e, context: t });
|
|
925
|
-
function r() {
|
|
926
|
-
n.current.querySelector("button[tabindex='0']")?.focus();
|
|
927
|
-
}
|
|
928
|
-
return /* @__PURE__ */ U("host", { shadowDom: !0, focus: r, children: [
|
|
929
|
-
/* @__PURE__ */ y("div", { id: "h", part: "heading", children: s.formatter.format(S(s.yearMonth)) }),
|
|
930
|
-
/* @__PURE__ */ U("table", { ref: n, "aria-labelledby": "h", part: "table", children: [
|
|
931
|
-
/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ y("tr", { part: "tr head", children: s.daysLong.map((o, c) => /* @__PURE__ */ U("th", { part: "th", scope: "col", children: [
|
|
932
|
-
/* @__PURE__ */ y("span", { class: "vh", children: o }),
|
|
933
|
-
/* @__PURE__ */ y("span", { "aria-hidden": "true", children: s.daysShort[c] })
|
|
934
|
-
] })) }) }),
|
|
935
|
-
/* @__PURE__ */ y("tbody", { children: s.weeks.map((o, c) => /* @__PURE__ */ y("tr", { part: "tr week", children: o.map((u, a) => {
|
|
936
|
-
const i = s.getDayProps(u);
|
|
937
|
-
return /* @__PURE__ */ y("td", { part: "td", children: i && /* @__PURE__ */ y("button", { ...i, children: u.day }) }, a);
|
|
938
|
-
}) }, c)) })
|
|
939
|
-
] })
|
|
940
|
-
] });
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
props: {
|
|
944
|
-
offset: {
|
|
945
|
-
type: Number,
|
|
946
|
-
value: 0
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
styles: [
|
|
950
|
-
Kt,
|
|
951
|
-
Jt,
|
|
952
|
-
z`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{font-weight:700;block-size:2.25rem}td{padding-inline:0}button{color:inherit;font-size:inherit;background:transparent;border:0;font-variant-numeric:tabular-nums;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`
|
|
953
|
-
]
|
|
954
|
-
}
|
|
955
|
-
);
|
|
956
|
-
customElements.define("calendar-month", He);
|
|
957
|
-
function Nt(e) {
|
|
958
|
-
return /* @__PURE__ */ y(
|
|
959
|
-
"button",
|
|
960
|
-
{
|
|
961
|
-
part: `button ${e.name} ${e.onclick ? "" : "disabled"}`,
|
|
962
|
-
onclick: e.onclick,
|
|
963
|
-
"aria-disabled": e.onclick ? null : "true",
|
|
964
|
-
children: /* @__PURE__ */ y("slot", { name: e.name, children: e.children })
|
|
965
|
-
}
|
|
966
|
-
);
|
|
967
|
-
}
|
|
968
|
-
function ut(e) {
|
|
969
|
-
const t = S(e.page.start), n = S(e.page.end);
|
|
970
|
-
return /* @__PURE__ */ U("div", { role: "group", "aria-labelledby": "h", part: "container", children: [
|
|
971
|
-
/* @__PURE__ */ y("div", { id: "h", class: "vh", "aria-live": "polite", "aria-atomic": "true", children: e.formatVerbose.formatRange(t, n) }),
|
|
972
|
-
/* @__PURE__ */ U("div", { part: "header", children: [
|
|
973
|
-
/* @__PURE__ */ y(Nt, { name: "previous", onclick: e.previous, children: "Previous" }),
|
|
974
|
-
/* @__PURE__ */ y("slot", { part: "heading", name: "heading", children: /* @__PURE__ */ y("div", { "aria-hidden": "true", children: e.format.formatRange(t, n) }) }),
|
|
975
|
-
/* @__PURE__ */ y(Nt, { name: "next", onclick: e.next, children: "Next" })
|
|
976
|
-
] }),
|
|
977
|
-
/* @__PURE__ */ y(
|
|
978
|
-
lt,
|
|
979
|
-
{
|
|
980
|
-
value: e,
|
|
981
|
-
onselectday: e.onSelect,
|
|
982
|
-
onfocusday: e.onFocus,
|
|
983
|
-
onhoverday: e.onHover,
|
|
984
|
-
children: /* @__PURE__ */ y("slot", {})
|
|
985
|
-
}
|
|
986
|
-
)
|
|
987
|
-
] });
|
|
988
|
-
}
|
|
989
|
-
const ft = {
|
|
990
|
-
value: {
|
|
991
|
-
type: String,
|
|
992
|
-
value: ""
|
|
993
|
-
},
|
|
994
|
-
min: {
|
|
995
|
-
type: String,
|
|
996
|
-
value: ""
|
|
997
|
-
},
|
|
998
|
-
max: {
|
|
999
|
-
type: String,
|
|
1000
|
-
value: ""
|
|
1001
|
-
},
|
|
1002
|
-
isDateDisallowed: {
|
|
1003
|
-
type: Function,
|
|
1004
|
-
value: (e) => !1
|
|
1005
|
-
},
|
|
1006
|
-
firstDayOfWeek: {
|
|
1007
|
-
type: Number,
|
|
1008
|
-
value: () => 1
|
|
1009
|
-
},
|
|
1010
|
-
showOutsideDays: {
|
|
1011
|
-
type: Boolean,
|
|
1012
|
-
value: !1
|
|
1013
|
-
},
|
|
1014
|
-
locale: {
|
|
1015
|
-
type: String,
|
|
1016
|
-
value: () => {
|
|
1017
|
-
}
|
|
1018
|
-
},
|
|
1019
|
-
months: {
|
|
1020
|
-
type: Number,
|
|
1021
|
-
value: 1
|
|
1022
|
-
},
|
|
1023
|
-
focusedDate: {
|
|
1024
|
-
type: String,
|
|
1025
|
-
value: () => {
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
pageBy: {
|
|
1029
|
-
type: String,
|
|
1030
|
-
value: () => "months"
|
|
1031
|
-
}
|
|
1032
|
-
}, dt = [
|
|
1033
|
-
Kt,
|
|
1034
|
-
Jt,
|
|
1035
|
-
z`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}button{display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.5}`
|
|
1036
|
-
], Ke = { year: "numeric" }, Je = { year: "numeric", month: "long" };
|
|
1037
|
-
function V(e, t) {
|
|
1038
|
-
return (t.year - e.year) * 12 + t.month - e.month;
|
|
1039
|
-
}
|
|
1040
|
-
const kt = (e, t) => (e = t === 12 ? new K(e.year, 1) : e, {
|
|
1041
|
-
start: e,
|
|
1042
|
-
end: e.add({ months: t - 1 })
|
|
1043
|
-
});
|
|
1044
|
-
function Ze({
|
|
1045
|
-
pageBy: e,
|
|
1046
|
-
focusedDate: t,
|
|
1047
|
-
months: n,
|
|
1048
|
-
max: s,
|
|
1049
|
-
min: r,
|
|
1050
|
-
goto: o
|
|
1051
|
-
}) {
|
|
1052
|
-
const c = e === "single" ? 1 : n, [u, a] = rt(
|
|
1053
|
-
() => kt(t.toPlainYearMonth(), n)
|
|
1054
|
-
), i = (d) => a(kt(u.start.add({ months: d }), n)), f = (d) => {
|
|
1055
|
-
const l = V(u.start, d.toPlainYearMonth());
|
|
1056
|
-
return l >= 0 && l < n;
|
|
1057
|
-
};
|
|
1058
|
-
return $(() => {
|
|
1059
|
-
if (f(t))
|
|
1060
|
-
return;
|
|
1061
|
-
const d = V(t.toPlainYearMonth(), u.start);
|
|
1062
|
-
o(t.add({ months: d }));
|
|
1063
|
-
}, [u.start]), $(() => {
|
|
1064
|
-
if (f(t))
|
|
1065
|
-
return;
|
|
1066
|
-
const d = V(u.start, t.toPlainYearMonth());
|
|
1067
|
-
i(d === -1 ? -c : d === n ? c : Math.floor(d / n) * n);
|
|
1068
|
-
}, [t, c, n]), {
|
|
1069
|
-
page: u,
|
|
1070
|
-
previous: !r || !f(r) ? () => i(-c) : void 0,
|
|
1071
|
-
next: !s || !f(s) ? () => i(c) : void 0
|
|
1072
|
-
};
|
|
1073
|
-
}
|
|
1074
|
-
function ht({
|
|
1075
|
-
months: e,
|
|
1076
|
-
pageBy: t,
|
|
1077
|
-
locale: n,
|
|
1078
|
-
focusedDate: s,
|
|
1079
|
-
setFocusedDate: r
|
|
1080
|
-
}) {
|
|
1081
|
-
const [o] = P("min"), [c] = P("max"), u = C("focusday"), a = C("change"), i = T(
|
|
1082
|
-
() => H(s ?? it(), o, c),
|
|
1083
|
-
[s, o, c]
|
|
1084
|
-
);
|
|
1085
|
-
function f(h) {
|
|
1086
|
-
r(h), u(S(h));
|
|
1087
|
-
}
|
|
1088
|
-
const { next: d, previous: l, page: m } = Ze({
|
|
1089
|
-
pageBy: t,
|
|
1090
|
-
focusedDate: i,
|
|
1091
|
-
months: e,
|
|
1092
|
-
min: o,
|
|
1093
|
-
max: c,
|
|
1094
|
-
goto: f
|
|
1095
|
-
}), v = _();
|
|
1096
|
-
function p() {
|
|
1097
|
-
v.current.querySelectorAll("calendar-month").forEach((h) => h.focus());
|
|
1098
|
-
}
|
|
1099
|
-
return {
|
|
1100
|
-
format: L(Ke, n),
|
|
1101
|
-
formatVerbose: L(Je, n),
|
|
1102
|
-
page: m,
|
|
1103
|
-
focusedDate: i,
|
|
1104
|
-
dispatch: a,
|
|
1105
|
-
onFocus(h) {
|
|
1106
|
-
h.stopPropagation(), f(h.detail), setTimeout(p);
|
|
1107
|
-
},
|
|
1108
|
-
min: o,
|
|
1109
|
-
max: c,
|
|
1110
|
-
next: d,
|
|
1111
|
-
previous: l,
|
|
1112
|
-
focus: p
|
|
1113
|
-
};
|
|
1114
|
-
}
|
|
1115
|
-
const We = j(
|
|
1116
|
-
(e) => {
|
|
1117
|
-
const [t, n] = P("value"), [s = t, r] = P("focusedDate"), o = ht({
|
|
1118
|
-
...e,
|
|
1119
|
-
focusedDate: s,
|
|
1120
|
-
setFocusedDate: r
|
|
1121
|
-
});
|
|
1122
|
-
function c(u) {
|
|
1123
|
-
n(u.detail), o.dispatch();
|
|
1124
|
-
}
|
|
1125
|
-
return /* @__PURE__ */ y("host", { shadowDom: !0, focus: o.focus, children: /* @__PURE__ */ y(
|
|
1126
|
-
ut,
|
|
1127
|
-
{
|
|
1128
|
-
...e,
|
|
1129
|
-
...o,
|
|
1130
|
-
type: "date",
|
|
1131
|
-
value: t,
|
|
1132
|
-
onSelect: c
|
|
1133
|
-
}
|
|
1134
|
-
) });
|
|
1135
|
-
},
|
|
1136
|
-
{ props: ft, styles: dt }
|
|
1137
|
-
);
|
|
1138
|
-
customElements.define("calendar-date", We);
|
|
1139
|
-
const Ot = (e, t) => E.compare(e, t) < 0 ? [e, t] : [t, e], Xe = j(
|
|
1140
|
-
(e) => {
|
|
1141
|
-
const [t, n] = _e("value"), [s = t[0], r] = P("focusedDate"), o = ht({
|
|
1142
|
-
...e,
|
|
1143
|
-
focusedDate: s,
|
|
1144
|
-
setFocusedDate: r
|
|
1145
|
-
}), c = C("rangestart"), u = C("rangeend"), [a, i] = P(
|
|
1146
|
-
"tentative"
|
|
1147
|
-
), [f, d] = rt();
|
|
1148
|
-
$(() => d(void 0), [a]);
|
|
1149
|
-
function l(h) {
|
|
1150
|
-
o.onFocus(h), m(h);
|
|
1151
|
-
}
|
|
1152
|
-
function m(h) {
|
|
1153
|
-
h.stopPropagation(), a && d(h.detail);
|
|
1154
|
-
}
|
|
1155
|
-
function v(h) {
|
|
1156
|
-
const b = h.detail;
|
|
1157
|
-
h.stopPropagation(), a ? (n(Ot(a, b)), i(void 0), u(S(b)), o.dispatch()) : (i(b), c(S(b)));
|
|
1158
|
-
}
|
|
1159
|
-
const p = a ? Ot(a, f ?? a) : t;
|
|
1160
|
-
return /* @__PURE__ */ y("host", { shadowDom: !0, focus: o.focus, children: /* @__PURE__ */ y(
|
|
1161
|
-
ut,
|
|
1162
|
-
{
|
|
1163
|
-
...e,
|
|
1164
|
-
...o,
|
|
1165
|
-
type: "range",
|
|
1166
|
-
value: p,
|
|
1167
|
-
onFocus: l,
|
|
1168
|
-
onHover: m,
|
|
1169
|
-
onSelect: v
|
|
1170
|
-
}
|
|
1171
|
-
) });
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
props: {
|
|
1175
|
-
...ft,
|
|
1176
|
-
tentative: {
|
|
1177
|
-
type: String,
|
|
1178
|
-
value: ""
|
|
1179
|
-
}
|
|
1180
|
-
},
|
|
1181
|
-
styles: dt
|
|
1182
|
-
}
|
|
1183
|
-
);
|
|
1184
|
-
customElements.define("calendar-range", Xe);
|
|
1185
|
-
const Ge = j(
|
|
1186
|
-
(e) => {
|
|
1187
|
-
const [t, n] = je("value"), [s = t[0], r] = P("focusedDate"), o = ht({
|
|
1188
|
-
...e,
|
|
1189
|
-
focusedDate: s,
|
|
1190
|
-
setFocusedDate: r
|
|
1191
|
-
});
|
|
1192
|
-
function c(u) {
|
|
1193
|
-
const a = [...t], i = t.findIndex((f) => f.equals(u.detail));
|
|
1194
|
-
i < 0 ? a.push(u.detail) : a.splice(i, 1), n(a), o.dispatch();
|
|
1195
|
-
}
|
|
1196
|
-
return /* @__PURE__ */ y("host", { shadowDom: !0, focus: o.focus, children: /* @__PURE__ */ y(
|
|
1197
|
-
ut,
|
|
1198
|
-
{
|
|
1199
|
-
...e,
|
|
1200
|
-
...o,
|
|
1201
|
-
type: "multi",
|
|
1202
|
-
value: t,
|
|
1203
|
-
onSelect: c
|
|
1204
|
-
}
|
|
1205
|
-
) });
|
|
1206
|
-
},
|
|
1207
|
-
{ props: ft, styles: dt }
|
|
1208
|
-
);
|
|
1209
|
-
customElements.define("calendar-multi", Ge);
|
|
1210
|
-
|
|
1211
|
-
/**
|
|
1212
|
-
* Get a number of randoms items from Array
|
|
1213
|
-
*
|
|
1214
|
-
* @param {Array} arr - The array where to look
|
|
1215
|
-
* @param {Number} n - The number of random items to take
|
|
1216
|
-
* @returns {Array} An array with the number of random items specified
|
|
1217
|
-
*/
|
|
1218
|
-
const getRandomFromArray = (arr, n) => {
|
|
1219
|
-
let length = arr.length;
|
|
1220
|
-
const result = new Array(n);
|
|
1221
|
-
const taken = new Array(length);
|
|
1222
|
-
if (n > length)
|
|
1223
|
-
throw new RangeError('getRandom: more elements taken than available');
|
|
1224
|
-
while (n--) {
|
|
1225
|
-
const x = Date.now() % length;
|
|
1226
|
-
result[n] = arr[x in taken ? taken[x] : x];
|
|
1227
|
-
taken[x] = --length in taken ? taken[length] : length;
|
|
1228
|
-
}
|
|
1229
|
-
return result;
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
/**
|
|
1233
|
-
* Check if the value is an empty array, object, set, map
|
|
1234
|
-
* @param value the value to be checked
|
|
1235
|
-
* @returns {boolean} true if value is empty
|
|
1236
|
-
*/
|
|
1237
|
-
const isEmpty = (value) => {
|
|
1238
|
-
if (isNil(value)) {
|
|
1239
|
-
return true;
|
|
1240
|
-
}
|
|
1241
|
-
else if ('size' in value) {
|
|
1242
|
-
return !isDefined(value.size);
|
|
1243
|
-
}
|
|
1244
|
-
else {
|
|
1245
|
-
return !isDefined(Object.values(value).length);
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
|
|
1249
|
-
export { getRandomFromArray, isEmpty };
|
|
1250
|
-
|
|
5
|
+
export{g as getAssetPath,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-b8a8243f.js";export{g as getBasePath,s as setBasePath}from"./p-0b976755.js";export{BqSlider,c as clamp,defineCustomElement as defineCustomElementBqSlider}from"./bq-slider.js";export{a as getCSSVariableValue,g as getColorCSSVariable}from"./p-edfd9767.js";export{d as debounce,s as setRafTimeout}from"./p-1defeea3.js";export{i as isEventTargetChildOfElement}from"./p-1c8b6eb4.js";export{BqTabGroup,defineCustomElement as defineCustomElementBqTabGroup,g as getNextElement}from"./bq-tab-group.js";import{i as n}from"./p-31df5ea1.js";export{i as isDefined}from"./p-31df5ea1.js";import"./p-073153b0.js";import{i as o}from"./p-99829fc7.js";export{i as isNil}from"./p-99829fc7.js";export{i as isHTMLElement}from"./p-57621be1.js";export{i as isString}from"./p-ecd27cf2.js";export{v as validatePropValue}from"./p-687da041.js";export{g as getInnerHTML,a as getTextContent,h as hasSlot,b as hasSlotContent}from"./p-d7ce7165.js";export{e as enter,l as leave,t as toggle}from"./p-a5dc1c94.js";export{BqAccordion,defineCustomElement as defineCustomElementBqAccordion}from"./bq-accordion.js";export{BqAccordionGroup,defineCustomElement as defineCustomElementBqAccordionGroup}from"./bq-accordion-group.js";export{BqAlert,defineCustomElement as defineCustomElementBqAlert}from"./bq-alert.js";export{BqAvatar,defineCustomElement as defineCustomElementBqAvatar}from"./bq-avatar.js";export{BqBadge,defineCustomElement as defineCustomElementBqBadge}from"./bq-badge.js";export{BqBreadcrumb,defineCustomElement as defineCustomElementBqBreadcrumb}from"./bq-breadcrumb.js";export{BqBreadcrumbItem,defineCustomElement as defineCustomElementBqBreadcrumbItem}from"./bq-breadcrumb-item.js";export{BqButton,defineCustomElement as defineCustomElementBqButton}from"./bq-button.js";export{BqCard,defineCustomElement as defineCustomElementBqCard}from"./bq-card.js";export{BqCheckbox,defineCustomElement as defineCustomElementBqCheckbox}from"./bq-checkbox.js";export{BqDatePicker,defineCustomElement as defineCustomElementBqDatePicker}from"./bq-date-picker.js";export{BqDialog,defineCustomElement as defineCustomElementBqDialog}from"./bq-dialog.js";export{BqDivider,defineCustomElement as defineCustomElementBqDivider}from"./bq-divider.js";export{BqDrawer,defineCustomElement as defineCustomElementBqDrawer}from"./bq-drawer.js";export{BqDropdown,defineCustomElement as defineCustomElementBqDropdown}from"./bq-dropdown.js";export{BqEmptyState,defineCustomElement as defineCustomElementBqEmptyState}from"./bq-empty-state.js";export{BqIcon,defineCustomElement as defineCustomElementBqIcon}from"./bq-icon.js";export{BqInput,defineCustomElement as defineCustomElementBqInput}from"./bq-input.js";export{BqNotification,defineCustomElement as defineCustomElementBqNotification}from"./bq-notification.js";export{BqOption,defineCustomElement as defineCustomElementBqOption}from"./bq-option.js";export{BqOptionGroup,defineCustomElement as defineCustomElementBqOptionGroup}from"./bq-option-group.js";export{BqOptionList,defineCustomElement as defineCustomElementBqOptionList}from"./bq-option-list.js";export{BqPageTitle,defineCustomElement as defineCustomElementBqPageTitle}from"./bq-page-title.js";export{BqPanel,defineCustomElement as defineCustomElementBqPanel}from"./bq-panel.js";export{BqProgress,defineCustomElement as defineCustomElementBqProgress}from"./bq-progress.js";export{BqRadio,defineCustomElement as defineCustomElementBqRadio}from"./bq-radio.js";export{BqRadioGroup,defineCustomElement as defineCustomElementBqRadioGroup}from"./bq-radio-group.js";export{BqSelect,defineCustomElement as defineCustomElementBqSelect}from"./bq-select.js";export{BqSideMenu,defineCustomElement as defineCustomElementBqSideMenu}from"./bq-side-menu.js";export{BqSideMenuItem,defineCustomElement as defineCustomElementBqSideMenuItem}from"./bq-side-menu-item.js";export{BqSpinner,defineCustomElement as defineCustomElementBqSpinner}from"./bq-spinner.js";export{BqStatus,defineCustomElement as defineCustomElementBqStatus}from"./bq-status.js";export{BqStepItem,defineCustomElement as defineCustomElementBqStepItem}from"./bq-step-item.js";export{BqSteps,defineCustomElement as defineCustomElementBqSteps}from"./bq-steps.js";export{BqSwitch,defineCustomElement as defineCustomElementBqSwitch}from"./bq-switch.js";export{BqTab,defineCustomElement as defineCustomElementBqTab}from"./bq-tab.js";export{BqTag,defineCustomElement as defineCustomElementBqTag}from"./bq-tag.js";export{BqTextarea,defineCustomElement as defineCustomElementBqTextarea}from"./bq-textarea.js";export{BqToast,defineCustomElement as defineCustomElementBqToast}from"./bq-toast.js";export{BqTooltip,defineCustomElement as defineCustomElementBqTooltip}from"./bq-tooltip.js";class r{#e;#t=new Set;constructor(e){this.#e=e}get current(){return this.#e}set current(e){this.#e!=e&&(this.#e=e,this.#t.forEach((t=>t(e))))}on(e){return this.#t.add(e),()=>this.#t.delete(e)}}const u=e=>new r(e),m=Symbol.for("atomico.hooks");globalThis[m]=globalThis[m]||{};let f=globalThis[m];const p=Symbol.for("Atomico.suspense"),y=Symbol.for("Atomico.effect"),q=Symbol.for("Atomico.layoutEffect"),E=Symbol.for("Atomico.insertionEffect"),C=(e,t,n)=>{const{i:o,hooks:s}=f.c,r=s[o]=s[o]||{};return r.value=e(r.value),r.effect=t,r.tag=n,f.c.i++,s[o].value},x=e=>C(((t=u(e))=>t)),B=()=>C(((e=u(f.c.host))=>e)),w=()=>f.c.update,j=(e,t,n=0)=>{let o={},s=!1;const r=()=>s,i=(e,t)=>{for(const n in o){const s=o[n];s.effect&&s.tag===e&&(s.value=s.effect(s.value,t))}};return{load:r=>{f.c={host:t,hooks:o,update:e,i:0,id:n};let i;try{s=!1,i=r()}catch(e){if(e!==p)throw e;s=!0}finally{f.c=null}return i},cleanEffects:e=>(i(E,e),()=>(i(q,e),()=>{i(y,e)})),isSuspense:r}},S=Symbol.for;function D(e,t){const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++){let n=e[o],s=t[o];if(n!==s)return!1}return!0}const k=e=>typeof e=="function",T=e=>typeof e=="object",{isArray:A}=Array,P=(e,t)=>(t?e instanceof HTMLStyleElement:!0)&&"hydrate"in(e?.dataset||{});function $(e,t){let n;const o=e=>{let{length:s}=e;for(let r=0;r<s;r++){const s=e[r];if(s&&Array.isArray(s))o(s);else{const e=typeof s;if(s==null||e==="function"||e==="boolean")continue;e==="string"||e==="number"?(n==null&&(n=""),n+=s):(n!=null&&(t(n),n=null),t(s))}}};o(e),n!=null&&t(n)}const N=(e,t,n)=>(e.addEventListener(t,n),()=>e.removeEventListener(t,n));class O{constructor(e,t,n){this.message=t,this.target=e,this.value=n}}class I extends O{}class M extends O{}const z="Custom",F=null,L={true:1,"":1,1:1};function R(e,t,n,o,s){const{type:r,reflect:i,event:a,value:l,attr:c=H(t)}=n?.name!=z&&T(n)&&n!=F?n:{type:n},u=r?.name===z&&r.map,m=l!=null?r==Function||!k(l)?()=>l:l:null;Object.defineProperty(e,t,{configurable:!0,set(e){const n=this[t];m&&r!=Boolean&&e==null&&(e=m());const{error:o,value:s}=(u?J:W)(r,e);if(o&&s!=null)throw new I(this,`The value defined for prop '${t}' must be of type '${r.name}'`,s);n!=s&&(this._props[t]=s??void 0,this.update(),a&&G(this,a),this.updated.then((()=>{i&&(this._ignoreAttr=c,V(this,r,c,this[t]),this._ignoreAttr=null)})))},get(){return this._props[t]}}),m&&(s[t]=m()),o[c]={prop:t,type:r}}const G=(e,{type:t,base:n=CustomEvent,...o})=>e.dispatchEvent(new n(t,o)),H=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase(),V=(e,t,n,o)=>o==null||t==Boolean&&!o?e.removeAttribute(n):e.setAttribute(n,t?.name===z&&t?.serialize?t?.serialize(o):T(o)?JSON.stringify(o):t==Boolean?"":o),U=(e,t)=>e==Boolean?!!L[t]:e==Number?Number(t):e==String?t:e==Array||e==Object?JSON.parse(t):e.name==z?t:new e(t),J=({map:e},t)=>{try{return{value:e(t),error:!1}}catch{return{value:t,error:!0}}},W=(e,t)=>e==null||t==null?{value:t,error:!1}:e!=String&&t===""?{value:void 0,error:!1}:e==Object||e==Array||e==Symbol?{value:t,error:{}.toString.call(t)!==`[object ${e.name}]`}:t instanceof e?{value:t,error:e==Number&&Number.isNaN(t.valueOf())}:e==String||e==Number||e==Boolean?{value:t,error:e==Number?typeof t!="number"?!0:Number.isNaN(t):e==String?typeof t!="string":typeof t!="boolean"}:{value:t,error:!0};let Z=0;const _=e=>{const t=(e?.dataset||{})?.hydrate||"";return t||"c"+Z++},Y=(e,t=HTMLElement)=>{const n={},o={},s="prototype"in t&&t.prototype instanceof Element,r=s?t:"base"in t?t.base:HTMLElement,{props:i,styles:a}=s?e:t;class l extends r{constructor(){super(),this._setup(),this._render=()=>e({...this._props});for(const e in o)this[e]=o[e]}static get styles(){return[super.styles,a]}async _setup(){if(this._props)return;this._props={};let e,t;this.mounted=new Promise((n=>this.mount=()=>{n(),e!=this.parentNode&&(t!=e?this.unmounted.then(this.update):this.update()),e=this.parentNode})),this.unmounted=new Promise((o=>this.unmount=()=>{o(),(e!=this.parentNode||!this.isConnected)&&(n.cleanEffects(!0)()(),t=this.parentNode,e=null)})),this.symbolId=this.symbolId||Symbol(),this.symbolIdParent=Symbol();const n=j((()=>this.update()),this,_(this));let o,s=!0;const r=P(this);this.update=()=>(o||(o=!0,this.updated=(this.updated||this.mounted).then((()=>{try{const e=n.load(this._render),t=n.cleanEffects();return e&&e.render(this,this.symbolId,r),o=!1,s&&!n.isSuspense()&&(s=!1,!r&&K(this)),t()}finally{o=!1}})).then((e=>{e&&e()}))),this.updated),this.update()}connectedCallback(){this.mount(),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback(),this.unmount()}attributeChangedCallback(e,t,o){if(n[e]){if(e===this._ignoreAttr||t===o)return;const{prop:s,type:r}=n[e];try{this[s]=U(r,o)}catch{throw new M(this,`The value defined as attr '${e}' cannot be parsed by type '${r.name}'`,o)}}else super.attributeChangedCallback(e,t,o)}static get props(){return{...super.props,...i}}static get observedAttributes(){const e=super.observedAttributes||[];for(const e in i)R(this.prototype,e,i[e],n,o);return Object.keys(n).concat(e)}}return l};function K(e){const{styles:t}=e.constructor,{shadowRoot:n}=e;if(n&&t.length){const e=[];$(t,(t=>{t&&(t instanceof Element?n.appendChild(t.cloneNode(!0)):e.push(t))})),e.length&&(n.adoptedStyleSheets=e)}}const Q=e=>(t,n)=>{C((([e,t]=[])=>((t||!t)&&(t&&D(t,n)?e=e||!0:(k(e)&&e(),e=null)),[e,n])),(([e,n],o)=>o?(k(e)&&e(),[]):[e||t(),n]),e)},X=Q(y),ee=Q(E);class te extends Array{constructor(e,t){let n=!0;const o=e=>{try{t(e,this,n)}finally{n=!1}};super(void 0,o,t),o(e)}}const ne=e=>{const t=w();return C(((n=new te(e,((e,n,o)=>{e=k(e)?e(n[0]):e,e!==n[0]&&(n[0]=e,o||t())})))=>n))},oe=(e,t)=>{const[n]=C((([n,o,s=0]=[])=>((!o||o&&!D(o,t))&&(n=e()),[n,t,s])));return n},se=e=>{const{current:t}=B();if(!(e in t))throw new I(t,`For useProp("${e}"), the prop does not exist on the host.`,e);return C(((n=new te(t[e],((n,o)=>{n=k(n)?n(t[e]):n,t[e]=n})))=>(n[0]=t[e],n)))},re=(e,t={})=>{const n=B();return n[e]||(n[e]=(o=t.detail)=>G(n.current,{type:e,...t,detail:o})),n[e]},ie=S("atomico/options");globalThis[ie]=globalThis[ie]||{sheet:!!document.adoptedStyleSheets};const ae=globalThis[ie],le={checked:1,value:1,selected:1},ce={list:1,type:1,size:1,form:1,width:1,height:1,src:1,href:1,slot:1},ue={shadowDom:1,staticNode:1,cloneNode:1,children:1,key:1},me={},de=[];class fe extends Text{}const pe=S("atomico/id"),he=S("atomico/type"),be=S("atomico/ref"),ye=S("atomico/vnode"),qe=()=>{};function ge(e,t,n){return Ce(this,e,t,n)}const Ee=(e,t,...n)=>{const o=t||me;let{children:s}=o;if(s=s??(n.length?n:de),e===qe)return s;const r=e?e instanceof Node?1:e.prototype instanceof HTMLElement&&2:0;if(r===!1&&e instanceof Function)return e(s!=de?{children:s,...o}:o);const i=ae.render||ge;return{[he]:ye,type:e,props:o,children:s,key:o.key,shadow:o.shadowDom,static:o.staticNode,raw:r,is:o.is,clone:o.cloneNode,render:i}};function Ce(e,t,n=pe,o,s){let r;if(t&&t[n]&&t[n].vnode==e||e[he]!=ye)return t;(e||!t)&&(s=s||e.type=="svg",r=e.type!="host"&&(e.raw==1?(t&&e.clone?t[be]:t)!=e.type:e.raw==2?!(t instanceof e.type):t?t[be]||t.localName!=e.type:!t),r&&e.type!=null&&(e.raw==1&&e.clone?(o=!0,t=e.type.cloneNode(!0),t[be]=e.type):t=e.raw==1?e.type:e.raw==2?new e.type:s?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,e.is?{is:e.is}:void 0)));const i=t[n]?t[n]:me,{vnode:a=me,cycle:l=0}=i;let{fragment:c,handlers:u}=i;const{children:m=de,props:d=me}=a;if(u=r?{}:u||{},e.static&&!r)return t;if(e.shadow&&!t.shadowRoot&&t.attachShadow({mode:"open",...e.shadow}),e.props!=d&&ve(t,d,e.props,u,s),e.children!==m){const r=e.shadow?t.shadowRoot:t;c=Be(e.children,c,r,n,!l&&o,s&&e.type=="foreignObject"?!1:s)}return t[n]={vnode:e,handlers:u,fragment:c,cycle:l+1},t}function xe(e,t){const n=new fe(""),o=new fe("");let s;if(e[t?"prepend":"append"](n),t){let{lastElementChild:t}=e;for(;t;){const{previousElementSibling:e}=t;if(P(t,!0)&&!P(e,!0)){s=t;break}t=e}}return s?s.before(o):e.append(o),{markStart:n,markEnd:o}}function Be(e,t,n,o,s,r){e=e==null?null:A(e)?e:[e];const i=t||xe(n,s),{markStart:a,markEnd:l,keyes:c}=i;let u;const m=c&&new Set;let d=a;if(e&&$(e,(e=>{if(typeof e=="object"&&!e[he])return;const t=e[he]&&e.key,i=c&&t!=null&&c.get(t);d!=l&&d===i?m.delete(d):d=d==l?l:d.nextSibling;const a=c?i:d;let f=a;if(e[he])f=Ce(e,a,o,s,r);else{const t=e+"";!(f instanceof Text)||f instanceof fe?f=new Text(t):f.data!=t&&(f.data=t)}f!=d&&(c&&m.delete(f),!a||c?(n.insertBefore(f,d),c&&d!=l&&m.add(d)):a==l?n.insertBefore(f,l):(n.replaceChild(f,a),d=f)),t!=null&&(u=u||new Map,u.set(t,f))})),d=d==l?l:d.nextSibling,t&&d!=l)for(;d!=l;){const e=d;d=d.nextSibling,e.remove()}return m&&m.forEach((e=>e.remove())),i.keyes=u,i}function ve(e,t,n,o,s){for(const r in t)!(r in n)&&we(e,r,t[r],null,s,o);for(const r in n)we(e,r,t[r],n[r],s,o)}function we(e,t,n,o,s,r){if(t=t=="class"&&!s?"className":t,n=n??null,o=o??null,t in e&&le[t]&&(n=e[t]),!(o===n||ue[t]||t[0]=="_"))if(t[0]=="o"&&t[1]=="n"&&(k(o)||k(n)))je(e,t.slice(2),o,r);else if(t=="ref")o&&(k(o)?o(e):o.current=e);else if(t=="style"){const{style:t}=e;n=n||"",o=o||"";const s=T(n),r=T(o);if(s)for(const e in n)if(r)!(e in o)&&Se(t,e,null);else break;if(r)for(const e in o){const r=o[e];s&&n[e]===r||Se(t,e,r)}else t.cssText=o}else{const r=t[0]=="$"?t.slice(1):t;r===t&&(!s&&!ce[t]&&t in e||k(o)||k(n))?e[t]=o??"":o==null?e.removeAttribute(r):e.setAttribute(r,T(o)?JSON.stringify(o):o)}}function je(e,t,n,o){if(o.handleEvent||(o.handleEvent=t=>o[t.type].call(e,t)),n){if(!o[t]){const s=n.capture||n.once||n.passive?Object.assign({},n):null;e.addEventListener(t,o,s)}o[t]=n}else o[t]&&(e.removeEventListener(t,o),delete o[t])}function Se(e,t,n){let o="setProperty";n==null&&(o="removeProperty",n=null),~t.indexOf("-")?e[o](t,n):e[t]=n}const De={};function ke(e,...t){const n=(e.raw||e).reduce(((e,n,o)=>e+n+(t[o]||"")),"");return De[n]=De[n]||Te(n)}function Te(e){if(ae.sheet){const t=new CSSStyleSheet;return t.replaceSync(e),t}else{const t=document.createElement("style");return t.textContent=e,t}}const Ae=Ee("host",{style:"display: contents"}),Pe=S("atomico/context"),$e=(e,t)=>{const n=B();ee((()=>N(n.current,"ConnectContext",(n=>{e===n.detail.id&&(n.stopPropagation(),n.detail.connect(t))}))),[e])},Ne=e=>{const t=re("ConnectContext",{bubbles:!0,composed:!0}),n=()=>{let n;return t({id:e,connect(e){n=e}}),n},[o,s]=ne(n);return X((()=>{o||(e[Pe]||(e[Pe]=customElements.whenDefined((new e).localName)),e[Pe].then((()=>s(n))))}),[e]),o},Oe=e=>{const t=Ne(e),n=w();return X((()=>{if(t)return N(t,"UpdatedValue",n)}),[t]),(t||e).value},Ie=e=>{const t=Y((()=>($e(t,B().current),Ae)),{props:{value:{type:Object,event:{type:"UpdatedValue"},value:()=>e}}});return t.value=e,t},Me=(e,t,n)=>(t==null?t={key:n}:t.key=n,Ee(e,t)),ze=Me,Fe=ke`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`,Le=ke`.vh{position:absolute;transform:scale(0)}`;function Re(){return Ke.from(new Date)}function Ge(e,t=0){const n=Ze(e),o=n.getUTCDay(),s=(o<t?7:0)+o-t;return n.setUTCDate(n.getUTCDate()-s),Ke.from(n)}function He(e,t=0){return Ge(e,t).add({days:6})}function Ve(e){return Ke.from(new Date(Date.UTC(e.year,e.month,0)))}function Ue(e,t,n){return t&&Ke.compare(e,t)<0?t:n&&Ke.compare(e,n)>0?n:e}const Je={days:1};function We(e,t=0){let n=Ge(e.toPlainDate(),t);const o=He(Ve(e),t),s=[];for(;Ke.compare(n,o)<0;){const e=[];for(let t=0;t<7;t++)e.push(n),n=n.add(Je);s.push(e)}return s}function Ze(e){return new Date(Date.UTC(e.year,e.month-1,e.day??1))}const _e=/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/,Ye=(e,t)=>e.toString().padStart(t,"0");class Ke{constructor(e,t,n){this.year=e,this.month=t,this.day=n}add(e){const t=Ze(this);if("days"in e)return t.setUTCDate(this.day+e.days),Ke.from(t);let{year:n,month:o}=this;"months"in e?(o=this.month+e.months,t.setUTCMonth(o-1)):(n=this.year+e.years,t.setUTCFullYear(n));const s=Ke.from(Ze({year:n,month:o,day:1}));return Ue(Ke.from(t),s,Ve(s))}toString(){return`${Ye(this.year,4)}-${Ye(this.month,2)}-${Ye(this.day,2)}`}toPlainYearMonth(){return new Qe(this.year,this.month)}equals(e){return Ke.compare(this,e)===0}static compare(e,t){return e.year<t.year?-1:e.year>t.year?1:e.month<t.month?-1:e.month>t.month?1:e.day<t.day?-1:e.day>t.day?1:0}static from(e){if(typeof e=="string"){const t=e.match(_e);if(!t)throw new TypeError(e);const[,n,o,s]=t;return new Ke(parseInt(n,10),parseInt(o,10),parseInt(s,10))}return new Ke(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate())}}class Qe{constructor(e,t){this.year=e,this.month=t}add(e){const t=Ze(this),n=(e.months??0)+(e.years??0)*12;return t.setUTCMonth(t.getUTCMonth()+n),new Qe(t.getUTCFullYear(),t.getUTCMonth()+1)}equals(e){return this.year===e.year&&this.month===e.month}toPlainDate(){return new Ke(this.year,this.month,1)}}function Xe(e,t){if(t)try{return e.from(t)}catch{}}function et(e){const[t,n]=se(e);return[oe((()=>Xe(Ke,t)),[t]),e=>n(e?.toString())]}function tt(e){const[t="",n]=se(e);return[oe((()=>{const[e,n]=t.split("/"),o=Xe(Ke,e),s=Xe(Ke,n);return o&&s?[o,s]:[]}),[t]),e=>n(`${e[0]}/${e[1]}`)]}function nt(e){const[t="",n]=se(e);return[oe((()=>{const e=[];for(const n of t.trim().split(/\s+/)){const t=Xe(Ke,n);t&&e.push(t)}return e}),[t]),e=>n(e.join(" "))]}function ot(e,t){return oe((()=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e})),[t,e])}function st(e,t,n){const o=ot(e,n);return oe((()=>{const e=[],n=new Date;for(var s=0;s<7;s++){const s=(n.getUTCDay()-t+7)%7;e[s]=o.format(n),n.setUTCDate(n.getUTCDate()+1)}return e}),[t,o])}const rt=(e,t,n)=>Ue(e,t,n)===e,it=e=>e.target.matches(":dir(ltr)"),at={month:"long",day:"numeric"},lt={month:"long"},ct={weekday:"narrow"},ut={weekday:"long"},mt={bubbles:!0};function dt({props:e,context:t}){const{offset:n}=e,{firstDayOfWeek:o,isDateDisallowed:s,min:r,max:i,page:a,locale:l,focusedDate:c}=t,u=Re(),m=st(ut,o,l),d=st(ct,o,l),f=ot(at,l),p=ot(lt,l),h=oe((()=>a.start.add({months:n})),[a,n]),b=oe((()=>We(h,o)),[h,o]),y=re("focusday",mt),q=re("selectday",mt),g=re("hoverday",mt);function E(e){y(Ue(e,r,i))}function C(e){let t;switch(e.key){case"ArrowRight":t=c.add({days:it(e)?1:-1});break;case"ArrowLeft":t=c.add({days:it(e)?-1:1});break;case"ArrowDown":t=c.add({days:7});break;case"ArrowUp":t=c.add({days:-7});break;case"PageUp":t=c.add(e.shiftKey?{years:-1}:{months:-1});break;case"PageDown":t=c.add(e.shiftKey?{years:1}:{months:1});break;case"Home":t=Ge(c,o);break;case"End":t=He(c,o);break;default:return}E(t),e.preventDefault()}function x(e){const n=h.equals(e);if(!t.showOutsideDays&&!n)return;const o=e.equals(c),a=e.equals(u),l=Ze(e),m=s?.(l),d=!rt(e,r,i);let p="",b;if(t.type==="range"){const[n,o]=t.value,s=n?.equals(e),r=o?.equals(e);b=n&&o&&rt(e,n,o),p=`${s?"range-start":""} ${r?"range-end":""} ${b&&!s&&!r?"range-inner":""}`}else t.type==="multi"?b=t.value.some((t=>t.equals(e))):b=t.value?.equals(e);return{part:`${`button day ${n?b?"selected":"":"outside"} ${m?"disallowed":""} ${a?"today":""}`} ${p}`,tabindex:n&&o?0:-1,disabled:d,"aria-disabled":m?"true":void 0,"aria-pressed":n&&b,"aria-current":a?"date":void 0,"aria-label":f.format(l),onkeydown:C,onclick(){m||q(e),E(e)},onmouseover(){!m&&!d&&g(e)}}}return{weeks:b,yearMonth:h,daysLong:m,daysShort:d,formatter:p,getDayProps:x}}const ft=Re(),pt=Ie({type:"date",firstDayOfWeek:1,isDateDisallowed:()=>!1,focusedDate:ft,page:{start:ft.toPlainYearMonth(),end:ft.toPlainYearMonth()}});customElements.define("calendar-month-ctx",pt);const ht=Y((e=>{const t=Oe(pt),n=x(),o=dt({props:e,context:t});function s(){n.current.querySelector("button[tabindex='0']")?.focus()}return ze("host",{shadowDom:!0,focus:s,children:[Me("div",{id:"h",part:"heading",children:o.formatter.format(Ze(o.yearMonth))}),ze("table",{ref:n,"aria-labelledby":"h",part:"table",children:[Me("thead",{children:Me("tr",{part:"tr head",children:o.daysLong.map(((e,t)=>ze("th",{part:"th",scope:"col",children:[Me("span",{class:"vh",children:e}),Me("span",{"aria-hidden":"true",children:o.daysShort[t]})]})))})}),Me("tbody",{children:o.weeks.map(((e,t)=>Me("tr",{part:"tr week",children:e.map(((e,t)=>{const n=o.getDayProps(e);return Me("td",{part:"td",children:n&&Me("button",{...n,children:e.day})},t)}))},t)))})]})]})}),{props:{offset:{type:Number,value:0}},styles:[Fe,Le,ke`:host{--color-accent: black;--color-text-on-accent: white;display:flex;flex-direction:column;gap:.25rem;text-align:center;inline-size:fit-content}table{border-collapse:collapse;font-size:.875rem}th{font-weight:700;block-size:2.25rem}td{padding-inline:0}button{color:inherit;font-size:inherit;background:transparent;border:0;font-variant-numeric:tabular-nums;block-size:2.25rem;inline-size:2.25rem}button:hover:where(:not(:disabled,[aria-disabled])){background:#0000000d}button:is([aria-pressed=true],:focus-visible){background:var(--color-accent);color:var(--color-text-on-accent)}button:focus-visible{outline:1px solid var(--color-text-on-accent);outline-offset:-2px}button:disabled,:host::part(outside),:host::part(disallowed){cursor:default;opacity:.5}`]});customElements.define("calendar-month",ht);function bt(e){return Me("button",{part:`button ${e.name} ${e.onclick?"":"disabled"}`,onclick:e.onclick,"aria-disabled":e.onclick?null:"true",children:Me("slot",{name:e.name,children:e.children})})}function yt(e){const t=Ze(e.page.start),n=Ze(e.page.end);return ze("div",{role:"group","aria-labelledby":"h",part:"container",children:[Me("div",{id:"h",class:"vh","aria-live":"polite","aria-atomic":"true",children:e.formatVerbose.formatRange(t,n)}),ze("div",{part:"header",children:[Me(bt,{name:"previous",onclick:e.previous,children:"Previous"}),Me("slot",{part:"heading",name:"heading",children:Me("div",{"aria-hidden":"true",children:e.format.formatRange(t,n)})}),Me(bt,{name:"next",onclick:e.next,children:"Next"})]}),Me(pt,{value:e,onselectday:e.onSelect,onfocusday:e.onFocus,onhoverday:e.onHover,children:Me("slot",{})})]})}const qt={value:{type:String,value:""},min:{type:String,value:""},max:{type:String,value:""},isDateDisallowed:{type:Function,value:e=>!1},firstDayOfWeek:{type:Number,value:()=>1},showOutsideDays:{type:Boolean,value:!1},locale:{type:String,value:()=>{}},months:{type:Number,value:1},focusedDate:{type:String,value:()=>{}},pageBy:{type:String,value:()=>"months"}},gt=[Fe,Le,ke`:host{display:block;inline-size:fit-content}[role=group]{display:flex;flex-direction:column;gap:1em}:host::part(header){display:flex;align-items:center;justify-content:space-between}:host::part(heading){font-weight:700;font-size:1.25em}button{display:flex;align-items:center;justify-content:center}button[aria-disabled]{cursor:default;opacity:.5}`],Et={year:"numeric"},Ct={year:"numeric",month:"long"};function xt(e,t){return(t.year-e.year)*12+t.month-e.month}const Bt=(e,t)=>(e=t===12?new Qe(e.year,1):e,{start:e,end:e.add({months:t-1})});function vt({pageBy:e,focusedDate:t,months:n,max:o,min:s,goto:r}){const i=e==="single"?1:n,[a,l]=ne((()=>Bt(t.toPlainYearMonth(),n))),c=e=>l(Bt(a.start.add({months:e}),n)),u=e=>{const t=xt(a.start,e.toPlainYearMonth());return t>=0&&t<n};return X((()=>{if(u(t))return;const e=xt(t.toPlainYearMonth(),a.start);r(t.add({months:e}))}),[a.start]),X((()=>{if(u(t))return;const e=xt(a.start,t.toPlainYearMonth());c(e===-1?-i:e===n?i:Math.floor(e/n)*n)}),[t,i,n]),{page:a,previous:!s||!u(s)?()=>c(-i):void 0,next:!o||!u(o)?()=>c(i):void 0}}function wt({months:e,pageBy:t,locale:n,focusedDate:o,setFocusedDate:s}){const[r]=et("min"),[i]=et("max"),a=re("focusday"),l=re("change"),c=oe((()=>Ue(o??Re(),r,i)),[o,r,i]);function u(e){s(e),a(Ze(e))}const{next:m,previous:d,page:f}=vt({pageBy:t,focusedDate:c,months:e,min:r,max:i,goto:u}),p=B();function h(){p.current.querySelectorAll("calendar-month").forEach((e=>e.focus()))}return{format:ot(Et,n),formatVerbose:ot(Ct,n),page:f,focusedDate:c,dispatch:l,onFocus(e){e.stopPropagation(),u(e.detail),setTimeout(h)},min:r,max:i,next:m,previous:d,focus:h}}const jt=Y((e=>{const[t,n]=et("value"),[o=t,s]=et("focusedDate"),r=wt({...e,focusedDate:o,setFocusedDate:s});function i(e){n(e.detail),r.dispatch()}return Me("host",{shadowDom:!0,focus:r.focus,children:Me(yt,{...e,...r,type:"date",value:t,onSelect:i})})}),{props:qt,styles:gt});customElements.define("calendar-date",jt);const St=(e,t)=>Ke.compare(e,t)<0?[e,t]:[t,e],Dt=Y((e=>{const[t,n]=tt("value"),[o=t[0],s]=et("focusedDate"),r=wt({...e,focusedDate:o,setFocusedDate:s}),i=re("rangestart"),a=re("rangeend"),[l,c]=et("tentative"),[u,m]=ne();X((()=>m(void 0)),[l]);function d(e){r.onFocus(e),f(e)}function f(e){e.stopPropagation(),l&&m(e.detail)}function p(e){const t=e.detail;e.stopPropagation(),l?(n(St(l,t)),c(void 0),a(Ze(t)),r.dispatch()):(c(t),i(Ze(t)))}const h=l?St(l,u??l):t;return Me("host",{shadowDom:!0,focus:r.focus,children:Me(yt,{...e,...r,type:"range",value:h,onFocus:d,onHover:f,onSelect:p})})}),{props:{...qt,tentative:{type:String,value:""}},styles:gt});customElements.define("calendar-range",Dt);const kt=Y((e=>{const[t,n]=nt("value"),[o=t[0],s]=et("focusedDate"),r=wt({...e,focusedDate:o,setFocusedDate:s});function i(e){const o=[...t],s=t.findIndex((t=>t.equals(e.detail)));s<0?o.push(e.detail):o.splice(s,1),n(o),r.dispatch()}return Me("host",{shadowDom:!0,focus:r.focus,children:Me(yt,{...e,...r,type:"multi",value:t,onSelect:i})})}),{props:qt,styles:gt});customElements.define("calendar-multi",kt);const Tt=(e,t)=>{let n=e.length;const o=new Array(t);const s=new Array(n);if(t>n)throw new RangeError("getRandom: more elements taken than available");while(t--){const r=Date.now()%n;o[t]=e[r in s?s[r]:r];s[r]=--n in s?s[n]:n}return o};const At=e=>{if(o(e)){return true}else if("size"in e){return!n(e.size)}else{return!n(Object.values(e).length)}};export{Tt as getRandomFromArray,At as isEmpty};
|
|
1251
6
|
//# sourceMappingURL=index.js.map
|