adverich-kun-ui 0.1.545 → 0.1.547
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/KunAlert/src/components/KunAlert.vue.js +1 -1
- package/dist/components/KunAutocomplete/src/components/KunAutocomplete.vue.js +13 -14
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue.js +7 -0
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue2.js +507 -0
- package/dist/components/KunDatePicker/src/composables/usePosition.js +53 -0
- package/dist/components/KunListItem/src/components/KunListItem.vue.js +2 -2
- package/dist/components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js +1 -1
- package/dist/components/KunModalFooter/src/components/KunModalFooter.vue.js +2 -2
- package/dist/components/KunTable/src/components/KunTableFilter.vue.js +13 -15
- package/dist/icons/IconAccountOutline.vue.js +2 -2
- package/dist/icons/IconArrowDown.vue.js +2 -2
- package/dist/icons/IconArrowDownUp.vue.js +2 -2
- package/dist/icons/IconArrowUp.vue.js +2 -2
- package/dist/icons/IconAsterisk.vue.js +2 -2
- package/dist/icons/IconCheck.vue.js +2 -2
- package/dist/icons/IconCheckBlankOutline.vue.js +2 -2
- package/dist/icons/IconCheckIndetOutline.vue.js +2 -2
- package/dist/icons/IconCheckOnOutline.vue.js +2 -2
- package/dist/icons/IconClose.vue.js +2 -2
- package/dist/icons/IconDelete.vue.js +2 -2
- package/dist/icons/IconEdit.vue.js +2 -2
- package/dist/icons/IconEyeOffOutline.vue.js +2 -2
- package/dist/icons/IconEyeOutline.vue.js +2 -2
- package/dist/icons/IconFilter.vue.js +2 -2
- package/dist/icons/IconMenuDownOutline.vue.js +2 -2
- package/dist/icons/IconMenuRounded.vue.js +2 -2
- package/dist/icons/IconMenuUpOutline.vue.js +2 -2
- package/dist/icons/IconMinus.vue.js +2 -2
- package/dist/icons/IconPencil.vue.js +2 -2
- package/dist/icons/IconRadioboxBlank.vue.js +2 -2
- package/dist/icons/IconRadioboxMarked.vue.js +2 -2
- package/dist/icons/IconSearch.vue.js +2 -2
- package/dist/icons/IconStar.vue.js +2 -2
- package/dist/icons/IconTrashOutline.vue.js +2 -2
- package/dist/index.js +163 -160
- package/package.json +58 -58
|
@@ -0,0 +1,507 @@
|
|
|
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 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
class: "h-5 w-5",
|
|
10
|
+
fill: "none",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
"stroke-width": "2"
|
|
14
|
+
}, ze = {
|
|
15
|
+
key: 1,
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
class: "h-5 w-5",
|
|
18
|
+
fill: "none",
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
"stroke-width": "2"
|
|
22
|
+
}, He = {
|
|
23
|
+
key: 0,
|
|
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 = {
|
|
26
|
+
key: 1,
|
|
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 = {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: "grid grid-cols-3 gap-2"
|
|
31
|
+
}, Ue = ["onClick"], Ie = {
|
|
32
|
+
key: 2,
|
|
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 = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "flex flex-col items-center"
|
|
37
|
+
}, Ge = {
|
|
38
|
+
key: 3,
|
|
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({
|
|
41
|
+
__name: "KunDatePicker",
|
|
42
|
+
props: {
|
|
43
|
+
modelValue: { type: [Date, Array, String], default: null },
|
|
44
|
+
range: { type: Boolean, default: !1 },
|
|
45
|
+
label: { type: String, default: "" },
|
|
46
|
+
placeholder: { type: String, default: "" },
|
|
47
|
+
disabled: { type: Boolean, default: !1 },
|
|
48
|
+
errorMessage: { type: String, default: "" },
|
|
49
|
+
// Logic
|
|
50
|
+
autoApply: { type: Boolean, default: !0 },
|
|
51
|
+
mode: { type: String, default: "date" },
|
|
52
|
+
// Time Options
|
|
53
|
+
enableTime: { type: Boolean, default: !1 },
|
|
54
|
+
enableSeconds: { type: Boolean, default: !1 },
|
|
55
|
+
// Defaults
|
|
56
|
+
startDate: { type: [Date, String], default: null },
|
|
57
|
+
startTime: { type: [String, Object], default: null },
|
|
58
|
+
// 'HH:mm:ss' or object
|
|
59
|
+
minDate: { type: Date, default: null },
|
|
60
|
+
maxDate: { type: Date, default: null },
|
|
61
|
+
locale: { type: String, default: "es-ES" },
|
|
62
|
+
// Formatting
|
|
63
|
+
valueFormat: { type: String, default: null },
|
|
64
|
+
displayFormat: { type: String, default: null },
|
|
65
|
+
formats: { type: Object, default: () => null },
|
|
66
|
+
// { value: string, display: string }
|
|
67
|
+
// Styling
|
|
68
|
+
width: { type: [String, Number], default: null },
|
|
69
|
+
calendarWidth: { type: [String, Number], default: 320 },
|
|
70
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
71
|
+
align: { type: String, default: "left" },
|
|
72
|
+
daySize: { type: String, default: "2rem" },
|
|
73
|
+
fontSize: { type: String, default: "0.875rem" },
|
|
74
|
+
maxHeight: { type: String, default: "400px" },
|
|
75
|
+
inputClass: { default: "" },
|
|
76
|
+
dialogClass: { default: "" }
|
|
77
|
+
},
|
|
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")
|
|
89
|
+
};
|
|
90
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss/g, (n) => l[n]);
|
|
91
|
+
}
|
|
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);
|
|
95
|
+
}, { 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));
|
|
117
|
+
} else {
|
|
118
|
+
const l = e(t);
|
|
119
|
+
l && (u.value = l, x.value = l.getMonth(), v.value = l.getFullYear(), D.value && G(l));
|
|
120
|
+
}
|
|
121
|
+
} else
|
|
122
|
+
u.value = null, q();
|
|
123
|
+
}
|
|
124
|
+
function q() {
|
|
125
|
+
let t = /* @__PURE__ */ new Date();
|
|
126
|
+
if (a.startDate) {
|
|
127
|
+
const e = a.startDate instanceof Date ? a.startDate : new Date(a.startDate);
|
|
128
|
+
isNaN(e.getTime()) || (t = e);
|
|
129
|
+
}
|
|
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 };
|
|
136
|
+
}
|
|
137
|
+
} else {
|
|
138
|
+
const e = /* @__PURE__ */ new Date();
|
|
139
|
+
g.value = { hours: e.getHours(), minutes: e.getMinutes(), seconds: 0 };
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function G(t) {
|
|
143
|
+
g.value = {
|
|
144
|
+
hours: t.getHours(),
|
|
145
|
+
minutes: t.getMinutes(),
|
|
146
|
+
seconds: t.getSeconds()
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
const { style: se, update: ie } = Fe(y, F, {
|
|
150
|
+
offset: 8,
|
|
151
|
+
align: a.align
|
|
152
|
+
}), ue = w(() => {
|
|
153
|
+
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), {
|
|
156
|
+
width: typeof t == "number" ? `${t}px` : t
|
|
157
|
+
};
|
|
158
|
+
}), de = w(() => new Date(v.value, x.value).toLocaleString(a.locale, { month: "long" }).replace(/^\w/, (t) => t.toUpperCase())), ce = w(() => {
|
|
159
|
+
const t = [], e = new Date(2023, 0, 1);
|
|
160
|
+
for (; e.getDay() !== 1; )
|
|
161
|
+
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);
|
|
164
|
+
return t;
|
|
165
|
+
});
|
|
166
|
+
function z(t) {
|
|
167
|
+
return a.formats && a.formats[t] ? a.formats[t] : t === "value" ? a.valueFormat : t === "display" ? a.displayFormat : null;
|
|
168
|
+
}
|
|
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);
|
|
186
|
+
};
|
|
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]) : "";
|
|
189
|
+
return r ? o ? `${r} ~ ${o}` : `${r} ~ ...` : "";
|
|
190
|
+
}
|
|
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),
|
|
199
|
+
isCurrentMonth: !1
|
|
200
|
+
});
|
|
201
|
+
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(() => {
|
|
208
|
+
const t = [], e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
209
|
+
for (let l = e - 100; l <= e + 20; l++)
|
|
210
|
+
t.push(l);
|
|
211
|
+
return t.reverse();
|
|
212
|
+
});
|
|
213
|
+
function A() {
|
|
214
|
+
a.disabled || (C.value ? $() : ve());
|
|
215
|
+
}
|
|
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();
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function $() {
|
|
222
|
+
C.value = !1, Y("close");
|
|
223
|
+
}
|
|
224
|
+
function J(t) {
|
|
225
|
+
t.detail.id !== I && C.value && $();
|
|
226
|
+
}
|
|
227
|
+
function Q(t) {
|
|
228
|
+
if (!C.value) return;
|
|
229
|
+
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)) || $();
|
|
231
|
+
}
|
|
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);
|
|
236
|
+
});
|
|
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;
|
|
240
|
+
}
|
|
241
|
+
function pe() {
|
|
242
|
+
B.value = B.value === "days" ? "years" : "days";
|
|
243
|
+
}
|
|
244
|
+
function ye(t) {
|
|
245
|
+
v.value = t, B.value = "days";
|
|
246
|
+
}
|
|
247
|
+
function R(t) {
|
|
248
|
+
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;
|
|
250
|
+
}
|
|
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];
|
|
259
|
+
}
|
|
260
|
+
u.value = l, a.autoApply && l.length === 2 && !D.value && E();
|
|
261
|
+
} else
|
|
262
|
+
u.value = e, a.autoApply && !D.value && E();
|
|
263
|
+
}
|
|
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);
|
|
268
|
+
}
|
|
269
|
+
function be() {
|
|
270
|
+
const t = u.value;
|
|
271
|
+
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);
|
|
274
|
+
}
|
|
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), $();
|
|
279
|
+
}
|
|
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" : ""}`;
|
|
290
|
+
}
|
|
291
|
+
function Z(t, e) {
|
|
292
|
+
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
293
|
+
}
|
|
294
|
+
return (t, e) => (i(), c("div", {
|
|
295
|
+
class: "relative w-full",
|
|
296
|
+
ref_key: "containerRef",
|
|
297
|
+
ref: re
|
|
298
|
+
}, [
|
|
299
|
+
M(Ye, Ve({
|
|
300
|
+
ref_key: "triggerRef",
|
|
301
|
+
ref: y,
|
|
302
|
+
"model-value": fe.value,
|
|
303
|
+
label: f.label,
|
|
304
|
+
placeholder: f.placeholder,
|
|
305
|
+
disabled: f.disabled,
|
|
306
|
+
readonly: ""
|
|
307
|
+
}, t.$attrs, {
|
|
308
|
+
onHandleClick: A,
|
|
309
|
+
onClick: A,
|
|
310
|
+
onKeydown: [
|
|
311
|
+
_(A, ["enter"]),
|
|
312
|
+
_(A, ["space"])
|
|
313
|
+
],
|
|
314
|
+
class: ["cursor-pointer", f.inputClass],
|
|
315
|
+
"error-message": f.errorMessage,
|
|
316
|
+
"has-error": !!f.errorMessage,
|
|
317
|
+
"hide-details": ""
|
|
318
|
+
}), {
|
|
319
|
+
"append-inner": L(() => [
|
|
320
|
+
m("div", {
|
|
321
|
+
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"])
|
|
323
|
+
}, [
|
|
324
|
+
f.mode === "time" ? (i(), c("svg", Be, [...e[6] || (e[6] = [
|
|
325
|
+
m("path", {
|
|
326
|
+
"stroke-linecap": "round",
|
|
327
|
+
"stroke-linejoin": "round",
|
|
328
|
+
d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
329
|
+
}, null, -1)
|
|
330
|
+
])])) : (i(), c("svg", ze, [...e[7] || (e[7] = [
|
|
331
|
+
m("path", {
|
|
332
|
+
"stroke-linecap": "round",
|
|
333
|
+
"stroke-linejoin": "round",
|
|
334
|
+
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"
|
|
335
|
+
}, null, -1)
|
|
336
|
+
])]))
|
|
337
|
+
])
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
}, 16, ["model-value", "label", "placeholder", "disabled", "class", "error-message", "has-error"]),
|
|
341
|
+
(i(), Ce(Te, { to: "body" }, [
|
|
342
|
+
M(Ae, {
|
|
343
|
+
"enter-active-class": "transition ease-out duration-150",
|
|
344
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
345
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
346
|
+
"leave-active-class": "transition ease-in duration-100",
|
|
347
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
348
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
349
|
+
}, {
|
|
350
|
+
default: L(() => [
|
|
351
|
+
C.value ? (i(), c("div", {
|
|
352
|
+
key: 0,
|
|
353
|
+
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(() => {
|
|
358
|
+
}, ["stop"]))
|
|
359
|
+
}, [
|
|
360
|
+
f.mode !== "time" ? (i(), c("div", He, [
|
|
361
|
+
m("button", {
|
|
362
|
+
type: "button",
|
|
363
|
+
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))
|
|
365
|
+
}, [...e[8] || (e[8] = [
|
|
366
|
+
m("svg", {
|
|
367
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
368
|
+
class: "h-5 w-5",
|
|
369
|
+
viewBox: "0 0 20 20",
|
|
370
|
+
fill: "currentColor"
|
|
371
|
+
}, [
|
|
372
|
+
m("path", {
|
|
373
|
+
"fill-rule": "evenodd",
|
|
374
|
+
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
|
+
"clip-rule": "evenodd"
|
|
376
|
+
})
|
|
377
|
+
], -1)
|
|
378
|
+
])]),
|
|
379
|
+
m("div", {
|
|
380
|
+
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", {
|
|
384
|
+
type: "button",
|
|
385
|
+
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))
|
|
387
|
+
}, [...e[9] || (e[9] = [
|
|
388
|
+
m("svg", {
|
|
389
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
390
|
+
class: "h-5 w-5",
|
|
391
|
+
viewBox: "0 0 20 20",
|
|
392
|
+
fill: "currentColor"
|
|
393
|
+
}, [
|
|
394
|
+
m("path", {
|
|
395
|
+
"fill-rule": "evenodd",
|
|
396
|
+
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
|
+
"clip-rule": "evenodd"
|
|
398
|
+
})
|
|
399
|
+
], -1)
|
|
400
|
+
])])
|
|
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,
|
|
407
|
+
class: "text-[0.7rem] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest"
|
|
408
|
+
}, N(l), 1))), 128))
|
|
409
|
+
]),
|
|
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))
|
|
417
|
+
])
|
|
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))
|
|
424
|
+
]))
|
|
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),
|
|
431
|
+
min: 0,
|
|
432
|
+
max: 23,
|
|
433
|
+
onChange: H,
|
|
434
|
+
precision: "0",
|
|
435
|
+
"text-center": "",
|
|
436
|
+
label: "Hora",
|
|
437
|
+
noArrows: "",
|
|
438
|
+
"hide-details": "",
|
|
439
|
+
density: "compact",
|
|
440
|
+
placeholder: "00"
|
|
441
|
+
}, null, 8, ["modelValue"])
|
|
442
|
+
]),
|
|
443
|
+
m("div", Ke, [
|
|
444
|
+
M(U, {
|
|
445
|
+
modelValue: g.value.minutes,
|
|
446
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => g.value.minutes = l),
|
|
447
|
+
min: 0,
|
|
448
|
+
max: 59,
|
|
449
|
+
onChange: H,
|
|
450
|
+
precision: "0",
|
|
451
|
+
"text-center": "",
|
|
452
|
+
label: "Min",
|
|
453
|
+
noArrows: "",
|
|
454
|
+
"hide-details": "",
|
|
455
|
+
density: "compact",
|
|
456
|
+
placeholder: "00"
|
|
457
|
+
}, null, 8, ["modelValue"])
|
|
458
|
+
]),
|
|
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),
|
|
463
|
+
min: 0,
|
|
464
|
+
max: 59,
|
|
465
|
+
onChange: H,
|
|
466
|
+
precision: "0",
|
|
467
|
+
"text-center": "",
|
|
468
|
+
label: "Seg",
|
|
469
|
+
noArrows: "",
|
|
470
|
+
"hide-details": "",
|
|
471
|
+
density: "compact",
|
|
472
|
+
placeholder: "00"
|
|
473
|
+
}, null, 8, ["modelValue"])
|
|
474
|
+
])) : T("", !0)
|
|
475
|
+
])) : T("", !0),
|
|
476
|
+
f.autoApply ? T("", !0) : (i(), c("div", Ge, [
|
|
477
|
+
M(ae, {
|
|
478
|
+
onClick: $,
|
|
479
|
+
size: "xs"
|
|
480
|
+
}, {
|
|
481
|
+
default: L(() => [...e[10] || (e[10] = [
|
|
482
|
+
le("Cancelar", -1)
|
|
483
|
+
])]),
|
|
484
|
+
_: 1
|
|
485
|
+
}),
|
|
486
|
+
M(ae, {
|
|
487
|
+
onClick: E,
|
|
488
|
+
size: "xs",
|
|
489
|
+
bgColor: "bg-success"
|
|
490
|
+
}, {
|
|
491
|
+
default: L(() => [...e[11] || (e[11] = [
|
|
492
|
+
le("Aplicar", -1)
|
|
493
|
+
])]),
|
|
494
|
+
_: 1
|
|
495
|
+
})
|
|
496
|
+
]))
|
|
497
|
+
], 6)) : T("", !0)
|
|
498
|
+
]),
|
|
499
|
+
_: 1
|
|
500
|
+
})
|
|
501
|
+
]))
|
|
502
|
+
], 512));
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
export {
|
|
506
|
+
lt as default
|
|
507
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ref as w, onMounted as L, onUnmounted as C } from "vue";
|
|
2
|
+
function R(s, g, c = {}) {
|
|
3
|
+
const { offset: r = 8, placement: W = "bottom-start" } = c, u = w({
|
|
4
|
+
position: "fixed",
|
|
5
|
+
top: "0px",
|
|
6
|
+
left: "0px",
|
|
7
|
+
opacity: "0",
|
|
8
|
+
pointerEvents: "none",
|
|
9
|
+
transform: "scale(0.95)",
|
|
10
|
+
maxHeight: "auto"
|
|
11
|
+
// Default
|
|
12
|
+
}), o = w("bottom"), a = w(!1), p = async () => {
|
|
13
|
+
if (!s.value || !g.value) return;
|
|
14
|
+
const d = s.value.rootRef || s.value.$el || s.value, B = g.value;
|
|
15
|
+
if (!d || !d.getBoundingClientRect) return;
|
|
16
|
+
const t = d.getBoundingClientRect(), i = B.getBoundingClientRect(), E = window.innerHeight, m = window.innerWidth, n = 12, v = E - t.bottom - r - n, f = t.top - r - n, H = v >= i.height, z = f >= i.height;
|
|
17
|
+
let $ = 0, e = 0, l = "top center", h = 0;
|
|
18
|
+
H || !z && v >= f ? ($ = t.bottom + r, o.value = "bottom", l = "top center", h = v) : (h = f, o.value = "top", l = "bottom center"), c.align === "right" ? (e = t.right - i.width, l = o.value === "bottom" ? "top right" : "bottom right") : c.align === "center" ? (e = t.left + t.width / 2 - i.width / 2, l = o.value === "bottom" ? "top center" : "bottom center") : (e = t.left, l = o.value === "bottom" ? "top left" : "bottom left"), e + i.width > m - n && (e = m - i.width - n), e < n && (e = n);
|
|
19
|
+
const y = {
|
|
20
|
+
position: "fixed",
|
|
21
|
+
left: `${e}px`,
|
|
22
|
+
opacity: "1",
|
|
23
|
+
pointerEvents: "auto",
|
|
24
|
+
transform: "scale(1)",
|
|
25
|
+
transformOrigin: l,
|
|
26
|
+
zIndex: "99999",
|
|
27
|
+
maxWidth: `${m - n * 2}px`,
|
|
28
|
+
// Essential for scrolling: Restrict max-height to available space
|
|
29
|
+
maxHeight: `${h}px`
|
|
30
|
+
};
|
|
31
|
+
o.value === "top" ? u.value = {
|
|
32
|
+
...y,
|
|
33
|
+
top: "auto",
|
|
34
|
+
bottom: `${E - t.top + r}px`
|
|
35
|
+
} : u.value = {
|
|
36
|
+
...y,
|
|
37
|
+
top: `${$}px`,
|
|
38
|
+
bottom: "auto"
|
|
39
|
+
}, a.value = !0;
|
|
40
|
+
}, b = () => {
|
|
41
|
+
a.value && p();
|
|
42
|
+
}, x = () => {
|
|
43
|
+
a.value && p();
|
|
44
|
+
};
|
|
45
|
+
return L(() => {
|
|
46
|
+
window.addEventListener("resize", x), window.addEventListener("scroll", b, !0);
|
|
47
|
+
}), C(() => {
|
|
48
|
+
window.removeEventListener("resize", x), window.removeEventListener("scroll", b, !0);
|
|
49
|
+
}), { style: u, update: p, position: o, isVisible: a };
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
R as usePosition
|
|
53
|
+
};
|
|
@@ -193,8 +193,8 @@ const Z = { class: "flex w-full items-center" }, _ = {
|
|
|
193
193
|
])) : s("", !0)
|
|
194
194
|
])
|
|
195
195
|
]),
|
|
196
|
-
_:
|
|
197
|
-
},
|
|
196
|
+
_: 3
|
|
197
|
+
}, 16, ["id", "href", "aria-selected", "aria-disabled", "class", "onClick", "onKeydown"]))
|
|
198
198
|
]),
|
|
199
199
|
_: 3
|
|
200
200
|
}, 8, ["to", "replace"])) : (l(), o(v($.value ? "a" : e.tag), C({
|
|
@@ -44,7 +44,7 @@ const x = { class: "fixed inset-0 flex justify-center items-center bg-black/75 z
|
|
|
44
44
|
}, [
|
|
45
45
|
i("div", x, [
|
|
46
46
|
i("div", k, [
|
|
47
|
-
t[0] || (t[0] = b(" Cargando datos ")),
|
|
47
|
+
t[0] || (t[0] = b(" Cargando datos ", -1)),
|
|
48
48
|
i("div", d({
|
|
49
49
|
class: "relative inline-block animate-spin mt-4",
|
|
50
50
|
style: o.value,
|
|
@@ -64,7 +64,7 @@ const h = { class: "flex items-center justify-between" }, y = { class: "text-sm
|
|
|
64
64
|
type: "button",
|
|
65
65
|
class: "ml-2 inline-flex rounded-md p-1 hover:bg-opacity-75 focus:outline-none",
|
|
66
66
|
onClick: d
|
|
67
|
-
}, s[0] || (s[0] = [
|
|
67
|
+
}, [...s[0] || (s[0] = [
|
|
68
68
|
t("svg", {
|
|
69
69
|
xmlns: "http://www.w3.org/2000/svg",
|
|
70
70
|
class: "h-5 w-5",
|
|
@@ -77,7 +77,7 @@ const h = { class: "flex items-center justify-between" }, y = { class: "text-sm
|
|
|
77
77
|
"clip-rule": "evenodd"
|
|
78
78
|
})
|
|
79
79
|
], -1)
|
|
80
|
-
]))
|
|
80
|
+
])])
|
|
81
81
|
])
|
|
82
82
|
], 16)) : c("", !0);
|
|
83
83
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed as g, ref as k, onMounted as b, watch as C, createBlock as
|
|
1
|
+
import { computed as g, ref as k, onMounted as b, watch as C, createBlock as _, createCommentVNode as $, openBlock as d, withCtx as o, createElementVNode as c, createVNode as a, createElementBlock as h, Fragment as N, renderList as w, createTextVNode as V } from "vue";
|
|
2
2
|
import z from "../../../KunDialog/src/components/KunDialog.vue.js";
|
|
3
3
|
import A from "../../../KunRow/src/components/KunRow.vue.js";
|
|
4
4
|
import B from "../../../KunCol/src/components/KunCol.vue.js";
|
|
@@ -21,8 +21,8 @@ const D = { class: "w-full" }, E = { class: "flex justify-end px-1" }, I = { cla
|
|
|
21
21
|
}), i = k({});
|
|
22
22
|
b(() => {
|
|
23
23
|
i.value = { ...n.filters.reduce((l, t) => {
|
|
24
|
-
var
|
|
25
|
-
const e = t.value, s = (
|
|
24
|
+
var x;
|
|
25
|
+
const e = t.value, s = (x = n.activeFilters) == null ? void 0 : x[e];
|
|
26
26
|
return s !== void 0 && (l[e] = s), l;
|
|
27
27
|
}, {}) };
|
|
28
28
|
});
|
|
@@ -38,7 +38,7 @@ const D = { class: "w-full" }, E = { class: "flex justify-end px-1" }, I = { cla
|
|
|
38
38
|
return C(i, (l) => {
|
|
39
39
|
for (const t in l)
|
|
40
40
|
Array.isArray(l[t]) && l[t].length === 0 && delete l[t];
|
|
41
|
-
}, { deep: !0 }), (l, t) => m.value ? (d(),
|
|
41
|
+
}, { deep: !0 }), (l, t) => m.value ? (d(), _(z, {
|
|
42
42
|
key: 0,
|
|
43
43
|
modelValue: m.value,
|
|
44
44
|
"onUpdate:modelValue": t[0] || (t[0] = (e) => m.value = e),
|
|
@@ -66,7 +66,7 @@ const D = { class: "w-full" }, E = { class: "flex justify-end px-1" }, I = { cla
|
|
|
66
66
|
]),
|
|
67
67
|
a(A, null, {
|
|
68
68
|
default: o(() => [
|
|
69
|
-
(d(!0), h(N, null, w(f.filters, (e) => (d(),
|
|
69
|
+
(d(!0), h(N, null, w(f.filters, (e) => (d(), _(B, {
|
|
70
70
|
cols: "4",
|
|
71
71
|
class: "px-2"
|
|
72
72
|
}, {
|
|
@@ -92,18 +92,16 @@ const D = { class: "w-full" }, E = { class: "flex justify-end px-1" }, I = { cla
|
|
|
92
92
|
}),
|
|
93
93
|
c("div", I, [
|
|
94
94
|
a(p, { onClick: F }, {
|
|
95
|
-
default: o(() => t[1] || (t[1] = [
|
|
96
|
-
V(" Limpiar filtros ")
|
|
97
|
-
])),
|
|
98
|
-
_: 1
|
|
99
|
-
__: [1]
|
|
95
|
+
default: o(() => [...t[1] || (t[1] = [
|
|
96
|
+
V(" Limpiar filtros ", -1)
|
|
97
|
+
])]),
|
|
98
|
+
_: 1
|
|
100
99
|
}),
|
|
101
100
|
a(p, { onClick: y }, {
|
|
102
|
-
default: o(() => t[2] || (t[2] = [
|
|
103
|
-
V(" Aplicar ")
|
|
104
|
-
])),
|
|
105
|
-
_: 1
|
|
106
|
-
__: [2]
|
|
101
|
+
default: o(() => [...t[2] || (t[2] = [
|
|
102
|
+
V(" Aplicar ", -1)
|
|
103
|
+
])]),
|
|
104
|
+
_: 1
|
|
107
105
|
})
|
|
108
106
|
])
|
|
109
107
|
])
|
|
@@ -7,12 +7,12 @@ const r = {}, a = {
|
|
|
7
7
|
viewBox: "0 0 24 24"
|
|
8
8
|
};
|
|
9
9
|
function l(m, t) {
|
|
10
|
-
return o(), e("svg", a, t[0] || (t[0] = [
|
|
10
|
+
return o(), e("svg", a, [...t[0] || (t[0] = [
|
|
11
11
|
c("path", {
|
|
12
12
|
fill: "currentColor",
|
|
13
13
|
d: "M12 4a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m0 7c2.67 0 8 1.33 8 4v3H4v-3c0-2.67 5.33-4 8-4m0 1.9c-2.97 0-6.1 1.46-6.1 2.1v1.1h12.2V17c0-.64-3.13-2.1-6.1-2.1"
|
|
14
14
|
}, null, -1)
|
|
15
|
-
]));
|
|
15
|
+
])]);
|
|
16
16
|
}
|
|
17
17
|
const f = /* @__PURE__ */ n(r, [["render", l]]);
|
|
18
18
|
export {
|