@iaclinical/components 1.0.34 → 1.0.36
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/iaclinical-components.cjs +1 -1
- package/dist/iaclinical-components.js +1127 -1084
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as N, computed as
|
|
1
|
+
import { defineComponent as N, computed as r, createElementBlock as a, openBlock as l, normalizeClass as n, createElementVNode as s, createCommentVNode as c, renderSlot as L, toDisplayString as D, createBlock as te, unref as Re, normalizeStyle as X, ref as P, onMounted as be, onUnmounted as ge, watch as de, createTextVNode as Y, withModifiers as J, createVNode as Q, withDirectives as me, Fragment as K, renderList as G, vModelSelect as Te, withKeys as Se, Teleport as ye, Transition as ie, withCtx as re, nextTick as ve, resolveDynamicComponent as he, vModelText as Ee } from "vue";
|
|
2
2
|
import { Icon as Ye } from "@iconify/vue";
|
|
3
3
|
const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
4
4
|
key: 1,
|
|
@@ -24,17 +24,17 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
24
24
|
density: { default: "normal" }
|
|
25
25
|
},
|
|
26
26
|
emits: ["toggle-menu"],
|
|
27
|
-
setup(t, { emit:
|
|
28
|
-
const e = t,
|
|
29
|
-
const
|
|
30
|
-
default: "bg-primary-
|
|
27
|
+
setup(t, { emit: b }) {
|
|
28
|
+
const e = t, m = b, o = r(() => {
|
|
29
|
+
const f = "flex flex-row items-center justify-between gap-2 sm:gap-4 px-3 sm:px-6 z-50 w-full", p = {
|
|
30
|
+
default: "bg-primary-500 text-primary-50",
|
|
31
31
|
dark: "bg-secondary-900 text-white",
|
|
32
32
|
light: "bg-white text-secondary-900 border-b border-secondary-200"
|
|
33
|
-
},
|
|
33
|
+
}, i = {
|
|
34
34
|
sm: "h-12",
|
|
35
35
|
md: "h-14",
|
|
36
36
|
lg: "h-16"
|
|
37
|
-
},
|
|
37
|
+
}, v = {
|
|
38
38
|
0: "",
|
|
39
39
|
1: "shadow-sm",
|
|
40
40
|
2: "shadow",
|
|
@@ -45,25 +45,25 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
45
45
|
compact: "gap-1",
|
|
46
46
|
normal: "gap-2 sm:gap-4",
|
|
47
47
|
prominent: "gap-3 sm:gap-6 px-6 sm:px-8"
|
|
48
|
-
},
|
|
48
|
+
}, w = e.sticky ? e.mode === "fixed" ? "fixed top-0 inset-x-0" : "sticky top-0 inset-x-0" : "", g = e.shadow ? "shadow-md" : v[Math.min(e.elevation, 5)];
|
|
49
49
|
return [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
f.replace("gap-2 sm:gap-4", z[e.density]),
|
|
51
|
+
p[e.variant],
|
|
52
|
+
i[e.height],
|
|
53
|
+
w,
|
|
54
|
+
g
|
|
55
55
|
].join(" ");
|
|
56
56
|
});
|
|
57
|
-
return (
|
|
58
|
-
class:
|
|
57
|
+
return (f, p) => (l(), a("header", {
|
|
58
|
+
class: n(o.value)
|
|
59
59
|
}, [
|
|
60
60
|
s("div", Ne, [
|
|
61
61
|
t.showMenuButton ? (l(), a("button", {
|
|
62
62
|
key: 0,
|
|
63
|
-
onClick:
|
|
63
|
+
onClick: p[0] || (p[0] = (i) => m("toggle-menu")),
|
|
64
64
|
class: "p-1.5 sm:p-2 hover:bg-primary-600 rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
65
65
|
"aria-label": "Toggle menu"
|
|
66
|
-
}, [...
|
|
66
|
+
}, [...p[1] || (p[1] = [
|
|
67
67
|
s("svg", {
|
|
68
68
|
class: "w-5 h-5 sm:w-6 sm:h-6 text-primary-50",
|
|
69
69
|
fill: "none",
|
|
@@ -78,26 +78,26 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
78
78
|
d: "M4 6h16M4 12h16M4 18h16"
|
|
79
79
|
})
|
|
80
80
|
], -1)
|
|
81
|
-
])])) :
|
|
82
|
-
t.title && t.titlePosition === "left" ? (l(), a("div", He,
|
|
83
|
-
|
|
81
|
+
])])) : c("", !0),
|
|
82
|
+
t.title && t.titlePosition === "left" ? (l(), a("div", He, D(t.title), 1)) : c("", !0),
|
|
83
|
+
L(f.$slots, "left", {}, void 0, !0)
|
|
84
84
|
]),
|
|
85
85
|
s("div", Ke, [
|
|
86
|
-
t.title && t.titlePosition === "center" ? (l(), a("div", Ue,
|
|
87
|
-
|
|
86
|
+
t.title && t.titlePosition === "center" ? (l(), a("div", Ue, D(t.title), 1)) : c("", !0),
|
|
87
|
+
L(f.$slots, "center", {}, void 0, !0)
|
|
88
88
|
]),
|
|
89
89
|
s("div", Je, [
|
|
90
|
-
t.title && t.titlePosition === "right" ? (l(), a("div", Ge,
|
|
91
|
-
|
|
90
|
+
t.title && t.titlePosition === "right" ? (l(), a("div", Ge, D(t.title), 1)) : c("", !0),
|
|
91
|
+
L(f.$slots, "right", {}, void 0, !0)
|
|
92
92
|
])
|
|
93
93
|
], 2));
|
|
94
94
|
}
|
|
95
|
-
}), Z = (t,
|
|
95
|
+
}), Z = (t, b) => {
|
|
96
96
|
const e = t.__vccOpts || t;
|
|
97
|
-
for (const [
|
|
98
|
-
e[
|
|
97
|
+
for (const [m, o] of b)
|
|
98
|
+
e[m] = o;
|
|
99
99
|
return e;
|
|
100
|
-
},
|
|
100
|
+
}, Ra = /* @__PURE__ */ Z(Qe, [["__scopeId", "data-v-b7ffd034"]]), Ze = ["type", "disabled", "aria-label"], Xe = {
|
|
101
101
|
key: 0,
|
|
102
102
|
class: "w-4 h-4 animate-spin mr-2",
|
|
103
103
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -106,7 +106,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
106
106
|
}, _e = {
|
|
107
107
|
key: 1,
|
|
108
108
|
class: "absolute top-0 right-0 inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-bold leading-none text-white transform translate-x-1/2 -translate-y-1/2 bg-danger-600 rounded-full min-w-[1.25rem]"
|
|
109
|
-
},
|
|
109
|
+
}, Ea = /* @__PURE__ */ N({
|
|
110
110
|
__name: "Button",
|
|
111
111
|
props: {
|
|
112
112
|
variant: { default: "primary" },
|
|
@@ -118,43 +118,44 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
118
118
|
badge: { default: 0 },
|
|
119
119
|
ariaLabel: { default: "" },
|
|
120
120
|
textColor: { default: void 0 },
|
|
121
|
-
textColorHover: { default: void 0 }
|
|
121
|
+
textColorHover: { default: void 0 },
|
|
122
|
+
compact: { type: Boolean, default: !1 }
|
|
122
123
|
},
|
|
123
124
|
emits: ["click"],
|
|
124
|
-
setup(t, { emit:
|
|
125
|
-
const e = t,
|
|
126
|
-
const
|
|
127
|
-
primary: "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-
|
|
125
|
+
setup(t, { emit: b }) {
|
|
126
|
+
const e = t, m = b, o = r(() => e.variant === "icon"), f = r(() => e.badge > 99 ? "99+" : e.badge.toString()), p = r(() => {
|
|
127
|
+
const v = "inline-flex items-center justify-center font-semibold tracking-wide transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", z = {
|
|
128
|
+
primary: "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-500 focus-visible:ring-primary-500",
|
|
128
129
|
secondary: "bg-secondary-200 text-secondary-900 hover:bg-secondary-300 hover:text-secondary-800 focus-visible:ring-secondary-500",
|
|
129
|
-
outline: "border border-secondary-300 bg-transparent hover:bg-
|
|
130
|
-
ghost: "hover:bg-
|
|
130
|
+
outline: "border border-secondary-300 bg-transparent hover:bg-primary-100 focus-visible:ring-secondary-500",
|
|
131
|
+
ghost: "hover:bg-primary-100 focus-visible:ring-secondary-500",
|
|
131
132
|
danger: "bg-danger-600 text-white hover:bg-danger-700 focus-visible:ring-danger-600",
|
|
132
|
-
icon: "hover:bg-
|
|
133
|
+
icon: "hover:bg-primary-100 hover:text-black focus-visible:ring-secondary-500 relative",
|
|
133
134
|
text: "bg-transparent border-0 focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
134
|
-
},
|
|
135
|
-
sm:
|
|
136
|
-
md:
|
|
137
|
-
lg:
|
|
138
|
-
},
|
|
135
|
+
}, w = {
|
|
136
|
+
sm: o.value ? e.compact ? "p-1" : "p-1.5" : e.compact ? "h-6 px-2 text-xs" : "h-8 px-3 text-sm",
|
|
137
|
+
md: o.value ? e.compact ? "p-1.5" : "p-2" : e.compact ? "h-8 px-3 text-sm" : "h-10 px-4 text-base",
|
|
138
|
+
lg: o.value ? e.compact ? "p-2" : "p-3" : e.compact ? "h-10 px-4 text-base" : "h-12 px-6 text-lg"
|
|
139
|
+
}, g = {
|
|
139
140
|
full: "rounded-full",
|
|
140
141
|
xl: "rounded-2xl",
|
|
141
142
|
lg: "rounded-xl",
|
|
142
143
|
md: "rounded-lg",
|
|
143
144
|
sm: "rounded-md",
|
|
144
145
|
none: "rounded-none"
|
|
145
|
-
},
|
|
146
|
-
var
|
|
147
|
-
return e.textColorHover ? e.textColorHover : (
|
|
146
|
+
}, B = e.textColor ? e.textColor : "", C = r(() => {
|
|
147
|
+
var F, j;
|
|
148
|
+
return e.textColorHover ? e.textColorHover : (F = e.textColor) != null && F.includes("white") || (j = e.textColor) != null && j.includes("50") ? "hover:text-black" : "";
|
|
148
149
|
});
|
|
149
|
-
return `${
|
|
150
|
-
}),
|
|
151
|
-
e.disabled ||
|
|
150
|
+
return `${v} ${z[e.variant]} ${w[e.size]} ${g[e.radius]} ${B} ${C.value}`;
|
|
151
|
+
}), i = (v) => {
|
|
152
|
+
e.disabled || m("click", v);
|
|
152
153
|
};
|
|
153
|
-
return (
|
|
154
|
-
class:
|
|
154
|
+
return (v, z) => (l(), a("button", {
|
|
155
|
+
class: n(p.value),
|
|
155
156
|
type: t.type,
|
|
156
157
|
disabled: t.disabled || t.loading,
|
|
157
|
-
onClick:
|
|
158
|
+
onClick: i,
|
|
158
159
|
"aria-label": t.ariaLabel
|
|
159
160
|
}, [
|
|
160
161
|
t.loading ? (l(), a("svg", Xe, [...z[0] || (z[0] = [
|
|
@@ -171,9 +172,9 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
171
172
|
fill: "currentColor",
|
|
172
173
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
173
174
|
}, null, -1)
|
|
174
|
-
])])) :
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
])])) : c("", !0),
|
|
176
|
+
L(v.$slots, "default"),
|
|
177
|
+
o.value && t.badge && t.badge > 0 ? (l(), a("span", _e, D(f.value), 1)) : c("", !0)
|
|
177
178
|
], 10, Ze));
|
|
178
179
|
}
|
|
179
180
|
}), et = /* @__PURE__ */ N({
|
|
@@ -188,16 +189,16 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
188
189
|
ariaLabel: {}
|
|
189
190
|
},
|
|
190
191
|
setup(t) {
|
|
191
|
-
const
|
|
192
|
+
const b = t, e = {
|
|
192
193
|
xs: "16px",
|
|
193
194
|
sm: "18px",
|
|
194
195
|
md: "20px",
|
|
195
196
|
lg: "24px",
|
|
196
197
|
xl: "30px",
|
|
197
198
|
"2xl": "36px"
|
|
198
|
-
},
|
|
199
|
-
const z =
|
|
200
|
-
switch (
|
|
199
|
+
}, m = (i, v) => {
|
|
200
|
+
const z = i.replace(/_/g, "-");
|
|
201
|
+
switch (v) {
|
|
201
202
|
case "filled":
|
|
202
203
|
return `material-symbols:${z}`;
|
|
203
204
|
case "outlined":
|
|
@@ -211,24 +212,24 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
211
212
|
default:
|
|
212
213
|
return `material-symbols:${z}`;
|
|
213
214
|
}
|
|
214
|
-
},
|
|
215
|
-
const
|
|
215
|
+
}, o = r(() => m(b.name, b.variant)), f = r(() => {
|
|
216
|
+
const i = [
|
|
216
217
|
"inline-flex items-center justify-center select-none",
|
|
217
218
|
"transition-transform duration-200"
|
|
218
219
|
];
|
|
219
|
-
return
|
|
220
|
-
}),
|
|
221
|
-
const
|
|
222
|
-
if (e[
|
|
223
|
-
const
|
|
224
|
-
|
|
220
|
+
return b.color && (b.color.startsWith("text-") || b.color.startsWith("fill-")) && i.push(b.color), b.spin && i.push("animate-spin"), i.join(" ");
|
|
221
|
+
}), p = r(() => {
|
|
222
|
+
const i = {};
|
|
223
|
+
if (e[b.size] ? (i.fontSize = e[b.size], i.width = e[b.size], i.height = e[b.size]) : (i.fontSize = b.size, i.width = b.size, i.height = b.size), b.color && !b.color.startsWith("text-") && !b.color.startsWith("fill-") && (i.color = b.color), b.rotate !== 0) {
|
|
224
|
+
const v = `rotate(${b.rotate}deg)`;
|
|
225
|
+
i.transform = v;
|
|
225
226
|
}
|
|
226
|
-
return
|
|
227
|
+
return i;
|
|
227
228
|
});
|
|
228
|
-
return (
|
|
229
|
-
icon:
|
|
230
|
-
class:
|
|
231
|
-
style: X(
|
|
229
|
+
return (i, v) => (l(), te(Re(Ye), {
|
|
230
|
+
icon: o.value,
|
|
231
|
+
class: n(f.value),
|
|
232
|
+
style: X(p.value),
|
|
232
233
|
"aria-label": t.ariaLabel,
|
|
233
234
|
role: t.ariaLabel ? "img" : void 0
|
|
234
235
|
}, null, 8, ["icon", "class", "style", "aria-label", "role"]));
|
|
@@ -251,7 +252,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
251
252
|
}, ft = {
|
|
252
253
|
key: 0,
|
|
253
254
|
class: "text-danger-600"
|
|
254
|
-
}, pt = { class: "grid grid-cols-1 md:grid-cols-2 gap-2" },
|
|
255
|
+
}, pt = { class: "grid grid-cols-1 md:grid-cols-2 gap-2" }, mt = ["disabled", "placeholder", "value", "required"], vt = ["disabled"], bt = ["disabled", "placeholder", "value", "required"], gt = ["disabled"], yt = {
|
|
255
256
|
key: 3,
|
|
256
257
|
class: "mt-1 text-sm text-danger-600"
|
|
257
258
|
}, ht = {
|
|
@@ -285,11 +286,12 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
285
286
|
locale: { default: "es" },
|
|
286
287
|
showWeekNumbers: { type: Boolean, default: !1 },
|
|
287
288
|
firstDayOfWeek: { default: 1 },
|
|
288
|
-
yearsPerRow: { default: 4 }
|
|
289
|
+
yearsPerRow: { default: 4 },
|
|
290
|
+
compact: { type: Boolean, default: !1 }
|
|
289
291
|
},
|
|
290
292
|
emits: ["update:modelValue", "date-select", "range-select", "multiple-select"],
|
|
291
|
-
setup(t, { emit:
|
|
292
|
-
const e = t,
|
|
293
|
+
setup(t, { emit: b }) {
|
|
294
|
+
const e = t, m = P([]), o = b, f = P(!1), p = P(null), i = P((/* @__PURE__ */ new Date()).getMonth()), v = P((/* @__PURE__ */ new Date()).getFullYear()), z = P(`calendar-${Math.random().toString(36).substr(2, 9)}`), w = P(null), g = P(null), B = [
|
|
293
295
|
"Enero",
|
|
294
296
|
"Febrero",
|
|
295
297
|
"Marzo",
|
|
@@ -302,17 +304,17 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
302
304
|
"Octubre",
|
|
303
305
|
"Noviembre",
|
|
304
306
|
"Diciembre"
|
|
305
|
-
],
|
|
306
|
-
const
|
|
307
|
-
for (let
|
|
308
|
-
|
|
309
|
-
return
|
|
310
|
-
}),
|
|
311
|
-
const
|
|
312
|
-
sm: "px-3 py-1.5 pr-10 text-sm",
|
|
313
|
-
md: "px-4 py-2 pr-10 text-base",
|
|
314
|
-
lg: "px-5 py-3 pr-12 text-lg"
|
|
315
|
-
},
|
|
307
|
+
], C = ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"], F = r(() => e.compact ? { sm: "xs", md: "xs", lg: "sm" }[e.size] || "xs" : { sm: "xs", md: "sm", lg: "md" }[e.size] || "sm"), j = r(() => {
|
|
308
|
+
const h = (/* @__PURE__ */ new Date()).getFullYear(), M = [];
|
|
309
|
+
for (let T = h - 100; T <= h + 10; T++)
|
|
310
|
+
M.push(T);
|
|
311
|
+
return M;
|
|
312
|
+
}), O = r(() => "ds-label"), q = r(() => e.bordered ? "border border-neutral-300" : ""), S = r(() => {
|
|
313
|
+
const h = "w-full rounded-md transition-colors focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", M = {
|
|
314
|
+
sm: e.compact ? "px-2 py-1 pr-8 text-xs" : "px-3 py-1.5 pr-10 text-sm",
|
|
315
|
+
md: e.compact ? "px-3 py-1.5 pr-10 text-sm" : "px-4 py-2 pr-10 text-base",
|
|
316
|
+
lg: e.compact ? "px-4 py-2 pr-10 text-base" : "px-5 py-3 pr-12 text-lg"
|
|
317
|
+
}, T = {
|
|
316
318
|
primary: "focus:ring-primary-500",
|
|
317
319
|
secondary: "focus:ring-secondary-500"
|
|
318
320
|
}, E = {
|
|
@@ -320,25 +322,31 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
320
322
|
filled: "bg-secondary-100",
|
|
321
323
|
outlined: "bg-transparent"
|
|
322
324
|
}, ee = e.error ? "border-danger-600 focus:ring-danger-500" : "";
|
|
323
|
-
return `${
|
|
324
|
-
}),
|
|
325
|
+
return `${h} ${M[e.size]} ${E[e.variant]} ${T[e.color]} ${ee}`;
|
|
326
|
+
}), I = r(() => `transition-colors text-[#565656] hover:text-[#565656] opacity-80 hover:opacity-100 ${e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`), W = r(() => e.compact ? "min-w-72 max-w-sm" : "min-w-80 max-w-sm"), A = r(() => `p-2 rounded-md transition-colors ${{
|
|
325
327
|
primary: "text-primary-600 hover:text-primary-700 hover:bg-primary-50",
|
|
326
328
|
secondary: "text-secondary-600 hover:text-secondary-700 hover:bg-secondary-50"
|
|
327
|
-
}[e.color]}`),
|
|
329
|
+
}[e.color]}`), k = r(() => `px-2 py-1 text-sm border border-secondary-300 rounded-md focus:outline-none focus:ring-1 ${{
|
|
328
330
|
primary: "focus:border-primary-500 focus:ring-primary-500",
|
|
329
331
|
secondary: "focus:border-secondary-500 focus:ring-secondary-500"
|
|
330
|
-
}[e.color]}`),
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
332
|
+
}[e.color]}`), y = r(() => {
|
|
333
|
+
const h = {
|
|
334
|
+
primary: "bg-primary-500 hover:bg-primary-600 focus:ring-primary-500",
|
|
335
|
+
secondary: "bg-secondary-600 hover:bg-secondary-700 focus:ring-secondary-500"
|
|
336
|
+
};
|
|
337
|
+
return `${e.compact ? "px-2 py-1 text-xs" : "px-3 py-1.5 text-sm"} text-white rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-1 disabled:opacity-50 disabled:cursor-not-allowed ${h[e.color]}`;
|
|
338
|
+
}), u = r(() => {
|
|
339
|
+
const h = {
|
|
340
|
+
primary: "text-primary-600 hover:text-primary-700 hover:bg-primary-50",
|
|
341
|
+
secondary: "text-secondary-600 hover:text-secondary-700 hover:bg-secondary-50"
|
|
342
|
+
};
|
|
343
|
+
return `${e.compact ? "px-2 py-1 text-xs" : "px-3 py-1.5 text-sm"} border border-secondary-300 rounded-md transition-colors focus:outline-none ${h[e.color]}`;
|
|
344
|
+
}), $ = r(() => e.mode === "single" && e.modelValue && e.modelValue instanceof Date ? H(e.modelValue) : ""), d = r(() => e.mode === "multiple" && Array.isArray(e.modelValue) && e.modelValue.length > 0 ? e.modelValue.length === 1 ? H(e.modelValue[0]) : `${e.modelValue.length} fechas seleccionadas` : ""), V = r(() => e.mode === "range" && e.modelValue && typeof e.modelValue == "object" && "start" in e.modelValue && e.modelValue.start ? H(e.modelValue.start) : ""), x = r(() => e.mode === "range" && e.modelValue && typeof e.modelValue == "object" && "end" in e.modelValue && e.modelValue.end ? H(e.modelValue.end) : ""), le = r(() => e.mode === "single" ? w.value !== null : e.mode === "multiple" ? m.value.length > 0 : w.value !== null && g.value !== null && g.value >= w.value);
|
|
345
|
+
r(() => e.mode === "range" && w.value && g.value ? g.value < w.value : !1);
|
|
346
|
+
const R = r(() => {
|
|
347
|
+
const h = new Date(v.value, i.value, 1), M = new Date(v.value, i.value + 1, 0), T = h.getDay(), E = M.getDate(), ee = [], ae = new Date(v.value, i.value - 1, 0);
|
|
348
|
+
for (let U = T - 1; U >= 0; U--) {
|
|
349
|
+
const se = new Date(v.value, i.value - 1, ae.getDate() - U);
|
|
342
350
|
ee.push({
|
|
343
351
|
day: se.getDate(),
|
|
344
352
|
date: se,
|
|
@@ -348,7 +356,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
348
356
|
});
|
|
349
357
|
}
|
|
350
358
|
for (let U = 1; U <= E; U++) {
|
|
351
|
-
const se = new Date(
|
|
359
|
+
const se = new Date(v.value, i.value, U);
|
|
352
360
|
ee.push({
|
|
353
361
|
day: U,
|
|
354
362
|
date: se,
|
|
@@ -359,7 +367,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
359
367
|
}
|
|
360
368
|
const Pe = 42 - ee.length;
|
|
361
369
|
for (let U = 1; U <= Pe; U++) {
|
|
362
|
-
const se = new Date(
|
|
370
|
+
const se = new Date(v.value, i.value + 1, U);
|
|
363
371
|
ee.push({
|
|
364
372
|
day: U,
|
|
365
373
|
date: se,
|
|
@@ -369,41 +377,41 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
369
377
|
});
|
|
370
378
|
}
|
|
371
379
|
return ee;
|
|
372
|
-
}), H = (
|
|
373
|
-
const
|
|
380
|
+
}), H = (h) => {
|
|
381
|
+
const M = h.getDate().toString().padStart(2, "0"), T = (h.getMonth() + 1).toString().padStart(2, "0"), E = h.getFullYear();
|
|
374
382
|
switch (e.dateFormat) {
|
|
375
383
|
case "MM/DD/YYYY":
|
|
376
|
-
return `${
|
|
384
|
+
return `${T}/${M}/${E}`;
|
|
377
385
|
case "YYYY-MM-DD":
|
|
378
|
-
return `${E}-${
|
|
386
|
+
return `${E}-${T}-${M}`;
|
|
379
387
|
case "DD/MM/YYYY":
|
|
380
388
|
default:
|
|
381
|
-
return `${
|
|
389
|
+
return `${M}/${T}/${E}`;
|
|
382
390
|
}
|
|
383
|
-
},
|
|
384
|
-
var
|
|
385
|
-
const
|
|
391
|
+
}, xe = (h) => {
|
|
392
|
+
var T;
|
|
393
|
+
const M = new Date(h.getFullYear(), h.getMonth(), h.getDate());
|
|
386
394
|
if (e.minDate) {
|
|
387
395
|
const E = new Date(e.minDate.getFullYear(), e.minDate.getMonth(), e.minDate.getDate());
|
|
388
|
-
if (
|
|
396
|
+
if (M < E) return !0;
|
|
389
397
|
}
|
|
390
398
|
if (e.maxDate) {
|
|
391
399
|
const E = new Date(e.maxDate.getFullYear(), e.maxDate.getMonth(), e.maxDate.getDate());
|
|
392
|
-
if (
|
|
400
|
+
if (M > E) return !0;
|
|
393
401
|
}
|
|
394
|
-
return !!((
|
|
395
|
-
(E) => E.toDateString() ===
|
|
402
|
+
return !!((T = e.disabledDates) != null && T.some(
|
|
403
|
+
(E) => E.toDateString() === h.toDateString()
|
|
396
404
|
));
|
|
397
|
-
}, Ie = (
|
|
398
|
-
const
|
|
399
|
-
if (
|
|
400
|
-
return `${
|
|
401
|
-
const
|
|
405
|
+
}, Ie = (h) => {
|
|
406
|
+
const M = "w-8 h-8 text-sm rounded-md transition-colors focus:outline-none";
|
|
407
|
+
if (h.disabled || xe(h.date))
|
|
408
|
+
return `${M} text-secondary-400 cursor-not-allowed`;
|
|
409
|
+
const T = je(h.date), E = Le(h.date), ee = Oe(h.date), ae = {
|
|
402
410
|
primary: {
|
|
403
411
|
selected: "bg-primary-600 text-white",
|
|
404
412
|
inRange: "bg-primary-100 text-primary-900",
|
|
405
|
-
today: "bg-primary-50 text-primary-
|
|
406
|
-
default: "text-secondary-700 hover:bg-primary-50 hover:text-primary-
|
|
413
|
+
today: "bg-primary-50 text-primary-500 border border-primary-300",
|
|
414
|
+
default: "text-secondary-700 hover:bg-primary-50 hover:text-primary-500",
|
|
407
415
|
otherMonth: "text-secondary-400 hover:bg-primary-50 hover:text-primary-600"
|
|
408
416
|
},
|
|
409
417
|
secondary: {
|
|
@@ -414,68 +422,68 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
414
422
|
otherMonth: "text-secondary-400 hover:bg-secondary-50 hover:text-secondary-600"
|
|
415
423
|
}
|
|
416
424
|
};
|
|
417
|
-
return
|
|
418
|
-
}, je = (
|
|
419
|
-
if (e.mode !== "range" || !
|
|
425
|
+
return T ? `${M} ${ae[e.color].selected}` : E ? `${M} ${ae[e.color].inRange}` : ee ? `${M} ${ae[e.color].today}` : h.isCurrentMonth ? `${M} ${ae[e.color].default}` : `${M} ${ae[e.color].otherMonth}`;
|
|
426
|
+
}, je = (h) => e.mode === "single" ? w.value ? oe(h, w.value) : !1 : e.mode === "multiple" ? m.value.some((M) => oe(h, M)) : !!(w.value && oe(h, w.value)) || !!(g.value && oe(h, g.value)), Le = (h) => {
|
|
427
|
+
if (e.mode !== "range" || !w.value || !g.value)
|
|
420
428
|
return !1;
|
|
421
|
-
const
|
|
422
|
-
return
|
|
423
|
-
}, Oe = (
|
|
424
|
-
e.disabled ||
|
|
425
|
-
},
|
|
426
|
-
e.disabled ||
|
|
427
|
-
},
|
|
428
|
-
e.disabled ||
|
|
429
|
-
},
|
|
430
|
-
e.disabled || (ue(
|
|
431
|
-
},
|
|
432
|
-
e.disabled || (ue(
|
|
433
|
-
},
|
|
434
|
-
e.disabled || (ue(
|
|
435
|
-
}, ue = (
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
e.disabled || (
|
|
429
|
+
const M = w.value, T = g.value;
|
|
430
|
+
return h > M && h < T;
|
|
431
|
+
}, Oe = (h) => oe(h, /* @__PURE__ */ new Date()), oe = (h, M) => h.toDateString() === M.toDateString(), we = () => {
|
|
432
|
+
e.disabled || f.value || ne();
|
|
433
|
+
}, ke = () => {
|
|
434
|
+
e.disabled || f.value || ne();
|
|
435
|
+
}, Ce = () => {
|
|
436
|
+
e.disabled || Me();
|
|
437
|
+
}, $e = (h) => {
|
|
438
|
+
e.disabled || (ue(h), f.value || ne());
|
|
439
|
+
}, Be = (h) => {
|
|
440
|
+
e.disabled || (ue(h), f.value || ne());
|
|
441
|
+
}, ze = (h) => {
|
|
442
|
+
e.disabled || (ue(h), Me());
|
|
443
|
+
}, ue = (h) => {
|
|
444
|
+
p.value = h;
|
|
445
|
+
}, Me = () => {
|
|
446
|
+
e.disabled || (f.value = !f.value, f.value && fe());
|
|
439
447
|
}, ne = () => {
|
|
440
|
-
e.disabled || (
|
|
448
|
+
e.disabled || (f.value = !0, fe());
|
|
441
449
|
}, ce = () => {
|
|
442
|
-
|
|
450
|
+
f.value = !1, p.value = null;
|
|
443
451
|
}, fe = () => {
|
|
444
|
-
e.mode === "single" ? (
|
|
445
|
-
}, Ae = (
|
|
452
|
+
e.mode === "single" ? (w.value = e.modelValue instanceof Date ? e.modelValue : null, g.value = null) : e.mode === "multiple" ? m.value = Array.isArray(e.modelValue) ? [...e.modelValue] : [] : e.modelValue && typeof e.modelValue == "object" && "start" in e.modelValue ? (w.value = e.modelValue.start, g.value = e.modelValue.end) : (w.value = null, g.value = null);
|
|
453
|
+
}, Ae = (h) => {
|
|
446
454
|
if (e.mode === "single")
|
|
447
|
-
|
|
455
|
+
w.value = h, g.value = null;
|
|
448
456
|
else if (e.mode === "multiple") {
|
|
449
|
-
const
|
|
450
|
-
|
|
457
|
+
const M = m.value.findIndex((T) => oe(T, h));
|
|
458
|
+
M >= 0 ? m.value.splice(M, 1) : m.value.push(h);
|
|
451
459
|
} else
|
|
452
|
-
|
|
460
|
+
p.value === "start" || !w.value ? (w.value = h, g.value = null, p.value = "end") : (p.value === "end" || !g.value) && (h < w.value ? (g.value = w.value, w.value = h) : g.value = h, p.value = null);
|
|
453
461
|
}, Fe = () => {
|
|
454
462
|
if (e.mode === "single")
|
|
455
|
-
|
|
463
|
+
o("update:modelValue", w.value), w.value && o("date-select", w.value);
|
|
456
464
|
else if (e.mode === "multiple") {
|
|
457
|
-
const
|
|
458
|
-
|
|
465
|
+
const h = [...m.value].sort((M, T) => M.getTime() - T.getTime());
|
|
466
|
+
o("update:modelValue", h), o("multiple-select", h);
|
|
459
467
|
} else {
|
|
460
|
-
const
|
|
461
|
-
|
|
468
|
+
const h = { start: w.value, end: g.value };
|
|
469
|
+
o("update:modelValue", h), o("range-select", h);
|
|
462
470
|
}
|
|
463
471
|
ce();
|
|
464
472
|
}, We = () => {
|
|
465
|
-
|
|
473
|
+
i.value === 0 ? (i.value = 11, v.value--) : i.value--;
|
|
466
474
|
}, qe = () => {
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
}, pe =
|
|
470
|
-
pe.value && !pe.value.contains(
|
|
475
|
+
i.value === 11 ? (i.value = 0, v.value++) : i.value++;
|
|
476
|
+
}, De = () => {
|
|
477
|
+
}, pe = P(), Ve = (h) => {
|
|
478
|
+
pe.value && !pe.value.contains(h.target) && ce();
|
|
471
479
|
};
|
|
472
|
-
return
|
|
473
|
-
document.addEventListener("click",
|
|
474
|
-
}),
|
|
475
|
-
document.removeEventListener("click",
|
|
476
|
-
}), de(() => e.modelValue, (
|
|
477
|
-
|
|
478
|
-
}, { deep: !0 }), (
|
|
480
|
+
return be(() => {
|
|
481
|
+
document.addEventListener("click", Ve);
|
|
482
|
+
}), ge(() => {
|
|
483
|
+
document.removeEventListener("click", Ve);
|
|
484
|
+
}), de(() => e.modelValue, (h) => {
|
|
485
|
+
f.value || fe();
|
|
486
|
+
}, { deep: !0 }), (h, M) => (l(), a("div", {
|
|
479
487
|
ref_key: "calendarWrapperRef",
|
|
480
488
|
ref: pe,
|
|
481
489
|
class: "calendar-wrapper"
|
|
@@ -484,35 +492,35 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
484
492
|
t.label && t.showLabel ? (l(), a("label", {
|
|
485
493
|
key: 0,
|
|
486
494
|
for: z.value,
|
|
487
|
-
class:
|
|
495
|
+
class: n(O.value)
|
|
488
496
|
}, [
|
|
489
|
-
Y(
|
|
490
|
-
t.required ? (l(), a("span", at, "*")) :
|
|
491
|
-
], 10, lt)) :
|
|
497
|
+
Y(D(t.label) + " ", 1),
|
|
498
|
+
t.required ? (l(), a("span", at, "*")) : c("", !0)
|
|
499
|
+
], 10, lt)) : c("", !0),
|
|
492
500
|
s("div", {
|
|
493
|
-
class:
|
|
501
|
+
class: n(["relative rounded-md", q.value])
|
|
494
502
|
}, [
|
|
495
503
|
s("input", {
|
|
496
504
|
id: z.value,
|
|
497
|
-
class:
|
|
505
|
+
class: n(S.value),
|
|
498
506
|
type: "text",
|
|
499
507
|
disabled: t.disabled,
|
|
500
508
|
placeholder: t.placeholder || "Seleccionar fecha",
|
|
501
|
-
value:
|
|
509
|
+
value: $.value,
|
|
502
510
|
required: t.required,
|
|
503
511
|
readonly: !0,
|
|
504
|
-
onClick:
|
|
505
|
-
onFocus:
|
|
512
|
+
onClick: we,
|
|
513
|
+
onFocus: ke
|
|
506
514
|
}, null, 42, st),
|
|
507
515
|
s("button", {
|
|
508
516
|
type: "button",
|
|
509
|
-
class:
|
|
510
|
-
onClick: J(
|
|
517
|
+
class: n(["absolute right-3 top-1/2 -translate-y-1/2", I.value]),
|
|
518
|
+
onClick: J(Ce, ["stop"]),
|
|
511
519
|
disabled: t.disabled
|
|
512
520
|
}, [
|
|
513
521
|
Q(_, {
|
|
514
522
|
name: t.iconName,
|
|
515
|
-
size:
|
|
523
|
+
size: F.value
|
|
516
524
|
}, null, 8, ["name", "size"])
|
|
517
525
|
], 10, ot)
|
|
518
526
|
], 2)
|
|
@@ -520,113 +528,113 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
520
528
|
t.label && t.showLabel ? (l(), a("label", {
|
|
521
529
|
key: 0,
|
|
522
530
|
for: z.value,
|
|
523
|
-
class:
|
|
531
|
+
class: n(O.value)
|
|
524
532
|
}, [
|
|
525
|
-
Y(
|
|
526
|
-
t.required ? (l(), a("span", it, "*")) :
|
|
527
|
-
], 10, nt)) :
|
|
533
|
+
Y(D(t.label) + " ", 1),
|
|
534
|
+
t.required ? (l(), a("span", it, "*")) : c("", !0)
|
|
535
|
+
], 10, nt)) : c("", !0),
|
|
528
536
|
s("div", {
|
|
529
|
-
class:
|
|
537
|
+
class: n(["relative rounded-md", q.value])
|
|
530
538
|
}, [
|
|
531
539
|
s("input", {
|
|
532
540
|
id: z.value,
|
|
533
|
-
class:
|
|
541
|
+
class: n(S.value),
|
|
534
542
|
type: "text",
|
|
535
543
|
disabled: t.disabled,
|
|
536
544
|
placeholder: t.placeholder || "Seleccionar fechas",
|
|
537
|
-
value:
|
|
545
|
+
value: d.value,
|
|
538
546
|
required: t.required,
|
|
539
547
|
readonly: !0,
|
|
540
|
-
onClick:
|
|
541
|
-
onFocus:
|
|
548
|
+
onClick: we,
|
|
549
|
+
onFocus: ke
|
|
542
550
|
}, null, 42, dt),
|
|
543
551
|
s("button", {
|
|
544
552
|
type: "button",
|
|
545
|
-
class:
|
|
546
|
-
onClick: J(
|
|
553
|
+
class: n(["absolute right-3 top-1/2 -translate-y-1/2", I.value]),
|
|
554
|
+
onClick: J(Ce, ["stop"]),
|
|
547
555
|
disabled: t.disabled
|
|
548
556
|
}, [
|
|
549
557
|
Q(_, {
|
|
550
558
|
name: t.iconName,
|
|
551
|
-
size:
|
|
559
|
+
size: F.value
|
|
552
560
|
}, null, 8, ["name", "size"])
|
|
553
561
|
], 10, ut)
|
|
554
562
|
], 2)
|
|
555
563
|
])) : (l(), a("div", ct, [
|
|
556
564
|
t.label && t.showLabel ? (l(), a("label", {
|
|
557
565
|
key: 0,
|
|
558
|
-
class:
|
|
566
|
+
class: n(O.value)
|
|
559
567
|
}, [
|
|
560
|
-
Y(
|
|
561
|
-
t.required ? (l(), a("span", ft, "*")) :
|
|
562
|
-
], 2)) :
|
|
568
|
+
Y(D(t.label) + " ", 1),
|
|
569
|
+
t.required ? (l(), a("span", ft, "*")) : c("", !0)
|
|
570
|
+
], 2)) : c("", !0),
|
|
563
571
|
s("div", pt, [
|
|
564
572
|
s("div", {
|
|
565
|
-
class:
|
|
573
|
+
class: n(["relative rounded-md", q.value])
|
|
566
574
|
}, [
|
|
567
575
|
s("input", {
|
|
568
|
-
class:
|
|
576
|
+
class: n(S.value),
|
|
569
577
|
type: "text",
|
|
570
578
|
disabled: t.disabled,
|
|
571
579
|
placeholder: t.startPlaceholder || "Fecha desde",
|
|
572
|
-
value:
|
|
580
|
+
value: V.value,
|
|
573
581
|
required: t.required,
|
|
574
582
|
readonly: !0,
|
|
575
|
-
onClick:
|
|
576
|
-
onFocus:
|
|
577
|
-
}, null, 42,
|
|
583
|
+
onClick: M[0] || (M[0] = () => $e("start")),
|
|
584
|
+
onFocus: M[1] || (M[1] = () => Be("start"))
|
|
585
|
+
}, null, 42, mt),
|
|
578
586
|
s("button", {
|
|
579
587
|
type: "button",
|
|
580
|
-
class:
|
|
581
|
-
onClick:
|
|
588
|
+
class: n(["absolute right-3 top-1/2 -translate-y-1/2", I.value]),
|
|
589
|
+
onClick: M[2] || (M[2] = J(() => ze("start"), ["stop"])),
|
|
582
590
|
disabled: t.disabled
|
|
583
591
|
}, [
|
|
584
592
|
Q(_, {
|
|
585
593
|
name: t.startIconName,
|
|
586
|
-
size:
|
|
594
|
+
size: F.value
|
|
587
595
|
}, null, 8, ["name", "size"])
|
|
588
|
-
], 10,
|
|
596
|
+
], 10, vt)
|
|
589
597
|
], 2),
|
|
590
598
|
s("div", {
|
|
591
|
-
class:
|
|
599
|
+
class: n(["relative rounded-md", q.value])
|
|
592
600
|
}, [
|
|
593
601
|
s("input", {
|
|
594
|
-
class:
|
|
602
|
+
class: n(S.value),
|
|
595
603
|
type: "text",
|
|
596
604
|
disabled: t.disabled,
|
|
597
605
|
placeholder: t.endPlaceholder || "Fecha hasta",
|
|
598
606
|
value: x.value,
|
|
599
607
|
required: t.required,
|
|
600
608
|
readonly: !0,
|
|
601
|
-
onClick:
|
|
602
|
-
onFocus:
|
|
603
|
-
}, null, 42,
|
|
609
|
+
onClick: M[3] || (M[3] = () => $e("end")),
|
|
610
|
+
onFocus: M[4] || (M[4] = () => Be("end"))
|
|
611
|
+
}, null, 42, bt),
|
|
604
612
|
s("button", {
|
|
605
613
|
type: "button",
|
|
606
|
-
class:
|
|
607
|
-
onClick:
|
|
614
|
+
class: n(["absolute right-3 top-1/2 -translate-y-1/2", I.value]),
|
|
615
|
+
onClick: M[5] || (M[5] = J(() => ze("end"), ["stop"])),
|
|
608
616
|
disabled: t.disabled
|
|
609
617
|
}, [
|
|
610
618
|
Q(_, {
|
|
611
619
|
name: t.endIconName,
|
|
612
|
-
size:
|
|
620
|
+
size: F.value
|
|
613
621
|
}, null, 8, ["name", "size"])
|
|
614
|
-
], 10,
|
|
622
|
+
], 10, gt)
|
|
615
623
|
], 2)
|
|
616
624
|
])
|
|
617
625
|
])),
|
|
618
|
-
t.error ? (l(), a("p", yt,
|
|
619
|
-
|
|
626
|
+
t.error ? (l(), a("p", yt, D(t.error), 1)) : t.helperText ? (l(), a("p", ht, D(t.helperText), 1)) : c("", !0),
|
|
627
|
+
f.value ? (l(), a("div", {
|
|
620
628
|
key: 5,
|
|
621
|
-
class:
|
|
622
|
-
onClick:
|
|
629
|
+
class: n(["absolute top-full mt-1 left-0 bg-white rounded-lg shadow-lg border border-secondary-200 z-50 overflow-hidden p-4", W.value]),
|
|
630
|
+
onClick: M[8] || (M[8] = J(() => {
|
|
623
631
|
}, ["stop"]))
|
|
624
632
|
}, [
|
|
625
633
|
s("div", xt, [
|
|
626
634
|
s("button", {
|
|
627
635
|
type: "button",
|
|
628
636
|
onClick: We,
|
|
629
|
-
class:
|
|
637
|
+
class: n(A.value)
|
|
630
638
|
}, [
|
|
631
639
|
Q(_, {
|
|
632
640
|
name: "chevron-left",
|
|
@@ -634,35 +642,35 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
634
642
|
})
|
|
635
643
|
], 2),
|
|
636
644
|
s("div", wt, [
|
|
637
|
-
|
|
638
|
-
"onUpdate:modelValue":
|
|
639
|
-
class:
|
|
640
|
-
onChange:
|
|
645
|
+
me(s("select", {
|
|
646
|
+
"onUpdate:modelValue": M[6] || (M[6] = (T) => i.value = T),
|
|
647
|
+
class: n(k.value),
|
|
648
|
+
onChange: De
|
|
641
649
|
}, [
|
|
642
|
-
(l(), a(K, null, G(
|
|
650
|
+
(l(), a(K, null, G(B, (T, E) => s("option", {
|
|
643
651
|
key: E,
|
|
644
652
|
value: E
|
|
645
|
-
},
|
|
653
|
+
}, D(T), 9, kt)), 64))
|
|
646
654
|
], 34), [
|
|
647
|
-
[
|
|
655
|
+
[Te, i.value]
|
|
648
656
|
]),
|
|
649
|
-
|
|
650
|
-
"onUpdate:modelValue":
|
|
651
|
-
class:
|
|
652
|
-
onChange:
|
|
657
|
+
me(s("select", {
|
|
658
|
+
"onUpdate:modelValue": M[7] || (M[7] = (T) => v.value = T),
|
|
659
|
+
class: n(k.value),
|
|
660
|
+
onChange: De
|
|
653
661
|
}, [
|
|
654
|
-
(l(!0), a(K, null, G(
|
|
655
|
-
key:
|
|
656
|
-
value:
|
|
657
|
-
},
|
|
662
|
+
(l(!0), a(K, null, G(j.value, (T) => (l(), a("option", {
|
|
663
|
+
key: T,
|
|
664
|
+
value: T
|
|
665
|
+
}, D(T), 9, Ct))), 128))
|
|
658
666
|
], 34), [
|
|
659
|
-
[
|
|
667
|
+
[Te, v.value]
|
|
660
668
|
])
|
|
661
669
|
]),
|
|
662
670
|
s("button", {
|
|
663
671
|
type: "button",
|
|
664
672
|
onClick: qe,
|
|
665
|
-
class:
|
|
673
|
+
class: n(A.value)
|
|
666
674
|
}, [
|
|
667
675
|
Q(_, {
|
|
668
676
|
name: "chevron-right",
|
|
@@ -671,43 +679,37 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
671
679
|
], 2)
|
|
672
680
|
]),
|
|
673
681
|
s("div", $t, [
|
|
674
|
-
(l(), a(K, null, G(
|
|
675
|
-
key:
|
|
682
|
+
(l(), a(K, null, G(C, (T) => s("div", {
|
|
683
|
+
key: T,
|
|
676
684
|
class: "text-center text-sm font-medium text-secondary-600 py-2"
|
|
677
|
-
},
|
|
685
|
+
}, D(T), 1)), 64))
|
|
678
686
|
]),
|
|
679
687
|
s("div", Bt, [
|
|
680
|
-
(l(!0), a(K, null, G(R.value, (
|
|
681
|
-
key:
|
|
688
|
+
(l(!0), a(K, null, G(R.value, (T) => (l(), a("button", {
|
|
689
|
+
key: T.key,
|
|
682
690
|
type: "button",
|
|
683
|
-
class:
|
|
684
|
-
disabled:
|
|
685
|
-
onClick: (E) => Ae(
|
|
686
|
-
},
|
|
691
|
+
class: n(Ie(T)),
|
|
692
|
+
disabled: T.disabled || xe(T.date),
|
|
693
|
+
onClick: (E) => Ae(T.date)
|
|
694
|
+
}, D(T.day), 11, zt))), 128))
|
|
687
695
|
]),
|
|
688
696
|
s("div", Mt, [
|
|
689
697
|
s("button", {
|
|
690
698
|
type: "button",
|
|
691
|
-
class:
|
|
699
|
+
class: n(u.value),
|
|
692
700
|
onClick: ce
|
|
693
701
|
}, " Cancelar ", 2),
|
|
694
702
|
s("button", {
|
|
695
703
|
type: "button",
|
|
696
|
-
class:
|
|
704
|
+
class: n(y.value),
|
|
697
705
|
onClick: Fe,
|
|
698
706
|
disabled: !le.value
|
|
699
707
|
}, " Confirmar ", 10, Dt)
|
|
700
708
|
])
|
|
701
|
-
], 2)) :
|
|
709
|
+
], 2)) : c("", !0)
|
|
702
710
|
], 512));
|
|
703
711
|
}
|
|
704
|
-
}),
|
|
705
|
-
key: 0,
|
|
706
|
-
class: "border-b border-gray-100 px-6 py-4"
|
|
707
|
-
}, It = { class: "px-6 py-4" }, jt = {
|
|
708
|
-
key: 1,
|
|
709
|
-
class: "border-t border-gray-100 px-6 py-4 bg-gray-50"
|
|
710
|
-
}, Ga = /* @__PURE__ */ N({
|
|
712
|
+
}), Ya = /* @__PURE__ */ Z(Vt, [["__scopeId", "data-v-18f461f5"]]), Tt = ["role", "tabindex"], Na = /* @__PURE__ */ N({
|
|
711
713
|
__name: "Card",
|
|
712
714
|
props: {
|
|
713
715
|
shadow: { default: "md" },
|
|
@@ -715,60 +717,69 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
715
717
|
bordered: { type: Boolean, default: !1 },
|
|
716
718
|
hoverable: { type: Boolean, default: !1 },
|
|
717
719
|
clickable: { type: Boolean, default: !1 },
|
|
718
|
-
disabled: { type: Boolean, default: !1 }
|
|
720
|
+
disabled: { type: Boolean, default: !1 },
|
|
721
|
+
compact: { type: Boolean, default: !1 }
|
|
719
722
|
},
|
|
720
723
|
emits: ["click"],
|
|
721
|
-
setup(t, { emit:
|
|
722
|
-
const e = t,
|
|
724
|
+
setup(t, { emit: b }) {
|
|
725
|
+
const e = t, m = b, o = {
|
|
723
726
|
none: "",
|
|
724
727
|
sm: "shadow-sm",
|
|
725
728
|
md: "shadow",
|
|
726
729
|
lg: "shadow-lg",
|
|
727
730
|
xl: "shadow-xl"
|
|
728
|
-
},
|
|
731
|
+
}, f = {
|
|
729
732
|
none: "rounded-none",
|
|
730
733
|
sm: "rounded-sm",
|
|
731
734
|
md: "rounded-md",
|
|
732
735
|
lg: "rounded-lg",
|
|
733
736
|
xl: "rounded-xl",
|
|
734
737
|
full: "rounded-full"
|
|
735
|
-
},
|
|
738
|
+
}, p = r(() => [
|
|
736
739
|
"w-full bg-white",
|
|
737
|
-
|
|
738
|
-
|
|
740
|
+
o[e.shadow],
|
|
741
|
+
f[e.rounded],
|
|
739
742
|
e.bordered ? "border border-gray-200" : "",
|
|
740
743
|
e.hoverable || e.clickable ? "transition-all duration-200" : "",
|
|
741
744
|
e.hoverable ? "hover:shadow-lg" : "",
|
|
742
745
|
e.clickable && !e.disabled ? "cursor-pointer hover:shadow-lg" : "",
|
|
743
746
|
e.clickable && e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
744
|
-
]),
|
|
745
|
-
!e.disabled && e.clickable &&
|
|
747
|
+
]), i = (v) => {
|
|
748
|
+
!e.disabled && e.clickable && m("click", v);
|
|
746
749
|
};
|
|
747
|
-
return (
|
|
748
|
-
class:
|
|
750
|
+
return (v, z) => (l(), a("div", {
|
|
751
|
+
class: n(p.value),
|
|
749
752
|
role: t.clickable ? "button" : void 0,
|
|
750
753
|
tabindex: t.clickable ? 0 : void 0,
|
|
751
|
-
onClick:
|
|
754
|
+
onClick: i,
|
|
752
755
|
onKeydown: [
|
|
753
|
-
|
|
754
|
-
|
|
756
|
+
Se(i, ["enter"]),
|
|
757
|
+
Se(i, ["space"])
|
|
755
758
|
]
|
|
756
759
|
}, [
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
]),
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
760
|
+
v.$slots.header ? (l(), a("div", {
|
|
761
|
+
key: 0,
|
|
762
|
+
class: n([e.compact ? "px-4 py-2" : "px-6 py-4", "border-b border-gray-100"])
|
|
763
|
+
}, [
|
|
764
|
+
L(v.$slots, "header")
|
|
765
|
+
], 2)) : c("", !0),
|
|
766
|
+
s("div", {
|
|
767
|
+
class: n(e.compact ? "px-4 py-2" : "px-6 py-4")
|
|
768
|
+
}, [
|
|
769
|
+
L(v.$slots, "default")
|
|
770
|
+
], 2),
|
|
771
|
+
v.$slots.footer ? (l(), a("div", {
|
|
772
|
+
key: 1,
|
|
773
|
+
class: n([e.compact ? "px-4 py-2" : "px-6 py-4", "border-t border-gray-100 bg-gray-50"])
|
|
774
|
+
}, [
|
|
775
|
+
L(v.$slots, "footer")
|
|
776
|
+
], 2)) : c("", !0)
|
|
766
777
|
], 42, Tt));
|
|
767
778
|
}
|
|
768
|
-
}),
|
|
779
|
+
}), St = { class: "flex items-center justify-between border-b border-gray-100/60 px-8 py-6" }, It = { class: "text-xl font-semibold text-gray-900" }, jt = ["disabled"], Lt = { class: "px-8 py-6" }, Ot = {
|
|
769
780
|
key: 0,
|
|
770
781
|
class: "absolute inset-0 flex items-center justify-center bg-white/50 rounded-lg"
|
|
771
|
-
},
|
|
782
|
+
}, At = /* @__PURE__ */ N({
|
|
772
783
|
__name: "Dialog",
|
|
773
784
|
props: {
|
|
774
785
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -778,37 +789,37 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
778
789
|
loading: { type: Boolean, default: !1 }
|
|
779
790
|
},
|
|
780
791
|
emits: ["update:modelValue", "close"],
|
|
781
|
-
setup(t, { emit:
|
|
782
|
-
const e = t,
|
|
792
|
+
setup(t, { emit: b }) {
|
|
793
|
+
const e = t, m = b, o = r({
|
|
783
794
|
get: () => e.modelValue,
|
|
784
|
-
set: (
|
|
785
|
-
}),
|
|
795
|
+
set: (v) => m("update:modelValue", v)
|
|
796
|
+
}), f = r(() => ({
|
|
786
797
|
sm: "sm:max-w-sm",
|
|
787
798
|
md: "sm:max-w-lg md:max-w-2xl",
|
|
788
799
|
lg: "sm:max-w-2xl md:max-w-4xl",
|
|
789
800
|
xl: "sm:max-w-4xl md:max-w-6xl"
|
|
790
|
-
})[e.size]),
|
|
791
|
-
e.loading || (
|
|
792
|
-
},
|
|
793
|
-
e.closeOnBackdrop && !e.loading &&
|
|
801
|
+
})[e.size]), p = () => {
|
|
802
|
+
e.loading || (o.value = !1, m("close"));
|
|
803
|
+
}, i = () => {
|
|
804
|
+
e.closeOnBackdrop && !e.loading && p();
|
|
794
805
|
};
|
|
795
|
-
return (
|
|
806
|
+
return (v, z) => (l(), te(ye, { to: "body" }, [
|
|
796
807
|
Q(ie, { name: "dialog" }, {
|
|
797
808
|
default: re(() => [
|
|
798
|
-
|
|
809
|
+
o.value ? (l(), a("div", {
|
|
799
810
|
key: 0,
|
|
800
811
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",
|
|
801
|
-
onClick:
|
|
812
|
+
onClick: i
|
|
802
813
|
}, [
|
|
803
814
|
s("div", {
|
|
804
|
-
class:
|
|
815
|
+
class: n(["relative w-full rounded-lg bg-white shadow-xl", f.value]),
|
|
805
816
|
onClick: z[0] || (z[0] = J(() => {
|
|
806
817
|
}, ["stop"]))
|
|
807
818
|
}, [
|
|
808
|
-
s("div",
|
|
809
|
-
s("h2",
|
|
810
|
-
|
|
811
|
-
Y(
|
|
819
|
+
s("div", St, [
|
|
820
|
+
s("h2", It, [
|
|
821
|
+
L(v.$slots, "title", {}, () => [
|
|
822
|
+
Y(D(t.title), 1)
|
|
812
823
|
], !0)
|
|
813
824
|
]),
|
|
814
825
|
s("button", {
|
|
@@ -816,7 +827,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
816
827
|
class: "inline-flex items-center justify-center rounded-md p-1 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
817
828
|
"aria-label": "Cerrar diálogo",
|
|
818
829
|
disabled: t.loading,
|
|
819
|
-
onClick:
|
|
830
|
+
onClick: p
|
|
820
831
|
}, [...z[1] || (z[1] = [
|
|
821
832
|
s("svg", {
|
|
822
833
|
class: "h-6 w-6",
|
|
@@ -831,12 +842,12 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
831
842
|
d: "M6 18L18 6M6 6l12 12"
|
|
832
843
|
})
|
|
833
844
|
], -1)
|
|
834
|
-
])], 8,
|
|
845
|
+
])], 8, jt)
|
|
835
846
|
]),
|
|
836
|
-
s("div",
|
|
837
|
-
|
|
847
|
+
s("div", Lt, [
|
|
848
|
+
L(v.$slots, "default", {}, void 0, !0)
|
|
838
849
|
]),
|
|
839
|
-
t.loading ? (l(), a("div",
|
|
850
|
+
t.loading ? (l(), a("div", Ot, [...z[2] || (z[2] = [
|
|
840
851
|
s("div", { class: "flex items-center gap-2 text-primary-600" }, [
|
|
841
852
|
s("svg", {
|
|
842
853
|
class: "w-5 h-5 animate-spin",
|
|
@@ -860,33 +871,33 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
860
871
|
]),
|
|
861
872
|
s("span", { class: "text-sm font-medium" }, "Cargando...")
|
|
862
873
|
], -1)
|
|
863
|
-
])])) :
|
|
864
|
-
|
|
874
|
+
])])) : c("", !0),
|
|
875
|
+
v.$slots.footer ? (l(), a("div", {
|
|
865
876
|
key: 1,
|
|
866
|
-
class:
|
|
877
|
+
class: n(["border-t border-gray-100 px-8 py-6 bg-gray-50", { "opacity-50 pointer-events-none": t.loading }])
|
|
867
878
|
}, [
|
|
868
|
-
|
|
869
|
-
], 2)) :
|
|
879
|
+
L(v.$slots, "footer", {}, void 0, !0)
|
|
880
|
+
], 2)) : c("", !0)
|
|
870
881
|
], 2)
|
|
871
|
-
])) :
|
|
882
|
+
])) : c("", !0)
|
|
872
883
|
]),
|
|
873
884
|
_: 3
|
|
874
885
|
})
|
|
875
886
|
]));
|
|
876
887
|
}
|
|
877
|
-
}),
|
|
888
|
+
}), Ha = /* @__PURE__ */ Z(At, [["__scopeId", "data-v-ea6db288"]]), Ft = ["accept", "multiple", "disabled"], Wt = { class: "flex flex-col items-center justify-center gap-4 text-center" }, qt = ["src", "alt"], Pt = {
|
|
878
889
|
key: 1,
|
|
879
890
|
class: "w-full h-full text-gray-400",
|
|
880
891
|
fill: "none",
|
|
881
892
|
stroke: "currentColor",
|
|
882
893
|
viewBox: "0 0 24 24"
|
|
883
|
-
},
|
|
894
|
+
}, Rt = { class: "text-center" }, Et = { class: "text-base font-medium text-gray-700" }, Yt = { class: "text-primary-500" }, Nt = { class: "flex items-center gap-3 flex-1 min-w-0" }, Ht = { class: "flex-1 min-w-0" }, Kt = { class: "text-sm font-medium text-gray-900 truncate" }, Ut = { class: "text-xs text-gray-500" }, Jt = {
|
|
884
895
|
key: 1,
|
|
885
896
|
class: "text-xs text-gray-500 mt-2"
|
|
886
|
-
},
|
|
897
|
+
}, Gt = {
|
|
887
898
|
key: 2,
|
|
888
899
|
class: "text-sm text-danger-500 mt-2"
|
|
889
|
-
},
|
|
900
|
+
}, Ka = /* @__PURE__ */ N({
|
|
890
901
|
__name: "FileUpload",
|
|
891
902
|
props: {
|
|
892
903
|
modelValue: { default: null },
|
|
@@ -908,73 +919,73 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
908
919
|
progress: { default: 0 }
|
|
909
920
|
},
|
|
910
921
|
emits: ["update:modelValue", "change", "error"],
|
|
911
|
-
setup(t, { emit:
|
|
912
|
-
const e = t,
|
|
922
|
+
setup(t, { emit: b }) {
|
|
923
|
+
const e = t, m = b, o = P(null), f = P(!1), p = P(e.modelValue), i = P(""), v = r(() => ({
|
|
913
924
|
sm: "w-20 h-20",
|
|
914
925
|
md: "w-32 h-32",
|
|
915
926
|
lg: "w-48 h-48",
|
|
916
927
|
xl: "w-64 h-64"
|
|
917
928
|
})[e.illustrationSize]), z = () => {
|
|
918
|
-
var
|
|
919
|
-
(
|
|
920
|
-
},
|
|
929
|
+
var S;
|
|
930
|
+
(S = o.value) == null || S.click();
|
|
931
|
+
}, w = () => {
|
|
921
932
|
e.disabled || z();
|
|
922
|
-
},
|
|
923
|
-
e.disabled || (
|
|
924
|
-
},
|
|
925
|
-
|
|
926
|
-
},
|
|
927
|
-
if (
|
|
928
|
-
const
|
|
929
|
-
return
|
|
933
|
+
}, g = (S) => {
|
|
934
|
+
e.disabled || (f.value = !0);
|
|
935
|
+
}, B = () => {
|
|
936
|
+
f.value = !1;
|
|
937
|
+
}, C = (S) => {
|
|
938
|
+
if (i.value = "", e.maxSize && S.size > e.maxSize) {
|
|
939
|
+
const I = (e.maxSize / 1048576).toFixed(2);
|
|
940
|
+
return i.value = `El archivo excede el tamaño máximo de ${I}MB`, m("error", i.value), !1;
|
|
930
941
|
}
|
|
931
942
|
return !0;
|
|
932
|
-
},
|
|
933
|
-
var
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
},
|
|
937
|
-
var
|
|
938
|
-
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
},
|
|
942
|
-
|
|
943
|
-
},
|
|
944
|
-
if (
|
|
945
|
-
const
|
|
946
|
-
return Math.round(
|
|
943
|
+
}, F = (S) => {
|
|
944
|
+
var A;
|
|
945
|
+
const W = (A = S.target.files) == null ? void 0 : A[0];
|
|
946
|
+
W && C(W) && (p.value = W, m("update:modelValue", W), m("change", W));
|
|
947
|
+
}, j = (S) => {
|
|
948
|
+
var W;
|
|
949
|
+
f.value = !1;
|
|
950
|
+
const I = (W = S.dataTransfer) == null ? void 0 : W.files[0];
|
|
951
|
+
I && C(I) && (p.value = I, m("update:modelValue", I), m("change", I));
|
|
952
|
+
}, O = () => {
|
|
953
|
+
p.value = null, i.value = "", o.value && (o.value.value = ""), m("update:modelValue", null), m("change", null);
|
|
954
|
+
}, q = (S) => {
|
|
955
|
+
if (S === 0) return "0 Bytes";
|
|
956
|
+
const I = 1024, W = ["Bytes", "KB", "MB", "GB"], A = Math.floor(Math.log(S) / Math.log(I));
|
|
957
|
+
return Math.round(S / Math.pow(I, A) * 100) / 100 + " " + W[A];
|
|
947
958
|
};
|
|
948
|
-
return (
|
|
949
|
-
class:
|
|
950
|
-
|
|
959
|
+
return (S, I) => (l(), a("div", {
|
|
960
|
+
class: n(["relative border-2 border-dashed rounded-lg p-8 transition-colors", [
|
|
961
|
+
f.value ? "border-primary-500 bg-primary-50" : "border-gray-300 bg-white hover:border-primary-500",
|
|
951
962
|
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
952
963
|
]]),
|
|
953
|
-
onClick:
|
|
954
|
-
onDragover: J(
|
|
955
|
-
onDragleave: J(
|
|
956
|
-
onDrop: J(
|
|
964
|
+
onClick: w,
|
|
965
|
+
onDragover: J(g, ["prevent"]),
|
|
966
|
+
onDragleave: J(B, ["prevent"]),
|
|
967
|
+
onDrop: J(j, ["prevent"])
|
|
957
968
|
}, [
|
|
958
969
|
s("input", {
|
|
959
970
|
ref_key: "fileInput",
|
|
960
|
-
ref:
|
|
971
|
+
ref: o,
|
|
961
972
|
type: "file",
|
|
962
973
|
accept: t.accept,
|
|
963
974
|
multiple: t.multiple,
|
|
964
975
|
disabled: t.disabled,
|
|
965
976
|
class: "hidden",
|
|
966
|
-
onChange:
|
|
967
|
-
}, null, 40,
|
|
968
|
-
s("div",
|
|
977
|
+
onChange: F
|
|
978
|
+
}, null, 40, Ft),
|
|
979
|
+
s("div", Wt, [
|
|
969
980
|
s("div", {
|
|
970
|
-
class:
|
|
981
|
+
class: n([v.value, "flex items-center justify-center"])
|
|
971
982
|
}, [
|
|
972
983
|
t.illustration ? (l(), a("img", {
|
|
973
984
|
key: 0,
|
|
974
985
|
src: t.illustration,
|
|
975
986
|
alt: t.illustrationAlt,
|
|
976
987
|
class: "max-w-full max-h-full object-contain"
|
|
977
|
-
}, null, 8,
|
|
988
|
+
}, null, 8, qt)) : (l(), a("svg", Pt, [...I[1] || (I[1] = [
|
|
978
989
|
s("path", {
|
|
979
990
|
"stroke-linecap": "round",
|
|
980
991
|
"stroke-linejoin": "round",
|
|
@@ -983,20 +994,20 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
983
994
|
}, null, -1)
|
|
984
995
|
])]))
|
|
985
996
|
], 2),
|
|
986
|
-
s("div",
|
|
987
|
-
s("p",
|
|
988
|
-
Y(
|
|
989
|
-
s("span",
|
|
997
|
+
s("div", Rt, [
|
|
998
|
+
s("p", Et, [
|
|
999
|
+
Y(D(t.mainText) + " ", 1),
|
|
1000
|
+
s("span", Yt, D(t.linkText), 1)
|
|
990
1001
|
])
|
|
991
1002
|
]),
|
|
992
|
-
|
|
1003
|
+
p.value ? (l(), a("div", {
|
|
993
1004
|
key: 0,
|
|
994
1005
|
class: "w-full max-w-md bg-gray-50 rounded-lg p-4 flex items-center justify-between",
|
|
995
|
-
onClick:
|
|
1006
|
+
onClick: I[0] || (I[0] = J(() => {
|
|
996
1007
|
}, ["stop"]))
|
|
997
1008
|
}, [
|
|
998
|
-
s("div",
|
|
999
|
-
|
|
1009
|
+
s("div", Nt, [
|
|
1010
|
+
I[2] || (I[2] = s("svg", {
|
|
1000
1011
|
class: "w-6 h-6 text-gray-600 flex-shrink-0",
|
|
1001
1012
|
fill: "none",
|
|
1002
1013
|
stroke: "currentColor",
|
|
@@ -1009,16 +1020,16 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1009
1020
|
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
1010
1021
|
})
|
|
1011
1022
|
], -1)),
|
|
1012
|
-
s("div",
|
|
1013
|
-
s("p",
|
|
1014
|
-
s("p",
|
|
1023
|
+
s("div", Ht, [
|
|
1024
|
+
s("p", Kt, D(p.value.name), 1),
|
|
1025
|
+
s("p", Ut, D(q(p.value.size)), 1)
|
|
1015
1026
|
])
|
|
1016
1027
|
]),
|
|
1017
|
-
t.disabled ?
|
|
1028
|
+
t.disabled ? c("", !0) : (l(), a("button", {
|
|
1018
1029
|
key: 0,
|
|
1019
|
-
onClick: J(
|
|
1030
|
+
onClick: J(O, ["stop"]),
|
|
1020
1031
|
class: "ml-3 text-gray-400 hover:text-danger-500 transition-colors"
|
|
1021
|
-
}, [...
|
|
1032
|
+
}, [...I[3] || (I[3] = [
|
|
1022
1033
|
s("svg", {
|
|
1023
1034
|
class: "w-5 h-5",
|
|
1024
1035
|
fill: "currentColor",
|
|
@@ -1031,34 +1042,34 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1031
1042
|
})
|
|
1032
1043
|
], -1)
|
|
1033
1044
|
])]))
|
|
1034
|
-
])) :
|
|
1035
|
-
t.helperText ? (l(), a("p",
|
|
1036
|
-
|
|
1045
|
+
])) : c("", !0),
|
|
1046
|
+
t.helperText ? (l(), a("p", Jt, D(t.helperText), 1)) : c("", !0),
|
|
1047
|
+
i.value ? (l(), a("p", Gt, D(i.value), 1)) : c("", !0)
|
|
1037
1048
|
])
|
|
1038
1049
|
], 34));
|
|
1039
1050
|
}
|
|
1040
|
-
}),
|
|
1051
|
+
}), Qt = { class: "input-wrapper" }, Zt = ["for"], Xt = {
|
|
1041
1052
|
key: 0,
|
|
1042
1053
|
class: "text-danger-600"
|
|
1043
|
-
},
|
|
1054
|
+
}, _t = { class: "relative flex items-center" }, el = {
|
|
1044
1055
|
key: 0,
|
|
1045
1056
|
class: "absolute left-3 text-secondary-500 text-sm"
|
|
1046
|
-
},
|
|
1057
|
+
}, tl = ["id", "type", "disabled", "placeholder", "value", "required", "readonly"], ll = {
|
|
1047
1058
|
key: 1,
|
|
1048
1059
|
class: "absolute right-3 flex items-center gap-2"
|
|
1049
|
-
},
|
|
1060
|
+
}, al = {
|
|
1050
1061
|
key: 1,
|
|
1051
1062
|
class: "text-secondary-500 text-sm"
|
|
1052
|
-
},
|
|
1063
|
+
}, sl = {
|
|
1053
1064
|
key: 2,
|
|
1054
1065
|
class: "absolute right-3 top-1/2 -translate-y-1/2 text-danger-600"
|
|
1055
|
-
},
|
|
1066
|
+
}, ol = {
|
|
1056
1067
|
key: 1,
|
|
1057
1068
|
class: "mt-1 text-sm text-danger-600"
|
|
1058
|
-
},
|
|
1069
|
+
}, rl = {
|
|
1059
1070
|
key: 2,
|
|
1060
1071
|
class: "mt-1 text-sm text-secondary-600"
|
|
1061
|
-
},
|
|
1072
|
+
}, nl = /* @__PURE__ */ N({
|
|
1062
1073
|
__name: "Input",
|
|
1063
1074
|
props: {
|
|
1064
1075
|
modelValue: { default: "" },
|
|
@@ -1074,63 +1085,64 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1074
1085
|
helperText: {},
|
|
1075
1086
|
clearable: { type: Boolean, default: !1 },
|
|
1076
1087
|
prefix: { default: void 0 },
|
|
1077
|
-
suffix: { default: void 0 }
|
|
1088
|
+
suffix: { default: void 0 },
|
|
1089
|
+
compact: { type: Boolean, default: !1 }
|
|
1078
1090
|
},
|
|
1079
1091
|
emits: ["update:modelValue", "blur", "focus", "clear"],
|
|
1080
|
-
setup(t, { emit:
|
|
1081
|
-
const e = t,
|
|
1082
|
-
const
|
|
1083
|
-
sm: "h-8 px-3 text-sm",
|
|
1084
|
-
md: "h-10 px-4 text-base",
|
|
1085
|
-
lg: "h-12 px-5 text-lg"
|
|
1086
|
-
},
|
|
1092
|
+
setup(t, { emit: b }) {
|
|
1093
|
+
const e = t, m = b, o = P(`input-${Math.random().toString(36).substr(2, 9)}`), f = r(() => "ds-label"), p = r(() => {
|
|
1094
|
+
const g = "w-full rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50", B = {
|
|
1095
|
+
sm: e.compact ? "h-6 px-2 text-xs" : "h-8 px-3 text-sm",
|
|
1096
|
+
md: e.compact ? "h-8 px-3 text-sm" : "h-10 px-4 text-base",
|
|
1097
|
+
lg: e.compact ? "h-10 px-4 text-base" : "h-12 px-5 text-lg"
|
|
1098
|
+
}, C = {
|
|
1087
1099
|
default: "border border-secondary-300 bg-white focus:border-primary-500 focus:ring-primary-500",
|
|
1088
1100
|
filled: "border-0 bg-secondary-100 focus:bg-white focus:ring-primary-500",
|
|
1089
1101
|
outlined: "border-2 border-secondary-300 bg-transparent focus:border-primary-500 focus:ring-primary-500"
|
|
1090
|
-
},
|
|
1091
|
-
return `${
|
|
1092
|
-
}),
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
},
|
|
1096
|
-
|
|
1097
|
-
}, z = (
|
|
1098
|
-
|
|
1099
|
-
},
|
|
1100
|
-
|
|
1102
|
+
}, F = e.error ? "border-danger-500 focus:border-danger-500 focus:ring-danger-500 pr-10" : "";
|
|
1103
|
+
return `${g} ${B[e.size]} ${C[e.variant]} ${F}`;
|
|
1104
|
+
}), i = (g) => {
|
|
1105
|
+
const B = g.target;
|
|
1106
|
+
m("update:modelValue", B.value);
|
|
1107
|
+
}, v = (g) => {
|
|
1108
|
+
m("blur", g);
|
|
1109
|
+
}, z = (g) => {
|
|
1110
|
+
m("focus", g);
|
|
1111
|
+
}, w = () => {
|
|
1112
|
+
m("update:modelValue", ""), m("clear");
|
|
1101
1113
|
};
|
|
1102
|
-
return (
|
|
1114
|
+
return (g, B) => (l(), a("div", Qt, [
|
|
1103
1115
|
t.label ? (l(), a("label", {
|
|
1104
1116
|
key: 0,
|
|
1105
|
-
for:
|
|
1106
|
-
class:
|
|
1117
|
+
for: o.value,
|
|
1118
|
+
class: n(f.value)
|
|
1107
1119
|
}, [
|
|
1108
|
-
Y(
|
|
1109
|
-
t.required ? (l(), a("span",
|
|
1110
|
-
], 10,
|
|
1111
|
-
s("div",
|
|
1112
|
-
t.prefix ? (l(), a("span",
|
|
1120
|
+
Y(D(t.label) + " ", 1),
|
|
1121
|
+
t.required ? (l(), a("span", Xt, "*")) : c("", !0)
|
|
1122
|
+
], 10, Zt)) : c("", !0),
|
|
1123
|
+
s("div", _t, [
|
|
1124
|
+
t.prefix ? (l(), a("span", el, D(t.prefix), 1)) : c("", !0),
|
|
1113
1125
|
s("input", {
|
|
1114
|
-
id:
|
|
1115
|
-
class:
|
|
1126
|
+
id: o.value,
|
|
1127
|
+
class: n([p.value, t.prefix ? "pl-9" : ""]),
|
|
1116
1128
|
type: t.type,
|
|
1117
1129
|
disabled: t.disabled,
|
|
1118
1130
|
placeholder: t.placeholder,
|
|
1119
1131
|
value: t.modelValue,
|
|
1120
1132
|
required: t.required,
|
|
1121
1133
|
readonly: t.readonly,
|
|
1122
|
-
onInput:
|
|
1123
|
-
onBlur:
|
|
1134
|
+
onInput: i,
|
|
1135
|
+
onBlur: v,
|
|
1124
1136
|
onFocus: z
|
|
1125
|
-
}, null, 42,
|
|
1126
|
-
t.clearable || t.suffix ? (l(), a("div",
|
|
1137
|
+
}, null, 42, tl),
|
|
1138
|
+
t.clearable || t.suffix ? (l(), a("div", ll, [
|
|
1127
1139
|
t.clearable && t.modelValue ? (l(), a("button", {
|
|
1128
1140
|
key: 0,
|
|
1129
1141
|
type: "button",
|
|
1130
1142
|
class: "text-secondary-400 hover:text-secondary-600 transition-colors",
|
|
1131
1143
|
"aria-label": "Limpiar",
|
|
1132
|
-
onClick:
|
|
1133
|
-
}, [...
|
|
1144
|
+
onClick: w
|
|
1145
|
+
}, [...B[0] || (B[0] = [
|
|
1134
1146
|
s("svg", {
|
|
1135
1147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1136
1148
|
class: "h-4 w-4",
|
|
@@ -1143,10 +1155,10 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1143
1155
|
"clip-rule": "evenodd"
|
|
1144
1156
|
})
|
|
1145
1157
|
], -1)
|
|
1146
|
-
])])) :
|
|
1147
|
-
t.suffix && !t.clearable ? (l(), a("span",
|
|
1148
|
-
])) :
|
|
1149
|
-
t.error && !t.suffix && !t.clearable ? (l(), a("span",
|
|
1158
|
+
])])) : c("", !0),
|
|
1159
|
+
t.suffix && !t.clearable ? (l(), a("span", al, D(t.suffix), 1)) : c("", !0)
|
|
1160
|
+
])) : c("", !0),
|
|
1161
|
+
t.error && !t.suffix && !t.clearable ? (l(), a("span", sl, [...B[1] || (B[1] = [
|
|
1150
1162
|
s("svg", {
|
|
1151
1163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1152
1164
|
class: "h-5 w-5",
|
|
@@ -1159,15 +1171,15 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1159
1171
|
"clip-rule": "evenodd"
|
|
1160
1172
|
})
|
|
1161
1173
|
], -1)
|
|
1162
|
-
])])) :
|
|
1174
|
+
])])) : c("", !0)
|
|
1163
1175
|
]),
|
|
1164
|
-
t.error ? (l(), a("p",
|
|
1176
|
+
t.error ? (l(), a("p", ol, D(t.error), 1)) : t.helperText ? (l(), a("p", rl, D(t.helperText), 1)) : c("", !0)
|
|
1165
1177
|
]));
|
|
1166
1178
|
}
|
|
1167
|
-
}),
|
|
1179
|
+
}), Ua = /* @__PURE__ */ Z(nl, [["__scopeId", "data-v-bf4bc631"]]), il = ["stroke-width"], dl = {
|
|
1168
1180
|
class: "w-full h-full rounded-lg overflow-hidden",
|
|
1169
1181
|
style: { "background-color": "#f7f7f7" }
|
|
1170
|
-
},
|
|
1182
|
+
}, ul = /* @__PURE__ */ N({
|
|
1171
1183
|
__name: "Loader",
|
|
1172
1184
|
props: {
|
|
1173
1185
|
type: { default: "circular" },
|
|
@@ -1178,24 +1190,24 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1178
1190
|
progress: { default: void 0 }
|
|
1179
1191
|
},
|
|
1180
1192
|
setup(t) {
|
|
1181
|
-
const
|
|
1193
|
+
const b = t, e = {
|
|
1182
1194
|
primary: "text-primary-700",
|
|
1183
1195
|
secondary: "text-secondary-500",
|
|
1184
1196
|
success: "text-success-500",
|
|
1185
1197
|
warning: "text-warning-500",
|
|
1186
1198
|
danger: "text-danger-500",
|
|
1187
1199
|
info: "text-info-500"
|
|
1188
|
-
},
|
|
1200
|
+
}, m = {
|
|
1189
1201
|
primary: "bg-primary-700",
|
|
1190
1202
|
secondary: "bg-secondary-500",
|
|
1191
1203
|
success: "bg-success-500",
|
|
1192
1204
|
warning: "bg-warning-500",
|
|
1193
1205
|
danger: "bg-danger-500",
|
|
1194
1206
|
info: "bg-info-500"
|
|
1195
|
-
},
|
|
1196
|
-
return (
|
|
1207
|
+
}, o = r(() => [e[b.color]]), f = r(() => [m[b.color]]);
|
|
1208
|
+
return (p, i) => t.type === "circular" ? (l(), a("div", {
|
|
1197
1209
|
key: 0,
|
|
1198
|
-
class:
|
|
1210
|
+
class: n(o.value)
|
|
1199
1211
|
}, [
|
|
1200
1212
|
(l(), a("svg", {
|
|
1201
1213
|
class: "animate-spin",
|
|
@@ -1210,8 +1222,8 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1210
1222
|
stroke: "currentColor",
|
|
1211
1223
|
"stroke-width": t.strokeWidth,
|
|
1212
1224
|
fill: "none"
|
|
1213
|
-
}, null, 8,
|
|
1214
|
-
|
|
1225
|
+
}, null, 8, il),
|
|
1226
|
+
i[0] || (i[0] = s("path", {
|
|
1215
1227
|
class: "opacity-75",
|
|
1216
1228
|
fill: "currentColor",
|
|
1217
1229
|
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
@@ -1222,30 +1234,30 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1222
1234
|
class: "w-full",
|
|
1223
1235
|
style: X({ height: t.height })
|
|
1224
1236
|
}, [
|
|
1225
|
-
s("div",
|
|
1237
|
+
s("div", dl, [
|
|
1226
1238
|
s("div", {
|
|
1227
|
-
class:
|
|
1239
|
+
class: n([[f.value, { "animate-linear-loader": t.progress === void 0 }], "h-full rounded-lg"]),
|
|
1228
1240
|
style: X({ width: t.progress !== void 0 ? `${Math.min(Math.max(t.progress, 0), 100)}%` : "100%" })
|
|
1229
1241
|
}, null, 6)
|
|
1230
1242
|
])
|
|
1231
|
-
], 4)) :
|
|
1243
|
+
], 4)) : c("", !0);
|
|
1232
1244
|
}
|
|
1233
|
-
}),
|
|
1245
|
+
}), Ja = /* @__PURE__ */ Z(ul, [["__scopeId", "data-v-f369fb46"]]), cl = ["disabled", "aria-expanded"], fl = ["disabled", "onClick"], pl = {
|
|
1234
1246
|
key: 0,
|
|
1235
1247
|
class: "flex-shrink-0"
|
|
1236
|
-
}, ml = { class: "flex-1 min-w-0 mr-2" },
|
|
1248
|
+
}, ml = { class: "flex-1 min-w-0 mr-2" }, vl = { class: "flex flex-col items-start" }, bl = ["title"], gl = ["title"], yl = {
|
|
1237
1249
|
key: 1,
|
|
1238
1250
|
class: "flex-shrink-0"
|
|
1239
|
-
},
|
|
1251
|
+
}, hl = {
|
|
1240
1252
|
key: 0,
|
|
1241
1253
|
class: "text-xs text-secondary-400 font-mono whitespace-nowrap"
|
|
1242
|
-
},
|
|
1254
|
+
}, xl = { key: 1 }, wl = {
|
|
1243
1255
|
key: 2,
|
|
1244
1256
|
class: "w-4 h-4 ml-2 flex-shrink-0",
|
|
1245
1257
|
fill: "none",
|
|
1246
1258
|
stroke: "currentColor",
|
|
1247
1259
|
viewBox: "0 0 24 24"
|
|
1248
|
-
},
|
|
1260
|
+
}, kl = /* @__PURE__ */ N({
|
|
1249
1261
|
__name: "Menu",
|
|
1250
1262
|
props: {
|
|
1251
1263
|
items: { default: () => [] },
|
|
@@ -1268,272 +1280,272 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1268
1280
|
closeDelay: { default: 100 }
|
|
1269
1281
|
},
|
|
1270
1282
|
emits: ["open", "close", "select"],
|
|
1271
|
-
setup(t, { emit:
|
|
1272
|
-
let e = null,
|
|
1273
|
-
const
|
|
1283
|
+
setup(t, { emit: b }) {
|
|
1284
|
+
let e = null, m = null;
|
|
1285
|
+
const o = t, f = b, p = P(!1), i = P(null), v = P(null), z = P({}), w = r(() => [
|
|
1274
1286
|
"inline-flex items-center justify-center px-4 py-2 text-sm font-medium",
|
|
1275
1287
|
"bg-white border border-secondary-300 rounded-md text-secondary-700",
|
|
1276
1288
|
"hover:bg-secondary-100 hover:text-secondary-900 hover:border-secondary-400",
|
|
1277
1289
|
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
1278
1290
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1279
1291
|
"transition-all duration-200"
|
|
1280
|
-
].join(" ")),
|
|
1292
|
+
].join(" ")), g = r(() => [...[
|
|
1281
1293
|
"fixed bg-white rounded-lg shadow-lg border border-secondary-200",
|
|
1282
1294
|
"flex flex-col",
|
|
1283
1295
|
"focus:outline-none"
|
|
1284
|
-
], `z-${
|
|
1285
|
-
const
|
|
1296
|
+
], `z-${o.zIndex}`].join(" ")), B = r(() => "px-4 py-3 border-b border-secondary-200 bg-secondary-50"), C = r(() => "px-4 py-3 border-t border-secondary-200 bg-secondary-50"), F = r(() => "py-1 overflow-y-auto flex-1 min-h-0"), j = r(() => "my-1 border-t border-secondary-200"), O = r(() => "px-4 py-2 text-xs font-semibold text-secondary-500 uppercase tracking-wider"), q = (d) => {
|
|
1297
|
+
const V = [
|
|
1286
1298
|
"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left",
|
|
1287
1299
|
"transition-all duration-150 focus:outline-none cursor-pointer",
|
|
1288
1300
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1289
|
-
], x =
|
|
1301
|
+
], x = d.variant || "default", le = {
|
|
1290
1302
|
default: "text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:bg-secondary-100",
|
|
1291
1303
|
danger: "text-danger-600 hover:bg-danger-100 hover:text-danger-700 focus:bg-danger-100",
|
|
1292
1304
|
success: "text-success-600 hover:bg-success-100 hover:text-success-700 focus:bg-success-100",
|
|
1293
1305
|
warning: "text-warning-600 hover:bg-warning-100 hover:text-warning-700 focus:bg-warning-100"
|
|
1294
1306
|
};
|
|
1295
1307
|
let R = "";
|
|
1296
|
-
return
|
|
1308
|
+
return d.color && (R = d.color, (d.color.includes("white") || d.color.includes("50")) && (R += " hover:text-black")), [...V, R || le[x]].join(" ");
|
|
1309
|
+
}, S = () => {
|
|
1310
|
+
o.disabled || (p.value ? W() : (m && clearTimeout(m), e = setTimeout(() => {
|
|
1311
|
+
I();
|
|
1312
|
+
}, o.openDelay)));
|
|
1297
1313
|
}, I = () => {
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
}, r.openDelay)));
|
|
1301
|
-
}, B = () => {
|
|
1302
|
-
v.value = !0, p("open"), be(() => {
|
|
1303
|
-
C(), document.addEventListener("click", j), document.addEventListener("keydown", h);
|
|
1314
|
+
p.value = !0, f("open"), ve(() => {
|
|
1315
|
+
$(), document.addEventListener("click", k), document.addEventListener("keydown", y);
|
|
1304
1316
|
});
|
|
1305
|
-
},
|
|
1306
|
-
e && clearTimeout(e),
|
|
1307
|
-
|
|
1308
|
-
},
|
|
1309
|
-
},
|
|
1310
|
-
|
|
1311
|
-
},
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
},
|
|
1315
|
-
|
|
1316
|
-
},
|
|
1317
|
-
(
|
|
1318
|
-
},
|
|
1319
|
-
if (!
|
|
1320
|
-
const
|
|
1317
|
+
}, W = () => {
|
|
1318
|
+
e && clearTimeout(e), m = setTimeout(() => {
|
|
1319
|
+
p.value = !1, f("close"), document.removeEventListener("click", k), document.removeEventListener("keydown", y);
|
|
1320
|
+
}, o.closeDelay);
|
|
1321
|
+
}, A = (d) => {
|
|
1322
|
+
d.disabled || (d.action && d.action(), f("select", d), (o.closeOnClick || o.closeOnSelect) && !d.children && W());
|
|
1323
|
+
}, k = (d) => {
|
|
1324
|
+
const V = d.target;
|
|
1325
|
+
i.value && !i.value.contains(V) && v.value && !v.value.contains(V) && W();
|
|
1326
|
+
}, y = (d) => {
|
|
1327
|
+
d.key === "Escape" && W();
|
|
1328
|
+
}, u = (d) => {
|
|
1329
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), S());
|
|
1330
|
+
}, $ = () => {
|
|
1331
|
+
if (!i.value || !v.value) return;
|
|
1332
|
+
const d = i.value.getBoundingClientRect(), V = v.value.getBoundingClientRect(), x = window.innerWidth, le = window.innerHeight;
|
|
1321
1333
|
let R = 0, H = 0;
|
|
1322
|
-
switch (
|
|
1334
|
+
switch (o.position) {
|
|
1323
1335
|
case "bottom-start":
|
|
1324
|
-
R =
|
|
1336
|
+
R = d.bottom + o.offset.y, H = d.left + o.offset.x;
|
|
1325
1337
|
break;
|
|
1326
1338
|
case "bottom-end":
|
|
1327
|
-
R =
|
|
1339
|
+
R = d.bottom + o.offset.y, H = d.right - V.width + o.offset.x;
|
|
1328
1340
|
break;
|
|
1329
1341
|
case "top-start":
|
|
1330
|
-
R =
|
|
1342
|
+
R = d.top - V.height - o.offset.y, H = d.left + o.offset.x;
|
|
1331
1343
|
break;
|
|
1332
1344
|
case "top-end":
|
|
1333
|
-
R =
|
|
1345
|
+
R = d.top - V.height - o.offset.y, H = d.right - V.width + o.offset.x;
|
|
1334
1346
|
break;
|
|
1335
1347
|
case "right-start":
|
|
1336
|
-
R =
|
|
1348
|
+
R = d.top + o.offset.y, H = d.right + o.offset.x;
|
|
1337
1349
|
break;
|
|
1338
1350
|
case "right-end":
|
|
1339
|
-
R =
|
|
1351
|
+
R = d.bottom - V.height + o.offset.y, H = d.right + o.offset.x;
|
|
1340
1352
|
break;
|
|
1341
1353
|
case "left-start":
|
|
1342
|
-
R =
|
|
1354
|
+
R = d.top + o.offset.y, H = d.left - V.width - o.offset.x;
|
|
1343
1355
|
break;
|
|
1344
1356
|
case "left-end":
|
|
1345
|
-
R =
|
|
1357
|
+
R = d.bottom - V.height + o.offset.y, H = d.left - V.width - o.offset.x;
|
|
1346
1358
|
break;
|
|
1347
1359
|
}
|
|
1348
|
-
H +
|
|
1360
|
+
H + V.width > x && (H = x - V.width - 8), H < 8 && (H = 8), R + V.height > le && (R = le - V.height - 8), R < 8 && (R = 8), z.value = {
|
|
1349
1361
|
top: `${R}px`,
|
|
1350
1362
|
left: `${H}px`,
|
|
1351
|
-
width:
|
|
1352
|
-
maxHeight:
|
|
1363
|
+
width: o.width === "auto" ? `${Math.max(d.width, 240)}px` : o.width,
|
|
1364
|
+
maxHeight: o.maxHeight,
|
|
1353
1365
|
minWidth: "240px"
|
|
1354
1366
|
};
|
|
1355
1367
|
};
|
|
1356
|
-
return
|
|
1357
|
-
window.addEventListener("scroll",
|
|
1358
|
-
}),
|
|
1359
|
-
window.removeEventListener("scroll",
|
|
1360
|
-
}), de(() =>
|
|
1361
|
-
|
|
1362
|
-
}, { deep: !0 }), (
|
|
1363
|
-
class:
|
|
1368
|
+
return be(() => {
|
|
1369
|
+
window.addEventListener("scroll", $, !0), window.addEventListener("resize", $);
|
|
1370
|
+
}), ge(() => {
|
|
1371
|
+
window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $), document.removeEventListener("click", k), document.removeEventListener("keydown", y);
|
|
1372
|
+
}), de(() => o.items, () => {
|
|
1373
|
+
p.value && ve($);
|
|
1374
|
+
}, { deep: !0 }), (d, V) => (l(), a("div", {
|
|
1375
|
+
class: n(["menu-wrapper", { "w-full": t.fullWidth }])
|
|
1364
1376
|
}, [
|
|
1365
1377
|
s("div", {
|
|
1366
1378
|
ref_key: "triggerRef",
|
|
1367
|
-
ref:
|
|
1379
|
+
ref: i
|
|
1368
1380
|
}, [
|
|
1369
|
-
|
|
1370
|
-
isOpen:
|
|
1371
|
-
toggle:
|
|
1381
|
+
L(d.$slots, "trigger", {
|
|
1382
|
+
isOpen: p.value,
|
|
1383
|
+
toggle: S
|
|
1372
1384
|
}, () => [
|
|
1373
1385
|
s("button", {
|
|
1374
1386
|
type: "button",
|
|
1375
|
-
class:
|
|
1387
|
+
class: n(w.value),
|
|
1376
1388
|
disabled: t.disabled,
|
|
1377
|
-
onClick:
|
|
1378
|
-
onKeydown:
|
|
1389
|
+
onClick: S,
|
|
1390
|
+
onKeydown: u,
|
|
1379
1391
|
tabindex: 0,
|
|
1380
1392
|
role: "button",
|
|
1381
|
-
"aria-expanded":
|
|
1393
|
+
"aria-expanded": p.value,
|
|
1382
1394
|
"aria-haspopup": !0
|
|
1383
1395
|
}, [
|
|
1384
|
-
|
|
1385
|
-
Y(
|
|
1396
|
+
L(d.$slots, "trigger-content", {}, () => [
|
|
1397
|
+
Y(D(t.triggerText), 1)
|
|
1386
1398
|
], !0),
|
|
1387
1399
|
t.showChevron ? (l(), a("svg", {
|
|
1388
1400
|
key: 0,
|
|
1389
|
-
class:
|
|
1401
|
+
class: n(["w-4 h-4 ml-2 transition-transform", p.value ? "rotate-180" : ""]),
|
|
1390
1402
|
fill: "none",
|
|
1391
1403
|
stroke: "currentColor",
|
|
1392
1404
|
viewBox: "0 0 24 24"
|
|
1393
|
-
}, [...
|
|
1405
|
+
}, [...V[1] || (V[1] = [
|
|
1394
1406
|
s("path", {
|
|
1395
1407
|
"stroke-linecap": "round",
|
|
1396
1408
|
"stroke-linejoin": "round",
|
|
1397
1409
|
"stroke-width": "2",
|
|
1398
1410
|
d: "M19 9l-7 7-7-7"
|
|
1399
1411
|
}, null, -1)
|
|
1400
|
-
])], 2)) :
|
|
1401
|
-
], 42,
|
|
1412
|
+
])], 2)) : c("", !0)
|
|
1413
|
+
], 42, cl)
|
|
1402
1414
|
], !0)
|
|
1403
1415
|
], 512),
|
|
1404
|
-
(l(), te(
|
|
1405
|
-
|
|
1416
|
+
(l(), te(ye, { to: "body" }, [
|
|
1417
|
+
p.value ? (l(), a("div", {
|
|
1406
1418
|
key: 0,
|
|
1407
1419
|
ref_key: "menuRef",
|
|
1408
|
-
ref:
|
|
1409
|
-
class:
|
|
1420
|
+
ref: v,
|
|
1421
|
+
class: n(g.value),
|
|
1410
1422
|
style: X(z.value),
|
|
1411
|
-
onClick:
|
|
1423
|
+
onClick: V[0] || (V[0] = J(() => {
|
|
1412
1424
|
}, ["stop"]))
|
|
1413
1425
|
}, [
|
|
1414
|
-
|
|
1426
|
+
d.$slots.header ? (l(), a("div", {
|
|
1415
1427
|
key: 0,
|
|
1416
|
-
class:
|
|
1428
|
+
class: n(B.value)
|
|
1417
1429
|
}, [
|
|
1418
|
-
|
|
1419
|
-
], 2)) :
|
|
1430
|
+
L(d.$slots, "header", { close: W }, void 0, !0)
|
|
1431
|
+
], 2)) : c("", !0),
|
|
1420
1432
|
s("div", {
|
|
1421
|
-
class:
|
|
1433
|
+
class: n(F.value)
|
|
1422
1434
|
}, [
|
|
1423
|
-
|
|
1424
|
-
close:
|
|
1425
|
-
isOpen:
|
|
1435
|
+
L(d.$slots, "default", {
|
|
1436
|
+
close: W,
|
|
1437
|
+
isOpen: p.value
|
|
1426
1438
|
}, () => [
|
|
1427
1439
|
(l(!0), a(K, null, G(t.items, (x, le) => (l(), a(K, {
|
|
1428
1440
|
key: x.id || le
|
|
1429
1441
|
}, [
|
|
1430
1442
|
x.type === "divider" ? (l(), a("div", {
|
|
1431
1443
|
key: 0,
|
|
1432
|
-
class:
|
|
1444
|
+
class: n(j.value)
|
|
1433
1445
|
}, null, 2)) : x.type === "header" ? (l(), a("div", {
|
|
1434
1446
|
key: 1,
|
|
1435
|
-
class:
|
|
1436
|
-
},
|
|
1447
|
+
class: n(O.value)
|
|
1448
|
+
}, D(x.label), 3)) : (l(), a("button", {
|
|
1437
1449
|
key: 2,
|
|
1438
1450
|
type: "button",
|
|
1439
|
-
class:
|
|
1451
|
+
class: n(q(x)),
|
|
1440
1452
|
disabled: x.disabled,
|
|
1441
|
-
onClick: (R) =>
|
|
1453
|
+
onClick: (R) => A(x)
|
|
1442
1454
|
}, [
|
|
1443
|
-
x.icon ||
|
|
1444
|
-
|
|
1455
|
+
x.icon || d.$slots[`icon-${x.id}`] ? (l(), a("span", pl, [
|
|
1456
|
+
L(d.$slots, `icon-${x.id}`, { item: x }, () => [
|
|
1445
1457
|
typeof x.icon == "string" ? (l(), te(_, {
|
|
1446
1458
|
key: 0,
|
|
1447
1459
|
name: x.icon,
|
|
1448
1460
|
size: "sm"
|
|
1449
|
-
}, null, 8, ["name"])) : (l(), te(
|
|
1461
|
+
}, null, 8, ["name"])) : (l(), te(he(x.icon), {
|
|
1450
1462
|
key: 1,
|
|
1451
1463
|
class: "w-5 h-5"
|
|
1452
1464
|
}))
|
|
1453
1465
|
], !0)
|
|
1454
|
-
])) :
|
|
1466
|
+
])) : c("", !0),
|
|
1455
1467
|
s("div", ml, [
|
|
1456
|
-
|
|
1468
|
+
L(d.$slots, `item-${x.id}`, {
|
|
1457
1469
|
item: x,
|
|
1458
|
-
close:
|
|
1470
|
+
close: W
|
|
1459
1471
|
}, () => [
|
|
1460
|
-
s("div",
|
|
1472
|
+
s("div", vl, [
|
|
1461
1473
|
s("span", {
|
|
1462
1474
|
class: "truncate w-full",
|
|
1463
1475
|
title: x.label
|
|
1464
|
-
},
|
|
1476
|
+
}, D(x.label), 9, bl),
|
|
1465
1477
|
x.description ? (l(), a("span", {
|
|
1466
1478
|
key: 0,
|
|
1467
1479
|
class: "text-xs text-secondary-500 truncate w-full",
|
|
1468
1480
|
title: x.description
|
|
1469
|
-
},
|
|
1481
|
+
}, D(x.description), 9, gl)) : c("", !0)
|
|
1470
1482
|
])
|
|
1471
1483
|
], !0)
|
|
1472
1484
|
]),
|
|
1473
|
-
x.suffix || x.shortcut ||
|
|
1474
|
-
|
|
1475
|
-
x.shortcut ? (l(), a("span",
|
|
1485
|
+
x.suffix || x.shortcut || d.$slots[`suffix-${x.id}`] ? (l(), a("span", yl, [
|
|
1486
|
+
L(d.$slots, `suffix-${x.id}`, { item: x }, () => [
|
|
1487
|
+
x.shortcut ? (l(), a("span", hl, D(x.shortcut), 1)) : x.suffix ? (l(), a("span", xl, D(x.suffix), 1)) : c("", !0)
|
|
1476
1488
|
], !0)
|
|
1477
|
-
])) :
|
|
1478
|
-
x.children && x.children.length > 0 ? (l(), a("svg",
|
|
1489
|
+
])) : c("", !0),
|
|
1490
|
+
x.children && x.children.length > 0 ? (l(), a("svg", wl, [...V[2] || (V[2] = [
|
|
1479
1491
|
s("path", {
|
|
1480
1492
|
"stroke-linecap": "round",
|
|
1481
1493
|
"stroke-linejoin": "round",
|
|
1482
1494
|
"stroke-width": "2",
|
|
1483
1495
|
d: "M9 5l7 7-7 7"
|
|
1484
1496
|
}, null, -1)
|
|
1485
|
-
])])) :
|
|
1486
|
-
], 10,
|
|
1497
|
+
])])) : c("", !0)
|
|
1498
|
+
], 10, fl))
|
|
1487
1499
|
], 64))), 128))
|
|
1488
1500
|
], !0)
|
|
1489
1501
|
], 2),
|
|
1490
|
-
|
|
1502
|
+
d.$slots.footer ? (l(), a("div", {
|
|
1491
1503
|
key: 1,
|
|
1492
|
-
class:
|
|
1504
|
+
class: n(C.value)
|
|
1493
1505
|
}, [
|
|
1494
|
-
|
|
1495
|
-
], 2)) :
|
|
1496
|
-
], 6)) :
|
|
1497
|
-
|
|
1506
|
+
L(d.$slots, "footer", { close: W }, void 0, !0)
|
|
1507
|
+
], 2)) : c("", !0)
|
|
1508
|
+
], 6)) : c("", !0),
|
|
1509
|
+
p.value && t.overlay ? (l(), a("div", {
|
|
1498
1510
|
key: 1,
|
|
1499
1511
|
class: "fixed inset-0 bg-black/20 z-40",
|
|
1500
|
-
onClick:
|
|
1501
|
-
})) :
|
|
1512
|
+
onClick: W
|
|
1513
|
+
})) : c("", !0)
|
|
1502
1514
|
]))
|
|
1503
1515
|
], 2));
|
|
1504
1516
|
}
|
|
1505
|
-
}),
|
|
1517
|
+
}), Ga = /* @__PURE__ */ Z(kl, [["__scopeId", "data-v-ad88f878"]]), Cl = ["for"], $l = {
|
|
1506
1518
|
key: 0,
|
|
1507
1519
|
class: "text-danger-600"
|
|
1508
|
-
},
|
|
1520
|
+
}, Bl = ["id", "disabled", "aria-expanded"], zl = { class: "flex-1 text-left truncate" }, Ml = {
|
|
1509
1521
|
key: 0,
|
|
1510
1522
|
class: "flex items-center justify-center gap-2 p-6 text-secondary-600"
|
|
1511
|
-
},
|
|
1523
|
+
}, Dl = {
|
|
1512
1524
|
key: 1,
|
|
1513
1525
|
class: "p-2 border-b border-secondary-200"
|
|
1514
|
-
},
|
|
1526
|
+
}, Vl = ["placeholder"], Tl = {
|
|
1515
1527
|
key: 2,
|
|
1516
1528
|
class: "max-h-64 overflow-y-auto"
|
|
1517
|
-
},
|
|
1529
|
+
}, Sl = {
|
|
1518
1530
|
key: 0,
|
|
1519
1531
|
class: "px-4 py-3 text-sm text-secondary-500 text-center"
|
|
1520
|
-
},
|
|
1532
|
+
}, Il = ["onClick"], jl = { class: "flex items-center justify-between w-full" }, Ll = { class: "truncate" }, Ol = {
|
|
1521
1533
|
key: 0,
|
|
1522
1534
|
class: "w-5 h-5 text-primary-600 flex-shrink-0 ml-2",
|
|
1523
1535
|
fill: "none",
|
|
1524
1536
|
stroke: "currentColor",
|
|
1525
1537
|
viewBox: "0 0 24 24",
|
|
1526
1538
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1527
|
-
},
|
|
1539
|
+
}, Al = {
|
|
1528
1540
|
key: 0,
|
|
1529
1541
|
class: "border-t border-secondary-200 my-1"
|
|
1530
|
-
},
|
|
1542
|
+
}, Fl = ["onClick"], Wl = ["innerHTML"], ql = {
|
|
1531
1543
|
key: 1,
|
|
1532
1544
|
class: "mt-1 text-sm text-danger-600"
|
|
1533
|
-
},
|
|
1545
|
+
}, Pl = {
|
|
1534
1546
|
key: 2,
|
|
1535
1547
|
class: "mt-1 text-sm text-secondary-600"
|
|
1536
|
-
},
|
|
1548
|
+
}, Rl = /* @__PURE__ */ N({
|
|
1537
1549
|
__name: "Select",
|
|
1538
1550
|
props: {
|
|
1539
1551
|
modelValue: { default: null },
|
|
@@ -1553,93 +1565,94 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1553
1565
|
helperText: { default: "" },
|
|
1554
1566
|
fullWidth: { type: Boolean, default: !1 },
|
|
1555
1567
|
menuPosition: { default: "bottom" },
|
|
1556
|
-
bordered: { type: Boolean, default: !0 }
|
|
1568
|
+
bordered: { type: Boolean, default: !0 },
|
|
1569
|
+
compact: { type: Boolean, default: !1 }
|
|
1557
1570
|
},
|
|
1558
1571
|
emits: ["update:modelValue", "change", "action"],
|
|
1559
|
-
setup(t, { emit:
|
|
1560
|
-
const e = t,
|
|
1572
|
+
setup(t, { emit: b }) {
|
|
1573
|
+
const e = t, m = b, o = P(!1), f = P(""), p = P(null), i = r(
|
|
1561
1574
|
() => `select-${Math.random().toString(36).substr(2, 9)}`
|
|
1562
|
-
),
|
|
1563
|
-
if (!e.searchable || !
|
|
1575
|
+
), v = r(() => e.options.find((y) => y.value === e.modelValue) || null), z = r(() => {
|
|
1576
|
+
if (!e.searchable || !f.value)
|
|
1564
1577
|
return e.options;
|
|
1565
|
-
const
|
|
1566
|
-
return e.options.filter((
|
|
1567
|
-
}),
|
|
1568
|
-
const
|
|
1569
|
-
sm: "px-3 py-1.5 text-sm",
|
|
1570
|
-
md: "px-4 py-2 text-base",
|
|
1571
|
-
lg: "px-5 py-3 text-lg"
|
|
1572
|
-
},
|
|
1578
|
+
const y = f.value.toLowerCase();
|
|
1579
|
+
return e.options.filter((u) => u.label.toLowerCase().includes(y));
|
|
1580
|
+
}), w = r(() => "ds-label"), g = r(() => e.bordered ? "border border-neutral-300 rounded-md" : "rounded-md"), B = r(() => {
|
|
1581
|
+
const y = "w-full rounded-md flex items-center justify-between gap-2 transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed", u = {
|
|
1582
|
+
sm: e.compact ? "px-2 py-1 text-xs" : "px-3 py-1.5 text-sm",
|
|
1583
|
+
md: e.compact ? "px-3 py-1.5 text-sm" : "px-4 py-2 text-base",
|
|
1584
|
+
lg: e.compact ? "px-4 py-2 text-base" : "px-5 py-3 text-lg"
|
|
1585
|
+
}, $ = {
|
|
1573
1586
|
default: "bg-white",
|
|
1574
1587
|
outline: "bg-transparent",
|
|
1575
1588
|
filled: "bg-secondary-100"
|
|
1576
|
-
},
|
|
1589
|
+
}, d = e.error ? "border-danger-600 focus:ring-danger-500" : "";
|
|
1577
1590
|
return [
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1591
|
+
y,
|
|
1592
|
+
u[e.size],
|
|
1593
|
+
$[e.variant],
|
|
1594
|
+
d
|
|
1582
1595
|
].join(" ");
|
|
1583
|
-
}),
|
|
1584
|
-
const
|
|
1585
|
-
return [
|
|
1586
|
-
},
|
|
1587
|
-
const
|
|
1588
|
-
return
|
|
1589
|
-
},
|
|
1590
|
-
e.disabled || e.loading || (
|
|
1591
|
-
var
|
|
1592
|
-
(
|
|
1596
|
+
}), C = r(() => `absolute ${e.menuPosition === "top" ? "bottom-full mb-1" : "top-full mt-1"} left-0 right-0 bg-white rounded-lg shadow-lg border border-secondary-200 z-50 overflow-hidden`), F = (y) => {
|
|
1597
|
+
const u = "w-full px-4 py-2 text-left hover:bg-primary-50 transition-colors focus:outline-none focus:bg-primary-50 disabled:opacity-50 disabled:cursor-not-allowed", $ = O(y) ? "bg-primary-50" : "";
|
|
1598
|
+
return [u, $].join(" ");
|
|
1599
|
+
}, j = (y) => {
|
|
1600
|
+
const u = "w-full px-4 py-2 text-left text-sm font-semibold transition-colors focus:outline-none flex items-center gap-3";
|
|
1601
|
+
return y.variant === "danger" ? `${u} text-danger-600 hover:bg-danger-50 focus:bg-danger-50` : `${u} text-secondary-700 hover:bg-secondary-50 focus:bg-secondary-50`;
|
|
1602
|
+
}, O = (y) => y.value === e.modelValue, q = () => {
|
|
1603
|
+
e.disabled || e.loading || (o.value = !o.value, o.value && e.searchable && ve(() => {
|
|
1604
|
+
var y;
|
|
1605
|
+
(y = p.value) == null || y.focus();
|
|
1593
1606
|
}));
|
|
1594
|
-
},
|
|
1595
|
-
|
|
1596
|
-
},
|
|
1597
|
-
|
|
1598
|
-
},
|
|
1599
|
-
|
|
1600
|
-
},
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
|
|
1607
|
+
}, S = () => {
|
|
1608
|
+
o.value = !1, f.value = "";
|
|
1609
|
+
}, I = (y) => {
|
|
1610
|
+
y.disabled || (m("update:modelValue", y.value), m("change", y), S());
|
|
1611
|
+
}, W = (y) => {
|
|
1612
|
+
y.action && y.action(), m("action", y), S();
|
|
1613
|
+
}, A = (y) => {
|
|
1614
|
+
const u = y.relatedTarget;
|
|
1615
|
+
u && u.closest(".select-wrapper") || setTimeout(() => {
|
|
1616
|
+
S();
|
|
1604
1617
|
}, 200);
|
|
1605
|
-
},
|
|
1606
|
-
|
|
1618
|
+
}, k = (y) => {
|
|
1619
|
+
y.key === "Escape" ? S() : (y.key === "Enter" || y.key === " ") && (y.preventDefault(), q());
|
|
1607
1620
|
};
|
|
1608
|
-
return de(
|
|
1609
|
-
|
|
1610
|
-
}), (
|
|
1611
|
-
class:
|
|
1621
|
+
return de(o, (y) => {
|
|
1622
|
+
y && (f.value = "");
|
|
1623
|
+
}), (y, u) => (l(), a("div", {
|
|
1624
|
+
class: n(["select-wrapper", { "w-full": t.fullWidth }])
|
|
1612
1625
|
}, [
|
|
1613
1626
|
t.label ? (l(), a("label", {
|
|
1614
1627
|
key: 0,
|
|
1615
|
-
for:
|
|
1616
|
-
class:
|
|
1628
|
+
for: i.value,
|
|
1629
|
+
class: n(w.value)
|
|
1617
1630
|
}, [
|
|
1618
|
-
Y(
|
|
1619
|
-
t.required ? (l(), a("span",
|
|
1620
|
-
], 10,
|
|
1631
|
+
Y(D(t.label) + " ", 1),
|
|
1632
|
+
t.required ? (l(), a("span", $l, "*")) : c("", !0)
|
|
1633
|
+
], 10, Cl)) : c("", !0),
|
|
1621
1634
|
s("div", {
|
|
1622
|
-
class:
|
|
1635
|
+
class: n(["relative", g.value])
|
|
1623
1636
|
}, [
|
|
1624
1637
|
s("button", {
|
|
1625
|
-
id:
|
|
1638
|
+
id: i.value,
|
|
1626
1639
|
type: "button",
|
|
1627
|
-
class:
|
|
1640
|
+
class: n(B.value),
|
|
1628
1641
|
disabled: t.disabled,
|
|
1629
|
-
"aria-expanded":
|
|
1642
|
+
"aria-expanded": o.value,
|
|
1630
1643
|
"aria-haspopup": !0,
|
|
1631
|
-
onClick:
|
|
1632
|
-
onBlur:
|
|
1633
|
-
onKeydown:
|
|
1644
|
+
onClick: q,
|
|
1645
|
+
onBlur: A,
|
|
1646
|
+
onKeydown: k
|
|
1634
1647
|
}, [
|
|
1635
|
-
s("span",
|
|
1648
|
+
s("span", zl, D(v.value ? v.value.label : t.placeholder), 1),
|
|
1636
1649
|
(l(), a("svg", {
|
|
1637
|
-
class:
|
|
1650
|
+
class: n(["w-5 h-5 flex-shrink-0 transition-transform text-[#565656] opacity-80", o.value ? "rotate-180" : ""]),
|
|
1638
1651
|
fill: "none",
|
|
1639
1652
|
stroke: "currentColor",
|
|
1640
1653
|
viewBox: "0 0 24 24",
|
|
1641
1654
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1642
|
-
}, [...
|
|
1655
|
+
}, [...u[3] || (u[3] = [
|
|
1643
1656
|
s("path", {
|
|
1644
1657
|
"stroke-linecap": "round",
|
|
1645
1658
|
"stroke-linejoin": "round",
|
|
@@ -1647,14 +1660,14 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1647
1660
|
d: "M19 9l-7 7-7-7"
|
|
1648
1661
|
}, null, -1)
|
|
1649
1662
|
])], 2))
|
|
1650
|
-
], 42,
|
|
1651
|
-
|
|
1663
|
+
], 42, Bl),
|
|
1664
|
+
o.value ? (l(), a("div", {
|
|
1652
1665
|
key: 0,
|
|
1653
|
-
class:
|
|
1654
|
-
onClick:
|
|
1666
|
+
class: n(C.value),
|
|
1667
|
+
onClick: u[2] || (u[2] = J(() => {
|
|
1655
1668
|
}, ["stop"]))
|
|
1656
1669
|
}, [
|
|
1657
|
-
t.loading ? (l(), a("div",
|
|
1670
|
+
t.loading ? (l(), a("div", Ml, [...u[4] || (u[4] = [
|
|
1658
1671
|
s("svg", {
|
|
1659
1672
|
class: "w-5 h-5 animate-spin",
|
|
1660
1673
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1676,74 +1689,74 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1676
1689
|
})
|
|
1677
1690
|
], -1),
|
|
1678
1691
|
s("span", null, "Cargando...", -1)
|
|
1679
|
-
])])) : t.searchable ? (l(), a("div",
|
|
1680
|
-
|
|
1692
|
+
])])) : t.searchable ? (l(), a("div", Dl, [
|
|
1693
|
+
me(s("input", {
|
|
1681
1694
|
ref_key: "searchInput",
|
|
1682
|
-
ref:
|
|
1683
|
-
"onUpdate:modelValue":
|
|
1695
|
+
ref: p,
|
|
1696
|
+
"onUpdate:modelValue": u[0] || (u[0] = ($) => f.value = $),
|
|
1684
1697
|
type: "text",
|
|
1685
1698
|
class: "w-full px-3 py-2 text-sm border border-secondary-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
1686
1699
|
placeholder: t.searchPlaceholder,
|
|
1687
|
-
onKeydown:
|
|
1700
|
+
onKeydown: u[1] || (u[1] = J(() => {
|
|
1688
1701
|
}, ["stop"]))
|
|
1689
|
-
}, null, 40,
|
|
1690
|
-
[Ee,
|
|
1702
|
+
}, null, 40, Vl), [
|
|
1703
|
+
[Ee, f.value]
|
|
1691
1704
|
])
|
|
1692
|
-
])) :
|
|
1693
|
-
t.loading ?
|
|
1694
|
-
z.value.length === 0 ? (l(), a("div",
|
|
1695
|
-
(l(!0), a(K, null, G(z.value, (
|
|
1696
|
-
key:
|
|
1705
|
+
])) : c("", !0),
|
|
1706
|
+
t.loading ? c("", !0) : (l(), a("div", Tl, [
|
|
1707
|
+
z.value.length === 0 ? (l(), a("div", Sl, D(t.emptyText), 1)) : (l(), a(K, { key: 1 }, [
|
|
1708
|
+
(l(!0), a(K, null, G(z.value, ($) => (l(), a("button", {
|
|
1709
|
+
key: $.value,
|
|
1697
1710
|
type: "button",
|
|
1698
|
-
class:
|
|
1699
|
-
onClick: (
|
|
1711
|
+
class: n(F($)),
|
|
1712
|
+
onClick: (d) => I($)
|
|
1700
1713
|
}, [
|
|
1701
|
-
s("div",
|
|
1702
|
-
s("span",
|
|
1703
|
-
|
|
1714
|
+
s("div", jl, [
|
|
1715
|
+
s("span", Ll, D($.label), 1),
|
|
1716
|
+
O($) ? (l(), a("svg", Ol, [...u[5] || (u[5] = [
|
|
1704
1717
|
s("path", {
|
|
1705
1718
|
"stroke-linecap": "round",
|
|
1706
1719
|
"stroke-linejoin": "round",
|
|
1707
1720
|
"stroke-width": "2",
|
|
1708
1721
|
d: "M5 13l4 4L19 7"
|
|
1709
1722
|
}, null, -1)
|
|
1710
|
-
])])) :
|
|
1723
|
+
])])) : c("", !0)
|
|
1711
1724
|
])
|
|
1712
|
-
], 10,
|
|
1713
|
-
t.actionItems.length > 0 ? (l(), a("div",
|
|
1714
|
-
(l(!0), a(K, null, G(t.actionItems, (
|
|
1715
|
-
key:
|
|
1725
|
+
], 10, Il))), 128)),
|
|
1726
|
+
t.actionItems.length > 0 ? (l(), a("div", Al)) : c("", !0),
|
|
1727
|
+
(l(!0), a(K, null, G(t.actionItems, ($) => (l(), a("button", {
|
|
1728
|
+
key: $.id,
|
|
1716
1729
|
type: "button",
|
|
1717
|
-
class:
|
|
1718
|
-
onClick: (
|
|
1730
|
+
class: n(j($)),
|
|
1731
|
+
onClick: (d) => W($)
|
|
1719
1732
|
}, [
|
|
1720
|
-
|
|
1733
|
+
$.icon ? (l(), a("svg", {
|
|
1721
1734
|
key: 0,
|
|
1722
1735
|
class: "w-4 h-4 flex-shrink-0",
|
|
1723
1736
|
fill: "none",
|
|
1724
1737
|
stroke: "currentColor",
|
|
1725
1738
|
viewBox: "0 0 24 24",
|
|
1726
1739
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1727
|
-
innerHTML:
|
|
1728
|
-
}, null, 8,
|
|
1729
|
-
Y(" " +
|
|
1730
|
-
], 10,
|
|
1740
|
+
innerHTML: $.icon
|
|
1741
|
+
}, null, 8, Wl)) : c("", !0),
|
|
1742
|
+
Y(" " + D($.label), 1)
|
|
1743
|
+
], 10, Fl))), 128))
|
|
1731
1744
|
], 64))
|
|
1732
1745
|
]))
|
|
1733
|
-
], 2)) :
|
|
1746
|
+
], 2)) : c("", !0)
|
|
1734
1747
|
], 2),
|
|
1735
|
-
t.error ? (l(), a("p",
|
|
1736
|
-
|
|
1748
|
+
t.error ? (l(), a("p", ql, D(t.error), 1)) : t.helperText ? (l(), a("p", Pl, D(t.helperText), 1)) : c("", !0),
|
|
1749
|
+
o.value ? (l(), a("div", {
|
|
1737
1750
|
key: 3,
|
|
1738
|
-
onClick:
|
|
1751
|
+
onClick: S,
|
|
1739
1752
|
class: "fixed inset-0 z-40"
|
|
1740
|
-
})) :
|
|
1753
|
+
})) : c("", !0)
|
|
1741
1754
|
], 2));
|
|
1742
1755
|
}
|
|
1743
|
-
}),
|
|
1756
|
+
}), Qa = /* @__PURE__ */ Z(Rl, [["__scopeId", "data-v-7fce9a5d"]]), El = ["title"], Yl = {
|
|
1744
1757
|
key: 0,
|
|
1745
1758
|
class: "space-y-1"
|
|
1746
|
-
},
|
|
1759
|
+
}, Nl = ["href", "onClick", "aria-current"], Hl = { key: 2 }, Kl = /* @__PURE__ */ N({
|
|
1747
1760
|
__name: "Sidebar",
|
|
1748
1761
|
props: {
|
|
1749
1762
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1767,80 +1780,80 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1767
1780
|
scrimOpacity: { default: 0.5 }
|
|
1768
1781
|
},
|
|
1769
1782
|
emits: ["update:modelValue", "update:activeItem", "update:collapsed", "close", "open", "itemClick", "toggleCollapse"],
|
|
1770
|
-
setup(t, { emit:
|
|
1771
|
-
const e = t,
|
|
1783
|
+
setup(t, { emit: b }) {
|
|
1784
|
+
const e = t, m = P(e.collapsed), o = r(() => e.mini || m.value), f = b, p = r({
|
|
1772
1785
|
get: () => e.modelValue,
|
|
1773
|
-
set: (
|
|
1774
|
-
}),
|
|
1775
|
-
const
|
|
1776
|
-
!e.persistent && !
|
|
1777
|
-
},
|
|
1778
|
-
|
|
1786
|
+
set: (k) => f("update:modelValue", k)
|
|
1787
|
+
}), i = (k = !1) => {
|
|
1788
|
+
const y = e.keepOpen && !k;
|
|
1789
|
+
!e.persistent && !y && (p.value = !1, f("close"));
|
|
1790
|
+
}, v = () => {
|
|
1791
|
+
m.value = !m.value, f("update:collapsed", m.value), f("toggleCollapse");
|
|
1779
1792
|
};
|
|
1780
1793
|
de(
|
|
1781
1794
|
() => e.collapsed,
|
|
1782
|
-
(
|
|
1783
|
-
|
|
1795
|
+
(k) => {
|
|
1796
|
+
m.value = k;
|
|
1784
1797
|
},
|
|
1785
1798
|
{ immediate: !0 }
|
|
1786
1799
|
);
|
|
1787
|
-
const z = (
|
|
1788
|
-
|
|
1789
|
-
},
|
|
1790
|
-
const
|
|
1791
|
-
return `${
|
|
1792
|
-
},
|
|
1793
|
-
const
|
|
1794
|
-
return `${
|
|
1795
|
-
},
|
|
1796
|
-
const
|
|
1797
|
-
return [
|
|
1798
|
-
}),
|
|
1800
|
+
const z = (k, y) => {
|
|
1801
|
+
y.id && f("update:activeItem", y.id), y.onClick && (k.preventDefault(), y.onClick(y)), f("itemClick", y), !e.keepOpen && !e.persistent && i();
|
|
1802
|
+
}, w = (k) => k.active !== void 0 ? k.active : e.activeItem && k.id ? e.activeItem === k.id : !1, g = (k) => {
|
|
1803
|
+
const y = o.value ? "flex items-center justify-center p-3 rounded-lg transition-all duration-200" : "flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200 text-sm font-medium", u = w(k) ? o.value ? "bg-primary-100 text-primary-700" : "bg-primary-100 text-primary-700 border-l-4 border-primary-600" : "text-gray-700 hover:bg-gray-100 hover:text-gray-900";
|
|
1804
|
+
return `${y} ${u}`;
|
|
1805
|
+
}, B = (k) => {
|
|
1806
|
+
const y = "w-5 h-5 flex-shrink-0", u = w(k) ? "text-primary-600" : "text-gray-500";
|
|
1807
|
+
return `${y} ${u}`;
|
|
1808
|
+
}, C = r(() => e.position === "left" ? "slide-right" : "slide-left"), F = r(() => {
|
|
1809
|
+
const k = "fixed top-0 h-full z-50 flex flex-col w-full max-w-full sm:max-w-none transition-all duration-300", y = e.position === "left" ? "left-0" : "right-0", u = e.shadow ? e.position === "left" ? "shadow-[2px_0_8px_rgba(0,0,0,0.1)]" : "shadow-[-2px_0_8px_rgba(0,0,0,0.1)]" : "", $ = e.bordered ? "border-r border-gray-200" : "";
|
|
1810
|
+
return [k, y, u, $].filter(Boolean).join(" ");
|
|
1811
|
+
}), j = r(() => ({
|
|
1799
1812
|
width: "100%",
|
|
1800
|
-
maxWidth: e.mini ||
|
|
1813
|
+
maxWidth: e.mini || m.value ? e.miniWidth : e.width,
|
|
1801
1814
|
backgroundColor: e.backgroundColor,
|
|
1802
1815
|
top: e.overlayTop,
|
|
1803
1816
|
height: e.overlayTop !== "0" ? `calc(100vh - ${e.overlayTop})` : "100vh"
|
|
1804
|
-
})),
|
|
1817
|
+
})), O = {
|
|
1805
1818
|
none: "",
|
|
1806
1819
|
sm: "p-2",
|
|
1807
1820
|
md: "p-4",
|
|
1808
1821
|
lg: "p-6"
|
|
1809
|
-
},
|
|
1810
|
-
return (
|
|
1822
|
+
}, q = r(() => `flex items-center justify-between border-b border-gray-200 ${o.value ? "p-2" : O[e.padding]}`), S = r(() => o.value ? "flex gap-1 items-center" : "flex gap-2 items-center"), I = r(() => o.value ? "p-1.5 hover:bg-gray-100 rounded-md transition-colors" : "p-2 hover:bg-gray-100 rounded-md transition-colors"), W = r(() => `flex-1 overflow-y-auto ${O[e.padding]}`), A = r(() => `border-t border-gray-200 ${O[e.padding]}`);
|
|
1823
|
+
return (k, y) => (l(), te(ye, { to: "body" }, [
|
|
1811
1824
|
Q(ie, { name: "fade" }, {
|
|
1812
1825
|
default: re(() => [
|
|
1813
|
-
|
|
1826
|
+
p.value && t.overlay && !t.keepOpen ? (l(), a("div", {
|
|
1814
1827
|
key: 0,
|
|
1815
|
-
onClick:
|
|
1828
|
+
onClick: y[0] || (y[0] = (u) => i()),
|
|
1816
1829
|
class: "fixed inset-0 z-40",
|
|
1817
1830
|
style: X({ top: t.overlayTop, backgroundColor: `rgba(0, 0, 0, ${t.scrimOpacity || 0.5})` })
|
|
1818
|
-
}, null, 4)) :
|
|
1831
|
+
}, null, 4)) : c("", !0)
|
|
1819
1832
|
]),
|
|
1820
1833
|
_: 1
|
|
1821
1834
|
}),
|
|
1822
|
-
Q(ie, { name:
|
|
1835
|
+
Q(ie, { name: C.value }, {
|
|
1823
1836
|
default: re(() => [
|
|
1824
|
-
|
|
1837
|
+
p.value ? (l(), a("aside", {
|
|
1825
1838
|
key: 0,
|
|
1826
|
-
class:
|
|
1827
|
-
style: X(
|
|
1839
|
+
class: n(F.value),
|
|
1840
|
+
style: X(j.value)
|
|
1828
1841
|
}, [
|
|
1829
|
-
|
|
1842
|
+
k.$slots.header ? (l(), a("div", {
|
|
1830
1843
|
key: 0,
|
|
1831
|
-
class:
|
|
1844
|
+
class: n(q.value)
|
|
1832
1845
|
}, [
|
|
1833
|
-
|
|
1846
|
+
L(k.$slots, "header", {}, void 0, !0),
|
|
1834
1847
|
s("div", {
|
|
1835
|
-
class:
|
|
1848
|
+
class: n(S.value)
|
|
1836
1849
|
}, [
|
|
1837
1850
|
t.collapsible ? (l(), a("button", {
|
|
1838
1851
|
key: 0,
|
|
1839
|
-
onClick:
|
|
1840
|
-
class:
|
|
1841
|
-
title:
|
|
1852
|
+
onClick: v,
|
|
1853
|
+
class: n(I.value),
|
|
1854
|
+
title: m.value ? "Expandir" : "Contraer",
|
|
1842
1855
|
"aria-label": "Toggle sidebar collapse"
|
|
1843
|
-
}, [...
|
|
1856
|
+
}, [...y[2] || (y[2] = [
|
|
1844
1857
|
s("svg", {
|
|
1845
1858
|
class: "w-5 h-5",
|
|
1846
1859
|
fill: "none",
|
|
@@ -1854,13 +1867,13 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1854
1867
|
d: "M15 19l-7-7 7-7"
|
|
1855
1868
|
})
|
|
1856
1869
|
], -1)
|
|
1857
|
-
])], 10,
|
|
1870
|
+
])], 10, El)) : c("", !0),
|
|
1858
1871
|
t.closable ? (l(), a("button", {
|
|
1859
1872
|
key: 1,
|
|
1860
|
-
onClick:
|
|
1861
|
-
class:
|
|
1873
|
+
onClick: y[1] || (y[1] = (u) => i(!0)),
|
|
1874
|
+
class: n(I.value),
|
|
1862
1875
|
"aria-label": "Cerrar menú"
|
|
1863
|
-
}, [...
|
|
1876
|
+
}, [...y[3] || (y[3] = [
|
|
1864
1877
|
s("svg", {
|
|
1865
1878
|
class: "w-5 h-5",
|
|
1866
1879
|
fill: "none",
|
|
@@ -1874,68 +1887,68 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1874
1887
|
d: "M6 18L18 6M6 6l12 12"
|
|
1875
1888
|
})
|
|
1876
1889
|
], -1)
|
|
1877
|
-
])], 2)) :
|
|
1890
|
+
])], 2)) : c("", !0)
|
|
1878
1891
|
], 2)
|
|
1879
|
-
], 2)) :
|
|
1892
|
+
], 2)) : c("", !0),
|
|
1880
1893
|
s("div", {
|
|
1881
|
-
class:
|
|
1894
|
+
class: n(W.value)
|
|
1882
1895
|
}, [
|
|
1883
|
-
t.items && t.items.length ? (l(), a("nav",
|
|
1884
|
-
(l(!0), a(K, null, G(t.items, (
|
|
1885
|
-
key:
|
|
1886
|
-
href:
|
|
1887
|
-
onClick: (
|
|
1888
|
-
class:
|
|
1889
|
-
"aria-current":
|
|
1896
|
+
t.items && t.items.length ? (l(), a("nav", Yl, [
|
|
1897
|
+
(l(!0), a(K, null, G(t.items, (u) => (l(), a("a", {
|
|
1898
|
+
key: u.id || u.label,
|
|
1899
|
+
href: u.href,
|
|
1900
|
+
onClick: ($) => z($, u),
|
|
1901
|
+
class: n(g(u)),
|
|
1902
|
+
"aria-current": w(u) ? "page" : void 0
|
|
1890
1903
|
}, [
|
|
1891
|
-
|
|
1904
|
+
u.icon && typeof u.icon == "string" ? (l(), te(_, {
|
|
1892
1905
|
key: 0,
|
|
1893
|
-
name:
|
|
1906
|
+
name: u.icon,
|
|
1894
1907
|
size: "md",
|
|
1895
|
-
class:
|
|
1896
|
-
}, null, 8, ["name", "class"])) :
|
|
1908
|
+
class: n(B(u))
|
|
1909
|
+
}, null, 8, ["name", "class"])) : u.icon ? (l(), te(he(u.icon), {
|
|
1897
1910
|
key: 1,
|
|
1898
|
-
class:
|
|
1899
|
-
}, null, 8, ["class"])) :
|
|
1900
|
-
|
|
1901
|
-
], 10,
|
|
1902
|
-
])) :
|
|
1903
|
-
|
|
1911
|
+
class: n(B(u))
|
|
1912
|
+
}, null, 8, ["class"])) : c("", !0),
|
|
1913
|
+
o.value ? c("", !0) : (l(), a("span", Hl, D(u.label), 1))
|
|
1914
|
+
], 10, Nl))), 128))
|
|
1915
|
+
])) : c("", !0),
|
|
1916
|
+
L(k.$slots, "default", {}, void 0, !0)
|
|
1904
1917
|
], 2),
|
|
1905
|
-
|
|
1918
|
+
k.$slots.footer ? (l(), a("div", {
|
|
1906
1919
|
key: 1,
|
|
1907
|
-
class:
|
|
1920
|
+
class: n(A.value)
|
|
1908
1921
|
}, [
|
|
1909
|
-
|
|
1910
|
-
], 2)) :
|
|
1911
|
-
], 6)) :
|
|
1922
|
+
L(k.$slots, "footer", {}, void 0, !0)
|
|
1923
|
+
], 2)) : c("", !0)
|
|
1924
|
+
], 6)) : c("", !0)
|
|
1912
1925
|
]),
|
|
1913
1926
|
_: 3
|
|
1914
1927
|
}, 8, ["name"])
|
|
1915
1928
|
]));
|
|
1916
1929
|
}
|
|
1917
|
-
}),
|
|
1930
|
+
}), Za = /* @__PURE__ */ Z(Kl, [["__scopeId", "data-v-1431a87b"]]), Ul = { class: "w-full space-y-4" }, Jl = { class: "flex flex-col gap-3 md:hidden" }, Gl = {
|
|
1918
1931
|
key: 0,
|
|
1919
1932
|
class: "flex items-center gap-2 px-1 text-sm text-gray-600"
|
|
1920
|
-
},
|
|
1933
|
+
}, Ql = ["checked", "indeterminate"], Zl = {
|
|
1921
1934
|
key: 0,
|
|
1922
1935
|
class: "flex items-center gap-2 pb-2"
|
|
1923
|
-
},
|
|
1936
|
+
}, Xl = ["checked", "onChange", "aria-label"], _l = { class: "text-[11px] uppercase tracking-wide text-gray-400" }, ea = { class: "text-sm text-gray-700" }, ta = {
|
|
1924
1937
|
key: 1,
|
|
1925
1938
|
class: "rounded-lg border border-dashed border-gray-200 bg-white p-4 text-gray-400 text-center"
|
|
1926
|
-
},
|
|
1939
|
+
}, la = { class: "hidden md:block w-full overflow-x-auto" }, aa = { class: "w-full border-collapse" }, sa = { class: "w-full" }, oa = {
|
|
1927
1940
|
key: 0,
|
|
1928
1941
|
class: "px-3 py-3 text-left text-xs font-semibold text-gray-700 border-l border-gray-100 first:border-l-0 w-10"
|
|
1929
|
-
},
|
|
1942
|
+
}, ra = ["checked", "indeterminate"], na = ["onClick"], ia = { class: "flex items-center gap-2" }, da = {
|
|
1930
1943
|
key: 0,
|
|
1931
1944
|
class: "text-xs text-gray-400"
|
|
1932
|
-
},
|
|
1945
|
+
}, ua = { key: 0 }, ca = { key: 1 }, fa = { class: "w-full" }, pa = ["checked", "onChange", "aria-label"], ma = {
|
|
1933
1946
|
key: 0,
|
|
1934
1947
|
class: "flex items-center justify-center py-12 text-gray-400"
|
|
1935
|
-
},
|
|
1948
|
+
}, va = {
|
|
1936
1949
|
key: 0,
|
|
1937
1950
|
class: "w-full px-6 py-4 bg-white"
|
|
1938
|
-
},
|
|
1951
|
+
}, ba = /* @__PURE__ */ N({
|
|
1939
1952
|
__name: "Table",
|
|
1940
1953
|
props: {
|
|
1941
1954
|
columns: {},
|
|
@@ -1952,250 +1965,253 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
1952
1965
|
hover: { type: Boolean, default: !0 }
|
|
1953
1966
|
},
|
|
1954
1967
|
emits: ["update:selectedKeys"],
|
|
1955
|
-
setup(t, { emit:
|
|
1956
|
-
const e = t,
|
|
1968
|
+
setup(t, { emit: b }) {
|
|
1969
|
+
const e = t, m = r(() => ({
|
|
1957
1970
|
compact: "py-1.5",
|
|
1958
1971
|
normal: "py-3",
|
|
1959
1972
|
spacious: "py-5"
|
|
1960
|
-
})[e.density]),
|
|
1961
|
-
|
|
1962
|
-
},
|
|
1963
|
-
if (!
|
|
1973
|
+
})[e.density]), o = r(() => e.striped), f = r(() => e.hover), p = b, i = P(null), v = P("asc"), z = (u) => {
|
|
1974
|
+
i.value === u ? v.value = v.value === "asc" ? "desc" : "asc" : (i.value = u, v.value = "asc");
|
|
1975
|
+
}, w = r(() => {
|
|
1976
|
+
if (!i.value)
|
|
1964
1977
|
return e.data;
|
|
1965
|
-
const
|
|
1966
|
-
return
|
|
1967
|
-
const
|
|
1968
|
-
return typeof
|
|
1969
|
-
}),
|
|
1970
|
-
}),
|
|
1978
|
+
const u = [...e.data];
|
|
1979
|
+
return u.sort(($, d) => {
|
|
1980
|
+
const V = $[i.value], x = d[i.value];
|
|
1981
|
+
return typeof V == "string" && typeof x == "string" ? v.value === "asc" ? V.localeCompare(x) : x.localeCompare(V) : typeof V == "number" && typeof x == "number" ? v.value === "asc" ? V - x : x - V : 0;
|
|
1982
|
+
}), u;
|
|
1983
|
+
}), g = r(() => e.columns.filter((u) => !u.hideOnMobile)), B = r(() => e.selectable), C = r({
|
|
1971
1984
|
get: () => e.selectedKeys || [],
|
|
1972
|
-
set: (
|
|
1973
|
-
}),
|
|
1974
|
-
const
|
|
1975
|
-
return (
|
|
1976
|
-
},
|
|
1977
|
-
|
|
1978
|
-
},
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
1981
|
-
},
|
|
1982
|
-
if (!
|
|
1983
|
-
const
|
|
1984
|
-
|
|
1985
|
-
},
|
|
1986
|
-
const
|
|
1987
|
-
return !!(
|
|
1988
|
-
},
|
|
1989
|
-
|
|
1990
|
-
},
|
|
1991
|
-
|
|
1985
|
+
set: (u) => p("update:selectedKeys", u)
|
|
1986
|
+
}), F = (u, $) => {
|
|
1987
|
+
const d = e.rowKey;
|
|
1988
|
+
return (d && u ? u[d] : void 0) ?? $;
|
|
1989
|
+
}, j = r(() => w.value.map((u, $) => F(u, $))), O = r(() => j.value.length > 0 && j.value.every((u) => C.value.includes(u))), q = r(() => !O.value && C.value.length > 0), S = (u) => {
|
|
1990
|
+
B.value && (C.value = u ? [...j.value] : []);
|
|
1991
|
+
}, I = (u, $) => {
|
|
1992
|
+
const d = F(u, $);
|
|
1993
|
+
return C.value.includes(d);
|
|
1994
|
+
}, W = (u, $, d) => {
|
|
1995
|
+
if (!B.value) return;
|
|
1996
|
+
const V = F(u, $), x = new Set(C.value);
|
|
1997
|
+
d ? x.add(V) : x.delete(V), C.value = Array.from(x);
|
|
1998
|
+
}, A = (u) => {
|
|
1999
|
+
const $ = u.target;
|
|
2000
|
+
return !!($ != null && $.checked);
|
|
2001
|
+
}, k = (u) => {
|
|
2002
|
+
S(A(u));
|
|
2003
|
+
}, y = (u, $, d) => {
|
|
2004
|
+
W(u, $, A(d));
|
|
1992
2005
|
};
|
|
1993
|
-
return (
|
|
1994
|
-
s("div",
|
|
1995
|
-
|
|
2006
|
+
return (u, $) => (l(), a("div", Ul, [
|
|
2007
|
+
s("div", Jl, [
|
|
2008
|
+
B.value ? (l(), a("div", Gl, [
|
|
1996
2009
|
s("input", {
|
|
1997
2010
|
type: "checkbox",
|
|
1998
2011
|
class: "h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500",
|
|
1999
|
-
checked:
|
|
2000
|
-
indeterminate:
|
|
2001
|
-
onChange:
|
|
2012
|
+
checked: O.value,
|
|
2013
|
+
indeterminate: q.value,
|
|
2014
|
+
onChange: k,
|
|
2002
2015
|
"aria-label": "Seleccionar todas las filas"
|
|
2003
|
-
}, null, 40,
|
|
2004
|
-
|
|
2005
|
-
])) :
|
|
2006
|
-
(l(!0), a(K, null, G(
|
|
2007
|
-
key: `card-${
|
|
2016
|
+
}, null, 40, Ql),
|
|
2017
|
+
$[0] || ($[0] = s("span", null, "Seleccionar todas", -1))
|
|
2018
|
+
])) : c("", !0),
|
|
2019
|
+
(l(!0), a(K, null, G(w.value, (d, V) => (l(), a("div", {
|
|
2020
|
+
key: `card-${V}`,
|
|
2008
2021
|
class: "rounded-lg border border-gray-200 bg-white p-4 shadow-sm"
|
|
2009
2022
|
}, [
|
|
2010
|
-
|
|
2023
|
+
B.value ? (l(), a("div", Zl, [
|
|
2011
2024
|
s("input", {
|
|
2012
2025
|
type: "checkbox",
|
|
2013
2026
|
class: "h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500",
|
|
2014
|
-
checked:
|
|
2015
|
-
onChange: (x) =>
|
|
2016
|
-
"aria-label": `Seleccionar fila ${
|
|
2017
|
-
}, null, 40,
|
|
2018
|
-
|
|
2019
|
-
])) :
|
|
2020
|
-
(l(!0), a(K, null, G(
|
|
2021
|
-
key: `card-${
|
|
2027
|
+
checked: I(d, V),
|
|
2028
|
+
onChange: (x) => y(d, V, x),
|
|
2029
|
+
"aria-label": `Seleccionar fila ${V + 1}`
|
|
2030
|
+
}, null, 40, Xl),
|
|
2031
|
+
$[1] || ($[1] = s("span", { class: "text-sm text-gray-700" }, "Seleccionar fila", -1))
|
|
2032
|
+
])) : c("", !0),
|
|
2033
|
+
(l(!0), a(K, null, G(g.value, (x) => (l(), a("div", {
|
|
2034
|
+
key: `card-${V}-${x.key}`,
|
|
2022
2035
|
class: "flex flex-col gap-1 py-1"
|
|
2023
2036
|
}, [
|
|
2024
|
-
s("span",
|
|
2025
|
-
s("span",
|
|
2026
|
-
|
|
2027
|
-
value:
|
|
2028
|
-
row:
|
|
2037
|
+
s("span", _l, D(x.label), 1),
|
|
2038
|
+
s("span", ea, [
|
|
2039
|
+
L(u.$slots, `cell-${x.key}`, {
|
|
2040
|
+
value: d[x.key],
|
|
2041
|
+
row: d
|
|
2029
2042
|
}, () => [
|
|
2030
|
-
Y(
|
|
2043
|
+
Y(D(d[x.key]), 1)
|
|
2031
2044
|
], !0)
|
|
2032
2045
|
])
|
|
2033
2046
|
]))), 128))
|
|
2034
2047
|
]))), 128)),
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2048
|
+
w.value.length === 0 ? (l(), a("div", ta, [
|
|
2049
|
+
L(u.$slots, "empty", {}, () => [
|
|
2050
|
+
$[2] || ($[2] = Y("No hay datos disponibles", -1))
|
|
2038
2051
|
], !0)
|
|
2039
|
-
])) :
|
|
2052
|
+
])) : c("", !0)
|
|
2040
2053
|
]),
|
|
2041
|
-
s("div",
|
|
2042
|
-
s("table",
|
|
2043
|
-
s("thead",
|
|
2054
|
+
s("div", la, [
|
|
2055
|
+
s("table", aa, [
|
|
2056
|
+
s("thead", sa, [
|
|
2044
2057
|
s("tr", {
|
|
2045
|
-
class:
|
|
2058
|
+
class: n([
|
|
2046
2059
|
"w-full bg-neutral-50 border-b border-gray-100",
|
|
2047
2060
|
e.headerClass || ""
|
|
2048
2061
|
])
|
|
2049
2062
|
}, [
|
|
2050
|
-
|
|
2063
|
+
B.value ? (l(), a("th", oa, [
|
|
2051
2064
|
s("input", {
|
|
2052
2065
|
type: "checkbox",
|
|
2053
2066
|
class: "h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500",
|
|
2054
|
-
checked:
|
|
2055
|
-
indeterminate:
|
|
2056
|
-
onChange:
|
|
2067
|
+
checked: O.value,
|
|
2068
|
+
indeterminate: q.value,
|
|
2069
|
+
onChange: k,
|
|
2057
2070
|
"aria-label": "Seleccionar todas las filas"
|
|
2058
|
-
}, null, 40,
|
|
2059
|
-
])) :
|
|
2060
|
-
(l(!0), a(K, null, G(t.columns, (
|
|
2061
|
-
key:
|
|
2062
|
-
style: X(
|
|
2063
|
-
class:
|
|
2071
|
+
}, null, 40, ra)
|
|
2072
|
+
])) : c("", !0),
|
|
2073
|
+
(l(!0), a(K, null, G(t.columns, (d) => (l(), a("th", {
|
|
2074
|
+
key: d.key,
|
|
2075
|
+
style: X(d.width ? { width: d.width } : {}),
|
|
2076
|
+
class: n([
|
|
2064
2077
|
"px-4 py-3 text-left text-xs font-semibold text-gray-700 border-l border-gray-100 first:border-l-0",
|
|
2065
|
-
|
|
2078
|
+
d.sortable ? "cursor-pointer hover:text-primary-600 select-none transition-colors" : "",
|
|
2066
2079
|
e.headerClass,
|
|
2067
2080
|
e.headerCellClass
|
|
2068
2081
|
]),
|
|
2069
|
-
onClick: (
|
|
2082
|
+
onClick: (V) => d.sortable && z(d.key)
|
|
2070
2083
|
}, [
|
|
2071
|
-
s("div",
|
|
2072
|
-
s("span", null,
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
])) :
|
|
2084
|
+
s("div", ia, [
|
|
2085
|
+
s("span", null, D(d.label), 1),
|
|
2086
|
+
d.sortable ? (l(), a("span", da, [
|
|
2087
|
+
i.value !== d.key ? (l(), a("span", ua, "⇅")) : (l(), a("span", ca, D(v.value === "asc" ? "↑" : "↓"), 1))
|
|
2088
|
+
])) : c("", !0)
|
|
2076
2089
|
])
|
|
2077
|
-
], 14,
|
|
2090
|
+
], 14, na))), 128))
|
|
2078
2091
|
], 2)
|
|
2079
2092
|
]),
|
|
2080
|
-
s("tbody",
|
|
2081
|
-
(l(!0), a(K, null, G(
|
|
2082
|
-
key:
|
|
2083
|
-
class:
|
|
2093
|
+
s("tbody", fa, [
|
|
2094
|
+
(l(!0), a(K, null, G(w.value, (d, V) => (l(), a("tr", {
|
|
2095
|
+
key: V,
|
|
2096
|
+
class: n([
|
|
2084
2097
|
"w-full border-b border-gray-200 transition-colors bg-white",
|
|
2085
|
-
|
|
2086
|
-
|
|
2098
|
+
o.value && V % 2 === 1 ? "bg-gray-50" : "",
|
|
2099
|
+
f.value ? "hover:bg-blue-50" : "",
|
|
2087
2100
|
e.rowClass,
|
|
2088
|
-
|
|
2101
|
+
m.value
|
|
2089
2102
|
])
|
|
2090
2103
|
}, [
|
|
2091
|
-
|
|
2104
|
+
B.value ? (l(), a("td", {
|
|
2092
2105
|
key: 0,
|
|
2093
|
-
class:
|
|
2106
|
+
class: n(["px-3 text-xs text-gray-600 border-l border-gray-100 first:border-l-0 w-10", m.value])
|
|
2094
2107
|
}, [
|
|
2095
2108
|
s("input", {
|
|
2096
2109
|
type: "checkbox",
|
|
2097
2110
|
class: "h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500",
|
|
2098
|
-
checked:
|
|
2099
|
-
onChange: (x) =>
|
|
2100
|
-
"aria-label": `Seleccionar fila ${
|
|
2101
|
-
}, null, 40,
|
|
2102
|
-
], 2)) :
|
|
2111
|
+
checked: I(d, V),
|
|
2112
|
+
onChange: (x) => y(d, V, x),
|
|
2113
|
+
"aria-label": `Seleccionar fila ${V + 1}`
|
|
2114
|
+
}, null, 40, pa)
|
|
2115
|
+
], 2)) : c("", !0),
|
|
2103
2116
|
(l(!0), a(K, null, G(t.columns, (x) => (l(), a("td", {
|
|
2104
|
-
key: `${
|
|
2105
|
-
class:
|
|
2117
|
+
key: `${V}-${x.key}`,
|
|
2118
|
+
class: n([
|
|
2106
2119
|
"px-4 text-xs text-gray-600 border-l border-gray-100 first:border-l-0 bg-white",
|
|
2107
2120
|
e.rowClass,
|
|
2108
2121
|
e.cellClass,
|
|
2109
|
-
|
|
2122
|
+
m.value
|
|
2110
2123
|
])
|
|
2111
2124
|
}, [
|
|
2112
|
-
|
|
2113
|
-
value:
|
|
2114
|
-
row:
|
|
2125
|
+
L(u.$slots, `cell-${x.key}`, {
|
|
2126
|
+
value: d[x.key],
|
|
2127
|
+
row: d
|
|
2115
2128
|
}, () => [
|
|
2116
|
-
Y(
|
|
2129
|
+
Y(D(d[x.key]), 1)
|
|
2117
2130
|
], !0)
|
|
2118
2131
|
], 2))), 128))
|
|
2119
2132
|
], 2))), 128))
|
|
2120
2133
|
])
|
|
2121
2134
|
]),
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2135
|
+
w.value.length === 0 ? (l(), a("div", ma, [
|
|
2136
|
+
L(u.$slots, "empty", {}, () => [
|
|
2137
|
+
$[3] || ($[3] = Y("No hay datos disponibles", -1))
|
|
2125
2138
|
], !0)
|
|
2126
|
-
])) :
|
|
2139
|
+
])) : c("", !0)
|
|
2127
2140
|
]),
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
])) :
|
|
2141
|
+
u.$slots.footer ? (l(), a("div", va, [
|
|
2142
|
+
L(u.$slots, "footer", {}, void 0, !0)
|
|
2143
|
+
])) : c("", !0)
|
|
2131
2144
|
]));
|
|
2132
2145
|
}
|
|
2133
|
-
}),
|
|
2146
|
+
}), Xa = /* @__PURE__ */ Z(ba, [["__scopeId", "data-v-9020135c"]]), ga = { class: "tabs-wrapper" }, ya = ["aria-selected", "onClick"], ha = /* @__PURE__ */ N({
|
|
2134
2147
|
__name: "Tabs",
|
|
2135
2148
|
props: {
|
|
2136
2149
|
modelValue: {},
|
|
2137
2150
|
tabs: {},
|
|
2138
2151
|
headerClass: {},
|
|
2139
2152
|
contentClass: {},
|
|
2140
|
-
variant: { default: "default" }
|
|
2153
|
+
variant: { default: "default" },
|
|
2154
|
+
compact: { type: Boolean, default: !1 }
|
|
2141
2155
|
},
|
|
2142
2156
|
emits: ["update:modelValue"],
|
|
2143
|
-
setup(t, { emit:
|
|
2144
|
-
const e = t,
|
|
2157
|
+
setup(t, { emit: b }) {
|
|
2158
|
+
const e = t, m = b, o = r(
|
|
2159
|
+
() => e.compact ? "relative w-full sm:w-auto text-left sm:text-center px-3 sm:px-4 py-2 text-sm tracking-wide transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary-500" : "relative w-full sm:w-auto text-left sm:text-center px-4 sm:px-6 py-3 text-base tracking-wide transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary-500"
|
|
2160
|
+
), f = r(() => ({
|
|
2145
2161
|
default: "border-b-3",
|
|
2146
2162
|
bordered: "border border-secondary-200 rounded-t-lg",
|
|
2147
2163
|
pill: "rounded-full bg-secondary-100 mx-1"
|
|
2148
|
-
})[e.variant]), p =
|
|
2164
|
+
})[e.variant]), p = r(() => ({
|
|
2149
2165
|
default: "border-b border-gray-200",
|
|
2150
2166
|
bordered: "gap-0",
|
|
2151
2167
|
pill: "gap-2 bg-white p-1 rounded-full border border-secondary-200"
|
|
2152
|
-
})[e.variant]),
|
|
2168
|
+
})[e.variant]), i = r(() => ({
|
|
2153
2169
|
default: "text-primary-600 border-primary-600 font-semibold",
|
|
2154
2170
|
bordered: "text-primary-600 border-primary-600 bg-primary-50 font-semibold",
|
|
2155
2171
|
pill: "text-white bg-primary-600 font-semibold"
|
|
2156
|
-
})[e.variant]),
|
|
2172
|
+
})[e.variant]), v = r(() => ({
|
|
2157
2173
|
default: "hover:text-secondary-700 border-transparent font-normal",
|
|
2158
2174
|
bordered: "text-secondary-600 hover:text-primary-600 font-normal",
|
|
2159
2175
|
pill: "text-secondary-600 hover:text-secondary-900 font-normal"
|
|
2160
|
-
})[e.variant]),
|
|
2161
|
-
|
|
2162
|
-
},
|
|
2163
|
-
() => e.tabs.find((
|
|
2176
|
+
})[e.variant]), z = (C) => e.modelValue === C, w = (C) => {
|
|
2177
|
+
z(C) || m("update:modelValue", C);
|
|
2178
|
+
}, g = r(() => e.modelValue), B = r(
|
|
2179
|
+
() => e.tabs.find((C) => C.value === g.value)
|
|
2164
2180
|
);
|
|
2165
|
-
return (
|
|
2181
|
+
return (C, F) => (l(), a("div", ga, [
|
|
2166
2182
|
s("div", {
|
|
2167
|
-
class:
|
|
2183
|
+
class: n(["tabs-header", t.headerClass])
|
|
2168
2184
|
}, [
|
|
2169
2185
|
s("div", {
|
|
2170
|
-
class:
|
|
2186
|
+
class: n(["tabs-container", p.value]),
|
|
2171
2187
|
role: "tablist"
|
|
2172
2188
|
}, [
|
|
2173
|
-
(l(!0), a(K, null, G(t.tabs, (
|
|
2174
|
-
key:
|
|
2189
|
+
(l(!0), a(K, null, G(t.tabs, (j) => (l(), a("button", {
|
|
2190
|
+
key: j.value,
|
|
2175
2191
|
type: "button",
|
|
2176
|
-
class:
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2192
|
+
class: n([
|
|
2193
|
+
o.value,
|
|
2194
|
+
f.value,
|
|
2195
|
+
z(j.value) ? i.value : v.value
|
|
2180
2196
|
]),
|
|
2181
|
-
"aria-selected":
|
|
2197
|
+
"aria-selected": z(j.value),
|
|
2182
2198
|
role: "tab",
|
|
2183
|
-
onClick: (
|
|
2184
|
-
},
|
|
2199
|
+
onClick: (O) => w(j.value)
|
|
2200
|
+
}, D(j.label), 11, ya))), 128))
|
|
2185
2201
|
], 2)
|
|
2186
2202
|
], 2),
|
|
2187
2203
|
s("div", {
|
|
2188
|
-
class:
|
|
2204
|
+
class: n(["tabs-content", t.contentClass]),
|
|
2189
2205
|
role: "tabpanel"
|
|
2190
2206
|
}, [
|
|
2191
|
-
|
|
2192
|
-
active:
|
|
2193
|
-
tab:
|
|
2207
|
+
L(C.$slots, g.value, {
|
|
2208
|
+
active: g.value,
|
|
2209
|
+
tab: B.value
|
|
2194
2210
|
}, void 0, !0)
|
|
2195
2211
|
], 2)
|
|
2196
2212
|
]));
|
|
2197
2213
|
}
|
|
2198
|
-
}),
|
|
2214
|
+
}), _a = /* @__PURE__ */ Z(ha, [["__scopeId", "data-v-17d67e55"]]), xa = "font-sans", es = /* @__PURE__ */ N({
|
|
2199
2215
|
__name: "Text",
|
|
2200
2216
|
props: {
|
|
2201
2217
|
variant: { default: "body1" },
|
|
@@ -2207,7 +2223,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2207
2223
|
weight: {}
|
|
2208
2224
|
},
|
|
2209
2225
|
setup(t) {
|
|
2210
|
-
const
|
|
2226
|
+
const b = {
|
|
2211
2227
|
h1: "text-[40px] leading-[57px] tracking-[0px] font-extrabold",
|
|
2212
2228
|
h2: "text-[40px] leading-[57px] tracking-[0px] font-bold",
|
|
2213
2229
|
h3: "text-[28px] leading-[39px] tracking-[0px] font-extrabold",
|
|
@@ -2247,12 +2263,12 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2247
2263
|
button3: "span",
|
|
2248
2264
|
caption: "span",
|
|
2249
2265
|
overline: "span"
|
|
2250
|
-
},
|
|
2266
|
+
}, m = {
|
|
2251
2267
|
left: "text-left",
|
|
2252
2268
|
center: "text-center",
|
|
2253
2269
|
right: "text-right",
|
|
2254
2270
|
justify: "text-justify"
|
|
2255
|
-
},
|
|
2271
|
+
}, o = {
|
|
2256
2272
|
default: "text-secondary-900",
|
|
2257
2273
|
muted: "text-secondary-600",
|
|
2258
2274
|
primary: "text-primary-600",
|
|
@@ -2260,52 +2276,49 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2260
2276
|
danger: "text-danger-600",
|
|
2261
2277
|
success: "text-success-600",
|
|
2262
2278
|
warning: "text-warning-600"
|
|
2263
|
-
},
|
|
2279
|
+
}, f = {
|
|
2264
2280
|
light: "font-light",
|
|
2265
2281
|
normal: "font-normal",
|
|
2266
2282
|
medium: "font-medium",
|
|
2267
2283
|
semibold: "font-semibold",
|
|
2268
2284
|
bold: "font-bold",
|
|
2269
2285
|
extrabold: "font-extrabold"
|
|
2270
|
-
},
|
|
2286
|
+
}, p = t, i = r(() => p.variant), v = r(() => p.align), z = r(() => p.as || e[i.value] || "span"), w = r(() => p.color && p.color.startsWith("#")), g = r(() => w.value ? "" : o[p.color] || o.default), B = r(() => w.value ? { color: p.color } : {}), C = r(() => p.weight ? { fontWeight: {
|
|
2271
2287
|
light: 300,
|
|
2272
2288
|
normal: 400,
|
|
2273
2289
|
medium: 500,
|
|
2274
2290
|
semibold: 600,
|
|
2275
2291
|
bold: 700,
|
|
2276
2292
|
extrabold: 800
|
|
2277
|
-
}[
|
|
2278
|
-
return (
|
|
2279
|
-
class:
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2293
|
+
}[p.weight] } : {}), F = r(() => p.weight ? f[p.weight] : "");
|
|
2294
|
+
return (j, O) => (l(), te(he(z.value), {
|
|
2295
|
+
class: n([
|
|
2296
|
+
xa,
|
|
2297
|
+
b[i.value],
|
|
2298
|
+
g.value,
|
|
2299
|
+
m[v.value],
|
|
2300
|
+
F.value,
|
|
2285
2301
|
{
|
|
2286
|
-
uppercase: t.uppercase ||
|
|
2302
|
+
uppercase: t.uppercase || i.value === "overline",
|
|
2287
2303
|
truncate: t.truncate
|
|
2288
2304
|
}
|
|
2289
2305
|
]),
|
|
2290
|
-
style: X([
|
|
2306
|
+
style: X([B.value, C.value])
|
|
2291
2307
|
}, {
|
|
2292
2308
|
default: re(() => [
|
|
2293
|
-
|
|
2309
|
+
L(j.$slots, "default")
|
|
2294
2310
|
]),
|
|
2295
2311
|
_: 3
|
|
2296
2312
|
}, 8, ["class", "style"]));
|
|
2297
2313
|
}
|
|
2298
|
-
}),
|
|
2314
|
+
}), wa = { class: "w-full flex items-center justify-between gap-3 py-2" }, ka = {
|
|
2299
2315
|
key: 0,
|
|
2300
2316
|
class: "text-xs pagination-text"
|
|
2301
|
-
},
|
|
2317
|
+
}, Ca = { key: 0 }, $a = {
|
|
2302
2318
|
class: "ml-auto inline-flex items-center gap-1",
|
|
2303
2319
|
role: "navigation",
|
|
2304
2320
|
"aria-label": "Pagination"
|
|
2305
|
-
},
|
|
2306
|
-
key: 0,
|
|
2307
|
-
class: "h-8 min-w-8 px-2 inline-flex items-center justify-center pagination-text"
|
|
2308
|
-
}, Sa = ["aria-label", "onClick"], Ia = ["disabled"], ja = /* @__PURE__ */ N({
|
|
2321
|
+
}, Ba = ["disabled"], za = ["aria-label", "onClick"], Ma = ["disabled"], Da = /* @__PURE__ */ N({
|
|
2309
2322
|
__name: "Pagination",
|
|
2310
2323
|
props: {
|
|
2311
2324
|
modelValue: { default: 1 },
|
|
@@ -2315,77 +2328,91 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2315
2328
|
previousText: { default: "Anterior" },
|
|
2316
2329
|
nextText: { default: "Siguiente" },
|
|
2317
2330
|
showSummary: { type: Boolean, default: !0 },
|
|
2318
|
-
itemLabel: { default: "" }
|
|
2331
|
+
itemLabel: { default: "" },
|
|
2332
|
+
compact: { type: Boolean, default: !1 }
|
|
2319
2333
|
},
|
|
2320
2334
|
emits: ["update:modelValue", "change"],
|
|
2321
|
-
setup(t, { emit:
|
|
2322
|
-
const e = t,
|
|
2323
|
-
const
|
|
2324
|
-
return
|
|
2325
|
-
}),
|
|
2326
|
-
const
|
|
2327
|
-
return
|
|
2328
|
-
}),
|
|
2329
|
-
const
|
|
2330
|
-
if (
|
|
2331
|
-
return Array.from({ length:
|
|
2332
|
-
const
|
|
2333
|
-
let
|
|
2334
|
-
|
|
2335
|
-
const
|
|
2336
|
-
|
|
2337
|
-
for (let
|
|
2338
|
-
|
|
2339
|
-
return
|
|
2335
|
+
setup(t, { emit: b }) {
|
|
2336
|
+
const e = t, m = b, o = r(() => {
|
|
2337
|
+
const g = Math.ceil(e.totalItems / e.pageSize);
|
|
2338
|
+
return g > 0 ? g : 1;
|
|
2339
|
+
}), f = r(() => {
|
|
2340
|
+
const g = Number(e.modelValue || 1);
|
|
2341
|
+
return g < 1 ? 1 : g > o.value ? o.value : g;
|
|
2342
|
+
}), p = r(() => e.totalItems === 0 ? 0 : (f.value - 1) * e.pageSize + 1), i = r(() => Math.min(f.value * e.pageSize, e.totalItems)), v = r(() => `Mostrando ${p.value} a ${i.value} de ${e.totalItems}`), z = r(() => {
|
|
2343
|
+
const g = o.value, B = Math.max(3, e.maxPages), C = f.value;
|
|
2344
|
+
if (g <= B)
|
|
2345
|
+
return Array.from({ length: g }, (S, I) => I + 1);
|
|
2346
|
+
const F = Math.floor(B / 2);
|
|
2347
|
+
let j = Math.max(1, C - F), O = Math.min(g, j + B - 1);
|
|
2348
|
+
j = Math.max(1, Math.min(j, O - B + 1));
|
|
2349
|
+
const q = [];
|
|
2350
|
+
j > 1 && (q.push(1), j > 2 && q.push("…"));
|
|
2351
|
+
for (let S = j; S <= O; S++)
|
|
2352
|
+
q.push(S);
|
|
2353
|
+
return O < g && (O < g - 1 && q.push("…"), q.push(g)), q;
|
|
2340
2354
|
});
|
|
2341
|
-
function
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2355
|
+
function w(g) {
|
|
2356
|
+
const B = Math.max(1, Math.min(g, o.value));
|
|
2357
|
+
B !== f.value && (m("update:modelValue", B), m("change", B));
|
|
2344
2358
|
}
|
|
2345
|
-
return (
|
|
2346
|
-
t.showSummary ? (l(), a("div",
|
|
2347
|
-
|
|
2348
|
-
start:
|
|
2349
|
-
end:
|
|
2359
|
+
return (g, B) => (l(), a("div", wa, [
|
|
2360
|
+
t.showSummary ? (l(), a("div", ka, [
|
|
2361
|
+
L(g.$slots, "summary", {
|
|
2362
|
+
start: p.value,
|
|
2363
|
+
end: i.value,
|
|
2350
2364
|
total: t.totalItems
|
|
2351
2365
|
}, () => [
|
|
2352
|
-
Y(
|
|
2353
|
-
t.itemLabel ? (l(), a("span",
|
|
2366
|
+
Y(D(v.value) + " ", 1),
|
|
2367
|
+
t.itemLabel ? (l(), a("span", Ca, D(t.itemLabel), 1)) : c("", !0)
|
|
2354
2368
|
], !0)
|
|
2355
|
-
])) :
|
|
2356
|
-
s("nav",
|
|
2369
|
+
])) : c("", !0),
|
|
2370
|
+
s("nav", $a, [
|
|
2357
2371
|
s("button", {
|
|
2358
2372
|
type: "button",
|
|
2359
|
-
class:
|
|
2360
|
-
|
|
2361
|
-
|
|
2373
|
+
class: n([
|
|
2374
|
+
e.compact ? "h-6 px-2 text-xs" : "h-8 px-3",
|
|
2375
|
+
"rounded-full pagination-text hover:bg-secondary-100 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
2376
|
+
]),
|
|
2377
|
+
disabled: f.value <= 1,
|
|
2378
|
+
onClick: B[0] || (B[0] = (C) => w(f.value - 1)),
|
|
2362
2379
|
"aria-label": "Anterior"
|
|
2363
|
-
},
|
|
2364
|
-
(l(!0), a(K, null, G(z.value, (
|
|
2365
|
-
key: `page-${
|
|
2380
|
+
}, D(t.previousText), 11, Ba),
|
|
2381
|
+
(l(!0), a(K, null, G(z.value, (C, F) => (l(), a(K, {
|
|
2382
|
+
key: `page-${F}-${C}`
|
|
2366
2383
|
}, [
|
|
2367
|
-
|
|
2384
|
+
C === "…" ? (l(), a("span", {
|
|
2385
|
+
key: 0,
|
|
2386
|
+
class: n([
|
|
2387
|
+
e.compact ? "h-6 min-w-6 px-1" : "h-8 min-w-8 px-2",
|
|
2388
|
+
"inline-flex items-center justify-center pagination-text"
|
|
2389
|
+
])
|
|
2390
|
+
}, " … ", 2)) : (l(), a("button", {
|
|
2368
2391
|
key: 1,
|
|
2369
2392
|
type: "button",
|
|
2370
|
-
"aria-label": `Página ${
|
|
2371
|
-
class:
|
|
2372
|
-
"h-
|
|
2373
|
-
|
|
2393
|
+
"aria-label": `Página ${C}`,
|
|
2394
|
+
class: n([
|
|
2395
|
+
e.compact ? "h-6 min-w-6 px-2 text-xs" : "h-8 min-w-8 px-3",
|
|
2396
|
+
"rounded-full transition-colors",
|
|
2397
|
+
C === f.value ? "bg-primary-500 text-white font-semibold" : "pagination-text hover:bg-secondary-100"
|
|
2374
2398
|
]),
|
|
2375
|
-
onClick: (
|
|
2376
|
-
},
|
|
2399
|
+
onClick: (j) => w(Number(C))
|
|
2400
|
+
}, D(C), 11, za))
|
|
2377
2401
|
], 64))), 128)),
|
|
2378
2402
|
s("button", {
|
|
2379
2403
|
type: "button",
|
|
2380
|
-
class:
|
|
2381
|
-
|
|
2382
|
-
|
|
2404
|
+
class: n([
|
|
2405
|
+
e.compact ? "h-6 px-2 text-xs" : "h-8 px-3",
|
|
2406
|
+
"rounded-full pagination-text hover:bg-secondary-100 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
2407
|
+
]),
|
|
2408
|
+
disabled: f.value >= o.value,
|
|
2409
|
+
onClick: B[1] || (B[1] = (C) => w(f.value + 1)),
|
|
2383
2410
|
"aria-label": "Siguiente"
|
|
2384
|
-
},
|
|
2411
|
+
}, D(t.nextText), 11, Ma)
|
|
2385
2412
|
])
|
|
2386
2413
|
]));
|
|
2387
2414
|
}
|
|
2388
|
-
}),
|
|
2415
|
+
}), ts = /* @__PURE__ */ Z(Da, [["__scopeId", "data-v-621d6bba"]]), ls = /* @__PURE__ */ N({
|
|
2389
2416
|
__name: "Tooltip",
|
|
2390
2417
|
props: {
|
|
2391
2418
|
content: { default: "" },
|
|
@@ -2398,63 +2425,63 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2398
2425
|
closeDelay: { default: 100 }
|
|
2399
2426
|
},
|
|
2400
2427
|
setup(t) {
|
|
2401
|
-
const
|
|
2402
|
-
let
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2428
|
+
const b = t, e = P(!1);
|
|
2429
|
+
let m = null, o = null;
|
|
2430
|
+
const f = () => {
|
|
2431
|
+
b.trigger === "hover" && (clearTimeout(o), m = setTimeout(() => {
|
|
2405
2432
|
e.value = !0;
|
|
2406
|
-
},
|
|
2407
|
-
},
|
|
2408
|
-
|
|
2433
|
+
}, b.openDelay));
|
|
2434
|
+
}, p = () => {
|
|
2435
|
+
b.trigger === "hover" && (clearTimeout(m), o = setTimeout(() => {
|
|
2409
2436
|
e.value = !1;
|
|
2410
|
-
},
|
|
2411
|
-
},
|
|
2412
|
-
|
|
2413
|
-
},
|
|
2414
|
-
|
|
2437
|
+
}, b.closeDelay));
|
|
2438
|
+
}, i = () => {
|
|
2439
|
+
b.trigger === "click" && (e.value = !e.value);
|
|
2440
|
+
}, v = () => {
|
|
2441
|
+
b.trigger === "focus" && (e.value = !0);
|
|
2415
2442
|
}, z = () => {
|
|
2416
|
-
|
|
2417
|
-
},
|
|
2443
|
+
b.trigger === "focus" && (e.value = !1);
|
|
2444
|
+
}, w = {
|
|
2418
2445
|
sm: "px-2 py-1 text-xs",
|
|
2419
2446
|
md: "px-3 py-2 text-sm",
|
|
2420
2447
|
lg: "px-4 py-3 text-base"
|
|
2421
|
-
},
|
|
2448
|
+
}, g = {
|
|
2422
2449
|
// Deja un pequeño espacio entre el activador y el tooltip
|
|
2423
2450
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
2424
2451
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
2425
2452
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
2426
2453
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
2427
|
-
},
|
|
2454
|
+
}, B = r(() => `absolute w-0 h-0 border-solid border-4 border-transparent ${{
|
|
2428
2455
|
top: "bottom-[-8px] rotate-180 left-1/2 -translate-x-1/2",
|
|
2429
2456
|
bottom: "top-[-8px] rotate-180 left-1/2 -translate-x-1/2",
|
|
2430
2457
|
left: "right-[-8px] rotate-180 top-1/2 -translate-y-1/2",
|
|
2431
2458
|
right: "left-[-8px] rotate-180 top-1/2 -translate-y-1/2"
|
|
2432
|
-
}[
|
|
2459
|
+
}[b.position]}`), C = r(() => ({
|
|
2433
2460
|
"bg-gray-900": "#111827",
|
|
2434
2461
|
"bg-primary-500": "#0ea5e9",
|
|
2435
2462
|
"bg-green-600": "#16a34a",
|
|
2436
2463
|
"bg-yellow-600": "#ca8a04",
|
|
2437
2464
|
"bg-danger-600": "#dc2626"
|
|
2438
|
-
})[
|
|
2465
|
+
})[b.backgroundColor] || "#111827"), F = r(() => ({
|
|
2439
2466
|
// Orden: top, right, bottom, left
|
|
2440
|
-
top: `transparent transparent ${
|
|
2467
|
+
top: `transparent transparent ${C.value} transparent`,
|
|
2441
2468
|
// tooltip arriba → flecha apunta hacia abajo (borde inferior coloreado)
|
|
2442
|
-
bottom: `${
|
|
2469
|
+
bottom: `${C.value} transparent transparent transparent`,
|
|
2443
2470
|
// tooltip abajo → flecha apunta hacia arriba (borde superior coloreado)
|
|
2444
|
-
left: `transparent ${
|
|
2471
|
+
left: `transparent ${C.value} transparent transparent`,
|
|
2445
2472
|
// tooltip a la izquierda → flecha apunta hacia la derecha (borde derecho coloreado)
|
|
2446
|
-
right: `transparent transparent transparent ${
|
|
2473
|
+
right: `transparent transparent transparent ${C.value}`
|
|
2447
2474
|
// tooltip a la derecha → flecha apunta hacia la izquierda (borde izquierdo coloreado)
|
|
2448
|
-
})[
|
|
2449
|
-
return (
|
|
2475
|
+
})[b.position]), j = r(() => `absolute ${g[b.position]} ${b.textColor} ${w[b.size]} rounded-md shadow-lg whitespace-nowrap z-50`);
|
|
2476
|
+
return (O, q) => (l(), a("div", {
|
|
2450
2477
|
class: "relative inline-flex",
|
|
2451
|
-
onMouseenter:
|
|
2452
|
-
onMouseleave:
|
|
2453
|
-
onClick:
|
|
2454
|
-
onFocus:
|
|
2478
|
+
onMouseenter: f,
|
|
2479
|
+
onMouseleave: p,
|
|
2480
|
+
onClick: i,
|
|
2481
|
+
onFocus: v,
|
|
2455
2482
|
onBlur: z
|
|
2456
2483
|
}, [
|
|
2457
|
-
O
|
|
2484
|
+
L(O.$slots, "default"),
|
|
2458
2485
|
Q(ie, {
|
|
2459
2486
|
"enter-active-class": "transition-opacity duration-200",
|
|
2460
2487
|
"enter-from-class": "opacity-0",
|
|
@@ -2466,24 +2493,24 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2466
2493
|
default: re(() => [
|
|
2467
2494
|
e.value ? (l(), a("div", {
|
|
2468
2495
|
key: 0,
|
|
2469
|
-
class:
|
|
2470
|
-
style: X({ backgroundColor:
|
|
2496
|
+
class: n(j.value),
|
|
2497
|
+
style: X({ backgroundColor: C.value }),
|
|
2471
2498
|
role: "tooltip"
|
|
2472
2499
|
}, [
|
|
2473
|
-
O
|
|
2474
|
-
Y(
|
|
2500
|
+
L(O.$slots, "content", {}, () => [
|
|
2501
|
+
Y(D(t.content), 1)
|
|
2475
2502
|
]),
|
|
2476
2503
|
s("div", {
|
|
2477
|
-
class:
|
|
2478
|
-
style: X({ borderColor:
|
|
2504
|
+
class: n(B.value),
|
|
2505
|
+
style: X({ borderColor: F.value })
|
|
2479
2506
|
}, null, 6)
|
|
2480
|
-
], 6)) :
|
|
2507
|
+
], 6)) : c("", !0)
|
|
2481
2508
|
]),
|
|
2482
2509
|
_: 3
|
|
2483
2510
|
})
|
|
2484
2511
|
], 32));
|
|
2485
2512
|
}
|
|
2486
|
-
}),
|
|
2513
|
+
}), Va = { class: "truncate" }, Ta = ["aria-label", "disabled"], as = /* @__PURE__ */ N({
|
|
2487
2514
|
__name: "Chip",
|
|
2488
2515
|
props: {
|
|
2489
2516
|
label: { default: "" },
|
|
@@ -2493,14 +2520,15 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2493
2520
|
closable: { type: Boolean, default: !1 },
|
|
2494
2521
|
disabled: { type: Boolean, default: !1 },
|
|
2495
2522
|
icon: { default: void 0 },
|
|
2496
|
-
closeAriaLabel: { default: "Cerrar" }
|
|
2523
|
+
closeAriaLabel: { default: "Cerrar" },
|
|
2524
|
+
compact: { type: Boolean, default: !1 }
|
|
2497
2525
|
},
|
|
2498
2526
|
emits: ["click", "close"],
|
|
2499
|
-
setup(t, { emit:
|
|
2500
|
-
const e = t,
|
|
2501
|
-
sm: "h-7 text-xs px-3 gap-1.5 font-semibold leading-none",
|
|
2502
|
-
md: "h-8 text-sm px-3.5 gap-2 font-semibold leading-none"
|
|
2503
|
-
},
|
|
2527
|
+
setup(t, { emit: b }) {
|
|
2528
|
+
const e = t, m = b, o = r(() => !!e.icon), f = r(() => e.icon || ""), p = r(() => ({
|
|
2529
|
+
sm: e.compact ? "h-6 text-xs px-2 gap-1 font-semibold leading-none" : "h-7 text-xs px-3 gap-1.5 font-semibold leading-none",
|
|
2530
|
+
md: e.compact ? "h-7 text-xs px-2.5 gap-1.5 font-semibold leading-none" : "h-8 text-sm px-3.5 gap-2 font-semibold leading-none"
|
|
2531
|
+
})), i = {
|
|
2504
2532
|
default: {
|
|
2505
2533
|
filled: "bg-gray-100 text-gray-800 border border-gray-200",
|
|
2506
2534
|
outlined: "bg-white text-gray-800 border border-gray-300",
|
|
@@ -2508,8 +2536,8 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2508
2536
|
},
|
|
2509
2537
|
primary: {
|
|
2510
2538
|
filled: "bg-primary-600 text-white border border-primary-600",
|
|
2511
|
-
outlined: "bg-white text-primary-
|
|
2512
|
-
tonal: "bg-primary-50 text-primary-
|
|
2539
|
+
outlined: "bg-white text-primary-500 border border-primary-300",
|
|
2540
|
+
tonal: "bg-primary-50 text-primary-500 border border-primary-100"
|
|
2513
2541
|
},
|
|
2514
2542
|
secondary: {
|
|
2515
2543
|
filled: "bg-secondary-600 text-white border border-secondary-600",
|
|
@@ -2536,39 +2564,39 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2536
2564
|
outlined: "bg-white text-sky-700 border border-sky-300",
|
|
2537
2565
|
tonal: "bg-sky-50 text-sky-700 border border-sky-100"
|
|
2538
2566
|
}
|
|
2539
|
-
},
|
|
2540
|
-
const
|
|
2567
|
+
}, v = r(() => {
|
|
2568
|
+
const B = i[e.color] ?? i.default, C = B[e.variant] ?? B.filled;
|
|
2541
2569
|
return [
|
|
2542
2570
|
"inline-flex items-center select-none",
|
|
2543
2571
|
"transition-colors duration-150",
|
|
2544
2572
|
"max-w-full",
|
|
2545
|
-
|
|
2573
|
+
p.value[e.size],
|
|
2546
2574
|
"rounded-full",
|
|
2547
2575
|
e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-default",
|
|
2548
|
-
|
|
2576
|
+
C
|
|
2549
2577
|
].join(" ");
|
|
2550
|
-
}), z =
|
|
2551
|
-
e.disabled ||
|
|
2552
|
-
},
|
|
2553
|
-
e.disabled ||
|
|
2578
|
+
}), z = r(() => "text-current flex items-center"), w = () => {
|
|
2579
|
+
e.disabled || m("close");
|
|
2580
|
+
}, g = () => {
|
|
2581
|
+
e.disabled || m("click");
|
|
2554
2582
|
};
|
|
2555
|
-
return (
|
|
2556
|
-
class:
|
|
2583
|
+
return (B, C) => (l(), a("div", {
|
|
2584
|
+
class: n(v.value),
|
|
2557
2585
|
role: "status",
|
|
2558
|
-
onClick:
|
|
2586
|
+
onClick: g
|
|
2559
2587
|
}, [
|
|
2560
|
-
|
|
2588
|
+
o.value ? (l(), a("span", {
|
|
2561
2589
|
key: 0,
|
|
2562
|
-
class:
|
|
2590
|
+
class: n(z.value)
|
|
2563
2591
|
}, [
|
|
2564
2592
|
Q(_, {
|
|
2565
|
-
name:
|
|
2593
|
+
name: f.value,
|
|
2566
2594
|
size: "sm"
|
|
2567
2595
|
}, null, 8, ["name"])
|
|
2568
|
-
], 2)) :
|
|
2569
|
-
s("span",
|
|
2570
|
-
|
|
2571
|
-
Y(
|
|
2596
|
+
], 2)) : c("", !0),
|
|
2597
|
+
s("span", Va, [
|
|
2598
|
+
L(B.$slots, "default", {}, () => [
|
|
2599
|
+
Y(D(t.label), 1)
|
|
2572
2600
|
])
|
|
2573
2601
|
]),
|
|
2574
2602
|
t.closable ? (l(), a("button", {
|
|
@@ -2576,20 +2604,20 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2576
2604
|
type: "button",
|
|
2577
2605
|
class: "shrink-0 rounded-full p-1 hover:bg-black/5 focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
2578
2606
|
"aria-label": t.closeAriaLabel,
|
|
2579
|
-
onClick: J(
|
|
2607
|
+
onClick: J(w, ["stop"]),
|
|
2580
2608
|
disabled: t.disabled
|
|
2581
2609
|
}, [
|
|
2582
2610
|
Q(_, {
|
|
2583
2611
|
name: "close",
|
|
2584
2612
|
size: "sm"
|
|
2585
2613
|
})
|
|
2586
|
-
], 8,
|
|
2614
|
+
], 8, Ta)) : c("", !0)
|
|
2587
2615
|
], 2));
|
|
2588
2616
|
}
|
|
2589
|
-
}),
|
|
2617
|
+
}), Sa = ["data-node-id"], Ia = {
|
|
2590
2618
|
key: 0,
|
|
2591
2619
|
class: "shrink-0 size-12 rounded-full bg-[var(--neutrales/fondo-general-claro,#f7f7f7)] grid place-items-center"
|
|
2592
|
-
},
|
|
2620
|
+
}, ja = {
|
|
2593
2621
|
key: 0,
|
|
2594
2622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2595
2623
|
width: "24",
|
|
@@ -2600,7 +2628,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2600
2628
|
"stroke-width": "2",
|
|
2601
2629
|
"stroke-linecap": "round",
|
|
2602
2630
|
"stroke-linejoin": "round"
|
|
2603
|
-
},
|
|
2631
|
+
}, La = {
|
|
2604
2632
|
key: 1,
|
|
2605
2633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2606
2634
|
width: "24",
|
|
@@ -2611,7 +2639,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2611
2639
|
"stroke-width": "2",
|
|
2612
2640
|
"stroke-linecap": "round",
|
|
2613
2641
|
"stroke-linejoin": "round"
|
|
2614
|
-
},
|
|
2642
|
+
}, Oa = {
|
|
2615
2643
|
key: 2,
|
|
2616
2644
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2617
2645
|
width: "24",
|
|
@@ -2622,7 +2650,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2622
2650
|
"stroke-width": "2",
|
|
2623
2651
|
"stroke-linecap": "round",
|
|
2624
2652
|
"stroke-linejoin": "round"
|
|
2625
|
-
},
|
|
2653
|
+
}, Aa = {
|
|
2626
2654
|
key: 3,
|
|
2627
2655
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2628
2656
|
width: "24",
|
|
@@ -2633,10 +2661,10 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2633
2661
|
"stroke-width": "2",
|
|
2634
2662
|
"stroke-linecap": "round",
|
|
2635
2663
|
"stroke-linejoin": "round"
|
|
2636
|
-
},
|
|
2664
|
+
}, Fa = {
|
|
2637
2665
|
key: 1,
|
|
2638
2666
|
class: "flex flex-wrap items-center justify-end gap-2 px-6 pb-6 pt-4"
|
|
2639
|
-
},
|
|
2667
|
+
}, ss = /* @__PURE__ */ N({
|
|
2640
2668
|
__name: "Alert",
|
|
2641
2669
|
props: {
|
|
2642
2670
|
variant: { default: "info" },
|
|
@@ -2647,12 +2675,27 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2647
2675
|
actions: { type: Boolean, default: !1 },
|
|
2648
2676
|
showIcon: { type: Boolean, default: !0 },
|
|
2649
2677
|
nodeId: { default: void 0 },
|
|
2650
|
-
stackOn: { default: void 0 }
|
|
2678
|
+
stackOn: { default: void 0 },
|
|
2679
|
+
autoClose: { default: void 0 }
|
|
2651
2680
|
},
|
|
2652
2681
|
emits: ["close", "accept", "cancel"],
|
|
2653
|
-
setup(t, { emit:
|
|
2654
|
-
const e =
|
|
2655
|
-
|
|
2682
|
+
setup(t, { emit: b }) {
|
|
2683
|
+
const e = b;
|
|
2684
|
+
let m = null;
|
|
2685
|
+
const o = t, f = r(() => o.variant), p = r(() => o.multiline), i = r(() => o.actions), v = r(() => o.nodeId), z = r(() => o.showIcon), w = () => {
|
|
2686
|
+
g(), e("close");
|
|
2687
|
+
}, g = () => {
|
|
2688
|
+
m !== null && (clearTimeout(m), m = null);
|
|
2689
|
+
};
|
|
2690
|
+
be(() => {
|
|
2691
|
+
o.autoClose && o.autoClose > 0 && (m = setTimeout(() => {
|
|
2692
|
+
e("close");
|
|
2693
|
+
}, o.autoClose));
|
|
2694
|
+
}), ge(() => {
|
|
2695
|
+
g();
|
|
2696
|
+
});
|
|
2697
|
+
const B = r(() => !!o.title), C = r(() => o.title ?? ""), F = r(() => o.description ?? ""), j = r(() => {
|
|
2698
|
+
switch (f.value) {
|
|
2656
2699
|
case "info":
|
|
2657
2700
|
return {
|
|
2658
2701
|
border: "border-[var(--semantica/info,#0064ff)]",
|
|
@@ -2674,35 +2717,35 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2674
2717
|
bg: "bg-[#fdf7f9] outline outline-1 outline-[rgba(214,0,64,0.5)]"
|
|
2675
2718
|
};
|
|
2676
2719
|
}
|
|
2677
|
-
}),
|
|
2678
|
-
const
|
|
2679
|
-
if (!
|
|
2680
|
-
const
|
|
2681
|
-
return `${
|
|
2682
|
-
}),
|
|
2683
|
-
if (!
|
|
2684
|
-
const
|
|
2685
|
-
return `flex-col ${
|
|
2686
|
-
}),
|
|
2687
|
-
if (!
|
|
2688
|
-
const
|
|
2689
|
-
return `flex-col ${
|
|
2690
|
-
}),
|
|
2691
|
-
return (
|
|
2692
|
-
class:
|
|
2693
|
-
|
|
2694
|
-
|
|
2720
|
+
}), O = r(() => "bg-[var(--color-primario/500,#56ced4)]"), q = r(() => {
|
|
2721
|
+
const A = "flex w-full items-start gap-4 flex-col";
|
|
2722
|
+
if (!o.stackOn) return `${A} sm:flex-row sm:items-center`;
|
|
2723
|
+
const k = o.stackOn, y = `${k}:flex-row ${k}:items-center`;
|
|
2724
|
+
return `${A} ${y}`;
|
|
2725
|
+
}), S = r(() => {
|
|
2726
|
+
if (!o.stackOn) return "flex-col sm:flex-row items-start sm:items-center";
|
|
2727
|
+
const A = o.stackOn;
|
|
2728
|
+
return `flex-col ${A}:flex-row items-start ${A}:items-center`;
|
|
2729
|
+
}), I = r(() => {
|
|
2730
|
+
if (!o.stackOn) return "flex-col sm:flex-row sm:items-center w-full";
|
|
2731
|
+
const A = o.stackOn;
|
|
2732
|
+
return `flex-col ${A}:flex-row ${A}:items-center w-full`;
|
|
2733
|
+
}), W = r(() => o.stackOn ? `self-start ${o.stackOn}:self-auto` : "self-start sm:self-auto");
|
|
2734
|
+
return (A, k) => (l(), a("div", {
|
|
2735
|
+
class: n(["relative w-full rounded-xl border", [
|
|
2736
|
+
j.value.border,
|
|
2737
|
+
j.value.bg
|
|
2695
2738
|
]]),
|
|
2696
2739
|
role: "alert",
|
|
2697
|
-
"data-node-id":
|
|
2740
|
+
"data-node-id": v.value
|
|
2698
2741
|
}, [
|
|
2699
2742
|
t.closable ? (l(), a("button", {
|
|
2700
2743
|
key: 0,
|
|
2701
2744
|
type: "button",
|
|
2702
2745
|
class: "absolute top-3 right-3 text-[color:var(--neutrales/texto-principal,#565656)]/70 hover:opacity-100 opacity-70",
|
|
2703
2746
|
"aria-label": "Cerrar",
|
|
2704
|
-
onClick:
|
|
2705
|
-
}, [...
|
|
2747
|
+
onClick: w
|
|
2748
|
+
}, [...k[2] || (k[2] = [
|
|
2706
2749
|
s("svg", {
|
|
2707
2750
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2708
2751
|
width: "18",
|
|
@@ -2727,15 +2770,15 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2727
2770
|
y2: "18"
|
|
2728
2771
|
})
|
|
2729
2772
|
], -1)
|
|
2730
|
-
])])) :
|
|
2773
|
+
])])) : c("", !0),
|
|
2731
2774
|
s("div", {
|
|
2732
|
-
class:
|
|
2775
|
+
class: n(["p-6", { "pb-0": i.value }])
|
|
2733
2776
|
}, [
|
|
2734
2777
|
s("div", {
|
|
2735
|
-
class:
|
|
2778
|
+
class: n(q.value)
|
|
2736
2779
|
}, [
|
|
2737
|
-
|
|
2738
|
-
|
|
2780
|
+
z.value ? (l(), a("div", Ia, [
|
|
2781
|
+
f.value === "info" ? (l(), a("svg", ja, [...k[3] || (k[3] = [
|
|
2739
2782
|
s("circle", {
|
|
2740
2783
|
cx: "12",
|
|
2741
2784
|
cy: "12",
|
|
@@ -2753,7 +2796,7 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2753
2796
|
x2: "12",
|
|
2754
2797
|
y2: "8"
|
|
2755
2798
|
}, null, -1)
|
|
2756
|
-
])])) :
|
|
2799
|
+
])])) : f.value === "warning" ? (l(), a("svg", La, [...k[4] || (k[4] = [
|
|
2757
2800
|
s("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }, null, -1),
|
|
2758
2801
|
s("line", {
|
|
2759
2802
|
x1: "12",
|
|
@@ -2767,10 +2810,10 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2767
2810
|
x2: "12",
|
|
2768
2811
|
y2: "17"
|
|
2769
2812
|
}, null, -1)
|
|
2770
|
-
])])) :
|
|
2813
|
+
])])) : f.value === "success" ? (l(), a("svg", Oa, [...k[5] || (k[5] = [
|
|
2771
2814
|
s("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }, null, -1),
|
|
2772
2815
|
s("polyline", { points: "22 4 12 14.01 9 11.01" }, null, -1)
|
|
2773
|
-
])])) : (l(), a("svg",
|
|
2816
|
+
])])) : (l(), a("svg", Aa, [...k[6] || (k[6] = [
|
|
2774
2817
|
s("polygon", { points: "7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2" }, null, -1),
|
|
2775
2818
|
s("line", {
|
|
2776
2819
|
x1: "12",
|
|
@@ -2785,69 +2828,69 @@ const Ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, He = {
|
|
|
2785
2828
|
y2: "16"
|
|
2786
2829
|
}, null, -1)
|
|
2787
2830
|
])]))
|
|
2788
|
-
])) :
|
|
2831
|
+
])) : c("", !0),
|
|
2789
2832
|
s("div", {
|
|
2790
|
-
class:
|
|
2833
|
+
class: n(["flex-1 flex gap-4 text-[14px]", [S.value, t.closable ? "pr-6" : "", { "whitespace-nowrap": !p.value, "whitespace-pre-wrap": p.value }]])
|
|
2791
2834
|
}, [
|
|
2792
2835
|
s("div", {
|
|
2793
|
-
class:
|
|
2836
|
+
class: n(["flex flex-1 gap-3 items-start", I.value])
|
|
2794
2837
|
}, [
|
|
2795
|
-
|
|
2838
|
+
B.value ? (l(), a("div", {
|
|
2796
2839
|
key: 0,
|
|
2797
|
-
class:
|
|
2798
|
-
},
|
|
2840
|
+
class: n(["tracking-[0.1px] text-[color:var(--neutrales/texto-principal,#565656)] font-medium", W.value])
|
|
2841
|
+
}, D(C.value), 3)) : c("", !0),
|
|
2799
2842
|
s("div", {
|
|
2800
|
-
class:
|
|
2843
|
+
class: n(["flex-1 tracking-[0.25px] text-[color:var(--neutrales/texto-principal,#565656)]", { "overflow-hidden overflow-ellipsis": !p.value }])
|
|
2801
2844
|
}, [
|
|
2802
|
-
|
|
2803
|
-
Y(
|
|
2845
|
+
L(A.$slots, "description", {}, () => [
|
|
2846
|
+
Y(D(F.value), 1)
|
|
2804
2847
|
])
|
|
2805
2848
|
], 2)
|
|
2806
2849
|
], 2)
|
|
2807
2850
|
], 2)
|
|
2808
2851
|
], 2)
|
|
2809
2852
|
], 2),
|
|
2810
|
-
|
|
2853
|
+
i.value ? (l(), a("div", Fa, [
|
|
2811
2854
|
s("button", {
|
|
2812
2855
|
type: "button",
|
|
2813
2856
|
class: "px-3 py-1.5 rounded-lg text-sm tracking-[0.25px] font-semibold text-[color:var(--neutrales/texto-principal,#565656)]",
|
|
2814
|
-
onClick:
|
|
2857
|
+
onClick: k[0] || (k[0] = (y) => A.$emit("cancel"))
|
|
2815
2858
|
}, [
|
|
2816
|
-
|
|
2817
|
-
|
|
2859
|
+
L(A.$slots, "cancel", {}, () => [
|
|
2860
|
+
k[7] || (k[7] = Y("Cancelar", -1))
|
|
2818
2861
|
])
|
|
2819
2862
|
]),
|
|
2820
2863
|
s("button", {
|
|
2821
2864
|
type: "button",
|
|
2822
|
-
class:
|
|
2823
|
-
onClick:
|
|
2865
|
+
class: n(["px-3 py-1.5 rounded-lg text-sm tracking-[0.25px] font-semibold text-white", O.value]),
|
|
2866
|
+
onClick: k[1] || (k[1] = (y) => A.$emit("accept"))
|
|
2824
2867
|
}, [
|
|
2825
|
-
|
|
2826
|
-
|
|
2868
|
+
L(A.$slots, "accept", {}, () => [
|
|
2869
|
+
k[8] || (k[8] = Y("Aceptar", -1))
|
|
2827
2870
|
])
|
|
2828
2871
|
], 2)
|
|
2829
|
-
])) :
|
|
2830
|
-
], 10,
|
|
2872
|
+
])) : c("", !0)
|
|
2873
|
+
], 10, Sa));
|
|
2831
2874
|
}
|
|
2832
2875
|
});
|
|
2833
2876
|
export {
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2877
|
+
ss as Alert,
|
|
2878
|
+
Ra as AppBar,
|
|
2879
|
+
Ea as Button,
|
|
2880
|
+
Ya as Calendar,
|
|
2881
|
+
Na as Card,
|
|
2882
|
+
as as Chip,
|
|
2883
|
+
Ha as Dialog,
|
|
2884
|
+
Ka as FileUpload,
|
|
2842
2885
|
_ as Icon,
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2886
|
+
Ua as Input,
|
|
2887
|
+
Ja as Loader,
|
|
2888
|
+
Ga as Menu,
|
|
2889
|
+
ts as Pagination,
|
|
2890
|
+
Qa as Select,
|
|
2891
|
+
Za as Sidebar,
|
|
2892
|
+
Xa as Table,
|
|
2893
|
+
_a as Tabs,
|
|
2894
|
+
es as Text,
|
|
2895
|
+
ls as Tooltip
|
|
2853
2896
|
};
|