@dazhicheng/ui 1.4.13 → 1.4.15

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.
Files changed (71) hide show
  1. package/dist/components/tt-form-adapter/component/index.d.ts +1 -1
  2. package/dist/components/tt-form-adapter/component/index.d.ts.map +1 -1
  3. package/dist/components/tt-form-adapter/index.d.ts.map +1 -1
  4. package/dist/components/tt-icon/index.d.ts +6 -6
  5. package/dist/components/tt-icon/index.d.ts.map +1 -1
  6. package/dist/components/tt-icon/index.vue.d.ts +3 -3
  7. package/dist/components/tt-icon/index.vue.d.ts.map +1 -1
  8. package/dist/components/tt-image/src/components/ImageViewer.d.ts +1 -1
  9. package/dist/components/tt-modal/src/RenderModal.vue.d.ts.map +1 -1
  10. package/dist/components/tt-table/src/Table.vue.d.ts +7 -9
  11. package/dist/components/tt-table/src/Table.vue.d.ts.map +1 -1
  12. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts +27 -0
  13. package/dist/components/tt-table/src/components/TableColumnModal.vue.d.ts.map +1 -0
  14. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts +1552 -7
  15. package/dist/components/tt-table/src/components/TableToobalTools.vue.d.ts.map +1 -1
  16. package/dist/components/tt-table/src/hooks/useColumns.d.ts +0 -4
  17. package/dist/components/tt-table/src/hooks/useColumns.d.ts.map +1 -1
  18. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts +20 -0
  19. package/dist/components/tt-table/src/hooks/useCustomColumns.d.ts.map +1 -0
  20. package/dist/components/tt-table/src/hooks/useTable.d.ts.map +1 -1
  21. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts +2 -3
  22. package/dist/components/tt-table/src/hooks/useTableFormEvent.d.ts.map +1 -1
  23. package/dist/components/tt-table/src/hooks/useTableRender.d.ts +10 -1
  24. package/dist/components/tt-table/src/hooks/useTableRender.d.ts.map +1 -1
  25. package/dist/components/tt-table/src/props.d.ts +1 -1
  26. package/dist/components/tt-table/src/toolProps.d.ts +0 -60
  27. package/dist/components/tt-table/src/toolProps.d.ts.map +1 -1
  28. package/dist/components/tt-table/src/types/table.d.ts +13 -8
  29. package/dist/components/tt-table/src/types/table.d.ts.map +1 -1
  30. package/dist/components/tt-table/src/types/tableTools.d.ts +1 -45
  31. package/dist/components/tt-table/src/types/tableTools.d.ts.map +1 -1
  32. package/dist/components/tt-table/src/utils/table-api.d.ts +1 -1
  33. package/dist/components/types.d.ts +9 -0
  34. package/dist/components/types.d.ts.map +1 -1
  35. package/dist/{css-CKklk3nV.js → css-BizbCFH3.js} +1 -0
  36. package/dist/css-DhJ-Bn4t.js +4 -0
  37. package/dist/{event-C_r_01bn.js → event-DFRZD7LK.js} +1 -1
  38. package/dist/{icon-CKxtqBLK.js → icon-D7yoP9ir.js} +2 -2
  39. package/dist/{index-CHk1NLpk.js → index-BKQp009w.js} +22 -16
  40. package/dist/{index-C7qn1UjQ.js → index-BNG_AB7y.js} +8 -8
  41. package/dist/{index-0sV6PZ-L.js → index-BhA_CsrH.js} +1 -1
  42. package/dist/index-BxInQxCV.js +2502 -0
  43. package/dist/{index-I3VH5txt.js → index-By5cqZnL.js} +6 -6
  44. package/dist/{index-CIXiwqxC.js → index-ByEUv7a2.js} +20 -20
  45. package/dist/{index-DX4n5C_u.js → index-CGcdoMJn.js} +7 -7
  46. package/dist/{index-afVweXBa.js → index-CJS0mCv6.js} +1 -1
  47. package/dist/{index-COmSNXx2.js → index-CrIIQxqW.js} +5 -5
  48. package/dist/{index-p-7cEt4P.js → index-D3Ax_E0B.js} +1 -1
  49. package/dist/{index-DrCkiGhL.js → index-D9W_gSi5.js} +2 -2
  50. package/dist/index-DEFw7uAt.js +3559 -0
  51. package/dist/{index-BKBQ9LSK.js → index-Dfotp4tT.js} +5 -5
  52. package/dist/{index-DurviMFc.js → index-DpN6iVOJ.js} +6 -6
  53. package/dist/{index-BYF6ppI2.js → index-V1pYlrHZ.js} +121 -121
  54. package/dist/{index-zwYRmlIJ.js → index-VEk4bikw.js} +5 -5
  55. package/dist/{index-BjeMLuYy.js → index-WNukMwgV.js} +11762 -10475
  56. package/dist/index-YgAUM4hl.js +436 -0
  57. package/dist/{index-D6tBgSuG.js → index-jX-ESk9T.js} +2 -2
  58. package/dist/index.js +11 -11
  59. package/dist/panel-time-pick.vue2-CTavHx-6.js +1603 -0
  60. package/dist/style.css +1 -1
  61. package/dist/{use-form-common-props-P6zIrwYl.js → use-form-common-props-QWQdZzPI.js} +1 -1
  62. package/dist/{use-form-item-DJnou3Cp.js → use-form-item-aIqGB1on.js} +2 -2
  63. package/dist/useProps-B1w2fNNy.js +215 -0
  64. package/dist/{util-BGcGKsTj.js → util-Boou02y4.js} +6 -6
  65. package/package.json +4 -3
  66. package/dist/components/tt-table/src/TableForm.vue.d.ts +0 -150
  67. package/dist/components/tt-table/src/TableForm.vue.d.ts.map +0 -1
  68. package/dist/components/tt-table/src/hooks/useFullscreen.d.ts +0 -12
  69. package/dist/components/tt-table/src/hooks/useFullscreen.d.ts.map +0 -1
  70. package/dist/index-BHUeEk8T.js +0 -2700
  71. package/dist/panel-time-pick.vue2-Bjerz4F7.js +0 -2026
