@dazhicheng/ui 1.1.0 → 1.4.1

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