@iaclinical/components 1.0.3 → 1.0.5
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/README.md +39 -1
- package/dist/fonts/Poppins-Black.woff2 +0 -0
- package/dist/fonts/Poppins-BlackItalic.woff2 +0 -0
- package/dist/fonts/Poppins-Bold.woff2 +0 -0
- package/dist/fonts/Poppins-BoldItalic.woff2 +0 -0
- package/dist/fonts/Poppins-ExtraBold.woff2 +0 -0
- package/dist/fonts/Poppins-ExtraBoldItalic.woff2 +0 -0
- package/dist/fonts/Poppins-ExtraLight.woff2 +0 -0
- package/dist/fonts/Poppins-ExtraLightItalic.woff2 +0 -0
- package/dist/fonts/Poppins-Italic.woff2 +0 -0
- package/dist/fonts/Poppins-Light.woff2 +0 -0
- package/dist/fonts/Poppins-LightItalic.woff2 +0 -0
- package/dist/fonts/Poppins-Medium.woff2 +0 -0
- package/dist/fonts/Poppins-MediumItalic.woff2 +0 -0
- package/dist/fonts/Poppins-Regular.woff2 +0 -0
- package/dist/fonts/Poppins-SemiBold.woff2 +0 -0
- package/dist/fonts/Poppins-SemiBoldItalic.woff2 +0 -0
- package/dist/fonts/Poppins-Thin.woff2 +0 -0
- package/dist/fonts/Poppins-ThinItalic.woff2 +0 -0
- package/dist/iaclinical-components.cjs +1 -1
- package/dist/iaclinical-components.js +724 -532
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as L, computed as g, createElementBlock as o, openBlock as s, normalizeClass as v, createElementVNode as a, createCommentVNode as c, renderSlot as C, toDisplayString as $, createBlock as q, Teleport as X, createVNode as G, Transition as Q, withCtx as U, withModifiers as I, createTextVNode as A, ref as V, normalizeStyle as P, onMounted as ee, onUnmounted as te, watch as Y, nextTick as J, Fragment as E, renderList as W, resolveDynamicComponent as Z, withDirectives as se, vModelText as oe } from "vue";
|
|
2
|
+
const le = { class: "flex items-center gap-4" }, ae = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "text-lg font-bold text-primary-50 font-poppins"
|
|
5
|
-
},
|
|
5
|
+
}, ne = { class: "flex-1 flex justify-center" }, re = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "text-lg font-bold text-primary-50 font-poppins"
|
|
8
|
+
}, ie = { class: "flex items-center gap-3" }, de = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-lg font-bold text-primary-50 font-poppins"
|
|
11
|
+
}, ue = /* @__PURE__ */ L({
|
|
6
12
|
__name: "AppBar",
|
|
7
13
|
props: {
|
|
8
14
|
title: { default: "" },
|
|
15
|
+
titlePosition: { default: "left" },
|
|
9
16
|
showMenuButton: { type: Boolean, default: !0 },
|
|
10
17
|
variant: { default: "default" },
|
|
11
18
|
sticky: { type: Boolean, default: !0 },
|
|
@@ -13,70 +20,72 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
13
20
|
height: { default: "md" }
|
|
14
21
|
},
|
|
15
22
|
emits: ["toggle-menu"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
const
|
|
23
|
+
setup(t, { emit: y }) {
|
|
24
|
+
const e = t, u = y, n = g(() => {
|
|
25
|
+
const d = "flex items-center justify-between px-6 z-50", r = {
|
|
19
26
|
default: "bg-primary-700 text-primary-50",
|
|
20
27
|
dark: "bg-secondary-900 text-white",
|
|
21
28
|
light: "bg-white text-secondary-900 border-b border-secondary-200"
|
|
22
|
-
},
|
|
29
|
+
}, f = {
|
|
23
30
|
sm: "h-12",
|
|
24
31
|
md: "h-14",
|
|
25
32
|
lg: "h-16"
|
|
26
|
-
},
|
|
33
|
+
}, i = e.sticky ? "sticky top-0" : "", x = e.shadow ? "shadow-md" : "";
|
|
27
34
|
return [
|
|
35
|
+
d,
|
|
36
|
+
r[e.variant],
|
|
37
|
+
f[e.height],
|
|
28
38
|
i,
|
|
29
|
-
|
|
30
|
-
u[t.height],
|
|
31
|
-
a,
|
|
32
|
-
b
|
|
39
|
+
x
|
|
33
40
|
].join(" ");
|
|
34
41
|
});
|
|
35
|
-
return (
|
|
36
|
-
class:
|
|
42
|
+
return (d, r) => (s(), o("header", {
|
|
43
|
+
class: v(n.value)
|
|
37
44
|
}, [
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
a("div", le, [
|
|
46
|
+
t.showMenuButton ? (s(), o("button", {
|
|
40
47
|
key: 0,
|
|
41
|
-
onClick:
|
|
48
|
+
onClick: r[0] || (r[0] = (f) => u("toggle-menu")),
|
|
42
49
|
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
50
|
"aria-label": "Toggle menu"
|
|
44
|
-
}, [...
|
|
45
|
-
|
|
51
|
+
}, [...r[1] || (r[1] = [
|
|
52
|
+
a("svg", {
|
|
46
53
|
class: "w-6 h-6 text-primary-50",
|
|
47
54
|
fill: "none",
|
|
48
55
|
stroke: "currentColor",
|
|
49
56
|
viewBox: "0 0 24 24",
|
|
50
57
|
xmlns: "http://www.w3.org/2000/svg"
|
|
51
58
|
}, [
|
|
52
|
-
|
|
59
|
+
a("path", {
|
|
53
60
|
"stroke-linecap": "round",
|
|
54
61
|
"stroke-linejoin": "round",
|
|
55
62
|
"stroke-width": "2",
|
|
56
63
|
d: "M4 6h16M4 12h16M4 18h16"
|
|
57
64
|
})
|
|
58
65
|
], -1)
|
|
59
|
-
])])) :
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
])])) : c("", !0),
|
|
67
|
+
t.title && t.titlePosition === "left" ? (s(), o("div", ae, $(t.title), 1)) : c("", !0),
|
|
68
|
+
C(d.$slots, "left", {}, void 0, !0)
|
|
62
69
|
]),
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
a("div", ne, [
|
|
71
|
+
t.title && t.titlePosition === "center" ? (s(), o("div", re, $(t.title), 1)) : c("", !0),
|
|
72
|
+
C(d.$slots, "center", {}, void 0, !0)
|
|
65
73
|
]),
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
a("div", ie, [
|
|
75
|
+
t.title && t.titlePosition === "right" ? (s(), o("div", de, $(t.title), 1)) : c("", !0),
|
|
76
|
+
C(d.$slots, "right", {}, void 0, !0)
|
|
68
77
|
])
|
|
69
78
|
], 2));
|
|
70
79
|
}
|
|
71
|
-
}),
|
|
72
|
-
const
|
|
73
|
-
for (const [
|
|
74
|
-
|
|
75
|
-
return
|
|
76
|
-
},
|
|
80
|
+
}), K = (t, y) => {
|
|
81
|
+
const e = t.__vccOpts || t;
|
|
82
|
+
for (const [u, n] of y)
|
|
83
|
+
e[u] = n;
|
|
84
|
+
return e;
|
|
85
|
+
}, Ft = /* @__PURE__ */ K(ue, [["__scopeId", "data-v-883474b5"]]), ce = ["type", "disabled", "aria-label"], fe = {
|
|
77
86
|
key: 0,
|
|
78
87
|
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
|
-
},
|
|
88
|
+
}, Pt = /* @__PURE__ */ L({
|
|
80
89
|
__name: "Button",
|
|
81
90
|
props: {
|
|
82
91
|
variant: { default: "primary" },
|
|
@@ -88,20 +97,20 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
88
97
|
ariaLabel: { default: "" }
|
|
89
98
|
},
|
|
90
99
|
emits: ["click"],
|
|
91
|
-
setup(
|
|
92
|
-
const
|
|
93
|
-
const
|
|
100
|
+
setup(t, { emit: y }) {
|
|
101
|
+
const e = t, u = y, n = g(() => e.variant === "icon"), d = g(() => e.badge > 99 ? "99+" : e.badge.toString()), r = g(() => {
|
|
102
|
+
const i = "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", x = {
|
|
94
103
|
primary: "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",
|
|
95
104
|
secondary: "bg-secondary-200 text-secondary-900 hover:bg-secondary-300 focus-visible:ring-secondary-500",
|
|
96
105
|
outline: "border border-secondary-300 bg-transparent hover:bg-secondary-100 focus-visible:ring-secondary-500",
|
|
97
106
|
ghost: "hover:bg-secondary-100 focus-visible:ring-secondary-500",
|
|
98
107
|
danger: "bg-danger-600 text-white hover:bg-danger-700 focus-visible:ring-danger-600",
|
|
99
108
|
icon: "hover:bg-secondary-100 focus-visible:ring-secondary-500 relative"
|
|
100
|
-
},
|
|
101
|
-
sm:
|
|
102
|
-
md:
|
|
103
|
-
lg:
|
|
104
|
-
},
|
|
109
|
+
}, m = {
|
|
110
|
+
sm: n.value ? "p-1.5" : "h-8 px-3 text-sm",
|
|
111
|
+
md: n.value ? "p-2" : "h-10 px-4 text-base",
|
|
112
|
+
lg: n.value ? "p-3" : "h-12 px-6 text-lg"
|
|
113
|
+
}, j = {
|
|
105
114
|
full: "rounded-full",
|
|
106
115
|
xl: "rounded-2xl",
|
|
107
116
|
lg: "rounded-xl",
|
|
@@ -109,72 +118,72 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
109
118
|
sm: "rounded-md",
|
|
110
119
|
none: "rounded-none"
|
|
111
120
|
};
|
|
112
|
-
return `${
|
|
113
|
-
}),
|
|
114
|
-
|
|
121
|
+
return `${i} ${x[e.variant]} ${m[e.size]} ${j[e.radius]}`;
|
|
122
|
+
}), f = (i) => {
|
|
123
|
+
e.disabled || u("click", i);
|
|
115
124
|
};
|
|
116
|
-
return (
|
|
117
|
-
class:
|
|
118
|
-
type:
|
|
119
|
-
disabled:
|
|
120
|
-
onClick:
|
|
121
|
-
"aria-label":
|
|
125
|
+
return (i, x) => (s(), o("button", {
|
|
126
|
+
class: v(r.value),
|
|
127
|
+
type: t.type,
|
|
128
|
+
disabled: t.disabled,
|
|
129
|
+
onClick: f,
|
|
130
|
+
"aria-label": t.ariaLabel
|
|
122
131
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
], 10,
|
|
132
|
+
C(i.$slots, "default"),
|
|
133
|
+
n.value && t.badge && t.badge > 0 ? (s(), o("span", fe, $(d.value), 1)) : c("", !0)
|
|
134
|
+
], 10, ce));
|
|
126
135
|
}
|
|
127
|
-
}),
|
|
136
|
+
}), pe = {
|
|
128
137
|
key: 0,
|
|
129
138
|
class: "border-b border-gray-100 px-6 py-4"
|
|
130
|
-
},
|
|
139
|
+
}, ge = { class: "px-6 py-4" }, he = {
|
|
131
140
|
key: 1,
|
|
132
141
|
class: "border-t border-gray-100 px-6 py-4 bg-gray-50"
|
|
133
|
-
},
|
|
142
|
+
}, Wt = /* @__PURE__ */ L({
|
|
134
143
|
__name: "Card",
|
|
135
144
|
props: {
|
|
136
145
|
shadow: { default: "md" },
|
|
137
146
|
rounded: { default: "lg" },
|
|
138
147
|
bordered: { type: Boolean, default: !1 }
|
|
139
148
|
},
|
|
140
|
-
setup(
|
|
141
|
-
const
|
|
149
|
+
setup(t) {
|
|
150
|
+
const y = t, e = {
|
|
142
151
|
none: "",
|
|
143
152
|
sm: "shadow-sm",
|
|
144
153
|
md: "shadow",
|
|
145
154
|
lg: "shadow-lg",
|
|
146
155
|
xl: "shadow-xl"
|
|
147
|
-
},
|
|
156
|
+
}, u = {
|
|
148
157
|
none: "rounded-none",
|
|
149
158
|
sm: "rounded-sm",
|
|
150
159
|
md: "rounded-md",
|
|
151
160
|
lg: "rounded-lg",
|
|
152
161
|
xl: "rounded-xl",
|
|
153
162
|
full: "rounded-full"
|
|
154
|
-
},
|
|
163
|
+
}, n = g(() => [
|
|
155
164
|
"w-full bg-white",
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
165
|
+
e[y.shadow],
|
|
166
|
+
u[y.rounded],
|
|
167
|
+
y.bordered ? "border border-gray-200" : ""
|
|
159
168
|
]);
|
|
160
|
-
return (
|
|
161
|
-
class:
|
|
169
|
+
return (d, r) => (s(), o("div", {
|
|
170
|
+
class: v(n.value)
|
|
162
171
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
])) :
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
d.$slots.header ? (s(), o("div", pe, [
|
|
173
|
+
C(d.$slots, "header")
|
|
174
|
+
])) : c("", !0),
|
|
175
|
+
a("div", ge, [
|
|
176
|
+
C(d.$slots, "default")
|
|
168
177
|
]),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
])) :
|
|
178
|
+
d.$slots.footer ? (s(), o("div", he, [
|
|
179
|
+
C(d.$slots, "footer")
|
|
180
|
+
])) : c("", !0)
|
|
172
181
|
], 2));
|
|
173
182
|
}
|
|
174
|
-
}),
|
|
183
|
+
}), be = { class: "flex items-center justify-between border-b border-gray-100 px-8 py-6" }, ve = { class: "text-xl font-semibold text-gray-900" }, ye = { class: "px-8 py-6" }, xe = {
|
|
175
184
|
key: 0,
|
|
176
185
|
class: "border-t border-gray-100 px-8 py-6 bg-gray-50"
|
|
177
|
-
},
|
|
186
|
+
}, me = /* @__PURE__ */ L({
|
|
178
187
|
__name: "Dialog",
|
|
179
188
|
props: {
|
|
180
189
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -182,47 +191,47 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
182
191
|
closeOnBackdrop: { type: Boolean, default: !0 }
|
|
183
192
|
},
|
|
184
193
|
emits: ["update:modelValue"],
|
|
185
|
-
setup(
|
|
186
|
-
const
|
|
187
|
-
get: () =>
|
|
188
|
-
set: (
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
|
|
194
|
+
setup(t, { emit: y }) {
|
|
195
|
+
const e = t, u = y, n = g({
|
|
196
|
+
get: () => e.modelValue,
|
|
197
|
+
set: (f) => u("update:modelValue", f)
|
|
198
|
+
}), d = () => {
|
|
199
|
+
n.value = !1;
|
|
200
|
+
}, r = () => {
|
|
201
|
+
e.closeOnBackdrop && d();
|
|
193
202
|
};
|
|
194
|
-
return (
|
|
195
|
-
|
|
196
|
-
default:
|
|
197
|
-
|
|
203
|
+
return (f, i) => (s(), q(X, { to: "body" }, [
|
|
204
|
+
G(Q, { name: "dialog" }, {
|
|
205
|
+
default: U(() => [
|
|
206
|
+
n.value ? (s(), o("div", {
|
|
198
207
|
key: 0,
|
|
199
208
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50",
|
|
200
|
-
onClick:
|
|
209
|
+
onClick: r
|
|
201
210
|
}, [
|
|
202
|
-
|
|
211
|
+
a("div", {
|
|
203
212
|
class: "relative w-full max-w-2xl rounded-lg bg-white shadow-xl",
|
|
204
|
-
onClick:
|
|
213
|
+
onClick: i[0] || (i[0] = I(() => {
|
|
205
214
|
}, ["stop"]))
|
|
206
215
|
}, [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
216
|
+
a("div", be, [
|
|
217
|
+
a("h2", ve, [
|
|
218
|
+
C(f.$slots, "title", {}, () => [
|
|
219
|
+
A($(t.title), 1)
|
|
211
220
|
], !0)
|
|
212
221
|
]),
|
|
213
|
-
|
|
222
|
+
a("button", {
|
|
214
223
|
type: "button",
|
|
215
224
|
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
225
|
"aria-label": "Cerrar diálogo",
|
|
217
|
-
onClick:
|
|
218
|
-
}, [...
|
|
219
|
-
|
|
226
|
+
onClick: d
|
|
227
|
+
}, [...i[1] || (i[1] = [
|
|
228
|
+
a("svg", {
|
|
220
229
|
class: "h-6 w-6",
|
|
221
230
|
fill: "none",
|
|
222
231
|
stroke: "currentColor",
|
|
223
232
|
viewBox: "0 0 24 24"
|
|
224
233
|
}, [
|
|
225
|
-
|
|
234
|
+
a("path", {
|
|
226
235
|
"stroke-linecap": "round",
|
|
227
236
|
"stroke-linejoin": "round",
|
|
228
237
|
"stroke-width": "2",
|
|
@@ -231,32 +240,32 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
231
240
|
], -1)
|
|
232
241
|
])])
|
|
233
242
|
]),
|
|
234
|
-
|
|
235
|
-
|
|
243
|
+
a("div", ye, [
|
|
244
|
+
C(f.$slots, "default", {}, void 0, !0)
|
|
236
245
|
]),
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
])) :
|
|
246
|
+
f.$slots.footer ? (s(), o("div", xe, [
|
|
247
|
+
C(f.$slots, "footer", {}, void 0, !0)
|
|
248
|
+
])) : c("", !0)
|
|
240
249
|
])
|
|
241
|
-
])) :
|
|
250
|
+
])) : c("", !0)
|
|
242
251
|
]),
|
|
243
252
|
_: 3
|
|
244
253
|
})
|
|
245
254
|
]));
|
|
246
255
|
}
|
|
247
|
-
}),
|
|
256
|
+
}), At = /* @__PURE__ */ K(me, [["__scopeId", "data-v-091e8739"]]), ke = ["accept", "multiple", "disabled"], we = { class: "flex flex-col items-center justify-center gap-4 text-center" }, $e = { class: "w-32 h-32 flex items-center justify-center" }, Ce = ["src", "alt"], Be = {
|
|
248
257
|
key: 1,
|
|
249
258
|
class: "w-full h-full text-gray-400",
|
|
250
259
|
fill: "none",
|
|
251
260
|
stroke: "currentColor",
|
|
252
261
|
viewBox: "0 0 24 24"
|
|
253
|
-
},
|
|
262
|
+
}, _e = { class: "text-center" }, Te = { class: "text-base font-medium text-gray-700" }, Me = { class: "text-primary-700" }, ze = { class: "flex items-center gap-3 flex-1 min-w-0" }, Ve = { class: "flex-1 min-w-0" }, je = { class: "text-sm font-medium text-gray-900 truncate" }, Le = { class: "text-xs text-gray-500" }, Se = {
|
|
254
263
|
key: 1,
|
|
255
264
|
class: "text-xs text-gray-500 mt-2"
|
|
256
|
-
},
|
|
265
|
+
}, De = {
|
|
257
266
|
key: 2,
|
|
258
267
|
class: "text-sm text-danger-500 mt-2"
|
|
259
|
-
},
|
|
268
|
+
}, Kt = /* @__PURE__ */ L({
|
|
260
269
|
__name: "FileUpload",
|
|
261
270
|
props: {
|
|
262
271
|
modelValue: { default: null },
|
|
@@ -271,67 +280,67 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
271
280
|
maxSize: { default: void 0 }
|
|
272
281
|
},
|
|
273
282
|
emits: ["update:modelValue", "change", "error"],
|
|
274
|
-
setup(
|
|
275
|
-
const
|
|
276
|
-
var
|
|
277
|
-
(
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
return
|
|
283
|
+
setup(t, { emit: y }) {
|
|
284
|
+
const e = t, u = y, n = V(null), d = V(!1), r = V(e.modelValue), f = V(""), i = () => {
|
|
285
|
+
var B;
|
|
286
|
+
(B = n.value) == null || B.click();
|
|
287
|
+
}, x = () => {
|
|
288
|
+
e.disabled || i();
|
|
289
|
+
}, m = (B) => {
|
|
290
|
+
e.disabled || (d.value = !0);
|
|
291
|
+
}, j = () => {
|
|
292
|
+
d.value = !1;
|
|
293
|
+
}, D = (B) => {
|
|
294
|
+
if (f.value = "", e.maxSize && B.size > e.maxSize) {
|
|
295
|
+
const b = (e.maxSize / 1048576).toFixed(2);
|
|
296
|
+
return f.value = `El archivo excede el tamaño máximo de ${b}MB`, u("error", f.value), !1;
|
|
288
297
|
}
|
|
289
298
|
return !0;
|
|
290
|
-
},
|
|
291
|
-
var
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
},
|
|
295
|
-
var
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
return Math.round(
|
|
299
|
+
}, _ = (B) => {
|
|
300
|
+
var S;
|
|
301
|
+
const T = (S = B.target.files) == null ? void 0 : S[0];
|
|
302
|
+
T && D(T) && (r.value = T, u("update:modelValue", T), u("change", T));
|
|
303
|
+
}, O = (B) => {
|
|
304
|
+
var T;
|
|
305
|
+
d.value = !1;
|
|
306
|
+
const b = (T = B.dataTransfer) == null ? void 0 : T.files[0];
|
|
307
|
+
b && D(b) && (r.value = b, u("update:modelValue", b), u("change", b));
|
|
308
|
+
}, H = () => {
|
|
309
|
+
r.value = null, f.value = "", n.value && (n.value.value = ""), u("update:modelValue", null), u("change", null);
|
|
310
|
+
}, F = (B) => {
|
|
311
|
+
if (B === 0) return "0 Bytes";
|
|
312
|
+
const b = 1024, T = ["Bytes", "KB", "MB", "GB"], S = Math.floor(Math.log(B) / Math.log(b));
|
|
313
|
+
return Math.round(B / Math.pow(b, S) * 100) / 100 + " " + T[S];
|
|
305
314
|
};
|
|
306
|
-
return (
|
|
307
|
-
class:
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
return (B, b) => (s(), o("div", {
|
|
316
|
+
class: v(["relative border-2 border-dashed rounded-lg p-8 transition-colors", [
|
|
317
|
+
d.value ? "border-primary-700 bg-primary-50" : "border-gray-300 bg-white hover:border-primary-500",
|
|
318
|
+
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
310
319
|
]]),
|
|
311
|
-
onClick:
|
|
312
|
-
onDragover:
|
|
313
|
-
onDragleave:
|
|
314
|
-
onDrop:
|
|
320
|
+
onClick: x,
|
|
321
|
+
onDragover: I(m, ["prevent"]),
|
|
322
|
+
onDragleave: I(j, ["prevent"]),
|
|
323
|
+
onDrop: I(O, ["prevent"])
|
|
315
324
|
}, [
|
|
316
|
-
|
|
325
|
+
a("input", {
|
|
317
326
|
ref_key: "fileInput",
|
|
318
|
-
ref:
|
|
327
|
+
ref: n,
|
|
319
328
|
type: "file",
|
|
320
|
-
accept:
|
|
321
|
-
multiple:
|
|
322
|
-
disabled:
|
|
329
|
+
accept: t.accept,
|
|
330
|
+
multiple: t.multiple,
|
|
331
|
+
disabled: t.disabled,
|
|
323
332
|
class: "hidden",
|
|
324
|
-
onChange:
|
|
325
|
-
}, null, 40,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
333
|
+
onChange: _
|
|
334
|
+
}, null, 40, ke),
|
|
335
|
+
a("div", we, [
|
|
336
|
+
a("div", $e, [
|
|
337
|
+
t.illustration ? (s(), o("img", {
|
|
329
338
|
key: 0,
|
|
330
|
-
src:
|
|
331
|
-
alt:
|
|
339
|
+
src: t.illustration,
|
|
340
|
+
alt: t.illustrationAlt,
|
|
332
341
|
class: "max-w-full max-h-full object-contain"
|
|
333
|
-
}, null, 8,
|
|
334
|
-
|
|
342
|
+
}, null, 8, Ce)) : (s(), o("svg", Be, [...b[1] || (b[1] = [
|
|
343
|
+
a("path", {
|
|
335
344
|
"stroke-linecap": "round",
|
|
336
345
|
"stroke-linejoin": "round",
|
|
337
346
|
"stroke-width": "1.5",
|
|
@@ -339,64 +348,64 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
339
348
|
}, null, -1)
|
|
340
349
|
])]))
|
|
341
350
|
]),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
351
|
+
a("div", _e, [
|
|
352
|
+
a("p", Te, [
|
|
353
|
+
A($(t.mainText) + " ", 1),
|
|
354
|
+
a("span", Me, $(t.linkText), 1)
|
|
346
355
|
])
|
|
347
356
|
]),
|
|
348
|
-
|
|
357
|
+
r.value ? (s(), o("div", {
|
|
349
358
|
key: 0,
|
|
350
359
|
class: "w-full max-w-md bg-gray-50 rounded-lg p-4 flex items-center justify-between",
|
|
351
|
-
onClick:
|
|
360
|
+
onClick: b[0] || (b[0] = I(() => {
|
|
352
361
|
}, ["stop"]))
|
|
353
362
|
}, [
|
|
354
|
-
|
|
355
|
-
|
|
363
|
+
a("div", ze, [
|
|
364
|
+
b[2] || (b[2] = a("svg", {
|
|
356
365
|
class: "w-6 h-6 text-gray-600 flex-shrink-0",
|
|
357
366
|
fill: "none",
|
|
358
367
|
stroke: "currentColor",
|
|
359
368
|
viewBox: "0 0 24 24"
|
|
360
369
|
}, [
|
|
361
|
-
|
|
370
|
+
a("path", {
|
|
362
371
|
"stroke-linecap": "round",
|
|
363
372
|
"stroke-linejoin": "round",
|
|
364
373
|
"stroke-width": "2",
|
|
365
374
|
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
375
|
})
|
|
367
376
|
], -1)),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
377
|
+
a("div", Ve, [
|
|
378
|
+
a("p", je, $(r.value.name), 1),
|
|
379
|
+
a("p", Le, $(F(r.value.size)), 1)
|
|
371
380
|
])
|
|
372
381
|
]),
|
|
373
|
-
|
|
382
|
+
t.disabled ? c("", !0) : (s(), o("button", {
|
|
374
383
|
key: 0,
|
|
375
|
-
onClick:
|
|
384
|
+
onClick: I(H, ["stop"]),
|
|
376
385
|
class: "ml-3 text-gray-400 hover:text-danger-500 transition-colors"
|
|
377
|
-
}, [...
|
|
378
|
-
|
|
386
|
+
}, [...b[3] || (b[3] = [
|
|
387
|
+
a("svg", {
|
|
379
388
|
class: "w-5 h-5",
|
|
380
389
|
fill: "currentColor",
|
|
381
390
|
viewBox: "0 0 20 20"
|
|
382
391
|
}, [
|
|
383
|
-
|
|
392
|
+
a("path", {
|
|
384
393
|
"fill-rule": "evenodd",
|
|
385
394
|
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
395
|
"clip-rule": "evenodd"
|
|
387
396
|
})
|
|
388
397
|
], -1)
|
|
389
398
|
])]))
|
|
390
|
-
])) :
|
|
391
|
-
|
|
392
|
-
|
|
399
|
+
])) : c("", !0),
|
|
400
|
+
t.helperText ? (s(), o("p", Se, $(t.helperText), 1)) : c("", !0),
|
|
401
|
+
f.value ? (s(), o("p", De, $(f.value), 1)) : c("", !0)
|
|
393
402
|
])
|
|
394
403
|
], 34));
|
|
395
404
|
}
|
|
396
|
-
}),
|
|
405
|
+
}), Oe = ["stroke-width"], Ie = {
|
|
397
406
|
class: "w-full h-full rounded-lg overflow-hidden",
|
|
398
407
|
style: { "background-color": "#f7f7f7" }
|
|
399
|
-
},
|
|
408
|
+
}, Ee = /* @__PURE__ */ L({
|
|
400
409
|
__name: "Loader",
|
|
401
410
|
props: {
|
|
402
411
|
type: { default: "circular" },
|
|
@@ -406,128 +415,351 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
406
415
|
strokeWidth: { default: 4 },
|
|
407
416
|
progress: { default: void 0 }
|
|
408
417
|
},
|
|
409
|
-
setup(
|
|
410
|
-
const
|
|
418
|
+
setup(t) {
|
|
419
|
+
const y = t, e = {
|
|
411
420
|
primary: "text-primary-700",
|
|
412
421
|
secondary: "text-secondary-500",
|
|
413
422
|
success: "text-success-500",
|
|
414
423
|
warning: "text-warning-500",
|
|
415
424
|
danger: "text-danger-500",
|
|
416
425
|
info: "text-info-500"
|
|
417
|
-
},
|
|
426
|
+
}, u = {
|
|
418
427
|
primary: "bg-primary-700",
|
|
419
428
|
secondary: "bg-secondary-500",
|
|
420
429
|
success: "bg-success-500",
|
|
421
430
|
warning: "bg-warning-500",
|
|
422
431
|
danger: "bg-danger-500",
|
|
423
432
|
info: "bg-info-500"
|
|
424
|
-
},
|
|
425
|
-
return (
|
|
433
|
+
}, n = g(() => [e[y.color]]), d = g(() => [u[y.color]]);
|
|
434
|
+
return (r, f) => t.type === "circular" ? (s(), o("div", {
|
|
426
435
|
key: 0,
|
|
427
|
-
class:
|
|
436
|
+
class: v(n.value)
|
|
428
437
|
}, [
|
|
429
|
-
(s(),
|
|
438
|
+
(s(), o("svg", {
|
|
430
439
|
class: "animate-spin",
|
|
431
|
-
style:
|
|
440
|
+
style: P({ width: t.size, height: t.size }),
|
|
432
441
|
viewBox: "0 0 24 24"
|
|
433
442
|
}, [
|
|
434
|
-
|
|
443
|
+
a("circle", {
|
|
435
444
|
class: "opacity-25",
|
|
436
445
|
cx: "12",
|
|
437
446
|
cy: "12",
|
|
438
447
|
r: "10",
|
|
439
448
|
stroke: "currentColor",
|
|
440
|
-
"stroke-width":
|
|
449
|
+
"stroke-width": t.strokeWidth,
|
|
441
450
|
fill: "none"
|
|
442
|
-
}, null, 8,
|
|
443
|
-
|
|
451
|
+
}, null, 8, Oe),
|
|
452
|
+
f[0] || (f[0] = a("path", {
|
|
444
453
|
class: "opacity-75",
|
|
445
454
|
fill: "currentColor",
|
|
446
455
|
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
456
|
}, null, -1))
|
|
448
457
|
], 4))
|
|
449
|
-
], 2)) :
|
|
458
|
+
], 2)) : t.type === "linear" ? (s(), o("div", {
|
|
450
459
|
key: 1,
|
|
451
460
|
class: "w-full",
|
|
452
|
-
style:
|
|
461
|
+
style: P({ height: t.height })
|
|
453
462
|
}, [
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
class:
|
|
457
|
-
style:
|
|
463
|
+
a("div", Ie, [
|
|
464
|
+
a("div", {
|
|
465
|
+
class: v([d.value, "h-full rounded-lg animate-linear-loader"]),
|
|
466
|
+
style: P({ width: t.progress ? `${t.progress}%` : void 0 })
|
|
458
467
|
}, null, 6)
|
|
459
468
|
])
|
|
460
|
-
], 4)) :
|
|
469
|
+
], 4)) : c("", !0);
|
|
461
470
|
}
|
|
462
|
-
}),
|
|
471
|
+
}), Rt = /* @__PURE__ */ K(Ee, [["__scopeId", "data-v-8df4ec38"]]), He = ["disabled", "aria-expanded"], Fe = ["disabled", "onClick"], Pe = {
|
|
463
472
|
key: 0,
|
|
464
|
-
class: "
|
|
465
|
-
},
|
|
473
|
+
class: "flex-shrink-0"
|
|
474
|
+
}, We = ["innerHTML"], Ae = { class: "flex-1 min-w-0 mr-2" }, Ke = { class: "flex flex-col items-start" }, Re = ["title"], Ne = ["title"], qe = {
|
|
475
|
+
key: 1,
|
|
476
|
+
class: "flex-shrink-0"
|
|
477
|
+
}, Ue = {
|
|
466
478
|
key: 0,
|
|
467
|
-
class: "
|
|
468
|
-
},
|
|
479
|
+
class: "text-xs text-secondary-400 font-mono whitespace-nowrap"
|
|
480
|
+
}, Ge = { key: 1 }, Qe = {
|
|
481
|
+
key: 2,
|
|
482
|
+
class: "w-4 h-4 ml-2 flex-shrink-0",
|
|
483
|
+
fill: "none",
|
|
484
|
+
stroke: "currentColor",
|
|
485
|
+
viewBox: "0 0 24 24"
|
|
486
|
+
}, Je = /* @__PURE__ */ L({
|
|
487
|
+
__name: "Menu",
|
|
488
|
+
props: {
|
|
489
|
+
items: { default: () => [] },
|
|
490
|
+
triggerText: { default: "Menu" },
|
|
491
|
+
showChevron: { type: Boolean, default: !0 },
|
|
492
|
+
position: { default: "bottom-start" },
|
|
493
|
+
align: { default: "start" },
|
|
494
|
+
offset: { default: () => ({ x: 0, y: 4 }) },
|
|
495
|
+
width: { default: "auto" },
|
|
496
|
+
maxHeight: { default: "400px" },
|
|
497
|
+
closeOnClick: { type: Boolean, default: !0 },
|
|
498
|
+
disabled: { type: Boolean, default: !1 },
|
|
499
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
500
|
+
overlay: { type: Boolean, default: !1 },
|
|
501
|
+
teleport: { type: Boolean, default: !0 },
|
|
502
|
+
zIndex: { default: 50 }
|
|
503
|
+
},
|
|
504
|
+
emits: ["open", "close", "select"],
|
|
505
|
+
setup(t, { emit: y }) {
|
|
506
|
+
const e = t, u = y, n = V(!1), d = V(null), r = V(null), f = V({}), i = g(() => [
|
|
507
|
+
"inline-flex items-center justify-center px-4 py-2 text-sm font-medium",
|
|
508
|
+
"bg-white border border-secondary-300 rounded-md",
|
|
509
|
+
"hover:bg-secondary-50 focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
510
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
511
|
+
"transition-colors"
|
|
512
|
+
].join(" ")), x = g(() => [...[
|
|
513
|
+
"fixed bg-white rounded-lg shadow-lg border border-secondary-200",
|
|
514
|
+
"flex flex-col",
|
|
515
|
+
"focus:outline-none"
|
|
516
|
+
], `z-${e.zIndex}`].join(" ")), m = g(() => "px-4 py-3 border-b border-secondary-200 bg-secondary-50"), j = g(() => "px-4 py-3 border-t border-secondary-200 bg-secondary-50"), D = g(() => "py-1 overflow-y-auto flex-1 min-h-0"), _ = g(() => "my-1 border-t border-secondary-200"), O = g(() => "px-4 py-2 text-xs font-semibold text-secondary-500 uppercase tracking-wider"), H = (l) => {
|
|
517
|
+
const w = [
|
|
518
|
+
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
519
|
+
"transition-colors focus:outline-none",
|
|
520
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
521
|
+
], p = l.variant || "default", R = {
|
|
522
|
+
default: "text-secondary-700 hover:bg-secondary-50 focus:bg-secondary-50",
|
|
523
|
+
danger: "text-danger-600 hover:bg-danger-50 focus:bg-danger-50",
|
|
524
|
+
success: "text-success-600 hover:bg-success-50 focus:bg-success-50",
|
|
525
|
+
warning: "text-warning-600 hover:bg-warning-50 focus:bg-warning-50"
|
|
526
|
+
};
|
|
527
|
+
return [...w, R[p]].join(" ");
|
|
528
|
+
}, F = () => {
|
|
529
|
+
e.disabled || (n.value ? b() : B());
|
|
530
|
+
}, B = () => {
|
|
531
|
+
n.value = !0, u("open"), J(() => {
|
|
532
|
+
k(), document.addEventListener("click", S), document.addEventListener("keydown", N);
|
|
533
|
+
});
|
|
534
|
+
}, b = () => {
|
|
535
|
+
n.value = !1, u("close"), document.removeEventListener("click", S), document.removeEventListener("keydown", N);
|
|
536
|
+
}, T = (l) => {
|
|
537
|
+
l.disabled || (l.action && l.action(), u("select", l), e.closeOnClick && !l.children && b());
|
|
538
|
+
}, S = (l) => {
|
|
539
|
+
const w = l.target;
|
|
540
|
+
d.value && !d.value.contains(w) && r.value && !r.value.contains(w) && b();
|
|
541
|
+
}, N = (l) => {
|
|
542
|
+
l.key === "Escape" && b();
|
|
543
|
+
}, h = (l) => {
|
|
544
|
+
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), F());
|
|
545
|
+
}, k = () => {
|
|
546
|
+
if (!d.value || !r.value) return;
|
|
547
|
+
const l = d.value.getBoundingClientRect(), w = r.value.getBoundingClientRect(), p = window.innerWidth, R = window.innerHeight;
|
|
548
|
+
let M = 0, z = 0;
|
|
549
|
+
switch (e.position) {
|
|
550
|
+
case "bottom-start":
|
|
551
|
+
M = l.bottom + e.offset.y, z = l.left + e.offset.x;
|
|
552
|
+
break;
|
|
553
|
+
case "bottom-end":
|
|
554
|
+
M = l.bottom + e.offset.y, z = l.right - w.width + e.offset.x;
|
|
555
|
+
break;
|
|
556
|
+
case "top-start":
|
|
557
|
+
M = l.top - w.height - e.offset.y, z = l.left + e.offset.x;
|
|
558
|
+
break;
|
|
559
|
+
case "top-end":
|
|
560
|
+
M = l.top - w.height - e.offset.y, z = l.right - w.width + e.offset.x;
|
|
561
|
+
break;
|
|
562
|
+
case "right-start":
|
|
563
|
+
M = l.top + e.offset.y, z = l.right + e.offset.x;
|
|
564
|
+
break;
|
|
565
|
+
case "right-end":
|
|
566
|
+
M = l.bottom - w.height + e.offset.y, z = l.right + e.offset.x;
|
|
567
|
+
break;
|
|
568
|
+
case "left-start":
|
|
569
|
+
M = l.top + e.offset.y, z = l.left - w.width - e.offset.x;
|
|
570
|
+
break;
|
|
571
|
+
case "left-end":
|
|
572
|
+
M = l.bottom - w.height + e.offset.y, z = l.left - w.width - e.offset.x;
|
|
573
|
+
break;
|
|
574
|
+
}
|
|
575
|
+
z + w.width > p && (z = p - w.width - 8), z < 8 && (z = 8), M + w.height > R && (M = R - w.height - 8), M < 8 && (M = 8), f.value = {
|
|
576
|
+
top: `${M}px`,
|
|
577
|
+
left: `${z}px`,
|
|
578
|
+
width: e.width === "auto" ? `${Math.max(l.width, 240)}px` : e.width,
|
|
579
|
+
maxHeight: e.maxHeight,
|
|
580
|
+
minWidth: "240px"
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
return ee(() => {
|
|
584
|
+
window.addEventListener("scroll", k, !0), window.addEventListener("resize", k);
|
|
585
|
+
}), te(() => {
|
|
586
|
+
window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k), document.removeEventListener("click", S), document.removeEventListener("keydown", N);
|
|
587
|
+
}), Y(() => e.items, () => {
|
|
588
|
+
n.value && J(k);
|
|
589
|
+
}, { deep: !0 }), (l, w) => (s(), o("div", {
|
|
590
|
+
class: v(["menu-wrapper", { "w-full": t.fullWidth }])
|
|
591
|
+
}, [
|
|
592
|
+
a("div", {
|
|
593
|
+
ref_key: "triggerRef",
|
|
594
|
+
ref: d
|
|
595
|
+
}, [
|
|
596
|
+
C(l.$slots, "trigger", {
|
|
597
|
+
isOpen: n.value,
|
|
598
|
+
toggle: F
|
|
599
|
+
}, () => [
|
|
600
|
+
a("button", {
|
|
601
|
+
type: "button",
|
|
602
|
+
class: v(i.value),
|
|
603
|
+
disabled: t.disabled,
|
|
604
|
+
onClick: F,
|
|
605
|
+
onKeydown: h,
|
|
606
|
+
tabindex: 0,
|
|
607
|
+
role: "button",
|
|
608
|
+
"aria-expanded": n.value,
|
|
609
|
+
"aria-haspopup": !0
|
|
610
|
+
}, [
|
|
611
|
+
C(l.$slots, "trigger-content", {}, () => [
|
|
612
|
+
A($(t.triggerText), 1)
|
|
613
|
+
], !0),
|
|
614
|
+
t.showChevron ? (s(), o("svg", {
|
|
615
|
+
key: 0,
|
|
616
|
+
class: v(["w-4 h-4 ml-2 transition-transform", n.value ? "rotate-180" : ""]),
|
|
617
|
+
fill: "none",
|
|
618
|
+
stroke: "currentColor",
|
|
619
|
+
viewBox: "0 0 24 24"
|
|
620
|
+
}, [...w[1] || (w[1] = [
|
|
621
|
+
a("path", {
|
|
622
|
+
"stroke-linecap": "round",
|
|
623
|
+
"stroke-linejoin": "round",
|
|
624
|
+
"stroke-width": "2",
|
|
625
|
+
d: "M19 9l-7 7-7-7"
|
|
626
|
+
}, null, -1)
|
|
627
|
+
])], 2)) : c("", !0)
|
|
628
|
+
], 42, He)
|
|
629
|
+
], !0)
|
|
630
|
+
], 512),
|
|
631
|
+
(s(), q(X, { to: "body" }, [
|
|
632
|
+
n.value ? (s(), o("div", {
|
|
633
|
+
key: 0,
|
|
634
|
+
ref_key: "menuRef",
|
|
635
|
+
ref: r,
|
|
636
|
+
class: v(x.value),
|
|
637
|
+
style: P(f.value),
|
|
638
|
+
onClick: w[0] || (w[0] = I(() => {
|
|
639
|
+
}, ["stop"]))
|
|
640
|
+
}, [
|
|
641
|
+
l.$slots.header ? (s(), o("div", {
|
|
642
|
+
key: 0,
|
|
643
|
+
class: v(m.value)
|
|
644
|
+
}, [
|
|
645
|
+
C(l.$slots, "header", { close: b }, void 0, !0)
|
|
646
|
+
], 2)) : c("", !0),
|
|
647
|
+
a("div", {
|
|
648
|
+
class: v(D.value)
|
|
649
|
+
}, [
|
|
650
|
+
C(l.$slots, "default", {
|
|
651
|
+
close: b,
|
|
652
|
+
isOpen: n.value
|
|
653
|
+
}, () => [
|
|
654
|
+
(s(!0), o(E, null, W(t.items, (p, R) => (s(), o(E, {
|
|
655
|
+
key: p.id || R
|
|
656
|
+
}, [
|
|
657
|
+
p.type === "divider" ? (s(), o("div", {
|
|
658
|
+
key: 0,
|
|
659
|
+
class: v(_.value)
|
|
660
|
+
}, null, 2)) : p.type === "header" ? (s(), o("div", {
|
|
661
|
+
key: 1,
|
|
662
|
+
class: v(O.value)
|
|
663
|
+
}, $(p.label), 3)) : (s(), o("button", {
|
|
664
|
+
key: 2,
|
|
665
|
+
type: "button",
|
|
666
|
+
class: v(H(p)),
|
|
667
|
+
disabled: p.disabled,
|
|
668
|
+
onClick: (M) => T(p)
|
|
669
|
+
}, [
|
|
670
|
+
p.icon || l.$slots[`icon-${p.id}`] ? (s(), o("span", Pe, [
|
|
671
|
+
C(l.$slots, `icon-${p.id}`, { item: p }, () => [
|
|
672
|
+
typeof p.icon != "string" ? (s(), q(Z(p.icon), {
|
|
673
|
+
key: 0,
|
|
674
|
+
class: "w-5 h-5"
|
|
675
|
+
})) : (s(), o("span", {
|
|
676
|
+
key: 1,
|
|
677
|
+
innerHTML: p.icon,
|
|
678
|
+
class: "w-5 h-5 inline-block"
|
|
679
|
+
}, null, 8, We))
|
|
680
|
+
], !0)
|
|
681
|
+
])) : c("", !0),
|
|
682
|
+
a("div", Ae, [
|
|
683
|
+
C(l.$slots, `item-${p.id}`, {
|
|
684
|
+
item: p,
|
|
685
|
+
close: b
|
|
686
|
+
}, () => [
|
|
687
|
+
a("div", Ke, [
|
|
688
|
+
a("span", {
|
|
689
|
+
class: "truncate w-full",
|
|
690
|
+
title: p.label
|
|
691
|
+
}, $(p.label), 9, Re),
|
|
692
|
+
p.description ? (s(), o("span", {
|
|
693
|
+
key: 0,
|
|
694
|
+
class: "text-xs text-secondary-500 truncate w-full",
|
|
695
|
+
title: p.description
|
|
696
|
+
}, $(p.description), 9, Ne)) : c("", !0)
|
|
697
|
+
])
|
|
698
|
+
], !0)
|
|
699
|
+
]),
|
|
700
|
+
p.suffix || p.shortcut || l.$slots[`suffix-${p.id}`] ? (s(), o("span", qe, [
|
|
701
|
+
C(l.$slots, `suffix-${p.id}`, { item: p }, () => [
|
|
702
|
+
p.shortcut ? (s(), o("span", Ue, $(p.shortcut), 1)) : p.suffix ? (s(), o("span", Ge, $(p.suffix), 1)) : c("", !0)
|
|
703
|
+
], !0)
|
|
704
|
+
])) : c("", !0),
|
|
705
|
+
p.children && p.children.length > 0 ? (s(), o("svg", Qe, [...w[2] || (w[2] = [
|
|
706
|
+
a("path", {
|
|
707
|
+
"stroke-linecap": "round",
|
|
708
|
+
"stroke-linejoin": "round",
|
|
709
|
+
"stroke-width": "2",
|
|
710
|
+
d: "M9 5l7 7-7 7"
|
|
711
|
+
}, null, -1)
|
|
712
|
+
])])) : c("", !0)
|
|
713
|
+
], 10, Fe))
|
|
714
|
+
], 64))), 128))
|
|
715
|
+
], !0)
|
|
716
|
+
], 2),
|
|
717
|
+
l.$slots.footer ? (s(), o("div", {
|
|
718
|
+
key: 1,
|
|
719
|
+
class: v(j.value)
|
|
720
|
+
}, [
|
|
721
|
+
C(l.$slots, "footer", { close: b }, void 0, !0)
|
|
722
|
+
], 2)) : c("", !0)
|
|
723
|
+
], 6)) : c("", !0),
|
|
724
|
+
n.value && t.overlay ? (s(), o("div", {
|
|
725
|
+
key: 1,
|
|
726
|
+
class: "fixed inset-0 bg-black/20 z-40",
|
|
727
|
+
onClick: b
|
|
728
|
+
})) : c("", !0)
|
|
729
|
+
]))
|
|
730
|
+
], 2));
|
|
731
|
+
}
|
|
732
|
+
}), Nt = /* @__PURE__ */ K(Je, [["__scopeId", "data-v-e155a86b"]]), Xe = ["for"], Ye = {
|
|
469
733
|
key: 0,
|
|
470
|
-
class: "
|
|
471
|
-
},
|
|
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 = {
|
|
734
|
+
class: "text-danger-600"
|
|
735
|
+
}, Ze = { class: "relative" }, et = ["id", "disabled", "aria-expanded"], tt = { class: "flex-1 text-left truncate" }, st = {
|
|
478
736
|
key: 0,
|
|
479
737
|
class: "p-2 border-b border-secondary-200"
|
|
480
|
-
},
|
|
738
|
+
}, ot = ["placeholder"], lt = { class: "max-h-64 overflow-y-auto" }, at = {
|
|
481
739
|
key: 0,
|
|
482
740
|
class: "px-4 py-3 text-sm text-secondary-500 text-center"
|
|
483
|
-
},
|
|
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
|
-
}, ot = {
|
|
506
|
-
key: 1,
|
|
507
|
-
class: "flex items-center justify-between w-full"
|
|
508
|
-
}, at = { class: "truncate" }, nt = {
|
|
741
|
+
}, nt = ["onClick"], rt = { class: "flex items-center justify-between w-full" }, it = { class: "truncate" }, dt = {
|
|
509
742
|
key: 0,
|
|
510
743
|
class: "w-5 h-5 text-primary-600 flex-shrink-0 ml-2",
|
|
511
744
|
fill: "none",
|
|
512
745
|
stroke: "currentColor",
|
|
513
746
|
viewBox: "0 0 24 24",
|
|
514
747
|
xmlns: "http://www.w3.org/2000/svg"
|
|
515
|
-
},
|
|
748
|
+
}, ut = {
|
|
516
749
|
key: 0,
|
|
517
750
|
class: "border-t border-secondary-200 my-1"
|
|
518
|
-
},
|
|
751
|
+
}, ct = ["onClick"], ft = ["innerHTML"], pt = {
|
|
519
752
|
key: 1,
|
|
520
753
|
class: "mt-1 text-sm text-danger-600"
|
|
521
|
-
},
|
|
754
|
+
}, gt = {
|
|
522
755
|
key: 2,
|
|
523
756
|
class: "mt-1 text-sm text-secondary-600"
|
|
524
|
-
},
|
|
757
|
+
}, ht = /* @__PURE__ */ L({
|
|
525
758
|
__name: "Select",
|
|
526
759
|
props: {
|
|
527
760
|
modelValue: { default: null },
|
|
528
761
|
options: { default: () => [] },
|
|
529
762
|
actionItems: { default: () => [] },
|
|
530
|
-
mode: { default: "normal" },
|
|
531
763
|
label: { default: "" },
|
|
532
764
|
placeholder: { default: "Seleccionar..." },
|
|
533
765
|
size: { default: "md" },
|
|
@@ -543,208 +775,167 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
543
775
|
menuPosition: { default: "bottom" }
|
|
544
776
|
},
|
|
545
777
|
emits: ["update:modelValue", "change", "action"],
|
|
546
|
-
setup(
|
|
547
|
-
const
|
|
778
|
+
setup(t, { emit: y }) {
|
|
779
|
+
const e = t, u = y, n = V(!1), d = V(""), r = V(null), f = g(
|
|
548
780
|
() => `select-${Math.random().toString(36).substr(2, 9)}`
|
|
549
|
-
),
|
|
550
|
-
if (!
|
|
551
|
-
return
|
|
552
|
-
const
|
|
553
|
-
return
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
});
|
|
557
|
-
}), v = g(() => "block text-sm font-semibold text-secondary-700 mb-1"), V = g(() => {
|
|
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", y = {
|
|
781
|
+
), i = g(() => e.options.find((h) => h.value === e.modelValue) || null), x = g(() => {
|
|
782
|
+
if (!e.searchable || !d.value)
|
|
783
|
+
return e.options;
|
|
784
|
+
const h = d.value.toLowerCase();
|
|
785
|
+
return e.options.filter((k) => k.label.toLowerCase().includes(h));
|
|
786
|
+
}), m = g(() => "block text-sm font-semibold text-secondary-700 mb-1"), j = g(() => {
|
|
787
|
+
const h = "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", k = {
|
|
559
788
|
sm: "px-3 py-1.5 text-sm",
|
|
560
789
|
md: "px-4 py-2 text-base",
|
|
561
790
|
lg: "px-5 py-3 text-lg"
|
|
562
|
-
},
|
|
791
|
+
}, l = {
|
|
563
792
|
default: "bg-white border-secondary-300 hover:border-secondary-400",
|
|
564
793
|
outline: "bg-transparent border-secondary-300 hover:border-primary-500",
|
|
565
794
|
filled: "bg-secondary-100 border-transparent hover:bg-secondary-200"
|
|
566
|
-
},
|
|
795
|
+
}, w = e.error ? "border-danger-600 focus:ring-danger-500" : "";
|
|
567
796
|
return [
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
797
|
+
h,
|
|
798
|
+
k[e.size],
|
|
799
|
+
l[e.variant],
|
|
800
|
+
w
|
|
572
801
|
].join(" ");
|
|
573
|
-
}),
|
|
574
|
-
const
|
|
575
|
-
return [
|
|
576
|
-
},
|
|
577
|
-
const
|
|
578
|
-
return
|
|
579
|
-
},
|
|
580
|
-
|
|
581
|
-
var
|
|
582
|
-
(
|
|
802
|
+
}), D = g(() => `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`), _ = (h) => {
|
|
803
|
+
const k = "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", l = H(h) ? "bg-primary-50" : "";
|
|
804
|
+
return [k, l].join(" ");
|
|
805
|
+
}, O = (h) => {
|
|
806
|
+
const k = "w-full px-4 py-2 text-left text-sm font-semibold transition-colors focus:outline-none flex items-center gap-3";
|
|
807
|
+
return h.variant === "danger" ? `${k} text-danger-600 hover:bg-danger-50 focus:bg-danger-50` : `${k} text-secondary-700 hover:bg-secondary-50 focus:bg-secondary-50`;
|
|
808
|
+
}, H = (h) => h.value === e.modelValue, F = () => {
|
|
809
|
+
e.disabled || (n.value = !n.value, n.value && e.searchable && J(() => {
|
|
810
|
+
var h;
|
|
811
|
+
(h = r.value) == null || h.focus();
|
|
583
812
|
}));
|
|
584
813
|
}, B = () => {
|
|
585
|
-
|
|
586
|
-
},
|
|
587
|
-
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
},
|
|
591
|
-
const
|
|
592
|
-
|
|
814
|
+
n.value = !1, d.value = "";
|
|
815
|
+
}, b = (h) => {
|
|
816
|
+
h.disabled || (u("update:modelValue", h.value), u("change", h), B());
|
|
817
|
+
}, T = (h) => {
|
|
818
|
+
h.action && h.action(), u("action", h), B();
|
|
819
|
+
}, S = (h) => {
|
|
820
|
+
const k = h.relatedTarget;
|
|
821
|
+
k && k.closest(".select-wrapper") || setTimeout(() => {
|
|
593
822
|
B();
|
|
594
823
|
}, 200);
|
|
595
|
-
},
|
|
596
|
-
|
|
824
|
+
}, N = (h) => {
|
|
825
|
+
h.key === "Escape" ? B() : (h.key === "Enter" || h.key === " ") && (h.preventDefault(), F());
|
|
597
826
|
};
|
|
598
|
-
return
|
|
599
|
-
|
|
600
|
-
}), (
|
|
601
|
-
class:
|
|
827
|
+
return Y(n, (h) => {
|
|
828
|
+
h && (d.value = "");
|
|
829
|
+
}), (h, k) => (s(), o("div", {
|
|
830
|
+
class: v(["select-wrapper", { "w-full": t.fullWidth }])
|
|
602
831
|
}, [
|
|
603
|
-
|
|
832
|
+
t.label ? (s(), o("label", {
|
|
604
833
|
key: 0,
|
|
605
|
-
for:
|
|
606
|
-
class:
|
|
834
|
+
for: f.value,
|
|
835
|
+
class: v(m.value)
|
|
607
836
|
}, [
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
], 10,
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
id:
|
|
837
|
+
A($(t.label) + " ", 1),
|
|
838
|
+
t.required ? (s(), o("span", Ye, "*")) : c("", !0)
|
|
839
|
+
], 10, Xe)) : c("", !0),
|
|
840
|
+
a("div", Ze, [
|
|
841
|
+
a("button", {
|
|
842
|
+
id: f.value,
|
|
614
843
|
type: "button",
|
|
615
|
-
class:
|
|
616
|
-
disabled:
|
|
617
|
-
"aria-expanded":
|
|
844
|
+
class: v(j.value),
|
|
845
|
+
disabled: t.disabled,
|
|
846
|
+
"aria-expanded": n.value,
|
|
618
847
|
"aria-haspopup": !0,
|
|
619
|
-
onClick:
|
|
620
|
-
onBlur:
|
|
621
|
-
onKeydown:
|
|
848
|
+
onClick: F,
|
|
849
|
+
onBlur: S,
|
|
850
|
+
onKeydown: N
|
|
622
851
|
}, [
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
src: a.value.avatar,
|
|
627
|
-
alt: a.value.label,
|
|
628
|
-
class: "w-full h-full object-cover"
|
|
629
|
-
}, null, 8, qe)
|
|
630
|
-
])) : a.value.initials ? (s(), l("div", Ee, x(a.value.initials), 1)) : f("", !0),
|
|
631
|
-
o("div", He, [
|
|
632
|
-
o("span", {
|
|
633
|
-
class: k(["text-sm font-semibold truncate w-full", z.value])
|
|
634
|
-
}, x(a.value.label), 3),
|
|
635
|
-
a.value.subtitle ? (s(), l("span", {
|
|
636
|
-
key: 0,
|
|
637
|
-
class: k(["text-xs truncate w-full", $.value])
|
|
638
|
-
}, x(a.value.subtitle), 3)) : f("", !0)
|
|
639
|
-
])
|
|
640
|
-
])) : (s(), l("span", Ke, x(a.value ? a.value.label : e.placeholder), 1)),
|
|
641
|
-
(s(), l("svg", {
|
|
642
|
-
class: k(["w-5 h-5 flex-shrink-0 transition-transform", [r.value ? "rotate-180" : "", M.value]]),
|
|
852
|
+
a("span", tt, $(i.value ? i.value.label : t.placeholder), 1),
|
|
853
|
+
(s(), o("svg", {
|
|
854
|
+
class: v(["w-5 h-5 flex-shrink-0 transition-transform text-secondary-600", n.value ? "rotate-180" : ""]),
|
|
643
855
|
fill: "none",
|
|
644
856
|
stroke: "currentColor",
|
|
645
857
|
viewBox: "0 0 24 24",
|
|
646
858
|
xmlns: "http://www.w3.org/2000/svg"
|
|
647
|
-
}, [...
|
|
648
|
-
|
|
859
|
+
}, [...k[3] || (k[3] = [
|
|
860
|
+
a("path", {
|
|
649
861
|
"stroke-linecap": "round",
|
|
650
862
|
"stroke-linejoin": "round",
|
|
651
863
|
"stroke-width": "2",
|
|
652
864
|
d: "M19 9l-7 7-7-7"
|
|
653
865
|
}, null, -1)
|
|
654
866
|
])], 2))
|
|
655
|
-
], 42,
|
|
656
|
-
|
|
867
|
+
], 42, et),
|
|
868
|
+
n.value ? (s(), o("div", {
|
|
657
869
|
key: 0,
|
|
658
|
-
class:
|
|
659
|
-
onClick:
|
|
870
|
+
class: v(D.value),
|
|
871
|
+
onClick: k[2] || (k[2] = I(() => {
|
|
660
872
|
}, ["stop"]))
|
|
661
873
|
}, [
|
|
662
|
-
|
|
663
|
-
|
|
874
|
+
t.searchable ? (s(), o("div", st, [
|
|
875
|
+
se(a("input", {
|
|
664
876
|
ref_key: "searchInput",
|
|
665
|
-
ref:
|
|
666
|
-
"onUpdate:modelValue":
|
|
877
|
+
ref: r,
|
|
878
|
+
"onUpdate:modelValue": k[0] || (k[0] = (l) => d.value = l),
|
|
667
879
|
type: "text",
|
|
668
880
|
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:
|
|
670
|
-
onKeydown:
|
|
881
|
+
placeholder: t.searchPlaceholder,
|
|
882
|
+
onKeydown: k[1] || (k[1] = I(() => {
|
|
671
883
|
}, ["stop"]))
|
|
672
|
-
}, null, 40,
|
|
673
|
-
[
|
|
884
|
+
}, null, 40, ot), [
|
|
885
|
+
[oe, d.value]
|
|
674
886
|
])
|
|
675
|
-
])) :
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
(s(!0),
|
|
679
|
-
key:
|
|
887
|
+
])) : c("", !0),
|
|
888
|
+
a("div", lt, [
|
|
889
|
+
x.value.length === 0 ? (s(), o("div", at, $(t.emptyText), 1)) : (s(), o(E, { key: 1 }, [
|
|
890
|
+
(s(!0), o(E, null, W(x.value, (l) => (s(), o("button", {
|
|
891
|
+
key: l.value,
|
|
680
892
|
type: "button",
|
|
681
|
-
class:
|
|
682
|
-
onClick: (
|
|
893
|
+
class: v(_(l)),
|
|
894
|
+
onClick: (w) => b(l)
|
|
683
895
|
}, [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
alt: p.label,
|
|
689
|
-
class: "w-full h-full object-cover"
|
|
690
|
-
}, null, 8, Xe)
|
|
691
|
-
])) : p.initials ? (s(), l("div", Ye, x(p.initials), 1)) : f("", !0),
|
|
692
|
-
o("div", Ze, [
|
|
693
|
-
o("span", et, x(p.label), 1),
|
|
694
|
-
p.subtitle ? (s(), l("span", tt, x(p.subtitle), 1)) : f("", !0),
|
|
695
|
-
p.description ? (s(), l("span", st, x(p.description), 1)) : f("", !0)
|
|
696
|
-
]),
|
|
697
|
-
m(p) ? (s(), l("svg", lt, [...y[4] || (y[4] = [
|
|
698
|
-
o("path", {
|
|
699
|
-
"stroke-linecap": "round",
|
|
700
|
-
"stroke-linejoin": "round",
|
|
701
|
-
"stroke-width": "2",
|
|
702
|
-
d: "M5 13l4 4L19 7"
|
|
703
|
-
}, null, -1)
|
|
704
|
-
])])) : f("", !0)
|
|
705
|
-
])) : (s(), l("div", ot, [
|
|
706
|
-
o("span", at, x(p.label), 1),
|
|
707
|
-
m(p) ? (s(), l("svg", nt, [...y[5] || (y[5] = [
|
|
708
|
-
o("path", {
|
|
896
|
+
a("div", rt, [
|
|
897
|
+
a("span", it, $(l.label), 1),
|
|
898
|
+
H(l) ? (s(), o("svg", dt, [...k[4] || (k[4] = [
|
|
899
|
+
a("path", {
|
|
709
900
|
"stroke-linecap": "round",
|
|
710
901
|
"stroke-linejoin": "round",
|
|
711
902
|
"stroke-width": "2",
|
|
712
903
|
d: "M5 13l4 4L19 7"
|
|
713
904
|
}, null, -1)
|
|
714
|
-
])])) :
|
|
715
|
-
])
|
|
716
|
-
], 10,
|
|
717
|
-
|
|
718
|
-
(s(!0),
|
|
719
|
-
key:
|
|
905
|
+
])])) : c("", !0)
|
|
906
|
+
])
|
|
907
|
+
], 10, nt))), 128)),
|
|
908
|
+
t.actionItems.length > 0 ? (s(), o("div", ut)) : c("", !0),
|
|
909
|
+
(s(!0), o(E, null, W(t.actionItems, (l) => (s(), o("button", {
|
|
910
|
+
key: l.id,
|
|
720
911
|
type: "button",
|
|
721
|
-
class:
|
|
722
|
-
onClick: (
|
|
912
|
+
class: v(O(l)),
|
|
913
|
+
onClick: (w) => T(l)
|
|
723
914
|
}, [
|
|
724
|
-
|
|
915
|
+
l.icon ? (s(), o("svg", {
|
|
725
916
|
key: 0,
|
|
726
917
|
class: "w-4 h-4 flex-shrink-0",
|
|
727
918
|
fill: "none",
|
|
728
919
|
stroke: "currentColor",
|
|
729
920
|
viewBox: "0 0 24 24",
|
|
730
921
|
xmlns: "http://www.w3.org/2000/svg",
|
|
731
|
-
innerHTML:
|
|
732
|
-
}, null, 8,
|
|
733
|
-
|
|
734
|
-
], 10,
|
|
922
|
+
innerHTML: l.icon
|
|
923
|
+
}, null, 8, ft)) : c("", !0),
|
|
924
|
+
A(" " + $(l.label), 1)
|
|
925
|
+
], 10, ct))), 128))
|
|
735
926
|
], 64))
|
|
736
927
|
])
|
|
737
|
-
], 2)) :
|
|
928
|
+
], 2)) : c("", !0)
|
|
738
929
|
]),
|
|
739
|
-
|
|
740
|
-
|
|
930
|
+
t.error ? (s(), o("p", pt, $(t.error), 1)) : t.helperText ? (s(), o("p", gt, $(t.helperText), 1)) : c("", !0),
|
|
931
|
+
n.value ? (s(), o("div", {
|
|
741
932
|
key: 3,
|
|
742
933
|
onClick: B,
|
|
743
934
|
class: "fixed inset-0 z-40"
|
|
744
|
-
})) :
|
|
935
|
+
})) : c("", !0)
|
|
745
936
|
], 2));
|
|
746
937
|
}
|
|
747
|
-
}),
|
|
938
|
+
}), qt = /* @__PURE__ */ K(ht, [["__scopeId", "data-v-f016a03c"]]), bt = /* @__PURE__ */ L({
|
|
748
939
|
__name: "Sidebar",
|
|
749
940
|
props: {
|
|
750
941
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -759,205 +950,205 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
759
950
|
padding: { default: "md" }
|
|
760
951
|
},
|
|
761
952
|
emits: ["update:modelValue", "close", "open"],
|
|
762
|
-
setup(
|
|
763
|
-
const
|
|
764
|
-
get: () =>
|
|
765
|
-
set: (
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
},
|
|
769
|
-
const
|
|
770
|
-
return [
|
|
771
|
-
}),
|
|
772
|
-
width:
|
|
773
|
-
backgroundColor:
|
|
774
|
-
top:
|
|
775
|
-
height:
|
|
776
|
-
})),
|
|
953
|
+
setup(t, { emit: y }) {
|
|
954
|
+
const e = t, u = y, n = g({
|
|
955
|
+
get: () => e.modelValue,
|
|
956
|
+
set: (_) => u("update:modelValue", _)
|
|
957
|
+
}), d = () => {
|
|
958
|
+
e.persistent || (n.value = !1, u("close"));
|
|
959
|
+
}, r = g(() => e.position === "left" ? "slide-right" : "slide-left"), f = g(() => {
|
|
960
|
+
const _ = "fixed top-0 h-full z-50 flex flex-col", O = e.position === "left" ? "left-0" : "right-0", H = 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)]" : "";
|
|
961
|
+
return [_, O, H].filter(Boolean).join(" ");
|
|
962
|
+
}), i = g(() => ({
|
|
963
|
+
width: e.width,
|
|
964
|
+
backgroundColor: e.backgroundColor,
|
|
965
|
+
top: e.overlayTop,
|
|
966
|
+
height: e.overlayTop !== "0" ? `calc(100vh - ${e.overlayTop})` : "100vh"
|
|
967
|
+
})), x = {
|
|
777
968
|
none: "",
|
|
778
969
|
sm: "p-2",
|
|
779
970
|
md: "p-4",
|
|
780
971
|
lg: "p-6"
|
|
781
|
-
},
|
|
782
|
-
return (
|
|
783
|
-
|
|
784
|
-
default:
|
|
785
|
-
|
|
972
|
+
}, m = g(() => `flex items-center justify-between border-b border-gray-200 ${x[e.padding]}`), j = g(() => `flex-1 overflow-y-auto ${x[e.padding]}`), D = g(() => `border-t border-gray-200 ${x[e.padding]}`);
|
|
973
|
+
return (_, O) => (s(), q(X, { to: "body" }, [
|
|
974
|
+
G(Q, { name: "fade" }, {
|
|
975
|
+
default: U(() => [
|
|
976
|
+
n.value && t.overlay ? (s(), o("div", {
|
|
786
977
|
key: 0,
|
|
787
|
-
onClick:
|
|
978
|
+
onClick: d,
|
|
788
979
|
class: "fixed inset-0 bg-black/50 z-40",
|
|
789
|
-
style:
|
|
790
|
-
}, null, 4)) :
|
|
980
|
+
style: P({ top: t.overlayTop })
|
|
981
|
+
}, null, 4)) : c("", !0)
|
|
791
982
|
]),
|
|
792
983
|
_: 1
|
|
793
984
|
}),
|
|
794
|
-
|
|
795
|
-
default:
|
|
796
|
-
|
|
985
|
+
G(Q, { name: r.value }, {
|
|
986
|
+
default: U(() => [
|
|
987
|
+
n.value ? (s(), o("aside", {
|
|
797
988
|
key: 0,
|
|
798
|
-
class:
|
|
799
|
-
style:
|
|
989
|
+
class: v(f.value),
|
|
990
|
+
style: P(i.value)
|
|
800
991
|
}, [
|
|
801
|
-
|
|
992
|
+
_.$slots.header ? (s(), o("div", {
|
|
802
993
|
key: 0,
|
|
803
|
-
class:
|
|
994
|
+
class: v(m.value)
|
|
804
995
|
}, [
|
|
805
|
-
|
|
806
|
-
|
|
996
|
+
C(_.$slots, "header", {}, void 0, !0),
|
|
997
|
+
t.closable ? (s(), o("button", {
|
|
807
998
|
key: 0,
|
|
808
|
-
onClick:
|
|
999
|
+
onClick: d,
|
|
809
1000
|
class: "p-2 hover:bg-gray-100 rounded-md transition-colors",
|
|
810
1001
|
"aria-label": "Cerrar menú"
|
|
811
|
-
}, [...
|
|
812
|
-
|
|
1002
|
+
}, [...O[0] || (O[0] = [
|
|
1003
|
+
a("svg", {
|
|
813
1004
|
class: "w-5 h-5",
|
|
814
1005
|
fill: "none",
|
|
815
1006
|
stroke: "currentColor",
|
|
816
1007
|
viewBox: "0 0 24 24"
|
|
817
1008
|
}, [
|
|
818
|
-
|
|
1009
|
+
a("path", {
|
|
819
1010
|
"stroke-linecap": "round",
|
|
820
1011
|
"stroke-linejoin": "round",
|
|
821
1012
|
"stroke-width": "2",
|
|
822
1013
|
d: "M6 18L18 6M6 6l12 12"
|
|
823
1014
|
})
|
|
824
1015
|
], -1)
|
|
825
|
-
])])) :
|
|
826
|
-
], 2)) :
|
|
827
|
-
|
|
828
|
-
class:
|
|
1016
|
+
])])) : c("", !0)
|
|
1017
|
+
], 2)) : c("", !0),
|
|
1018
|
+
a("div", {
|
|
1019
|
+
class: v(j.value)
|
|
829
1020
|
}, [
|
|
830
|
-
|
|
1021
|
+
C(_.$slots, "default", {}, void 0, !0)
|
|
831
1022
|
], 2),
|
|
832
|
-
|
|
1023
|
+
_.$slots.footer ? (s(), o("div", {
|
|
833
1024
|
key: 1,
|
|
834
|
-
class:
|
|
1025
|
+
class: v(D.value)
|
|
835
1026
|
}, [
|
|
836
|
-
|
|
837
|
-
], 2)) :
|
|
838
|
-
], 6)) :
|
|
1027
|
+
C(_.$slots, "footer", {}, void 0, !0)
|
|
1028
|
+
], 2)) : c("", !0)
|
|
1029
|
+
], 6)) : c("", !0)
|
|
839
1030
|
]),
|
|
840
1031
|
_: 3
|
|
841
1032
|
}, 8, ["name"])
|
|
842
1033
|
]));
|
|
843
1034
|
}
|
|
844
|
-
}),
|
|
1035
|
+
}), Ut = /* @__PURE__ */ K(bt, [["__scopeId", "data-v-fffb0e44"]]), vt = { class: "w-full overflow-x-auto" }, yt = { class: "w-full border-collapse" }, xt = { class: "w-full" }, mt = { class: "bg-white border-b border-gray-100 w-full" }, kt = ["onClick"], wt = { class: "flex items-center gap-2" }, $t = {
|
|
845
1036
|
key: 0,
|
|
846
1037
|
class: "text-xs text-gray-400"
|
|
847
|
-
},
|
|
1038
|
+
}, Ct = { key: 0 }, Bt = { key: 1 }, _t = { class: "w-full" }, Tt = {
|
|
848
1039
|
key: 0,
|
|
849
1040
|
class: "flex items-center justify-center py-12 text-gray-400"
|
|
850
|
-
},
|
|
1041
|
+
}, Mt = {
|
|
851
1042
|
key: 1,
|
|
852
1043
|
class: "w-full px-6 py-4 bg-white"
|
|
853
|
-
},
|
|
1044
|
+
}, zt = /* @__PURE__ */ L({
|
|
854
1045
|
__name: "Table",
|
|
855
1046
|
props: {
|
|
856
1047
|
columns: {},
|
|
857
1048
|
data: {}
|
|
858
1049
|
},
|
|
859
|
-
setup(
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
},
|
|
863
|
-
if (!
|
|
864
|
-
return
|
|
865
|
-
const
|
|
866
|
-
return
|
|
867
|
-
const
|
|
868
|
-
return typeof
|
|
869
|
-
}),
|
|
1050
|
+
setup(t) {
|
|
1051
|
+
const y = t, e = V(null), u = V("asc"), n = (r) => {
|
|
1052
|
+
e.value === r ? u.value = u.value === "asc" ? "desc" : "asc" : (e.value = r, u.value = "asc");
|
|
1053
|
+
}, d = g(() => {
|
|
1054
|
+
if (!e.value)
|
|
1055
|
+
return y.data;
|
|
1056
|
+
const r = [...y.data];
|
|
1057
|
+
return r.sort((f, i) => {
|
|
1058
|
+
const x = f[e.value], m = i[e.value];
|
|
1059
|
+
return typeof x == "string" && typeof m == "string" ? u.value === "asc" ? x.localeCompare(m) : m.localeCompare(x) : typeof x == "number" && typeof m == "number" ? u.value === "asc" ? x - m : m - x : 0;
|
|
1060
|
+
}), r;
|
|
870
1061
|
});
|
|
871
|
-
return (
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
(s(!0),
|
|
876
|
-
key:
|
|
877
|
-
style:
|
|
878
|
-
class:
|
|
1062
|
+
return (r, f) => (s(), o("div", vt, [
|
|
1063
|
+
a("table", yt, [
|
|
1064
|
+
a("thead", xt, [
|
|
1065
|
+
a("tr", mt, [
|
|
1066
|
+
(s(!0), o(E, null, W(t.columns, (i) => (s(), o("th", {
|
|
1067
|
+
key: i.key,
|
|
1068
|
+
style: P(i.width ? { width: i.width } : {}),
|
|
1069
|
+
class: v([
|
|
879
1070
|
"px-8 py-4 text-left text-base font-semibold text-gray-900 border-0",
|
|
880
|
-
|
|
1071
|
+
i.sortable ? "cursor-pointer hover:text-primary-700 select-none transition-colors" : ""
|
|
881
1072
|
]),
|
|
882
|
-
onClick: (
|
|
1073
|
+
onClick: (x) => i.sortable && n(i.key)
|
|
883
1074
|
}, [
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
])) :
|
|
1075
|
+
a("div", wt, [
|
|
1076
|
+
a("span", null, $(i.label), 1),
|
|
1077
|
+
i.sortable ? (s(), o("span", $t, [
|
|
1078
|
+
e.value !== i.key ? (s(), o("span", Ct, "⇅")) : (s(), o("span", Bt, $(u.value === "asc" ? "↑" : "↓"), 1))
|
|
1079
|
+
])) : c("", !0)
|
|
889
1080
|
])
|
|
890
|
-
], 14,
|
|
1081
|
+
], 14, kt))), 128))
|
|
891
1082
|
])
|
|
892
1083
|
]),
|
|
893
|
-
|
|
894
|
-
(s(!0),
|
|
895
|
-
key:
|
|
1084
|
+
a("tbody", _t, [
|
|
1085
|
+
(s(!0), o(E, null, W(d.value, (i, x) => (s(), o("tr", {
|
|
1086
|
+
key: x,
|
|
896
1087
|
class: "w-full hover:bg-gray-50 transition-colors"
|
|
897
1088
|
}, [
|
|
898
|
-
(s(!0),
|
|
899
|
-
key: `${
|
|
1089
|
+
(s(!0), o(E, null, W(t.columns, (m) => (s(), o("td", {
|
|
1090
|
+
key: `${x}-${m.key}`,
|
|
900
1091
|
class: "px-8 py-4 text-base text-gray-700 border-0"
|
|
901
1092
|
}, [
|
|
902
|
-
|
|
903
|
-
value:
|
|
904
|
-
row:
|
|
1093
|
+
C(r.$slots, `cell-${m.key}`, {
|
|
1094
|
+
value: i[m.key],
|
|
1095
|
+
row: i
|
|
905
1096
|
}, () => [
|
|
906
|
-
|
|
1097
|
+
A($(i[m.key]), 1)
|
|
907
1098
|
], !0)
|
|
908
1099
|
]))), 128))
|
|
909
1100
|
]))), 128))
|
|
910
1101
|
])
|
|
911
1102
|
]),
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1103
|
+
d.value.length === 0 ? (s(), o("div", Tt, [
|
|
1104
|
+
C(r.$slots, "empty", {}, () => [
|
|
1105
|
+
f[0] || (f[0] = A("No hay datos disponibles", -1))
|
|
915
1106
|
], !0)
|
|
916
|
-
])) :
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
])) :
|
|
1107
|
+
])) : c("", !0),
|
|
1108
|
+
r.$slots.footer ? (s(), o("div", Mt, [
|
|
1109
|
+
C(r.$slots, "footer", {}, void 0, !0)
|
|
1110
|
+
])) : c("", !0)
|
|
920
1111
|
]));
|
|
921
1112
|
}
|
|
922
|
-
}),
|
|
1113
|
+
}), Gt = /* @__PURE__ */ K(zt, [["__scopeId", "data-v-6b3ff0a8"]]), Vt = { class: "w-full" }, jt = {
|
|
923
1114
|
class: "flex border-b border-gray-100",
|
|
924
1115
|
role: "tablist"
|
|
925
|
-
},
|
|
1116
|
+
}, Lt = ["aria-selected", "onClick"], St = { role: "tabpanel" }, Dt = "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", Ot = "text-primary-700 border-b-4 border-primary-700", It = "text-gray-600 border-b-4 border-transparent hover:text-gray-800", Qt = /* @__PURE__ */ L({
|
|
926
1117
|
__name: "Tabs",
|
|
927
1118
|
props: {
|
|
928
1119
|
modelValue: {},
|
|
929
1120
|
tabs: {}
|
|
930
1121
|
},
|
|
931
1122
|
emits: ["update:modelValue"],
|
|
932
|
-
setup(
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
},
|
|
936
|
-
() =>
|
|
1123
|
+
setup(t, { emit: y }) {
|
|
1124
|
+
const e = t, u = y, n = (i) => e.modelValue === i, d = (i) => {
|
|
1125
|
+
n(i) || u("update:modelValue", i);
|
|
1126
|
+
}, r = g(() => e.modelValue), f = g(
|
|
1127
|
+
() => e.tabs.find((i) => i.value === r.value)
|
|
937
1128
|
);
|
|
938
|
-
return (
|
|
939
|
-
|
|
940
|
-
(s(!0),
|
|
941
|
-
key:
|
|
1129
|
+
return (i, x) => (s(), o("div", Vt, [
|
|
1130
|
+
a("div", jt, [
|
|
1131
|
+
(s(!0), o(E, null, W(t.tabs, (m) => (s(), o("button", {
|
|
1132
|
+
key: m.value,
|
|
942
1133
|
type: "button",
|
|
943
|
-
class:
|
|
944
|
-
|
|
945
|
-
|
|
1134
|
+
class: v([
|
|
1135
|
+
Dt,
|
|
1136
|
+
n(m.value) ? Ot : It
|
|
946
1137
|
]),
|
|
947
|
-
"aria-selected":
|
|
1138
|
+
"aria-selected": n(m.value),
|
|
948
1139
|
role: "tab",
|
|
949
|
-
onClick: (
|
|
950
|
-
},
|
|
1140
|
+
onClick: (j) => d(m.value)
|
|
1141
|
+
}, $(m.label), 11, Lt))), 128))
|
|
951
1142
|
]),
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
active:
|
|
955
|
-
tab:
|
|
1143
|
+
a("div", St, [
|
|
1144
|
+
C(i.$slots, r.value, {
|
|
1145
|
+
active: r.value,
|
|
1146
|
+
tab: f.value
|
|
956
1147
|
})
|
|
957
1148
|
])
|
|
958
1149
|
]));
|
|
959
1150
|
}
|
|
960
|
-
}),
|
|
1151
|
+
}), Et = "font-sans", Jt = /* @__PURE__ */ L({
|
|
961
1152
|
__name: "Text",
|
|
962
1153
|
props: {
|
|
963
1154
|
variant: { default: "body1" },
|
|
@@ -968,8 +1159,8 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
968
1159
|
truncate: { type: Boolean, default: !1 },
|
|
969
1160
|
weight: {}
|
|
970
1161
|
},
|
|
971
|
-
setup(
|
|
972
|
-
const
|
|
1162
|
+
setup(t) {
|
|
1163
|
+
const y = {
|
|
973
1164
|
h1: "text-[40px] leading-[57px] tracking-[0px] font-extrabold",
|
|
974
1165
|
h2: "text-[40px] leading-[57px] tracking-[0px] font-bold",
|
|
975
1166
|
h3: "text-[28px] leading-[39px] tracking-[0px] font-extrabold",
|
|
@@ -989,7 +1180,7 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
989
1180
|
button3: "text-[12px] leading-[18px] tracking-[1.25px] font-bold",
|
|
990
1181
|
caption: "text-[12px] leading-[18px] tracking-[0.4px] font-normal",
|
|
991
1182
|
overline: "text-[10px] leading-[15px] tracking-[1.5px] font-medium"
|
|
992
|
-
},
|
|
1183
|
+
}, e = {
|
|
993
1184
|
h1: "h1",
|
|
994
1185
|
h2: "h2",
|
|
995
1186
|
h3: "h3",
|
|
@@ -1009,12 +1200,12 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
1009
1200
|
button3: "span",
|
|
1010
1201
|
caption: "span",
|
|
1011
1202
|
overline: "span"
|
|
1012
|
-
},
|
|
1203
|
+
}, u = {
|
|
1013
1204
|
left: "text-left",
|
|
1014
1205
|
center: "text-center",
|
|
1015
1206
|
right: "text-right",
|
|
1016
1207
|
justify: "text-justify"
|
|
1017
|
-
},
|
|
1208
|
+
}, n = {
|
|
1018
1209
|
default: "text-secondary-900",
|
|
1019
1210
|
muted: "text-secondary-600",
|
|
1020
1211
|
primary: "text-primary-600",
|
|
@@ -1022,44 +1213,45 @@ const se = { class: "flex items-center gap-4" }, le = {
|
|
|
1022
1213
|
danger: "text-danger-600",
|
|
1023
1214
|
success: "text-success-600",
|
|
1024
1215
|
warning: "text-warning-600"
|
|
1025
|
-
},
|
|
1216
|
+
}, d = {
|
|
1026
1217
|
light: "font-light",
|
|
1027
1218
|
normal: "font-normal",
|
|
1028
1219
|
medium: "font-medium",
|
|
1029
1220
|
semibold: "font-semibold",
|
|
1030
1221
|
bold: "font-bold",
|
|
1031
1222
|
extrabold: "font-extrabold"
|
|
1032
|
-
},
|
|
1033
|
-
return (
|
|
1034
|
-
class:
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1223
|
+
}, r = t, f = g(() => r.variant), i = g(() => r.color), x = g(() => r.align), m = g(() => r.as || e[f.value] || "span"), j = g(() => r.weight ? d[r.weight] : "");
|
|
1224
|
+
return (D, _) => (s(), q(Z(m.value), {
|
|
1225
|
+
class: v([
|
|
1226
|
+
Et,
|
|
1227
|
+
y[f.value],
|
|
1228
|
+
n[i.value],
|
|
1229
|
+
u[x.value],
|
|
1230
|
+
j.value,
|
|
1040
1231
|
{
|
|
1041
|
-
uppercase:
|
|
1042
|
-
truncate:
|
|
1232
|
+
uppercase: t.uppercase || f.value === "overline",
|
|
1233
|
+
truncate: t.truncate
|
|
1043
1234
|
}
|
|
1044
1235
|
])
|
|
1045
1236
|
}, {
|
|
1046
|
-
default:
|
|
1047
|
-
|
|
1237
|
+
default: U(() => [
|
|
1238
|
+
C(D.$slots, "default")
|
|
1048
1239
|
]),
|
|
1049
1240
|
_: 3
|
|
1050
1241
|
}, 8, ["class"]));
|
|
1051
1242
|
}
|
|
1052
1243
|
});
|
|
1053
1244
|
export {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1245
|
+
Ft as AppBar,
|
|
1246
|
+
Pt as Button,
|
|
1247
|
+
Wt as Card,
|
|
1248
|
+
At as Dialog,
|
|
1249
|
+
Kt as FileUpload,
|
|
1250
|
+
Rt as Loader,
|
|
1251
|
+
Nt as Menu,
|
|
1252
|
+
qt as Select,
|
|
1253
|
+
Ut as Sidebar,
|
|
1254
|
+
Gt as Table,
|
|
1255
|
+
Qt as Tabs,
|
|
1256
|
+
Jt as Text
|
|
1065
1257
|
};
|