adverich-kun-ui 0.1.548 → 0.1.550
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adverich-kun-ui.css +1 -1
- package/dist/components/KunClock/src/components/KunClock.vue.js +42 -0
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue.js +2 -2
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue2.js +273 -258
- package/dist/index.js +182 -179
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { usePosition as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as Ce, ref as w, computed as k, watch as Ve, onMounted as Te, onUnmounted as Ae, createElementBlock as f, openBlock as d, createVNode as V, createBlock as Ye, mergeProps as Fe, withKeys as le, withCtx as E, createElementVNode as g, withModifiers as ae, Teleport as $e, Transition as Ne, createCommentVNode as A, normalizeStyle as re, normalizeClass as I, unref as ze, toDisplayString as N, Fragment as U, renderList as W, createTextVNode as oe, nextTick as Be } from "vue";
|
|
2
|
+
import He from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
3
|
+
import K from "../../../KunNumberField/src/components/KunNumberField.vue.js";
|
|
4
|
+
import { usePosition as Le } from "../composables/usePosition.js";
|
|
5
|
+
import se from "../../../KunBtn/src/components/KunBtn.vue.js";
|
|
6
|
+
const Re = {
|
|
7
7
|
key: 0,
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
9
|
class: "h-5 w-5",
|
|
@@ -11,7 +11,7 @@ const Be = {
|
|
|
11
11
|
viewBox: "0 0 24 24",
|
|
12
12
|
stroke: "currentColor",
|
|
13
13
|
"stroke-width": "2"
|
|
14
|
-
},
|
|
14
|
+
}, Ee = {
|
|
15
15
|
key: 1,
|
|
16
16
|
xmlns: "http://www.w3.org/2000/svg",
|
|
17
17
|
class: "h-5 w-5",
|
|
@@ -19,25 +19,25 @@ const Be = {
|
|
|
19
19
|
viewBox: "0 0 24 24",
|
|
20
20
|
stroke: "currentColor",
|
|
21
21
|
"stroke-width": "2"
|
|
22
|
-
},
|
|
22
|
+
}, Pe = {
|
|
23
23
|
key: 0,
|
|
24
24
|
class: "px-2 py-3 flex items-center justify-between border-b border-slate-100 dark:border-slate-700/50 bg-slate-50/50 dark:bg-slate-800/50 flex-shrink-0"
|
|
25
|
-
},
|
|
25
|
+
}, Oe = {
|
|
26
26
|
key: 1,
|
|
27
27
|
class: "flex-1 overflow-y-auto custom-scrollbar p-3 min-h-0"
|
|
28
|
-
},
|
|
28
|
+
}, je = { key: 0 }, Ie = { class: "grid grid-cols-7 mb-2 text-center" }, Ue = { class: "grid grid-cols-7 gap-1" }, We = ["onClick"], Ke = {
|
|
29
29
|
key: 1,
|
|
30
30
|
class: "grid grid-cols-3 gap-2"
|
|
31
|
-
},
|
|
31
|
+
}, Ze = ["onClick"], qe = {
|
|
32
32
|
key: 2,
|
|
33
33
|
class: "border-t border-slate-100 dark:border-slate-700 p-3 bg-slate-50/50 dark:bg-slate-800/50 grid grid-cols-3 gap-2 text-center flex-shrink-0"
|
|
34
|
-
},
|
|
34
|
+
}, Ge = { class: "flex flex-col items-center" }, Je = { class: "flex flex-col items-center" }, Qe = {
|
|
35
35
|
key: 0,
|
|
36
36
|
class: "flex flex-col items-center"
|
|
37
|
-
},
|
|
37
|
+
}, Xe = {
|
|
38
38
|
key: 3,
|
|
39
39
|
class: "p-3 border-t border-slate-100 dark:border-slate-700 flex justify-end gap-2 bg-white dark:bg-slate-800 flex-shrink-0"
|
|
40
|
-
},
|
|
40
|
+
}, at = /* @__PURE__ */ Ce({
|
|
41
41
|
__name: "KunDatePicker",
|
|
42
42
|
props: {
|
|
43
43
|
modelValue: { type: [Date, Array, String], default: null },
|
|
@@ -76,259 +76,274 @@ const Be = {
|
|
|
76
76
|
dialogClass: { default: "" }
|
|
77
77
|
},
|
|
78
78
|
emits: ["update:modelValue", "change", "close", "open"],
|
|
79
|
-
setup(
|
|
80
|
-
const
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
YYYY:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
setup(m, { emit: ie }) {
|
|
80
|
+
const l = m, z = ie, Z = Math.random().toString(36).substr(2, 9), ue = w(null), h = w(null), B = w(null), T = w(!1), H = w("days"), c = w(null), D = w((/* @__PURE__ */ new Date()).getMonth()), y = w((/* @__PURE__ */ new Date()).getFullYear()), v = w({ hours: 0, minutes: 0, seconds: 0 });
|
|
81
|
+
function q(t, e) {
|
|
82
|
+
const n = t.getFullYear().toString(), a = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0"), o = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0"), p = String(t.getSeconds()).padStart(2, "0"), s = {
|
|
83
|
+
YYYY: n,
|
|
84
|
+
yyyy: n,
|
|
85
|
+
YY: n.slice(-2),
|
|
86
|
+
yy: n.slice(-2),
|
|
87
|
+
MM: a,
|
|
88
|
+
DD: r,
|
|
89
|
+
dd: r,
|
|
90
|
+
HH: o,
|
|
91
|
+
mm: i,
|
|
92
|
+
ss: p
|
|
89
93
|
};
|
|
90
|
-
return e.replace(/YYYY|MM|DD|HH|mm|ss/g, (
|
|
94
|
+
return e.replace(/YYYY|yyyy|YY|yy|MM|DD|dd|HH|mm|ss/g, (x) => s[x]);
|
|
91
95
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
function de(t, e) {
|
|
97
|
+
if (!t || !e) return null;
|
|
98
|
+
const n = e.match(/[a-zA-Z]+/g), a = t.match(/\d+/g);
|
|
99
|
+
if (!n || !a || n.length !== a.length) return null;
|
|
100
|
+
let r = (/* @__PURE__ */ new Date()).getFullYear(), o = 0, i = 1, p = 0, s = 0, x = 0;
|
|
101
|
+
n.forEach((M, ne) => {
|
|
102
|
+
const u = parseInt(a[ne], 10);
|
|
103
|
+
isNaN(u) || (/y/i.test(M) ? r = u < 100 ? 2e3 + u : u : M === "MM" ? o = u - 1 : /d/i.test(M) ? i = u : M === "HH" ? p = u : M === "mm" ? s = u : M === "ss" && (x = u));
|
|
104
|
+
});
|
|
105
|
+
const R = new Date(r, o, i, p, s, x);
|
|
106
|
+
return R.getMonth() !== o ? null : R;
|
|
107
|
+
}
|
|
108
|
+
function P(t) {
|
|
109
|
+
if (!t) return null;
|
|
110
|
+
if (t instanceof Date) return t;
|
|
111
|
+
if (typeof t == "string") {
|
|
112
|
+
const e = Y("value");
|
|
113
|
+
if (e) {
|
|
114
|
+
const o = de(t, e);
|
|
115
|
+
if (o && !isNaN(o.getTime())) return o;
|
|
116
|
+
}
|
|
117
|
+
const n = new Date(t);
|
|
118
|
+
if (!isNaN(n.getTime())) return n;
|
|
119
|
+
if (b.value === "time") {
|
|
120
|
+
const [o, i, p] = t.split(/[:\s]/).map(Number), s = /* @__PURE__ */ new Date();
|
|
121
|
+
return s.setHours(o || 0, i || 0, p || 0, 0), s;
|
|
122
|
+
}
|
|
123
|
+
const a = t.replace(" ", "T"), r = new Date(a);
|
|
124
|
+
if (!isNaN(r.getTime())) return r;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const b = k(() => l.mode ? l.mode : l.enableTime ? "datetime" : "date"), S = k(() => b.value === "datetime" || b.value === "time" || l.enableTime), ce = k(() => l.enableSeconds || Y("value") && Y("value").includes("ss"));
|
|
129
|
+
Ve(() => l.modelValue, (t) => {
|
|
130
|
+
G(t);
|
|
95
131
|
}, { immediate: !0 });
|
|
96
|
-
function
|
|
97
|
-
if (t)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (p.value === "time") {
|
|
104
|
-
const [d, h, s] = l.split(/[:\s]/).map(Number), V = /* @__PURE__ */ new Date();
|
|
105
|
-
return V.setHours(d || 0, h || 0, s || 0, 0), V;
|
|
106
|
-
}
|
|
107
|
-
const r = l.replace(" ", "T"), o = new Date(r);
|
|
108
|
-
if (!isNaN(o.getTime())) return o;
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
};
|
|
112
|
-
if (a.range && Array.isArray(t) && t.length > 0) {
|
|
113
|
-
const l = t.map(e).filter((r) => r);
|
|
114
|
-
u.value = l.length > 0 ? l : null;
|
|
115
|
-
const n = l[0];
|
|
116
|
-
n && (x.value = n.getMonth(), v.value = n.getFullYear(), D.value && G(n));
|
|
132
|
+
function G(t) {
|
|
133
|
+
if (t)
|
|
134
|
+
if (l.range && Array.isArray(t) && t.length > 0) {
|
|
135
|
+
const e = t.map((a) => P(a)).filter((a) => a);
|
|
136
|
+
e.length === 2 && e[0] > e[1] && e.reverse(), c.value = e.length > 0 ? e : null;
|
|
137
|
+
const n = e[0];
|
|
138
|
+
n && (D.value = n.getMonth(), y.value = n.getFullYear(), S.value && Q(n));
|
|
117
139
|
} else {
|
|
118
|
-
const
|
|
119
|
-
|
|
140
|
+
const e = P(t);
|
|
141
|
+
e && (c.value = e, D.value = e.getMonth(), y.value = e.getFullYear(), S.value && Q(e));
|
|
120
142
|
}
|
|
121
|
-
|
|
122
|
-
|
|
143
|
+
else
|
|
144
|
+
c.value = null, J();
|
|
123
145
|
}
|
|
124
|
-
function
|
|
146
|
+
function J() {
|
|
125
147
|
let t = /* @__PURE__ */ new Date();
|
|
126
|
-
if (
|
|
127
|
-
const e =
|
|
148
|
+
if (l.startDate) {
|
|
149
|
+
const e = l.startDate instanceof Date ? l.startDate : new Date(l.startDate);
|
|
128
150
|
isNaN(e.getTime()) || (t = e);
|
|
129
151
|
}
|
|
130
|
-
if (
|
|
131
|
-
if (typeof
|
|
132
|
-
|
|
133
|
-
else if (typeof
|
|
134
|
-
const [e,
|
|
135
|
-
|
|
152
|
+
if (D.value = t.getMonth(), y.value = t.getFullYear(), l.startTime) {
|
|
153
|
+
if (typeof l.startTime == "object")
|
|
154
|
+
v.value = { hours: 0, minutes: 0, seconds: 0, ...l.startTime };
|
|
155
|
+
else if (typeof l.startTime == "string") {
|
|
156
|
+
const [e, n, a] = l.startTime.split(":").map(Number);
|
|
157
|
+
v.value = { hours: e || 0, minutes: n || 0, seconds: a || 0 };
|
|
136
158
|
}
|
|
137
159
|
} else {
|
|
138
160
|
const e = /* @__PURE__ */ new Date();
|
|
139
|
-
|
|
161
|
+
v.value = { hours: e.getHours(), minutes: e.getMinutes(), seconds: 0 };
|
|
140
162
|
}
|
|
141
163
|
}
|
|
142
|
-
function
|
|
143
|
-
|
|
164
|
+
function Q(t) {
|
|
165
|
+
v.value = {
|
|
144
166
|
hours: t.getHours(),
|
|
145
167
|
minutes: t.getMinutes(),
|
|
146
168
|
seconds: t.getSeconds()
|
|
147
169
|
};
|
|
148
170
|
}
|
|
149
|
-
const { style:
|
|
171
|
+
const { style: fe, update: me } = Le(h, B, {
|
|
150
172
|
offset: 8,
|
|
151
|
-
align:
|
|
152
|
-
}),
|
|
173
|
+
align: l.align
|
|
174
|
+
}), ge = k(() => {
|
|
153
175
|
var e;
|
|
154
|
-
let t =
|
|
155
|
-
return
|
|
176
|
+
let t = l.calendarWidth;
|
|
177
|
+
return l.fullWidth && ((e = h.value) != null && e.rootRef) && (t = h.value.rootRef.getBoundingClientRect().width), b.value === "time" && (t = 200), {
|
|
156
178
|
width: typeof t == "number" ? `${t}px` : t
|
|
157
179
|
};
|
|
158
|
-
}),
|
|
180
|
+
}), ve = k(() => new Date(y.value, D.value).toLocaleString(l.locale, { month: "long" }).replace(/^\w/, (t) => t.toUpperCase())), pe = k(() => {
|
|
159
181
|
const t = [], e = new Date(2023, 0, 1);
|
|
160
182
|
for (; e.getDay() !== 1; )
|
|
161
183
|
e.setDate(e.getDate() + 1);
|
|
162
|
-
for (let
|
|
163
|
-
t.push(e.toLocaleString(
|
|
184
|
+
for (let n = 0; n < 7; n++)
|
|
185
|
+
t.push(e.toLocaleString(l.locale, { weekday: "narrow" }).replace(".", "")), e.setDate(e.getDate() + 1);
|
|
164
186
|
return t;
|
|
165
187
|
});
|
|
166
|
-
function
|
|
167
|
-
return
|
|
188
|
+
function Y(t) {
|
|
189
|
+
return l.formats && l.formats[t] ? l.formats[t] : t === "value" ? l.valueFormat : t === "display" ? l.displayFormat : null;
|
|
168
190
|
}
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
171
|
-
const t = { day: "2-digit", month: "2-digit", year: "numeric" }, e = { hour: "2-digit", minute: "2-digit", second:
|
|
172
|
-
const o =
|
|
173
|
-
if (o) return
|
|
174
|
-
let
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
else if (typeof r == "string")
|
|
180
|
-
if (p.value === "time" && r.includes(":")) {
|
|
181
|
-
const [d, h, s] = r.split(/[:\s]/).map(Number);
|
|
182
|
-
o = /* @__PURE__ */ new Date(), o.setHours(d || 0, h || 0, s || 0, 0);
|
|
183
|
-
} else
|
|
184
|
-
o = new Date(r);
|
|
185
|
-
return o && !isNaN(o.getTime()) ? l(o) : String(r);
|
|
191
|
+
const ye = k(() => {
|
|
192
|
+
if (!l.modelValue) return "";
|
|
193
|
+
const t = { day: "2-digit", month: "2-digit", year: "numeric" }, e = { hour: "2-digit", minute: "2-digit", second: ce.value ? "2-digit" : void 0 }, n = (r) => {
|
|
194
|
+
const o = Y("display");
|
|
195
|
+
if (o) return q(r, o);
|
|
196
|
+
let i = "";
|
|
197
|
+
return b.value !== "time" && (i += r.toLocaleDateString(l.locale, t)), b.value === "datetime" && (i += " " + r.toLocaleTimeString(l.locale, e)), b.value === "time" && (i = r.toLocaleTimeString(l.locale, e)), i;
|
|
198
|
+
}, a = (r) => {
|
|
199
|
+
const o = P(r);
|
|
200
|
+
return o ? n(o) : String(r);
|
|
186
201
|
};
|
|
187
|
-
if (
|
|
188
|
-
const r =
|
|
202
|
+
if (l.range && Array.isArray(l.modelValue)) {
|
|
203
|
+
const r = l.modelValue[0] ? a(l.modelValue[0]) : "", o = l.modelValue[1] ? a(l.modelValue[1]) : "";
|
|
189
204
|
return r ? o ? `${r} ~ ${o}` : `${r} ~ ...` : "";
|
|
190
205
|
}
|
|
191
|
-
return
|
|
192
|
-
}),
|
|
193
|
-
if (
|
|
194
|
-
const t =
|
|
195
|
-
for (let s = 0; s <
|
|
196
|
-
|
|
197
|
-
day: o -
|
|
198
|
-
date: new Date(t, e - 1, o -
|
|
206
|
+
return a(l.modelValue);
|
|
207
|
+
}), he = k(() => {
|
|
208
|
+
if (b.value === "time") return [];
|
|
209
|
+
const t = y.value, e = D.value, n = new Date(t, e, 1).getDay(), a = n === 0 ? 6 : n - 1, r = new Date(t, e + 1, 0).getDate(), o = new Date(t, e, 0).getDate(), i = [];
|
|
210
|
+
for (let s = 0; s < a; s++)
|
|
211
|
+
i.push({
|
|
212
|
+
day: o - a + s + 1,
|
|
213
|
+
date: new Date(t, e - 1, o - a + s + 1),
|
|
199
214
|
isCurrentMonth: !1
|
|
200
215
|
});
|
|
201
216
|
for (let s = 1; s <= r; s++)
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
for (let s = 1; s <=
|
|
205
|
-
|
|
206
|
-
return
|
|
207
|
-
}),
|
|
217
|
+
i.push({ day: s, date: new Date(t, e, s), isCurrentMonth: !0 });
|
|
218
|
+
const p = 42 - i.length;
|
|
219
|
+
for (let s = 1; s <= p; s++)
|
|
220
|
+
i.push({ day: s, date: new Date(t, e + 1, s), isCurrentMonth: !1 });
|
|
221
|
+
return i;
|
|
222
|
+
}), be = k(() => {
|
|
208
223
|
const t = [], e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
209
|
-
for (let
|
|
210
|
-
t.push(
|
|
224
|
+
for (let n = e - 100; n <= e + 20; n++)
|
|
225
|
+
t.push(n);
|
|
211
226
|
return t.reverse();
|
|
212
227
|
});
|
|
213
|
-
function
|
|
214
|
-
|
|
228
|
+
function F() {
|
|
229
|
+
l.disabled || (T.value ? $() : we());
|
|
215
230
|
}
|
|
216
|
-
function
|
|
217
|
-
window.dispatchEvent(new CustomEvent("kun:datepicker:open", { detail: { id:
|
|
218
|
-
|
|
231
|
+
function we() {
|
|
232
|
+
window.dispatchEvent(new CustomEvent("kun:datepicker:open", { detail: { id: Z } })), T.value = !0, l.modelValue ? G(l.modelValue) : J(), z("open"), Be(() => {
|
|
233
|
+
me();
|
|
219
234
|
});
|
|
220
235
|
}
|
|
221
236
|
function $() {
|
|
222
|
-
|
|
237
|
+
T.value = !1, z("close");
|
|
223
238
|
}
|
|
224
|
-
function
|
|
225
|
-
t.detail.id !==
|
|
239
|
+
function X(t) {
|
|
240
|
+
t.detail.id !== Z && T.value && $();
|
|
226
241
|
}
|
|
227
|
-
function
|
|
228
|
-
if (!
|
|
242
|
+
function _(t) {
|
|
243
|
+
if (!T.value) return;
|
|
229
244
|
const e = t.target;
|
|
230
|
-
|
|
245
|
+
B.value && B.value.contains(e) || h.value && (h.value.rootRef && h.value.rootRef.contains(e) || h.value.$el && h.value.$el.contains(e)) || $();
|
|
231
246
|
}
|
|
232
|
-
|
|
233
|
-
document.addEventListener("click",
|
|
234
|
-
}),
|
|
235
|
-
document.removeEventListener("click",
|
|
247
|
+
Te(() => {
|
|
248
|
+
document.addEventListener("click", _, !0), window.addEventListener("kun:datepicker:open", X);
|
|
249
|
+
}), Ae(() => {
|
|
250
|
+
document.removeEventListener("click", _, !0), window.removeEventListener("kun:datepicker:open", X);
|
|
236
251
|
});
|
|
237
|
-
function
|
|
238
|
-
let e =
|
|
239
|
-
e > 11 ? (e = 0,
|
|
252
|
+
function ee(t) {
|
|
253
|
+
let e = D.value + t;
|
|
254
|
+
e > 11 ? (e = 0, y.value++) : e < 0 && (e = 11, y.value--), D.value = e;
|
|
240
255
|
}
|
|
241
|
-
function
|
|
242
|
-
|
|
256
|
+
function ke() {
|
|
257
|
+
H.value = H.value === "days" ? "years" : "days";
|
|
243
258
|
}
|
|
244
|
-
function
|
|
245
|
-
|
|
259
|
+
function xe(t) {
|
|
260
|
+
y.value = t, H.value = "days";
|
|
246
261
|
}
|
|
247
|
-
function
|
|
262
|
+
function O(t) {
|
|
248
263
|
const e = new Date(t);
|
|
249
|
-
return
|
|
264
|
+
return S.value ? e.setHours(v.value.hours || 0, v.value.minutes || 0, v.value.seconds || 0, 0) : e.setHours(0, 0, 0, 0), e;
|
|
250
265
|
}
|
|
251
|
-
function
|
|
252
|
-
const e =
|
|
253
|
-
if (
|
|
254
|
-
let
|
|
255
|
-
if (
|
|
256
|
-
else if (
|
|
257
|
-
let
|
|
258
|
-
r <
|
|
266
|
+
function De(t) {
|
|
267
|
+
const e = O(t.date);
|
|
268
|
+
if (l.range) {
|
|
269
|
+
let n = Array.isArray(c.value) ? [...c.value] : [];
|
|
270
|
+
if (n.length === 2 && (n = []), n.length === 0) n = [e];
|
|
271
|
+
else if (n.length === 1) {
|
|
272
|
+
let a = n[0], r = e;
|
|
273
|
+
r < a && ([a, r] = [r, a]), n = [a, r];
|
|
259
274
|
}
|
|
260
|
-
|
|
275
|
+
c.value = n, l.autoApply && n.length === 2 && !S.value && j();
|
|
261
276
|
} else
|
|
262
|
-
|
|
277
|
+
c.value = e, l.autoApply && !S.value && j();
|
|
263
278
|
}
|
|
264
|
-
function
|
|
265
|
-
let t =
|
|
266
|
-
const e =
|
|
267
|
-
|
|
279
|
+
function L() {
|
|
280
|
+
let t = c.value instanceof Date ? c.value : /* @__PURE__ */ new Date();
|
|
281
|
+
const e = O(t);
|
|
282
|
+
l.range || (c.value = e);
|
|
268
283
|
}
|
|
269
|
-
function
|
|
270
|
-
const t =
|
|
284
|
+
function Se() {
|
|
285
|
+
const t = c.value;
|
|
271
286
|
if (!t) return null;
|
|
272
|
-
const e =
|
|
273
|
-
return Array.isArray(t) ? t.map((
|
|
287
|
+
const e = Y("value"), n = (a) => e ? q(a, e) : a;
|
|
288
|
+
return Array.isArray(t) ? t.map((a) => n(a)) : n(t);
|
|
274
289
|
}
|
|
275
|
-
function
|
|
276
|
-
|
|
277
|
-
const t =
|
|
278
|
-
|
|
290
|
+
function j() {
|
|
291
|
+
S.value && c.value && !Array.isArray(c.value) ? c.value = O(c.value) : b.value === "time" && !c.value && L();
|
|
292
|
+
const t = Se();
|
|
293
|
+
z("update:modelValue", t), z("change", t), $();
|
|
279
294
|
}
|
|
280
|
-
function
|
|
281
|
-
const { date: e, isCurrentMonth:
|
|
282
|
-
let o = !1,
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
const [
|
|
286
|
-
|
|
287
|
-
} else !
|
|
288
|
-
const
|
|
289
|
-
return o ? `${
|
|
295
|
+
function Me(t) {
|
|
296
|
+
const { date: e, isCurrentMonth: n } = t, r = te(e, /* @__PURE__ */ new Date());
|
|
297
|
+
let o = !1, i = !1;
|
|
298
|
+
const p = (u, C) => u instanceof Date && te(u, C), s = c.value;
|
|
299
|
+
if (l.range && Array.isArray(s)) {
|
|
300
|
+
const [u, C] = s;
|
|
301
|
+
u && p(u, e) && (o = !0), C && p(C, e) && (o = !0), u && C && u instanceof Date && C instanceof Date && e > u && e < C && (i = !0);
|
|
302
|
+
} else !l.range && s instanceof Date && p(s, e) && (o = !0);
|
|
303
|
+
const x = "flex items-center justify-center font-medium text-sm z-10", R = n ? "text-slate-700 dark:text-slate-200" : "text-slate-300 dark:text-slate-600";
|
|
304
|
+
return o ? `${x} bg-blue-600 text-white shadow-md hover:bg-blue-700 rounded-full` : i ? `${x} bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-none` : `${x} ${R} hover:bg-slate-100 dark:hover:bg-slate-700 ${r ? "border border-blue-500 text-blue-600 dark:text-blue-400 font-bold" : ""}`;
|
|
290
305
|
}
|
|
291
|
-
function
|
|
306
|
+
function te(t, e) {
|
|
292
307
|
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
293
308
|
}
|
|
294
|
-
return (t, e) => (
|
|
309
|
+
return (t, e) => (d(), f("div", {
|
|
295
310
|
class: "relative w-full",
|
|
296
311
|
ref_key: "containerRef",
|
|
297
|
-
ref:
|
|
312
|
+
ref: ue
|
|
298
313
|
}, [
|
|
299
|
-
|
|
314
|
+
V(He, Fe({
|
|
300
315
|
ref_key: "triggerRef",
|
|
301
|
-
ref:
|
|
302
|
-
"model-value":
|
|
303
|
-
label:
|
|
304
|
-
placeholder:
|
|
305
|
-
disabled:
|
|
316
|
+
ref: h,
|
|
317
|
+
"model-value": ye.value,
|
|
318
|
+
label: m.label,
|
|
319
|
+
placeholder: m.placeholder,
|
|
320
|
+
disabled: m.disabled,
|
|
306
321
|
readonly: ""
|
|
307
322
|
}, t.$attrs, {
|
|
308
|
-
onHandleClick:
|
|
309
|
-
onClick:
|
|
323
|
+
onHandleClick: F,
|
|
324
|
+
onClick: F,
|
|
310
325
|
onKeyDown: [
|
|
311
|
-
|
|
312
|
-
|
|
326
|
+
le(F, ["enter"]),
|
|
327
|
+
le(F, ["space"])
|
|
313
328
|
],
|
|
314
|
-
class: ["cursor-pointer",
|
|
315
|
-
"error-message":
|
|
316
|
-
"has-error": !!
|
|
329
|
+
class: ["cursor-pointer", m.inputClass],
|
|
330
|
+
"error-message": m.errorMessage,
|
|
331
|
+
"has-error": !!m.errorMessage,
|
|
317
332
|
"hide-details": ""
|
|
318
333
|
}), {
|
|
319
|
-
"append-inner":
|
|
320
|
-
|
|
334
|
+
"append-inner": E(() => [
|
|
335
|
+
g("div", {
|
|
321
336
|
class: "cursor-pointer text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors",
|
|
322
|
-
onClick:
|
|
337
|
+
onClick: ae(F, ["stop"])
|
|
323
338
|
}, [
|
|
324
|
-
|
|
325
|
-
|
|
339
|
+
m.mode === "time" ? (d(), f("svg", Re, [...e[6] || (e[6] = [
|
|
340
|
+
g("path", {
|
|
326
341
|
"stroke-linecap": "round",
|
|
327
342
|
"stroke-linejoin": "round",
|
|
328
343
|
d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
329
344
|
}, null, -1)
|
|
330
|
-
])])) : (
|
|
331
|
-
|
|
345
|
+
])])) : (d(), f("svg", Ee, [...e[7] || (e[7] = [
|
|
346
|
+
g("path", {
|
|
332
347
|
"stroke-linecap": "round",
|
|
333
348
|
"stroke-linejoin": "round",
|
|
334
349
|
d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"
|
|
@@ -338,8 +353,8 @@ const Be = {
|
|
|
338
353
|
]),
|
|
339
354
|
_: 1
|
|
340
355
|
}, 16, ["model-value", "label", "placeholder", "disabled", "class", "error-message", "has-error"]),
|
|
341
|
-
(
|
|
342
|
-
|
|
356
|
+
(d(), Ye($e, { to: "body" }, [
|
|
357
|
+
V(Ne, {
|
|
343
358
|
"enter-active-class": "transition ease-out duration-150",
|
|
344
359
|
"enter-from-class": "opacity-0 scale-95",
|
|
345
360
|
"enter-to-class": "opacity-100 scale-100",
|
|
@@ -347,90 +362,90 @@ const Be = {
|
|
|
347
362
|
"leave-from-class": "opacity-100 scale-100",
|
|
348
363
|
"leave-to-class": "opacity-0 scale-95"
|
|
349
364
|
}, {
|
|
350
|
-
default:
|
|
351
|
-
|
|
365
|
+
default: E(() => [
|
|
366
|
+
T.value ? (d(), f("div", {
|
|
352
367
|
key: 0,
|
|
353
368
|
ref_key: "popoverRef",
|
|
354
|
-
ref:
|
|
355
|
-
class:
|
|
356
|
-
style:
|
|
357
|
-
onClick: e[5] || (e[5] =
|
|
369
|
+
ref: B,
|
|
370
|
+
class: I(["fixed shadow-2xl rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 flex flex-col font-sans select-none overflow-hidden", [m.dialogClass]]),
|
|
371
|
+
style: re([ze(fe), ge.value]),
|
|
372
|
+
onClick: e[5] || (e[5] = ae(() => {
|
|
358
373
|
}, ["stop"]))
|
|
359
374
|
}, [
|
|
360
|
-
|
|
361
|
-
|
|
375
|
+
m.mode !== "time" ? (d(), f("div", Pe, [
|
|
376
|
+
g("button", {
|
|
362
377
|
type: "button",
|
|
363
378
|
class: "p-1 rounded-full hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors text-slate-600 dark:text-slate-300 focus:outline-none focus:ring-2 focus:ring-slate-400",
|
|
364
|
-
onClick: e[0] || (e[0] = (
|
|
379
|
+
onClick: e[0] || (e[0] = (n) => ee(-1))
|
|
365
380
|
}, [...e[8] || (e[8] = [
|
|
366
|
-
|
|
381
|
+
g("svg", {
|
|
367
382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
368
383
|
class: "h-5 w-5",
|
|
369
384
|
viewBox: "0 0 20 20",
|
|
370
385
|
fill: "currentColor"
|
|
371
386
|
}, [
|
|
372
|
-
|
|
387
|
+
g("path", {
|
|
373
388
|
"fill-rule": "evenodd",
|
|
374
389
|
d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",
|
|
375
390
|
"clip-rule": "evenodd"
|
|
376
391
|
})
|
|
377
392
|
], -1)
|
|
378
393
|
])]),
|
|
379
|
-
|
|
394
|
+
g("div", {
|
|
380
395
|
class: "font-semibold text-slate-800 dark:text-slate-100 cursor-pointer hover:bg-slate-200 dark:hover:bg-slate-700 px-3 py-1 rounded transition-colors text-center",
|
|
381
|
-
onClick:
|
|
382
|
-
}, N(
|
|
383
|
-
|
|
396
|
+
onClick: ke
|
|
397
|
+
}, N(ve.value) + " " + N(y.value), 1),
|
|
398
|
+
g("button", {
|
|
384
399
|
type: "button",
|
|
385
400
|
class: "p-1 rounded-full hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors text-slate-600 dark:text-slate-300 focus:outline-none focus:ring-2 focus:ring-slate-400",
|
|
386
|
-
onClick: e[1] || (e[1] = (
|
|
401
|
+
onClick: e[1] || (e[1] = (n) => ee(1))
|
|
387
402
|
}, [...e[9] || (e[9] = [
|
|
388
|
-
|
|
403
|
+
g("svg", {
|
|
389
404
|
xmlns: "http://www.w3.org/2000/svg",
|
|
390
405
|
class: "h-5 w-5",
|
|
391
406
|
viewBox: "0 0 20 20",
|
|
392
407
|
fill: "currentColor"
|
|
393
408
|
}, [
|
|
394
|
-
|
|
409
|
+
g("path", {
|
|
395
410
|
"fill-rule": "evenodd",
|
|
396
411
|
d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
|
|
397
412
|
"clip-rule": "evenodd"
|
|
398
413
|
})
|
|
399
414
|
], -1)
|
|
400
415
|
])])
|
|
401
|
-
])) :
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
(
|
|
406
|
-
key:
|
|
416
|
+
])) : A("", !0),
|
|
417
|
+
m.mode !== "time" ? (d(), f("div", Oe, [
|
|
418
|
+
H.value === "days" ? (d(), f("div", je, [
|
|
419
|
+
g("div", Ie, [
|
|
420
|
+
(d(!0), f(U, null, W(pe.value, (n) => (d(), f("span", {
|
|
421
|
+
key: n,
|
|
407
422
|
class: "text-[0.7rem] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest"
|
|
408
|
-
}, N(
|
|
423
|
+
}, N(n), 1))), 128))
|
|
409
424
|
]),
|
|
410
|
-
|
|
411
|
-
(
|
|
412
|
-
key:
|
|
413
|
-
class:
|
|
414
|
-
style:
|
|
415
|
-
onClick: (r) =>
|
|
416
|
-
}, N(
|
|
425
|
+
g("div", Ue, [
|
|
426
|
+
(d(!0), f(U, null, W(he.value, (n, a) => (d(), f("div", {
|
|
427
|
+
key: a,
|
|
428
|
+
class: I(["relative flex items-center justify-center rounded-full transition-all duration-150 cursor-pointer group", Me(n)]),
|
|
429
|
+
style: re({ width: m.daySize, height: m.daySize, fontSize: m.fontSize }),
|
|
430
|
+
onClick: (r) => De(n)
|
|
431
|
+
}, N(n.day), 15, We))), 128))
|
|
417
432
|
])
|
|
418
|
-
])) : (
|
|
419
|
-
(
|
|
420
|
-
key:
|
|
421
|
-
class:
|
|
422
|
-
onClick: (
|
|
423
|
-
}, N(
|
|
433
|
+
])) : (d(), f("div", Ke, [
|
|
434
|
+
(d(!0), f(U, null, W(be.value, (n) => (d(), f("div", {
|
|
435
|
+
key: n,
|
|
436
|
+
class: I(["p-2 text-center rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700 cursor-pointer transition-colors text-sm border border-transparent", { "bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 border-blue-200 dark:border-blue-800 font-bold": n === y.value }]),
|
|
437
|
+
onClick: (a) => xe(n)
|
|
438
|
+
}, N(n), 11, Ze))), 128))
|
|
424
439
|
]))
|
|
425
|
-
])) :
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
modelValue:
|
|
430
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
440
|
+
])) : A("", !0),
|
|
441
|
+
S.value ? (d(), f("div", qe, [
|
|
442
|
+
g("div", Ge, [
|
|
443
|
+
V(K, {
|
|
444
|
+
modelValue: v.value.hours,
|
|
445
|
+
"onUpdate:modelValue": e[2] || (e[2] = (n) => v.value.hours = n),
|
|
431
446
|
min: 0,
|
|
432
447
|
max: 23,
|
|
433
|
-
onChange:
|
|
448
|
+
onChange: L,
|
|
434
449
|
precision: "0",
|
|
435
450
|
"text-center": "",
|
|
436
451
|
label: "Hora",
|
|
@@ -440,13 +455,13 @@ const Be = {
|
|
|
440
455
|
placeholder: "00"
|
|
441
456
|
}, null, 8, ["modelValue"])
|
|
442
457
|
]),
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
modelValue:
|
|
446
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
458
|
+
g("div", Je, [
|
|
459
|
+
V(K, {
|
|
460
|
+
modelValue: v.value.minutes,
|
|
461
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => v.value.minutes = n),
|
|
447
462
|
min: 0,
|
|
448
463
|
max: 59,
|
|
449
|
-
onChange:
|
|
464
|
+
onChange: L,
|
|
450
465
|
precision: "0",
|
|
451
466
|
"text-center": "",
|
|
452
467
|
label: "Min",
|
|
@@ -456,13 +471,13 @@ const Be = {
|
|
|
456
471
|
placeholder: "00"
|
|
457
472
|
}, null, 8, ["modelValue"])
|
|
458
473
|
]),
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
modelValue:
|
|
462
|
-
"onUpdate:modelValue": e[4] || (e[4] = (
|
|
474
|
+
m.enableSeconds ? (d(), f("div", Qe, [
|
|
475
|
+
V(K, {
|
|
476
|
+
modelValue: v.value.seconds,
|
|
477
|
+
"onUpdate:modelValue": e[4] || (e[4] = (n) => v.value.seconds = n),
|
|
463
478
|
min: 0,
|
|
464
479
|
max: 59,
|
|
465
|
-
onChange:
|
|
480
|
+
onChange: L,
|
|
466
481
|
precision: "0",
|
|
467
482
|
"text-center": "",
|
|
468
483
|
label: "Seg",
|
|
@@ -471,30 +486,30 @@ const Be = {
|
|
|
471
486
|
density: "compact",
|
|
472
487
|
placeholder: "00"
|
|
473
488
|
}, null, 8, ["modelValue"])
|
|
474
|
-
])) :
|
|
475
|
-
])) :
|
|
476
|
-
|
|
477
|
-
|
|
489
|
+
])) : A("", !0)
|
|
490
|
+
])) : A("", !0),
|
|
491
|
+
m.autoApply ? A("", !0) : (d(), f("div", Xe, [
|
|
492
|
+
V(se, {
|
|
478
493
|
onClick: $,
|
|
479
494
|
size: "xs"
|
|
480
495
|
}, {
|
|
481
|
-
default:
|
|
482
|
-
|
|
496
|
+
default: E(() => [...e[10] || (e[10] = [
|
|
497
|
+
oe("Cancelar", -1)
|
|
483
498
|
])]),
|
|
484
499
|
_: 1
|
|
485
500
|
}),
|
|
486
|
-
|
|
487
|
-
onClick:
|
|
501
|
+
V(se, {
|
|
502
|
+
onClick: j,
|
|
488
503
|
size: "xs",
|
|
489
504
|
bgColor: "bg-success"
|
|
490
505
|
}, {
|
|
491
|
-
default:
|
|
492
|
-
|
|
506
|
+
default: E(() => [...e[11] || (e[11] = [
|
|
507
|
+
oe("Aplicar", -1)
|
|
493
508
|
])]),
|
|
494
509
|
_: 1
|
|
495
510
|
})
|
|
496
511
|
]))
|
|
497
|
-
], 6)) :
|
|
512
|
+
], 6)) : A("", !0)
|
|
498
513
|
]),
|
|
499
514
|
_: 1
|
|
500
515
|
})
|
|
@@ -503,5 +518,5 @@ const Be = {
|
|
|
503
518
|
}
|
|
504
519
|
});
|
|
505
520
|
export {
|
|
506
|
-
|
|
521
|
+
at as default
|
|
507
522
|
};
|