adverich-kun-ui 0.1.544 → 0.1.546
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 +14 -15
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue.js +7 -0
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue2.js +483 -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/components/kunMenu/src/components/{kunMenu.vue.js → KunMenu.vue.js} +6 -6
- 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 +164 -161
- package/package.json +58 -58
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import { defineComponent as ke, ref as h, computed as b, watch as xe, onMounted as De, onUnmounted as Se, createElementBlock as u, openBlock as i, createVNode as x, createBlock as Me, mergeProps as Ce, withKeys as Z, withCtx as L, createElementVNode as c, withModifiers as _, Teleport as Ve, Transition as Ae, createCommentVNode as V, normalizeStyle as ee, normalizeClass as P, unref as $e, toDisplayString as T, Fragment as O, renderList as U, createTextVNode as te, nextTick as Fe } from "vue";
|
|
2
|
+
import Te from "../../../KunTextField/src/components/KunTextField.vue.js";
|
|
3
|
+
import j from "../../../KunNumberField/src/components/KunNumberField.vue.js";
|
|
4
|
+
import { usePosition as Ye } from "../composables/usePosition.js";
|
|
5
|
+
import le 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" }, Ne = { class: "grid grid-cols-7 gap-1" }, Pe = ["onClick"], Oe = {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: "grid grid-cols-3 gap-2"
|
|
31
|
+
}, Ue = ["onClick"], je = {
|
|
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
|
+
}, Ie = { class: "flex flex-col items-center" }, We = { class: "flex flex-col items-center" }, Ke = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "flex flex-col items-center"
|
|
37
|
+
}, qe = {
|
|
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
|
+
}, tt = /* @__PURE__ */ ke({
|
|
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
|
+
// Dynamic default handled in computed usually, or standard
|
|
48
|
+
disabled: { type: Boolean, default: !1 },
|
|
49
|
+
errorMessage: { type: String, default: "" },
|
|
50
|
+
// Logic
|
|
51
|
+
autoApply: { type: Boolean, default: !0 },
|
|
52
|
+
// Modes: 'date', 'datetime', 'time'
|
|
53
|
+
mode: { type: String, default: "date" },
|
|
54
|
+
// Backwards compat / Overrides
|
|
55
|
+
enableTime: { type: Boolean, default: !1 },
|
|
56
|
+
// If true implies datetime unless mode is set
|
|
57
|
+
enableSeconds: { type: Boolean, default: !1 },
|
|
58
|
+
minDate: { type: Date, default: null },
|
|
59
|
+
maxDate: { type: Date, default: null },
|
|
60
|
+
locale: { type: String, default: "es-ES" },
|
|
61
|
+
// Formatting
|
|
62
|
+
valueFormat: { type: String, default: null },
|
|
63
|
+
// e.g., 'YYYY-MM-DD', 'YYYY-MM-DD HH:mm:ss', 'HH:mm:ss'
|
|
64
|
+
displayFormat: { type: String, default: null },
|
|
65
|
+
// Override display format
|
|
66
|
+
// Styling & Layout
|
|
67
|
+
width: { type: [String, Number], default: null },
|
|
68
|
+
calendarWidth: { type: [String, Number], default: 320 },
|
|
69
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
70
|
+
align: { type: String, default: "left" },
|
|
71
|
+
daySize: { type: String, default: "2rem" },
|
|
72
|
+
fontSize: { type: String, default: "0.875rem" },
|
|
73
|
+
maxHeight: { type: String, default: "400px" },
|
|
74
|
+
inputClass: { default: "" },
|
|
75
|
+
dialogClass: { default: "" }
|
|
76
|
+
},
|
|
77
|
+
emits: ["update:modelValue", "change", "close", "open"],
|
|
78
|
+
setup(d, { emit: ae }) {
|
|
79
|
+
const a = d, Y = ae, I = Math.random().toString(36).substr(2, 9), ne = h(null), v = h(null), B = h(null), D = h(!1), z = h("days"), o = h(null), S = h((/* @__PURE__ */ new Date()).getMonth()), p = h((/* @__PURE__ */ new Date()).getFullYear()), m = h({ hours: 0, minutes: 0, seconds: 0 });
|
|
80
|
+
function W(t, e) {
|
|
81
|
+
const l = {
|
|
82
|
+
YYYY: t.getFullYear().toString(),
|
|
83
|
+
MM: String(t.getMonth() + 1).padStart(2, "0"),
|
|
84
|
+
DD: String(t.getDate()).padStart(2, "0"),
|
|
85
|
+
HH: String(t.getHours()).padStart(2, "0"),
|
|
86
|
+
mm: String(t.getMinutes()).padStart(2, "0"),
|
|
87
|
+
ss: String(t.getSeconds()).padStart(2, "0")
|
|
88
|
+
};
|
|
89
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss/g, (n) => l[n]);
|
|
90
|
+
}
|
|
91
|
+
const f = b(() => a.mode ? a.mode : a.enableTime ? "datetime" : "date"), M = b(() => f.value === "datetime" || f.value === "time" || a.enableTime), oe = b(() => a.enableSeconds || a.valueFormat && a.valueFormat.includes("ss"));
|
|
92
|
+
xe(() => a.modelValue, (t) => {
|
|
93
|
+
K(t);
|
|
94
|
+
}, { immediate: !0 });
|
|
95
|
+
function K(t) {
|
|
96
|
+
if (t)
|
|
97
|
+
if (a.range && Array.isArray(t) && t.length > 0) {
|
|
98
|
+
o.value = t.map((l) => A(l));
|
|
99
|
+
const e = Array.isArray(o.value) ? o.value[0] : null;
|
|
100
|
+
e instanceof Date && (S.value = e.getMonth(), p.value = e.getFullYear(), M.value && q(e));
|
|
101
|
+
} else {
|
|
102
|
+
const e = A(t);
|
|
103
|
+
e instanceof Date && (o.value = e, S.value = e.getMonth(), p.value = e.getFullYear(), M.value && q(e));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
o.value = null;
|
|
107
|
+
const e = /* @__PURE__ */ new Date();
|
|
108
|
+
m.value = { hours: e.getHours(), minutes: e.getMinutes(), seconds: 0 };
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function A(t) {
|
|
112
|
+
if (t instanceof Date) return t;
|
|
113
|
+
if (typeof t == "string") {
|
|
114
|
+
if (f.value === "time") {
|
|
115
|
+
const [n, r, y] = t.split(/[:\s]/).map(Number), g = /* @__PURE__ */ new Date();
|
|
116
|
+
return g.setHours(n || 0, r || 0, y || 0, 0), g;
|
|
117
|
+
}
|
|
118
|
+
const e = t.replace(" ", "T"), l = new Date(e);
|
|
119
|
+
if (!isNaN(l.getTime())) return l;
|
|
120
|
+
}
|
|
121
|
+
return /* @__PURE__ */ new Date();
|
|
122
|
+
}
|
|
123
|
+
function q(t) {
|
|
124
|
+
m.value = {
|
|
125
|
+
hours: t.getHours(),
|
|
126
|
+
minutes: t.getMinutes(),
|
|
127
|
+
seconds: t.getSeconds()
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const { style: re, update: se } = Ye(v, B, {
|
|
131
|
+
offset: 8,
|
|
132
|
+
align: a.align
|
|
133
|
+
}), ie = b(() => {
|
|
134
|
+
var e;
|
|
135
|
+
let t = a.calendarWidth;
|
|
136
|
+
return a.fullWidth && ((e = v.value) != null && e.rootRef) && (t = v.value.rootRef.getBoundingClientRect().width), f.value === "time" && (t = 200), {
|
|
137
|
+
width: typeof t == "number" ? `${t}px` : t
|
|
138
|
+
};
|
|
139
|
+
}), ue = b(() => new Date(p.value, S.value).toLocaleString(a.locale, { month: "long" }).replace(/^\w/, (t) => t.toUpperCase())), de = b(() => {
|
|
140
|
+
const t = [], e = new Date(2023, 0, 1);
|
|
141
|
+
for (; e.getDay() !== 1; )
|
|
142
|
+
e.setDate(e.getDate() + 1);
|
|
143
|
+
for (let l = 0; l < 7; l++)
|
|
144
|
+
t.push(e.toLocaleString(a.locale, { weekday: "narrow" }).replace(".", "")), e.setDate(e.getDate() + 1);
|
|
145
|
+
return t;
|
|
146
|
+
}), ce = b(() => {
|
|
147
|
+
if (!a.modelValue) return "";
|
|
148
|
+
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 = (n) => {
|
|
149
|
+
if (a.displayFormat) return W(n, a.displayFormat);
|
|
150
|
+
let r = "";
|
|
151
|
+
return f.value !== "time" && (r += n.toLocaleDateString(a.locale, t)), f.value === "datetime" && (r += " " + n.toLocaleTimeString(a.locale, e)), f.value === "time" && (r = n.toLocaleTimeString(a.locale, e)), r;
|
|
152
|
+
};
|
|
153
|
+
if (a.range && Array.isArray(a.modelValue)) {
|
|
154
|
+
const n = a.modelValue[0] ? l(A(a.modelValue[0])) : "", r = a.modelValue[1] ? l(A(a.modelValue[1])) : "";
|
|
155
|
+
return n ? r ? `${n} ~ ${r}` : `${n} ~ ...` : "";
|
|
156
|
+
}
|
|
157
|
+
return l(A(a.modelValue));
|
|
158
|
+
}), fe = b(() => {
|
|
159
|
+
if (f.value === "time") return [];
|
|
160
|
+
const t = p.value, e = S.value, l = new Date(t, e, 1).getDay(), n = l === 0 ? 6 : l - 1, r = new Date(t, e + 1, 0).getDate(), y = new Date(t, e, 0).getDate(), g = [];
|
|
161
|
+
for (let s = 0; s < n; s++)
|
|
162
|
+
g.push({
|
|
163
|
+
day: y - n + s + 1,
|
|
164
|
+
date: new Date(t, e - 1, y - n + s + 1),
|
|
165
|
+
isCurrentMonth: !1
|
|
166
|
+
});
|
|
167
|
+
for (let s = 1; s <= r; s++)
|
|
168
|
+
g.push({
|
|
169
|
+
day: s,
|
|
170
|
+
date: new Date(t, e, s),
|
|
171
|
+
isCurrentMonth: !0
|
|
172
|
+
});
|
|
173
|
+
const C = 42 - g.length;
|
|
174
|
+
for (let s = 1; s <= C; s++)
|
|
175
|
+
g.push({
|
|
176
|
+
day: s,
|
|
177
|
+
date: new Date(t, e + 1, s),
|
|
178
|
+
isCurrentMonth: !1
|
|
179
|
+
});
|
|
180
|
+
return g;
|
|
181
|
+
}), me = b(() => {
|
|
182
|
+
const t = [], e = (/* @__PURE__ */ new Date()).getFullYear();
|
|
183
|
+
for (let l = e - 100; l <= e + 20; l++)
|
|
184
|
+
t.push(l);
|
|
185
|
+
return t.reverse();
|
|
186
|
+
});
|
|
187
|
+
function $() {
|
|
188
|
+
a.disabled || (D.value ? F() : ge());
|
|
189
|
+
}
|
|
190
|
+
function ge() {
|
|
191
|
+
window.dispatchEvent(new CustomEvent("kun:datepicker:open", { detail: { id: I } })), D.value = !0, K(a.modelValue), Y("open"), Fe(() => {
|
|
192
|
+
se();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function F() {
|
|
196
|
+
D.value = !1, Y("close");
|
|
197
|
+
}
|
|
198
|
+
function G(t) {
|
|
199
|
+
t.detail.id !== I && D.value && F();
|
|
200
|
+
}
|
|
201
|
+
function J(t) {
|
|
202
|
+
if (!D.value) return;
|
|
203
|
+
const e = t.target;
|
|
204
|
+
B.value && B.value.contains(e) || v.value && (v.value.rootRef && v.value.rootRef.contains(e) || v.value.$el && v.value.$el.contains(e)) || F();
|
|
205
|
+
}
|
|
206
|
+
De(() => {
|
|
207
|
+
document.addEventListener("click", J, !0), window.addEventListener("kun:datepicker:open", G);
|
|
208
|
+
}), Se(() => {
|
|
209
|
+
document.removeEventListener("click", J, !0), window.removeEventListener("kun:datepicker:open", G);
|
|
210
|
+
});
|
|
211
|
+
function Q(t) {
|
|
212
|
+
let e = S.value + t;
|
|
213
|
+
e > 11 ? (e = 0, p.value++) : e < 0 && (e = 11, p.value--), S.value = e;
|
|
214
|
+
}
|
|
215
|
+
function ve() {
|
|
216
|
+
z.value = z.value === "days" ? "years" : "days";
|
|
217
|
+
}
|
|
218
|
+
function pe(t) {
|
|
219
|
+
p.value = t, z.value = "days";
|
|
220
|
+
}
|
|
221
|
+
function R(t) {
|
|
222
|
+
const e = new Date(t);
|
|
223
|
+
return f.value === "time" || f.value === "datetime" || a.enableTime ? (e.setHours(m.value.hours || 0), e.setMinutes(m.value.minutes || 0), e.setSeconds(m.value.seconds || 0)) : e.setHours(0, 0, 0, 0), e;
|
|
224
|
+
}
|
|
225
|
+
function ye(t) {
|
|
226
|
+
const e = R(t.date);
|
|
227
|
+
if (a.range) {
|
|
228
|
+
let l = Array.isArray(o.value) ? [...o.value] : [];
|
|
229
|
+
if (l.length === 2 && (l = []), l.length === 0)
|
|
230
|
+
l = [e];
|
|
231
|
+
else if (l.length === 1) {
|
|
232
|
+
let n = l[0], r = e;
|
|
233
|
+
r < n && ([n, r] = [r, n]), l = [n, r];
|
|
234
|
+
}
|
|
235
|
+
o.value = l, a.autoApply && l.length === 2 && !M.value && E();
|
|
236
|
+
} else
|
|
237
|
+
o.value = e, a.autoApply && !M.value && E();
|
|
238
|
+
}
|
|
239
|
+
function H() {
|
|
240
|
+
let t = o.value instanceof Date ? o.value : /* @__PURE__ */ new Date();
|
|
241
|
+
!o.value && f.value === "time" && (t = /* @__PURE__ */ new Date());
|
|
242
|
+
const e = R(t);
|
|
243
|
+
a.range || (o.value = e);
|
|
244
|
+
}
|
|
245
|
+
function he() {
|
|
246
|
+
const t = o.value;
|
|
247
|
+
if (!t) return null;
|
|
248
|
+
const e = (l) => a.valueFormat ? W(l, a.valueFormat) : l;
|
|
249
|
+
return Array.isArray(t) ? t.map((l) => e(l)) : e(t);
|
|
250
|
+
}
|
|
251
|
+
function E() {
|
|
252
|
+
f.value === "time" && !o.value ? H() : M.value && o.value && !Array.isArray(o.value) && (o.value = R(o.value));
|
|
253
|
+
const t = he();
|
|
254
|
+
Y("update:modelValue", t), Y("change", t), F();
|
|
255
|
+
}
|
|
256
|
+
function be(t) {
|
|
257
|
+
const { date: e, isCurrentMonth: l } = t, r = X(e, /* @__PURE__ */ new Date());
|
|
258
|
+
let y = !1, g = !1;
|
|
259
|
+
const C = o.value, s = (w, k) => w instanceof Date ? X(w, k) : !1;
|
|
260
|
+
if (a.range && Array.isArray(C)) {
|
|
261
|
+
const [w, k] = C;
|
|
262
|
+
w && s(w, e) && (y = !0), k && s(k, e) && (y = !0), w && k && w instanceof Date && k instanceof Date && e > w && e < k && (g = !0);
|
|
263
|
+
} else !a.range && C instanceof Date && s(C, e) && (y = !0);
|
|
264
|
+
const N = "flex items-center justify-center font-medium text-sm z-10", we = l ? "text-slate-700 dark:text-slate-200" : "text-slate-300 dark:text-slate-600";
|
|
265
|
+
return y ? `${N} bg-blue-600 text-white shadow-md hover:bg-blue-700 rounded-full` : g ? `${N} bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-none` : `${N} ${we} hover:bg-slate-100 dark:hover:bg-slate-700 ${r ? "border border-blue-500 text-blue-600 dark:text-blue-400 font-bold" : ""}`;
|
|
266
|
+
}
|
|
267
|
+
function X(t, e) {
|
|
268
|
+
return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
|
|
269
|
+
}
|
|
270
|
+
return (t, e) => (i(), u("div", {
|
|
271
|
+
class: "relative w-full",
|
|
272
|
+
ref_key: "containerRef",
|
|
273
|
+
ref: ne
|
|
274
|
+
}, [
|
|
275
|
+
x(Te, Ce({
|
|
276
|
+
ref_key: "triggerRef",
|
|
277
|
+
ref: v,
|
|
278
|
+
"model-value": ce.value,
|
|
279
|
+
label: d.label,
|
|
280
|
+
placeholder: d.placeholder,
|
|
281
|
+
disabled: d.disabled,
|
|
282
|
+
readonly: ""
|
|
283
|
+
}, t.$attrs, {
|
|
284
|
+
onHandleClick: $,
|
|
285
|
+
onClick: $,
|
|
286
|
+
onKeydown: [
|
|
287
|
+
Z($, ["enter"]),
|
|
288
|
+
Z($, ["space"])
|
|
289
|
+
],
|
|
290
|
+
class: ["cursor-pointer", d.inputClass],
|
|
291
|
+
"error-message": d.errorMessage,
|
|
292
|
+
"has-error": !!d.errorMessage,
|
|
293
|
+
"hide-details": ""
|
|
294
|
+
}), {
|
|
295
|
+
"append-inner": L(() => [
|
|
296
|
+
c("div", {
|
|
297
|
+
class: "cursor-pointer text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors",
|
|
298
|
+
onClick: _($, ["stop"])
|
|
299
|
+
}, [
|
|
300
|
+
d.mode === "time" ? (i(), u("svg", Be, [...e[6] || (e[6] = [
|
|
301
|
+
c("path", {
|
|
302
|
+
"stroke-linecap": "round",
|
|
303
|
+
"stroke-linejoin": "round",
|
|
304
|
+
d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
305
|
+
}, null, -1)
|
|
306
|
+
])])) : (i(), u("svg", ze, [...e[7] || (e[7] = [
|
|
307
|
+
c("path", {
|
|
308
|
+
"stroke-linecap": "round",
|
|
309
|
+
"stroke-linejoin": "round",
|
|
310
|
+
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"
|
|
311
|
+
}, null, -1)
|
|
312
|
+
])]))
|
|
313
|
+
])
|
|
314
|
+
]),
|
|
315
|
+
_: 1
|
|
316
|
+
}, 16, ["model-value", "label", "placeholder", "disabled", "class", "error-message", "has-error"]),
|
|
317
|
+
(i(), Me(Ve, { to: "body" }, [
|
|
318
|
+
x(Ae, {
|
|
319
|
+
"enter-active-class": "transition ease-out duration-150",
|
|
320
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
321
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
322
|
+
"leave-active-class": "transition ease-in duration-100",
|
|
323
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
324
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
325
|
+
}, {
|
|
326
|
+
default: L(() => [
|
|
327
|
+
D.value ? (i(), u("div", {
|
|
328
|
+
key: 0,
|
|
329
|
+
ref_key: "popoverRef",
|
|
330
|
+
ref: B,
|
|
331
|
+
class: P(["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", [d.dialogClass]]),
|
|
332
|
+
style: ee([$e(re), ie.value]),
|
|
333
|
+
onClick: e[5] || (e[5] = _(() => {
|
|
334
|
+
}, ["stop"]))
|
|
335
|
+
}, [
|
|
336
|
+
d.mode !== "time" ? (i(), u("div", He, [
|
|
337
|
+
c("button", {
|
|
338
|
+
type: "button",
|
|
339
|
+
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",
|
|
340
|
+
onClick: e[0] || (e[0] = (l) => Q(-1))
|
|
341
|
+
}, [...e[8] || (e[8] = [
|
|
342
|
+
c("svg", {
|
|
343
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
344
|
+
class: "h-5 w-5",
|
|
345
|
+
viewBox: "0 0 20 20",
|
|
346
|
+
fill: "currentColor"
|
|
347
|
+
}, [
|
|
348
|
+
c("path", {
|
|
349
|
+
"fill-rule": "evenodd",
|
|
350
|
+
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",
|
|
351
|
+
"clip-rule": "evenodd"
|
|
352
|
+
})
|
|
353
|
+
], -1)
|
|
354
|
+
])]),
|
|
355
|
+
c("div", {
|
|
356
|
+
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",
|
|
357
|
+
onClick: ve
|
|
358
|
+
}, T(ue.value) + " " + T(p.value), 1),
|
|
359
|
+
c("button", {
|
|
360
|
+
type: "button",
|
|
361
|
+
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",
|
|
362
|
+
onClick: e[1] || (e[1] = (l) => Q(1))
|
|
363
|
+
}, [...e[9] || (e[9] = [
|
|
364
|
+
c("svg", {
|
|
365
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
366
|
+
class: "h-5 w-5",
|
|
367
|
+
viewBox: "0 0 20 20",
|
|
368
|
+
fill: "currentColor"
|
|
369
|
+
}, [
|
|
370
|
+
c("path", {
|
|
371
|
+
"fill-rule": "evenodd",
|
|
372
|
+
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",
|
|
373
|
+
"clip-rule": "evenodd"
|
|
374
|
+
})
|
|
375
|
+
], -1)
|
|
376
|
+
])])
|
|
377
|
+
])) : V("", !0),
|
|
378
|
+
d.mode !== "time" ? (i(), u("div", Le, [
|
|
379
|
+
z.value === "days" ? (i(), u("div", Re, [
|
|
380
|
+
c("div", Ee, [
|
|
381
|
+
(i(!0), u(O, null, U(de.value, (l) => (i(), u("span", {
|
|
382
|
+
key: l,
|
|
383
|
+
class: "text-[0.7rem] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest"
|
|
384
|
+
}, T(l), 1))), 128))
|
|
385
|
+
]),
|
|
386
|
+
c("div", Ne, [
|
|
387
|
+
(i(!0), u(O, null, U(fe.value, (l, n) => (i(), u("div", {
|
|
388
|
+
key: n,
|
|
389
|
+
class: P(["relative flex items-center justify-center rounded-full transition-all duration-150 cursor-pointer group", be(l)]),
|
|
390
|
+
style: ee({ width: d.daySize, height: d.daySize, fontSize: d.fontSize }),
|
|
391
|
+
onClick: (r) => ye(l)
|
|
392
|
+
}, T(l.day), 15, Pe))), 128))
|
|
393
|
+
])
|
|
394
|
+
])) : (i(), u("div", Oe, [
|
|
395
|
+
(i(!0), u(O, null, U(me.value, (l) => (i(), u("div", {
|
|
396
|
+
key: l,
|
|
397
|
+
class: P(["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 === p.value }]),
|
|
398
|
+
onClick: (n) => pe(l)
|
|
399
|
+
}, T(l), 11, Ue))), 128))
|
|
400
|
+
]))
|
|
401
|
+
])) : V("", !0),
|
|
402
|
+
M.value ? (i(), u("div", je, [
|
|
403
|
+
c("div", Ie, [
|
|
404
|
+
x(j, {
|
|
405
|
+
modelValue: m.value.hours,
|
|
406
|
+
"onUpdate:modelValue": e[2] || (e[2] = (l) => m.value.hours = l),
|
|
407
|
+
min: 0,
|
|
408
|
+
max: 23,
|
|
409
|
+
onChange: H,
|
|
410
|
+
precision: "0",
|
|
411
|
+
"text-center": "",
|
|
412
|
+
label: "Hora",
|
|
413
|
+
noArrows: "",
|
|
414
|
+
"hide-details": "",
|
|
415
|
+
density: "compact",
|
|
416
|
+
placeholder: "00"
|
|
417
|
+
}, null, 8, ["modelValue"])
|
|
418
|
+
]),
|
|
419
|
+
c("div", We, [
|
|
420
|
+
x(j, {
|
|
421
|
+
modelValue: m.value.minutes,
|
|
422
|
+
"onUpdate:modelValue": e[3] || (e[3] = (l) => m.value.minutes = l),
|
|
423
|
+
min: 0,
|
|
424
|
+
max: 59,
|
|
425
|
+
onChange: H,
|
|
426
|
+
precision: "0",
|
|
427
|
+
"text-center": "",
|
|
428
|
+
label: "Min",
|
|
429
|
+
noArrows: "",
|
|
430
|
+
"hide-details": "",
|
|
431
|
+
density: "compact",
|
|
432
|
+
placeholder: "00"
|
|
433
|
+
}, null, 8, ["modelValue"])
|
|
434
|
+
]),
|
|
435
|
+
d.enableSeconds ? (i(), u("div", Ke, [
|
|
436
|
+
x(j, {
|
|
437
|
+
modelValue: m.value.seconds,
|
|
438
|
+
"onUpdate:modelValue": e[4] || (e[4] = (l) => m.value.seconds = l),
|
|
439
|
+
min: 0,
|
|
440
|
+
max: 59,
|
|
441
|
+
onChange: H,
|
|
442
|
+
precision: "0",
|
|
443
|
+
"text-center": "",
|
|
444
|
+
label: "Seg",
|
|
445
|
+
noArrows: "",
|
|
446
|
+
"hide-details": "",
|
|
447
|
+
density: "compact",
|
|
448
|
+
placeholder: "00"
|
|
449
|
+
}, null, 8, ["modelValue"])
|
|
450
|
+
])) : V("", !0)
|
|
451
|
+
])) : V("", !0),
|
|
452
|
+
d.autoApply ? V("", !0) : (i(), u("div", qe, [
|
|
453
|
+
x(le, {
|
|
454
|
+
onClick: F,
|
|
455
|
+
size: "xs"
|
|
456
|
+
}, {
|
|
457
|
+
default: L(() => [...e[10] || (e[10] = [
|
|
458
|
+
te("Cancelar", -1)
|
|
459
|
+
])]),
|
|
460
|
+
_: 1
|
|
461
|
+
}),
|
|
462
|
+
x(le, {
|
|
463
|
+
onClick: E,
|
|
464
|
+
size: "xs",
|
|
465
|
+
bgColor: "bg-success"
|
|
466
|
+
}, {
|
|
467
|
+
default: L(() => [...e[11] || (e[11] = [
|
|
468
|
+
te("Aplicar", -1)
|
|
469
|
+
])]),
|
|
470
|
+
_: 1
|
|
471
|
+
})
|
|
472
|
+
]))
|
|
473
|
+
], 6)) : V("", !0)
|
|
474
|
+
]),
|
|
475
|
+
_: 1
|
|
476
|
+
})
|
|
477
|
+
]))
|
|
478
|
+
], 512));
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
export {
|
|
482
|
+
tt as default
|
|
483
|
+
};
|
|
@@ -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
|
])
|