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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as xe, ref as b, computed as w, watch as De, onMounted as Se, onUnmounted as Me, createElementBlock as c, openBlock as i, createVNode as M, createBlock as Ce, mergeProps as Ve, withKeys as _, withCtx as L, createElementVNode as m, withModifiers as ee, Teleport as Te, Transition as Ae, createCommentVNode as T, normalizeStyle as te, normalizeClass as O, unref as $e, toDisplayString as N, Fragment as P, renderList as j, createTextVNode as le, nextTick as Ne } from "vue";
2
- import Ye from "../../../KunTextField/src/components/KunTextField.vue.js";
3
- import U from "../../../KunNumberField/src/components/KunNumberField.vue.js";
4
- import { usePosition as Fe } from "../composables/usePosition.js";
5
- import ae from "../../../KunBtn/src/components/KunBtn.vue.js";
6
- const Be = {
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
- }, ze = {
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
- }, He = {
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
- }, Le = {
25
+ }, Oe = {
26
26
  key: 1,
27
27
  class: "flex-1 overflow-y-auto custom-scrollbar p-3 min-h-0"
28
- }, Re = { key: 0 }, Ee = { class: "grid grid-cols-7 mb-2 text-center" }, Oe = { class: "grid grid-cols-7 gap-1" }, Pe = ["onClick"], je = {
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
- }, Ue = ["onClick"], Ie = {
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
- }, We = { class: "flex flex-col items-center" }, Ke = { class: "flex flex-col items-center" }, qe = {
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
- }, Ge = {
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
- }, lt = /* @__PURE__ */ xe({
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(f, { emit: ne }) {
80
- const a = f, Y = ne, I = Math.random().toString(36).substr(2, 9), re = b(null), y = b(null), F = b(null), C = b(!1), B = b("days"), u = b(null), x = b((/* @__PURE__ */ new Date()).getMonth()), v = b((/* @__PURE__ */ new Date()).getFullYear()), g = b({ hours: 0, minutes: 0, seconds: 0 });
81
- function W(t, e) {
82
- const l = {
83
- YYYY: t.getFullYear().toString(),
84
- MM: String(t.getMonth() + 1).padStart(2, "0"),
85
- DD: String(t.getDate()).padStart(2, "0"),
86
- HH: String(t.getHours()).padStart(2, "0"),
87
- mm: String(t.getMinutes()).padStart(2, "0"),
88
- ss: String(t.getSeconds()).padStart(2, "0")
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, (n) => l[n]);
94
+ return e.replace(/YYYY|yyyy|YY|yy|MM|DD|dd|HH|mm|ss/g, (x) => s[x]);
91
95
  }
92
- const p = w(() => a.mode ? a.mode : a.enableTime ? "datetime" : "date"), D = w(() => p.value === "datetime" || p.value === "time" || a.enableTime), oe = w(() => a.enableSeconds || z("value") && z("value").includes("ss"));
93
- De(() => a.modelValue, (t) => {
94
- K(t);
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 K(t) {
97
- if (t) {
98
- const e = (l) => {
99
- if (l instanceof Date) return l;
100
- if (typeof l == "string") {
101
- const n = new Date(l);
102
- if (!isNaN(n.getTime())) return n;
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 l = e(t);
119
- l && (u.value = l, x.value = l.getMonth(), v.value = l.getFullYear(), D.value && G(l));
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
- } else
122
- u.value = null, q();
143
+ else
144
+ c.value = null, J();
123
145
  }
124
- function q() {
146
+ function J() {
125
147
  let t = /* @__PURE__ */ new Date();
126
- if (a.startDate) {
127
- const e = a.startDate instanceof Date ? a.startDate : new Date(a.startDate);
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 (x.value = t.getMonth(), v.value = t.getFullYear(), a.startTime) {
131
- if (typeof a.startTime == "object")
132
- g.value = { hours: 0, minutes: 0, seconds: 0, ...a.startTime };
133
- else if (typeof a.startTime == "string") {
134
- const [e, l, n] = a.startTime.split(":").map(Number);
135
- g.value = { hours: e || 0, minutes: l || 0, seconds: n || 0 };
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
- g.value = { hours: e.getHours(), minutes: e.getMinutes(), seconds: 0 };
161
+ v.value = { hours: e.getHours(), minutes: e.getMinutes(), seconds: 0 };
140
162
  }
141
163
  }
142
- function G(t) {
143
- g.value = {
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: se, update: ie } = Fe(y, F, {
171
+ const { style: fe, update: me } = Le(h, B, {
150
172
  offset: 8,
151
- align: a.align
152
- }), ue = w(() => {
173
+ align: l.align
174
+ }), ge = k(() => {
153
175
  var e;
154
- let t = a.calendarWidth;
155
- return a.fullWidth && ((e = y.value) != null && e.rootRef) && (t = y.value.rootRef.getBoundingClientRect().width), p.value === "time" && (t = 200), {
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
- }), de = w(() => new Date(v.value, x.value).toLocaleString(a.locale, { month: "long" }).replace(/^\w/, (t) => t.toUpperCase())), ce = w(() => {
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 l = 0; l < 7; l++)
163
- t.push(e.toLocaleString(a.locale, { weekday: "narrow" }).replace(".", "")), e.setDate(e.getDate() + 1);
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 z(t) {
167
- return a.formats && a.formats[t] ? a.formats[t] : t === "value" ? a.valueFormat : t === "display" ? a.displayFormat : null;
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 fe = w(() => {
170
- if (!a.modelValue) return "";
171
- const t = { day: "2-digit", month: "2-digit", year: "numeric" }, e = { hour: "2-digit", minute: "2-digit", second: oe.value ? "2-digit" : void 0 }, l = (r) => {
172
- const o = z("display");
173
- if (o) return W(r, o);
174
- let d = "";
175
- return p.value !== "time" && (d += r.toLocaleDateString(a.locale, t)), p.value === "datetime" && (d += " " + r.toLocaleTimeString(a.locale, e)), p.value === "time" && (d = r.toLocaleTimeString(a.locale, e)), d;
176
- }, n = (r) => {
177
- let o = null;
178
- if (r instanceof Date) o = r;
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 (a.range && Array.isArray(a.modelValue)) {
188
- const r = a.modelValue[0] ? n(a.modelValue[0]) : "", o = a.modelValue[1] ? n(a.modelValue[1]) : "";
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 n(a.modelValue);
192
- }), me = w(() => {
193
- if (p.value === "time") return [];
194
- const t = v.value, e = x.value, l = new Date(t, e, 1).getDay(), n = l === 0 ? 6 : l - 1, r = new Date(t, e + 1, 0).getDate(), o = new Date(t, e, 0).getDate(), d = [];
195
- for (let s = 0; s < n; s++)
196
- d.push({
197
- day: o - n + s + 1,
198
- date: new Date(t, e - 1, o - n + s + 1),
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
- d.push({ day: s, date: new Date(t, e, s), isCurrentMonth: !0 });
203
- const h = 42 - d.length;
204
- for (let s = 1; s <= h; s++)
205
- d.push({ day: s, date: new Date(t, e + 1, s), isCurrentMonth: !1 });
206
- return d;
207
- }), ge = w(() => {
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 l = e - 100; l <= e + 20; l++)
210
- t.push(l);
224
+ for (let n = e - 100; n <= e + 20; n++)
225
+ t.push(n);
211
226
  return t.reverse();
212
227
  });
213
- function A() {
214
- a.disabled || (C.value ? $() : ve());
228
+ function F() {
229
+ l.disabled || (T.value ? $() : we());
215
230
  }
216
- function ve() {
217
- window.dispatchEvent(new CustomEvent("kun:datepicker:open", { detail: { id: I } })), C.value = !0, a.modelValue ? K(a.modelValue) : q(), Y("open"), Ne(() => {
218
- ie();
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
- C.value = !1, Y("close");
237
+ T.value = !1, z("close");
223
238
  }
224
- function J(t) {
225
- t.detail.id !== I && C.value && $();
239
+ function X(t) {
240
+ t.detail.id !== Z && T.value && $();
226
241
  }
227
- function Q(t) {
228
- if (!C.value) return;
242
+ function _(t) {
243
+ if (!T.value) return;
229
244
  const e = t.target;
230
- F.value && F.value.contains(e) || y.value && (y.value.rootRef && y.value.rootRef.contains(e) || y.value.$el && y.value.$el.contains(e)) || $();
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
- Se(() => {
233
- document.addEventListener("click", Q, !0), window.addEventListener("kun:datepicker:open", J);
234
- }), Me(() => {
235
- document.removeEventListener("click", Q, !0), window.removeEventListener("kun:datepicker:open", J);
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 X(t) {
238
- let e = x.value + t;
239
- e > 11 ? (e = 0, v.value++) : e < 0 && (e = 11, v.value--), x.value = e;
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 pe() {
242
- B.value = B.value === "days" ? "years" : "days";
256
+ function ke() {
257
+ H.value = H.value === "days" ? "years" : "days";
243
258
  }
244
- function ye(t) {
245
- v.value = t, B.value = "days";
259
+ function xe(t) {
260
+ y.value = t, H.value = "days";
246
261
  }
247
- function R(t) {
262
+ function O(t) {
248
263
  const e = new Date(t);
249
- return D.value ? e.setHours(g.value.hours || 0, g.value.minutes || 0, g.value.seconds || 0, 0) : e.setHours(0, 0, 0, 0), e;
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 he(t) {
252
- const e = R(t.date);
253
- if (a.range) {
254
- let l = Array.isArray(u.value) ? [...u.value] : [];
255
- if (l.length === 2 && (l = []), l.length === 0) l = [e];
256
- else if (l.length === 1) {
257
- let n = l[0], r = e;
258
- r < n && ([n, r] = [r, n]), l = [n, 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
- u.value = l, a.autoApply && l.length === 2 && !D.value && E();
275
+ c.value = n, l.autoApply && n.length === 2 && !S.value && j();
261
276
  } else
262
- u.value = e, a.autoApply && !D.value && E();
277
+ c.value = e, l.autoApply && !S.value && j();
263
278
  }
264
- function H() {
265
- let t = u.value instanceof Date ? u.value : /* @__PURE__ */ new Date();
266
- const e = R(t);
267
- a.range || (u.value = e);
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 be() {
270
- const t = u.value;
284
+ function Se() {
285
+ const t = c.value;
271
286
  if (!t) return null;
272
- const e = z("value"), l = (n) => e ? W(n, e) : n;
273
- return Array.isArray(t) ? t.map((n) => l(n)) : l(t);
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 E() {
276
- D.value && u.value && !Array.isArray(u.value) ? u.value = R(u.value) : p.value === "time" && !u.value && H();
277
- const t = be();
278
- Y("update:modelValue", t), Y("change", t), $();
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 we(t) {
281
- const { date: e, isCurrentMonth: l } = t, r = Z(e, /* @__PURE__ */ new Date());
282
- let o = !1, d = !1;
283
- const h = (k, S) => k instanceof Date && Z(k, S), s = u.value;
284
- if (a.range && Array.isArray(s)) {
285
- const [k, S] = s;
286
- k && h(k, e) && (o = !0), S && h(S, e) && (o = !0), k && S && k instanceof Date && S instanceof Date && e > k && e < S && (d = !0);
287
- } else !a.range && s instanceof Date && h(s, e) && (o = !0);
288
- const V = "flex items-center justify-center font-medium text-sm z-10", ke = l ? "text-slate-700 dark:text-slate-200" : "text-slate-300 dark:text-slate-600";
289
- return o ? `${V} bg-blue-600 text-white shadow-md hover:bg-blue-700 rounded-full` : d ? `${V} bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-none` : `${V} ${ke} hover:bg-slate-100 dark:hover:bg-slate-700 ${r ? "border border-blue-500 text-blue-600 dark:text-blue-400 font-bold" : ""}`;
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 Z(t, e) {
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) => (i(), c("div", {
309
+ return (t, e) => (d(), f("div", {
295
310
  class: "relative w-full",
296
311
  ref_key: "containerRef",
297
- ref: re
312
+ ref: ue
298
313
  }, [
299
- M(Ye, Ve({
314
+ V(He, Fe({
300
315
  ref_key: "triggerRef",
301
- ref: y,
302
- "model-value": fe.value,
303
- label: f.label,
304
- placeholder: f.placeholder,
305
- disabled: f.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: A,
309
- onClick: A,
323
+ onHandleClick: F,
324
+ onClick: F,
310
325
  onKeyDown: [
311
- _(A, ["enter"]),
312
- _(A, ["space"])
326
+ le(F, ["enter"]),
327
+ le(F, ["space"])
313
328
  ],
314
- class: ["cursor-pointer", f.inputClass],
315
- "error-message": f.errorMessage,
316
- "has-error": !!f.errorMessage,
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": L(() => [
320
- m("div", {
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: ee(A, ["stop"])
337
+ onClick: ae(F, ["stop"])
323
338
  }, [
324
- f.mode === "time" ? (i(), c("svg", Be, [...e[6] || (e[6] = [
325
- m("path", {
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
- ])])) : (i(), c("svg", ze, [...e[7] || (e[7] = [
331
- m("path", {
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
- (i(), Ce(Te, { to: "body" }, [
342
- M(Ae, {
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: L(() => [
351
- C.value ? (i(), c("div", {
365
+ default: E(() => [
366
+ T.value ? (d(), f("div", {
352
367
  key: 0,
353
368
  ref_key: "popoverRef",
354
- ref: F,
355
- class: O(["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", [f.dialogClass]]),
356
- style: te([$e(se), ue.value]),
357
- onClick: e[5] || (e[5] = ee(() => {
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
- f.mode !== "time" ? (i(), c("div", He, [
361
- m("button", {
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] = (l) => X(-1))
379
+ onClick: e[0] || (e[0] = (n) => ee(-1))
365
380
  }, [...e[8] || (e[8] = [
366
- m("svg", {
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
- m("path", {
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
- m("div", {
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: pe
382
- }, N(de.value) + " " + N(v.value), 1),
383
- m("button", {
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] = (l) => X(1))
401
+ onClick: e[1] || (e[1] = (n) => ee(1))
387
402
  }, [...e[9] || (e[9] = [
388
- m("svg", {
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
- m("path", {
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
- ])) : T("", !0),
402
- f.mode !== "time" ? (i(), c("div", Le, [
403
- B.value === "days" ? (i(), c("div", Re, [
404
- m("div", Ee, [
405
- (i(!0), c(P, null, j(ce.value, (l) => (i(), c("span", {
406
- key: l,
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(l), 1))), 128))
423
+ }, N(n), 1))), 128))
409
424
  ]),
410
- m("div", Oe, [
411
- (i(!0), c(P, null, j(me.value, (l, n) => (i(), c("div", {
412
- key: n,
413
- class: O(["relative flex items-center justify-center rounded-full transition-all duration-150 cursor-pointer group", we(l)]),
414
- style: te({ width: f.daySize, height: f.daySize, fontSize: f.fontSize }),
415
- onClick: (r) => he(l)
416
- }, N(l.day), 15, Pe))), 128))
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
- ])) : (i(), c("div", je, [
419
- (i(!0), c(P, null, j(ge.value, (l) => (i(), c("div", {
420
- key: l,
421
- class: O(["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": l === v.value }]),
422
- onClick: (n) => ye(l)
423
- }, N(l), 11, Ue))), 128))
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
- ])) : T("", !0),
426
- D.value ? (i(), c("div", Ie, [
427
- m("div", We, [
428
- M(U, {
429
- modelValue: g.value.hours,
430
- "onUpdate:modelValue": e[2] || (e[2] = (l) => g.value.hours = l),
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: H,
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
- m("div", Ke, [
444
- M(U, {
445
- modelValue: g.value.minutes,
446
- "onUpdate:modelValue": e[3] || (e[3] = (l) => g.value.minutes = l),
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: H,
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
- f.enableSeconds ? (i(), c("div", qe, [
460
- M(U, {
461
- modelValue: g.value.seconds,
462
- "onUpdate:modelValue": e[4] || (e[4] = (l) => g.value.seconds = l),
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: H,
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
- ])) : T("", !0)
475
- ])) : T("", !0),
476
- f.autoApply ? T("", !0) : (i(), c("div", Ge, [
477
- M(ae, {
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: L(() => [...e[10] || (e[10] = [
482
- le("Cancelar", -1)
496
+ default: E(() => [...e[10] || (e[10] = [
497
+ oe("Cancelar", -1)
483
498
  ])]),
484
499
  _: 1
485
500
  }),
486
- M(ae, {
487
- onClick: E,
501
+ V(se, {
502
+ onClick: j,
488
503
  size: "xs",
489
504
  bgColor: "bg-success"
490
505
  }, {
491
- default: L(() => [...e[11] || (e[11] = [
492
- le("Aplicar", -1)
506
+ default: E(() => [...e[11] || (e[11] = [
507
+ oe("Aplicar", -1)
493
508
  ])]),
494
509
  _: 1
495
510
  })
496
511
  ]))
497
- ], 6)) : T("", !0)
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
- lt as default
521
+ at as default
507
522
  };