@iaclinical/components 1.0.0
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 -0
- package/dist/iaclinical-components.js +967 -0
- package/dist/style.css +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import { defineComponent as B, computed as v, createElementBlock as s, openBlock as t, normalizeClass as k, createElementVNode as a, createCommentVNode as p, renderSlot as $, toDisplayString as x, createBlock as E, Teleport as Q, createVNode as J, Transition as R, withCtx as H, withModifiers as j, createTextVNode as S, ref as T, normalizeStyle as F, watch as X, withDirectives as Y, vModelText as Z, Fragment as z, renderList as L, nextTick as ee, resolveDynamicComponent as te } from "vue";
|
|
2
|
+
const se = { class: "flex items-center gap-4" }, le = {
|
|
3
|
+
key: 1,
|
|
4
|
+
class: "text-lg font-bold text-primary-50 font-poppins"
|
|
5
|
+
}, ae = { class: "flex-1 flex justify-center" }, oe = { class: "flex items-center gap-3" }, ne = /* @__PURE__ */ B({
|
|
6
|
+
__name: "AppBar",
|
|
7
|
+
props: {
|
|
8
|
+
title: { default: "" },
|
|
9
|
+
showMenuButton: { type: Boolean, default: !0 },
|
|
10
|
+
variant: { default: "default" },
|
|
11
|
+
sticky: { type: Boolean, default: !0 },
|
|
12
|
+
shadow: { type: Boolean, default: !1 },
|
|
13
|
+
height: { default: "md" }
|
|
14
|
+
},
|
|
15
|
+
emits: ["toggle-menu"],
|
|
16
|
+
setup(e, { emit: h }) {
|
|
17
|
+
const l = e, u = h, r = v(() => {
|
|
18
|
+
const i = "flex items-center justify-between px-6 z-50", n = {
|
|
19
|
+
default: "bg-primary-700 text-primary-50",
|
|
20
|
+
dark: "bg-secondary-900 text-white",
|
|
21
|
+
light: "bg-white text-secondary-900 border-b border-secondary-200"
|
|
22
|
+
}, d = {
|
|
23
|
+
sm: "h-12",
|
|
24
|
+
md: "h-14",
|
|
25
|
+
lg: "h-16"
|
|
26
|
+
}, o = l.sticky ? "sticky top-0" : "", m = l.shadow ? "shadow-md" : "";
|
|
27
|
+
return [
|
|
28
|
+
i,
|
|
29
|
+
n[l.variant],
|
|
30
|
+
d[l.height],
|
|
31
|
+
o,
|
|
32
|
+
m
|
|
33
|
+
].join(" ");
|
|
34
|
+
});
|
|
35
|
+
return (i, n) => (t(), s("header", {
|
|
36
|
+
class: k(r.value)
|
|
37
|
+
}, [
|
|
38
|
+
a("div", se, [
|
|
39
|
+
e.showMenuButton ? (t(), s("button", {
|
|
40
|
+
key: 0,
|
|
41
|
+
onClick: n[0] || (n[0] = (d) => u("toggle-menu")),
|
|
42
|
+
class: "p-2 hover:bg-primary-600 rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
43
|
+
"aria-label": "Toggle menu"
|
|
44
|
+
}, [...n[1] || (n[1] = [
|
|
45
|
+
a("svg", {
|
|
46
|
+
class: "w-6 h-6 text-primary-50",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
51
|
+
}, [
|
|
52
|
+
a("path", {
|
|
53
|
+
"stroke-linecap": "round",
|
|
54
|
+
"stroke-linejoin": "round",
|
|
55
|
+
"stroke-width": "2",
|
|
56
|
+
d: "M4 6h16M4 12h16M4 18h16"
|
|
57
|
+
})
|
|
58
|
+
], -1)
|
|
59
|
+
])])) : p("", !0),
|
|
60
|
+
e.title ? (t(), s("div", le, x(e.title), 1)) : p("", !0),
|
|
61
|
+
$(i.$slots, "left", {}, void 0, !0)
|
|
62
|
+
]),
|
|
63
|
+
a("div", ae, [
|
|
64
|
+
$(i.$slots, "center", {}, void 0, !0)
|
|
65
|
+
]),
|
|
66
|
+
a("div", oe, [
|
|
67
|
+
$(i.$slots, "right", {}, void 0, !0)
|
|
68
|
+
])
|
|
69
|
+
], 2));
|
|
70
|
+
}
|
|
71
|
+
}), I = (e, h) => {
|
|
72
|
+
const l = e.__vccOpts || e;
|
|
73
|
+
for (const [u, r] of h)
|
|
74
|
+
l[u] = r;
|
|
75
|
+
return l;
|
|
76
|
+
}, It = /* @__PURE__ */ I(ne, [["__scopeId", "data-v-8c81fc6d"]]), re = ["type", "disabled", "aria-label"], ie = {
|
|
77
|
+
key: 0,
|
|
78
|
+
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]"
|
|
79
|
+
}, Ot = /* @__PURE__ */ B({
|
|
80
|
+
__name: "Button",
|
|
81
|
+
props: {
|
|
82
|
+
variant: { default: "primary" },
|
|
83
|
+
size: { default: "md" },
|
|
84
|
+
radius: { default: "full" },
|
|
85
|
+
type: { default: "button" },
|
|
86
|
+
disabled: { type: Boolean, default: !1 },
|
|
87
|
+
badge: { default: 0 },
|
|
88
|
+
ariaLabel: { default: "" }
|
|
89
|
+
},
|
|
90
|
+
emits: ["click"],
|
|
91
|
+
setup(e, { emit: h }) {
|
|
92
|
+
const l = e, u = h, r = v(() => l.variant === "icon"), i = v(() => l.badge > 99 ? "99+" : l.badge.toString()), n = v(() => {
|
|
93
|
+
const o = "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", m = {
|
|
94
|
+
primary: "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",
|
|
95
|
+
secondary: "bg-secondary-200 text-secondary-900 hover:bg-secondary-300 focus-visible:ring-secondary-500",
|
|
96
|
+
outline: "border border-secondary-300 bg-transparent hover:bg-secondary-100 focus-visible:ring-secondary-500",
|
|
97
|
+
ghost: "hover:bg-secondary-100 focus-visible:ring-secondary-500",
|
|
98
|
+
danger: "bg-danger-600 text-white hover:bg-danger-700 focus-visible:ring-danger-600",
|
|
99
|
+
icon: "hover:bg-secondary-100 focus-visible:ring-secondary-500 relative"
|
|
100
|
+
}, b = {
|
|
101
|
+
sm: r.value ? "p-1.5" : "h-8 px-3 text-sm",
|
|
102
|
+
md: r.value ? "p-2" : "h-10 px-4 text-base",
|
|
103
|
+
lg: r.value ? "p-3" : "h-12 px-6 text-lg"
|
|
104
|
+
}, V = {
|
|
105
|
+
full: "rounded-full",
|
|
106
|
+
xl: "rounded-2xl",
|
|
107
|
+
lg: "rounded-xl",
|
|
108
|
+
md: "rounded-lg",
|
|
109
|
+
sm: "rounded-md",
|
|
110
|
+
none: "rounded-none"
|
|
111
|
+
};
|
|
112
|
+
return `${o} ${m[l.variant]} ${b[l.size]} ${V[l.radius]}`;
|
|
113
|
+
}), d = (o) => {
|
|
114
|
+
l.disabled || u("click", o);
|
|
115
|
+
};
|
|
116
|
+
return (o, m) => (t(), s("button", {
|
|
117
|
+
class: k(n.value),
|
|
118
|
+
type: e.type,
|
|
119
|
+
disabled: e.disabled,
|
|
120
|
+
onClick: d,
|
|
121
|
+
"aria-label": e.ariaLabel
|
|
122
|
+
}, [
|
|
123
|
+
$(o.$slots, "default"),
|
|
124
|
+
r.value && e.badge && e.badge > 0 ? (t(), s("span", ie, x(i.value), 1)) : p("", !0)
|
|
125
|
+
], 10, re));
|
|
126
|
+
}
|
|
127
|
+
}), de = {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: "border-b border-gray-100 px-6 py-4"
|
|
130
|
+
}, ce = { class: "px-6 py-4" }, ue = {
|
|
131
|
+
key: 1,
|
|
132
|
+
class: "border-t border-gray-100 px-6 py-4 bg-gray-50"
|
|
133
|
+
}, Ft = /* @__PURE__ */ B({
|
|
134
|
+
__name: "Card",
|
|
135
|
+
props: {
|
|
136
|
+
shadow: { default: "md" },
|
|
137
|
+
rounded: { default: "lg" },
|
|
138
|
+
bordered: { type: Boolean, default: !1 }
|
|
139
|
+
},
|
|
140
|
+
setup(e) {
|
|
141
|
+
const h = e, l = {
|
|
142
|
+
none: "",
|
|
143
|
+
sm: "shadow-sm",
|
|
144
|
+
md: "shadow",
|
|
145
|
+
lg: "shadow-lg",
|
|
146
|
+
xl: "shadow-xl"
|
|
147
|
+
}, u = {
|
|
148
|
+
none: "rounded-none",
|
|
149
|
+
sm: "rounded-sm",
|
|
150
|
+
md: "rounded-md",
|
|
151
|
+
lg: "rounded-lg",
|
|
152
|
+
xl: "rounded-xl",
|
|
153
|
+
full: "rounded-full"
|
|
154
|
+
}, r = v(() => [
|
|
155
|
+
"w-full bg-white",
|
|
156
|
+
l[h.shadow],
|
|
157
|
+
u[h.rounded],
|
|
158
|
+
h.bordered ? "border border-gray-200" : ""
|
|
159
|
+
]);
|
|
160
|
+
return (i, n) => (t(), s("div", {
|
|
161
|
+
class: k(r.value)
|
|
162
|
+
}, [
|
|
163
|
+
i.$slots.header ? (t(), s("div", de, [
|
|
164
|
+
$(i.$slots, "header")
|
|
165
|
+
])) : p("", !0),
|
|
166
|
+
a("div", ce, [
|
|
167
|
+
$(i.$slots, "default")
|
|
168
|
+
]),
|
|
169
|
+
i.$slots.footer ? (t(), s("div", ue, [
|
|
170
|
+
$(i.$slots, "footer")
|
|
171
|
+
])) : p("", !0)
|
|
172
|
+
], 2));
|
|
173
|
+
}
|
|
174
|
+
}), fe = { class: "flex items-center justify-between border-b border-gray-100 px-8 py-6" }, pe = { class: "text-xl font-semibold text-gray-900" }, xe = { class: "px-8 py-6" }, ge = {
|
|
175
|
+
key: 0,
|
|
176
|
+
class: "border-t border-gray-100 px-8 py-6 bg-gray-50"
|
|
177
|
+
}, he = /* @__PURE__ */ B({
|
|
178
|
+
__name: "Dialog",
|
|
179
|
+
props: {
|
|
180
|
+
modelValue: { type: Boolean, default: !1 },
|
|
181
|
+
title: { default: "Diálogo" },
|
|
182
|
+
closeOnBackdrop: { type: Boolean, default: !0 }
|
|
183
|
+
},
|
|
184
|
+
emits: ["update:modelValue"],
|
|
185
|
+
setup(e, { emit: h }) {
|
|
186
|
+
const l = e, u = h, r = v({
|
|
187
|
+
get: () => l.modelValue,
|
|
188
|
+
set: (d) => u("update:modelValue", d)
|
|
189
|
+
}), i = () => {
|
|
190
|
+
r.value = !1;
|
|
191
|
+
}, n = () => {
|
|
192
|
+
l.closeOnBackdrop && i();
|
|
193
|
+
};
|
|
194
|
+
return (d, o) => (t(), E(Q, { to: "body" }, [
|
|
195
|
+
J(R, { name: "dialog" }, {
|
|
196
|
+
default: H(() => [
|
|
197
|
+
r.value ? (t(), s("div", {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
200
|
+
onClick: n
|
|
201
|
+
}, [
|
|
202
|
+
a("div", {
|
|
203
|
+
class: "relative w-full max-w-2xl rounded-lg bg-white shadow-xl",
|
|
204
|
+
onClick: o[0] || (o[0] = j(() => {
|
|
205
|
+
}, ["stop"]))
|
|
206
|
+
}, [
|
|
207
|
+
a("div", fe, [
|
|
208
|
+
a("h2", pe, [
|
|
209
|
+
$(d.$slots, "title", {}, () => [
|
|
210
|
+
S(x(e.title), 1)
|
|
211
|
+
], !0)
|
|
212
|
+
]),
|
|
213
|
+
a("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
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",
|
|
216
|
+
"aria-label": "Cerrar diálogo",
|
|
217
|
+
onClick: i
|
|
218
|
+
}, [...o[1] || (o[1] = [
|
|
219
|
+
a("svg", {
|
|
220
|
+
class: "h-6 w-6",
|
|
221
|
+
fill: "none",
|
|
222
|
+
stroke: "currentColor",
|
|
223
|
+
viewBox: "0 0 24 24"
|
|
224
|
+
}, [
|
|
225
|
+
a("path", {
|
|
226
|
+
"stroke-linecap": "round",
|
|
227
|
+
"stroke-linejoin": "round",
|
|
228
|
+
"stroke-width": "2",
|
|
229
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
230
|
+
})
|
|
231
|
+
], -1)
|
|
232
|
+
])])
|
|
233
|
+
]),
|
|
234
|
+
a("div", xe, [
|
|
235
|
+
$(d.$slots, "default", {}, void 0, !0)
|
|
236
|
+
]),
|
|
237
|
+
d.$slots.footer ? (t(), s("div", ge, [
|
|
238
|
+
$(d.$slots, "footer", {}, void 0, !0)
|
|
239
|
+
])) : p("", !0)
|
|
240
|
+
])
|
|
241
|
+
])) : p("", !0)
|
|
242
|
+
]),
|
|
243
|
+
_: 3
|
|
244
|
+
})
|
|
245
|
+
]));
|
|
246
|
+
}
|
|
247
|
+
}), At = /* @__PURE__ */ I(he, [["__scopeId", "data-v-091e8739"]]), be = ["accept", "multiple", "disabled"], ve = { class: "flex flex-col items-center justify-center gap-4 text-center" }, ye = { class: "w-32 h-32 flex items-center justify-center" }, me = ["src", "alt"], ke = {
|
|
248
|
+
key: 1,
|
|
249
|
+
class: "w-full h-full text-gray-400",
|
|
250
|
+
fill: "none",
|
|
251
|
+
stroke: "currentColor",
|
|
252
|
+
viewBox: "0 0 24 24"
|
|
253
|
+
}, we = { class: "text-center" }, $e = { class: "text-base font-medium text-gray-700" }, Ce = { class: "text-primary-700" }, _e = { class: "flex items-center gap-3 flex-1 min-w-0" }, Be = { class: "flex-1 min-w-0" }, Te = { class: "text-sm font-medium text-gray-900 truncate" }, Ve = { class: "text-xs text-gray-500" }, je = {
|
|
254
|
+
key: 1,
|
|
255
|
+
class: "text-xs text-gray-500 mt-2"
|
|
256
|
+
}, ze = {
|
|
257
|
+
key: 2,
|
|
258
|
+
class: "text-sm text-danger-500 mt-2"
|
|
259
|
+
}, Nt = /* @__PURE__ */ B({
|
|
260
|
+
__name: "FileUpload",
|
|
261
|
+
props: {
|
|
262
|
+
modelValue: { default: null },
|
|
263
|
+
accept: { default: "*" },
|
|
264
|
+
multiple: { type: Boolean, default: !1 },
|
|
265
|
+
disabled: { type: Boolean, default: !1 },
|
|
266
|
+
illustration: { default: void 0 },
|
|
267
|
+
illustrationAlt: { default: "Subir archivo" },
|
|
268
|
+
mainText: { default: "Suelta aquí un archivo o" },
|
|
269
|
+
linkText: { default: "selecciónalo desde tu equipo" },
|
|
270
|
+
helperText: { default: "" },
|
|
271
|
+
maxSize: { default: void 0 }
|
|
272
|
+
},
|
|
273
|
+
emits: ["update:modelValue", "change", "error"],
|
|
274
|
+
setup(e, { emit: h }) {
|
|
275
|
+
const l = e, u = h, r = T(null), i = T(!1), n = T(l.modelValue), d = T(""), o = () => {
|
|
276
|
+
var w;
|
|
277
|
+
(w = r.value) == null || w.click();
|
|
278
|
+
}, m = () => {
|
|
279
|
+
l.disabled || o();
|
|
280
|
+
}, b = (w) => {
|
|
281
|
+
l.disabled || (i.value = !0);
|
|
282
|
+
}, V = () => {
|
|
283
|
+
i.value = !1;
|
|
284
|
+
}, M = (w) => {
|
|
285
|
+
if (d.value = "", l.maxSize && w.size > l.maxSize) {
|
|
286
|
+
const y = (l.maxSize / 1048576).toFixed(2);
|
|
287
|
+
return d.value = `El archivo excede el tamaño máximo de ${y}MB`, u("error", d.value), !1;
|
|
288
|
+
}
|
|
289
|
+
return !0;
|
|
290
|
+
}, O = (w) => {
|
|
291
|
+
var _;
|
|
292
|
+
const C = (_ = w.target.files) == null ? void 0 : _[0];
|
|
293
|
+
C && M(C) && (n.value = C, u("update:modelValue", C), u("change", C));
|
|
294
|
+
}, A = (w) => {
|
|
295
|
+
var C;
|
|
296
|
+
i.value = !1;
|
|
297
|
+
const y = (C = w.dataTransfer) == null ? void 0 : C.files[0];
|
|
298
|
+
y && M(y) && (n.value = y, u("update:modelValue", y), u("change", y));
|
|
299
|
+
}, N = () => {
|
|
300
|
+
n.value = null, d.value = "", r.value && (r.value.value = ""), u("update:modelValue", null), u("change", null);
|
|
301
|
+
}, q = (w) => {
|
|
302
|
+
if (w === 0) return "0 Bytes";
|
|
303
|
+
const y = 1024, C = ["Bytes", "KB", "MB", "GB"], _ = Math.floor(Math.log(w) / Math.log(y));
|
|
304
|
+
return Math.round(w / Math.pow(y, _) * 100) / 100 + " " + C[_];
|
|
305
|
+
};
|
|
306
|
+
return (w, y) => (t(), s("div", {
|
|
307
|
+
class: k(["relative border-2 border-dashed rounded-lg p-8 transition-colors", [
|
|
308
|
+
i.value ? "border-primary-700 bg-primary-50" : "border-gray-300 bg-white hover:border-primary-500",
|
|
309
|
+
e.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
310
|
+
]]),
|
|
311
|
+
onClick: m,
|
|
312
|
+
onDragover: j(b, ["prevent"]),
|
|
313
|
+
onDragleave: j(V, ["prevent"]),
|
|
314
|
+
onDrop: j(A, ["prevent"])
|
|
315
|
+
}, [
|
|
316
|
+
a("input", {
|
|
317
|
+
ref_key: "fileInput",
|
|
318
|
+
ref: r,
|
|
319
|
+
type: "file",
|
|
320
|
+
accept: e.accept,
|
|
321
|
+
multiple: e.multiple,
|
|
322
|
+
disabled: e.disabled,
|
|
323
|
+
class: "hidden",
|
|
324
|
+
onChange: O
|
|
325
|
+
}, null, 40, be),
|
|
326
|
+
a("div", ve, [
|
|
327
|
+
a("div", ye, [
|
|
328
|
+
e.illustration ? (t(), s("img", {
|
|
329
|
+
key: 0,
|
|
330
|
+
src: e.illustration,
|
|
331
|
+
alt: e.illustrationAlt,
|
|
332
|
+
class: "max-w-full max-h-full object-contain"
|
|
333
|
+
}, null, 8, me)) : (t(), s("svg", ke, [...y[1] || (y[1] = [
|
|
334
|
+
a("path", {
|
|
335
|
+
"stroke-linecap": "round",
|
|
336
|
+
"stroke-linejoin": "round",
|
|
337
|
+
"stroke-width": "1.5",
|
|
338
|
+
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"
|
|
339
|
+
}, null, -1)
|
|
340
|
+
])]))
|
|
341
|
+
]),
|
|
342
|
+
a("div", we, [
|
|
343
|
+
a("p", $e, [
|
|
344
|
+
S(x(e.mainText) + " ", 1),
|
|
345
|
+
a("span", Ce, x(e.linkText), 1)
|
|
346
|
+
])
|
|
347
|
+
]),
|
|
348
|
+
n.value ? (t(), s("div", {
|
|
349
|
+
key: 0,
|
|
350
|
+
class: "w-full max-w-md bg-gray-50 rounded-lg p-4 flex items-center justify-between",
|
|
351
|
+
onClick: y[0] || (y[0] = j(() => {
|
|
352
|
+
}, ["stop"]))
|
|
353
|
+
}, [
|
|
354
|
+
a("div", _e, [
|
|
355
|
+
y[2] || (y[2] = a("svg", {
|
|
356
|
+
class: "w-6 h-6 text-gray-600 flex-shrink-0",
|
|
357
|
+
fill: "none",
|
|
358
|
+
stroke: "currentColor",
|
|
359
|
+
viewBox: "0 0 24 24"
|
|
360
|
+
}, [
|
|
361
|
+
a("path", {
|
|
362
|
+
"stroke-linecap": "round",
|
|
363
|
+
"stroke-linejoin": "round",
|
|
364
|
+
"stroke-width": "2",
|
|
365
|
+
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"
|
|
366
|
+
})
|
|
367
|
+
], -1)),
|
|
368
|
+
a("div", Be, [
|
|
369
|
+
a("p", Te, x(n.value.name), 1),
|
|
370
|
+
a("p", Ve, x(q(n.value.size)), 1)
|
|
371
|
+
])
|
|
372
|
+
]),
|
|
373
|
+
e.disabled ? p("", !0) : (t(), s("button", {
|
|
374
|
+
key: 0,
|
|
375
|
+
onClick: j(N, ["stop"]),
|
|
376
|
+
class: "ml-3 text-gray-400 hover:text-danger-500 transition-colors"
|
|
377
|
+
}, [...y[3] || (y[3] = [
|
|
378
|
+
a("svg", {
|
|
379
|
+
class: "w-5 h-5",
|
|
380
|
+
fill: "currentColor",
|
|
381
|
+
viewBox: "0 0 20 20"
|
|
382
|
+
}, [
|
|
383
|
+
a("path", {
|
|
384
|
+
"fill-rule": "evenodd",
|
|
385
|
+
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
386
|
+
"clip-rule": "evenodd"
|
|
387
|
+
})
|
|
388
|
+
], -1)
|
|
389
|
+
])]))
|
|
390
|
+
])) : p("", !0),
|
|
391
|
+
e.helperText ? (t(), s("p", je, x(e.helperText), 1)) : p("", !0),
|
|
392
|
+
d.value ? (t(), s("p", ze, x(d.value), 1)) : p("", !0)
|
|
393
|
+
])
|
|
394
|
+
], 34));
|
|
395
|
+
}
|
|
396
|
+
}), Me = ["stroke-width"], De = {
|
|
397
|
+
class: "w-full h-full rounded-lg overflow-hidden",
|
|
398
|
+
style: { "background-color": "#f7f7f7" }
|
|
399
|
+
}, Le = /* @__PURE__ */ B({
|
|
400
|
+
__name: "Loader",
|
|
401
|
+
props: {
|
|
402
|
+
type: { default: "circular" },
|
|
403
|
+
size: { default: "40px" },
|
|
404
|
+
height: { default: "4px" },
|
|
405
|
+
color: { default: "primary" },
|
|
406
|
+
strokeWidth: { default: 4 },
|
|
407
|
+
progress: { default: void 0 }
|
|
408
|
+
},
|
|
409
|
+
setup(e) {
|
|
410
|
+
const h = e, l = {
|
|
411
|
+
primary: "text-primary-700",
|
|
412
|
+
secondary: "text-secondary-500",
|
|
413
|
+
success: "text-success-500",
|
|
414
|
+
warning: "text-warning-500",
|
|
415
|
+
danger: "text-danger-500",
|
|
416
|
+
info: "text-info-500"
|
|
417
|
+
}, u = {
|
|
418
|
+
primary: "bg-primary-700",
|
|
419
|
+
secondary: "bg-secondary-500",
|
|
420
|
+
success: "bg-success-500",
|
|
421
|
+
warning: "bg-warning-500",
|
|
422
|
+
danger: "bg-danger-500",
|
|
423
|
+
info: "bg-info-500"
|
|
424
|
+
}, r = v(() => [l[h.color]]), i = v(() => [u[h.color]]);
|
|
425
|
+
return (n, d) => e.type === "circular" ? (t(), s("div", {
|
|
426
|
+
key: 0,
|
|
427
|
+
class: k(r.value)
|
|
428
|
+
}, [
|
|
429
|
+
(t(), s("svg", {
|
|
430
|
+
class: "animate-spin",
|
|
431
|
+
style: F({ width: e.size, height: e.size }),
|
|
432
|
+
viewBox: "0 0 24 24"
|
|
433
|
+
}, [
|
|
434
|
+
a("circle", {
|
|
435
|
+
class: "opacity-25",
|
|
436
|
+
cx: "12",
|
|
437
|
+
cy: "12",
|
|
438
|
+
r: "10",
|
|
439
|
+
stroke: "currentColor",
|
|
440
|
+
"stroke-width": e.strokeWidth,
|
|
441
|
+
fill: "none"
|
|
442
|
+
}, null, 8, Me),
|
|
443
|
+
d[0] || (d[0] = a("path", {
|
|
444
|
+
class: "opacity-75",
|
|
445
|
+
fill: "currentColor",
|
|
446
|
+
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"
|
|
447
|
+
}, null, -1))
|
|
448
|
+
], 4))
|
|
449
|
+
], 2)) : e.type === "linear" ? (t(), s("div", {
|
|
450
|
+
key: 1,
|
|
451
|
+
class: "w-full",
|
|
452
|
+
style: F({ height: e.height })
|
|
453
|
+
}, [
|
|
454
|
+
a("div", De, [
|
|
455
|
+
a("div", {
|
|
456
|
+
class: k([i.value, "h-full rounded-lg animate-linear-loader"]),
|
|
457
|
+
style: F({ width: e.progress ? `${e.progress}%` : void 0 })
|
|
458
|
+
}, null, 6)
|
|
459
|
+
])
|
|
460
|
+
], 4)) : p("", !0);
|
|
461
|
+
}
|
|
462
|
+
}), qt = /* @__PURE__ */ I(Le, [["__scopeId", "data-v-8df4ec38"]]), Se = ["for"], Ie = {
|
|
463
|
+
key: 0,
|
|
464
|
+
class: "text-danger-600"
|
|
465
|
+
}, Oe = { class: "relative" }, Fe = ["id", "disabled", "aria-expanded"], Ae = {
|
|
466
|
+
key: 0,
|
|
467
|
+
class: "flex items-center gap-3 flex-1"
|
|
468
|
+
}, Ne = {
|
|
469
|
+
key: 0,
|
|
470
|
+
class: "w-8 h-8 rounded-full overflow-hidden bg-primary-50 flex-shrink-0"
|
|
471
|
+
}, qe = ["src", "alt"], Ee = {
|
|
472
|
+
key: 1,
|
|
473
|
+
class: "w-8 h-8 rounded-full bg-primary-700 flex items-center justify-center flex-shrink-0 font-bold text-white text-sm"
|
|
474
|
+
}, He = { class: "flex flex-col items-start flex-1 min-w-0" }, Ke = {
|
|
475
|
+
key: 1,
|
|
476
|
+
class: "flex-1 text-left truncate"
|
|
477
|
+
}, Pe = {
|
|
478
|
+
key: 0,
|
|
479
|
+
class: "p-2 border-b border-secondary-200"
|
|
480
|
+
}, We = ["placeholder"], Ue = { class: "max-h-64 overflow-y-auto" }, Ge = {
|
|
481
|
+
key: 0,
|
|
482
|
+
class: "px-4 py-3 text-sm text-secondary-500 text-center"
|
|
483
|
+
}, Qe = ["onClick"], Je = {
|
|
484
|
+
key: 0,
|
|
485
|
+
class: "flex items-center gap-3 w-full"
|
|
486
|
+
}, Re = {
|
|
487
|
+
key: 0,
|
|
488
|
+
class: "w-10 h-10 rounded-full overflow-hidden bg-primary-50 flex-shrink-0"
|
|
489
|
+
}, Xe = ["src", "alt"], Ye = {
|
|
490
|
+
key: 1,
|
|
491
|
+
class: "w-10 h-10 rounded-full bg-primary-700 flex items-center justify-center flex-shrink-0 font-bold text-white"
|
|
492
|
+
}, Ze = { class: "flex flex-col items-start flex-1 min-w-0" }, et = { class: "text-sm font-semibold text-secondary-900 truncate w-full" }, tt = {
|
|
493
|
+
key: 0,
|
|
494
|
+
class: "text-xs text-secondary-600 truncate w-full"
|
|
495
|
+
}, st = {
|
|
496
|
+
key: 1,
|
|
497
|
+
class: "text-xs text-secondary-500 truncate w-full"
|
|
498
|
+
}, lt = {
|
|
499
|
+
key: 2,
|
|
500
|
+
class: "w-5 h-5 text-primary-600 flex-shrink-0",
|
|
501
|
+
fill: "none",
|
|
502
|
+
stroke: "currentColor",
|
|
503
|
+
viewBox: "0 0 24 24",
|
|
504
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
505
|
+
}, at = {
|
|
506
|
+
key: 1,
|
|
507
|
+
class: "flex items-center justify-between w-full"
|
|
508
|
+
}, ot = { class: "truncate" }, nt = {
|
|
509
|
+
key: 0,
|
|
510
|
+
class: "w-5 h-5 text-primary-600 flex-shrink-0 ml-2",
|
|
511
|
+
fill: "none",
|
|
512
|
+
stroke: "currentColor",
|
|
513
|
+
viewBox: "0 0 24 24",
|
|
514
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
515
|
+
}, rt = {
|
|
516
|
+
key: 0,
|
|
517
|
+
class: "border-t border-secondary-200 my-1"
|
|
518
|
+
}, it = ["onClick"], dt = ["innerHTML"], ct = {
|
|
519
|
+
key: 1,
|
|
520
|
+
class: "mt-1 text-sm text-danger-600"
|
|
521
|
+
}, ut = {
|
|
522
|
+
key: 2,
|
|
523
|
+
class: "mt-1 text-sm text-secondary-600"
|
|
524
|
+
}, ft = /* @__PURE__ */ B({
|
|
525
|
+
__name: "Select",
|
|
526
|
+
props: {
|
|
527
|
+
modelValue: { default: null },
|
|
528
|
+
options: { default: () => [] },
|
|
529
|
+
actionItems: { default: () => [] },
|
|
530
|
+
mode: { default: "normal" },
|
|
531
|
+
label: { default: "" },
|
|
532
|
+
placeholder: { default: "Seleccionar..." },
|
|
533
|
+
size: { default: "md" },
|
|
534
|
+
variant: { default: "default" },
|
|
535
|
+
disabled: { type: Boolean, default: !1 },
|
|
536
|
+
required: { type: Boolean, default: !1 },
|
|
537
|
+
searchable: { type: Boolean, default: !1 },
|
|
538
|
+
searchPlaceholder: { default: "Buscar..." },
|
|
539
|
+
emptyText: { default: "No hay opciones disponibles" },
|
|
540
|
+
error: { default: "" },
|
|
541
|
+
helperText: { default: "" },
|
|
542
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
543
|
+
menuPosition: { default: "bottom" }
|
|
544
|
+
},
|
|
545
|
+
emits: ["update:modelValue", "change", "action"],
|
|
546
|
+
setup(e, { emit: h }) {
|
|
547
|
+
const l = e, u = h, r = T(!1), i = T(""), n = T(null), d = v(
|
|
548
|
+
() => `select-${Math.random().toString(36).substr(2, 9)}`
|
|
549
|
+
), o = v(() => l.options.find((c) => c.value === l.modelValue) || null), m = v(() => {
|
|
550
|
+
if (!l.searchable || !i.value)
|
|
551
|
+
return l.options;
|
|
552
|
+
const c = i.value.toLowerCase();
|
|
553
|
+
return l.options.filter((g) => {
|
|
554
|
+
var f, D;
|
|
555
|
+
return g.label.toLowerCase().includes(c) || ((f = g.subtitle) == null ? void 0 : f.toLowerCase().includes(c)) || ((D = g.description) == null ? void 0 : D.toLowerCase().includes(c));
|
|
556
|
+
});
|
|
557
|
+
}), b = v(() => "block text-sm font-semibold text-secondary-700 mb-1"), V = v(() => {
|
|
558
|
+
const c = "w-full flex items-center justify-between gap-2 border rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed", g = {
|
|
559
|
+
sm: "px-3 py-1.5 text-sm",
|
|
560
|
+
md: "px-4 py-2 text-base",
|
|
561
|
+
lg: "px-5 py-3 text-lg"
|
|
562
|
+
}, f = {
|
|
563
|
+
default: "bg-white border-secondary-300 hover:border-secondary-400",
|
|
564
|
+
outline: "bg-transparent border-secondary-300 hover:border-primary-500",
|
|
565
|
+
filled: "bg-secondary-100 border-transparent hover:bg-secondary-200"
|
|
566
|
+
}, D = l.mode === "menu" ? "bg-primary-700 border-primary-700 hover:bg-primary-600" : "", G = l.error ? "border-danger-600 focus:ring-danger-500" : "";
|
|
567
|
+
return [
|
|
568
|
+
c,
|
|
569
|
+
g[l.size],
|
|
570
|
+
D || f[l.variant],
|
|
571
|
+
G
|
|
572
|
+
].join(" ");
|
|
573
|
+
}), M = v(() => l.mode === "menu" ? "text-white" : "text-secondary-900"), O = v(() => l.mode === "menu" ? "text-primary-100" : "text-secondary-600"), A = v(() => l.mode === "menu" ? "text-white" : "text-secondary-600"), N = v(() => `absolute ${l.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`), q = (c) => {
|
|
574
|
+
const g = "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", f = y(c) ? "bg-primary-50" : "";
|
|
575
|
+
return [g, f].join(" ");
|
|
576
|
+
}, w = (c) => {
|
|
577
|
+
const g = "w-full px-4 py-2 text-left text-sm font-semibold transition-colors focus:outline-none flex items-center gap-3";
|
|
578
|
+
return c.variant === "danger" ? `${g} text-danger-600 hover:bg-danger-50 focus:bg-danger-50` : `${g} text-secondary-700 hover:bg-secondary-50 focus:bg-secondary-50`;
|
|
579
|
+
}, y = (c) => c.value === l.modelValue, C = () => {
|
|
580
|
+
l.disabled || (r.value = !r.value, r.value && l.searchable && ee(() => {
|
|
581
|
+
var c;
|
|
582
|
+
(c = n.value) == null || c.focus();
|
|
583
|
+
}));
|
|
584
|
+
}, _ = () => {
|
|
585
|
+
r.value = !1, i.value = "";
|
|
586
|
+
}, K = (c) => {
|
|
587
|
+
c.disabled || (u("update:modelValue", c.value), u("change", c), _());
|
|
588
|
+
}, P = (c) => {
|
|
589
|
+
c.action && c.action(), u("action", c), _();
|
|
590
|
+
}, W = (c) => {
|
|
591
|
+
const g = c.relatedTarget;
|
|
592
|
+
g && g.closest(".select-wrapper") || setTimeout(() => {
|
|
593
|
+
_();
|
|
594
|
+
}, 200);
|
|
595
|
+
}, U = (c) => {
|
|
596
|
+
c.key === "Escape" ? _() : (c.key === "Enter" || c.key === " ") && (c.preventDefault(), C());
|
|
597
|
+
};
|
|
598
|
+
return X(r, (c) => {
|
|
599
|
+
c && (i.value = "");
|
|
600
|
+
}), (c, g) => (t(), s("div", {
|
|
601
|
+
class: k(["select-wrapper", { "w-full": e.fullWidth }])
|
|
602
|
+
}, [
|
|
603
|
+
e.label ? (t(), s("label", {
|
|
604
|
+
key: 0,
|
|
605
|
+
for: d.value,
|
|
606
|
+
class: k(b.value)
|
|
607
|
+
}, [
|
|
608
|
+
S(x(e.label) + " ", 1),
|
|
609
|
+
e.required ? (t(), s("span", Ie, "*")) : p("", !0)
|
|
610
|
+
], 10, Se)) : p("", !0),
|
|
611
|
+
a("div", Oe, [
|
|
612
|
+
a("button", {
|
|
613
|
+
id: d.value,
|
|
614
|
+
type: "button",
|
|
615
|
+
class: k(V.value),
|
|
616
|
+
disabled: e.disabled,
|
|
617
|
+
"aria-expanded": r.value,
|
|
618
|
+
"aria-haspopup": !0,
|
|
619
|
+
onClick: C,
|
|
620
|
+
onBlur: W,
|
|
621
|
+
onKeydown: U
|
|
622
|
+
}, [
|
|
623
|
+
e.mode === "menu" && o.value ? (t(), s("div", Ae, [
|
|
624
|
+
o.value.avatar ? (t(), s("div", Ne, [
|
|
625
|
+
a("img", {
|
|
626
|
+
src: o.value.avatar,
|
|
627
|
+
alt: o.value.label,
|
|
628
|
+
class: "w-full h-full object-cover"
|
|
629
|
+
}, null, 8, qe)
|
|
630
|
+
])) : o.value.initials ? (t(), s("div", Ee, x(o.value.initials), 1)) : p("", !0),
|
|
631
|
+
a("div", He, [
|
|
632
|
+
a("span", {
|
|
633
|
+
class: k(["text-sm font-semibold truncate w-full", M.value])
|
|
634
|
+
}, x(o.value.label), 3),
|
|
635
|
+
o.value.subtitle ? (t(), s("span", {
|
|
636
|
+
key: 0,
|
|
637
|
+
class: k(["text-xs truncate w-full", O.value])
|
|
638
|
+
}, x(o.value.subtitle), 3)) : p("", !0)
|
|
639
|
+
])
|
|
640
|
+
])) : (t(), s("span", Ke, x(o.value ? o.value.label : e.placeholder), 1)),
|
|
641
|
+
(t(), s("svg", {
|
|
642
|
+
class: k(["w-5 h-5 flex-shrink-0 transition-transform", [r.value ? "rotate-180" : "", A.value]]),
|
|
643
|
+
fill: "none",
|
|
644
|
+
stroke: "currentColor",
|
|
645
|
+
viewBox: "0 0 24 24",
|
|
646
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
647
|
+
}, [...g[3] || (g[3] = [
|
|
648
|
+
a("path", {
|
|
649
|
+
"stroke-linecap": "round",
|
|
650
|
+
"stroke-linejoin": "round",
|
|
651
|
+
"stroke-width": "2",
|
|
652
|
+
d: "M19 9l-7 7-7-7"
|
|
653
|
+
}, null, -1)
|
|
654
|
+
])], 2))
|
|
655
|
+
], 42, Fe),
|
|
656
|
+
r.value ? (t(), s("div", {
|
|
657
|
+
key: 0,
|
|
658
|
+
class: k(N.value),
|
|
659
|
+
onClick: g[2] || (g[2] = j(() => {
|
|
660
|
+
}, ["stop"]))
|
|
661
|
+
}, [
|
|
662
|
+
e.searchable ? (t(), s("div", Pe, [
|
|
663
|
+
Y(a("input", {
|
|
664
|
+
ref_key: "searchInput",
|
|
665
|
+
ref: n,
|
|
666
|
+
"onUpdate:modelValue": g[0] || (g[0] = (f) => i.value = f),
|
|
667
|
+
type: "text",
|
|
668
|
+
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",
|
|
669
|
+
placeholder: e.searchPlaceholder,
|
|
670
|
+
onKeydown: g[1] || (g[1] = j(() => {
|
|
671
|
+
}, ["stop"]))
|
|
672
|
+
}, null, 40, We), [
|
|
673
|
+
[Z, i.value]
|
|
674
|
+
])
|
|
675
|
+
])) : p("", !0),
|
|
676
|
+
a("div", Ue, [
|
|
677
|
+
m.value.length === 0 ? (t(), s("div", Ge, x(e.emptyText), 1)) : (t(), s(z, { key: 1 }, [
|
|
678
|
+
(t(!0), s(z, null, L(m.value, (f) => (t(), s("button", {
|
|
679
|
+
key: f.value,
|
|
680
|
+
type: "button",
|
|
681
|
+
class: k(q(f)),
|
|
682
|
+
onClick: (D) => K(f)
|
|
683
|
+
}, [
|
|
684
|
+
e.mode === "menu" ? (t(), s("div", Je, [
|
|
685
|
+
f.avatar ? (t(), s("div", Re, [
|
|
686
|
+
a("img", {
|
|
687
|
+
src: f.avatar,
|
|
688
|
+
alt: f.label,
|
|
689
|
+
class: "w-full h-full object-cover"
|
|
690
|
+
}, null, 8, Xe)
|
|
691
|
+
])) : f.initials ? (t(), s("div", Ye, x(f.initials), 1)) : p("", !0),
|
|
692
|
+
a("div", Ze, [
|
|
693
|
+
a("span", et, x(f.label), 1),
|
|
694
|
+
f.subtitle ? (t(), s("span", tt, x(f.subtitle), 1)) : p("", !0),
|
|
695
|
+
f.description ? (t(), s("span", st, x(f.description), 1)) : p("", !0)
|
|
696
|
+
]),
|
|
697
|
+
y(f) ? (t(), s("svg", lt, [...g[4] || (g[4] = [
|
|
698
|
+
a("path", {
|
|
699
|
+
"stroke-linecap": "round",
|
|
700
|
+
"stroke-linejoin": "round",
|
|
701
|
+
"stroke-width": "2",
|
|
702
|
+
d: "M5 13l4 4L19 7"
|
|
703
|
+
}, null, -1)
|
|
704
|
+
])])) : p("", !0)
|
|
705
|
+
])) : (t(), s("div", at, [
|
|
706
|
+
a("span", ot, x(f.label), 1),
|
|
707
|
+
y(f) ? (t(), s("svg", nt, [...g[5] || (g[5] = [
|
|
708
|
+
a("path", {
|
|
709
|
+
"stroke-linecap": "round",
|
|
710
|
+
"stroke-linejoin": "round",
|
|
711
|
+
"stroke-width": "2",
|
|
712
|
+
d: "M5 13l4 4L19 7"
|
|
713
|
+
}, null, -1)
|
|
714
|
+
])])) : p("", !0)
|
|
715
|
+
]))
|
|
716
|
+
], 10, Qe))), 128)),
|
|
717
|
+
e.actionItems.length > 0 ? (t(), s("div", rt)) : p("", !0),
|
|
718
|
+
(t(!0), s(z, null, L(e.actionItems, (f) => (t(), s("button", {
|
|
719
|
+
key: f.id,
|
|
720
|
+
type: "button",
|
|
721
|
+
class: k(w(f)),
|
|
722
|
+
onClick: (D) => P(f)
|
|
723
|
+
}, [
|
|
724
|
+
f.icon ? (t(), s("svg", {
|
|
725
|
+
key: 0,
|
|
726
|
+
class: "w-4 h-4 flex-shrink-0",
|
|
727
|
+
fill: "none",
|
|
728
|
+
stroke: "currentColor",
|
|
729
|
+
viewBox: "0 0 24 24",
|
|
730
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
731
|
+
innerHTML: f.icon
|
|
732
|
+
}, null, 8, dt)) : p("", !0),
|
|
733
|
+
S(" " + x(f.label), 1)
|
|
734
|
+
], 10, it))), 128))
|
|
735
|
+
], 64))
|
|
736
|
+
])
|
|
737
|
+
], 2)) : p("", !0)
|
|
738
|
+
]),
|
|
739
|
+
e.error ? (t(), s("p", ct, x(e.error), 1)) : e.helperText ? (t(), s("p", ut, x(e.helperText), 1)) : p("", !0),
|
|
740
|
+
r.value ? (t(), s("div", {
|
|
741
|
+
key: 3,
|
|
742
|
+
onClick: _,
|
|
743
|
+
class: "fixed inset-0 z-40"
|
|
744
|
+
})) : p("", !0)
|
|
745
|
+
], 2));
|
|
746
|
+
}
|
|
747
|
+
}), Et = /* @__PURE__ */ I(ft, [["__scopeId", "data-v-5644cc74"]]), pt = { class: "w-full overflow-x-auto" }, xt = { class: "w-full border-collapse" }, gt = { class: "w-full" }, ht = { class: "bg-white border-b border-gray-100 w-full" }, bt = ["onClick"], vt = { class: "flex items-center gap-2" }, yt = {
|
|
748
|
+
key: 0,
|
|
749
|
+
class: "text-xs text-gray-400"
|
|
750
|
+
}, mt = { key: 0 }, kt = { key: 1 }, wt = { class: "w-full" }, $t = {
|
|
751
|
+
key: 0,
|
|
752
|
+
class: "flex items-center justify-center py-12 text-gray-400"
|
|
753
|
+
}, Ct = {
|
|
754
|
+
key: 1,
|
|
755
|
+
class: "w-full px-6 py-4 bg-white"
|
|
756
|
+
}, _t = /* @__PURE__ */ B({
|
|
757
|
+
__name: "Table",
|
|
758
|
+
props: {
|
|
759
|
+
columns: {},
|
|
760
|
+
data: {}
|
|
761
|
+
},
|
|
762
|
+
setup(e) {
|
|
763
|
+
const h = e, l = T(null), u = T("asc"), r = (n) => {
|
|
764
|
+
l.value === n ? u.value = u.value === "asc" ? "desc" : "asc" : (l.value = n, u.value = "asc");
|
|
765
|
+
}, i = v(() => {
|
|
766
|
+
if (!l.value)
|
|
767
|
+
return h.data;
|
|
768
|
+
const n = [...h.data];
|
|
769
|
+
return n.sort((d, o) => {
|
|
770
|
+
const m = d[l.value], b = o[l.value];
|
|
771
|
+
return typeof m == "string" && typeof b == "string" ? u.value === "asc" ? m.localeCompare(b) : b.localeCompare(m) : typeof m == "number" && typeof b == "number" ? u.value === "asc" ? m - b : b - m : 0;
|
|
772
|
+
}), n;
|
|
773
|
+
});
|
|
774
|
+
return (n, d) => (t(), s("div", pt, [
|
|
775
|
+
a("table", xt, [
|
|
776
|
+
a("thead", gt, [
|
|
777
|
+
a("tr", ht, [
|
|
778
|
+
(t(!0), s(z, null, L(e.columns, (o) => (t(), s("th", {
|
|
779
|
+
key: o.key,
|
|
780
|
+
style: F(o.width ? { width: o.width } : {}),
|
|
781
|
+
class: k([
|
|
782
|
+
"px-8 py-4 text-left text-base font-semibold text-gray-900 border-0",
|
|
783
|
+
o.sortable ? "cursor-pointer hover:text-primary-700 select-none transition-colors" : ""
|
|
784
|
+
]),
|
|
785
|
+
onClick: (m) => o.sortable && r(o.key)
|
|
786
|
+
}, [
|
|
787
|
+
a("div", vt, [
|
|
788
|
+
a("span", null, x(o.label), 1),
|
|
789
|
+
o.sortable ? (t(), s("span", yt, [
|
|
790
|
+
l.value !== o.key ? (t(), s("span", mt, "⇅")) : (t(), s("span", kt, x(u.value === "asc" ? "↑" : "↓"), 1))
|
|
791
|
+
])) : p("", !0)
|
|
792
|
+
])
|
|
793
|
+
], 14, bt))), 128))
|
|
794
|
+
])
|
|
795
|
+
]),
|
|
796
|
+
a("tbody", wt, [
|
|
797
|
+
(t(!0), s(z, null, L(i.value, (o, m) => (t(), s("tr", {
|
|
798
|
+
key: m,
|
|
799
|
+
class: "w-full hover:bg-gray-50 transition-colors"
|
|
800
|
+
}, [
|
|
801
|
+
(t(!0), s(z, null, L(e.columns, (b) => (t(), s("td", {
|
|
802
|
+
key: `${m}-${b.key}`,
|
|
803
|
+
class: "px-8 py-4 text-base text-gray-700 border-0"
|
|
804
|
+
}, [
|
|
805
|
+
$(n.$slots, `cell-${b.key}`, {
|
|
806
|
+
value: o[b.key],
|
|
807
|
+
row: o
|
|
808
|
+
}, () => [
|
|
809
|
+
S(x(o[b.key]), 1)
|
|
810
|
+
], !0)
|
|
811
|
+
]))), 128))
|
|
812
|
+
]))), 128))
|
|
813
|
+
])
|
|
814
|
+
]),
|
|
815
|
+
i.value.length === 0 ? (t(), s("div", $t, [
|
|
816
|
+
$(n.$slots, "empty", {}, () => [
|
|
817
|
+
d[0] || (d[0] = S("No hay datos disponibles", -1))
|
|
818
|
+
], !0)
|
|
819
|
+
])) : p("", !0),
|
|
820
|
+
n.$slots.footer ? (t(), s("div", Ct, [
|
|
821
|
+
$(n.$slots, "footer", {}, void 0, !0)
|
|
822
|
+
])) : p("", !0)
|
|
823
|
+
]));
|
|
824
|
+
}
|
|
825
|
+
}), Ht = /* @__PURE__ */ I(_t, [["__scopeId", "data-v-6b3ff0a8"]]), Bt = { class: "w-full" }, Tt = {
|
|
826
|
+
class: "flex border-b border-gray-100",
|
|
827
|
+
role: "tablist"
|
|
828
|
+
}, Vt = ["aria-selected", "onClick"], jt = { role: "tabpanel" }, zt = "relative px-6 py-3 text-base font-semibold tracking-wide transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary-500", Mt = "text-primary-700 border-b-4 border-primary-700", Dt = "text-gray-600 border-b-4 border-transparent hover:text-gray-800", Kt = /* @__PURE__ */ B({
|
|
829
|
+
__name: "Tabs",
|
|
830
|
+
props: {
|
|
831
|
+
modelValue: {},
|
|
832
|
+
tabs: {}
|
|
833
|
+
},
|
|
834
|
+
emits: ["update:modelValue"],
|
|
835
|
+
setup(e, { emit: h }) {
|
|
836
|
+
const l = e, u = h, r = (o) => l.modelValue === o, i = (o) => {
|
|
837
|
+
r(o) || u("update:modelValue", o);
|
|
838
|
+
}, n = v(() => l.modelValue), d = v(
|
|
839
|
+
() => l.tabs.find((o) => o.value === n.value)
|
|
840
|
+
);
|
|
841
|
+
return (o, m) => (t(), s("div", Bt, [
|
|
842
|
+
a("div", Tt, [
|
|
843
|
+
(t(!0), s(z, null, L(e.tabs, (b) => (t(), s("button", {
|
|
844
|
+
key: b.value,
|
|
845
|
+
type: "button",
|
|
846
|
+
class: k([
|
|
847
|
+
zt,
|
|
848
|
+
r(b.value) ? Mt : Dt
|
|
849
|
+
]),
|
|
850
|
+
"aria-selected": r(b.value),
|
|
851
|
+
role: "tab",
|
|
852
|
+
onClick: (V) => i(b.value)
|
|
853
|
+
}, x(b.label), 11, Vt))), 128))
|
|
854
|
+
]),
|
|
855
|
+
a("div", jt, [
|
|
856
|
+
$(o.$slots, n.value, {
|
|
857
|
+
active: n.value,
|
|
858
|
+
tab: d.value
|
|
859
|
+
})
|
|
860
|
+
])
|
|
861
|
+
]));
|
|
862
|
+
}
|
|
863
|
+
}), Lt = "font-sans", Pt = /* @__PURE__ */ B({
|
|
864
|
+
__name: "Text",
|
|
865
|
+
props: {
|
|
866
|
+
variant: { default: "body1" },
|
|
867
|
+
as: {},
|
|
868
|
+
color: { default: "default" },
|
|
869
|
+
align: { default: "left" },
|
|
870
|
+
uppercase: { type: Boolean, default: !1 },
|
|
871
|
+
truncate: { type: Boolean, default: !1 },
|
|
872
|
+
weight: {}
|
|
873
|
+
},
|
|
874
|
+
setup(e) {
|
|
875
|
+
const h = {
|
|
876
|
+
h1: "text-[40px] leading-[57px] tracking-[0px] font-extrabold",
|
|
877
|
+
h2: "text-[40px] leading-[57px] tracking-[0px] font-bold",
|
|
878
|
+
h3: "text-[28px] leading-[39px] tracking-[0px] font-extrabold",
|
|
879
|
+
h4: "text-[21px] leading-[29px] tracking-[0px] font-extrabold",
|
|
880
|
+
h5: "text-[16px] leading-[22px] tracking-[0px] font-extrabold",
|
|
881
|
+
h6: "text-[13px] leading-[18px] tracking-[0px] font-extrabold",
|
|
882
|
+
subtitle1: "text-[16px] leading-[24px] tracking-[0.15px] font-medium",
|
|
883
|
+
subtitle2: "text-[14px] leading-[21px] tracking-[0.1px] font-medium",
|
|
884
|
+
subtitle3: "text-[12px] leading-[18px] tracking-[0.1px] font-medium",
|
|
885
|
+
subtitle4: "text-[10px] leading-[15px] tracking-[0.1px] font-medium",
|
|
886
|
+
body1: "text-[16px] leading-[24px] tracking-[0.5px] font-light",
|
|
887
|
+
body2: "text-[14px] leading-[21px] tracking-[0.25px] font-light",
|
|
888
|
+
body3: "text-[12px] leading-[18px] tracking-[0.25px] font-light",
|
|
889
|
+
body4: "text-[10px] leading-[15px] tracking-[0.25px] font-light",
|
|
890
|
+
button1: "text-[14px] leading-[24px] tracking-[1.25px] font-bold",
|
|
891
|
+
button2: "text-[14px] leading-[20px] tracking-[1.25px] font-bold",
|
|
892
|
+
button3: "text-[12px] leading-[18px] tracking-[1.25px] font-bold",
|
|
893
|
+
caption: "text-[12px] leading-[18px] tracking-[0.4px] font-normal",
|
|
894
|
+
overline: "text-[10px] leading-[15px] tracking-[1.5px] font-medium"
|
|
895
|
+
}, l = {
|
|
896
|
+
h1: "h1",
|
|
897
|
+
h2: "h2",
|
|
898
|
+
h3: "h3",
|
|
899
|
+
h4: "h4",
|
|
900
|
+
h5: "h5",
|
|
901
|
+
h6: "h6",
|
|
902
|
+
subtitle1: "p",
|
|
903
|
+
subtitle2: "p",
|
|
904
|
+
subtitle3: "p",
|
|
905
|
+
subtitle4: "p",
|
|
906
|
+
body1: "p",
|
|
907
|
+
body2: "p",
|
|
908
|
+
body3: "p",
|
|
909
|
+
body4: "p",
|
|
910
|
+
button1: "span",
|
|
911
|
+
button2: "span",
|
|
912
|
+
button3: "span",
|
|
913
|
+
caption: "span",
|
|
914
|
+
overline: "span"
|
|
915
|
+
}, u = {
|
|
916
|
+
left: "text-left",
|
|
917
|
+
center: "text-center",
|
|
918
|
+
right: "text-right",
|
|
919
|
+
justify: "text-justify"
|
|
920
|
+
}, r = {
|
|
921
|
+
default: "text-secondary-900",
|
|
922
|
+
muted: "text-secondary-600",
|
|
923
|
+
primary: "text-primary-600",
|
|
924
|
+
secondary: "text-secondary-700",
|
|
925
|
+
danger: "text-danger-600",
|
|
926
|
+
success: "text-success-600",
|
|
927
|
+
warning: "text-warning-600"
|
|
928
|
+
}, i = {
|
|
929
|
+
light: "font-light",
|
|
930
|
+
normal: "font-normal",
|
|
931
|
+
medium: "font-medium",
|
|
932
|
+
semibold: "font-semibold",
|
|
933
|
+
bold: "font-bold",
|
|
934
|
+
extrabold: "font-extrabold"
|
|
935
|
+
}, n = e, d = v(() => n.variant), o = v(() => n.color), m = v(() => n.align), b = v(() => n.as || l[d.value] || "span"), V = v(() => n.weight ? i[n.weight] : "");
|
|
936
|
+
return (M, O) => (t(), E(te(b.value), {
|
|
937
|
+
class: k([
|
|
938
|
+
Lt,
|
|
939
|
+
h[d.value],
|
|
940
|
+
r[o.value],
|
|
941
|
+
u[m.value],
|
|
942
|
+
V.value,
|
|
943
|
+
{
|
|
944
|
+
uppercase: e.uppercase || d.value === "overline",
|
|
945
|
+
truncate: e.truncate
|
|
946
|
+
}
|
|
947
|
+
])
|
|
948
|
+
}, {
|
|
949
|
+
default: H(() => [
|
|
950
|
+
$(M.$slots, "default")
|
|
951
|
+
]),
|
|
952
|
+
_: 3
|
|
953
|
+
}, 8, ["class"]));
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
export {
|
|
957
|
+
It as AppBar,
|
|
958
|
+
Ot as Button,
|
|
959
|
+
Ft as Card,
|
|
960
|
+
At as Dialog,
|
|
961
|
+
Nt as FileUpload,
|
|
962
|
+
qt as Loader,
|
|
963
|
+
Et as Select,
|
|
964
|
+
Ht as Table,
|
|
965
|
+
Kt as Tabs,
|
|
966
|
+
Pt as Text
|
|
967
|
+
};
|