@cal.macconnachie/web-components 0.0.20 → 1.0.1
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 +3 -0
- package/dist/components/{auth.js → auth-form.js} +689 -805
- package/dist/components/base-button.js +894 -0
- package/dist/components/base-card.js +879 -0
- package/dist/components/base-date-picker.js +1458 -0
- package/dist/components/base-datetime-picker.js +1697 -0
- package/dist/components/base-drawer.js +1300 -0
- package/dist/components/base-input.js +883 -0
- package/dist/components/base-select.js +1076 -0
- package/dist/components/base-tab.js +653 -0
- package/dist/components/base-tabs.js +1246 -0
- package/dist/components/base-textarea.js +921 -0
- package/dist/components/base-time-picker.js +1141 -0
- package/dist/components/favicon.ico +0 -0
- package/dist/components/index.d.ts +399 -33
- package/dist/components/quantity-select.js +859 -0
- package/dist/components/theme-toggle.js +185 -165
- package/dist/favicon.ico +0 -0
- package/dist/index.d.ts +399 -33
- package/dist/index.js +7365 -2352
- package/dist/stylesheets/main.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,1458 @@
|
|
|
1
|
+
const U = globalThis, B = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, L = Symbol(), J = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let ae = class {
|
|
3
|
+
constructor(e, t, r) {
|
|
4
|
+
if (this._$cssResult$ = !0, r !== L) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
|
+
this.cssText = e, this.t = t;
|
|
6
|
+
}
|
|
7
|
+
get styleSheet() {
|
|
8
|
+
let e = this.o;
|
|
9
|
+
const t = this.t;
|
|
10
|
+
if (B && e === void 0) {
|
|
11
|
+
const r = t !== void 0 && t.length === 1;
|
|
12
|
+
r && (e = J.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), r && J.set(t, e));
|
|
13
|
+
}
|
|
14
|
+
return e;
|
|
15
|
+
}
|
|
16
|
+
toString() {
|
|
17
|
+
return this.cssText;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const pe = (s) => new ae(typeof s == "string" ? s : s + "", void 0, L), ue = (s, ...e) => {
|
|
21
|
+
const t = s.length === 1 ? s[0] : e.reduce(((r, i, a) => r + ((o) => {
|
|
22
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
|
+
if (typeof o == "number") return o;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(i) + s[a + 1]), s[0]);
|
|
26
|
+
return new ae(t, s, L);
|
|
27
|
+
}, ge = (s, e) => {
|
|
28
|
+
if (B) s.adoptedStyleSheets = e.map(((t) => t instanceof CSSStyleSheet ? t : t.styleSheet));
|
|
29
|
+
else for (const t of e) {
|
|
30
|
+
const r = document.createElement("style"), i = U.litNonce;
|
|
31
|
+
i !== void 0 && r.setAttribute("nonce", i), r.textContent = t.cssText, s.appendChild(r);
|
|
32
|
+
}
|
|
33
|
+
}, G = B ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((e) => {
|
|
34
|
+
let t = "";
|
|
35
|
+
for (const r of e.cssRules) t += r.cssText;
|
|
36
|
+
return pe(t);
|
|
37
|
+
})(s) : s;
|
|
38
|
+
const { is: ye, defineProperty: ve, getOwnPropertyDescriptor: me, getOwnPropertyNames: fe, getOwnPropertySymbols: $e, getPrototypeOf: be } = Object, Y = globalThis, Z = Y.trustedTypes, _e = Z ? Z.emptyScript : "", we = Y.reactiveElementPolyfillSupport, M = (s, e) => s, H = { toAttribute(s, e) {
|
|
39
|
+
switch (e) {
|
|
40
|
+
case Boolean:
|
|
41
|
+
s = s ? _e : null;
|
|
42
|
+
break;
|
|
43
|
+
case Object:
|
|
44
|
+
case Array:
|
|
45
|
+
s = s == null ? s : JSON.stringify(s);
|
|
46
|
+
}
|
|
47
|
+
return s;
|
|
48
|
+
}, fromAttribute(s, e) {
|
|
49
|
+
let t = s;
|
|
50
|
+
switch (e) {
|
|
51
|
+
case Boolean:
|
|
52
|
+
t = s !== null;
|
|
53
|
+
break;
|
|
54
|
+
case Number:
|
|
55
|
+
t = s === null ? null : Number(s);
|
|
56
|
+
break;
|
|
57
|
+
case Object:
|
|
58
|
+
case Array:
|
|
59
|
+
try {
|
|
60
|
+
t = JSON.parse(s);
|
|
61
|
+
} catch {
|
|
62
|
+
t = null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return t;
|
|
66
|
+
} }, F = (s, e) => !ye(s, e), X = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: F };
|
|
67
|
+
Symbol.metadata ??= Symbol("metadata"), Y.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let k = class extends HTMLElement {
|
|
69
|
+
static addInitializer(e) {
|
|
70
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
71
|
+
}
|
|
72
|
+
static get observedAttributes() {
|
|
73
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
74
|
+
}
|
|
75
|
+
static createProperty(e, t = X) {
|
|
76
|
+
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
77
|
+
const r = Symbol(), i = this.getPropertyDescriptor(e, r, t);
|
|
78
|
+
i !== void 0 && ve(this.prototype, e, i);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
static getPropertyDescriptor(e, t, r) {
|
|
82
|
+
const { get: i, set: a } = me(this.prototype, e) ?? { get() {
|
|
83
|
+
return this[t];
|
|
84
|
+
}, set(o) {
|
|
85
|
+
this[t] = o;
|
|
86
|
+
} };
|
|
87
|
+
return { get: i, set(o) {
|
|
88
|
+
const l = i?.call(this);
|
|
89
|
+
a?.call(this, o), this.requestUpdate(e, l, r);
|
|
90
|
+
}, configurable: !0, enumerable: !0 };
|
|
91
|
+
}
|
|
92
|
+
static getPropertyOptions(e) {
|
|
93
|
+
return this.elementProperties.get(e) ?? X;
|
|
94
|
+
}
|
|
95
|
+
static _$Ei() {
|
|
96
|
+
if (this.hasOwnProperty(M("elementProperties"))) return;
|
|
97
|
+
const e = be(this);
|
|
98
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
99
|
+
}
|
|
100
|
+
static finalize() {
|
|
101
|
+
if (this.hasOwnProperty(M("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
|
|
103
|
+
const t = this.properties, r = [...fe(t), ...$e(t)];
|
|
104
|
+
for (const i of r) this.createProperty(i, t[i]);
|
|
105
|
+
}
|
|
106
|
+
const e = this[Symbol.metadata];
|
|
107
|
+
if (e !== null) {
|
|
108
|
+
const t = litPropertyMetadata.get(e);
|
|
109
|
+
if (t !== void 0) for (const [r, i] of t) this.elementProperties.set(r, i);
|
|
110
|
+
}
|
|
111
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const [t, r] of this.elementProperties) {
|
|
113
|
+
const i = this._$Eu(t, r);
|
|
114
|
+
i !== void 0 && this._$Eh.set(i, t);
|
|
115
|
+
}
|
|
116
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
117
|
+
}
|
|
118
|
+
static finalizeStyles(e) {
|
|
119
|
+
const t = [];
|
|
120
|
+
if (Array.isArray(e)) {
|
|
121
|
+
const r = new Set(e.flat(1 / 0).reverse());
|
|
122
|
+
for (const i of r) t.unshift(G(i));
|
|
123
|
+
} else e !== void 0 && t.push(G(e));
|
|
124
|
+
return t;
|
|
125
|
+
}
|
|
126
|
+
static _$Eu(e, t) {
|
|
127
|
+
const r = t.attribute;
|
|
128
|
+
return r === !1 ? void 0 : typeof r == "string" ? r : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
129
|
+
}
|
|
130
|
+
constructor() {
|
|
131
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
132
|
+
}
|
|
133
|
+
_$Ev() {
|
|
134
|
+
this._$ES = new Promise(((e) => this.enableUpdating = e)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((e) => e(this)));
|
|
135
|
+
}
|
|
136
|
+
addController(e) {
|
|
137
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
138
|
+
}
|
|
139
|
+
removeController(e) {
|
|
140
|
+
this._$EO?.delete(e);
|
|
141
|
+
}
|
|
142
|
+
_$E_() {
|
|
143
|
+
const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
|
|
144
|
+
for (const r of t.keys()) this.hasOwnProperty(r) && (e.set(r, this[r]), delete this[r]);
|
|
145
|
+
e.size > 0 && (this._$Ep = e);
|
|
146
|
+
}
|
|
147
|
+
createRenderRoot() {
|
|
148
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
+
return ge(e, this.constructor.elementStyles), e;
|
|
150
|
+
}
|
|
151
|
+
connectedCallback() {
|
|
152
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((e) => e.hostConnected?.()));
|
|
153
|
+
}
|
|
154
|
+
enableUpdating(e) {
|
|
155
|
+
}
|
|
156
|
+
disconnectedCallback() {
|
|
157
|
+
this._$EO?.forEach(((e) => e.hostDisconnected?.()));
|
|
158
|
+
}
|
|
159
|
+
attributeChangedCallback(e, t, r) {
|
|
160
|
+
this._$AK(e, r);
|
|
161
|
+
}
|
|
162
|
+
_$ET(e, t) {
|
|
163
|
+
const r = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, r);
|
|
164
|
+
if (i !== void 0 && r.reflect === !0) {
|
|
165
|
+
const a = (r.converter?.toAttribute !== void 0 ? r.converter : H).toAttribute(t, r.type);
|
|
166
|
+
this._$Em = e, a == null ? this.removeAttribute(i) : this.setAttribute(i, a), this._$Em = null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_$AK(e, t) {
|
|
170
|
+
const r = this.constructor, i = r._$Eh.get(e);
|
|
171
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
+
const a = r.getPropertyOptions(i), o = typeof a.converter == "function" ? { fromAttribute: a.converter } : a.converter?.fromAttribute !== void 0 ? a.converter : H;
|
|
173
|
+
this._$Em = i;
|
|
174
|
+
const l = o.fromAttribute(t, a.type);
|
|
175
|
+
this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
requestUpdate(e, t, r) {
|
|
179
|
+
if (e !== void 0) {
|
|
180
|
+
const i = this.constructor, a = this[e];
|
|
181
|
+
if (r ??= i.getPropertyOptions(e), !((r.hasChanged ?? F)(a, t) || r.useDefault && r.reflect && a === this._$Ej?.get(e) && !this.hasAttribute(i._$Eu(e, r)))) return;
|
|
182
|
+
this.C(e, t, r);
|
|
183
|
+
}
|
|
184
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
|
+
}
|
|
186
|
+
C(e, t, { useDefault: r, reflect: i, wrapped: a }, o) {
|
|
187
|
+
r && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), a !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || r || (t = void 0), this._$AL.set(e, t)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
188
|
+
}
|
|
189
|
+
async _$EP() {
|
|
190
|
+
this.isUpdatePending = !0;
|
|
191
|
+
try {
|
|
192
|
+
await this._$ES;
|
|
193
|
+
} catch (t) {
|
|
194
|
+
Promise.reject(t);
|
|
195
|
+
}
|
|
196
|
+
const e = this.scheduleUpdate();
|
|
197
|
+
return e != null && await e, !this.isUpdatePending;
|
|
198
|
+
}
|
|
199
|
+
scheduleUpdate() {
|
|
200
|
+
return this.performUpdate();
|
|
201
|
+
}
|
|
202
|
+
performUpdate() {
|
|
203
|
+
if (!this.isUpdatePending) return;
|
|
204
|
+
if (!this.hasUpdated) {
|
|
205
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
+
for (const [i, a] of this._$Ep) this[i] = a;
|
|
207
|
+
this._$Ep = void 0;
|
|
208
|
+
}
|
|
209
|
+
const r = this.constructor.elementProperties;
|
|
210
|
+
if (r.size > 0) for (const [i, a] of r) {
|
|
211
|
+
const { wrapped: o } = a, l = this[i];
|
|
212
|
+
o !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, a, l);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
let e = !1;
|
|
216
|
+
const t = this._$AL;
|
|
217
|
+
try {
|
|
218
|
+
e = this.shouldUpdate(t), e ? (this.willUpdate(t), this._$EO?.forEach(((r) => r.hostUpdate?.())), this.update(t)) : this._$EM();
|
|
219
|
+
} catch (r) {
|
|
220
|
+
throw e = !1, this._$EM(), r;
|
|
221
|
+
}
|
|
222
|
+
e && this._$AE(t);
|
|
223
|
+
}
|
|
224
|
+
willUpdate(e) {
|
|
225
|
+
}
|
|
226
|
+
_$AE(e) {
|
|
227
|
+
this._$EO?.forEach(((t) => t.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
228
|
+
}
|
|
229
|
+
_$EM() {
|
|
230
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
231
|
+
}
|
|
232
|
+
get updateComplete() {
|
|
233
|
+
return this.getUpdateComplete();
|
|
234
|
+
}
|
|
235
|
+
getUpdateComplete() {
|
|
236
|
+
return this._$ES;
|
|
237
|
+
}
|
|
238
|
+
shouldUpdate(e) {
|
|
239
|
+
return !0;
|
|
240
|
+
}
|
|
241
|
+
update(e) {
|
|
242
|
+
this._$Eq &&= this._$Eq.forEach(((t) => this._$ET(t, this[t]))), this._$EM();
|
|
243
|
+
}
|
|
244
|
+
updated(e) {
|
|
245
|
+
}
|
|
246
|
+
firstUpdated(e) {
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
k.elementStyles = [], k.shadowRootOptions = { mode: "open" }, k[M("elementProperties")] = /* @__PURE__ */ new Map(), k[M("finalized")] = /* @__PURE__ */ new Map(), we?.({ ReactiveElement: k }), (Y.reactiveElementVersions ??= []).push("2.1.1");
|
|
250
|
+
const q = globalThis, N = q.trustedTypes, Q = N ? N.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, oe = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, ne = "?" + $, Ae = `<${ne}>`, w = document, D = () => w.createComment(""), T = (s) => s === null || typeof s != "object" && typeof s != "function", V = Array.isArray, Se = (s) => V(s) || typeof s?.[Symbol.iterator] == "function", I = `[
|
|
251
|
+
\f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ee = /-->/g, te = />/g, b = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), re = /'/g, se = /"/g, le = /^(?:script|style|textarea|title)$/i, xe = (s) => (e, ...t) => ({ _$litType$: s, strings: e, values: t }), y = xe(1), A = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), ie = /* @__PURE__ */ new WeakMap(), _ = w.createTreeWalker(w, 129);
|
|
253
|
+
function ce(s, e) {
|
|
254
|
+
if (!V(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
+
return Q !== void 0 ? Q.createHTML(e) : e;
|
|
256
|
+
}
|
|
257
|
+
const ke = (s, e) => {
|
|
258
|
+
const t = s.length - 1, r = [];
|
|
259
|
+
let i, a = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = C;
|
|
260
|
+
for (let l = 0; l < t; l++) {
|
|
261
|
+
const n = s[l];
|
|
262
|
+
let u, g, c = -1, m = 0;
|
|
263
|
+
for (; m < n.length && (o.lastIndex = m, g = o.exec(n), g !== null); ) m = o.lastIndex, o === C ? g[1] === "!--" ? o = ee : g[1] !== void 0 ? o = te : g[2] !== void 0 ? (le.test(g[2]) && (i = RegExp("</" + g[2], "g")), o = b) : g[3] !== void 0 && (o = b) : o === b ? g[0] === ">" ? (o = i ?? C, c = -1) : g[1] === void 0 ? c = -2 : (c = o.lastIndex - g[2].length, u = g[1], o = g[3] === void 0 ? b : g[3] === '"' ? se : re) : o === se || o === re ? o = b : o === ee || o === te ? o = C : (o = b, i = void 0);
|
|
264
|
+
const f = o === b && s[l + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
a += o === C ? n + Ae : c >= 0 ? (r.push(u), n.slice(0, c) + oe + n.slice(c) + $ + f) : n + $ + (c === -2 ? l : f);
|
|
266
|
+
}
|
|
267
|
+
return [ce(s, a + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), r];
|
|
268
|
+
};
|
|
269
|
+
class O {
|
|
270
|
+
constructor({ strings: e, _$litType$: t }, r) {
|
|
271
|
+
let i;
|
|
272
|
+
this.parts = [];
|
|
273
|
+
let a = 0, o = 0;
|
|
274
|
+
const l = e.length - 1, n = this.parts, [u, g] = ke(e, t);
|
|
275
|
+
if (this.el = O.createElement(u, r), _.currentNode = this.el.content, t === 2 || t === 3) {
|
|
276
|
+
const c = this.el.content.firstChild;
|
|
277
|
+
c.replaceWith(...c.childNodes);
|
|
278
|
+
}
|
|
279
|
+
for (; (i = _.nextNode()) !== null && n.length < l; ) {
|
|
280
|
+
if (i.nodeType === 1) {
|
|
281
|
+
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(oe)) {
|
|
282
|
+
const m = g[o++], f = i.getAttribute(c).split($), z = /([.?@])?(.*)/.exec(m);
|
|
283
|
+
n.push({ type: 1, index: a, name: z[2], strings: f, ctor: z[1] === "." ? Ce : z[1] === "?" ? Me : z[1] === "@" ? Pe : j }), i.removeAttribute(c);
|
|
284
|
+
} else c.startsWith($) && (n.push({ type: 6, index: a }), i.removeAttribute(c));
|
|
285
|
+
if (le.test(i.tagName)) {
|
|
286
|
+
const c = i.textContent.split($), m = c.length - 1;
|
|
287
|
+
if (m > 0) {
|
|
288
|
+
i.textContent = N ? N.emptyScript : "";
|
|
289
|
+
for (let f = 0; f < m; f++) i.append(c[f], D()), _.nextNode(), n.push({ type: 2, index: ++a });
|
|
290
|
+
i.append(c[m], D());
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
} else if (i.nodeType === 8) if (i.data === ne) n.push({ type: 2, index: a });
|
|
294
|
+
else {
|
|
295
|
+
let c = -1;
|
|
296
|
+
for (; (c = i.data.indexOf($, c + 1)) !== -1; ) n.push({ type: 7, index: a }), c += $.length - 1;
|
|
297
|
+
}
|
|
298
|
+
a++;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
static createElement(e, t) {
|
|
302
|
+
const r = w.createElement("template");
|
|
303
|
+
return r.innerHTML = e, r;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function E(s, e, t = s, r) {
|
|
307
|
+
if (e === A) return e;
|
|
308
|
+
let i = r !== void 0 ? t._$Co?.[r] : t._$Cl;
|
|
309
|
+
const a = T(e) ? void 0 : e._$litDirective$;
|
|
310
|
+
return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(s), i._$AT(s, t, r)), r !== void 0 ? (t._$Co ??= [])[r] = i : t._$Cl = i), i !== void 0 && (e = E(s, i._$AS(s, e.values), i, r)), e;
|
|
311
|
+
}
|
|
312
|
+
class Ee {
|
|
313
|
+
constructor(e, t) {
|
|
314
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
315
|
+
}
|
|
316
|
+
get parentNode() {
|
|
317
|
+
return this._$AM.parentNode;
|
|
318
|
+
}
|
|
319
|
+
get _$AU() {
|
|
320
|
+
return this._$AM._$AU;
|
|
321
|
+
}
|
|
322
|
+
u(e) {
|
|
323
|
+
const { el: { content: t }, parts: r } = this._$AD, i = (e?.creationScope ?? w).importNode(t, !0);
|
|
324
|
+
_.currentNode = i;
|
|
325
|
+
let a = _.nextNode(), o = 0, l = 0, n = r[0];
|
|
326
|
+
for (; n !== void 0; ) {
|
|
327
|
+
if (o === n.index) {
|
|
328
|
+
let u;
|
|
329
|
+
n.type === 2 ? u = new R(a, a.nextSibling, this, e) : n.type === 1 ? u = new n.ctor(a, n.name, n.strings, this, e) : n.type === 6 && (u = new De(a, this, e)), this._$AV.push(u), n = r[++l];
|
|
330
|
+
}
|
|
331
|
+
o !== n?.index && (a = _.nextNode(), o++);
|
|
332
|
+
}
|
|
333
|
+
return _.currentNode = w, i;
|
|
334
|
+
}
|
|
335
|
+
p(e) {
|
|
336
|
+
let t = 0;
|
|
337
|
+
for (const r of this._$AV) r !== void 0 && (r.strings !== void 0 ? (r._$AI(e, r, t), t += r.strings.length - 2) : r._$AI(e[t])), t++;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
class R {
|
|
341
|
+
get _$AU() {
|
|
342
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
343
|
+
}
|
|
344
|
+
constructor(e, t, r, i) {
|
|
345
|
+
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = r, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
346
|
+
}
|
|
347
|
+
get parentNode() {
|
|
348
|
+
let e = this._$AA.parentNode;
|
|
349
|
+
const t = this._$AM;
|
|
350
|
+
return t !== void 0 && e?.nodeType === 11 && (e = t.parentNode), e;
|
|
351
|
+
}
|
|
352
|
+
get startNode() {
|
|
353
|
+
return this._$AA;
|
|
354
|
+
}
|
|
355
|
+
get endNode() {
|
|
356
|
+
return this._$AB;
|
|
357
|
+
}
|
|
358
|
+
_$AI(e, t = this) {
|
|
359
|
+
e = E(this, e, t), T(e) ? e === p || e == null || e === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : e !== this._$AH && e !== A && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Se(e) ? this.k(e) : this._(e);
|
|
360
|
+
}
|
|
361
|
+
O(e) {
|
|
362
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
363
|
+
}
|
|
364
|
+
T(e) {
|
|
365
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
366
|
+
}
|
|
367
|
+
_(e) {
|
|
368
|
+
this._$AH !== p && T(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
369
|
+
}
|
|
370
|
+
$(e) {
|
|
371
|
+
const { values: t, _$litType$: r } = e, i = typeof r == "number" ? this._$AC(e) : (r.el === void 0 && (r.el = O.createElement(ce(r.h, r.h[0]), this.options)), r);
|
|
372
|
+
if (this._$AH?._$AD === i) this._$AH.p(t);
|
|
373
|
+
else {
|
|
374
|
+
const a = new Ee(i, this), o = a.u(this.options);
|
|
375
|
+
a.p(t), this.T(o), this._$AH = a;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
_$AC(e) {
|
|
379
|
+
let t = ie.get(e.strings);
|
|
380
|
+
return t === void 0 && ie.set(e.strings, t = new O(e)), t;
|
|
381
|
+
}
|
|
382
|
+
k(e) {
|
|
383
|
+
V(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
|
+
const t = this._$AH;
|
|
385
|
+
let r, i = 0;
|
|
386
|
+
for (const a of e) i === t.length ? t.push(r = new R(this.O(D()), this.O(D()), this, this.options)) : r = t[i], r._$AI(a), i++;
|
|
387
|
+
i < t.length && (this._$AR(r && r._$AB.nextSibling, i), t.length = i);
|
|
388
|
+
}
|
|
389
|
+
_$AR(e = this._$AA.nextSibling, t) {
|
|
390
|
+
for (this._$AP?.(!1, !0, t); e !== this._$AB; ) {
|
|
391
|
+
const r = e.nextSibling;
|
|
392
|
+
e.remove(), e = r;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
setConnected(e) {
|
|
396
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
class j {
|
|
400
|
+
get tagName() {
|
|
401
|
+
return this.element.tagName;
|
|
402
|
+
}
|
|
403
|
+
get _$AU() {
|
|
404
|
+
return this._$AM._$AU;
|
|
405
|
+
}
|
|
406
|
+
constructor(e, t, r, i, a) {
|
|
407
|
+
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = e, this.name = t, this._$AM = i, this.options = a, r.length > 2 || r[0] !== "" || r[1] !== "" ? (this._$AH = Array(r.length - 1).fill(new String()), this.strings = r) : this._$AH = p;
|
|
408
|
+
}
|
|
409
|
+
_$AI(e, t = this, r, i) {
|
|
410
|
+
const a = this.strings;
|
|
411
|
+
let o = !1;
|
|
412
|
+
if (a === void 0) e = E(this, e, t, 0), o = !T(e) || e !== this._$AH && e !== A, o && (this._$AH = e);
|
|
413
|
+
else {
|
|
414
|
+
const l = e;
|
|
415
|
+
let n, u;
|
|
416
|
+
for (e = a[0], n = 0; n < a.length - 1; n++) u = E(this, l[r + n], t, n), u === A && (u = this._$AH[n]), o ||= !T(u) || u !== this._$AH[n], u === p ? e = p : e !== p && (e += (u ?? "") + a[n + 1]), this._$AH[n] = u;
|
|
417
|
+
}
|
|
418
|
+
o && !i && this.j(e);
|
|
419
|
+
}
|
|
420
|
+
j(e) {
|
|
421
|
+
e === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
class Ce extends j {
|
|
425
|
+
constructor() {
|
|
426
|
+
super(...arguments), this.type = 3;
|
|
427
|
+
}
|
|
428
|
+
j(e) {
|
|
429
|
+
this.element[this.name] = e === p ? void 0 : e;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
class Me extends j {
|
|
433
|
+
constructor() {
|
|
434
|
+
super(...arguments), this.type = 4;
|
|
435
|
+
}
|
|
436
|
+
j(e) {
|
|
437
|
+
this.element.toggleAttribute(this.name, !!e && e !== p);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
class Pe extends j {
|
|
441
|
+
constructor(e, t, r, i, a) {
|
|
442
|
+
super(e, t, r, i, a), this.type = 5;
|
|
443
|
+
}
|
|
444
|
+
_$AI(e, t = this) {
|
|
445
|
+
if ((e = E(this, e, t, 0) ?? p) === A) return;
|
|
446
|
+
const r = this._$AH, i = e === p && r !== p || e.capture !== r.capture || e.once !== r.once || e.passive !== r.passive, a = e !== p && (r === p || i);
|
|
447
|
+
i && this.element.removeEventListener(this.name, this, r), a && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
448
|
+
}
|
|
449
|
+
handleEvent(e) {
|
|
450
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
class De {
|
|
454
|
+
constructor(e, t, r) {
|
|
455
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = r;
|
|
456
|
+
}
|
|
457
|
+
get _$AU() {
|
|
458
|
+
return this._$AM._$AU;
|
|
459
|
+
}
|
|
460
|
+
_$AI(e) {
|
|
461
|
+
E(this, e);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
const Te = q.litHtmlPolyfillSupport;
|
|
465
|
+
Te?.(O, R), (q.litHtmlVersions ??= []).push("3.3.1");
|
|
466
|
+
const Oe = (s, e, t) => {
|
|
467
|
+
const r = t?.renderBefore ?? e;
|
|
468
|
+
let i = r._$litPart$;
|
|
469
|
+
if (i === void 0) {
|
|
470
|
+
const a = t?.renderBefore ?? null;
|
|
471
|
+
r._$litPart$ = i = new R(e.insertBefore(D(), a), a, void 0, t ?? {});
|
|
472
|
+
}
|
|
473
|
+
return i._$AI(s), i;
|
|
474
|
+
};
|
|
475
|
+
const W = globalThis;
|
|
476
|
+
let P = class extends k {
|
|
477
|
+
constructor() {
|
|
478
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
|
+
}
|
|
480
|
+
createRenderRoot() {
|
|
481
|
+
const e = super.createRenderRoot();
|
|
482
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
483
|
+
}
|
|
484
|
+
update(e) {
|
|
485
|
+
const t = this.render();
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Oe(t, this.renderRoot, this.renderOptions);
|
|
487
|
+
}
|
|
488
|
+
connectedCallback() {
|
|
489
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
490
|
+
}
|
|
491
|
+
disconnectedCallback() {
|
|
492
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
|
+
}
|
|
494
|
+
render() {
|
|
495
|
+
return A;
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
P._$litElement$ = !0, P.finalized = !0, W.litElementHydrateSupport?.({ LitElement: P });
|
|
499
|
+
const Re = W.litElementPolyfillSupport;
|
|
500
|
+
Re?.({ LitElement: P });
|
|
501
|
+
(W.litElementVersions ??= []).push("4.2.1");
|
|
502
|
+
const ze = (s) => (e, t) => {
|
|
503
|
+
t !== void 0 ? t.addInitializer((() => {
|
|
504
|
+
customElements.define(s, e);
|
|
505
|
+
})) : customElements.define(s, e);
|
|
506
|
+
};
|
|
507
|
+
const Ue = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: F }, He = (s = Ue, e, t) => {
|
|
508
|
+
const { kind: r, metadata: i } = t;
|
|
509
|
+
let a = globalThis.litPropertyMetadata.get(i);
|
|
510
|
+
if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((s = Object.create(s)).wrapped = !0), a.set(t.name, s), r === "accessor") {
|
|
511
|
+
const { name: o } = t;
|
|
512
|
+
return { set(l) {
|
|
513
|
+
const n = e.get.call(this);
|
|
514
|
+
e.set.call(this, l), this.requestUpdate(o, n, s);
|
|
515
|
+
}, init(l) {
|
|
516
|
+
return l !== void 0 && this.C(o, void 0, s, l), l;
|
|
517
|
+
} };
|
|
518
|
+
}
|
|
519
|
+
if (r === "setter") {
|
|
520
|
+
const { name: o } = t;
|
|
521
|
+
return function(l) {
|
|
522
|
+
const n = this[o];
|
|
523
|
+
e.call(this, l), this.requestUpdate(o, n, s);
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
throw Error("Unsupported decorator location: " + r);
|
|
527
|
+
};
|
|
528
|
+
function v(s) {
|
|
529
|
+
return (e, t) => typeof t == "object" ? He(s, e, t) : ((r, i, a) => {
|
|
530
|
+
const o = i.hasOwnProperty(a);
|
|
531
|
+
return i.constructor.createProperty(a, r), o ? Object.getOwnPropertyDescriptor(i, a) : void 0;
|
|
532
|
+
})(s, e, t);
|
|
533
|
+
}
|
|
534
|
+
function S(s) {
|
|
535
|
+
return v({ ...s, state: !0, attribute: !1 });
|
|
536
|
+
}
|
|
537
|
+
const Ne = (s, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(s, e, t), t);
|
|
538
|
+
function de(s, e) {
|
|
539
|
+
return (t, r, i) => {
|
|
540
|
+
const a = (o) => o.renderRoot?.querySelector(s) ?? null;
|
|
541
|
+
return Ne(t, r, { get() {
|
|
542
|
+
return a(this);
|
|
543
|
+
} });
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const Ye = { ATTRIBUTE: 1 }, je = (s) => (...e) => ({ _$litDirective$: s, values: e });
|
|
547
|
+
class Ie {
|
|
548
|
+
constructor(e) {
|
|
549
|
+
}
|
|
550
|
+
get _$AU() {
|
|
551
|
+
return this._$AM._$AU;
|
|
552
|
+
}
|
|
553
|
+
_$AT(e, t, r) {
|
|
554
|
+
this._$Ct = e, this._$AM = t, this._$Ci = r;
|
|
555
|
+
}
|
|
556
|
+
_$AS(e, t) {
|
|
557
|
+
return this.update(e, t);
|
|
558
|
+
}
|
|
559
|
+
update(e, t) {
|
|
560
|
+
return this.render(...t);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
const x = je(class extends Ie {
|
|
564
|
+
constructor(s) {
|
|
565
|
+
if (super(s), s.type !== Ye.ATTRIBUTE || s.name !== "class" || s.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
566
|
+
}
|
|
567
|
+
render(s) {
|
|
568
|
+
return " " + Object.keys(s).filter(((e) => s[e])).join(" ") + " ";
|
|
569
|
+
}
|
|
570
|
+
update(s, [e]) {
|
|
571
|
+
if (this.st === void 0) {
|
|
572
|
+
this.st = /* @__PURE__ */ new Set(), s.strings !== void 0 && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter(((r) => r !== ""))));
|
|
573
|
+
for (const r in e) e[r] && !this.nt?.has(r) && this.st.add(r);
|
|
574
|
+
return this.render(e);
|
|
575
|
+
}
|
|
576
|
+
const t = s.element.classList;
|
|
577
|
+
for (const r of this.st) r in e || (t.remove(r), this.st.delete(r));
|
|
578
|
+
for (const r in e) {
|
|
579
|
+
const i = !!e[r];
|
|
580
|
+
i === this.st.has(r) || this.nt?.has(r) || (i ? (t.add(r), this.st.add(r)) : (t.remove(r), this.st.delete(r)));
|
|
581
|
+
}
|
|
582
|
+
return A;
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
const Be = (s) => s ?? p;
|
|
586
|
+
var Le = Object.defineProperty, he = (s, e, t, r) => {
|
|
587
|
+
for (var i = void 0, a = s.length - 1, o; a >= 0; a--)
|
|
588
|
+
(o = s[a]) && (i = o(e, t, i) || i);
|
|
589
|
+
return i && Le(e, t, i), i;
|
|
590
|
+
};
|
|
591
|
+
class K extends P {
|
|
592
|
+
constructor() {
|
|
593
|
+
super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.boundThemeChangeHandler = this.handleGlobalThemeChange.bind(this);
|
|
594
|
+
}
|
|
595
|
+
connectedCallback() {
|
|
596
|
+
super.connectedCallback();
|
|
597
|
+
const e = document.documentElement.getAttribute("data-theme"), t = localStorage.getItem(this.storageKey), r = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
598
|
+
e ? this.theme = e : t ? (this.theme = t, this.applyTheme()) : r ? (this.theme = "dark", this.applyTheme()) : this.applyTheme(), window.addEventListener("theme-changed", this.boundThemeChangeHandler);
|
|
599
|
+
}
|
|
600
|
+
disconnectedCallback() {
|
|
601
|
+
window.removeEventListener("theme-changed", this.boundThemeChangeHandler), super.disconnectedCallback();
|
|
602
|
+
}
|
|
603
|
+
handleGlobalThemeChange(e) {
|
|
604
|
+
const t = e;
|
|
605
|
+
t.target !== this && t.detail.theme !== this.theme && (this.theme = t.detail.theme);
|
|
606
|
+
}
|
|
607
|
+
applyTheme() {
|
|
608
|
+
document.documentElement.setAttribute("data-theme", this.theme), localStorage.setItem(this.storageKey, this.theme), this.dispatchEvent(
|
|
609
|
+
new CustomEvent("theme-changed", {
|
|
610
|
+
detail: { theme: this.theme },
|
|
611
|
+
bubbles: !0,
|
|
612
|
+
composed: !0
|
|
613
|
+
})
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
he([
|
|
618
|
+
v({ type: String, attribute: "data-theme", reflect: !0 })
|
|
619
|
+
], K.prototype, "theme");
|
|
620
|
+
he([
|
|
621
|
+
v({ type: String, attribute: "storage-key" })
|
|
622
|
+
], K.prototype, "storageKey");
|
|
623
|
+
var Fe = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, h = (s, e, t, r) => {
|
|
624
|
+
for (var i = r > 1 ? void 0 : r ? qe(e, t) : e, a = s.length - 1, o; a >= 0; a--)
|
|
625
|
+
(o = s[a]) && (i = (r ? o(e, t, i) : o(i)) || i);
|
|
626
|
+
return r && i && Fe(e, t, i), i;
|
|
627
|
+
};
|
|
628
|
+
let d = class extends K {
|
|
629
|
+
constructor() {
|
|
630
|
+
super(...arguments), this.value = "", this.placeholder = "Select a date", this.required = !1, this.disabled = !1, this.size = "md", this.isOpen = !1, this.currentMonth = (/* @__PURE__ */ new Date()).getMonth(), this.currentYear = (/* @__PURE__ */ new Date()).getFullYear(), this.showMonthPicker = !1, this.showYearPicker = !1, this.yearRangeStart = (/* @__PURE__ */ new Date()).getFullYear() - 5, this.isFlipped = !1, this.inputId = `date-picker-${Math.random().toString(36).substr(2, 9)}`, this.weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], this.monthNames = [
|
|
631
|
+
"Jan",
|
|
632
|
+
"Feb",
|
|
633
|
+
"Mar",
|
|
634
|
+
"Apr",
|
|
635
|
+
"May",
|
|
636
|
+
"Jun",
|
|
637
|
+
"Jul",
|
|
638
|
+
"Aug",
|
|
639
|
+
"Sep",
|
|
640
|
+
"Oct",
|
|
641
|
+
"Nov",
|
|
642
|
+
"Dec"
|
|
643
|
+
];
|
|
644
|
+
}
|
|
645
|
+
get displayValue() {
|
|
646
|
+
if (!this.value) return "";
|
|
647
|
+
const s = /* @__PURE__ */ new Date(this.value + "T00:00:00");
|
|
648
|
+
return isNaN(s.getTime()) ? this.value : s.toLocaleDateString("en-US", {
|
|
649
|
+
year: "numeric",
|
|
650
|
+
month: "long",
|
|
651
|
+
day: "numeric"
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
get currentMonthName() {
|
|
655
|
+
return new Date(this.currentYear, this.currentMonth).toLocaleDateString("en-US", { month: "long" });
|
|
656
|
+
}
|
|
657
|
+
get yearRangeEnd() {
|
|
658
|
+
return this.yearRangeStart + 11;
|
|
659
|
+
}
|
|
660
|
+
get yearRange() {
|
|
661
|
+
const s = [];
|
|
662
|
+
for (let e = this.yearRangeStart; e <= this.yearRangeEnd; e++)
|
|
663
|
+
s.push(e);
|
|
664
|
+
return s;
|
|
665
|
+
}
|
|
666
|
+
get calendarDays() {
|
|
667
|
+
const s = new Date(this.currentYear, this.currentMonth, 1), e = new Date(this.currentYear, this.currentMonth + 1, 0), t = s.getDay(), r = e.getDate(), i = [];
|
|
668
|
+
for (let a = 0; a < t; a++)
|
|
669
|
+
i.push(null);
|
|
670
|
+
for (let a = 1; a <= r; a++)
|
|
671
|
+
i.push(a);
|
|
672
|
+
for (; i.length < 42; )
|
|
673
|
+
i.push(null);
|
|
674
|
+
return i.slice(0, 42);
|
|
675
|
+
}
|
|
676
|
+
handleDisplayClick() {
|
|
677
|
+
this.disabled || this.toggleCalendar();
|
|
678
|
+
}
|
|
679
|
+
toggleCalendar() {
|
|
680
|
+
if (this.isOpen = !this.isOpen, this.isOpen && this.value) {
|
|
681
|
+
const s = /* @__PURE__ */ new Date(this.value + "T00:00:00");
|
|
682
|
+
isNaN(s.getTime()) || (this.currentMonth = s.getMonth(), this.currentYear = s.getFullYear());
|
|
683
|
+
}
|
|
684
|
+
this.isOpen && requestAnimationFrame(() => this.updateDropdownPosition());
|
|
685
|
+
}
|
|
686
|
+
updateDropdownPosition() {
|
|
687
|
+
if (!this.calendarContainer || !this.dateDisplay) return;
|
|
688
|
+
const s = this.dateDisplay.getBoundingClientRect(), e = 400, t = window.innerHeight - s.bottom, r = s.top;
|
|
689
|
+
this.isFlipped = t < e && r > t;
|
|
690
|
+
}
|
|
691
|
+
closeCalendar() {
|
|
692
|
+
this.isOpen = !1, this.showMonthPicker = !1, this.showYearPicker = !1, this.isFlipped = !1;
|
|
693
|
+
}
|
|
694
|
+
selectDate(s) {
|
|
695
|
+
const e = new Date(this.currentYear, this.currentMonth, s), t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getDate()).padStart(2, "0"), a = `${t}-${r}-${i}`, o = this.value;
|
|
696
|
+
this.value = a, this.dispatchEvent(
|
|
697
|
+
new CustomEvent("change", {
|
|
698
|
+
detail: { value: a, oldValue: o },
|
|
699
|
+
bubbles: !0,
|
|
700
|
+
composed: !0
|
|
701
|
+
})
|
|
702
|
+
), this.closeCalendar();
|
|
703
|
+
}
|
|
704
|
+
selectToday() {
|
|
705
|
+
const s = /* @__PURE__ */ new Date(), e = s.getFullYear(), t = String(s.getMonth() + 1).padStart(2, "0"), r = String(s.getDate()).padStart(2, "0"), i = `${e}-${t}-${r}`, a = this.value;
|
|
706
|
+
this.value = i, this.dispatchEvent(
|
|
707
|
+
new CustomEvent("change", {
|
|
708
|
+
detail: { value: i, oldValue: a },
|
|
709
|
+
bubbles: !0,
|
|
710
|
+
composed: !0
|
|
711
|
+
})
|
|
712
|
+
), this.closeCalendar();
|
|
713
|
+
}
|
|
714
|
+
previousMonth(s) {
|
|
715
|
+
s.stopPropagation(), this.currentMonth === 0 ? (this.currentMonth = 11, this.currentYear--) : this.currentMonth--;
|
|
716
|
+
}
|
|
717
|
+
nextMonth(s) {
|
|
718
|
+
s.stopPropagation(), this.currentMonth === 11 ? (this.currentMonth = 0, this.currentYear++) : this.currentMonth++;
|
|
719
|
+
}
|
|
720
|
+
isSelectedDate(s) {
|
|
721
|
+
if (!this.value) return !1;
|
|
722
|
+
const e = /* @__PURE__ */ new Date(this.value + "T00:00:00");
|
|
723
|
+
return e.getDate() === s && e.getMonth() === this.currentMonth && e.getFullYear() === this.currentYear;
|
|
724
|
+
}
|
|
725
|
+
isToday(s) {
|
|
726
|
+
const e = /* @__PURE__ */ new Date();
|
|
727
|
+
return e.getDate() === s && e.getMonth() === this.currentMonth && e.getFullYear() === this.currentYear;
|
|
728
|
+
}
|
|
729
|
+
isDisabled(s) {
|
|
730
|
+
const e = new Date(this.currentYear, this.currentMonth, s), t = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getDate()).padStart(2, "0"), a = `${t}-${r}-${i}`;
|
|
731
|
+
return !!(this.minDate && a < this.minDate || this.maxDate && a > this.maxDate);
|
|
732
|
+
}
|
|
733
|
+
selectMonth(s) {
|
|
734
|
+
this.currentMonth = s, this.showMonthPicker = !1;
|
|
735
|
+
}
|
|
736
|
+
selectYear(s) {
|
|
737
|
+
this.currentYear = s, this.showYearPicker = !1, (s < this.yearRangeStart || s > this.yearRangeEnd) && (this.yearRangeStart = s - 5);
|
|
738
|
+
}
|
|
739
|
+
yearRangeBack(s) {
|
|
740
|
+
s.stopPropagation(), this.yearRangeStart -= 12;
|
|
741
|
+
}
|
|
742
|
+
yearRangeForward(s) {
|
|
743
|
+
s.stopPropagation(), this.yearRangeStart += 12;
|
|
744
|
+
}
|
|
745
|
+
handleKeydown(s) {
|
|
746
|
+
if (!this.disabled)
|
|
747
|
+
switch (s.key) {
|
|
748
|
+
case "Enter":
|
|
749
|
+
case " ":
|
|
750
|
+
s.preventDefault(), this.toggleCalendar();
|
|
751
|
+
break;
|
|
752
|
+
case "Escape":
|
|
753
|
+
s.preventDefault(), this.closeCalendar();
|
|
754
|
+
break;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
render() {
|
|
758
|
+
const s = !!this.error, e = {
|
|
759
|
+
"date-wrapper": !0,
|
|
760
|
+
[`date-picker--${this.size}`]: !0,
|
|
761
|
+
"date-picker--error": s
|
|
762
|
+
}, t = {
|
|
763
|
+
"date-display": !0,
|
|
764
|
+
"date-display--open": this.isOpen,
|
|
765
|
+
"date-display--empty": !this.value,
|
|
766
|
+
"date-disabled": this.disabled
|
|
767
|
+
};
|
|
768
|
+
return y`
|
|
769
|
+
<div class="date-picker-group">
|
|
770
|
+
${this.label ? y`
|
|
771
|
+
<label for=${this.inputId} class="date-picker-label">
|
|
772
|
+
${this.label}
|
|
773
|
+
${this.required ? y`<span class="required-indicator" aria-label="required">*</span>` : ""}
|
|
774
|
+
</label>
|
|
775
|
+
` : ""}
|
|
776
|
+
|
|
777
|
+
<div class=${x(e)}>
|
|
778
|
+
<div
|
|
779
|
+
id=${this.inputId}
|
|
780
|
+
class=${x(t)}
|
|
781
|
+
@click=${this.handleDisplayClick}
|
|
782
|
+
@keydown=${this.handleKeydown}
|
|
783
|
+
tabindex=${this.disabled ? -1 : 0}
|
|
784
|
+
role="button"
|
|
785
|
+
aria-haspopup="dialog"
|
|
786
|
+
aria-expanded=${this.isOpen}
|
|
787
|
+
aria-describedby=${Be(s ? `${this.inputId}-error` : void 0)}
|
|
788
|
+
aria-invalid=${s}
|
|
789
|
+
>
|
|
790
|
+
${this.displayValue || this.placeholder}
|
|
791
|
+
</div>
|
|
792
|
+
|
|
793
|
+
<div class="date-icon">
|
|
794
|
+
<svg viewBox="0 0 20 20" fill="currentColor">
|
|
795
|
+
<path
|
|
796
|
+
fill-rule="evenodd"
|
|
797
|
+
d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"
|
|
798
|
+
clip-rule="evenodd"
|
|
799
|
+
/>
|
|
800
|
+
</svg>
|
|
801
|
+
</div>
|
|
802
|
+
|
|
803
|
+
${this.isOpen ? y`
|
|
804
|
+
<div class="calendar-overlay" @click=${this.closeCalendar}></div>
|
|
805
|
+
<div
|
|
806
|
+
class=${x({
|
|
807
|
+
"calendar-container": !0,
|
|
808
|
+
"calendar-container--flipped": this.isFlipped
|
|
809
|
+
})}
|
|
810
|
+
role="dialog"
|
|
811
|
+
aria-label="Choose date"
|
|
812
|
+
>
|
|
813
|
+
${this.showMonthPicker ? y`
|
|
814
|
+
<div class="picker-overlay">
|
|
815
|
+
<div class="month-picker-container">
|
|
816
|
+
<div class="month-picker-grid">
|
|
817
|
+
${this.monthNames.map(
|
|
818
|
+
(r, i) => y`
|
|
819
|
+
<div
|
|
820
|
+
class=${x({
|
|
821
|
+
"month-item": !0,
|
|
822
|
+
"month-selected": i === this.currentMonth
|
|
823
|
+
})}
|
|
824
|
+
@click=${() => this.selectMonth(i)}
|
|
825
|
+
>
|
|
826
|
+
${r}
|
|
827
|
+
</div>
|
|
828
|
+
`
|
|
829
|
+
)}
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
</div>
|
|
833
|
+
` : this.showYearPicker ? y`
|
|
834
|
+
<div class="picker-overlay">
|
|
835
|
+
<div class="year-picker-container">
|
|
836
|
+
<div class="year-picker-header">
|
|
837
|
+
<button
|
|
838
|
+
type="button"
|
|
839
|
+
class="year-nav"
|
|
840
|
+
@click=${this.yearRangeBack}
|
|
841
|
+
>
|
|
842
|
+
‹
|
|
843
|
+
</button>
|
|
844
|
+
<span class="year-range"
|
|
845
|
+
>${this.yearRangeStart} - ${this.yearRangeEnd}</span
|
|
846
|
+
>
|
|
847
|
+
<button
|
|
848
|
+
type="button"
|
|
849
|
+
class="year-nav"
|
|
850
|
+
@click=${this.yearRangeForward}
|
|
851
|
+
>
|
|
852
|
+
›
|
|
853
|
+
</button>
|
|
854
|
+
</div>
|
|
855
|
+
<div class="year-picker-grid">
|
|
856
|
+
${this.yearRange.map(
|
|
857
|
+
(r) => y`
|
|
858
|
+
<div
|
|
859
|
+
class=${x({
|
|
860
|
+
"year-item": !0,
|
|
861
|
+
"year-selected": r === this.currentYear
|
|
862
|
+
})}
|
|
863
|
+
@click=${() => this.selectYear(r)}
|
|
864
|
+
>
|
|
865
|
+
${r}
|
|
866
|
+
</div>
|
|
867
|
+
`
|
|
868
|
+
)}
|
|
869
|
+
</div>
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
` : y`
|
|
873
|
+
<div class="calendar-header">
|
|
874
|
+
<button
|
|
875
|
+
type="button"
|
|
876
|
+
class="calendar-nav"
|
|
877
|
+
@click=${this.previousMonth}
|
|
878
|
+
>
|
|
879
|
+
‹
|
|
880
|
+
</button>
|
|
881
|
+
<div class="calendar-month-year">
|
|
882
|
+
<span
|
|
883
|
+
class="month-selector"
|
|
884
|
+
@click=${() => this.showMonthPicker = !0}
|
|
885
|
+
>
|
|
886
|
+
${this.currentMonthName}
|
|
887
|
+
</span>
|
|
888
|
+
<span
|
|
889
|
+
class="year-selector"
|
|
890
|
+
@click=${() => this.showYearPicker = !0}
|
|
891
|
+
>
|
|
892
|
+
${this.currentYear}
|
|
893
|
+
</span>
|
|
894
|
+
</div>
|
|
895
|
+
<button type="button" class="calendar-nav" @click=${this.nextMonth}>
|
|
896
|
+
›
|
|
897
|
+
</button>
|
|
898
|
+
</div>
|
|
899
|
+
|
|
900
|
+
<div class="calendar-weekdays">
|
|
901
|
+
${this.weekDays.map((r) => y`<div class="calendar-weekday">${r}</div>`)}
|
|
902
|
+
</div>
|
|
903
|
+
|
|
904
|
+
<div class="calendar-days">
|
|
905
|
+
${this.calendarDays.map(
|
|
906
|
+
(r) => r ? y`
|
|
907
|
+
<div
|
|
908
|
+
class=${x({
|
|
909
|
+
"calendar-day": !0,
|
|
910
|
+
"day-selected": this.isSelectedDate(r),
|
|
911
|
+
"day-today": this.isToday(r),
|
|
912
|
+
"day-disabled": this.isDisabled(r)
|
|
913
|
+
})}
|
|
914
|
+
@click=${() => !this.isDisabled(r) && this.selectDate(r)}
|
|
915
|
+
>
|
|
916
|
+
${r}
|
|
917
|
+
</div>
|
|
918
|
+
` : y`<div class="calendar-day day-empty"></div>`
|
|
919
|
+
)}
|
|
920
|
+
</div>
|
|
921
|
+
|
|
922
|
+
<div class="calendar-footer">
|
|
923
|
+
<button
|
|
924
|
+
type="button"
|
|
925
|
+
class="calendar-today-btn"
|
|
926
|
+
@click=${this.selectToday}
|
|
927
|
+
>
|
|
928
|
+
Today
|
|
929
|
+
</button>
|
|
930
|
+
</div>
|
|
931
|
+
`}
|
|
932
|
+
</div>
|
|
933
|
+
` : ""}
|
|
934
|
+
</div>
|
|
935
|
+
|
|
936
|
+
${s ? y`
|
|
937
|
+
<div id="${this.inputId}-error" class="date-picker-error" role="alert">
|
|
938
|
+
${this.error}
|
|
939
|
+
</div>
|
|
940
|
+
` : this.hint ? y` <div class="date-picker-hint">${this.hint}</div> ` : ""}
|
|
941
|
+
</div>
|
|
942
|
+
`;
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
d.styles = ue`
|
|
946
|
+
:host {
|
|
947
|
+
display: block;
|
|
948
|
+
position: relative;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.date-picker-group {
|
|
952
|
+
display: flex;
|
|
953
|
+
flex-direction: column;
|
|
954
|
+
gap: var(--space-2);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.date-picker-label {
|
|
958
|
+
display: flex;
|
|
959
|
+
align-items: center;
|
|
960
|
+
gap: var(--space-1);
|
|
961
|
+
font-size: var(--font-size-sm);
|
|
962
|
+
font-weight: var(--font-weight-medium);
|
|
963
|
+
color: var(--color-text-primary);
|
|
964
|
+
line-height: var(--line-height-tight);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.required-indicator {
|
|
968
|
+
color: var(--color-error);
|
|
969
|
+
font-weight: var(--font-weight-bold);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
.date-wrapper {
|
|
973
|
+
position: relative;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
.date-display {
|
|
977
|
+
width: 100%;
|
|
978
|
+
font-family: var(--font-family-sans);
|
|
979
|
+
background-color: var(--color-bg-primary);
|
|
980
|
+
border: 1px solid var(--color-border);
|
|
981
|
+
border-radius: var(--radius-md);
|
|
982
|
+
transition: all var(--transition-fast);
|
|
983
|
+
color: var(--color-text-primary);
|
|
984
|
+
cursor: pointer;
|
|
985
|
+
user-select: none;
|
|
986
|
+
display: flex;
|
|
987
|
+
align-items: center;
|
|
988
|
+
box-sizing: border-box;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
.date-display:hover:not(.date-disabled) {
|
|
992
|
+
border-color: var(--color-border-hover);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.date-display--open {
|
|
996
|
+
border-color: var(--color-border-focus);
|
|
997
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.date-display--empty {
|
|
1001
|
+
color: var(--color-text-muted);
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/* Sizes */
|
|
1005
|
+
.date-picker--sm .date-display {
|
|
1006
|
+
padding: var(--space-2) var(--space-3);
|
|
1007
|
+
padding-right: var(--space-8);
|
|
1008
|
+
font-size: var(--font-size-sm);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.date-picker--md .date-display {
|
|
1012
|
+
padding: var(--space-3) var(--space-4);
|
|
1013
|
+
padding-right: var(--space-10);
|
|
1014
|
+
font-size: var(--font-size-base);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
.date-picker--lg .date-display {
|
|
1018
|
+
padding: var(--space-4) var(--space-5);
|
|
1019
|
+
padding-right: var(--space-12);
|
|
1020
|
+
font-size: var(--font-size-lg);
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/* States */
|
|
1024
|
+
.date-picker--error .date-display {
|
|
1025
|
+
border-color: var(--color-error);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
.date-picker--error .date-display--open {
|
|
1029
|
+
box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
.date-disabled {
|
|
1033
|
+
opacity: 0.5;
|
|
1034
|
+
cursor: not-allowed !important;
|
|
1035
|
+
background-color: var(--color-bg-muted);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
.date-icon {
|
|
1039
|
+
position: absolute;
|
|
1040
|
+
right: var(--space-3);
|
|
1041
|
+
top: 50%;
|
|
1042
|
+
transform: translateY(-50%);
|
|
1043
|
+
color: var(--color-text-secondary);
|
|
1044
|
+
pointer-events: none;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
.date-icon svg {
|
|
1048
|
+
width: 1.25em;
|
|
1049
|
+
height: 1.25em;
|
|
1050
|
+
display: block;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/* Calendar Dropdown */
|
|
1054
|
+
.calendar-overlay {
|
|
1055
|
+
position: fixed;
|
|
1056
|
+
top: 0;
|
|
1057
|
+
left: 0;
|
|
1058
|
+
right: 0;
|
|
1059
|
+
bottom: 0;
|
|
1060
|
+
z-index: 999;
|
|
1061
|
+
background: transparent;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.calendar-container {
|
|
1065
|
+
position: absolute;
|
|
1066
|
+
top: calc(100% + 4px);
|
|
1067
|
+
left: 0;
|
|
1068
|
+
min-width: 280px;
|
|
1069
|
+
min-height: 320px;
|
|
1070
|
+
background: var(--color-bg-primary);
|
|
1071
|
+
border: 1px solid var(--color-border-focus);
|
|
1072
|
+
border-radius: var(--radius-md);
|
|
1073
|
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
1074
|
+
z-index: 1000;
|
|
1075
|
+
padding: var(--space-3);
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
.calendar-container--flipped {
|
|
1079
|
+
top: auto;
|
|
1080
|
+
bottom: calc(100% + 4px);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.calendar-header {
|
|
1084
|
+
display: flex;
|
|
1085
|
+
justify-content: space-between;
|
|
1086
|
+
align-items: center;
|
|
1087
|
+
margin-bottom: var(--space-3);
|
|
1088
|
+
padding: 0 var(--space-2);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.calendar-nav {
|
|
1092
|
+
background: none;
|
|
1093
|
+
border: none;
|
|
1094
|
+
color: var(--color-text-secondary);
|
|
1095
|
+
font-size: 1.25rem;
|
|
1096
|
+
cursor: pointer;
|
|
1097
|
+
padding: var(--space-1) var(--space-2);
|
|
1098
|
+
border-radius: 50%;
|
|
1099
|
+
width: 32px;
|
|
1100
|
+
height: 32px;
|
|
1101
|
+
display: flex;
|
|
1102
|
+
align-items: center;
|
|
1103
|
+
justify-content: center;
|
|
1104
|
+
transition: all 0.2s ease;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
.calendar-nav:hover {
|
|
1108
|
+
background-color: var(--color-bg-secondary);
|
|
1109
|
+
color: var(--color-text-primary);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.calendar-month-year {
|
|
1113
|
+
font-size: var(--font-size-base);
|
|
1114
|
+
font-weight: var(--font-weight-medium);
|
|
1115
|
+
color: var(--color-text-primary);
|
|
1116
|
+
display: flex;
|
|
1117
|
+
gap: var(--space-2);
|
|
1118
|
+
align-items: center;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
.month-selector,
|
|
1122
|
+
.year-selector {
|
|
1123
|
+
cursor: pointer;
|
|
1124
|
+
padding: var(--space-1) var(--space-2);
|
|
1125
|
+
border-radius: var(--radius-md);
|
|
1126
|
+
transition: all 0.2s ease;
|
|
1127
|
+
border: 1px solid transparent;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
.month-selector:hover,
|
|
1131
|
+
.year-selector:hover {
|
|
1132
|
+
background-color: var(--color-bg-secondary);
|
|
1133
|
+
border-color: var(--color-border);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.calendar-weekdays {
|
|
1137
|
+
display: grid;
|
|
1138
|
+
grid-template-columns: repeat(7, 1fr);
|
|
1139
|
+
gap: 0;
|
|
1140
|
+
margin-bottom: var(--space-2);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
.calendar-weekday {
|
|
1144
|
+
text-align: center;
|
|
1145
|
+
font-size: var(--font-size-xs);
|
|
1146
|
+
font-weight: var(--font-weight-medium);
|
|
1147
|
+
color: var(--color-text-secondary);
|
|
1148
|
+
padding: var(--space-1);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
.calendar-days {
|
|
1152
|
+
display: grid;
|
|
1153
|
+
grid-template-columns: repeat(7, 1fr);
|
|
1154
|
+
gap: 2px;
|
|
1155
|
+
padding: var(--space-2) 0;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
.calendar-day {
|
|
1159
|
+
aspect-ratio: 1;
|
|
1160
|
+
display: flex;
|
|
1161
|
+
align-items: center;
|
|
1162
|
+
justify-content: center;
|
|
1163
|
+
font-size: var(--font-size-sm);
|
|
1164
|
+
color: var(--color-text-primary);
|
|
1165
|
+
cursor: pointer;
|
|
1166
|
+
border-radius: 50%;
|
|
1167
|
+
transition: all 0.15s ease;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
.calendar-day:not(.day-empty):not(.day-disabled):hover {
|
|
1171
|
+
background-color: var(--color-bg-secondary);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
.day-empty {
|
|
1175
|
+
cursor: default;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
.day-selected {
|
|
1179
|
+
background-color: var(--color-primary);
|
|
1180
|
+
color: white;
|
|
1181
|
+
font-weight: var(--font-weight-medium);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
.day-selected:hover {
|
|
1185
|
+
background-color: var(--color-primary) !important;
|
|
1186
|
+
transform: scale(1.1);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.day-today {
|
|
1190
|
+
position: relative;
|
|
1191
|
+
font-weight: var(--font-weight-medium);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
.day-today::after {
|
|
1195
|
+
content: '';
|
|
1196
|
+
position: absolute;
|
|
1197
|
+
bottom: 2px;
|
|
1198
|
+
left: 50%;
|
|
1199
|
+
transform: translateX(-50%);
|
|
1200
|
+
width: 4px;
|
|
1201
|
+
height: 4px;
|
|
1202
|
+
background-color: var(--color-primary);
|
|
1203
|
+
border-radius: 50%;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
.day-selected.day-today::after {
|
|
1207
|
+
background-color: white;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
.day-disabled {
|
|
1211
|
+
opacity: 0.3;
|
|
1212
|
+
cursor: not-allowed;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.day-disabled:hover {
|
|
1216
|
+
background-color: transparent !important;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.calendar-footer {
|
|
1220
|
+
margin-top: var(--space-2);
|
|
1221
|
+
padding-top: var(--space-2);
|
|
1222
|
+
border-top: 1px solid var(--color-border);
|
|
1223
|
+
display: flex;
|
|
1224
|
+
justify-content: center;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
.calendar-today-btn {
|
|
1228
|
+
background: transparent;
|
|
1229
|
+
border: none;
|
|
1230
|
+
color: var(--color-primary);
|
|
1231
|
+
font-size: var(--font-size-xs);
|
|
1232
|
+
font-weight: var(--font-weight-medium);
|
|
1233
|
+
padding: var(--space-1) var(--space-2);
|
|
1234
|
+
border-radius: var(--radius-md);
|
|
1235
|
+
cursor: pointer;
|
|
1236
|
+
transition: all 0.2s ease;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
.calendar-today-btn:hover {
|
|
1240
|
+
background-color: var(--color-bg-secondary);
|
|
1241
|
+
color: var(--color-primary);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/* Picker Overlay */
|
|
1245
|
+
.picker-overlay {
|
|
1246
|
+
position: absolute;
|
|
1247
|
+
top: 0;
|
|
1248
|
+
left: 0;
|
|
1249
|
+
right: 0;
|
|
1250
|
+
bottom: 0;
|
|
1251
|
+
background: var(--color-bg-primary);
|
|
1252
|
+
border-radius: var(--radius-md);
|
|
1253
|
+
padding: var(--space-3);
|
|
1254
|
+
z-index: 10;
|
|
1255
|
+
animation: fadeIn 0.15s ease;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
@keyframes fadeIn {
|
|
1259
|
+
from {
|
|
1260
|
+
opacity: 0;
|
|
1261
|
+
}
|
|
1262
|
+
to {
|
|
1263
|
+
opacity: 1;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/* Month Picker */
|
|
1268
|
+
.month-picker-container {
|
|
1269
|
+
display: flex;
|
|
1270
|
+
flex-direction: column;
|
|
1271
|
+
height: 100%;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
.month-picker-grid {
|
|
1275
|
+
display: grid;
|
|
1276
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1277
|
+
gap: var(--space-2);
|
|
1278
|
+
flex: 1;
|
|
1279
|
+
align-content: center;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.month-item {
|
|
1283
|
+
padding: var(--space-4) var(--space-2);
|
|
1284
|
+
text-align: center;
|
|
1285
|
+
cursor: pointer;
|
|
1286
|
+
border-radius: var(--radius-md);
|
|
1287
|
+
font-size: var(--font-size-sm);
|
|
1288
|
+
color: var(--color-text-primary);
|
|
1289
|
+
transition: all 0.15s ease;
|
|
1290
|
+
border: 1px solid transparent;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.month-item:hover {
|
|
1294
|
+
background-color: var(--color-bg-secondary);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
.month-selected {
|
|
1298
|
+
background-color: var(--color-primary);
|
|
1299
|
+
color: white;
|
|
1300
|
+
font-weight: var(--font-weight-medium);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
.month-selected:hover {
|
|
1304
|
+
background-color: var(--color-primary);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/* Year Picker */
|
|
1308
|
+
.year-picker-container {
|
|
1309
|
+
display: flex;
|
|
1310
|
+
flex-direction: column;
|
|
1311
|
+
height: 100%;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
.year-picker-header {
|
|
1315
|
+
display: flex;
|
|
1316
|
+
justify-content: space-between;
|
|
1317
|
+
align-items: center;
|
|
1318
|
+
margin-bottom: var(--space-3);
|
|
1319
|
+
padding: var(--space-2);
|
|
1320
|
+
border-bottom: 1px solid var(--color-border);
|
|
1321
|
+
flex-shrink: 0;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.year-nav {
|
|
1325
|
+
background: none;
|
|
1326
|
+
border: none;
|
|
1327
|
+
color: var(--color-text-secondary);
|
|
1328
|
+
font-size: 1.25rem;
|
|
1329
|
+
cursor: pointer;
|
|
1330
|
+
padding: var(--space-1) var(--space-2);
|
|
1331
|
+
border-radius: 50%;
|
|
1332
|
+
width: 32px;
|
|
1333
|
+
height: 32px;
|
|
1334
|
+
display: flex;
|
|
1335
|
+
align-items: center;
|
|
1336
|
+
justify-content: center;
|
|
1337
|
+
transition: all 0.2s ease;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.year-nav:hover {
|
|
1341
|
+
background-color: var(--color-bg-secondary);
|
|
1342
|
+
color: var(--color-text-primary);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.year-range {
|
|
1346
|
+
font-size: var(--font-size-sm);
|
|
1347
|
+
font-weight: var(--font-weight-medium);
|
|
1348
|
+
color: var(--color-text-primary);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
.year-picker-grid {
|
|
1352
|
+
display: grid;
|
|
1353
|
+
grid-template-columns: repeat(3, 1fr);
|
|
1354
|
+
gap: var(--space-2);
|
|
1355
|
+
flex: 1;
|
|
1356
|
+
align-content: center;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
.year-item {
|
|
1360
|
+
padding: var(--space-4) var(--space-2);
|
|
1361
|
+
text-align: center;
|
|
1362
|
+
cursor: pointer;
|
|
1363
|
+
border-radius: var(--radius-md);
|
|
1364
|
+
font-size: var(--font-size-sm);
|
|
1365
|
+
color: var(--color-text-primary);
|
|
1366
|
+
transition: all 0.15s ease;
|
|
1367
|
+
border: 1px solid transparent;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
.year-item:hover {
|
|
1371
|
+
background-color: var(--color-bg-secondary);
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
.year-selected {
|
|
1375
|
+
background-color: var(--color-primary);
|
|
1376
|
+
color: white;
|
|
1377
|
+
font-weight: var(--font-weight-medium);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
.year-selected:hover {
|
|
1381
|
+
background-color: var(--color-primary);
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
.date-picker-error {
|
|
1385
|
+
font-size: var(--font-size-sm);
|
|
1386
|
+
color: var(--color-error);
|
|
1387
|
+
line-height: var(--line-height-tight);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
.date-picker-hint {
|
|
1391
|
+
font-size: var(--font-size-sm);
|
|
1392
|
+
color: var(--color-text-muted);
|
|
1393
|
+
line-height: var(--line-height-tight);
|
|
1394
|
+
}
|
|
1395
|
+
`;
|
|
1396
|
+
h([
|
|
1397
|
+
v({ type: String })
|
|
1398
|
+
], d.prototype, "value", 2);
|
|
1399
|
+
h([
|
|
1400
|
+
v({ type: String })
|
|
1401
|
+
], d.prototype, "label", 2);
|
|
1402
|
+
h([
|
|
1403
|
+
v({ type: String })
|
|
1404
|
+
], d.prototype, "placeholder", 2);
|
|
1405
|
+
h([
|
|
1406
|
+
v({ type: Boolean, reflect: !0 })
|
|
1407
|
+
], d.prototype, "required", 2);
|
|
1408
|
+
h([
|
|
1409
|
+
v({ type: Boolean, reflect: !0 })
|
|
1410
|
+
], d.prototype, "disabled", 2);
|
|
1411
|
+
h([
|
|
1412
|
+
v({ type: String })
|
|
1413
|
+
], d.prototype, "error", 2);
|
|
1414
|
+
h([
|
|
1415
|
+
v({ type: String })
|
|
1416
|
+
], d.prototype, "hint", 2);
|
|
1417
|
+
h([
|
|
1418
|
+
v({ type: String })
|
|
1419
|
+
], d.prototype, "size", 2);
|
|
1420
|
+
h([
|
|
1421
|
+
v({ type: String })
|
|
1422
|
+
], d.prototype, "minDate", 2);
|
|
1423
|
+
h([
|
|
1424
|
+
v({ type: String })
|
|
1425
|
+
], d.prototype, "maxDate", 2);
|
|
1426
|
+
h([
|
|
1427
|
+
S()
|
|
1428
|
+
], d.prototype, "isOpen", 2);
|
|
1429
|
+
h([
|
|
1430
|
+
S()
|
|
1431
|
+
], d.prototype, "currentMonth", 2);
|
|
1432
|
+
h([
|
|
1433
|
+
S()
|
|
1434
|
+
], d.prototype, "currentYear", 2);
|
|
1435
|
+
h([
|
|
1436
|
+
S()
|
|
1437
|
+
], d.prototype, "showMonthPicker", 2);
|
|
1438
|
+
h([
|
|
1439
|
+
S()
|
|
1440
|
+
], d.prototype, "showYearPicker", 2);
|
|
1441
|
+
h([
|
|
1442
|
+
S()
|
|
1443
|
+
], d.prototype, "yearRangeStart", 2);
|
|
1444
|
+
h([
|
|
1445
|
+
S()
|
|
1446
|
+
], d.prototype, "isFlipped", 2);
|
|
1447
|
+
h([
|
|
1448
|
+
de(".date-display")
|
|
1449
|
+
], d.prototype, "dateDisplay", 2);
|
|
1450
|
+
h([
|
|
1451
|
+
de(".calendar-container")
|
|
1452
|
+
], d.prototype, "calendarContainer", 2);
|
|
1453
|
+
d = h([
|
|
1454
|
+
ze("base-date-picker")
|
|
1455
|
+
], d);
|
|
1456
|
+
export {
|
|
1457
|
+
d as BaseDatePicker
|
|
1458
|
+
};
|