@zealsolutions/zeal-ui 1.0.0-alpha.347 → 1.0.0-alpha.348
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/DatePicker-Cvaseoh7.js +1303 -0
- package/dist/components/datepicker/index.js +7 -0
- package/dist/components/inputs/index.js +108 -1303
- package/dist/css/editorStyles.css +14 -14
- package/package.json +3 -2
|
@@ -0,0 +1,1303 @@
|
|
|
1
|
+
import { computed as S, openBlock as C, createElementBlock as A, normalizeClass as De, toDisplayString as B, Fragment as H, createElementVNode as V, renderList as ne, createVNode as ie, ref as O, shallowRef as et, watch as ve, getCurrentScope as tt, onScopeDispose as nt, shallowReadonly as G, unref as Ye, mergeModels as ot, useModel as rt, renderSlot as st, normalizeStyle as it, createBlock as ye, createCommentVNode as lt } from "vue";
|
|
2
|
+
import ct from "./ChevronLeftIcon-ChE9LoOU.js";
|
|
3
|
+
import at from "./ChevronRightIcon-DknltHiN.js";
|
|
4
|
+
import ut from "./CalendarIcon-DjSv5Y23.js";
|
|
5
|
+
const ft = {
|
|
6
|
+
__name: "DateCell",
|
|
7
|
+
props: {
|
|
8
|
+
cellNumber: {
|
|
9
|
+
type: Number,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
isCurrentDay: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
20
|
+
isSelected: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["selectDay"],
|
|
26
|
+
setup(e, { emit: t }) {
|
|
27
|
+
const n = e, o = S(() => n.isSelected ? "bg-app-950 text-white cursor-pointer" : n.isCurrentDay ? "bg-black-950 text-white cursor-pointer hover:bg-app-300 hover:text-black-950" : n.disabled ? "bg-steel-200 dark:bg-surface-sunken text-steel-800 cursor-not-allowed" : "bg-surface-raised text-black-950 dark:text-content cursor-pointer hover:bg-app-300 hover:text-black-950"), r = t;
|
|
28
|
+
return (s, i) => (C(), A("div", {
|
|
29
|
+
class: De(["flex flex-wrap justify-center content-center text-style-label-small size-[40px] p-[5px] border-steel-400 dark:border-line-strong border-l-[1px] first-of-type:border-none", o.value]),
|
|
30
|
+
onClick: i[0] || (i[0] = (l) => e.disabled ? null : r("selectDay"))
|
|
31
|
+
}, B(e.cellNumber), 3));
|
|
32
|
+
}
|
|
33
|
+
}, dt = { class: "flex flex-row" }, mt = { class: "text-steel-800 dark:text-content-muted text-center h-4 text-style-label-small mb-[15px] w-[40px]" }, pt = { class: "rounded-[10px] bg-surface-raised w-fit" }, ht = { class: "flex flex-row border-t-[1px] border-steel-400 dark:border-line-strong border-l-[1px] border-r-[1px] first-of-type:rounded-t-[10px] last-of-type:border-b-[1px] last-of-type:rounded-b-[10px] overflow-hidden" }, gt = {
|
|
34
|
+
__name: "DateGrid",
|
|
35
|
+
props: {
|
|
36
|
+
year: {
|
|
37
|
+
type: Number,
|
|
38
|
+
required: !0
|
|
39
|
+
},
|
|
40
|
+
month: {
|
|
41
|
+
type: Number,
|
|
42
|
+
required: !0
|
|
43
|
+
},
|
|
44
|
+
rows: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: !1,
|
|
47
|
+
default: 6
|
|
48
|
+
},
|
|
49
|
+
selectedDate: {
|
|
50
|
+
type: [Date, String],
|
|
51
|
+
required: !1,
|
|
52
|
+
default: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
emits: ["selectDay"],
|
|
56
|
+
setup(e, { emit: t }) {
|
|
57
|
+
const n = e, o = ["M", "T", "W", "T", "F", "S", "S"], r = S(() => {
|
|
58
|
+
const c = new Date(n.year, n.month, 1).getDay() - 1;
|
|
59
|
+
return c === -1 ? 6 : c;
|
|
60
|
+
}), s = S(() => new Date(n.year, n.month + 1, 0).getDate()), i = S(() => new Date(n.year, n.month, 0).getDate()), l = (c, f) => (c - 1) * 7 + f - r.value, a = (c, f) => {
|
|
61
|
+
var u = (c - 1) * 7 + f - r.value;
|
|
62
|
+
return u < 1 ? i.value + u : u > s.value ? u - s.value : u;
|
|
63
|
+
};
|
|
64
|
+
return (c, f) => (C(), A(H, null, [
|
|
65
|
+
V("div", dt, [
|
|
66
|
+
(C(), A(H, null, ne(o, (u) => V("div", mt, B(u), 1)), 64))
|
|
67
|
+
]),
|
|
68
|
+
V("div", pt, [
|
|
69
|
+
(C(!0), A(H, null, ne(e.rows, (u) => (C(), A("div", ht, [
|
|
70
|
+
(C(), A(H, null, ne(7, (m) => ie(ft, {
|
|
71
|
+
cellNumber: a(u, m),
|
|
72
|
+
disabled: l(u, m) < 1 || l(u, m) > s.value,
|
|
73
|
+
onSelectDay: (d) => c.$emit("selectDay", new Date(n.year, n.month, a(u, m))),
|
|
74
|
+
isCurrentDay: l(u, m) == (/* @__PURE__ */ new Date()).getDate() && n.month == (/* @__PURE__ */ new Date()).getMonth() && n.year == (/* @__PURE__ */ new Date()).getFullYear(),
|
|
75
|
+
isSelected: e.selectedDate instanceof Date && e.selectedDate.getDate() == a(u, m) && e.selectedDate.getMonth() == n.month && e.selectedDate.getFullYear() == n.year && l(u, m) > 0 && l(u, m) <= s.value
|
|
76
|
+
}, null, 8, ["cellNumber", "disabled", "onSelectDay", "isCurrentDay", "isSelected"])), 64))
|
|
77
|
+
]))), 256))
|
|
78
|
+
])
|
|
79
|
+
], 64));
|
|
80
|
+
}
|
|
81
|
+
}, vt = { class: "grid grid-cols-3 gap-[5px]" }, yt = ["onClick"], xt = {
|
|
82
|
+
__name: "MonthPicker",
|
|
83
|
+
props: {
|
|
84
|
+
month: {
|
|
85
|
+
type: Number,
|
|
86
|
+
required: !0
|
|
87
|
+
},
|
|
88
|
+
year: {
|
|
89
|
+
type: Number,
|
|
90
|
+
required: !0
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
emits: ["selectMonth"],
|
|
94
|
+
setup(e, { emit: t }) {
|
|
95
|
+
const n = e, o = t, r = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], s = /* @__PURE__ */ new Date(), i = (a) => a === s.getMonth() && n.year === s.getFullYear(), l = (a) => a === n.month ? "bg-app-950 text-white" : i(a) ? "bg-black-950 text-white hover:bg-app-300 hover:text-black-950" : "bg-surface-raised text-black-950 dark:text-content hover:bg-app-300 hover:text-black-950";
|
|
96
|
+
return (a, c) => (C(), A("div", vt, [
|
|
97
|
+
(C(), A(H, null, ne(r, (f, u) => V("div", {
|
|
98
|
+
key: f,
|
|
99
|
+
class: De(["flex flex-wrap justify-center content-center text-style-label-small h-[50px] rounded-[10px] cursor-pointer", l(u)]),
|
|
100
|
+
onClick: (m) => o("selectMonth", u)
|
|
101
|
+
}, B(f), 11, yt)), 64))
|
|
102
|
+
]));
|
|
103
|
+
}
|
|
104
|
+
}, wt = { class: "grid grid-cols-3 gap-[5px]" }, bt = ["onClick"], Dt = {
|
|
105
|
+
__name: "YearPicker",
|
|
106
|
+
props: {
|
|
107
|
+
year: {
|
|
108
|
+
type: Number,
|
|
109
|
+
required: !0
|
|
110
|
+
},
|
|
111
|
+
startYear: {
|
|
112
|
+
type: Number,
|
|
113
|
+
required: !0
|
|
114
|
+
},
|
|
115
|
+
count: {
|
|
116
|
+
type: Number,
|
|
117
|
+
required: !1,
|
|
118
|
+
default: 12
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
emits: ["selectYear"],
|
|
122
|
+
setup(e, { emit: t }) {
|
|
123
|
+
const n = e, o = t, r = S(() => Array.from({ length: n.count }, (l, a) => n.startYear + a)), s = (/* @__PURE__ */ new Date()).getFullYear(), i = (l) => l === n.year ? "bg-app-950 text-white" : l === s ? "bg-black-950 text-white hover:bg-app-300 hover:text-black-950" : "bg-surface-raised text-black-950 dark:text-content hover:bg-app-300 hover:text-black-950";
|
|
124
|
+
return (l, a) => (C(), A("div", wt, [
|
|
125
|
+
(C(!0), A(H, null, ne(r.value, (c) => (C(), A("div", {
|
|
126
|
+
key: c,
|
|
127
|
+
class: De(["flex flex-wrap justify-center content-center text-style-label-small h-[50px] rounded-[10px] cursor-pointer", i(c)]),
|
|
128
|
+
onClick: (f) => o("selectYear", c)
|
|
129
|
+
}, B(c), 11, bt))), 128))
|
|
130
|
+
]));
|
|
131
|
+
}
|
|
132
|
+
}, le = Math.min, I = Math.max, ce = Math.round, se = Math.floor, T = (e) => ({
|
|
133
|
+
x: e,
|
|
134
|
+
y: e
|
|
135
|
+
}), Ct = {
|
|
136
|
+
left: "right",
|
|
137
|
+
right: "left",
|
|
138
|
+
bottom: "top",
|
|
139
|
+
top: "bottom"
|
|
140
|
+
}, kt = {
|
|
141
|
+
start: "end",
|
|
142
|
+
end: "start"
|
|
143
|
+
};
|
|
144
|
+
function Me(e, t, n) {
|
|
145
|
+
return I(e, le(t, n));
|
|
146
|
+
}
|
|
147
|
+
function fe(e, t) {
|
|
148
|
+
return typeof e == "function" ? e(t) : e;
|
|
149
|
+
}
|
|
150
|
+
function j(e) {
|
|
151
|
+
return e.split("-")[0];
|
|
152
|
+
}
|
|
153
|
+
function de(e) {
|
|
154
|
+
return e.split("-")[1];
|
|
155
|
+
}
|
|
156
|
+
function We(e) {
|
|
157
|
+
return e === "x" ? "y" : "x";
|
|
158
|
+
}
|
|
159
|
+
function qe(e) {
|
|
160
|
+
return e === "y" ? "height" : "width";
|
|
161
|
+
}
|
|
162
|
+
const At = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
163
|
+
function Y(e) {
|
|
164
|
+
return At.has(j(e)) ? "y" : "x";
|
|
165
|
+
}
|
|
166
|
+
function ze(e) {
|
|
167
|
+
return We(Y(e));
|
|
168
|
+
}
|
|
169
|
+
function St(e, t, n) {
|
|
170
|
+
n === void 0 && (n = !1);
|
|
171
|
+
const o = de(e), r = ze(e), s = qe(r);
|
|
172
|
+
let i = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
|
|
173
|
+
return t.reference[s] > t.floating[s] && (i = ae(i)), [i, ae(i)];
|
|
174
|
+
}
|
|
175
|
+
function Rt(e) {
|
|
176
|
+
const t = ae(e);
|
|
177
|
+
return [we(e), t, we(t)];
|
|
178
|
+
}
|
|
179
|
+
function we(e) {
|
|
180
|
+
return e.replace(/start|end/g, (t) => kt[t]);
|
|
181
|
+
}
|
|
182
|
+
const Le = ["left", "right"], Te = ["right", "left"], Ot = ["top", "bottom"], _t = ["bottom", "top"];
|
|
183
|
+
function Et(e, t, n) {
|
|
184
|
+
switch (e) {
|
|
185
|
+
case "top":
|
|
186
|
+
case "bottom":
|
|
187
|
+
return n ? t ? Te : Le : t ? Le : Te;
|
|
188
|
+
case "left":
|
|
189
|
+
case "right":
|
|
190
|
+
return t ? Ot : _t;
|
|
191
|
+
default:
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function Mt(e, t, n, o) {
|
|
196
|
+
const r = de(e);
|
|
197
|
+
let s = Et(j(e), n === "start", o);
|
|
198
|
+
return r && (s = s.map((i) => i + "-" + r), t && (s = s.concat(s.map(we)))), s;
|
|
199
|
+
}
|
|
200
|
+
function ae(e) {
|
|
201
|
+
return e.replace(/left|right|bottom|top/g, (t) => Ct[t]);
|
|
202
|
+
}
|
|
203
|
+
function Lt(e) {
|
|
204
|
+
return {
|
|
205
|
+
top: 0,
|
|
206
|
+
right: 0,
|
|
207
|
+
bottom: 0,
|
|
208
|
+
left: 0,
|
|
209
|
+
...e
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function Tt(e) {
|
|
213
|
+
return typeof e != "number" ? Lt(e) : {
|
|
214
|
+
top: e,
|
|
215
|
+
right: e,
|
|
216
|
+
bottom: e,
|
|
217
|
+
left: e
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function ue(e) {
|
|
221
|
+
const {
|
|
222
|
+
x: t,
|
|
223
|
+
y: n,
|
|
224
|
+
width: o,
|
|
225
|
+
height: r
|
|
226
|
+
} = e;
|
|
227
|
+
return {
|
|
228
|
+
width: o,
|
|
229
|
+
height: r,
|
|
230
|
+
top: n,
|
|
231
|
+
left: t,
|
|
232
|
+
right: t + o,
|
|
233
|
+
bottom: n + r,
|
|
234
|
+
x: t,
|
|
235
|
+
y: n
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function Ne(e, t, n) {
|
|
239
|
+
let {
|
|
240
|
+
reference: o,
|
|
241
|
+
floating: r
|
|
242
|
+
} = e;
|
|
243
|
+
const s = Y(t), i = ze(t), l = qe(i), a = j(t), c = s === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, m = o[l] / 2 - r[l] / 2;
|
|
244
|
+
let d;
|
|
245
|
+
switch (a) {
|
|
246
|
+
case "top":
|
|
247
|
+
d = {
|
|
248
|
+
x: f,
|
|
249
|
+
y: o.y - r.height
|
|
250
|
+
};
|
|
251
|
+
break;
|
|
252
|
+
case "bottom":
|
|
253
|
+
d = {
|
|
254
|
+
x: f,
|
|
255
|
+
y: o.y + o.height
|
|
256
|
+
};
|
|
257
|
+
break;
|
|
258
|
+
case "right":
|
|
259
|
+
d = {
|
|
260
|
+
x: o.x + o.width,
|
|
261
|
+
y: u
|
|
262
|
+
};
|
|
263
|
+
break;
|
|
264
|
+
case "left":
|
|
265
|
+
d = {
|
|
266
|
+
x: o.x - r.width,
|
|
267
|
+
y: u
|
|
268
|
+
};
|
|
269
|
+
break;
|
|
270
|
+
default:
|
|
271
|
+
d = {
|
|
272
|
+
x: o.x,
|
|
273
|
+
y: o.y
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
switch (de(t)) {
|
|
277
|
+
case "start":
|
|
278
|
+
d[i] -= m * (n && c ? -1 : 1);
|
|
279
|
+
break;
|
|
280
|
+
case "end":
|
|
281
|
+
d[i] += m * (n && c ? -1 : 1);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
return d;
|
|
285
|
+
}
|
|
286
|
+
const Nt = async (e, t, n) => {
|
|
287
|
+
const {
|
|
288
|
+
placement: o = "bottom",
|
|
289
|
+
strategy: r = "absolute",
|
|
290
|
+
middleware: s = [],
|
|
291
|
+
platform: i
|
|
292
|
+
} = n, l = s.filter(Boolean), a = await (i.isRTL == null ? void 0 : i.isRTL(t));
|
|
293
|
+
let c = await i.getElementRects({
|
|
294
|
+
reference: e,
|
|
295
|
+
floating: t,
|
|
296
|
+
strategy: r
|
|
297
|
+
}), {
|
|
298
|
+
x: f,
|
|
299
|
+
y: u
|
|
300
|
+
} = Ne(c, o, a), m = o, d = {}, h = 0;
|
|
301
|
+
for (let y = 0; y < l.length; y++) {
|
|
302
|
+
const {
|
|
303
|
+
name: v,
|
|
304
|
+
fn: g
|
|
305
|
+
} = l[y], {
|
|
306
|
+
x,
|
|
307
|
+
y: w,
|
|
308
|
+
data: D,
|
|
309
|
+
reset: b
|
|
310
|
+
} = await g({
|
|
311
|
+
x: f,
|
|
312
|
+
y: u,
|
|
313
|
+
initialPlacement: o,
|
|
314
|
+
placement: m,
|
|
315
|
+
strategy: r,
|
|
316
|
+
middlewareData: d,
|
|
317
|
+
rects: c,
|
|
318
|
+
platform: i,
|
|
319
|
+
elements: {
|
|
320
|
+
reference: e,
|
|
321
|
+
floating: t
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
f = x ?? f, u = w ?? u, d = {
|
|
325
|
+
...d,
|
|
326
|
+
[v]: {
|
|
327
|
+
...d[v],
|
|
328
|
+
...D
|
|
329
|
+
}
|
|
330
|
+
}, b && h <= 50 && (h++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (c = b.rects === !0 ? await i.getElementRects({
|
|
331
|
+
reference: e,
|
|
332
|
+
floating: t,
|
|
333
|
+
strategy: r
|
|
334
|
+
}) : b.rects), {
|
|
335
|
+
x: f,
|
|
336
|
+
y: u
|
|
337
|
+
} = Ne(c, m, a)), y = -1);
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
x: f,
|
|
341
|
+
y: u,
|
|
342
|
+
placement: m,
|
|
343
|
+
strategy: r,
|
|
344
|
+
middlewareData: d
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
async function He(e, t) {
|
|
348
|
+
var n;
|
|
349
|
+
t === void 0 && (t = {});
|
|
350
|
+
const {
|
|
351
|
+
x: o,
|
|
352
|
+
y: r,
|
|
353
|
+
platform: s,
|
|
354
|
+
rects: i,
|
|
355
|
+
elements: l,
|
|
356
|
+
strategy: a
|
|
357
|
+
} = e, {
|
|
358
|
+
boundary: c = "clippingAncestors",
|
|
359
|
+
rootBoundary: f = "viewport",
|
|
360
|
+
elementContext: u = "floating",
|
|
361
|
+
altBoundary: m = !1,
|
|
362
|
+
padding: d = 0
|
|
363
|
+
} = fe(t, e), h = Tt(d), v = l[m ? u === "floating" ? "reference" : "floating" : u], g = ue(await s.getClippingRect({
|
|
364
|
+
element: (n = await (s.isElement == null ? void 0 : s.isElement(v))) == null || n ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
365
|
+
boundary: c,
|
|
366
|
+
rootBoundary: f,
|
|
367
|
+
strategy: a
|
|
368
|
+
})), x = u === "floating" ? {
|
|
369
|
+
x: o,
|
|
370
|
+
y: r,
|
|
371
|
+
width: i.floating.width,
|
|
372
|
+
height: i.floating.height
|
|
373
|
+
} : i.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), D = await (s.isElement == null ? void 0 : s.isElement(w)) ? await (s.getScale == null ? void 0 : s.getScale(w)) || {
|
|
374
|
+
x: 1,
|
|
375
|
+
y: 1
|
|
376
|
+
} : {
|
|
377
|
+
x: 1,
|
|
378
|
+
y: 1
|
|
379
|
+
}, b = ue(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
380
|
+
elements: l,
|
|
381
|
+
rect: x,
|
|
382
|
+
offsetParent: w,
|
|
383
|
+
strategy: a
|
|
384
|
+
}) : x);
|
|
385
|
+
return {
|
|
386
|
+
top: (g.top - b.top + h.top) / D.y,
|
|
387
|
+
bottom: (b.bottom - g.bottom + h.bottom) / D.y,
|
|
388
|
+
left: (g.left - b.left + h.left) / D.x,
|
|
389
|
+
right: (b.right - g.right + h.right) / D.x
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
const Pt = function(e) {
|
|
393
|
+
return e === void 0 && (e = {}), {
|
|
394
|
+
name: "flip",
|
|
395
|
+
options: e,
|
|
396
|
+
async fn(t) {
|
|
397
|
+
var n, o;
|
|
398
|
+
const {
|
|
399
|
+
placement: r,
|
|
400
|
+
middlewareData: s,
|
|
401
|
+
rects: i,
|
|
402
|
+
initialPlacement: l,
|
|
403
|
+
platform: a,
|
|
404
|
+
elements: c
|
|
405
|
+
} = t, {
|
|
406
|
+
mainAxis: f = !0,
|
|
407
|
+
crossAxis: u = !0,
|
|
408
|
+
fallbackPlacements: m,
|
|
409
|
+
fallbackStrategy: d = "bestFit",
|
|
410
|
+
fallbackAxisSideDirection: h = "none",
|
|
411
|
+
flipAlignment: y = !0,
|
|
412
|
+
...v
|
|
413
|
+
} = fe(e, t);
|
|
414
|
+
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
415
|
+
return {};
|
|
416
|
+
const g = j(r), x = Y(l), w = j(l) === l, D = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), b = m || (w || !y ? [ae(l)] : Rt(l)), L = h !== "none";
|
|
417
|
+
!m && L && b.push(...Mt(l, y, h, D));
|
|
418
|
+
const p = [l, ...b], k = await He(t, v), F = [];
|
|
419
|
+
let U = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
420
|
+
if (f && F.push(k[g]), u) {
|
|
421
|
+
const q = St(r, i, D);
|
|
422
|
+
F.push(k[q[0]], k[q[1]]);
|
|
423
|
+
}
|
|
424
|
+
if (U = [...U, {
|
|
425
|
+
placement: r,
|
|
426
|
+
overflows: F
|
|
427
|
+
}], !F.every((q) => q <= 0)) {
|
|
428
|
+
var Oe, _e;
|
|
429
|
+
const q = (((Oe = s.flip) == null ? void 0 : Oe.index) || 0) + 1, ge = p[q];
|
|
430
|
+
if (ge && (!(u === "alignment" ? x !== Y(ge) : !1) || // We leave the current main axis only if every placement on that axis
|
|
431
|
+
// overflows the main axis.
|
|
432
|
+
U.every((_) => _.overflows[0] > 0 && Y(_.placement) === x)))
|
|
433
|
+
return {
|
|
434
|
+
data: {
|
|
435
|
+
index: q,
|
|
436
|
+
overflows: U
|
|
437
|
+
},
|
|
438
|
+
reset: {
|
|
439
|
+
placement: ge
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
let Z = (_e = U.filter((z) => z.overflows[0] <= 0).sort((z, _) => z.overflows[1] - _.overflows[1])[0]) == null ? void 0 : _e.placement;
|
|
443
|
+
if (!Z)
|
|
444
|
+
switch (d) {
|
|
445
|
+
case "bestFit": {
|
|
446
|
+
var Ee;
|
|
447
|
+
const z = (Ee = U.filter((_) => {
|
|
448
|
+
if (L) {
|
|
449
|
+
const $ = Y(_.placement);
|
|
450
|
+
return $ === x || // Create a bias to the `y` side axis due to horizontal
|
|
451
|
+
// reading directions favoring greater width.
|
|
452
|
+
$ === "y";
|
|
453
|
+
}
|
|
454
|
+
return !0;
|
|
455
|
+
}).map((_) => [_.placement, _.overflows.filter(($) => $ > 0).reduce(($, Ze) => $ + Ze, 0)]).sort((_, $) => _[1] - $[1])[0]) == null ? void 0 : Ee[0];
|
|
456
|
+
z && (Z = z);
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
case "initialPlacement":
|
|
460
|
+
Z = l;
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
if (r !== Z)
|
|
464
|
+
return {
|
|
465
|
+
reset: {
|
|
466
|
+
placement: Z
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
return {};
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
}, Ft = /* @__PURE__ */ new Set(["left", "top"]);
|
|
474
|
+
async function Vt(e, t) {
|
|
475
|
+
const {
|
|
476
|
+
placement: n,
|
|
477
|
+
platform: o,
|
|
478
|
+
elements: r
|
|
479
|
+
} = e, s = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), i = j(n), l = de(n), a = Y(n) === "y", c = Ft.has(i) ? -1 : 1, f = s && a ? -1 : 1, u = fe(t, e);
|
|
480
|
+
let {
|
|
481
|
+
mainAxis: m,
|
|
482
|
+
crossAxis: d,
|
|
483
|
+
alignmentAxis: h
|
|
484
|
+
} = typeof u == "number" ? {
|
|
485
|
+
mainAxis: u,
|
|
486
|
+
crossAxis: 0,
|
|
487
|
+
alignmentAxis: null
|
|
488
|
+
} : {
|
|
489
|
+
mainAxis: u.mainAxis || 0,
|
|
490
|
+
crossAxis: u.crossAxis || 0,
|
|
491
|
+
alignmentAxis: u.alignmentAxis
|
|
492
|
+
};
|
|
493
|
+
return l && typeof h == "number" && (d = l === "end" ? h * -1 : h), a ? {
|
|
494
|
+
x: d * f,
|
|
495
|
+
y: m * c
|
|
496
|
+
} : {
|
|
497
|
+
x: m * c,
|
|
498
|
+
y: d * f
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
const $t = function(e) {
|
|
502
|
+
return e === void 0 && (e = 0), {
|
|
503
|
+
name: "offset",
|
|
504
|
+
options: e,
|
|
505
|
+
async fn(t) {
|
|
506
|
+
var n, o;
|
|
507
|
+
const {
|
|
508
|
+
x: r,
|
|
509
|
+
y: s,
|
|
510
|
+
placement: i,
|
|
511
|
+
middlewareData: l
|
|
512
|
+
} = t, a = await Vt(t, e);
|
|
513
|
+
return i === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
|
|
514
|
+
x: r + a.x,
|
|
515
|
+
y: s + a.y,
|
|
516
|
+
data: {
|
|
517
|
+
...a,
|
|
518
|
+
placement: i
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}, Bt = function(e) {
|
|
524
|
+
return e === void 0 && (e = {}), {
|
|
525
|
+
name: "shift",
|
|
526
|
+
options: e,
|
|
527
|
+
async fn(t) {
|
|
528
|
+
const {
|
|
529
|
+
x: n,
|
|
530
|
+
y: o,
|
|
531
|
+
placement: r
|
|
532
|
+
} = t, {
|
|
533
|
+
mainAxis: s = !0,
|
|
534
|
+
crossAxis: i = !1,
|
|
535
|
+
limiter: l = {
|
|
536
|
+
fn: (v) => {
|
|
537
|
+
let {
|
|
538
|
+
x: g,
|
|
539
|
+
y: x
|
|
540
|
+
} = v;
|
|
541
|
+
return {
|
|
542
|
+
x: g,
|
|
543
|
+
y: x
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
...a
|
|
548
|
+
} = fe(e, t), c = {
|
|
549
|
+
x: n,
|
|
550
|
+
y: o
|
|
551
|
+
}, f = await He(t, a), u = Y(j(r)), m = We(u);
|
|
552
|
+
let d = c[m], h = c[u];
|
|
553
|
+
if (s) {
|
|
554
|
+
const v = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", x = d + f[v], w = d - f[g];
|
|
555
|
+
d = Me(x, d, w);
|
|
556
|
+
}
|
|
557
|
+
if (i) {
|
|
558
|
+
const v = u === "y" ? "top" : "left", g = u === "y" ? "bottom" : "right", x = h + f[v], w = h - f[g];
|
|
559
|
+
h = Me(x, h, w);
|
|
560
|
+
}
|
|
561
|
+
const y = l.fn({
|
|
562
|
+
...t,
|
|
563
|
+
[m]: d,
|
|
564
|
+
[u]: h
|
|
565
|
+
});
|
|
566
|
+
return {
|
|
567
|
+
...y,
|
|
568
|
+
data: {
|
|
569
|
+
x: y.x - n,
|
|
570
|
+
y: y.y - o,
|
|
571
|
+
enabled: {
|
|
572
|
+
[m]: s,
|
|
573
|
+
[u]: i
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
function me() {
|
|
581
|
+
return typeof window < "u";
|
|
582
|
+
}
|
|
583
|
+
function X(e) {
|
|
584
|
+
return Ce(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
585
|
+
}
|
|
586
|
+
function R(e) {
|
|
587
|
+
var t;
|
|
588
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
589
|
+
}
|
|
590
|
+
function P(e) {
|
|
591
|
+
var t;
|
|
592
|
+
return (t = (Ce(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
593
|
+
}
|
|
594
|
+
function Ce(e) {
|
|
595
|
+
return me() ? e instanceof Node || e instanceof R(e).Node : !1;
|
|
596
|
+
}
|
|
597
|
+
function E(e) {
|
|
598
|
+
return me() ? e instanceof Element || e instanceof R(e).Element : !1;
|
|
599
|
+
}
|
|
600
|
+
function N(e) {
|
|
601
|
+
return me() ? e instanceof HTMLElement || e instanceof R(e).HTMLElement : !1;
|
|
602
|
+
}
|
|
603
|
+
function Pe(e) {
|
|
604
|
+
return !me() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof R(e).ShadowRoot;
|
|
605
|
+
}
|
|
606
|
+
const Yt = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
607
|
+
function re(e) {
|
|
608
|
+
const {
|
|
609
|
+
overflow: t,
|
|
610
|
+
overflowX: n,
|
|
611
|
+
overflowY: o,
|
|
612
|
+
display: r
|
|
613
|
+
} = M(e);
|
|
614
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !Yt.has(r);
|
|
615
|
+
}
|
|
616
|
+
const Wt = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
617
|
+
function qt(e) {
|
|
618
|
+
return Wt.has(X(e));
|
|
619
|
+
}
|
|
620
|
+
const zt = [":popover-open", ":modal"];
|
|
621
|
+
function pe(e) {
|
|
622
|
+
return zt.some((t) => {
|
|
623
|
+
try {
|
|
624
|
+
return e.matches(t);
|
|
625
|
+
} catch {
|
|
626
|
+
return !1;
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
const Ht = ["transform", "translate", "scale", "rotate", "perspective"], It = ["transform", "translate", "scale", "rotate", "perspective", "filter"], jt = ["paint", "layout", "strict", "content"];
|
|
631
|
+
function ke(e) {
|
|
632
|
+
const t = Ae(), n = E(e) ? M(e) : e;
|
|
633
|
+
return Ht.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || It.some((o) => (n.willChange || "").includes(o)) || jt.some((o) => (n.contain || "").includes(o));
|
|
634
|
+
}
|
|
635
|
+
function Jt(e) {
|
|
636
|
+
let t = W(e);
|
|
637
|
+
for (; N(t) && !Q(t); ) {
|
|
638
|
+
if (ke(t))
|
|
639
|
+
return t;
|
|
640
|
+
if (pe(t))
|
|
641
|
+
return null;
|
|
642
|
+
t = W(t);
|
|
643
|
+
}
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
function Ae() {
|
|
647
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
648
|
+
}
|
|
649
|
+
const Xt = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
650
|
+
function Q(e) {
|
|
651
|
+
return Xt.has(X(e));
|
|
652
|
+
}
|
|
653
|
+
function M(e) {
|
|
654
|
+
return R(e).getComputedStyle(e);
|
|
655
|
+
}
|
|
656
|
+
function he(e) {
|
|
657
|
+
return E(e) ? {
|
|
658
|
+
scrollLeft: e.scrollLeft,
|
|
659
|
+
scrollTop: e.scrollTop
|
|
660
|
+
} : {
|
|
661
|
+
scrollLeft: e.scrollX,
|
|
662
|
+
scrollTop: e.scrollY
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
function W(e) {
|
|
666
|
+
if (X(e) === "html")
|
|
667
|
+
return e;
|
|
668
|
+
const t = (
|
|
669
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
670
|
+
e.assignedSlot || // DOM Element detected.
|
|
671
|
+
e.parentNode || // ShadowRoot detected.
|
|
672
|
+
Pe(e) && e.host || // Fallback.
|
|
673
|
+
P(e)
|
|
674
|
+
);
|
|
675
|
+
return Pe(t) ? t.host : t;
|
|
676
|
+
}
|
|
677
|
+
function Ie(e) {
|
|
678
|
+
const t = W(e);
|
|
679
|
+
return Q(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : N(t) && re(t) ? t : Ie(t);
|
|
680
|
+
}
|
|
681
|
+
function oe(e, t, n) {
|
|
682
|
+
var o;
|
|
683
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
684
|
+
const r = Ie(e), s = r === ((o = e.ownerDocument) == null ? void 0 : o.body), i = R(r);
|
|
685
|
+
if (s) {
|
|
686
|
+
const l = be(i);
|
|
687
|
+
return t.concat(i, i.visualViewport || [], re(r) ? r : [], l && n ? oe(l) : []);
|
|
688
|
+
}
|
|
689
|
+
return t.concat(r, oe(r, [], n));
|
|
690
|
+
}
|
|
691
|
+
function be(e) {
|
|
692
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
693
|
+
}
|
|
694
|
+
function je(e) {
|
|
695
|
+
const t = M(e);
|
|
696
|
+
let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
|
|
697
|
+
const r = N(e), s = r ? e.offsetWidth : n, i = r ? e.offsetHeight : o, l = ce(n) !== s || ce(o) !== i;
|
|
698
|
+
return l && (n = s, o = i), {
|
|
699
|
+
width: n,
|
|
700
|
+
height: o,
|
|
701
|
+
$: l
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
function Se(e) {
|
|
705
|
+
return E(e) ? e : e.contextElement;
|
|
706
|
+
}
|
|
707
|
+
function K(e) {
|
|
708
|
+
const t = Se(e);
|
|
709
|
+
if (!N(t))
|
|
710
|
+
return T(1);
|
|
711
|
+
const n = t.getBoundingClientRect(), {
|
|
712
|
+
width: o,
|
|
713
|
+
height: r,
|
|
714
|
+
$: s
|
|
715
|
+
} = je(t);
|
|
716
|
+
let i = (s ? ce(n.width) : n.width) / o, l = (s ? ce(n.height) : n.height) / r;
|
|
717
|
+
return (!i || !Number.isFinite(i)) && (i = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
718
|
+
x: i,
|
|
719
|
+
y: l
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
const Ut = /* @__PURE__ */ T(0);
|
|
723
|
+
function Je(e) {
|
|
724
|
+
const t = R(e);
|
|
725
|
+
return !Ae() || !t.visualViewport ? Ut : {
|
|
726
|
+
x: t.visualViewport.offsetLeft,
|
|
727
|
+
y: t.visualViewport.offsetTop
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
function Gt(e, t, n) {
|
|
731
|
+
return t === void 0 && (t = !1), !n || t && n !== R(e) ? !1 : t;
|
|
732
|
+
}
|
|
733
|
+
function J(e, t, n, o) {
|
|
734
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
735
|
+
const r = e.getBoundingClientRect(), s = Se(e);
|
|
736
|
+
let i = T(1);
|
|
737
|
+
t && (o ? E(o) && (i = K(o)) : i = K(e));
|
|
738
|
+
const l = Gt(s, n, o) ? Je(s) : T(0);
|
|
739
|
+
let a = (r.left + l.x) / i.x, c = (r.top + l.y) / i.y, f = r.width / i.x, u = r.height / i.y;
|
|
740
|
+
if (s) {
|
|
741
|
+
const m = R(s), d = o && E(o) ? R(o) : o;
|
|
742
|
+
let h = m, y = be(h);
|
|
743
|
+
for (; y && o && d !== h; ) {
|
|
744
|
+
const v = K(y), g = y.getBoundingClientRect(), x = M(y), w = g.left + (y.clientLeft + parseFloat(x.paddingLeft)) * v.x, D = g.top + (y.clientTop + parseFloat(x.paddingTop)) * v.y;
|
|
745
|
+
a *= v.x, c *= v.y, f *= v.x, u *= v.y, a += w, c += D, h = R(y), y = be(h);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
return ue({
|
|
749
|
+
width: f,
|
|
750
|
+
height: u,
|
|
751
|
+
x: a,
|
|
752
|
+
y: c
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
function Re(e, t) {
|
|
756
|
+
const n = he(e).scrollLeft;
|
|
757
|
+
return t ? t.left + n : J(P(e)).left + n;
|
|
758
|
+
}
|
|
759
|
+
function Xe(e, t, n) {
|
|
760
|
+
n === void 0 && (n = !1);
|
|
761
|
+
const o = e.getBoundingClientRect(), r = o.left + t.scrollLeft - (n ? 0 : (
|
|
762
|
+
// RTL <body> scrollbar.
|
|
763
|
+
Re(e, o)
|
|
764
|
+
)), s = o.top + t.scrollTop;
|
|
765
|
+
return {
|
|
766
|
+
x: r,
|
|
767
|
+
y: s
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
function Kt(e) {
|
|
771
|
+
let {
|
|
772
|
+
elements: t,
|
|
773
|
+
rect: n,
|
|
774
|
+
offsetParent: o,
|
|
775
|
+
strategy: r
|
|
776
|
+
} = e;
|
|
777
|
+
const s = r === "fixed", i = P(o), l = t ? pe(t.floating) : !1;
|
|
778
|
+
if (o === i || l && s)
|
|
779
|
+
return n;
|
|
780
|
+
let a = {
|
|
781
|
+
scrollLeft: 0,
|
|
782
|
+
scrollTop: 0
|
|
783
|
+
}, c = T(1);
|
|
784
|
+
const f = T(0), u = N(o);
|
|
785
|
+
if ((u || !u && !s) && ((X(o) !== "body" || re(i)) && (a = he(o)), N(o))) {
|
|
786
|
+
const d = J(o);
|
|
787
|
+
c = K(o), f.x = d.x + o.clientLeft, f.y = d.y + o.clientTop;
|
|
788
|
+
}
|
|
789
|
+
const m = i && !u && !s ? Xe(i, a, !0) : T(0);
|
|
790
|
+
return {
|
|
791
|
+
width: n.width * c.x,
|
|
792
|
+
height: n.height * c.y,
|
|
793
|
+
x: n.x * c.x - a.scrollLeft * c.x + f.x + m.x,
|
|
794
|
+
y: n.y * c.y - a.scrollTop * c.y + f.y + m.y
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
function Qt(e) {
|
|
798
|
+
return Array.from(e.getClientRects());
|
|
799
|
+
}
|
|
800
|
+
function Zt(e) {
|
|
801
|
+
const t = P(e), n = he(e), o = e.ownerDocument.body, r = I(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), s = I(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
|
|
802
|
+
let i = -n.scrollLeft + Re(e);
|
|
803
|
+
const l = -n.scrollTop;
|
|
804
|
+
return M(o).direction === "rtl" && (i += I(t.clientWidth, o.clientWidth) - r), {
|
|
805
|
+
width: r,
|
|
806
|
+
height: s,
|
|
807
|
+
x: i,
|
|
808
|
+
y: l
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
function en(e, t) {
|
|
812
|
+
const n = R(e), o = P(e), r = n.visualViewport;
|
|
813
|
+
let s = o.clientWidth, i = o.clientHeight, l = 0, a = 0;
|
|
814
|
+
if (r) {
|
|
815
|
+
s = r.width, i = r.height;
|
|
816
|
+
const c = Ae();
|
|
817
|
+
(!c || c && t === "fixed") && (l = r.offsetLeft, a = r.offsetTop);
|
|
818
|
+
}
|
|
819
|
+
return {
|
|
820
|
+
width: s,
|
|
821
|
+
height: i,
|
|
822
|
+
x: l,
|
|
823
|
+
y: a
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
const tn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
827
|
+
function nn(e, t) {
|
|
828
|
+
const n = J(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, s = N(e) ? K(e) : T(1), i = e.clientWidth * s.x, l = e.clientHeight * s.y, a = r * s.x, c = o * s.y;
|
|
829
|
+
return {
|
|
830
|
+
width: i,
|
|
831
|
+
height: l,
|
|
832
|
+
x: a,
|
|
833
|
+
y: c
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
function Fe(e, t, n) {
|
|
837
|
+
let o;
|
|
838
|
+
if (t === "viewport")
|
|
839
|
+
o = en(e, n);
|
|
840
|
+
else if (t === "document")
|
|
841
|
+
o = Zt(P(e));
|
|
842
|
+
else if (E(t))
|
|
843
|
+
o = nn(t, n);
|
|
844
|
+
else {
|
|
845
|
+
const r = Je(e);
|
|
846
|
+
o = {
|
|
847
|
+
x: t.x - r.x,
|
|
848
|
+
y: t.y - r.y,
|
|
849
|
+
width: t.width,
|
|
850
|
+
height: t.height
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
return ue(o);
|
|
854
|
+
}
|
|
855
|
+
function Ue(e, t) {
|
|
856
|
+
const n = W(e);
|
|
857
|
+
return n === t || !E(n) || Q(n) ? !1 : M(n).position === "fixed" || Ue(n, t);
|
|
858
|
+
}
|
|
859
|
+
function on(e, t) {
|
|
860
|
+
const n = t.get(e);
|
|
861
|
+
if (n)
|
|
862
|
+
return n;
|
|
863
|
+
let o = oe(e, [], !1).filter((l) => E(l) && X(l) !== "body"), r = null;
|
|
864
|
+
const s = M(e).position === "fixed";
|
|
865
|
+
let i = s ? W(e) : e;
|
|
866
|
+
for (; E(i) && !Q(i); ) {
|
|
867
|
+
const l = M(i), a = ke(i);
|
|
868
|
+
!a && l.position === "fixed" && (r = null), (s ? !a && !r : !a && l.position === "static" && !!r && tn.has(r.position) || re(i) && !a && Ue(e, i)) ? o = o.filter((f) => f !== i) : r = l, i = W(i);
|
|
869
|
+
}
|
|
870
|
+
return t.set(e, o), o;
|
|
871
|
+
}
|
|
872
|
+
function rn(e) {
|
|
873
|
+
let {
|
|
874
|
+
element: t,
|
|
875
|
+
boundary: n,
|
|
876
|
+
rootBoundary: o,
|
|
877
|
+
strategy: r
|
|
878
|
+
} = e;
|
|
879
|
+
const i = [...n === "clippingAncestors" ? pe(t) ? [] : on(t, this._c) : [].concat(n), o], l = i[0], a = i.reduce((c, f) => {
|
|
880
|
+
const u = Fe(t, f, r);
|
|
881
|
+
return c.top = I(u.top, c.top), c.right = le(u.right, c.right), c.bottom = le(u.bottom, c.bottom), c.left = I(u.left, c.left), c;
|
|
882
|
+
}, Fe(t, l, r));
|
|
883
|
+
return {
|
|
884
|
+
width: a.right - a.left,
|
|
885
|
+
height: a.bottom - a.top,
|
|
886
|
+
x: a.left,
|
|
887
|
+
y: a.top
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function sn(e) {
|
|
891
|
+
const {
|
|
892
|
+
width: t,
|
|
893
|
+
height: n
|
|
894
|
+
} = je(e);
|
|
895
|
+
return {
|
|
896
|
+
width: t,
|
|
897
|
+
height: n
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
function ln(e, t, n) {
|
|
901
|
+
const o = N(t), r = P(t), s = n === "fixed", i = J(e, !0, s, t);
|
|
902
|
+
let l = {
|
|
903
|
+
scrollLeft: 0,
|
|
904
|
+
scrollTop: 0
|
|
905
|
+
};
|
|
906
|
+
const a = T(0);
|
|
907
|
+
function c() {
|
|
908
|
+
a.x = Re(r);
|
|
909
|
+
}
|
|
910
|
+
if (o || !o && !s)
|
|
911
|
+
if ((X(t) !== "body" || re(r)) && (l = he(t)), o) {
|
|
912
|
+
const d = J(t, !0, s, t);
|
|
913
|
+
a.x = d.x + t.clientLeft, a.y = d.y + t.clientTop;
|
|
914
|
+
} else
|
|
915
|
+
r && c();
|
|
916
|
+
s && !o && r && c();
|
|
917
|
+
const f = r && !o && !s ? Xe(r, l) : T(0), u = i.left + l.scrollLeft - a.x - f.x, m = i.top + l.scrollTop - a.y - f.y;
|
|
918
|
+
return {
|
|
919
|
+
x: u,
|
|
920
|
+
y: m,
|
|
921
|
+
width: i.width,
|
|
922
|
+
height: i.height
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function xe(e) {
|
|
926
|
+
return M(e).position === "static";
|
|
927
|
+
}
|
|
928
|
+
function Ve(e, t) {
|
|
929
|
+
if (!N(e) || M(e).position === "fixed")
|
|
930
|
+
return null;
|
|
931
|
+
if (t)
|
|
932
|
+
return t(e);
|
|
933
|
+
let n = e.offsetParent;
|
|
934
|
+
return P(e) === n && (n = n.ownerDocument.body), n;
|
|
935
|
+
}
|
|
936
|
+
function Ge(e, t) {
|
|
937
|
+
const n = R(e);
|
|
938
|
+
if (pe(e))
|
|
939
|
+
return n;
|
|
940
|
+
if (!N(e)) {
|
|
941
|
+
let r = W(e);
|
|
942
|
+
for (; r && !Q(r); ) {
|
|
943
|
+
if (E(r) && !xe(r))
|
|
944
|
+
return r;
|
|
945
|
+
r = W(r);
|
|
946
|
+
}
|
|
947
|
+
return n;
|
|
948
|
+
}
|
|
949
|
+
let o = Ve(e, t);
|
|
950
|
+
for (; o && qt(o) && xe(o); )
|
|
951
|
+
o = Ve(o, t);
|
|
952
|
+
return o && Q(o) && xe(o) && !ke(o) ? n : o || Jt(e) || n;
|
|
953
|
+
}
|
|
954
|
+
const cn = async function(e) {
|
|
955
|
+
const t = this.getOffsetParent || Ge, n = this.getDimensions, o = await n(e.floating);
|
|
956
|
+
return {
|
|
957
|
+
reference: ln(e.reference, await t(e.floating), e.strategy),
|
|
958
|
+
floating: {
|
|
959
|
+
x: 0,
|
|
960
|
+
y: 0,
|
|
961
|
+
width: o.width,
|
|
962
|
+
height: o.height
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
};
|
|
966
|
+
function an(e) {
|
|
967
|
+
return M(e).direction === "rtl";
|
|
968
|
+
}
|
|
969
|
+
const un = {
|
|
970
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Kt,
|
|
971
|
+
getDocumentElement: P,
|
|
972
|
+
getClippingRect: rn,
|
|
973
|
+
getOffsetParent: Ge,
|
|
974
|
+
getElementRects: cn,
|
|
975
|
+
getClientRects: Qt,
|
|
976
|
+
getDimensions: sn,
|
|
977
|
+
getScale: K,
|
|
978
|
+
isElement: E,
|
|
979
|
+
isRTL: an
|
|
980
|
+
};
|
|
981
|
+
function Ke(e, t) {
|
|
982
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
983
|
+
}
|
|
984
|
+
function fn(e, t) {
|
|
985
|
+
let n = null, o;
|
|
986
|
+
const r = P(e);
|
|
987
|
+
function s() {
|
|
988
|
+
var l;
|
|
989
|
+
clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
|
|
990
|
+
}
|
|
991
|
+
function i(l, a) {
|
|
992
|
+
l === void 0 && (l = !1), a === void 0 && (a = 1), s();
|
|
993
|
+
const c = e.getBoundingClientRect(), {
|
|
994
|
+
left: f,
|
|
995
|
+
top: u,
|
|
996
|
+
width: m,
|
|
997
|
+
height: d
|
|
998
|
+
} = c;
|
|
999
|
+
if (l || t(), !m || !d)
|
|
1000
|
+
return;
|
|
1001
|
+
const h = se(u), y = se(r.clientWidth - (f + m)), v = se(r.clientHeight - (u + d)), g = se(f), w = {
|
|
1002
|
+
rootMargin: -h + "px " + -y + "px " + -v + "px " + -g + "px",
|
|
1003
|
+
threshold: I(0, le(1, a)) || 1
|
|
1004
|
+
};
|
|
1005
|
+
let D = !0;
|
|
1006
|
+
function b(L) {
|
|
1007
|
+
const p = L[0].intersectionRatio;
|
|
1008
|
+
if (p !== a) {
|
|
1009
|
+
if (!D)
|
|
1010
|
+
return i();
|
|
1011
|
+
p ? i(!1, p) : o = setTimeout(() => {
|
|
1012
|
+
i(!1, 1e-7);
|
|
1013
|
+
}, 1e3);
|
|
1014
|
+
}
|
|
1015
|
+
p === 1 && !Ke(c, e.getBoundingClientRect()) && i(), D = !1;
|
|
1016
|
+
}
|
|
1017
|
+
try {
|
|
1018
|
+
n = new IntersectionObserver(b, {
|
|
1019
|
+
...w,
|
|
1020
|
+
// Handle <iframe>s
|
|
1021
|
+
root: r.ownerDocument
|
|
1022
|
+
});
|
|
1023
|
+
} catch {
|
|
1024
|
+
n = new IntersectionObserver(b, w);
|
|
1025
|
+
}
|
|
1026
|
+
n.observe(e);
|
|
1027
|
+
}
|
|
1028
|
+
return i(!0), s;
|
|
1029
|
+
}
|
|
1030
|
+
function dn(e, t, n, o) {
|
|
1031
|
+
o === void 0 && (o = {});
|
|
1032
|
+
const {
|
|
1033
|
+
ancestorScroll: r = !0,
|
|
1034
|
+
ancestorResize: s = !0,
|
|
1035
|
+
elementResize: i = typeof ResizeObserver == "function",
|
|
1036
|
+
layoutShift: l = typeof IntersectionObserver == "function",
|
|
1037
|
+
animationFrame: a = !1
|
|
1038
|
+
} = o, c = Se(e), f = r || s ? [...c ? oe(c) : [], ...oe(t)] : [];
|
|
1039
|
+
f.forEach((g) => {
|
|
1040
|
+
r && g.addEventListener("scroll", n, {
|
|
1041
|
+
passive: !0
|
|
1042
|
+
}), s && g.addEventListener("resize", n);
|
|
1043
|
+
});
|
|
1044
|
+
const u = c && l ? fn(c, n) : null;
|
|
1045
|
+
let m = -1, d = null;
|
|
1046
|
+
i && (d = new ResizeObserver((g) => {
|
|
1047
|
+
let [x] = g;
|
|
1048
|
+
x && x.target === c && d && (d.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1049
|
+
var w;
|
|
1050
|
+
(w = d) == null || w.observe(t);
|
|
1051
|
+
})), n();
|
|
1052
|
+
}), c && !a && d.observe(c), d.observe(t));
|
|
1053
|
+
let h, y = a ? J(e) : null;
|
|
1054
|
+
a && v();
|
|
1055
|
+
function v() {
|
|
1056
|
+
const g = J(e);
|
|
1057
|
+
y && !Ke(y, g) && n(), y = g, h = requestAnimationFrame(v);
|
|
1058
|
+
}
|
|
1059
|
+
return n(), () => {
|
|
1060
|
+
var g;
|
|
1061
|
+
f.forEach((x) => {
|
|
1062
|
+
r && x.removeEventListener("scroll", n), s && x.removeEventListener("resize", n);
|
|
1063
|
+
}), u == null || u(), (g = d) == null || g.disconnect(), d = null, a && cancelAnimationFrame(h);
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
const mn = $t, pn = Bt, hn = Pt, gn = (e, t, n) => {
|
|
1067
|
+
const o = /* @__PURE__ */ new Map(), r = {
|
|
1068
|
+
platform: un,
|
|
1069
|
+
...n
|
|
1070
|
+
}, s = {
|
|
1071
|
+
...r.platform,
|
|
1072
|
+
_c: o
|
|
1073
|
+
};
|
|
1074
|
+
return Nt(e, t, {
|
|
1075
|
+
...r,
|
|
1076
|
+
platform: s
|
|
1077
|
+
});
|
|
1078
|
+
};
|
|
1079
|
+
function vn(e) {
|
|
1080
|
+
return e != null && typeof e == "object" && "$el" in e;
|
|
1081
|
+
}
|
|
1082
|
+
function $e(e) {
|
|
1083
|
+
if (vn(e)) {
|
|
1084
|
+
const t = e.$el;
|
|
1085
|
+
return Ce(t) && X(t) === "#comment" ? null : t;
|
|
1086
|
+
}
|
|
1087
|
+
return e;
|
|
1088
|
+
}
|
|
1089
|
+
function ee(e) {
|
|
1090
|
+
return typeof e == "function" ? e() : Ye(e);
|
|
1091
|
+
}
|
|
1092
|
+
function Qe(e) {
|
|
1093
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1094
|
+
}
|
|
1095
|
+
function Be(e, t) {
|
|
1096
|
+
const n = Qe(e);
|
|
1097
|
+
return Math.round(t * n) / n;
|
|
1098
|
+
}
|
|
1099
|
+
function yn(e, t, n) {
|
|
1100
|
+
n === void 0 && (n = {});
|
|
1101
|
+
const o = n.whileElementsMounted, r = S(() => {
|
|
1102
|
+
var p;
|
|
1103
|
+
return (p = ee(n.open)) != null ? p : !0;
|
|
1104
|
+
}), s = S(() => ee(n.middleware)), i = S(() => {
|
|
1105
|
+
var p;
|
|
1106
|
+
return (p = ee(n.placement)) != null ? p : "bottom";
|
|
1107
|
+
}), l = S(() => {
|
|
1108
|
+
var p;
|
|
1109
|
+
return (p = ee(n.strategy)) != null ? p : "absolute";
|
|
1110
|
+
}), a = S(() => {
|
|
1111
|
+
var p;
|
|
1112
|
+
return (p = ee(n.transform)) != null ? p : !0;
|
|
1113
|
+
}), c = S(() => $e(e.value)), f = S(() => $e(t.value)), u = O(0), m = O(0), d = O(l.value), h = O(i.value), y = et({}), v = O(!1), g = S(() => {
|
|
1114
|
+
const p = {
|
|
1115
|
+
position: d.value,
|
|
1116
|
+
left: "0",
|
|
1117
|
+
top: "0"
|
|
1118
|
+
};
|
|
1119
|
+
if (!f.value)
|
|
1120
|
+
return p;
|
|
1121
|
+
const k = Be(f.value, u.value), F = Be(f.value, m.value);
|
|
1122
|
+
return a.value ? {
|
|
1123
|
+
...p,
|
|
1124
|
+
transform: "translate(" + k + "px, " + F + "px)",
|
|
1125
|
+
...Qe(f.value) >= 1.5 && {
|
|
1126
|
+
willChange: "transform"
|
|
1127
|
+
}
|
|
1128
|
+
} : {
|
|
1129
|
+
position: d.value,
|
|
1130
|
+
left: k + "px",
|
|
1131
|
+
top: F + "px"
|
|
1132
|
+
};
|
|
1133
|
+
});
|
|
1134
|
+
let x;
|
|
1135
|
+
function w() {
|
|
1136
|
+
if (c.value == null || f.value == null)
|
|
1137
|
+
return;
|
|
1138
|
+
const p = r.value;
|
|
1139
|
+
gn(c.value, f.value, {
|
|
1140
|
+
middleware: s.value,
|
|
1141
|
+
placement: i.value,
|
|
1142
|
+
strategy: l.value
|
|
1143
|
+
}).then((k) => {
|
|
1144
|
+
u.value = k.x, m.value = k.y, d.value = k.strategy, h.value = k.placement, y.value = k.middlewareData, v.value = p !== !1;
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
function D() {
|
|
1148
|
+
typeof x == "function" && (x(), x = void 0);
|
|
1149
|
+
}
|
|
1150
|
+
function b() {
|
|
1151
|
+
if (D(), o === void 0) {
|
|
1152
|
+
w();
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
if (c.value != null && f.value != null) {
|
|
1156
|
+
x = o(c.value, f.value, w);
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
function L() {
|
|
1161
|
+
r.value || (v.value = !1);
|
|
1162
|
+
}
|
|
1163
|
+
return ve([s, i, l, r], w, {
|
|
1164
|
+
flush: "sync"
|
|
1165
|
+
}), ve([c, f], b, {
|
|
1166
|
+
flush: "sync"
|
|
1167
|
+
}), ve(r, L, {
|
|
1168
|
+
flush: "sync"
|
|
1169
|
+
}), tt() && nt(D), {
|
|
1170
|
+
x: G(u),
|
|
1171
|
+
y: G(m),
|
|
1172
|
+
strategy: G(d),
|
|
1173
|
+
placement: G(h),
|
|
1174
|
+
middlewareData: G(y),
|
|
1175
|
+
isPositioned: G(v),
|
|
1176
|
+
floatingStyles: g,
|
|
1177
|
+
update: w
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
const xn = { class: "flex flex-col w-full" }, wn = { class: "flex flex-row mb-[15px] justify-between items-center" }, bn = { class: "flex flex-row items-center gap-[8px]" }, Dn = {
|
|
1181
|
+
key: 2,
|
|
1182
|
+
class: "text-style-label"
|
|
1183
|
+
}, te = 12, Rn = {
|
|
1184
|
+
__name: "DatePicker",
|
|
1185
|
+
props: /* @__PURE__ */ ot({
|
|
1186
|
+
year: {
|
|
1187
|
+
type: Number,
|
|
1188
|
+
required: !1,
|
|
1189
|
+
default: (/* @__PURE__ */ new Date()).getFullYear()
|
|
1190
|
+
},
|
|
1191
|
+
month: {
|
|
1192
|
+
type: Number,
|
|
1193
|
+
required: !1,
|
|
1194
|
+
default: (/* @__PURE__ */ new Date()).getMonth()
|
|
1195
|
+
}
|
|
1196
|
+
}, {
|
|
1197
|
+
modelValue: {},
|
|
1198
|
+
modelModifiers: {}
|
|
1199
|
+
}),
|
|
1200
|
+
emits: ["update:modelValue"],
|
|
1201
|
+
setup(e) {
|
|
1202
|
+
const t = e, n = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], o = rt(e, "modelValue"), r = O(null), s = O(null), { floatingStyles: i } = yn(r, s, {
|
|
1203
|
+
placement: "bottom-start",
|
|
1204
|
+
middleware: [mn(8), hn(), pn()],
|
|
1205
|
+
whileElementsMounted: dn
|
|
1206
|
+
}), l = (p) => p instanceof Date ? p : typeof p == "string" && p ? new Date(p) : null, a = (p) => {
|
|
1207
|
+
o.value = p;
|
|
1208
|
+
}, c = O(t.month), f = O(t.year), u = O(!1), m = O("days"), d = O(h(t.year));
|
|
1209
|
+
function h(p) {
|
|
1210
|
+
return Math.floor(p / te) * te;
|
|
1211
|
+
}
|
|
1212
|
+
const y = S(() => `${d.value} – ${d.value + te - 1}`), v = (p) => {
|
|
1213
|
+
m.value === "days" ? g(p) : m.value === "months" ? f.value += p : d.value += p * te;
|
|
1214
|
+
}, g = (p) => {
|
|
1215
|
+
c.value += p, c.value < 0 && (c.value = 11, f.value -= 1), c.value > 11 && (c.value = 0, f.value += 1);
|
|
1216
|
+
}, x = () => {
|
|
1217
|
+
m.value = "months";
|
|
1218
|
+
}, w = () => {
|
|
1219
|
+
d.value = h(f.value), m.value = "years";
|
|
1220
|
+
}, D = (p) => {
|
|
1221
|
+
c.value = p, m.value = "days";
|
|
1222
|
+
}, b = (p) => {
|
|
1223
|
+
f.value = p, m.value = "days";
|
|
1224
|
+
}, L = () => {
|
|
1225
|
+
const p = l(o.value);
|
|
1226
|
+
p && (c.value = p.getMonth(), f.value = p.getFullYear()), d.value = h(f.value), m.value = "days", u.value = !u.value;
|
|
1227
|
+
};
|
|
1228
|
+
return (p, k) => (C(), A("div", xn, [
|
|
1229
|
+
V("div", {
|
|
1230
|
+
ref_key: "referenceEl",
|
|
1231
|
+
ref: r
|
|
1232
|
+
}, [
|
|
1233
|
+
st(p.$slots, "button", { openCalendar: L }, () => [
|
|
1234
|
+
ie(ut, {
|
|
1235
|
+
class: "text-steel-950 dark:text-content-muted cursor-pointer",
|
|
1236
|
+
onClick: L
|
|
1237
|
+
})
|
|
1238
|
+
])
|
|
1239
|
+
], 512),
|
|
1240
|
+
u.value ? (C(), A("div", {
|
|
1241
|
+
key: 0,
|
|
1242
|
+
ref_key: "floatingEl",
|
|
1243
|
+
ref: s,
|
|
1244
|
+
class: "w-[310px] p-[15px] rounded-[20px] shadow-[0_2px_4px_0_rgba(0,0,0,0.12),0_2px_10px_0_rgba(0,0,0,0.12)] z-50 bg-surface-raised",
|
|
1245
|
+
style: it(Ye(i))
|
|
1246
|
+
}, [
|
|
1247
|
+
V("div", wn, [
|
|
1248
|
+
ie(ct, {
|
|
1249
|
+
class: "text-steel-800 dark:text-content-muted cursor-pointer",
|
|
1250
|
+
onClick: k[0] || (k[0] = (F) => v(-1))
|
|
1251
|
+
}),
|
|
1252
|
+
V("div", bn, [
|
|
1253
|
+
m.value === "days" ? (C(), A(H, { key: 0 }, [
|
|
1254
|
+
V("button", {
|
|
1255
|
+
type: "button",
|
|
1256
|
+
class: "text-style-label hover:text-app-950 dark:hover:text-app-300 cursor-pointer",
|
|
1257
|
+
onClick: x
|
|
1258
|
+
}, B(n[c.value]), 1),
|
|
1259
|
+
V("button", {
|
|
1260
|
+
type: "button",
|
|
1261
|
+
class: "text-style-label hover:text-app-950 dark:hover:text-app-300 cursor-pointer",
|
|
1262
|
+
onClick: w
|
|
1263
|
+
}, B(f.value), 1)
|
|
1264
|
+
], 64)) : m.value === "months" ? (C(), A("button", {
|
|
1265
|
+
key: 1,
|
|
1266
|
+
type: "button",
|
|
1267
|
+
class: "text-style-label hover:text-app-950 dark:hover:text-app-300 cursor-pointer",
|
|
1268
|
+
onClick: w
|
|
1269
|
+
}, B(f.value), 1)) : (C(), A("p", Dn, B(y.value), 1))
|
|
1270
|
+
]),
|
|
1271
|
+
ie(at, {
|
|
1272
|
+
class: "text-steel-800 dark:text-content-muted cursor-pointer",
|
|
1273
|
+
onClick: k[1] || (k[1] = (F) => v(1))
|
|
1274
|
+
})
|
|
1275
|
+
]),
|
|
1276
|
+
m.value === "days" ? (C(), ye(gt, {
|
|
1277
|
+
key: 0,
|
|
1278
|
+
year: f.value,
|
|
1279
|
+
month: c.value,
|
|
1280
|
+
onSelectDay: a,
|
|
1281
|
+
selectedDate: l(o.value)
|
|
1282
|
+
}, null, 8, ["year", "month", "selectedDate"])) : m.value === "months" ? (C(), ye(xt, {
|
|
1283
|
+
key: 1,
|
|
1284
|
+
month: c.value,
|
|
1285
|
+
year: f.value,
|
|
1286
|
+
onSelectMonth: D
|
|
1287
|
+
}, null, 8, ["month", "year"])) : (C(), ye(Dt, {
|
|
1288
|
+
key: 2,
|
|
1289
|
+
year: f.value,
|
|
1290
|
+
startYear: d.value,
|
|
1291
|
+
count: te,
|
|
1292
|
+
onSelectYear: b
|
|
1293
|
+
}, null, 8, ["year", "startYear"]))
|
|
1294
|
+
], 4)) : lt("", !0)
|
|
1295
|
+
]));
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1298
|
+
export {
|
|
1299
|
+
Rn as _,
|
|
1300
|
+
gt as a,
|
|
1301
|
+
xt as b,
|
|
1302
|
+
Dt as c
|
|
1303
|
+
};
|