@@ -0,0 +1,1603 @@
1
+ import { s as At, t as Yt, w as et, a as se, j as Pe, U as dt, c as Ot, d as ve, C as Le, x as Ft, y as Rt, N as tt, f as $t, e as Lt } from "./index-WNukMwgV.js";
2
+ import { ref as G, computed as R, defineComponent as Ne, reactive as Nt, createElementBlock as Q, openBlock as A, normalizeStyle as ze, normalizeClass as H, unref as t, renderSlot as Te, createElementVNode as pe, mergeProps as We, useAttrs as Bt, inject as Ge, watch as Je, nextTick as Ce, onBeforeUnmount as Ht, provide as nt, createBlock as X, withCtx as ee, withModifiers as Ie, createCommentVNode as fe, resolveDynamicComponent as Oe, toDisplayString as ue, onMounted as _t, Fragment as ie, renderList as Fe, createTextVNode as Re, withDirectives as at, createVNode as qe, Transition as Ut } from "vue";
3
+ import { onClickOutside as Kt, unrefElement as jt } from "@vueuse/core";
4
+ import { u as zt, E as Wt } from "./index-CGcdoMJn.js";
5
+ import { E as Se, g as qt } from "./index-BKQp009w.js";
6
+ import { u as Zt, E as Gt, a as ot, b as Jt, c as xt } from "./util-Boou02y4.js";
7
+ import { isEqual as Qt, debounce as Xt } from "lodash-es";
8
+ import { u as pt } from "./index-BQfVaV7A.js";
9
+ import { p as ft, b as Me, a as U, u as en, j as tn, h as nn, d as st, e as an, g as on } from "./use-form-common-props-QWQdZzPI.js";
10
+ import { u as sn } from "./index-D3Ax_E0B.js";
11
+ import { u as mt, a as rn } from "./use-form-item-aIqGB1on.js";
12
+ import { u as vt } from "./index-jX-ESk9T.js";
13
+ import { g as ht, E as we } from "./event-DFRZD7LK.js";
14
+ import { E as ln } from "./index-YgAUM4hl.js";
15
+ import { v as rt } from "./index-BhA_CsrH.js";
16
+ var gt = { exports: {} };
17
+ (function(r, p) {
18
+ (function(l, o) {
19
+ r.exports = o();
20
+ })(At, function() {
21
+ var l = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, o = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, w = /\d/, O = /\d\d/, f = /\d\d?/, d = /\d*[^-_:/,()\s\d]+/, T = {}, D = function(n) {
22
+ return (n = +n) + (n > 68 ? 1900 : 2e3);
23
+ }, S = function(n) {
24
+ return function(h) {
25
+ this[n] = +h;
26
+ };
27
+ }, V = [/[+-]\d\d:?(\d\d)?|Z/, function(n) {
28
+ (this.zone || (this.zone = {})).offset = function(h) {
29
+ if (!h || h === "Z") return 0;
30
+ var b = h.match(/([+-]|\d\d)/g), P = 60 * b[1] + (+b[2] || 0);
31
+ return P === 0 ? 0 : b[0] === "+" ? -P : P;
32
+ }(n);
33
+ }], F = function(n) {
34
+ var h = T[n];
35
+ return h && (h.indexOf ? h : h.s.concat(h.f));
36
+ }, I = function(n, h) {
37
+ var b, P = T.meridiem;
38
+ if (P) {
39
+ for (var v = 1; v <= 24; v += 1) if (n.indexOf(P(v, 0, h)) > -1) {
40
+ b = v > 12;
41
+ break;
42
+ }
43
+ } else b = n === (h ? "pm" : "PM");
44
+ return b;
45
+ }, m = { A: [d, function(n) {
46
+ this.afternoon = I(n, !1);
47
+ }], a: [d, function(n) {
48
+ this.afternoon = I(n, !0);
49
+ }], Q: [w, function(n) {
50
+ this.month = 3 * (n - 1) + 1;
51
+ }], S: [w, function(n) {
52
+ this.milliseconds = 100 * +n;
53
+ }], SS: [O, function(n) {
54
+ this.milliseconds = 10 * +n;
55
+ }], SSS: [/\d{3}/, function(n) {
56
+ this.milliseconds = +n;
57
+ }], s: [f, S("seconds")], ss: [f, S("seconds")], m: [f, S("minutes")], mm: [f, S("minutes")], H: [f, S("hours")], h: [f, S("hours")], HH: [f, S("hours")], hh: [f, S("hours")], D: [f, S("day")], DD: [O, S("day")], Do: [d, function(n) {
58
+ var h = T.ordinal, b = n.match(/\d+/);
59
+ if (this.day = b[0], h) for (var P = 1; P <= 31; P += 1) h(P).replace(/\[|\]/g, "") === n && (this.day = P);
60
+ }], w: [f, S("week")], ww: [O, S("week")], M: [f, S("month")], MM: [O, S("month")], MMM: [d, function(n) {
61
+ var h = F("months"), b = (F("monthsShort") || h.map(function(P) {
62
+ return P.slice(0, 3);
63
+ })).indexOf(n) + 1;
64
+ if (b < 1) throw new Error();
65
+ this.month = b % 12 || b;
66
+ }], MMMM: [d, function(n) {
67
+ var h = F("months").indexOf(n) + 1;
68
+ if (h < 1) throw new Error();
69
+ this.month = h % 12 || h;
70
+ }], Y: [/[+-]?\d+/, S("year")], YY: [O, function(n) {
71
+ this.year = D(n);
72
+ }], YYYY: [/\d{4}/, S("year")], Z: V, ZZ: V };
73
+ function C(n) {
74
+ var h, b;
75
+ h = n, b = T && T.formats;
76
+ for (var P = (n = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(Z, W, _) {
77
+ var K = _ && _.toUpperCase();
78
+ return W || b[_] || l[_] || b[K].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(J, j, x) {
79
+ return j || x.slice(1);
80
+ });
81
+ })).match(o), v = P.length, y = 0; y < v; y += 1) {
82
+ var N = P[y], $ = m[N], s = $ && $[0], L = $ && $[1];
83
+ P[y] = L ? { regex: s, parser: L } : N.replace(/^\[|\]$/g, "");
84
+ }
85
+ return function(Z) {
86
+ for (var W = {}, _ = 0, K = 0; _ < v; _ += 1) {
87
+ var J = P[_];
88
+ if (typeof J == "string") K += J.length;
89
+ else {
90
+ var j = J.regex, x = J.parser, ne = Z.slice(K), k = j.exec(ne)[0];
91
+ x.call(W, k), Z = Z.replace(k, "");
92
+ }
93
+ }
94
+ return function(M) {
95
+ var q = M.afternoon;
96
+ if (q !== void 0) {
97
+ var B = M.hours;
98
+ q ? B < 12 && (M.hours += 12) : B === 12 && (M.hours = 0), delete M.afternoon;
99
+ }
100
+ }(W), W;
101
+ };
102
+ }
103
+ return function(n, h, b) {
104
+ b.p.customParseFormat = !0, n && n.parseTwoDigitYear && (D = n.parseTwoDigitYear);
105
+ var P = h.prototype, v = P.parse;
106
+ P.parse = function(y) {
107
+ var N = y.date, $ = y.utc, s = y.args;
108
+ this.$u = $;
109
+ var L = s[1];
110
+ if (typeof L == "string") {
111
+ var Z = s[2] === !0, W = s[3] === !0, _ = Z || W, K = s[2];
112
+ W && (K = s[2]), T = this.$locale(), !Z && K && (T = b.Ls[K]), this.$d = function(ne, k, M, q) {
113
+ try {
114
+ if (["x", "X"].indexOf(k) > -1) return new Date((k === "X" ? 1e3 : 1) * ne);
115
+ var B = C(k)(ne), te = B.year, a = B.month, u = B.day, i = B.hours, g = B.minutes, E = B.seconds, z = B.milliseconds, re = B.zone, ae = B.week, he = /* @__PURE__ */ new Date(), ge = u || (te || a ? 1 : he.getDate()), be = te || he.getFullYear(), le = 0;
116
+ te && !a || (le = a > 0 ? a - 1 : he.getMonth());
117
+ var ce, me = i || 0, de = g || 0, ye = E || 0, ke = z || 0;
118
+ return re ? new Date(Date.UTC(be, le, ge, me, de, ye, ke + 60 * re.offset * 1e3)) : M ? new Date(Date.UTC(be, le, ge, me, de, ye, ke)) : (ce = new Date(be, le, ge, me, de, ye, ke), ae && (ce = q(ce).week(ae).toDate()), ce);
119
+ } catch {
120
+ return /* @__PURE__ */ new Date("");
121
+ }
122
+ }(N, L, $, b), this.init(), K && K !== !0 && (this.$L = this.locale(K).$L), _ && N != this.format(L) && (this.$d = /* @__PURE__ */ new Date("")), T = {};
123
+ } else if (L instanceof Array) for (var J = L.length, j = 1; j <= J; j += 1) {
124
+ s[1] = L[j - 1];
125
+ var x = b.apply(this, s);
126
+ if (x.isValid()) {
127
+ this.$d = x.$d, this.$L = x.$L, this.init();
128
+ break;
129
+ }
130
+ j === J && (this.$d = /* @__PURE__ */ new Date(""));
131
+ }
132
+ else v.call(this, y);
133
+ };
134
+ };
135
+ });
136
+ })(gt);
137
+ var un = gt.exports;
138
+ const _n = /* @__PURE__ */ Yt(un), lt = ["hours", "minutes", "seconds"], xe = "EP_PICKER_BASE", cn = "ElPopperOptions", dn = /* @__PURE__ */ Symbol("commonPickerContextKey"), Ze = "HH:mm:ss", Ee = "YYYY-MM-DD", Un = {
139
+ date: Ee,
140
+ dates: Ee,
141
+ week: "gggg[w]ww",
142
+ year: "YYYY",
143
+ years: "YYYY",
144
+ month: "YYYY-MM",
145
+ months: "YYYY-MM",
146
+ datetime: `${Ee} ${Ze}`,
147
+ monthrange: "YYYY-MM",
148
+ yearrange: "YYYY",
149
+ daterange: Ee,
150
+ datetimerange: `${Ee} ${Ze}`
151
+ }, Ue = (r, p) => [
152
+ r > 0 ? r - 1 : void 0,
153
+ r,
154
+ r < p ? r + 1 : void 0
155
+ ], Kn = (r) => Array.from(Array.from({ length: r }).keys()), jn = (r) => r.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim(), zn = (r) => r.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim(), it = function(r, p) {
156
+ const l = et(r), o = et(p);
157
+ return l && o ? r.getTime() === p.getTime() : !l && !o ? r === p : !1;
158
+ }, bt = function(r, p) {
159
+ const l = se(r), o = se(p);
160
+ return l && o ? r.length !== p.length ? !1 : r.every((w, O) => it(w, p[O])) : !l && !o ? it(r, p) : !1;
161
+ }, ut = function(r, p, l) {
162
+ const o = ft(p) || p === "x" ? Pe(r).locale(l) : Pe(r, p).locale(l);
163
+ return o.isValid() ? o : void 0;
164
+ }, ct = function(r, p, l) {
165
+ return ft(p) ? r : p === "x" ? +r : Pe(r).locale(l).format(p);
166
+ }, Ke = (r, p) => {
167
+ var l;
168
+ const o = [], w = p == null ? void 0 : p();
169
+ for (let O = 0; O < r; O++)
170
+ o.push((l = w == null ? void 0 : w.includes(O)) != null ? l : !1);
171
+ return o;
172
+ }, $e = (r) => se(r) ? r.map((p) => p.toDate()) : r.toDate(), pn = (r, p) => {
173
+ const { lang: l } = pt(), o = G(!1), w = G(!1), O = G(null), f = R(() => {
174
+ const { modelValue: m } = r;
175
+ return !m || se(m) && !m.filter(Boolean).length;
176
+ }), d = (m) => {
177
+ if (!bt(r.modelValue, m)) {
178
+ let C;
179
+ se(m) ? C = m.map(
180
+ (h) => ct(h, r.valueFormat, l.value)
181
+ ) : m && (C = ct(m, r.valueFormat, l.value)), p(dt, m && C, l.value);
182
+ }
183
+ }, T = R(() => {
184
+ var m;
185
+ let C;
186
+ if (f.value ? D.value.getDefaultValue && (C = D.value.getDefaultValue()) : se(r.modelValue) ? C = r.modelValue.map(
187
+ (n) => ut(n, r.valueFormat, l.value)
188
+ ) : C = ut(
189
+ (m = r.modelValue) != null ? m : "",
190
+ r.valueFormat,
191
+ l.value
192
+ ), D.value.getRangeAvailableTime) {
193
+ const n = D.value.getRangeAvailableTime(
194
+ C
195
+ );
196
+ Qt(n, C) || (C = n, f.value || d($e(C)));
197
+ }
198
+ return se(C) && C.some((n) => !n) && (C = []), C;
199
+ }), D = G({});
200
+ return {
201
+ parsedValue: T,
202
+ pickerActualVisible: w,
203
+ pickerOptions: D,
204
+ pickerVisible: o,
205
+ userInput: O,
206
+ valueIsEmpty: f,
207
+ emitInput: d,
208
+ onCalendarChange: (m) => {
209
+ p("calendar-change", m);
210
+ },
211
+ onPanelChange: (m, C, n) => {
212
+ p("panel-change", m, C, n);
213
+ },
214
+ onPick: (m = "", C = !1) => {
215
+ o.value = C;
216
+ let n;
217
+ se(m) ? n = m.map((h) => h.toDate()) : n = m && m.toDate(), O.value = null, d(n);
218
+ },
219
+ onSetPickerOption: (m) => {
220
+ D.value[m[0]] = m[1], D.value.panelReady = !0;
221
+ }
222
+ };
223
+ }, yt = Me({
224
+ /**
225
+ * @description To specify the array of hours that cannot be selected
226
+ */
227
+ disabledHours: {
228
+ type: U(Function)
229
+ },
230
+ /**
231
+ * @description To specify the array of minutes that cannot be selected
232
+ */
233
+ disabledMinutes: {
234
+ type: U(Function)
235
+ },
236
+ /**
237
+ * @description To specify the array of seconds that cannot be selected
238
+ */
239
+ disabledSeconds: {
240
+ type: U(Function)
241
+ }
242
+ }), fn = Me({
243
+ visible: Boolean,
244
+ actualVisible: {
245
+ type: Boolean,
246
+ default: void 0
247
+ },
248
+ format: {
249
+ type: String,
250
+ default: ""
251
+ }
252
+ }), mn = Me({
253
+ /**
254
+ * @description this prop decides if the date picker panel pops up when the input is focused
255
+ */
256
+ automaticDropdown: {
257
+ type: Boolean,
258
+ default: !0
259
+ },
260
+ /**
261
+ * @description same as `id` in native input
262
+ */
263
+ id: {
264
+ type: U([Array, String])
265
+ },
266
+ /**
267
+ * @description same as `name` in native input
268
+ */
269
+ name: {
270
+ type: U([Array, String])
271
+ },
272
+ /**
273
+ * @description custom class name for TimePicker's dropdown
274
+ */
275
+ popperClass: ot.popperClass,
276
+ /**
277
+ * @description custom style for TimePicker's dropdown
278
+ */
279
+ popperStyle: ot.popperStyle,
280
+ /**
281
+ * @description format of the displayed value in the input box
282
+ */
283
+ format: String,
284
+ /**
285
+ * @description optional, format of binding value. If not specified, the binding value will be a Date object
286
+ */
287
+ valueFormat: String,
288
+ /**
289
+ * @description optional, format of the date displayed in input's inner panel
290
+ */
291
+ dateFormat: String,
292
+ /**
293
+ * @description optional, format of the time displayed in input's inner panel
294
+ */
295
+ timeFormat: String,
296
+ /**
297
+ * @description type of the picker
298
+ */
299
+ type: {
300
+ type: String,
301
+ default: ""
302
+ },
303
+ /**
304
+ * @description whether to show clear button
305
+ */
306
+ clearable: {
307
+ type: Boolean,
308
+ default: !0
309
+ },
310
+ /**
311
+ * @description Custom clear icon component
312
+ */
313
+ clearIcon: {
314
+ type: U([String, Object]),
315
+ default: Ot
316
+ },
317
+ /**
318
+ * @description whether the input is editable
319
+ */
320
+ editable: {
321
+ type: Boolean,
322
+ default: !0
323
+ },
324
+ /**
325
+ * @description Custom prefix icon component
326
+ */
327
+ prefixIcon: {
328
+ type: U([String, Object]),
329
+ default: ""
330
+ },
331
+ /**
332
+ * @description size of Input
333
+ */
334
+ size: en,
335
+ /**
336
+ * @description whether TimePicker is read only
337
+ */
338
+ readonly: Boolean,
339
+ /**
340
+ * @description whether TimePicker is disabled
341
+ */
342
+ disabled: {
343
+ type: Boolean,
344
+ default: void 0
345
+ },
346
+ /**
347
+ * @description placeholder in non-range mode
348
+ */
349
+ placeholder: {
350
+ type: String,
351
+ default: ""
352
+ },
353
+ /**
354
+ * @description [popper.js](https://popper.js.org/docs/v2/) parameters
355
+ */
356
+ popperOptions: {
357
+ type: U(Object),
358
+ default: () => ({})
359
+ },
360
+ /**
361
+ * @description binding value, if it is an array, the length should be 2
362
+ */
363
+ modelValue: {
364
+ type: U([Date, Array, String, Number]),
365
+ default: ""
366
+ },
367
+ /**
368
+ * @description range separator
369
+ */
370
+ rangeSeparator: {
371
+ type: String,
372
+ default: "-"
373
+ },
374
+ /**
375
+ * @description placeholder for the start date in range mode
376
+ */
377
+ startPlaceholder: String,
378
+ /**
379
+ * @description placeholder for the end date in range mode
380
+ */
381
+ endPlaceholder: String,
382
+ /**
383
+ * @description optional, default date of the calendar
384
+ */
385
+ defaultValue: {
386
+ type: U([Date, Array])
387
+ },
388
+ /**
389
+ * @description optional, the time value to use when selecting date range
390
+ */
391
+ defaultTime: {
392
+ type: U([Date, Array])
393
+ },
394
+ /**
395
+ * @description whether to pick a time range
396
+ */
397
+ isRange: Boolean,
398
+ ...yt,
399
+ /**
400
+ * @description a function determining if a date is disabled with that date as its parameter. Should return a Boolean
401
+ */
402
+ disabledDate: {
403
+ type: Function
404
+ },
405
+ /**
406
+ * @description set custom className
407
+ */
408
+ cellClassName: {
409
+ type: Function
410
+ },
411
+ /**
412
+ * @description an object array to set shortcut options
413
+ */
414
+ shortcuts: {
415
+ type: Array,
416
+ default: () => []
417
+ },
418
+ /**
419
+ * @description whether to pick time using arrow buttons
420
+ */
421
+ arrowControl: Boolean,
422
+ /**
423
+ * @description input tabindex
424
+ */
425
+ tabindex: {
426
+ type: U([String, Number]),
427
+ default: 0
428
+ },
429
+ /**
430
+ * @description whether to trigger form validation
431
+ */
432
+ validateEvent: {
433
+ type: Boolean,
434
+ default: !0
435
+ },
436
+ /**
437
+ * @description unlink two date-panels in range-picker
438
+ */
439
+ unlinkPanels: Boolean,
440
+ /**
441
+ * @description position of dropdown
442
+ */
443
+ placement: {
444
+ type: U(String),
445
+ values: Gt,
446
+ default: "bottom"
447
+ },
448
+ /**
449
+ * @description list of possible positions for dropdown
450
+ */
451
+ fallbackPlacements: {
452
+ type: U(Array),
453
+ default: ["bottom", "top", "right", "left"]
454
+ },
455
+ ...Zt,
456
+ ...sn(["ariaLabel"]),
457
+ /**
458
+ * @description whether to show the now button
459
+ */
460
+ showNow: {
461
+ type: Boolean,
462
+ default: !0
463
+ },
464
+ /**
465
+ * @description whether to show footer
466
+ */
467
+ showConfirm: {
468
+ type: Boolean,
469
+ default: !0
470
+ },
471
+ /**
472
+ * @description whether to show footer
473
+ */
474
+ showFooter: {
475
+ type: Boolean,
476
+ default: !0
477
+ },
478
+ /**
479
+ * @description whether to show the number of the calendar week
480
+ */
481
+ showWeekNumber: Boolean
482
+ }), kt = Me({
483
+ id: {
484
+ type: U(Array)
485
+ },
486
+ name: {
487
+ type: U(Array)
488
+ },
489
+ modelValue: {
490
+ type: U([Array, String])
491
+ },
492
+ startPlaceholder: String,
493
+ endPlaceholder: String,
494
+ disabled: Boolean
495
+ }), Wn = kt, vn = ["id", "name", "placeholder", "value", "disabled"], hn = ["id", "name", "placeholder", "value", "disabled"];
496
+ var gn = /* @__PURE__ */ Ne({
497
+ name: "PickerRangeTrigger",
498
+ inheritAttrs: !1,
499
+ __name: "picker-range-trigger",
500
+ props: kt,
501
+ emits: [
502
+ "mouseenter",
503
+ "mouseleave",
504
+ "click",
505
+ "touchstart",
506
+ "focus",
507
+ "blur",
508
+ "startInput",
509
+ "endInput",
510
+ "startChange",
511
+ "endChange"
512
+ ],
513
+ setup(r, { expose: p, emit: l }) {
514
+ const o = r, w = l, { formItem: O } = mt(), { inputId: f } = rn(
515
+ Nt({ id: R(() => {
516
+ var s;
517
+ return (s = o.id) == null ? void 0 : s[0];
518
+ }) }),
519
+ {
520
+ formItemContext: O
521
+ }
522
+ ), d = zt(), T = ve("date"), D = ve("range"), S = G(), V = G(), { wrapperRef: F, isFocused: I } = vt(S, {
523
+ disabled: R(() => o.disabled)
524
+ }), m = (s) => {
525
+ w("click", s);
526
+ }, C = (s) => {
527
+ w("mouseenter", s);
528
+ }, n = (s) => {
529
+ w("mouseleave", s);
530
+ }, h = (s) => {
531
+ w("touchstart", s);
532
+ }, b = (s) => {
533
+ w("startInput", s);
534
+ }, P = (s) => {
535
+ w("endInput", s);
536
+ }, v = (s) => {
537
+ w("startChange", s);
538
+ }, y = (s) => {
539
+ w("endChange", s);
540
+ };
541
+ return p({
542
+ focus: () => {
543
+ var s;
544
+ (s = S.value) == null || s.focus();
545
+ },
546
+ blur: () => {
547
+ var s, L;
548
+ (s = S.value) == null || s.blur(), (L = V.value) == null || L.blur();
549
+ }
550
+ }), (s, L) => (A(), Q(
551
+ "div",
552
+ {
553
+ ref_key: "wrapperRef",
554
+ ref: F,
555
+ class: H([t(T).is("active", t(I)), s.$attrs.class]),
556
+ style: ze(
557
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
558
+ s.$attrs.style
559
+ ),
560
+ onClick: m,
561
+ onMouseenter: C,
562
+ onMouseleave: n,
563
+ onTouchstartPassive: h
564
+ },
565
+ [
566
+ Te(s.$slots, "prefix"),
567
+ pe("input", We(t(d), {
568
+ id: t(f),
569
+ ref_key: "inputRef",
570
+ ref: S,
571
+ name: s.name && s.name[0],
572
+ placeholder: s.startPlaceholder,
573
+ value: s.modelValue && s.modelValue[0],
574
+ class: t(D).b("input"),
575
+ disabled: s.disabled,
576
+ onInput: b,
577
+ onChange: v
578
+ }), null, 16, vn),
579
+ Te(s.$slots, "range-separator"),
580
+ pe("input", We(t(d), {
581
+ id: s.id && s.id[1],
582
+ ref_key: "endInputRef",
583
+ ref: V,
584
+ name: s.name && s.name[1],
585
+ placeholder: s.endPlaceholder,
586
+ value: s.modelValue && s.modelValue[1],
587
+ class: t(D).b("input"),
588
+ disabled: s.disabled,
589
+ onInput: P,
590
+ onChange: y
591
+ }), null, 16, hn),
592
+ Te(s.$slots, "suffix")
593
+ ],
594
+ 38
595
+ /* CLASS, STYLE, NEED_HYDRATION */
596
+ ));
597
+ }
598
+ }), qn = /* @__PURE__ */ Ne({
599
+ name: "Picker",
600
+ __name: "picker",
601
+ props: mn,
602
+ emits: [
603
+ dt,
604
+ Le,
605
+ "focus",
606
+ "blur",
607
+ "clear",
608
+ "calendar-change",
609
+ "panel-change",
610
+ "visible-change",
611
+ "keydown"
612
+ ],
613
+ setup(r, { expose: p, emit: l }) {
614
+ const o = r, w = l, O = Bt(), f = ve("date"), d = ve("input"), T = ve("range"), { formItem: D } = mt(), S = Ge(
615
+ cn,
616
+ {}
617
+ ), V = Jt(o, null), F = G(), I = G(), m = G(null);
618
+ let C = !1;
619
+ const n = tn(), h = pn(o, w), {
620
+ parsedValue: b,
621
+ pickerActualVisible: P,
622
+ userInput: v,
623
+ pickerVisible: y,
624
+ pickerOptions: N,
625
+ valueIsEmpty: $,
626
+ emitInput: s,
627
+ onPick: L,
628
+ onSetPickerOption: Z,
629
+ onCalendarChange: W,
630
+ onPanelChange: _
631
+ } = h, { isFocused: K, handleFocus: J, handleBlur: j } = vt(I, {
632
+ disabled: n,
633
+ beforeFocus() {
634
+ return o.readonly;
635
+ },
636
+ afterFocus() {
637
+ o.automaticDropdown && (y.value = !0);
638
+ },
639
+ beforeBlur(e) {
640
+ var c;
641
+ return !C && ((c = F.value) == null ? void 0 : c.isFocusInsideContent(e));
642
+ },
643
+ afterBlur() {
644
+ He(), y.value = !1, C = !1, o.validateEvent && (D == null || D.validate("blur").catch((e) => st(e)));
645
+ }
646
+ }), x = G(!1), ne = R(() => [
647
+ f.b("editor"),
648
+ f.bm("editor", o.type),
649
+ d.e("wrapper"),
650
+ f.is("disabled", n.value),
651
+ f.is("active", y.value),
652
+ T.b("editor"),
653
+ Be ? T.bm("editor", Be.value) : "",
654
+ O.class
655
+ ]), k = R(() => [
656
+ d.e("icon"),
657
+ T.e("close-icon"),
658
+ ce.value ? "" : T.em("close-icon", "hidden")
659
+ ]);
660
+ Je(y, (e) => {
661
+ e ? Ce(() => {
662
+ e && (m.value = o.modelValue);
663
+ }) : (v.value = null, Ce(() => {
664
+ M(o.modelValue);
665
+ }));
666
+ });
667
+ const M = (e, c) => {
668
+ (c || !bt(e, m.value)) && (w(Le, e), c && (m.value = e), o.validateEvent && (D == null || D.validate("change").catch((Y) => st(Y))));
669
+ }, q = (e) => {
670
+ w("keydown", e);
671
+ }, B = R(() => I.value ? Array.from(
672
+ I.value.$el.querySelectorAll("input")
673
+ ) : []), te = (e, c, Y) => {
674
+ const oe = B.value;
675
+ oe.length && (!Y || Y === "min" ? (oe[0].setSelectionRange(e, c), oe[0].focus()) : Y === "max" && (oe[1].setSelectionRange(e, c), oe[1].focus()));
676
+ }, a = () => {
677
+ P.value = !0;
678
+ }, u = () => {
679
+ w("visible-change", !0);
680
+ }, i = () => {
681
+ P.value = !1, y.value = !1, w("visible-change", !1);
682
+ }, g = () => {
683
+ y.value = !0;
684
+ }, E = () => {
685
+ y.value = !1;
686
+ }, z = R(() => {
687
+ const e = _e(b.value);
688
+ return se(v.value) ? [
689
+ v.value[0] || e && e[0] || "",
690
+ v.value[1] || e && e[1] || ""
691
+ ] : v.value !== null ? v.value : !ae.value && $.value || !y.value && $.value ? "" : e ? he.value || ge.value || be.value ? e.join(", ") : e : "";
692
+ }), re = R(() => o.type.includes("time")), ae = R(() => o.type.startsWith("time")), he = R(() => o.type === "dates"), ge = R(() => o.type === "months"), be = R(() => o.type === "years"), le = R(
693
+ () => o.prefixIcon || (re.value ? Ft : Rt)
694
+ ), ce = R(
695
+ () => o.clearable && !n.value && !o.readonly && !$.value && (x.value || K.value)
696
+ ), me = (e) => {
697
+ o.readonly || n.value || (ce.value && (e == null || e.stopPropagation(), N.value.handleClear ? N.value.handleClear() : s(V.valueOnClear.value), M(V.valueOnClear.value, !0), i()), w("clear"));
698
+ }, de = async (e) => {
699
+ var c;
700
+ o.readonly || n.value || (((c = e.target) == null ? void 0 : c.tagName) !== "INPUT" || K.value || !o.automaticDropdown) && (y.value = !0);
701
+ }, ye = () => {
702
+ o.readonly || n.value || !$.value && o.clearable && (x.value = !0);
703
+ }, ke = () => {
704
+ x.value = !1;
705
+ }, Ve = (e) => {
706
+ var c;
707
+ o.readonly || n.value || (((c = e.touches[0].target) == null ? void 0 : c.tagName) !== "INPUT" || K.value || !o.automaticDropdown) && (y.value = !0);
708
+ }, St = R(() => o.type.includes("range")), Be = nn(), Pt = R(() => {
709
+ var e, c;
710
+ return (c = (e = t(F)) == null ? void 0 : e.popperRef) == null ? void 0 : c.contentRef;
711
+ }), Qe = Kt(
712
+ I,
713
+ (e) => {
714
+ const c = t(Pt), Y = jt(I);
715
+ c && (e.target === c || e.composedPath().includes(c)) || e.target === Y || Y && e.composedPath().includes(Y) || (y.value = !1);
716
+ }
717
+ );
718
+ Ht(() => {
719
+ Qe == null || Qe();
720
+ });
721
+ const He = () => {
722
+ if (v.value) {
723
+ const e = Ae(z.value);
724
+ e && (Ye(e) && s($e(e)), v.value = null);
725
+ }
726
+ v.value === "" && (s(V.valueOnClear.value), M(V.valueOnClear.value, !0), v.value = null);
727
+ }, Ae = (e) => e ? N.value.parseUserInput(e) : null, _e = (e) => e ? se(e) ? e.map((Y) => Y.format(o.format)) : e.format(o.format) : null, Ye = (e) => N.value.isValidValue(e), Xe = async (e) => {
728
+ if (o.readonly || n.value) return;
729
+ const c = ht(e);
730
+ if (q(e), c === we.esc) {
731
+ y.value === !0 && (y.value = !1, e.preventDefault(), e.stopPropagation());
732
+ return;
733
+ }
734
+ if (c === we.down && (N.value.handleFocusPicker && (e.preventDefault(), e.stopPropagation()), y.value === !1 && (y.value = !0, await Ce()), N.value.handleFocusPicker)) {
735
+ N.value.handleFocusPicker();
736
+ return;
737
+ }
738
+ if (c === we.tab) {
739
+ C = !0;
740
+ return;
741
+ }
742
+ if (c === we.enter || c === we.numpadEnter) {
743
+ y.value ? (v.value === null || v.value === "" || Ye(Ae(z.value))) && (He(), y.value = !1) : y.value = !0, e.preventDefault(), e.stopPropagation();
744
+ return;
745
+ }
746
+ if (v.value) {
747
+ e.stopPropagation();
748
+ return;
749
+ }
750
+ N.value.handleKeydownInput && N.value.handleKeydownInput(e);
751
+ }, Ct = (e) => {
752
+ v.value = e, y.value || (y.value = !0);
753
+ }, Mt = (e) => {
754
+ const c = e.target;
755
+ v.value ? v.value = [c.value, v.value[1]] : v.value = [c.value, null];
756
+ }, Dt = (e) => {
757
+ const c = e.target;
758
+ v.value ? v.value = [v.value[0], c.value] : v.value = [null, c.value];
759
+ }, It = () => {
760
+ var e;
761
+ const c = v.value, Y = Ae(c && c[0]), oe = t(b);
762
+ if (Y && Y.isValid()) {
763
+ v.value = [
764
+ _e(Y),
765
+ ((e = z.value) == null ? void 0 : e[1]) || null
766
+ ];
767
+ const De = [Y, oe && (oe[1] || null)];
768
+ Ye(De) && (s($e(De)), v.value = null);
769
+ }
770
+ }, Et = () => {
771
+ var e;
772
+ const c = t(v), Y = Ae(c && c[1]), oe = t(b);
773
+ if (Y && Y.isValid()) {
774
+ v.value = [
775
+ ((e = t(z)) == null ? void 0 : e[0]) || null,
776
+ _e(Y)
777
+ ];
778
+ const De = [oe && oe[0], Y];
779
+ Ye(De) && (s($e(De)), v.value = null);
780
+ }
781
+ }, Tt = () => {
782
+ var e;
783
+ (e = I.value) == null || e.focus();
784
+ }, Vt = () => {
785
+ var e;
786
+ (e = I.value) == null || e.blur();
787
+ };
788
+ return nt(xe, {
789
+ props: o,
790
+ emptyValues: V
791
+ }), nt(dn, h), p({
792
+ /**
793
+ * @description focus input box.
794
+ */
795
+ focus: Tt,
796
+ /**
797
+ * @description blur input box.
798
+ */
799
+ blur: Vt,
800
+ /**
801
+ * @description opens picker
802
+ */
803
+ handleOpen: g,
804
+ /**
805
+ * @description closes picker
806
+ */
807
+ handleClose: E,
808
+ /**
809
+ * @description pick item manually
810
+ */
811
+ onPick: L
812
+ }), (e, c) => (A(), X(t(xt), We({
813
+ ref_key: "refPopper",
814
+ ref: F,
815
+ visible: t(y),
816
+ effect: "light",
817
+ pure: "",
818
+ trigger: "click"
819
+ }, e.$attrs, {
820
+ role: "dialog",
821
+ teleported: "",
822
+ transition: `${t(f).namespace.value}-zoom-in-top`,
823
+ "popper-class": [`${t(f).namespace.value}-picker__popper`, e.popperClass],
824
+ "popper-style": e.popperStyle,
825
+ "popper-options": t(S),
826
+ "fallback-placements": e.fallbackPlacements,
827
+ "gpu-acceleration": !1,
828
+ placement: e.placement,
829
+ "stop-popper-mouse-event": !1,
830
+ "hide-after": 0,
831
+ persistent: "",
832
+ onBeforeShow: a,
833
+ onShow: u,
834
+ onHide: i
835
+ }), {
836
+ default: ee(() => [
837
+ St.value ? (A(), X(gn, {
838
+ key: 1,
839
+ id: (
840
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
841
+ e.id
842
+ ),
843
+ ref_key: "inputRef",
844
+ ref: I,
845
+ "model-value": z.value,
846
+ name: (
847
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
848
+ e.name
849
+ ),
850
+ disabled: t(n),
851
+ readonly: !e.editable || e.readonly,
852
+ "start-placeholder": e.startPlaceholder,
853
+ "end-placeholder": e.endPlaceholder,
854
+ class: H(ne.value),
855
+ style: ze(e.$attrs.style),
856
+ "aria-label": e.ariaLabel,
857
+ tabindex: e.tabindex,
858
+ autocomplete: "off",
859
+ role: "combobox",
860
+ onClick: de,
861
+ onFocus: t(J),
862
+ onBlur: t(j),
863
+ onStartInput: Mt,
864
+ onStartChange: It,
865
+ onEndInput: Dt,
866
+ onEndChange: Et,
867
+ onMousedown: de,
868
+ onMouseenter: ye,
869
+ onMouseleave: ke,
870
+ onTouchstartPassive: Ve,
871
+ onKeydown: Xe
872
+ }, {
873
+ prefix: ee(() => [
874
+ le.value ? (A(), X(t(Se), {
875
+ key: 0,
876
+ class: H([t(d).e("icon"), t(T).e("icon")])
877
+ }, {
878
+ default: ee(() => [
879
+ (A(), X(Oe(le.value)))
880
+ ]),
881
+ _: 1
882
+ /* STABLE */
883
+ }, 8, ["class"])) : fe("v-if", !0)
884
+ ]),
885
+ "range-separator": ee(() => [
886
+ Te(e.$slots, "range-separator", {}, () => [
887
+ pe(
888
+ "span",
889
+ {
890
+ class: H(t(T).b("separator"))
891
+ },
892
+ ue(e.rangeSeparator),
893
+ 3
894
+ /* TEXT, CLASS */
895
+ )
896
+ ])
897
+ ]),
898
+ suffix: ee(() => [
899
+ e.clearIcon ? (A(), X(t(Se), {
900
+ key: 0,
901
+ class: H(k.value),
902
+ onMousedown: Ie(t(tt), ["prevent"]),
903
+ onClick: me
904
+ }, {
905
+ default: ee(() => [
906
+ (A(), X(Oe(e.clearIcon)))
907
+ ]),
908
+ _: 1
909
+ /* STABLE */
910
+ }, 8, ["class", "onMousedown"])) : fe("v-if", !0)
911
+ ]),
912
+ _: 3
913
+ /* FORWARDED */
914
+ }, 8, ["id", "model-value", "name", "disabled", "readonly", "start-placeholder", "end-placeholder", "class", "style", "aria-label", "tabindex", "onFocus", "onBlur"])) : (A(), X(t(Wt), {
915
+ key: 0,
916
+ id: (
917
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
918
+ e.id
919
+ ),
920
+ ref_key: "inputRef",
921
+ ref: I,
922
+ "container-role": "combobox",
923
+ "model-value": (
924
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
925
+ z.value
926
+ ),
927
+ name: (
928
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
929
+ e.name
930
+ ),
931
+ size: t(Be),
932
+ disabled: t(n),
933
+ placeholder: e.placeholder,
934
+ class: H([
935
+ t(f).b("editor"),
936
+ t(f).bm("editor", e.type),
937
+ t(f).is("focus", t(y)),
938
+ e.$attrs.class
939
+ ]),
940
+ style: ze(e.$attrs.style),
941
+ readonly: !e.editable || e.readonly || he.value || ge.value || be.value || e.type === "week",
942
+ "aria-label": e.ariaLabel,
943
+ tabindex: e.tabindex,
944
+ "validate-event": !1,
945
+ onInput: Ct,
946
+ onFocus: t(J),
947
+ onBlur: t(j),
948
+ onKeydown: Xe,
949
+ onChange: He,
950
+ onMousedown: de,
951
+ onMouseenter: ye,
952
+ onMouseleave: ke,
953
+ onTouchstartPassive: Ve,
954
+ onClick: c[0] || (c[0] = Ie(() => {
955
+ }, ["stop"]))
956
+ }, {
957
+ prefix: ee(() => [
958
+ le.value ? (A(), X(t(Se), {
959
+ key: 0,
960
+ class: H(t(d).e("icon")),
961
+ onMousedown: Ie(de, ["prevent"]),
962
+ onTouchstartPassive: Ve
963
+ }, {
964
+ default: ee(() => [
965
+ (A(), X(Oe(le.value)))
966
+ ]),
967
+ _: 1
968
+ /* STABLE */
969
+ }, 8, ["class"])) : fe("v-if", !0)
970
+ ]),
971
+ suffix: ee(() => [
972
+ ce.value && e.clearIcon ? (A(), X(t(Se), {
973
+ key: 0,
974
+ class: H(`${t(d).e("icon")} clear-icon`),
975
+ onMousedown: Ie(t(tt), ["prevent"]),
976
+ onClick: me
977
+ }, {
978
+ default: ee(() => [
979
+ (A(), X(Oe(e.clearIcon)))
980
+ ]),
981
+ _: 1
982
+ /* STABLE */
983
+ }, 8, ["class", "onMousedown"])) : fe("v-if", !0)
984
+ ]),
985
+ _: 1
986
+ /* STABLE */
987
+ }, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur"]))
988
+ ]),
989
+ content: ee(() => [
990
+ Te(e.$slots, "default", {
991
+ visible: t(y),
992
+ actualVisible: t(P),
993
+ parsedValue: t(b),
994
+ format: e.format,
995
+ dateFormat: e.dateFormat,
996
+ timeFormat: e.timeFormat,
997
+ unlinkPanels: e.unlinkPanels,
998
+ type: e.type,
999
+ defaultValue: e.defaultValue,
1000
+ showNow: e.showNow,
1001
+ showConfirm: e.showConfirm,
1002
+ showFooter: e.showFooter,
1003
+ showWeekNumber: e.showWeekNumber,
1004
+ onPick: c[1] || (c[1] = //@ts-ignore
1005
+ (...Y) => t(L) && t(L)(...Y)),
1006
+ onSelectRange: te,
1007
+ onSetPickerOption: c[2] || (c[2] = //@ts-ignore
1008
+ (...Y) => t(Z) && t(Z)(...Y)),
1009
+ onCalendarChange: c[3] || (c[3] = //@ts-ignore
1010
+ (...Y) => t(W) && t(W)(...Y)),
1011
+ onClear: me,
1012
+ onPanelChange: c[4] || (c[4] = //@ts-ignore
1013
+ (...Y) => t(_) && t(_)(...Y)),
1014
+ onMousedown: c[5] || (c[5] = Ie(() => {
1015
+ }, ["stop"]))
1016
+ })
1017
+ ]),
1018
+ _: 3
1019
+ /* FORWARDED */
1020
+ }, 16, ["visible", "transition", "popper-class", "popper-style", "popper-options", "fallback-placements", "placement"]));
1021
+ }
1022
+ });
1023
+ const bn = Me({
1024
+ ...fn,
1025
+ datetimeRole: String,
1026
+ parsedValue: {
1027
+ type: U(Object)
1028
+ }
1029
+ }), yn = ({
1030
+ getAvailableHours: r,
1031
+ getAvailableMinutes: p,
1032
+ getAvailableSeconds: l
1033
+ }) => {
1034
+ const o = (f, d, T, D) => {
1035
+ const S = {
1036
+ hour: r,
1037
+ minute: p,
1038
+ second: l
1039
+ };
1040
+ let V = f;
1041
+ return ["hour", "minute", "second"].forEach((F) => {
1042
+ if (S[F]) {
1043
+ let I;
1044
+ const m = S[F];
1045
+ switch (F) {
1046
+ case "minute": {
1047
+ I = m(
1048
+ V.hour(),
1049
+ d,
1050
+ D
1051
+ );
1052
+ break;
1053
+ }
1054
+ case "second": {
1055
+ I = m(
1056
+ V.hour(),
1057
+ V.minute(),
1058
+ d,
1059
+ D
1060
+ );
1061
+ break;
1062
+ }
1063
+ default: {
1064
+ I = m(
1065
+ d,
1066
+ D
1067
+ );
1068
+ break;
1069
+ }
1070
+ }
1071
+ if (I != null && I.length && !I.includes(V[F]())) {
1072
+ const C = T ? 0 : I.length - 1;
1073
+ V = V[F](I[C]);
1074
+ }
1075
+ }
1076
+ }), V;
1077
+ }, w = {};
1078
+ return {
1079
+ timePickerOptions: w,
1080
+ getAvailableTime: o,
1081
+ onSetOption: ([f, d]) => {
1082
+ w[f] = d;
1083
+ }
1084
+ };
1085
+ }, je = (r) => {
1086
+ const p = (o, w) => o || w, l = (o) => o !== !0;
1087
+ return r.map(p).filter(l);
1088
+ }, wt = (r, p, l) => ({
1089
+ getHoursList: (f, d) => Ke(24, r && (() => r == null ? void 0 : r(f, d))),
1090
+ getMinutesList: (f, d, T) => Ke(
1091
+ 60,
1092
+ p && (() => p == null ? void 0 : p(f, d, T))
1093
+ ),
1094
+ getSecondsList: (f, d, T, D) => Ke(
1095
+ 60,
1096
+ l && (() => l == null ? void 0 : l(f, d, T, D))
1097
+ )
1098
+ }), kn = (r, p, l) => {
1099
+ const { getHoursList: o, getMinutesList: w, getSecondsList: O } = wt(
1100
+ r,
1101
+ p,
1102
+ l
1103
+ );
1104
+ return {
1105
+ getAvailableHours: (D, S) => je(o(D, S)),
1106
+ getAvailableMinutes: (D, S, V) => je(w(D, S, V)),
1107
+ getAvailableSeconds: (D, S, V, F) => je(O(D, S, V, F))
1108
+ };
1109
+ }, wn = (r) => {
1110
+ const p = G(r.parsedValue);
1111
+ return Je(
1112
+ () => r.visible,
1113
+ (l) => {
1114
+ l || (p.value = r.parsedValue);
1115
+ }
1116
+ ), p;
1117
+ }, Sn = Me({
1118
+ role: {
1119
+ type: String,
1120
+ required: !0
1121
+ },
1122
+ spinnerDate: {
1123
+ type: U(Object),
1124
+ required: !0
1125
+ },
1126
+ showSeconds: {
1127
+ type: Boolean,
1128
+ default: !0
1129
+ },
1130
+ arrowControl: Boolean,
1131
+ amPmMode: {
1132
+ // 'a': am/pm; 'A': AM/PM
1133
+ type: U(String),
1134
+ default: ""
1135
+ },
1136
+ ...yt
1137
+ }), Pn = ["onClick"], Cn = ["onMouseenter"];
1138
+ var Mn = /* @__PURE__ */ Ne({
1139
+ __name: "basic-time-spinner",
1140
+ props: Sn,
1141
+ emits: [Le, "select-range", "set-option"],
1142
+ setup(r, { emit: p }) {
1143
+ const l = r, o = Ge(xe), { isRange: w, format: O } = o.props, f = p, d = ve("time"), { getHoursList: T, getMinutesList: D, getSecondsList: S } = wt(
1144
+ l.disabledHours,
1145
+ l.disabledMinutes,
1146
+ l.disabledSeconds
1147
+ );
1148
+ let V = !1;
1149
+ const F = G(), I = G(), m = G(), C = G(), n = {
1150
+ hours: I,
1151
+ minutes: m,
1152
+ seconds: C
1153
+ }, h = R(() => l.showSeconds ? lt : lt.slice(0, 2)), b = R(() => {
1154
+ const { spinnerDate: a } = l, u = a.hour(), i = a.minute(), g = a.second();
1155
+ return { hours: u, minutes: i, seconds: g };
1156
+ }), P = R(() => {
1157
+ const { hours: a, minutes: u } = t(b), { role: i, spinnerDate: g } = l, E = w ? void 0 : g;
1158
+ return {
1159
+ hours: T(i, E),
1160
+ minutes: D(a, i, E),
1161
+ seconds: S(a, u, i, E)
1162
+ };
1163
+ }), v = R(() => {
1164
+ const { hours: a, minutes: u, seconds: i } = t(b);
1165
+ return {
1166
+ hours: Ue(a, 23),
1167
+ minutes: Ue(u, 59),
1168
+ seconds: Ue(i, 59)
1169
+ };
1170
+ }), y = Xt((a) => {
1171
+ V = !1, s(a);
1172
+ }, 200), N = (a) => {
1173
+ if (!!!l.amPmMode) return "";
1174
+ const i = l.amPmMode === "A";
1175
+ let g = a < 12 ? " am" : " pm";
1176
+ return i && (g = g.toUpperCase()), g;
1177
+ }, $ = (a) => {
1178
+ let u = [0, 0];
1179
+ const i = O || Ze, g = i.indexOf("HH"), E = i.indexOf("mm"), z = i.indexOf("ss");
1180
+ switch (a) {
1181
+ case "hours":
1182
+ g !== -1 && (u = [g, g + 2]);
1183
+ break;
1184
+ case "minutes":
1185
+ E !== -1 && (u = [E, E + 2]);
1186
+ break;
1187
+ case "seconds":
1188
+ z !== -1 && (u = [z, z + 2]);
1189
+ break;
1190
+ }
1191
+ const [re, ae] = u;
1192
+ f("select-range", re, ae), F.value = a;
1193
+ }, s = (a) => {
1194
+ W(a, t(b)[a]);
1195
+ }, L = () => {
1196
+ s("hours"), s("minutes"), s("seconds");
1197
+ }, Z = (a) => a.querySelector(`.${d.namespace.value}-scrollbar__wrap`), W = (a, u) => {
1198
+ if (l.arrowControl) return;
1199
+ const i = t(n[a]);
1200
+ i && i.$el && (Z(i.$el).scrollTop = Math.max(
1201
+ 0,
1202
+ u * _(a)
1203
+ ));
1204
+ }, _ = (a) => {
1205
+ const u = t(n[a]), i = u == null ? void 0 : u.$el.querySelector("li");
1206
+ return i && Number.parseFloat(qt(i, "height")) || 0;
1207
+ }, K = () => {
1208
+ j(1);
1209
+ }, J = () => {
1210
+ j(-1);
1211
+ }, j = (a) => {
1212
+ F.value || $("hours");
1213
+ const u = F.value, i = t(b)[u], g = F.value === "hours" ? 24 : 60, E = x(u, i, a, g);
1214
+ ne(u, E), W(u, E), Ce(() => $(u));
1215
+ }, x = (a, u, i, g) => {
1216
+ let E = (u + i + g) % g;
1217
+ const z = t(P)[a];
1218
+ for (; z[E] && E !== u; )
1219
+ E = (E + i + g) % g;
1220
+ return E;
1221
+ }, ne = (a, u) => {
1222
+ if (t(P)[a][u]) return;
1223
+ const { hours: E, minutes: z, seconds: re } = t(b);
1224
+ let ae;
1225
+ switch (a) {
1226
+ case "hours":
1227
+ ae = l.spinnerDate.hour(u).minute(z).second(re);
1228
+ break;
1229
+ case "minutes":
1230
+ ae = l.spinnerDate.hour(E).minute(u).second(re);
1231
+ break;
1232
+ case "seconds":
1233
+ ae = l.spinnerDate.hour(E).minute(z).second(u);
1234
+ break;
1235
+ }
1236
+ f(Le, ae);
1237
+ }, k = (a, { value: u, disabled: i }) => {
1238
+ i || (ne(a, u), $(a), W(a, u));
1239
+ }, M = (a) => {
1240
+ const u = t(n[a]);
1241
+ if (!u) return;
1242
+ V = !0, y(a);
1243
+ const i = Math.min(
1244
+ Math.round(
1245
+ (Z(u.$el).scrollTop - (q(a) * 0.5 - 10) / _(a) + 3) / _(a)
1246
+ ),
1247
+ a === "hours" ? 23 : 59
1248
+ );
1249
+ ne(a, i);
1250
+ }, q = (a) => t(n[a]).$el.offsetHeight, B = () => {
1251
+ const a = (u) => {
1252
+ const i = t(n[u]);
1253
+ i && i.$el && (Z(i.$el).onscroll = () => {
1254
+ M(u);
1255
+ });
1256
+ };
1257
+ a("hours"), a("minutes"), a("seconds");
1258
+ };
1259
+ _t(() => {
1260
+ Ce(() => {
1261
+ !l.arrowControl && B(), L(), l.role === "start" && $("hours");
1262
+ });
1263
+ });
1264
+ const te = (a, u) => {
1265
+ n[u].value = a ?? void 0;
1266
+ };
1267
+ return f("set-option", [`${l.role}_scrollDown`, j]), f("set-option", [`${l.role}_emitSelectRange`, $]), Je(
1268
+ () => l.spinnerDate,
1269
+ () => {
1270
+ V || L();
1271
+ }
1272
+ ), (a, u) => (A(), Q(
1273
+ "div",
1274
+ {
1275
+ class: H([t(d).b("spinner"), { "has-seconds": a.showSeconds }])
1276
+ },
1277
+ [
1278
+ a.arrowControl ? fe("v-if", !0) : (A(!0), Q(
1279
+ ie,
1280
+ { key: 0 },
1281
+ Fe(h.value, (i) => (A(), X(t(ln), {
1282
+ key: i,
1283
+ ref_for: !0,
1284
+ ref: (g) => te(g, i),
1285
+ class: H(t(d).be("spinner", "wrapper")),
1286
+ "wrap-style": "max-height: inherit;",
1287
+ "view-class": t(d).be("spinner", "list"),
1288
+ noresize: "",
1289
+ tag: "ul",
1290
+ onMouseenter: (g) => $(i),
1291
+ onMousemove: (g) => s(i)
1292
+ }, {
1293
+ default: ee(() => [
1294
+ (A(!0), Q(
1295
+ ie,
1296
+ null,
1297
+ Fe(P.value[i], (g, E) => (A(), Q("li", {
1298
+ key: E,
1299
+ class: H([
1300
+ t(d).be("spinner", "item"),
1301
+ t(d).is("active", E === b.value[i]),
1302
+ t(d).is("disabled", g)
1303
+ ]),
1304
+ onClick: (z) => k(i, { value: E, disabled: g })
1305
+ }, [
1306
+ i === "hours" ? (A(), Q(
1307
+ ie,
1308
+ { key: 0 },
1309
+ [
1310
+ Re(
1311
+ ue(("0" + (a.amPmMode ? E % 12 || 12 : E)).slice(-2)) + ue(N(E)),
1312
+ 1
1313
+ /* TEXT */
1314
+ )
1315
+ ],
1316
+ 64
1317
+ /* STABLE_FRAGMENT */
1318
+ )) : (A(), Q(
1319
+ ie,
1320
+ { key: 1 },
1321
+ [
1322
+ Re(
1323
+ ue(("0" + E).slice(-2)),
1324
+ 1
1325
+ /* TEXT */
1326
+ )
1327
+ ],
1328
+ 64
1329
+ /* STABLE_FRAGMENT */
1330
+ ))
1331
+ ], 10, Pn))),
1332
+ 128
1333
+ /* KEYED_FRAGMENT */
1334
+ ))
1335
+ ]),
1336
+ _: 2
1337
+ /* DYNAMIC */
1338
+ }, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]))),
1339
+ 128
1340
+ /* KEYED_FRAGMENT */
1341
+ )),
1342
+ a.arrowControl ? (A(!0), Q(
1343
+ ie,
1344
+ { key: 1 },
1345
+ Fe(h.value, (i) => (A(), Q("div", {
1346
+ key: i,
1347
+ class: H([t(d).be("spinner", "wrapper"), t(d).is("arrow")]),
1348
+ onMouseenter: (g) => $(i)
1349
+ }, [
1350
+ at((A(), X(t(Se), {
1351
+ class: H(["arrow-up", t(d).be("spinner", "arrow")])
1352
+ }, {
1353
+ default: ee(() => [
1354
+ qe(t($t))
1355
+ ]),
1356
+ _: 1
1357
+ /* STABLE */
1358
+ }, 8, ["class"])), [
1359
+ [t(rt), J]
1360
+ ]),
1361
+ at((A(), X(t(Se), {
1362
+ class: H(["arrow-down", t(d).be("spinner", "arrow")])
1363
+ }, {
1364
+ default: ee(() => [
1365
+ qe(t(Lt))
1366
+ ]),
1367
+ _: 1
1368
+ /* STABLE */
1369
+ }, 8, ["class"])), [
1370
+ [t(rt), K]
1371
+ ]),
1372
+ pe(
1373
+ "ul",
1374
+ {
1375
+ class: H(t(d).be("spinner", "list"))
1376
+ },
1377
+ [
1378
+ (A(!0), Q(
1379
+ ie,
1380
+ null,
1381
+ Fe(v.value[i], (g, E) => (A(), Q(
1382
+ "li",
1383
+ {
1384
+ key: E,
1385
+ class: H([
1386
+ t(d).be("spinner", "item"),
1387
+ t(d).is("active", g === b.value[i]),
1388
+ t(d).is("disabled", P.value[i][g])
1389
+ ])
1390
+ },
1391
+ [
1392
+ t(an)(g) ? (A(), Q(
1393
+ ie,
1394
+ { key: 0 },
1395
+ [
1396
+ i === "hours" ? (A(), Q(
1397
+ ie,
1398
+ { key: 0 },
1399
+ [
1400
+ Re(
1401
+ ue(("0" + (a.amPmMode ? g % 12 || 12 : g)).slice(-2)) + ue(N(g)),
1402
+ 1
1403
+ /* TEXT */
1404
+ )
1405
+ ],
1406
+ 64
1407
+ /* STABLE_FRAGMENT */
1408
+ )) : (A(), Q(
1409
+ ie,
1410
+ { key: 1 },
1411
+ [
1412
+ Re(
1413
+ ue(("0" + g).slice(-2)),
1414
+ 1
1415
+ /* TEXT */
1416
+ )
1417
+ ],
1418
+ 64
1419
+ /* STABLE_FRAGMENT */
1420
+ ))
1421
+ ],
1422
+ 64
1423
+ /* STABLE_FRAGMENT */
1424
+ )) : fe("v-if", !0)
1425
+ ],
1426
+ 2
1427
+ /* CLASS */
1428
+ ))),
1429
+ 128
1430
+ /* KEYED_FRAGMENT */
1431
+ ))
1432
+ ],
1433
+ 2
1434
+ /* CLASS */
1435
+ )
1436
+ ], 42, Cn))),
1437
+ 128
1438
+ /* KEYED_FRAGMENT */
1439
+ )) : fe("v-if", !0)
1440
+ ],
1441
+ 2
1442
+ /* CLASS */
1443
+ ));
1444
+ }
1445
+ }), Zn = /* @__PURE__ */ Ne({
1446
+ __name: "panel-time-pick",
1447
+ props: bn,
1448
+ emits: ["pick", "select-range", "set-picker-option"],
1449
+ setup(r, { emit: p }) {
1450
+ const l = r, o = p, w = Ge(xe), {
1451
+ arrowControl: O,
1452
+ disabledHours: f,
1453
+ disabledMinutes: d,
1454
+ disabledSeconds: T,
1455
+ defaultValue: D
1456
+ } = w.props, { getAvailableHours: S, getAvailableMinutes: V, getAvailableSeconds: F } = kn(f, d, T), I = ve("time"), { t: m, lang: C } = pt(), n = G([0, 2]), h = wn(l), b = R(() => on(l.actualVisible) ? `${I.namespace.value}-zoom-in-top` : ""), P = R(() => l.format.includes("ss")), v = R(() => l.format.includes("A") ? "A" : l.format.includes("a") ? "a" : ""), y = (k) => {
1457
+ const M = Pe(k).locale(C.value), q = j(M);
1458
+ return M.isSame(q);
1459
+ }, N = () => {
1460
+ const k = h.value;
1461
+ o("pick", k, !1), Ce(() => {
1462
+ h.value = k;
1463
+ });
1464
+ }, $ = (k = !1, M = !1) => {
1465
+ M || o("pick", l.parsedValue, k);
1466
+ }, s = (k) => {
1467
+ if (!l.visible)
1468
+ return;
1469
+ const M = j(k).millisecond(0);
1470
+ o("pick", M, !0);
1471
+ }, L = (k, M) => {
1472
+ o("select-range", k, M), n.value = [k, M];
1473
+ }, Z = (k) => {
1474
+ const M = l.format, q = M.indexOf("HH"), B = M.indexOf("mm"), te = M.indexOf("ss"), a = [], u = [];
1475
+ q !== -1 && (a.push(q), u.push("hours")), B !== -1 && (a.push(B), u.push("minutes")), te !== -1 && P.value && (a.push(te), u.push("seconds"));
1476
+ const g = (a.indexOf(n.value[0]) + k + a.length) % a.length;
1477
+ _.start_emitSelectRange(u[g]);
1478
+ }, W = (k) => {
1479
+ const M = ht(k), { left: q, right: B, up: te, down: a } = we;
1480
+ if ([q, B].includes(M)) {
1481
+ Z(M === q ? -1 : 1), k.preventDefault();
1482
+ return;
1483
+ }
1484
+ if ([te, a].includes(M)) {
1485
+ const u = M === te ? -1 : 1;
1486
+ _.start_scrollDown(u), k.preventDefault();
1487
+ return;
1488
+ }
1489
+ }, { timePickerOptions: _, onSetOption: K, getAvailableTime: J } = yn({
1490
+ getAvailableHours: S,
1491
+ getAvailableMinutes: V,
1492
+ getAvailableSeconds: F
1493
+ }), j = (k) => J(k, l.datetimeRole || "", !0), x = (k) => k ? Pe(k, l.format).locale(C.value) : null, ne = () => Pe(D).locale(C.value);
1494
+ return o("set-picker-option", ["isValidValue", y]), o("set-picker-option", ["parseUserInput", x]), o("set-picker-option", ["handleKeydownInput", W]), o("set-picker-option", ["getRangeAvailableTime", j]), o("set-picker-option", ["getDefaultValue", ne]), (k, M) => (A(), X(Ut, { name: b.value }, {
1495
+ default: ee(() => [
1496
+ k.actualVisible || k.visible ? (A(), Q(
1497
+ "div",
1498
+ {
1499
+ key: 0,
1500
+ class: H(t(I).b("panel"))
1501
+ },
1502
+ [
1503
+ pe(
1504
+ "div",
1505
+ {
1506
+ class: H([t(I).be("panel", "content"), { "has-seconds": P.value }])
1507
+ },
1508
+ [
1509
+ qe(Mn, {
1510
+ ref: "spinner",
1511
+ role: k.datetimeRole || "start",
1512
+ "arrow-control": t(O),
1513
+ "show-seconds": P.value,
1514
+ "am-pm-mode": v.value,
1515
+ "spinner-date": (
1516
+ // https://github.com/vuejs/language-tools/issues/2104#issuecomment-3092541527
1517
+ k.parsedValue
1518
+ ),
1519
+ "disabled-hours": t(f),
1520
+ "disabled-minutes": t(d),
1521
+ "disabled-seconds": t(T),
1522
+ onChange: s,
1523
+ onSetOption: t(K),
1524
+ onSelectRange: L
1525
+ }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
1526
+ ],
1527
+ 2
1528
+ /* CLASS */
1529
+ ),
1530
+ pe(
1531
+ "div",
1532
+ {
1533
+ class: H(t(I).be("panel", "footer"))
1534
+ },
1535
+ [
1536
+ pe(
1537
+ "button",
1538
+ {
1539
+ type: "button",
1540
+ class: H([t(I).be("panel", "btn"), "cancel"]),
1541
+ onClick: N
1542
+ },
1543
+ ue(t(m)("el.datepicker.cancel")),
1544
+ 3
1545
+ /* TEXT, CLASS */
1546
+ ),
1547
+ pe(
1548
+ "button",
1549
+ {
1550
+ type: "button",
1551
+ class: H([t(I).be("panel", "btn"), "confirm"]),
1552
+ onClick: M[0] || (M[0] = (q) => $())
1553
+ },
1554
+ ue(t(m)("el.datepicker.confirm")),
1555
+ 3
1556
+ /* TEXT, CLASS */
1557
+ )
1558
+ ],
1559
+ 2
1560
+ /* CLASS */
1561
+ )
1562
+ ],
1563
+ 2
1564
+ /* CLASS */
1565
+ )) : fe("v-if", !0)
1566
+ ]),
1567
+ _: 1
1568
+ /* STABLE */
1569
+ }, 8, ["name"]));
1570
+ }
1571
+ });
1572
+ export {
1573
+ Ze as D,
1574
+ xe as P,
1575
+ dn as R,
1576
+ Mn as _,
1577
+ yn as a,
1578
+ kn as b,
1579
+ mn as c,
1580
+ Zn as d,
1581
+ cn as e,
1582
+ qn as f,
1583
+ _n as g,
1584
+ Ue as h,
1585
+ it as i,
1586
+ $e as j,
1587
+ jn as k,
1588
+ zn as l,
1589
+ ct as m,
1590
+ Ke as n,
1591
+ Ee as o,
1592
+ ut as p,
1593
+ Un as q,
1594
+ Kn as r,
1595
+ lt as s,
1596
+ fn as t,
1597
+ wn as u,
1598
+ bt as v,
1599
+ kt as w,
1600
+ Wn as x,
1601
+ yt as y,
1602
+ pn as z
1603
+ };