@iaclinical/components 1.0.15 → 1.0.17
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 +5 -3
- package/dist/iaclinical-components.cjs +1 -1
- package/dist/iaclinical-components.js +668 -608
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as O, computed as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as O, computed as c, createElementBlock as o, openBlock as s, normalizeClass as x, createElementVNode as l, createCommentVNode as h, renderSlot as B, toDisplayString as w, createBlock as q, Teleport as J, createVNode as G, Transition as Q, withCtx as U, withModifiers as F, createTextVNode as P, ref as E, unref as ee, normalizeStyle as R, onMounted as te, onUnmounted as se, watch as X, nextTick as Z, Fragment as A, renderList as W, resolveDynamicComponent as Y, withDirectives as oe, vModelText as le } from "vue";
|
|
2
|
+
import { Icon as ae } from "@iconify/vue";
|
|
3
|
+
const ne = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, re = {
|
|
3
4
|
key: 1,
|
|
4
5
|
class: "text-base sm:text-lg font-bold text-primary-50 font-poppins whitespace-nowrap"
|
|
5
|
-
},
|
|
6
|
+
}, ie = { class: "flex flex-1 justify-center items-center min-w-0" }, de = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "text-base sm:text-lg font-bold text-primary-50 font-poppins truncate"
|
|
8
|
-
},
|
|
9
|
+
}, ue = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ce = {
|
|
9
10
|
key: 0,
|
|
10
11
|
class: "text-base sm:text-lg font-bold text-primary-50 font-poppins whitespace-nowrap"
|
|
11
|
-
},
|
|
12
|
+
}, fe = /* @__PURE__ */ O({
|
|
12
13
|
__name: "AppBar",
|
|
13
14
|
props: {
|
|
14
15
|
title: { default: "" },
|
|
@@ -20,35 +21,35 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
20
21
|
height: { default: "md" }
|
|
21
22
|
},
|
|
22
23
|
emits: ["toggle-menu"],
|
|
23
|
-
setup(t, { emit:
|
|
24
|
-
const e = t,
|
|
25
|
-
const
|
|
24
|
+
setup(t, { emit: u }) {
|
|
25
|
+
const e = t, d = u, r = c(() => {
|
|
26
|
+
const i = "flex flex-row items-center justify-between gap-2 sm:gap-4 px-3 sm:px-6 z-50 w-full", p = {
|
|
26
27
|
default: "bg-primary-700 text-primary-50",
|
|
27
28
|
dark: "bg-secondary-900 text-white",
|
|
28
29
|
light: "bg-white text-secondary-900 border-b border-secondary-200"
|
|
29
|
-
},
|
|
30
|
+
}, a = {
|
|
30
31
|
sm: "h-12",
|
|
31
32
|
md: "h-14",
|
|
32
33
|
lg: "h-16"
|
|
33
|
-
},
|
|
34
|
+
}, g = e.sticky ? "sticky top-0" : "", v = e.shadow ? "shadow-md" : "";
|
|
34
35
|
return [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
i,
|
|
37
|
+
p[e.variant],
|
|
38
|
+
a[e.height],
|
|
39
|
+
g,
|
|
40
|
+
v
|
|
40
41
|
].join(" ");
|
|
41
42
|
});
|
|
42
|
-
return (
|
|
43
|
-
class:
|
|
43
|
+
return (i, p) => (s(), o("header", {
|
|
44
|
+
class: x(r.value)
|
|
44
45
|
}, [
|
|
45
|
-
l("div",
|
|
46
|
+
l("div", ne, [
|
|
46
47
|
t.showMenuButton ? (s(), o("button", {
|
|
47
48
|
key: 0,
|
|
48
|
-
onClick:
|
|
49
|
+
onClick: p[0] || (p[0] = (a) => d("toggle-menu")),
|
|
49
50
|
class: "p-1.5 sm:p-2 hover:bg-primary-600 rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
50
51
|
"aria-label": "Toggle menu"
|
|
51
|
-
}, [...
|
|
52
|
+
}, [...p[1] || (p[1] = [
|
|
52
53
|
l("svg", {
|
|
53
54
|
class: "w-5 h-5 sm:w-6 sm:h-6 text-primary-50",
|
|
54
55
|
fill: "none",
|
|
@@ -63,29 +64,29 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
63
64
|
d: "M4 6h16M4 12h16M4 18h16"
|
|
64
65
|
})
|
|
65
66
|
], -1)
|
|
66
|
-
])])) :
|
|
67
|
-
t.title && t.titlePosition === "left" ? (s(), o("div",
|
|
68
|
-
B(
|
|
69
|
-
]),
|
|
70
|
-
l("div", ne, [
|
|
71
|
-
t.title && t.titlePosition === "center" ? (s(), o("div", re, w(t.title), 1)) : g("", !0),
|
|
72
|
-
B(r.$slots, "center", {}, void 0, !0)
|
|
67
|
+
])])) : h("", !0),
|
|
68
|
+
t.title && t.titlePosition === "left" ? (s(), o("div", re, w(t.title), 1)) : h("", !0),
|
|
69
|
+
B(i.$slots, "left", {}, void 0, !0)
|
|
73
70
|
]),
|
|
74
71
|
l("div", ie, [
|
|
75
|
-
t.title && t.titlePosition === "
|
|
76
|
-
B(
|
|
72
|
+
t.title && t.titlePosition === "center" ? (s(), o("div", de, w(t.title), 1)) : h("", !0),
|
|
73
|
+
B(i.$slots, "center", {}, void 0, !0)
|
|
74
|
+
]),
|
|
75
|
+
l("div", ue, [
|
|
76
|
+
t.title && t.titlePosition === "right" ? (s(), o("div", ce, w(t.title), 1)) : h("", !0),
|
|
77
|
+
B(i.$slots, "right", {}, void 0, !0)
|
|
77
78
|
])
|
|
78
79
|
], 2));
|
|
79
80
|
}
|
|
80
|
-
}), N = (t,
|
|
81
|
+
}), N = (t, u) => {
|
|
81
82
|
const e = t.__vccOpts || t;
|
|
82
|
-
for (const [
|
|
83
|
-
e[
|
|
83
|
+
for (const [d, r] of u)
|
|
84
|
+
e[d] = r;
|
|
84
85
|
return e;
|
|
85
|
-
},
|
|
86
|
+
}, as = /* @__PURE__ */ N(fe, [["__scopeId", "data-v-c5861315"]]), pe = ["type", "disabled", "aria-label"], ve = {
|
|
86
87
|
key: 0,
|
|
87
88
|
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]"
|
|
88
|
-
},
|
|
89
|
+
}, ns = /* @__PURE__ */ O({
|
|
89
90
|
__name: "Button",
|
|
90
91
|
props: {
|
|
91
92
|
variant: { default: "primary" },
|
|
@@ -99,9 +100,9 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
99
100
|
textColorHover: { default: void 0 }
|
|
100
101
|
},
|
|
101
102
|
emits: ["click"],
|
|
102
|
-
setup(t, { emit:
|
|
103
|
-
const e = t,
|
|
104
|
-
const
|
|
103
|
+
setup(t, { emit: u }) {
|
|
104
|
+
const e = t, d = u, r = c(() => e.variant === "icon"), i = c(() => e.badge > 99 ? "99+" : e.badge.toString()), p = c(() => {
|
|
105
|
+
const g = "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", v = {
|
|
105
106
|
primary: "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700 focus-visible:ring-primary-700",
|
|
106
107
|
secondary: "bg-secondary-200 text-secondary-900 hover:bg-secondary-300 focus-visible:ring-secondary-500",
|
|
107
108
|
outline: "border border-secondary-300 bg-transparent hover:bg-secondary-100 focus-visible:ring-secondary-500",
|
|
@@ -110,42 +111,42 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
110
111
|
icon: "hover:bg-secondary-100 focus-visible:ring-secondary-500 relative",
|
|
111
112
|
text: "bg-transparent border-0 focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
112
113
|
}, y = {
|
|
113
|
-
sm:
|
|
114
|
-
md:
|
|
115
|
-
lg:
|
|
116
|
-
},
|
|
114
|
+
sm: r.value ? "p-1.5" : "h-8 px-3 text-sm",
|
|
115
|
+
md: r.value ? "p-2" : "h-10 px-4 text-base",
|
|
116
|
+
lg: r.value ? "p-3" : "h-12 px-6 text-lg"
|
|
117
|
+
}, f = {
|
|
117
118
|
full: "rounded-full",
|
|
118
119
|
xl: "rounded-2xl",
|
|
119
120
|
lg: "rounded-xl",
|
|
120
121
|
md: "rounded-lg",
|
|
121
122
|
sm: "rounded-md",
|
|
122
123
|
none: "rounded-none"
|
|
123
|
-
}, _ = e.textColor ? e.textColor : "", C =
|
|
124
|
-
var
|
|
125
|
-
return e.textColorHover ? e.textColorHover : (
|
|
124
|
+
}, _ = e.textColor ? e.textColor : "", C = c(() => {
|
|
125
|
+
var I, V;
|
|
126
|
+
return e.textColorHover ? e.textColorHover : (I = e.textColor) != null && I.includes("white") || (V = e.textColor) != null && V.includes("50") ? "hover:text-black" : "";
|
|
126
127
|
});
|
|
127
|
-
return `${
|
|
128
|
-
}),
|
|
129
|
-
e.disabled ||
|
|
128
|
+
return `${g} ${v[e.variant]} ${y[e.size]} ${f[e.radius]} ${_} ${C.value}`;
|
|
129
|
+
}), a = (g) => {
|
|
130
|
+
e.disabled || d("click", g);
|
|
130
131
|
};
|
|
131
|
-
return (
|
|
132
|
-
class: p
|
|
132
|
+
return (g, v) => (s(), o("button", {
|
|
133
|
+
class: x(p.value),
|
|
133
134
|
type: t.type,
|
|
134
135
|
disabled: t.disabled,
|
|
135
|
-
onClick:
|
|
136
|
+
onClick: a,
|
|
136
137
|
"aria-label": t.ariaLabel
|
|
137
138
|
}, [
|
|
138
|
-
B(
|
|
139
|
-
|
|
140
|
-
], 10,
|
|
139
|
+
B(g.$slots, "default"),
|
|
140
|
+
r.value && t.badge && t.badge > 0 ? (s(), o("span", ve, w(i.value), 1)) : h("", !0)
|
|
141
|
+
], 10, pe));
|
|
141
142
|
}
|
|
142
|
-
}),
|
|
143
|
+
}), ge = {
|
|
143
144
|
key: 0,
|
|
144
145
|
class: "border-b border-gray-100 px-6 py-4"
|
|
145
|
-
},
|
|
146
|
+
}, xe = { class: "px-6 py-4" }, he = {
|
|
146
147
|
key: 1,
|
|
147
148
|
class: "border-t border-gray-100 px-6 py-4 bg-gray-50"
|
|
148
|
-
},
|
|
149
|
+
}, rs = /* @__PURE__ */ O({
|
|
149
150
|
__name: "Card",
|
|
150
151
|
props: {
|
|
151
152
|
shadow: { default: "md" },
|
|
@@ -153,43 +154,43 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
153
154
|
bordered: { type: Boolean, default: !1 }
|
|
154
155
|
},
|
|
155
156
|
setup(t) {
|
|
156
|
-
const
|
|
157
|
+
const u = t, e = {
|
|
157
158
|
none: "",
|
|
158
159
|
sm: "shadow-sm",
|
|
159
160
|
md: "shadow",
|
|
160
161
|
lg: "shadow-lg",
|
|
161
162
|
xl: "shadow-xl"
|
|
162
|
-
},
|
|
163
|
+
}, d = {
|
|
163
164
|
none: "rounded-none",
|
|
164
165
|
sm: "rounded-sm",
|
|
165
166
|
md: "rounded-md",
|
|
166
167
|
lg: "rounded-lg",
|
|
167
168
|
xl: "rounded-xl",
|
|
168
169
|
full: "rounded-full"
|
|
169
|
-
},
|
|
170
|
+
}, r = c(() => [
|
|
170
171
|
"w-full bg-white",
|
|
171
|
-
e[
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
e[u.shadow],
|
|
173
|
+
d[u.rounded],
|
|
174
|
+
u.bordered ? "border border-gray-200" : ""
|
|
174
175
|
]);
|
|
175
|
-
return (
|
|
176
|
-
class:
|
|
176
|
+
return (i, p) => (s(), o("div", {
|
|
177
|
+
class: x(r.value)
|
|
177
178
|
}, [
|
|
178
|
-
|
|
179
|
-
B(
|
|
180
|
-
])) :
|
|
181
|
-
l("div",
|
|
182
|
-
B(
|
|
179
|
+
i.$slots.header ? (s(), o("div", ge, [
|
|
180
|
+
B(i.$slots, "header")
|
|
181
|
+
])) : h("", !0),
|
|
182
|
+
l("div", xe, [
|
|
183
|
+
B(i.$slots, "default")
|
|
183
184
|
]),
|
|
184
|
-
|
|
185
|
-
B(
|
|
186
|
-
])) :
|
|
185
|
+
i.$slots.footer ? (s(), o("div", he, [
|
|
186
|
+
B(i.$slots, "footer")
|
|
187
|
+
])) : h("", !0)
|
|
187
188
|
], 2));
|
|
188
189
|
}
|
|
189
|
-
}),
|
|
190
|
+
}), be = { class: "flex items-center justify-between border-b border-gray-100/60 px-8 py-6" }, ye = { class: "text-xl font-semibold text-gray-900" }, me = { class: "px-8 py-6" }, we = {
|
|
190
191
|
key: 0,
|
|
191
192
|
class: "border-t border-gray-100 px-8 py-6 bg-gray-50"
|
|
192
|
-
},
|
|
193
|
+
}, ke = /* @__PURE__ */ O({
|
|
193
194
|
__name: "Dialog",
|
|
194
195
|
props: {
|
|
195
196
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -197,40 +198,40 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
197
198
|
closeOnBackdrop: { type: Boolean, default: !0 }
|
|
198
199
|
},
|
|
199
200
|
emits: ["update:modelValue", "close"],
|
|
200
|
-
setup(t, { emit:
|
|
201
|
-
const e = t,
|
|
201
|
+
setup(t, { emit: u }) {
|
|
202
|
+
const e = t, d = u, r = c({
|
|
202
203
|
get: () => e.modelValue,
|
|
203
|
-
set: (
|
|
204
|
-
}),
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
e.closeOnBackdrop &&
|
|
204
|
+
set: (a) => d("update:modelValue", a)
|
|
205
|
+
}), i = () => {
|
|
206
|
+
r.value = !1, d("close");
|
|
207
|
+
}, p = () => {
|
|
208
|
+
e.closeOnBackdrop && i();
|
|
208
209
|
};
|
|
209
|
-
return (
|
|
210
|
+
return (a, g) => (s(), q(J, { to: "body" }, [
|
|
210
211
|
G(Q, { name: "dialog" }, {
|
|
211
212
|
default: U(() => [
|
|
212
|
-
|
|
213
|
+
r.value ? (s(), o("div", {
|
|
213
214
|
key: 0,
|
|
214
215
|
class: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",
|
|
215
|
-
onClick:
|
|
216
|
+
onClick: p
|
|
216
217
|
}, [
|
|
217
218
|
l("div", {
|
|
218
219
|
class: "relative w-full rounded-lg bg-white shadow-xl sm:max-w-lg md:max-w-2xl",
|
|
219
|
-
onClick:
|
|
220
|
+
onClick: g[0] || (g[0] = F(() => {
|
|
220
221
|
}, ["stop"]))
|
|
221
222
|
}, [
|
|
222
|
-
l("div",
|
|
223
|
-
l("h2",
|
|
224
|
-
B(
|
|
225
|
-
|
|
223
|
+
l("div", be, [
|
|
224
|
+
l("h2", ye, [
|
|
225
|
+
B(a.$slots, "title", {}, () => [
|
|
226
|
+
P(w(t.title), 1)
|
|
226
227
|
], !0)
|
|
227
228
|
]),
|
|
228
229
|
l("button", {
|
|
229
230
|
type: "button",
|
|
230
231
|
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",
|
|
231
232
|
"aria-label": "Cerrar diálogo",
|
|
232
|
-
onClick:
|
|
233
|
-
}, [...
|
|
233
|
+
onClick: i
|
|
234
|
+
}, [...g[1] || (g[1] = [
|
|
234
235
|
l("svg", {
|
|
235
236
|
class: "h-6 w-6",
|
|
236
237
|
fill: "none",
|
|
@@ -246,32 +247,32 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
246
247
|
], -1)
|
|
247
248
|
])])
|
|
248
249
|
]),
|
|
249
|
-
l("div",
|
|
250
|
-
B(
|
|
250
|
+
l("div", me, [
|
|
251
|
+
B(a.$slots, "default", {}, void 0, !0)
|
|
251
252
|
]),
|
|
252
|
-
|
|
253
|
-
B(
|
|
254
|
-
])) :
|
|
253
|
+
a.$slots.footer ? (s(), o("div", we, [
|
|
254
|
+
B(a.$slots, "footer", {}, void 0, !0)
|
|
255
|
+
])) : h("", !0)
|
|
255
256
|
])
|
|
256
|
-
])) :
|
|
257
|
+
])) : h("", !0)
|
|
257
258
|
]),
|
|
258
259
|
_: 3
|
|
259
260
|
})
|
|
260
261
|
]));
|
|
261
262
|
}
|
|
262
|
-
}),
|
|
263
|
+
}), is = /* @__PURE__ */ N(ke, [["__scopeId", "data-v-37e19754"]]), $e = ["accept", "multiple", "disabled"], Ce = { class: "flex flex-col items-center justify-center gap-4 text-center" }, Be = ["src", "alt"], ze = {
|
|
263
264
|
key: 1,
|
|
264
265
|
class: "w-full h-full text-gray-400",
|
|
265
266
|
fill: "none",
|
|
266
267
|
stroke: "currentColor",
|
|
267
268
|
viewBox: "0 0 24 24"
|
|
268
|
-
},
|
|
269
|
+
}, Me = { class: "text-center" }, _e = { class: "text-base font-medium text-gray-700" }, Te = { class: "text-primary-700" }, je = { class: "flex items-center gap-3 flex-1 min-w-0" }, Ve = { class: "flex-1 min-w-0" }, Ie = { class: "text-sm font-medium text-gray-900 truncate" }, Se = { class: "text-xs text-gray-500" }, Le = {
|
|
269
270
|
key: 1,
|
|
270
271
|
class: "text-xs text-gray-500 mt-2"
|
|
271
|
-
},
|
|
272
|
+
}, Oe = {
|
|
272
273
|
key: 2,
|
|
273
274
|
class: "text-sm text-danger-500 mt-2"
|
|
274
|
-
},
|
|
275
|
+
}, ds = /* @__PURE__ */ O({
|
|
275
276
|
__name: "FileUpload",
|
|
276
277
|
props: {
|
|
277
278
|
modelValue: { default: null },
|
|
@@ -287,73 +288,73 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
287
288
|
maxSize: { default: void 0 }
|
|
288
289
|
},
|
|
289
290
|
emits: ["update:modelValue", "change", "error"],
|
|
290
|
-
setup(t, { emit:
|
|
291
|
-
const e = t,
|
|
291
|
+
setup(t, { emit: u }) {
|
|
292
|
+
const e = t, d = u, r = E(null), i = E(!1), p = E(e.modelValue), a = E(""), g = c(() => ({
|
|
292
293
|
sm: "w-20 h-20",
|
|
293
294
|
md: "w-32 h-32",
|
|
294
295
|
lg: "w-48 h-48",
|
|
295
296
|
xl: "w-64 h-64"
|
|
296
|
-
})[e.illustrationSize]),
|
|
297
|
+
})[e.illustrationSize]), v = () => {
|
|
297
298
|
var k;
|
|
298
|
-
(k =
|
|
299
|
+
(k = r.value) == null || k.click();
|
|
299
300
|
}, y = () => {
|
|
300
|
-
e.disabled ||
|
|
301
|
-
},
|
|
302
|
-
e.disabled || (
|
|
301
|
+
e.disabled || v();
|
|
302
|
+
}, f = (k) => {
|
|
303
|
+
e.disabled || (i.value = !0);
|
|
303
304
|
}, _ = () => {
|
|
304
|
-
|
|
305
|
+
i.value = !1;
|
|
305
306
|
}, C = (k) => {
|
|
306
|
-
if (
|
|
307
|
+
if (a.value = "", e.maxSize && k.size > e.maxSize) {
|
|
307
308
|
const j = (e.maxSize / 1048576).toFixed(2);
|
|
308
|
-
return
|
|
309
|
+
return a.value = `El archivo excede el tamaño máximo de ${j}MB`, d("error", a.value), !1;
|
|
309
310
|
}
|
|
310
311
|
return !0;
|
|
311
|
-
},
|
|
312
|
+
}, I = (k) => {
|
|
312
313
|
var H;
|
|
313
|
-
const
|
|
314
|
-
|
|
314
|
+
const L = (H = k.target.files) == null ? void 0 : H[0];
|
|
315
|
+
L && C(L) && (p.value = L, d("update:modelValue", L), d("change", L));
|
|
315
316
|
}, V = (k) => {
|
|
316
|
-
var
|
|
317
|
-
|
|
318
|
-
const j = (
|
|
319
|
-
j && C(j) && (
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
},
|
|
317
|
+
var L;
|
|
318
|
+
i.value = !1;
|
|
319
|
+
const j = (L = k.dataTransfer) == null ? void 0 : L.files[0];
|
|
320
|
+
j && C(j) && (p.value = j, d("update:modelValue", j), d("change", j));
|
|
321
|
+
}, T = () => {
|
|
322
|
+
p.value = null, a.value = "", r.value && (r.value.value = ""), d("update:modelValue", null), d("change", null);
|
|
323
|
+
}, b = (k) => {
|
|
323
324
|
if (k === 0) return "0 Bytes";
|
|
324
|
-
const j = 1024,
|
|
325
|
-
return Math.round(k / Math.pow(j, H) * 100) / 100 + " " +
|
|
325
|
+
const j = 1024, L = ["Bytes", "KB", "MB", "GB"], H = Math.floor(Math.log(k) / Math.log(j));
|
|
326
|
+
return Math.round(k / Math.pow(j, H) * 100) / 100 + " " + L[H];
|
|
326
327
|
};
|
|
327
328
|
return (k, j) => (s(), o("div", {
|
|
328
|
-
class:
|
|
329
|
-
|
|
329
|
+
class: x(["relative border-2 border-dashed rounded-lg p-8 transition-colors", [
|
|
330
|
+
i.value ? "border-primary-700 bg-primary-50" : "border-gray-300 bg-white hover:border-primary-500",
|
|
330
331
|
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
331
332
|
]]),
|
|
332
333
|
onClick: y,
|
|
333
|
-
onDragover: F(
|
|
334
|
+
onDragover: F(f, ["prevent"]),
|
|
334
335
|
onDragleave: F(_, ["prevent"]),
|
|
335
336
|
onDrop: F(V, ["prevent"])
|
|
336
337
|
}, [
|
|
337
338
|
l("input", {
|
|
338
339
|
ref_key: "fileInput",
|
|
339
|
-
ref:
|
|
340
|
+
ref: r,
|
|
340
341
|
type: "file",
|
|
341
342
|
accept: t.accept,
|
|
342
343
|
multiple: t.multiple,
|
|
343
344
|
disabled: t.disabled,
|
|
344
345
|
class: "hidden",
|
|
345
|
-
onChange:
|
|
346
|
-
}, null, 40,
|
|
347
|
-
l("div",
|
|
346
|
+
onChange: I
|
|
347
|
+
}, null, 40, $e),
|
|
348
|
+
l("div", Ce, [
|
|
348
349
|
l("div", {
|
|
349
|
-
class:
|
|
350
|
+
class: x([g.value, "flex items-center justify-center"])
|
|
350
351
|
}, [
|
|
351
352
|
t.illustration ? (s(), o("img", {
|
|
352
353
|
key: 0,
|
|
353
354
|
src: t.illustration,
|
|
354
355
|
alt: t.illustrationAlt,
|
|
355
356
|
class: "max-w-full max-h-full object-contain"
|
|
356
|
-
}, null, 8,
|
|
357
|
+
}, null, 8, Be)) : (s(), o("svg", ze, [...j[1] || (j[1] = [
|
|
357
358
|
l("path", {
|
|
358
359
|
"stroke-linecap": "round",
|
|
359
360
|
"stroke-linejoin": "round",
|
|
@@ -362,19 +363,19 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
362
363
|
}, null, -1)
|
|
363
364
|
])]))
|
|
364
365
|
], 2),
|
|
365
|
-
l("div",
|
|
366
|
-
l("p",
|
|
367
|
-
|
|
366
|
+
l("div", Me, [
|
|
367
|
+
l("p", _e, [
|
|
368
|
+
P(w(t.mainText) + " ", 1),
|
|
368
369
|
l("span", Te, w(t.linkText), 1)
|
|
369
370
|
])
|
|
370
371
|
]),
|
|
371
|
-
|
|
372
|
+
p.value ? (s(), o("div", {
|
|
372
373
|
key: 0,
|
|
373
374
|
class: "w-full max-w-md bg-gray-50 rounded-lg p-4 flex items-center justify-between",
|
|
374
375
|
onClick: j[0] || (j[0] = F(() => {
|
|
375
376
|
}, ["stop"]))
|
|
376
377
|
}, [
|
|
377
|
-
l("div",
|
|
378
|
+
l("div", je, [
|
|
378
379
|
j[2] || (j[2] = l("svg", {
|
|
379
380
|
class: "w-6 h-6 text-gray-600 flex-shrink-0",
|
|
380
381
|
fill: "none",
|
|
@@ -388,14 +389,14 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
388
389
|
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"
|
|
389
390
|
})
|
|
390
391
|
], -1)),
|
|
391
|
-
l("div",
|
|
392
|
-
l("p",
|
|
393
|
-
l("p",
|
|
392
|
+
l("div", Ve, [
|
|
393
|
+
l("p", Ie, w(p.value.name), 1),
|
|
394
|
+
l("p", Se, w(b(p.value.size)), 1)
|
|
394
395
|
])
|
|
395
396
|
]),
|
|
396
|
-
t.disabled ?
|
|
397
|
+
t.disabled ? h("", !0) : (s(), o("button", {
|
|
397
398
|
key: 0,
|
|
398
|
-
onClick: F(
|
|
399
|
+
onClick: F(T, ["stop"]),
|
|
399
400
|
class: "ml-3 text-gray-400 hover:text-danger-500 transition-colors"
|
|
400
401
|
}, [...j[3] || (j[3] = [
|
|
401
402
|
l("svg", {
|
|
@@ -410,16 +411,73 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
410
411
|
})
|
|
411
412
|
], -1)
|
|
412
413
|
])]))
|
|
413
|
-
])) :
|
|
414
|
-
t.helperText ? (s(), o("p",
|
|
415
|
-
|
|
414
|
+
])) : h("", !0),
|
|
415
|
+
t.helperText ? (s(), o("p", Le, w(t.helperText), 1)) : h("", !0),
|
|
416
|
+
a.value ? (s(), o("p", Oe, w(a.value), 1)) : h("", !0)
|
|
416
417
|
])
|
|
417
418
|
], 34));
|
|
418
419
|
}
|
|
419
|
-
}),
|
|
420
|
+
}), De = /* @__PURE__ */ O({
|
|
421
|
+
__name: "Icon",
|
|
422
|
+
props: {
|
|
423
|
+
name: {},
|
|
424
|
+
size: { default: "md" },
|
|
425
|
+
color: { default: "currentColor" },
|
|
426
|
+
variant: { default: "filled" },
|
|
427
|
+
rotate: { default: 0 },
|
|
428
|
+
spin: { type: Boolean, default: !1 },
|
|
429
|
+
ariaLabel: {}
|
|
430
|
+
},
|
|
431
|
+
setup(t) {
|
|
432
|
+
const u = t, e = {
|
|
433
|
+
xs: "16px",
|
|
434
|
+
sm: "18px",
|
|
435
|
+
md: "20px",
|
|
436
|
+
lg: "24px",
|
|
437
|
+
xl: "30px",
|
|
438
|
+
"2xl": "36px"
|
|
439
|
+
}, d = (a, g) => {
|
|
440
|
+
const v = a.replace(/_/g, "-");
|
|
441
|
+
switch (g) {
|
|
442
|
+
case "filled":
|
|
443
|
+
return `material-symbols:${v}`;
|
|
444
|
+
case "outlined":
|
|
445
|
+
return `ic:outline-${v}`;
|
|
446
|
+
case "rounded":
|
|
447
|
+
return `ic:round-${v}`;
|
|
448
|
+
case "sharp":
|
|
449
|
+
return `ic:sharp-${v}`;
|
|
450
|
+
case "two-tone":
|
|
451
|
+
return `ic:twotone-${v}`;
|
|
452
|
+
default:
|
|
453
|
+
return `material-symbols:${v}`;
|
|
454
|
+
}
|
|
455
|
+
}, r = c(() => d(u.name, u.variant)), i = c(() => {
|
|
456
|
+
const a = [
|
|
457
|
+
"inline-flex items-center justify-center select-none",
|
|
458
|
+
"transition-transform duration-200"
|
|
459
|
+
];
|
|
460
|
+
return u.color && (u.color.startsWith("text-") || u.color.startsWith("fill-")) && a.push(u.color), u.spin && a.push("animate-spin"), a.join(" ");
|
|
461
|
+
}), p = c(() => {
|
|
462
|
+
const a = {};
|
|
463
|
+
if (e[u.size] ? (a.fontSize = e[u.size], a.width = e[u.size], a.height = e[u.size]) : (a.fontSize = u.size, a.width = u.size, a.height = u.size), u.color && !u.color.startsWith("text-") && !u.color.startsWith("fill-") && (a.color = u.color), u.rotate !== 0) {
|
|
464
|
+
const g = `rotate(${u.rotate}deg)`;
|
|
465
|
+
a.transform = g;
|
|
466
|
+
}
|
|
467
|
+
return a;
|
|
468
|
+
});
|
|
469
|
+
return (a, g) => (s(), q(ee(ae), {
|
|
470
|
+
icon: r.value,
|
|
471
|
+
class: x(i.value),
|
|
472
|
+
style: R(p.value),
|
|
473
|
+
"aria-label": t.ariaLabel,
|
|
474
|
+
role: t.ariaLabel ? "img" : void 0
|
|
475
|
+
}, null, 8, ["icon", "class", "style", "aria-label", "role"]));
|
|
476
|
+
}
|
|
477
|
+
}), us = /* @__PURE__ */ N(De, [["__scopeId", "data-v-5f982e5c"]]), Ae = ["stroke-width"], Pe = {
|
|
420
478
|
class: "w-full h-full rounded-lg overflow-hidden",
|
|
421
479
|
style: { "background-color": "#f7f7f7" }
|
|
422
|
-
},
|
|
480
|
+
}, Ee = /* @__PURE__ */ O({
|
|
423
481
|
__name: "Loader",
|
|
424
482
|
props: {
|
|
425
483
|
type: { default: "circular" },
|
|
@@ -430,24 +488,24 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
430
488
|
progress: { default: void 0 }
|
|
431
489
|
},
|
|
432
490
|
setup(t) {
|
|
433
|
-
const
|
|
491
|
+
const u = t, e = {
|
|
434
492
|
primary: "text-primary-700",
|
|
435
493
|
secondary: "text-secondary-500",
|
|
436
494
|
success: "text-success-500",
|
|
437
495
|
warning: "text-warning-500",
|
|
438
496
|
danger: "text-danger-500",
|
|
439
497
|
info: "text-info-500"
|
|
440
|
-
},
|
|
498
|
+
}, d = {
|
|
441
499
|
primary: "bg-primary-700",
|
|
442
500
|
secondary: "bg-secondary-500",
|
|
443
501
|
success: "bg-success-500",
|
|
444
502
|
warning: "bg-warning-500",
|
|
445
503
|
danger: "bg-danger-500",
|
|
446
504
|
info: "bg-info-500"
|
|
447
|
-
},
|
|
448
|
-
return (
|
|
505
|
+
}, r = c(() => [e[u.color]]), i = c(() => [d[u.color]]);
|
|
506
|
+
return (p, a) => t.type === "circular" ? (s(), o("div", {
|
|
449
507
|
key: 0,
|
|
450
|
-
class:
|
|
508
|
+
class: x(r.value)
|
|
451
509
|
}, [
|
|
452
510
|
(s(), o("svg", {
|
|
453
511
|
class: "animate-spin",
|
|
@@ -462,8 +520,8 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
462
520
|
stroke: "currentColor",
|
|
463
521
|
"stroke-width": t.strokeWidth,
|
|
464
522
|
fill: "none"
|
|
465
|
-
}, null, 8,
|
|
466
|
-
|
|
523
|
+
}, null, 8, Ae),
|
|
524
|
+
a[0] || (a[0] = l("path", {
|
|
467
525
|
class: "opacity-75",
|
|
468
526
|
fill: "currentColor",
|
|
469
527
|
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"
|
|
@@ -474,30 +532,30 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
474
532
|
class: "w-full",
|
|
475
533
|
style: R({ height: t.height })
|
|
476
534
|
}, [
|
|
477
|
-
l("div",
|
|
535
|
+
l("div", Pe, [
|
|
478
536
|
l("div", {
|
|
479
|
-
class:
|
|
537
|
+
class: x([i.value, "h-full rounded-lg animate-linear-loader"]),
|
|
480
538
|
style: R({ width: t.progress ? `${t.progress}%` : void 0 })
|
|
481
539
|
}, null, 6)
|
|
482
540
|
])
|
|
483
|
-
], 4)) :
|
|
541
|
+
], 4)) : h("", !0);
|
|
484
542
|
}
|
|
485
|
-
}),
|
|
543
|
+
}), cs = /* @__PURE__ */ N(Ee, [["__scopeId", "data-v-8df4ec38"]]), He = ["disabled", "aria-expanded"], We = ["disabled", "onClick"], Ne = {
|
|
486
544
|
key: 0,
|
|
487
545
|
class: "flex-shrink-0"
|
|
488
|
-
},
|
|
546
|
+
}, Fe = ["innerHTML"], Re = { class: "flex-1 min-w-0 mr-2" }, Ke = { class: "flex flex-col items-start" }, qe = ["title"], Ue = ["title"], Ge = {
|
|
489
547
|
key: 1,
|
|
490
548
|
class: "flex-shrink-0"
|
|
491
|
-
},
|
|
549
|
+
}, Qe = {
|
|
492
550
|
key: 0,
|
|
493
551
|
class: "text-xs text-secondary-400 font-mono whitespace-nowrap"
|
|
494
|
-
},
|
|
552
|
+
}, Ze = { key: 1 }, Je = {
|
|
495
553
|
key: 2,
|
|
496
554
|
class: "w-4 h-4 ml-2 flex-shrink-0",
|
|
497
555
|
fill: "none",
|
|
498
556
|
stroke: "currentColor",
|
|
499
557
|
viewBox: "0 0 24 24"
|
|
500
|
-
},
|
|
558
|
+
}, Xe = /* @__PURE__ */ O({
|
|
501
559
|
__name: "Menu",
|
|
502
560
|
props: {
|
|
503
561
|
items: { default: () => [] },
|
|
@@ -516,174 +574,175 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
516
574
|
zIndex: { default: 50 }
|
|
517
575
|
},
|
|
518
576
|
emits: ["open", "close", "select"],
|
|
519
|
-
setup(t, { emit:
|
|
520
|
-
const e = t,
|
|
577
|
+
setup(t, { emit: u }) {
|
|
578
|
+
const e = t, d = u, r = E(!1), i = E(null), p = E(null), a = E({}), g = c(() => [
|
|
521
579
|
"inline-flex items-center justify-center px-4 py-2 text-sm font-medium",
|
|
522
|
-
"bg-white border border-secondary-300 rounded-md",
|
|
523
|
-
"hover:bg-secondary-
|
|
580
|
+
"bg-white border border-secondary-300 rounded-md text-secondary-700",
|
|
581
|
+
"hover:bg-secondary-100 hover:text-secondary-900 hover:border-secondary-400",
|
|
582
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
524
583
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
525
|
-
"transition-
|
|
526
|
-
].join(" ")),
|
|
584
|
+
"transition-all duration-200"
|
|
585
|
+
].join(" ")), v = c(() => [...[
|
|
527
586
|
"fixed bg-white rounded-lg shadow-lg border border-secondary-200",
|
|
528
587
|
"flex flex-col",
|
|
529
588
|
"focus:outline-none"
|
|
530
|
-
], `z-${e.zIndex}`].join(" ")), y =
|
|
531
|
-
const
|
|
532
|
-
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
533
|
-
"transition-
|
|
589
|
+
], `z-${e.zIndex}`].join(" ")), y = c(() => "px-4 py-3 border-b border-secondary-200 bg-secondary-50"), f = c(() => "px-4 py-3 border-t border-secondary-200 bg-secondary-50"), _ = c(() => "py-1 overflow-y-auto flex-1 min-h-0"), C = c(() => "my-1 border-t border-secondary-200"), I = c(() => "px-4 py-2 text-xs font-semibold text-secondary-500 uppercase tracking-wider"), V = (n) => {
|
|
590
|
+
const M = [
|
|
591
|
+
"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left",
|
|
592
|
+
"transition-all duration-150 focus:outline-none cursor-pointer",
|
|
534
593
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
535
|
-
], m =
|
|
536
|
-
default: "text-secondary-700 hover:bg-secondary-
|
|
537
|
-
danger: "text-danger-600 hover:bg-danger-
|
|
538
|
-
success: "text-success-600 hover:bg-success-
|
|
539
|
-
warning: "text-warning-600 hover:bg-warning-
|
|
594
|
+
], m = n.variant || "default", K = {
|
|
595
|
+
default: "text-secondary-700 hover:bg-secondary-100 hover:text-secondary-900 focus:bg-secondary-100",
|
|
596
|
+
danger: "text-danger-600 hover:bg-danger-100 hover:text-danger-700 focus:bg-danger-100",
|
|
597
|
+
success: "text-success-600 hover:bg-success-100 hover:text-success-700 focus:bg-success-100",
|
|
598
|
+
warning: "text-warning-600 hover:bg-warning-100 hover:text-warning-700 focus:bg-warning-100"
|
|
540
599
|
};
|
|
541
|
-
let
|
|
542
|
-
return
|
|
543
|
-
},
|
|
544
|
-
e.disabled || (
|
|
545
|
-
},
|
|
546
|
-
|
|
547
|
-
|
|
600
|
+
let S = "";
|
|
601
|
+
return n.color && (S = n.color, (n.color.includes("white") || n.color.includes("50")) && (S += " hover:text-black")), [...M, S || K[m]].join(" ");
|
|
602
|
+
}, T = () => {
|
|
603
|
+
e.disabled || (r.value ? k() : b());
|
|
604
|
+
}, b = () => {
|
|
605
|
+
r.value = !0, d("open"), Z(() => {
|
|
606
|
+
z(), document.addEventListener("click", L), document.addEventListener("keydown", H);
|
|
548
607
|
});
|
|
549
608
|
}, k = () => {
|
|
550
|
-
|
|
551
|
-
}, j = (
|
|
552
|
-
|
|
553
|
-
},
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
}, H = (
|
|
557
|
-
|
|
558
|
-
}, $ = (
|
|
559
|
-
(
|
|
560
|
-
},
|
|
561
|
-
if (!
|
|
562
|
-
const
|
|
563
|
-
let
|
|
609
|
+
r.value = !1, d("close"), document.removeEventListener("click", L), document.removeEventListener("keydown", H);
|
|
610
|
+
}, j = (n) => {
|
|
611
|
+
n.disabled || (n.action && n.action(), d("select", n), e.closeOnClick && !n.children && k());
|
|
612
|
+
}, L = (n) => {
|
|
613
|
+
const M = n.target;
|
|
614
|
+
i.value && !i.value.contains(M) && p.value && !p.value.contains(M) && k();
|
|
615
|
+
}, H = (n) => {
|
|
616
|
+
n.key === "Escape" && k();
|
|
617
|
+
}, $ = (n) => {
|
|
618
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), T());
|
|
619
|
+
}, z = () => {
|
|
620
|
+
if (!i.value || !p.value) return;
|
|
621
|
+
const n = i.value.getBoundingClientRect(), M = p.value.getBoundingClientRect(), m = window.innerWidth, K = window.innerHeight;
|
|
622
|
+
let S = 0, D = 0;
|
|
564
623
|
switch (e.position) {
|
|
565
624
|
case "bottom-start":
|
|
566
|
-
|
|
625
|
+
S = n.bottom + e.offset.y, D = n.left + e.offset.x;
|
|
567
626
|
break;
|
|
568
627
|
case "bottom-end":
|
|
569
|
-
|
|
628
|
+
S = n.bottom + e.offset.y, D = n.right - M.width + e.offset.x;
|
|
570
629
|
break;
|
|
571
630
|
case "top-start":
|
|
572
|
-
|
|
631
|
+
S = n.top - M.height - e.offset.y, D = n.left + e.offset.x;
|
|
573
632
|
break;
|
|
574
633
|
case "top-end":
|
|
575
|
-
|
|
634
|
+
S = n.top - M.height - e.offset.y, D = n.right - M.width + e.offset.x;
|
|
576
635
|
break;
|
|
577
636
|
case "right-start":
|
|
578
|
-
|
|
637
|
+
S = n.top + e.offset.y, D = n.right + e.offset.x;
|
|
579
638
|
break;
|
|
580
639
|
case "right-end":
|
|
581
|
-
|
|
640
|
+
S = n.bottom - M.height + e.offset.y, D = n.right + e.offset.x;
|
|
582
641
|
break;
|
|
583
642
|
case "left-start":
|
|
584
|
-
|
|
643
|
+
S = n.top + e.offset.y, D = n.left - M.width - e.offset.x;
|
|
585
644
|
break;
|
|
586
645
|
case "left-end":
|
|
587
|
-
|
|
646
|
+
S = n.bottom - M.height + e.offset.y, D = n.left - M.width - e.offset.x;
|
|
588
647
|
break;
|
|
589
648
|
}
|
|
590
|
-
D +
|
|
591
|
-
top: `${
|
|
649
|
+
D + M.width > m && (D = m - M.width - 8), D < 8 && (D = 8), S + M.height > K && (S = K - M.height - 8), S < 8 && (S = 8), a.value = {
|
|
650
|
+
top: `${S}px`,
|
|
592
651
|
left: `${D}px`,
|
|
593
|
-
width: e.width === "auto" ? `${Math.max(
|
|
652
|
+
width: e.width === "auto" ? `${Math.max(n.width, 240)}px` : e.width,
|
|
594
653
|
maxHeight: e.maxHeight,
|
|
595
654
|
minWidth: "240px"
|
|
596
655
|
};
|
|
597
656
|
};
|
|
598
|
-
return
|
|
599
|
-
window.addEventListener("scroll",
|
|
600
|
-
}),
|
|
601
|
-
window.removeEventListener("scroll",
|
|
657
|
+
return te(() => {
|
|
658
|
+
window.addEventListener("scroll", z, !0), window.addEventListener("resize", z);
|
|
659
|
+
}), se(() => {
|
|
660
|
+
window.removeEventListener("scroll", z, !0), window.removeEventListener("resize", z), document.removeEventListener("click", L), document.removeEventListener("keydown", H);
|
|
602
661
|
}), X(() => e.items, () => {
|
|
603
|
-
|
|
604
|
-
}, { deep: !0 }), (
|
|
605
|
-
class:
|
|
662
|
+
r.value && Z(z);
|
|
663
|
+
}, { deep: !0 }), (n, M) => (s(), o("div", {
|
|
664
|
+
class: x(["menu-wrapper", { "w-full": t.fullWidth }])
|
|
606
665
|
}, [
|
|
607
666
|
l("div", {
|
|
608
667
|
ref_key: "triggerRef",
|
|
609
|
-
ref:
|
|
668
|
+
ref: i
|
|
610
669
|
}, [
|
|
611
|
-
B(
|
|
612
|
-
isOpen:
|
|
613
|
-
toggle:
|
|
670
|
+
B(n.$slots, "trigger", {
|
|
671
|
+
isOpen: r.value,
|
|
672
|
+
toggle: T
|
|
614
673
|
}, () => [
|
|
615
674
|
l("button", {
|
|
616
675
|
type: "button",
|
|
617
|
-
class:
|
|
676
|
+
class: x(g.value),
|
|
618
677
|
disabled: t.disabled,
|
|
619
|
-
onClick:
|
|
678
|
+
onClick: T,
|
|
620
679
|
onKeydown: $,
|
|
621
680
|
tabindex: 0,
|
|
622
681
|
role: "button",
|
|
623
|
-
"aria-expanded":
|
|
682
|
+
"aria-expanded": r.value,
|
|
624
683
|
"aria-haspopup": !0
|
|
625
684
|
}, [
|
|
626
|
-
B(
|
|
627
|
-
|
|
685
|
+
B(n.$slots, "trigger-content", {}, () => [
|
|
686
|
+
P(w(t.triggerText), 1)
|
|
628
687
|
], !0),
|
|
629
688
|
t.showChevron ? (s(), o("svg", {
|
|
630
689
|
key: 0,
|
|
631
|
-
class:
|
|
690
|
+
class: x(["w-4 h-4 ml-2 transition-transform", r.value ? "rotate-180" : ""]),
|
|
632
691
|
fill: "none",
|
|
633
692
|
stroke: "currentColor",
|
|
634
693
|
viewBox: "0 0 24 24"
|
|
635
|
-
}, [...
|
|
694
|
+
}, [...M[1] || (M[1] = [
|
|
636
695
|
l("path", {
|
|
637
696
|
"stroke-linecap": "round",
|
|
638
697
|
"stroke-linejoin": "round",
|
|
639
698
|
"stroke-width": "2",
|
|
640
699
|
d: "M19 9l-7 7-7-7"
|
|
641
700
|
}, null, -1)
|
|
642
|
-
])], 2)) :
|
|
643
|
-
], 42,
|
|
701
|
+
])], 2)) : h("", !0)
|
|
702
|
+
], 42, He)
|
|
644
703
|
], !0)
|
|
645
704
|
], 512),
|
|
646
705
|
(s(), q(J, { to: "body" }, [
|
|
647
|
-
|
|
706
|
+
r.value ? (s(), o("div", {
|
|
648
707
|
key: 0,
|
|
649
708
|
ref_key: "menuRef",
|
|
650
|
-
ref:
|
|
651
|
-
class:
|
|
652
|
-
style: R(
|
|
653
|
-
onClick:
|
|
709
|
+
ref: p,
|
|
710
|
+
class: x(v.value),
|
|
711
|
+
style: R(a.value),
|
|
712
|
+
onClick: M[0] || (M[0] = F(() => {
|
|
654
713
|
}, ["stop"]))
|
|
655
714
|
}, [
|
|
656
|
-
|
|
715
|
+
n.$slots.header ? (s(), o("div", {
|
|
657
716
|
key: 0,
|
|
658
|
-
class:
|
|
717
|
+
class: x(y.value)
|
|
659
718
|
}, [
|
|
660
|
-
B(
|
|
661
|
-
], 2)) :
|
|
719
|
+
B(n.$slots, "header", { close: k }, void 0, !0)
|
|
720
|
+
], 2)) : h("", !0),
|
|
662
721
|
l("div", {
|
|
663
|
-
class:
|
|
722
|
+
class: x(_.value)
|
|
664
723
|
}, [
|
|
665
|
-
B(
|
|
724
|
+
B(n.$slots, "default", {
|
|
666
725
|
close: k,
|
|
667
|
-
isOpen:
|
|
726
|
+
isOpen: r.value
|
|
668
727
|
}, () => [
|
|
669
728
|
(s(!0), o(A, null, W(t.items, (m, K) => (s(), o(A, {
|
|
670
729
|
key: m.id || K
|
|
671
730
|
}, [
|
|
672
731
|
m.type === "divider" ? (s(), o("div", {
|
|
673
732
|
key: 0,
|
|
674
|
-
class:
|
|
733
|
+
class: x(C.value)
|
|
675
734
|
}, null, 2)) : m.type === "header" ? (s(), o("div", {
|
|
676
735
|
key: 1,
|
|
677
|
-
class:
|
|
736
|
+
class: x(I.value)
|
|
678
737
|
}, w(m.label), 3)) : (s(), o("button", {
|
|
679
738
|
key: 2,
|
|
680
739
|
type: "button",
|
|
681
|
-
class:
|
|
740
|
+
class: x(V(m)),
|
|
682
741
|
disabled: m.disabled,
|
|
683
|
-
onClick: (
|
|
742
|
+
onClick: (S) => j(m)
|
|
684
743
|
}, [
|
|
685
|
-
m.icon ||
|
|
686
|
-
B(
|
|
744
|
+
m.icon || n.$slots[`icon-${m.id}`] ? (s(), o("span", Ne, [
|
|
745
|
+
B(n.$slots, `icon-${m.id}`, { item: m }, () => [
|
|
687
746
|
typeof m.icon != "string" ? (s(), q(Y(m.icon), {
|
|
688
747
|
key: 0,
|
|
689
748
|
class: "w-5 h-5"
|
|
@@ -691,85 +750,85 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
691
750
|
key: 1,
|
|
692
751
|
innerHTML: m.icon,
|
|
693
752
|
class: "w-5 h-5 inline-block"
|
|
694
|
-
}, null, 8,
|
|
753
|
+
}, null, 8, Fe))
|
|
695
754
|
], !0)
|
|
696
|
-
])) :
|
|
697
|
-
l("div",
|
|
698
|
-
B(
|
|
755
|
+
])) : h("", !0),
|
|
756
|
+
l("div", Re, [
|
|
757
|
+
B(n.$slots, `item-${m.id}`, {
|
|
699
758
|
item: m,
|
|
700
759
|
close: k
|
|
701
760
|
}, () => [
|
|
702
|
-
l("div",
|
|
761
|
+
l("div", Ke, [
|
|
703
762
|
l("span", {
|
|
704
763
|
class: "truncate w-full",
|
|
705
764
|
title: m.label
|
|
706
|
-
}, w(m.label), 9,
|
|
765
|
+
}, w(m.label), 9, qe),
|
|
707
766
|
m.description ? (s(), o("span", {
|
|
708
767
|
key: 0,
|
|
709
768
|
class: "text-xs text-secondary-500 truncate w-full",
|
|
710
769
|
title: m.description
|
|
711
|
-
}, w(m.description), 9,
|
|
770
|
+
}, w(m.description), 9, Ue)) : h("", !0)
|
|
712
771
|
])
|
|
713
772
|
], !0)
|
|
714
773
|
]),
|
|
715
|
-
m.suffix || m.shortcut ||
|
|
716
|
-
B(
|
|
717
|
-
m.shortcut ? (s(), o("span",
|
|
774
|
+
m.suffix || m.shortcut || n.$slots[`suffix-${m.id}`] ? (s(), o("span", Ge, [
|
|
775
|
+
B(n.$slots, `suffix-${m.id}`, { item: m }, () => [
|
|
776
|
+
m.shortcut ? (s(), o("span", Qe, w(m.shortcut), 1)) : m.suffix ? (s(), o("span", Ze, w(m.suffix), 1)) : h("", !0)
|
|
718
777
|
], !0)
|
|
719
|
-
])) :
|
|
720
|
-
m.children && m.children.length > 0 ? (s(), o("svg",
|
|
778
|
+
])) : h("", !0),
|
|
779
|
+
m.children && m.children.length > 0 ? (s(), o("svg", Je, [...M[2] || (M[2] = [
|
|
721
780
|
l("path", {
|
|
722
781
|
"stroke-linecap": "round",
|
|
723
782
|
"stroke-linejoin": "round",
|
|
724
783
|
"stroke-width": "2",
|
|
725
784
|
d: "M9 5l7 7-7 7"
|
|
726
785
|
}, null, -1)
|
|
727
|
-
])])) :
|
|
728
|
-
], 10,
|
|
786
|
+
])])) : h("", !0)
|
|
787
|
+
], 10, We))
|
|
729
788
|
], 64))), 128))
|
|
730
789
|
], !0)
|
|
731
790
|
], 2),
|
|
732
|
-
|
|
791
|
+
n.$slots.footer ? (s(), o("div", {
|
|
733
792
|
key: 1,
|
|
734
|
-
class:
|
|
793
|
+
class: x(f.value)
|
|
735
794
|
}, [
|
|
736
|
-
B(
|
|
737
|
-
], 2)) :
|
|
738
|
-
], 6)) :
|
|
739
|
-
|
|
795
|
+
B(n.$slots, "footer", { close: k }, void 0, !0)
|
|
796
|
+
], 2)) : h("", !0)
|
|
797
|
+
], 6)) : h("", !0),
|
|
798
|
+
r.value && t.overlay ? (s(), o("div", {
|
|
740
799
|
key: 1,
|
|
741
800
|
class: "fixed inset-0 bg-black/20 z-40",
|
|
742
801
|
onClick: k
|
|
743
|
-
})) :
|
|
802
|
+
})) : h("", !0)
|
|
744
803
|
]))
|
|
745
804
|
], 2));
|
|
746
805
|
}
|
|
747
|
-
}),
|
|
806
|
+
}), fs = /* @__PURE__ */ N(Xe, [["__scopeId", "data-v-61176297"]]), Ye = ["for"], et = {
|
|
748
807
|
key: 0,
|
|
749
808
|
class: "text-danger-600"
|
|
750
|
-
},
|
|
809
|
+
}, tt = { class: "relative" }, st = ["id", "disabled", "aria-expanded"], ot = { class: "flex-1 text-left truncate" }, lt = {
|
|
751
810
|
key: 0,
|
|
752
811
|
class: "p-2 border-b border-secondary-200"
|
|
753
|
-
},
|
|
812
|
+
}, at = ["placeholder"], nt = { class: "max-h-64 overflow-y-auto" }, rt = {
|
|
754
813
|
key: 0,
|
|
755
814
|
class: "px-4 py-3 text-sm text-secondary-500 text-center"
|
|
756
|
-
},
|
|
815
|
+
}, it = ["onClick"], dt = { class: "flex items-center justify-between w-full" }, ut = { class: "truncate" }, ct = {
|
|
757
816
|
key: 0,
|
|
758
817
|
class: "w-5 h-5 text-primary-600 flex-shrink-0 ml-2",
|
|
759
818
|
fill: "none",
|
|
760
819
|
stroke: "currentColor",
|
|
761
820
|
viewBox: "0 0 24 24",
|
|
762
821
|
xmlns: "http://www.w3.org/2000/svg"
|
|
763
|
-
},
|
|
822
|
+
}, ft = {
|
|
764
823
|
key: 0,
|
|
765
824
|
class: "border-t border-secondary-200 my-1"
|
|
766
|
-
},
|
|
825
|
+
}, pt = ["onClick"], vt = ["innerHTML"], gt = {
|
|
767
826
|
key: 1,
|
|
768
827
|
class: "mt-1 text-sm text-danger-600"
|
|
769
|
-
},
|
|
828
|
+
}, xt = {
|
|
770
829
|
key: 2,
|
|
771
830
|
class: "mt-1 text-sm text-secondary-600"
|
|
772
|
-
},
|
|
831
|
+
}, ht = /* @__PURE__ */ O({
|
|
773
832
|
__name: "Select",
|
|
774
833
|
props: {
|
|
775
834
|
modelValue: { default: null },
|
|
@@ -790,88 +849,88 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
790
849
|
menuPosition: { default: "bottom" }
|
|
791
850
|
},
|
|
792
851
|
emits: ["update:modelValue", "change", "action"],
|
|
793
|
-
setup(t, { emit:
|
|
794
|
-
const e = t,
|
|
852
|
+
setup(t, { emit: u }) {
|
|
853
|
+
const e = t, d = u, r = E(!1), i = E(""), p = E(null), a = c(
|
|
795
854
|
() => `select-${Math.random().toString(36).substr(2, 9)}`
|
|
796
|
-
),
|
|
797
|
-
if (!e.searchable || !
|
|
855
|
+
), g = c(() => e.options.find(($) => $.value === e.modelValue) || null), v = c(() => {
|
|
856
|
+
if (!e.searchable || !i.value)
|
|
798
857
|
return e.options;
|
|
799
|
-
const $ =
|
|
800
|
-
return e.options.filter((
|
|
801
|
-
}), y =
|
|
802
|
-
const $ = "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",
|
|
858
|
+
const $ = i.value.toLowerCase();
|
|
859
|
+
return e.options.filter((z) => z.label.toLowerCase().includes($));
|
|
860
|
+
}), y = c(() => "block text-sm font-semibold text-secondary-700 mb-1"), f = c(() => {
|
|
861
|
+
const $ = "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", z = {
|
|
803
862
|
sm: "px-3 py-1.5 text-sm",
|
|
804
863
|
md: "px-4 py-2 text-base",
|
|
805
864
|
lg: "px-5 py-3 text-lg"
|
|
806
|
-
},
|
|
865
|
+
}, n = {
|
|
807
866
|
default: "bg-white border-secondary-300 hover:border-secondary-400",
|
|
808
867
|
outline: "bg-transparent border-secondary-300 hover:border-primary-500",
|
|
809
868
|
filled: "bg-secondary-100 border-transparent hover:bg-secondary-200"
|
|
810
|
-
},
|
|
869
|
+
}, M = e.error ? "border-danger-600 focus:ring-danger-500" : "";
|
|
811
870
|
return [
|
|
812
871
|
$,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
872
|
+
z[e.size],
|
|
873
|
+
n[e.variant],
|
|
874
|
+
M
|
|
816
875
|
].join(" ");
|
|
817
|
-
}), _ =
|
|
818
|
-
const
|
|
819
|
-
return [
|
|
820
|
-
},
|
|
821
|
-
const
|
|
822
|
-
return $.variant === "danger" ? `${
|
|
823
|
-
}, V = ($) => $.value === e.modelValue,
|
|
824
|
-
e.disabled || (
|
|
876
|
+
}), _ = c(() => `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`), C = ($) => {
|
|
877
|
+
const z = "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", n = V($) ? "bg-primary-50" : "";
|
|
878
|
+
return [z, n].join(" ");
|
|
879
|
+
}, I = ($) => {
|
|
880
|
+
const z = "w-full px-4 py-2 text-left text-sm font-semibold transition-colors focus:outline-none flex items-center gap-3";
|
|
881
|
+
return $.variant === "danger" ? `${z} text-danger-600 hover:bg-danger-50 focus:bg-danger-50` : `${z} text-secondary-700 hover:bg-secondary-50 focus:bg-secondary-50`;
|
|
882
|
+
}, V = ($) => $.value === e.modelValue, T = () => {
|
|
883
|
+
e.disabled || (r.value = !r.value, r.value && e.searchable && Z(() => {
|
|
825
884
|
var $;
|
|
826
|
-
($ =
|
|
885
|
+
($ = p.value) == null || $.focus();
|
|
827
886
|
}));
|
|
828
|
-
},
|
|
829
|
-
|
|
887
|
+
}, b = () => {
|
|
888
|
+
r.value = !1, i.value = "";
|
|
830
889
|
}, k = ($) => {
|
|
831
|
-
$.disabled || (
|
|
890
|
+
$.disabled || (d("update:modelValue", $.value), d("change", $), b());
|
|
832
891
|
}, j = ($) => {
|
|
833
|
-
$.action && $.action(),
|
|
834
|
-
},
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
892
|
+
$.action && $.action(), d("action", $), b();
|
|
893
|
+
}, L = ($) => {
|
|
894
|
+
const z = $.relatedTarget;
|
|
895
|
+
z && z.closest(".select-wrapper") || setTimeout(() => {
|
|
896
|
+
b();
|
|
838
897
|
}, 200);
|
|
839
898
|
}, H = ($) => {
|
|
840
|
-
$.key === "Escape" ?
|
|
899
|
+
$.key === "Escape" ? b() : ($.key === "Enter" || $.key === " ") && ($.preventDefault(), T());
|
|
841
900
|
};
|
|
842
|
-
return X(
|
|
843
|
-
$ && (
|
|
844
|
-
}), ($,
|
|
845
|
-
class:
|
|
901
|
+
return X(r, ($) => {
|
|
902
|
+
$ && (i.value = "");
|
|
903
|
+
}), ($, z) => (s(), o("div", {
|
|
904
|
+
class: x(["select-wrapper", { "w-full": t.fullWidth }])
|
|
846
905
|
}, [
|
|
847
906
|
t.label ? (s(), o("label", {
|
|
848
907
|
key: 0,
|
|
849
|
-
for:
|
|
850
|
-
class:
|
|
908
|
+
for: a.value,
|
|
909
|
+
class: x(y.value)
|
|
851
910
|
}, [
|
|
852
|
-
|
|
853
|
-
t.required ? (s(), o("span",
|
|
854
|
-
], 10,
|
|
855
|
-
l("div",
|
|
911
|
+
P(w(t.label) + " ", 1),
|
|
912
|
+
t.required ? (s(), o("span", et, "*")) : h("", !0)
|
|
913
|
+
], 10, Ye)) : h("", !0),
|
|
914
|
+
l("div", tt, [
|
|
856
915
|
l("button", {
|
|
857
|
-
id:
|
|
916
|
+
id: a.value,
|
|
858
917
|
type: "button",
|
|
859
|
-
class:
|
|
918
|
+
class: x(f.value),
|
|
860
919
|
disabled: t.disabled,
|
|
861
|
-
"aria-expanded":
|
|
920
|
+
"aria-expanded": r.value,
|
|
862
921
|
"aria-haspopup": !0,
|
|
863
|
-
onClick:
|
|
864
|
-
onBlur:
|
|
922
|
+
onClick: T,
|
|
923
|
+
onBlur: L,
|
|
865
924
|
onKeydown: H
|
|
866
925
|
}, [
|
|
867
|
-
l("span",
|
|
926
|
+
l("span", ot, w(g.value ? g.value.label : t.placeholder), 1),
|
|
868
927
|
(s(), o("svg", {
|
|
869
|
-
class:
|
|
928
|
+
class: x(["w-5 h-5 flex-shrink-0 transition-transform text-secondary-600", r.value ? "rotate-180" : ""]),
|
|
870
929
|
fill: "none",
|
|
871
930
|
stroke: "currentColor",
|
|
872
931
|
viewBox: "0 0 24 24",
|
|
873
932
|
xmlns: "http://www.w3.org/2000/svg"
|
|
874
|
-
}, [...
|
|
933
|
+
}, [...z[3] || (z[3] = [
|
|
875
934
|
l("path", {
|
|
876
935
|
"stroke-linecap": "round",
|
|
877
936
|
"stroke-linejoin": "round",
|
|
@@ -879,78 +938,78 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
879
938
|
d: "M19 9l-7 7-7-7"
|
|
880
939
|
}, null, -1)
|
|
881
940
|
])], 2))
|
|
882
|
-
], 42,
|
|
883
|
-
|
|
941
|
+
], 42, st),
|
|
942
|
+
r.value ? (s(), o("div", {
|
|
884
943
|
key: 0,
|
|
885
|
-
class:
|
|
886
|
-
onClick:
|
|
944
|
+
class: x(_.value),
|
|
945
|
+
onClick: z[2] || (z[2] = F(() => {
|
|
887
946
|
}, ["stop"]))
|
|
888
947
|
}, [
|
|
889
|
-
t.searchable ? (s(), o("div",
|
|
890
|
-
|
|
948
|
+
t.searchable ? (s(), o("div", lt, [
|
|
949
|
+
oe(l("input", {
|
|
891
950
|
ref_key: "searchInput",
|
|
892
|
-
ref:
|
|
893
|
-
"onUpdate:modelValue":
|
|
951
|
+
ref: p,
|
|
952
|
+
"onUpdate:modelValue": z[0] || (z[0] = (n) => i.value = n),
|
|
894
953
|
type: "text",
|
|
895
954
|
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",
|
|
896
955
|
placeholder: t.searchPlaceholder,
|
|
897
|
-
onKeydown:
|
|
956
|
+
onKeydown: z[1] || (z[1] = F(() => {
|
|
898
957
|
}, ["stop"]))
|
|
899
|
-
}, null, 40,
|
|
900
|
-
[
|
|
958
|
+
}, null, 40, at), [
|
|
959
|
+
[le, i.value]
|
|
901
960
|
])
|
|
902
|
-
])) :
|
|
903
|
-
l("div",
|
|
904
|
-
|
|
905
|
-
(s(!0), o(A, null, W(
|
|
906
|
-
key:
|
|
961
|
+
])) : h("", !0),
|
|
962
|
+
l("div", nt, [
|
|
963
|
+
v.value.length === 0 ? (s(), o("div", rt, w(t.emptyText), 1)) : (s(), o(A, { key: 1 }, [
|
|
964
|
+
(s(!0), o(A, null, W(v.value, (n) => (s(), o("button", {
|
|
965
|
+
key: n.value,
|
|
907
966
|
type: "button",
|
|
908
|
-
class:
|
|
909
|
-
onClick: (
|
|
967
|
+
class: x(C(n)),
|
|
968
|
+
onClick: (M) => k(n)
|
|
910
969
|
}, [
|
|
911
|
-
l("div",
|
|
912
|
-
l("span",
|
|
913
|
-
V(
|
|
970
|
+
l("div", dt, [
|
|
971
|
+
l("span", ut, w(n.label), 1),
|
|
972
|
+
V(n) ? (s(), o("svg", ct, [...z[4] || (z[4] = [
|
|
914
973
|
l("path", {
|
|
915
974
|
"stroke-linecap": "round",
|
|
916
975
|
"stroke-linejoin": "round",
|
|
917
976
|
"stroke-width": "2",
|
|
918
977
|
d: "M5 13l4 4L19 7"
|
|
919
978
|
}, null, -1)
|
|
920
|
-
])])) :
|
|
979
|
+
])])) : h("", !0)
|
|
921
980
|
])
|
|
922
|
-
], 10,
|
|
923
|
-
t.actionItems.length > 0 ? (s(), o("div",
|
|
924
|
-
(s(!0), o(A, null, W(t.actionItems, (
|
|
925
|
-
key:
|
|
981
|
+
], 10, it))), 128)),
|
|
982
|
+
t.actionItems.length > 0 ? (s(), o("div", ft)) : h("", !0),
|
|
983
|
+
(s(!0), o(A, null, W(t.actionItems, (n) => (s(), o("button", {
|
|
984
|
+
key: n.id,
|
|
926
985
|
type: "button",
|
|
927
|
-
class:
|
|
928
|
-
onClick: (
|
|
986
|
+
class: x(I(n)),
|
|
987
|
+
onClick: (M) => j(n)
|
|
929
988
|
}, [
|
|
930
|
-
|
|
989
|
+
n.icon ? (s(), o("svg", {
|
|
931
990
|
key: 0,
|
|
932
991
|
class: "w-4 h-4 flex-shrink-0",
|
|
933
992
|
fill: "none",
|
|
934
993
|
stroke: "currentColor",
|
|
935
994
|
viewBox: "0 0 24 24",
|
|
936
995
|
xmlns: "http://www.w3.org/2000/svg",
|
|
937
|
-
innerHTML:
|
|
938
|
-
}, null, 8,
|
|
939
|
-
|
|
940
|
-
], 10,
|
|
996
|
+
innerHTML: n.icon
|
|
997
|
+
}, null, 8, vt)) : h("", !0),
|
|
998
|
+
P(" " + w(n.label), 1)
|
|
999
|
+
], 10, pt))), 128))
|
|
941
1000
|
], 64))
|
|
942
1001
|
])
|
|
943
|
-
], 2)) :
|
|
1002
|
+
], 2)) : h("", !0)
|
|
944
1003
|
]),
|
|
945
|
-
t.error ? (s(), o("p",
|
|
946
|
-
|
|
1004
|
+
t.error ? (s(), o("p", gt, w(t.error), 1)) : t.helperText ? (s(), o("p", xt, w(t.helperText), 1)) : h("", !0),
|
|
1005
|
+
r.value ? (s(), o("div", {
|
|
947
1006
|
key: 3,
|
|
948
|
-
onClick:
|
|
1007
|
+
onClick: b,
|
|
949
1008
|
class: "fixed inset-0 z-40"
|
|
950
|
-
})) :
|
|
1009
|
+
})) : h("", !0)
|
|
951
1010
|
], 2));
|
|
952
1011
|
}
|
|
953
|
-
}),
|
|
1012
|
+
}), ps = /* @__PURE__ */ N(ht, [["__scopeId", "data-v-f016a03c"]]), bt = /* @__PURE__ */ O({
|
|
954
1013
|
__name: "Sidebar",
|
|
955
1014
|
props: {
|
|
956
1015
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -965,58 +1024,58 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
965
1024
|
padding: { default: "md" }
|
|
966
1025
|
},
|
|
967
1026
|
emits: ["update:modelValue", "close", "open"],
|
|
968
|
-
setup(t, { emit:
|
|
969
|
-
const e = t,
|
|
1027
|
+
setup(t, { emit: u }) {
|
|
1028
|
+
const e = t, d = u, r = c({
|
|
970
1029
|
get: () => e.modelValue,
|
|
971
|
-
set: (C) =>
|
|
972
|
-
}),
|
|
973
|
-
e.persistent || (
|
|
974
|
-
},
|
|
975
|
-
const C = "fixed top-0 h-full z-50 flex flex-col w-full max-w-full sm:max-w-none",
|
|
976
|
-
return [C,
|
|
977
|
-
}),
|
|
1030
|
+
set: (C) => d("update:modelValue", C)
|
|
1031
|
+
}), i = () => {
|
|
1032
|
+
e.persistent || (r.value = !1, d("close"));
|
|
1033
|
+
}, p = c(() => e.position === "left" ? "slide-right" : "slide-left"), a = c(() => {
|
|
1034
|
+
const C = "fixed top-0 h-full z-50 flex flex-col w-full max-w-full sm:max-w-none", I = e.position === "left" ? "left-0" : "right-0", V = 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)]" : "";
|
|
1035
|
+
return [C, I, V].filter(Boolean).join(" ");
|
|
1036
|
+
}), g = c(() => ({
|
|
978
1037
|
// Base fluid width; respect custom width as max constraint
|
|
979
1038
|
width: "100%",
|
|
980
1039
|
maxWidth: e.width,
|
|
981
1040
|
backgroundColor: e.backgroundColor,
|
|
982
1041
|
top: e.overlayTop,
|
|
983
1042
|
height: e.overlayTop !== "0" ? `calc(100vh - ${e.overlayTop})` : "100vh"
|
|
984
|
-
})),
|
|
1043
|
+
})), v = {
|
|
985
1044
|
none: "",
|
|
986
1045
|
sm: "p-2",
|
|
987
1046
|
md: "p-4",
|
|
988
1047
|
lg: "p-6"
|
|
989
|
-
}, y =
|
|
990
|
-
return (C,
|
|
1048
|
+
}, y = c(() => `flex items-center justify-between border-b border-gray-200 ${v[e.padding]}`), f = c(() => `flex-1 overflow-y-auto ${v[e.padding]}`), _ = c(() => `border-t border-gray-200 ${v[e.padding]}`);
|
|
1049
|
+
return (C, I) => (s(), q(J, { to: "body" }, [
|
|
991
1050
|
G(Q, { name: "fade" }, {
|
|
992
1051
|
default: U(() => [
|
|
993
|
-
|
|
1052
|
+
r.value && t.overlay ? (s(), o("div", {
|
|
994
1053
|
key: 0,
|
|
995
|
-
onClick:
|
|
1054
|
+
onClick: i,
|
|
996
1055
|
class: "fixed inset-0 bg-black/50 z-40",
|
|
997
1056
|
style: R({ top: t.overlayTop })
|
|
998
|
-
}, null, 4)) :
|
|
1057
|
+
}, null, 4)) : h("", !0)
|
|
999
1058
|
]),
|
|
1000
1059
|
_: 1
|
|
1001
1060
|
}),
|
|
1002
|
-
G(Q, { name:
|
|
1061
|
+
G(Q, { name: p.value }, {
|
|
1003
1062
|
default: U(() => [
|
|
1004
|
-
|
|
1063
|
+
r.value ? (s(), o("aside", {
|
|
1005
1064
|
key: 0,
|
|
1006
|
-
class:
|
|
1007
|
-
style: R(
|
|
1065
|
+
class: x(a.value),
|
|
1066
|
+
style: R(g.value)
|
|
1008
1067
|
}, [
|
|
1009
1068
|
C.$slots.header ? (s(), o("div", {
|
|
1010
1069
|
key: 0,
|
|
1011
|
-
class:
|
|
1070
|
+
class: x(y.value)
|
|
1012
1071
|
}, [
|
|
1013
1072
|
B(C.$slots, "header", {}, void 0, !0),
|
|
1014
1073
|
t.closable ? (s(), o("button", {
|
|
1015
1074
|
key: 0,
|
|
1016
|
-
onClick:
|
|
1075
|
+
onClick: i,
|
|
1017
1076
|
class: "p-2 hover:bg-gray-100 rounded-md transition-colors",
|
|
1018
1077
|
"aria-label": "Cerrar menú"
|
|
1019
|
-
}, [...
|
|
1078
|
+
}, [...I[0] || (I[0] = [
|
|
1020
1079
|
l("svg", {
|
|
1021
1080
|
class: "w-5 h-5",
|
|
1022
1081
|
fill: "none",
|
|
@@ -1030,38 +1089,38 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1030
1089
|
d: "M6 18L18 6M6 6l12 12"
|
|
1031
1090
|
})
|
|
1032
1091
|
], -1)
|
|
1033
|
-
])])) :
|
|
1034
|
-
], 2)) :
|
|
1092
|
+
])])) : h("", !0)
|
|
1093
|
+
], 2)) : h("", !0),
|
|
1035
1094
|
l("div", {
|
|
1036
|
-
class:
|
|
1095
|
+
class: x(f.value)
|
|
1037
1096
|
}, [
|
|
1038
1097
|
B(C.$slots, "default", {}, void 0, !0)
|
|
1039
1098
|
], 2),
|
|
1040
1099
|
C.$slots.footer ? (s(), o("div", {
|
|
1041
1100
|
key: 1,
|
|
1042
|
-
class:
|
|
1101
|
+
class: x(_.value)
|
|
1043
1102
|
}, [
|
|
1044
1103
|
B(C.$slots, "footer", {}, void 0, !0)
|
|
1045
|
-
], 2)) :
|
|
1046
|
-
], 6)) :
|
|
1104
|
+
], 2)) : h("", !0)
|
|
1105
|
+
], 6)) : h("", !0)
|
|
1047
1106
|
]),
|
|
1048
1107
|
_: 3
|
|
1049
1108
|
}, 8, ["name"])
|
|
1050
1109
|
]));
|
|
1051
1110
|
}
|
|
1052
|
-
}),
|
|
1111
|
+
}), vs = /* @__PURE__ */ N(bt, [["__scopeId", "data-v-b208234c"]]), yt = { class: "w-full space-y-4" }, mt = { class: "flex flex-col gap-3 md:hidden" }, wt = { class: "text-[11px] uppercase tracking-wide text-gray-400" }, kt = { class: "text-sm text-gray-700" }, $t = {
|
|
1053
1112
|
key: 0,
|
|
1054
1113
|
class: "rounded-lg border border-dashed border-gray-200 bg-white p-4 text-gray-400 text-center"
|
|
1055
|
-
},
|
|
1114
|
+
}, Ct = { class: "hidden md:block w-full overflow-x-auto" }, Bt = { class: "w-full border-collapse" }, zt = { class: "w-full" }, Mt = ["onClick"], _t = { class: "flex items-center gap-2" }, Tt = {
|
|
1056
1115
|
key: 0,
|
|
1057
1116
|
class: "text-xs text-gray-400"
|
|
1058
|
-
},
|
|
1117
|
+
}, jt = { key: 0 }, Vt = { key: 1 }, It = { class: "w-full" }, St = {
|
|
1059
1118
|
key: 0,
|
|
1060
1119
|
class: "flex items-center justify-center py-12 text-gray-400"
|
|
1061
|
-
},
|
|
1120
|
+
}, Lt = {
|
|
1062
1121
|
key: 0,
|
|
1063
1122
|
class: "w-full px-6 py-4 bg-white"
|
|
1064
|
-
},
|
|
1123
|
+
}, Ot = /* @__PURE__ */ O({
|
|
1065
1124
|
__name: "Table",
|
|
1066
1125
|
props: {
|
|
1067
1126
|
columns: {},
|
|
@@ -1072,147 +1131,147 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1072
1131
|
rowClass: { default: void 0 }
|
|
1073
1132
|
},
|
|
1074
1133
|
setup(t) {
|
|
1075
|
-
const
|
|
1076
|
-
e.value ===
|
|
1077
|
-
},
|
|
1134
|
+
const u = t, e = E(null), d = E("asc"), r = (a) => {
|
|
1135
|
+
e.value === a ? d.value = d.value === "asc" ? "desc" : "asc" : (e.value = a, d.value = "asc");
|
|
1136
|
+
}, i = c(() => {
|
|
1078
1137
|
if (!e.value)
|
|
1079
|
-
return
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1082
|
-
const y =
|
|
1083
|
-
return typeof y == "string" && typeof
|
|
1084
|
-
}),
|
|
1085
|
-
}),
|
|
1086
|
-
return (
|
|
1087
|
-
l("div",
|
|
1088
|
-
(s(!0), o(A, null, W(
|
|
1138
|
+
return u.data;
|
|
1139
|
+
const a = [...u.data];
|
|
1140
|
+
return a.sort((g, v) => {
|
|
1141
|
+
const y = g[e.value], f = v[e.value];
|
|
1142
|
+
return typeof y == "string" && typeof f == "string" ? d.value === "asc" ? y.localeCompare(f) : f.localeCompare(y) : typeof y == "number" && typeof f == "number" ? d.value === "asc" ? y - f : f - y : 0;
|
|
1143
|
+
}), a;
|
|
1144
|
+
}), p = c(() => u.columns.filter((a) => !a.hideOnMobile));
|
|
1145
|
+
return (a, g) => (s(), o("div", yt, [
|
|
1146
|
+
l("div", mt, [
|
|
1147
|
+
(s(!0), o(A, null, W(i.value, (v, y) => (s(), o("div", {
|
|
1089
1148
|
key: `card-${y}`,
|
|
1090
1149
|
class: "rounded-lg border border-gray-200 bg-white p-4 shadow-sm"
|
|
1091
1150
|
}, [
|
|
1092
|
-
(s(!0), o(A, null, W(
|
|
1093
|
-
key: `card-${y}-${
|
|
1151
|
+
(s(!0), o(A, null, W(p.value, (f) => (s(), o("div", {
|
|
1152
|
+
key: `card-${y}-${f.key}`,
|
|
1094
1153
|
class: "flex flex-col gap-1 py-1"
|
|
1095
1154
|
}, [
|
|
1096
|
-
l("span",
|
|
1097
|
-
l("span",
|
|
1098
|
-
B(
|
|
1099
|
-
value:
|
|
1100
|
-
row:
|
|
1155
|
+
l("span", wt, w(f.label), 1),
|
|
1156
|
+
l("span", kt, [
|
|
1157
|
+
B(a.$slots, `cell-${f.key}`, {
|
|
1158
|
+
value: v[f.key],
|
|
1159
|
+
row: v
|
|
1101
1160
|
}, () => [
|
|
1102
|
-
|
|
1161
|
+
P(w(v[f.key]), 1)
|
|
1103
1162
|
], !0)
|
|
1104
1163
|
])
|
|
1105
1164
|
]))), 128))
|
|
1106
1165
|
]))), 128)),
|
|
1107
|
-
|
|
1108
|
-
B(
|
|
1109
|
-
|
|
1166
|
+
i.value.length === 0 ? (s(), o("div", $t, [
|
|
1167
|
+
B(a.$slots, "empty", {}, () => [
|
|
1168
|
+
g[0] || (g[0] = P("No hay datos disponibles", -1))
|
|
1110
1169
|
], !0)
|
|
1111
|
-
])) :
|
|
1170
|
+
])) : h("", !0)
|
|
1112
1171
|
]),
|
|
1113
|
-
l("div",
|
|
1114
|
-
l("table",
|
|
1115
|
-
l("thead",
|
|
1172
|
+
l("div", Ct, [
|
|
1173
|
+
l("table", Bt, [
|
|
1174
|
+
l("thead", zt, [
|
|
1116
1175
|
l("tr", {
|
|
1117
|
-
class:
|
|
1176
|
+
class: x([
|
|
1118
1177
|
"w-full",
|
|
1119
|
-
|
|
1178
|
+
u.headerClass || "bg-neutral-50 border-b border-gray-100"
|
|
1120
1179
|
])
|
|
1121
1180
|
}, [
|
|
1122
|
-
(s(!0), o(A, null, W(t.columns, (
|
|
1123
|
-
key:
|
|
1124
|
-
style: R(
|
|
1125
|
-
class:
|
|
1181
|
+
(s(!0), o(A, null, W(t.columns, (v) => (s(), o("th", {
|
|
1182
|
+
key: v.key,
|
|
1183
|
+
style: R(v.width ? { width: v.width } : {}),
|
|
1184
|
+
class: x([
|
|
1126
1185
|
"px-4 py-3 text-left text-xs font-semibold text-gray-700 border-l border-gray-100 first:border-l-0",
|
|
1127
|
-
|
|
1128
|
-
|
|
1186
|
+
v.sortable ? "cursor-pointer hover:text-primary-600 select-none transition-colors" : "",
|
|
1187
|
+
u.headerCellClass
|
|
1129
1188
|
]),
|
|
1130
|
-
onClick: (y) =>
|
|
1189
|
+
onClick: (y) => v.sortable && r(v.key)
|
|
1131
1190
|
}, [
|
|
1132
|
-
l("div",
|
|
1133
|
-
l("span", null, w(
|
|
1134
|
-
|
|
1135
|
-
e.value !==
|
|
1136
|
-
])) :
|
|
1191
|
+
l("div", _t, [
|
|
1192
|
+
l("span", null, w(v.label), 1),
|
|
1193
|
+
v.sortable ? (s(), o("span", Tt, [
|
|
1194
|
+
e.value !== v.key ? (s(), o("span", jt, "⇅")) : (s(), o("span", Vt, w(d.value === "asc" ? "↑" : "↓"), 1))
|
|
1195
|
+
])) : h("", !0)
|
|
1137
1196
|
])
|
|
1138
|
-
], 14,
|
|
1197
|
+
], 14, Mt))), 128))
|
|
1139
1198
|
], 2)
|
|
1140
1199
|
]),
|
|
1141
|
-
l("tbody",
|
|
1142
|
-
(s(!0), o(A, null, W(
|
|
1200
|
+
l("tbody", It, [
|
|
1201
|
+
(s(!0), o(A, null, W(i.value, (v, y) => (s(), o("tr", {
|
|
1143
1202
|
key: y,
|
|
1144
|
-
class:
|
|
1203
|
+
class: x([
|
|
1145
1204
|
"w-full border-b border-gray-200 hover:bg-gray-50 transition-colors",
|
|
1146
|
-
|
|
1205
|
+
u.rowClass
|
|
1147
1206
|
])
|
|
1148
1207
|
}, [
|
|
1149
|
-
(s(!0), o(A, null, W(t.columns, (
|
|
1150
|
-
key: `${y}-${
|
|
1151
|
-
class:
|
|
1208
|
+
(s(!0), o(A, null, W(t.columns, (f) => (s(), o("td", {
|
|
1209
|
+
key: `${y}-${f.key}`,
|
|
1210
|
+
class: x([
|
|
1152
1211
|
"px-4 py-3 text-xs text-gray-600 border-l border-gray-100 first:border-l-0",
|
|
1153
|
-
|
|
1212
|
+
u.cellClass
|
|
1154
1213
|
])
|
|
1155
1214
|
}, [
|
|
1156
|
-
B(
|
|
1157
|
-
value:
|
|
1158
|
-
row:
|
|
1215
|
+
B(a.$slots, `cell-${f.key}`, {
|
|
1216
|
+
value: v[f.key],
|
|
1217
|
+
row: v
|
|
1159
1218
|
}, () => [
|
|
1160
|
-
|
|
1219
|
+
P(w(v[f.key]), 1)
|
|
1161
1220
|
], !0)
|
|
1162
1221
|
], 2))), 128))
|
|
1163
1222
|
], 2))), 128))
|
|
1164
1223
|
])
|
|
1165
1224
|
]),
|
|
1166
|
-
|
|
1167
|
-
B(
|
|
1168
|
-
|
|
1225
|
+
i.value.length === 0 ? (s(), o("div", St, [
|
|
1226
|
+
B(a.$slots, "empty", {}, () => [
|
|
1227
|
+
g[1] || (g[1] = P("No hay datos disponibles", -1))
|
|
1169
1228
|
], !0)
|
|
1170
|
-
])) :
|
|
1229
|
+
])) : h("", !0)
|
|
1171
1230
|
]),
|
|
1172
|
-
|
|
1173
|
-
B(
|
|
1174
|
-
])) :
|
|
1231
|
+
a.$slots.footer ? (s(), o("div", Lt, [
|
|
1232
|
+
B(a.$slots, "footer", {}, void 0, !0)
|
|
1233
|
+
])) : h("", !0)
|
|
1175
1234
|
]));
|
|
1176
1235
|
}
|
|
1177
|
-
}),
|
|
1236
|
+
}), gs = /* @__PURE__ */ N(Ot, [["__scopeId", "data-v-8e7ce66d"]]), Dt = { class: "w-full" }, At = {
|
|
1178
1237
|
class: "tabs-container flex flex-col sm:flex-row",
|
|
1179
1238
|
role: "tablist"
|
|
1180
|
-
},
|
|
1239
|
+
}, Pt = ["aria-selected", "onClick"], Et = { role: "tabpanel" }, Ht = "relative w-full sm:w-auto text-left sm:text-center px-4 sm:px-6 py-3 text-base font-semibold tracking-wide transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary-500 border-b-2", Wt = "text-primary-600 border-primary-600", Nt = "hover:text-secondary-700 border-gray-100", Ft = /* @__PURE__ */ O({
|
|
1181
1240
|
__name: "Tabs",
|
|
1182
1241
|
props: {
|
|
1183
1242
|
modelValue: {},
|
|
1184
1243
|
tabs: {}
|
|
1185
1244
|
},
|
|
1186
1245
|
emits: ["update:modelValue"],
|
|
1187
|
-
setup(t, { emit:
|
|
1188
|
-
const e = t,
|
|
1189
|
-
|
|
1190
|
-
},
|
|
1191
|
-
() => e.tabs.find((
|
|
1246
|
+
setup(t, { emit: u }) {
|
|
1247
|
+
const e = t, d = u, r = (g) => e.modelValue === g, i = (g) => {
|
|
1248
|
+
r(g) || d("update:modelValue", g);
|
|
1249
|
+
}, p = c(() => e.modelValue), a = c(
|
|
1250
|
+
() => e.tabs.find((g) => g.value === p.value)
|
|
1192
1251
|
);
|
|
1193
|
-
return (
|
|
1194
|
-
l("div",
|
|
1252
|
+
return (g, v) => (s(), o("div", Dt, [
|
|
1253
|
+
l("div", At, [
|
|
1195
1254
|
(s(!0), o(A, null, W(t.tabs, (y) => (s(), o("button", {
|
|
1196
1255
|
key: y.value,
|
|
1197
1256
|
type: "button",
|
|
1198
|
-
class:
|
|
1199
|
-
|
|
1200
|
-
|
|
1257
|
+
class: x([
|
|
1258
|
+
Ht,
|
|
1259
|
+
r(y.value) ? Wt : Nt
|
|
1201
1260
|
]),
|
|
1202
|
-
"aria-selected":
|
|
1261
|
+
"aria-selected": r(y.value),
|
|
1203
1262
|
role: "tab",
|
|
1204
|
-
onClick: (
|
|
1205
|
-
}, w(y.label), 11,
|
|
1263
|
+
onClick: (f) => i(y.value)
|
|
1264
|
+
}, w(y.label), 11, Pt))), 128))
|
|
1206
1265
|
]),
|
|
1207
|
-
l("div",
|
|
1208
|
-
B(
|
|
1209
|
-
active:
|
|
1210
|
-
tab:
|
|
1266
|
+
l("div", Et, [
|
|
1267
|
+
B(g.$slots, p.value, {
|
|
1268
|
+
active: p.value,
|
|
1269
|
+
tab: a.value
|
|
1211
1270
|
}, void 0, !0)
|
|
1212
1271
|
])
|
|
1213
1272
|
]));
|
|
1214
1273
|
}
|
|
1215
|
-
}),
|
|
1274
|
+
}), xs = /* @__PURE__ */ N(Ft, [["__scopeId", "data-v-b5a754bd"]]), Rt = "font-sans", hs = /* @__PURE__ */ O({
|
|
1216
1275
|
__name: "Text",
|
|
1217
1276
|
props: {
|
|
1218
1277
|
variant: { default: "body1" },
|
|
@@ -1224,7 +1283,7 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1224
1283
|
weight: {}
|
|
1225
1284
|
},
|
|
1226
1285
|
setup(t) {
|
|
1227
|
-
const
|
|
1286
|
+
const u = {
|
|
1228
1287
|
h1: "text-[40px] leading-[57px] tracking-[0px] font-extrabold",
|
|
1229
1288
|
h2: "text-[40px] leading-[57px] tracking-[0px] font-bold",
|
|
1230
1289
|
h3: "text-[28px] leading-[39px] tracking-[0px] font-extrabold",
|
|
@@ -1264,12 +1323,12 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1264
1323
|
button3: "span",
|
|
1265
1324
|
caption: "span",
|
|
1266
1325
|
overline: "span"
|
|
1267
|
-
},
|
|
1326
|
+
}, d = {
|
|
1268
1327
|
left: "text-left",
|
|
1269
1328
|
center: "text-center",
|
|
1270
1329
|
right: "text-right",
|
|
1271
1330
|
justify: "text-justify"
|
|
1272
|
-
},
|
|
1331
|
+
}, r = {
|
|
1273
1332
|
default: "text-secondary-900",
|
|
1274
1333
|
muted: "text-secondary-600",
|
|
1275
1334
|
primary: "text-primary-600",
|
|
@@ -1277,23 +1336,23 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1277
1336
|
danger: "text-danger-600",
|
|
1278
1337
|
success: "text-success-600",
|
|
1279
1338
|
warning: "text-warning-600"
|
|
1280
|
-
},
|
|
1339
|
+
}, i = {
|
|
1281
1340
|
light: "font-light",
|
|
1282
1341
|
normal: "font-normal",
|
|
1283
1342
|
medium: "font-medium",
|
|
1284
1343
|
semibold: "font-semibold",
|
|
1285
1344
|
bold: "font-bold",
|
|
1286
1345
|
extrabold: "font-extrabold"
|
|
1287
|
-
},
|
|
1346
|
+
}, p = t, a = c(() => p.variant), g = c(() => p.color), v = c(() => p.align), y = c(() => p.as || e[a.value] || "span"), f = c(() => p.weight ? i[p.weight] : "");
|
|
1288
1347
|
return (_, C) => (s(), q(Y(y.value), {
|
|
1289
|
-
class:
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1348
|
+
class: x([
|
|
1349
|
+
Rt,
|
|
1350
|
+
u[a.value],
|
|
1351
|
+
r[g.value],
|
|
1352
|
+
d[v.value],
|
|
1353
|
+
f.value,
|
|
1295
1354
|
{
|
|
1296
|
-
uppercase: t.uppercase ||
|
|
1355
|
+
uppercase: t.uppercase || a.value === "overline",
|
|
1297
1356
|
truncate: t.truncate
|
|
1298
1357
|
}
|
|
1299
1358
|
])
|
|
@@ -1304,17 +1363,17 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1304
1363
|
_: 3
|
|
1305
1364
|
}, 8, ["class"]));
|
|
1306
1365
|
}
|
|
1307
|
-
}),
|
|
1366
|
+
}), Kt = { class: "w-full flex items-center justify-between gap-3 py-2" }, qt = {
|
|
1308
1367
|
key: 0,
|
|
1309
1368
|
class: "text-xs text-secondary-600"
|
|
1310
|
-
},
|
|
1369
|
+
}, Ut = { key: 0 }, Gt = {
|
|
1311
1370
|
class: "ml-auto inline-flex items-center gap-1",
|
|
1312
1371
|
role: "navigation",
|
|
1313
1372
|
"aria-label": "Pagination"
|
|
1314
|
-
},
|
|
1373
|
+
}, Qt = ["disabled"], Zt = {
|
|
1315
1374
|
key: 0,
|
|
1316
1375
|
class: "h-8 min-w-8 px-2 inline-flex items-center justify-center text-secondary-500"
|
|
1317
|
-
},
|
|
1376
|
+
}, Jt = ["aria-label", "onClick"], Xt = ["disabled"], Yt = /* @__PURE__ */ O({
|
|
1318
1377
|
__name: "Pagination",
|
|
1319
1378
|
props: {
|
|
1320
1379
|
modelValue: { default: 1 },
|
|
@@ -1327,77 +1386,77 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1327
1386
|
itemLabel: { default: "" }
|
|
1328
1387
|
},
|
|
1329
1388
|
emits: ["update:modelValue", "change"],
|
|
1330
|
-
setup(t, { emit:
|
|
1331
|
-
const e = t,
|
|
1332
|
-
const
|
|
1333
|
-
return
|
|
1334
|
-
}),
|
|
1335
|
-
const
|
|
1336
|
-
return
|
|
1337
|
-
}),
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1340
|
-
return Array.from({ length:
|
|
1341
|
-
const
|
|
1342
|
-
let V = Math.max(1, C -
|
|
1343
|
-
V = Math.max(1, Math.min(V,
|
|
1344
|
-
const
|
|
1345
|
-
V > 1 && (
|
|
1346
|
-
for (let k = V; k <=
|
|
1347
|
-
|
|
1348
|
-
return
|
|
1389
|
+
setup(t, { emit: u }) {
|
|
1390
|
+
const e = t, d = u, r = c(() => {
|
|
1391
|
+
const f = Math.ceil(e.totalItems / e.pageSize);
|
|
1392
|
+
return f > 0 ? f : 1;
|
|
1393
|
+
}), i = c(() => {
|
|
1394
|
+
const f = Number(e.modelValue || 1);
|
|
1395
|
+
return f < 1 ? 1 : f > r.value ? r.value : f;
|
|
1396
|
+
}), p = c(() => e.totalItems === 0 ? 0 : (i.value - 1) * e.pageSize + 1), a = c(() => Math.min(i.value * e.pageSize, e.totalItems)), g = c(() => `Mostrando ${p.value} a ${a.value} de ${e.totalItems}`), v = c(() => {
|
|
1397
|
+
const f = r.value, _ = Math.max(3, e.maxPages), C = i.value;
|
|
1398
|
+
if (f <= _)
|
|
1399
|
+
return Array.from({ length: f }, (k, j) => j + 1);
|
|
1400
|
+
const I = Math.floor(_ / 2);
|
|
1401
|
+
let V = Math.max(1, C - I), T = Math.min(f, V + _ - 1);
|
|
1402
|
+
V = Math.max(1, Math.min(V, T - _ + 1));
|
|
1403
|
+
const b = [];
|
|
1404
|
+
V > 1 && (b.push(1), V > 2 && b.push("…"));
|
|
1405
|
+
for (let k = V; k <= T; k++)
|
|
1406
|
+
b.push(k);
|
|
1407
|
+
return T < f && (T < f - 1 && b.push("…"), b.push(f)), b;
|
|
1349
1408
|
});
|
|
1350
|
-
function y(
|
|
1351
|
-
const _ = Math.max(1, Math.min(
|
|
1352
|
-
_ !==
|
|
1409
|
+
function y(f) {
|
|
1410
|
+
const _ = Math.max(1, Math.min(f, r.value));
|
|
1411
|
+
_ !== i.value && (d("update:modelValue", _), d("change", _));
|
|
1353
1412
|
}
|
|
1354
|
-
return (
|
|
1355
|
-
t.showSummary ? (s(), o("div",
|
|
1356
|
-
B(
|
|
1357
|
-
start:
|
|
1358
|
-
end:
|
|
1413
|
+
return (f, _) => (s(), o("div", Kt, [
|
|
1414
|
+
t.showSummary ? (s(), o("div", qt, [
|
|
1415
|
+
B(f.$slots, "summary", {
|
|
1416
|
+
start: p.value,
|
|
1417
|
+
end: a.value,
|
|
1359
1418
|
total: t.totalItems
|
|
1360
1419
|
}, () => [
|
|
1361
|
-
|
|
1362
|
-
t.itemLabel ? (s(), o("span",
|
|
1420
|
+
P(w(g.value), 1),
|
|
1421
|
+
t.itemLabel ? (s(), o("span", Ut, w(t.itemLabel), 1)) : h("", !0)
|
|
1363
1422
|
], !0)
|
|
1364
|
-
])) :
|
|
1365
|
-
l("nav",
|
|
1423
|
+
])) : h("", !0),
|
|
1424
|
+
l("nav", Gt, [
|
|
1366
1425
|
l("button", {
|
|
1367
1426
|
type: "button",
|
|
1368
1427
|
class: "h-8 px-3 rounded-full text-sm font-semibold text-secondary-700 hover:bg-secondary-100 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1369
|
-
disabled:
|
|
1370
|
-
onClick: _[0] || (_[0] = (C) => y(
|
|
1428
|
+
disabled: i.value <= 1,
|
|
1429
|
+
onClick: _[0] || (_[0] = (C) => y(i.value - 1)),
|
|
1371
1430
|
"aria-label": "Anterior"
|
|
1372
|
-
}, w(t.previousText), 9,
|
|
1373
|
-
(s(!0), o(A, null, W(
|
|
1374
|
-
key: `page-${
|
|
1431
|
+
}, w(t.previousText), 9, Qt),
|
|
1432
|
+
(s(!0), o(A, null, W(v.value, (C, I) => (s(), o(A, {
|
|
1433
|
+
key: `page-${I}-${C}`
|
|
1375
1434
|
}, [
|
|
1376
|
-
C === "…" ? (s(), o("span",
|
|
1435
|
+
C === "…" ? (s(), o("span", Zt, " … ")) : (s(), o("button", {
|
|
1377
1436
|
key: 1,
|
|
1378
1437
|
type: "button",
|
|
1379
1438
|
"aria-label": `Página ${C}`,
|
|
1380
|
-
class:
|
|
1439
|
+
class: x([
|
|
1381
1440
|
"h-8 min-w-8 px-3 rounded-full text-sm font-semibold transition-colors",
|
|
1382
|
-
C ===
|
|
1441
|
+
C === i.value ? "bg-primary-500 text-white" : "text-secondary-700 hover:bg-secondary-100"
|
|
1383
1442
|
]),
|
|
1384
1443
|
onClick: (V) => y(C)
|
|
1385
|
-
}, w(C), 11,
|
|
1444
|
+
}, w(C), 11, Jt))
|
|
1386
1445
|
], 64))), 128)),
|
|
1387
1446
|
l("button", {
|
|
1388
1447
|
type: "button",
|
|
1389
1448
|
class: "h-8 px-3 rounded-full text-sm font-semibold text-secondary-700 hover:bg-secondary-100 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1390
|
-
disabled:
|
|
1391
|
-
onClick: _[1] || (_[1] = (C) => y(
|
|
1449
|
+
disabled: i.value >= r.value,
|
|
1450
|
+
onClick: _[1] || (_[1] = (C) => y(i.value + 1)),
|
|
1392
1451
|
"aria-label": "Siguiente"
|
|
1393
|
-
}, w(t.nextText), 9,
|
|
1452
|
+
}, w(t.nextText), 9, Xt)
|
|
1394
1453
|
])
|
|
1395
1454
|
]));
|
|
1396
1455
|
}
|
|
1397
|
-
}),
|
|
1456
|
+
}), bs = /* @__PURE__ */ N(Yt, [["__scopeId", "data-v-87417cc4"]]), es = ["data-node-id"], ts = { class: "shrink-0 size-12 rounded-full bg-[var(--neutrales/fondo-general-claro,#f7f7f7)] grid place-items-center" }, ss = {
|
|
1398
1457
|
key: 1,
|
|
1399
1458
|
class: "flex justify-end gap-1 px-6 pb-6 pt-4"
|
|
1400
|
-
},
|
|
1459
|
+
}, ys = /* @__PURE__ */ O({
|
|
1401
1460
|
__name: "Alert",
|
|
1402
1461
|
props: {
|
|
1403
1462
|
variant: {},
|
|
@@ -1410,10 +1469,10 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1410
1469
|
stackOn: {}
|
|
1411
1470
|
},
|
|
1412
1471
|
emits: ["close", "accept", "cancel"],
|
|
1413
|
-
setup(t, { emit:
|
|
1414
|
-
const e =
|
|
1415
|
-
if (
|
|
1416
|
-
switch (
|
|
1472
|
+
setup(t, { emit: u }) {
|
|
1473
|
+
const e = u, d = t, r = c(() => d.variant ?? "info"), i = c(() => d.multiline ?? !1), p = c(() => d.actions ?? !1), a = c(() => d.nodeId ?? void 0), g = () => e("close"), v = c(() => {
|
|
1474
|
+
if (d.title) return d.title;
|
|
1475
|
+
switch (r.value) {
|
|
1417
1476
|
case "info":
|
|
1418
1477
|
return "Alerta de información";
|
|
1419
1478
|
case "warning":
|
|
@@ -1423,8 +1482,8 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1423
1482
|
case "error":
|
|
1424
1483
|
return "Alerta de error";
|
|
1425
1484
|
}
|
|
1426
|
-
}), y =
|
|
1427
|
-
switch (
|
|
1485
|
+
}), y = c(() => d.description ?? ""), f = c(() => {
|
|
1486
|
+
switch (r.value) {
|
|
1428
1487
|
case "info":
|
|
1429
1488
|
return {
|
|
1430
1489
|
border: "border-[var(--semantica/info,#0064ff)]",
|
|
@@ -1450,31 +1509,31 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1450
1509
|
icon: "text-[#ff4235]"
|
|
1451
1510
|
};
|
|
1452
1511
|
}
|
|
1453
|
-
}), _ =
|
|
1454
|
-
const
|
|
1455
|
-
if (!
|
|
1456
|
-
const
|
|
1457
|
-
return `${
|
|
1458
|
-
}),
|
|
1459
|
-
if (!
|
|
1460
|
-
const
|
|
1461
|
-
return `flex-col ${
|
|
1462
|
-
}), V =
|
|
1463
|
-
return (
|
|
1464
|
-
class:
|
|
1465
|
-
|
|
1466
|
-
|
|
1512
|
+
}), _ = c(() => "bg-[var(--color-primario/700,#269ea4)]"), C = c(() => {
|
|
1513
|
+
const T = "flex w-full items-start gap-4 flex-col";
|
|
1514
|
+
if (!d.stackOn) return `${T} sm:flex-row sm:items-center`;
|
|
1515
|
+
const b = d.stackOn, k = `${b}:flex-row ${b}:items-center`;
|
|
1516
|
+
return `${T} ${k}`;
|
|
1517
|
+
}), I = c(() => {
|
|
1518
|
+
if (!d.stackOn) return "flex-col sm:flex-row items-start sm:items-center";
|
|
1519
|
+
const T = d.stackOn;
|
|
1520
|
+
return `flex-col ${T}:flex-row items-start ${T}:items-center`;
|
|
1521
|
+
}), V = c(() => d.stackOn ? `self-start ${d.stackOn}:self-auto` : "self-start sm:self-auto");
|
|
1522
|
+
return (T, b) => (s(), o("div", {
|
|
1523
|
+
class: x(["relative w-full rounded-xl border", [
|
|
1524
|
+
f.value.border,
|
|
1525
|
+
f.value.bg
|
|
1467
1526
|
]]),
|
|
1468
1527
|
role: "alert",
|
|
1469
|
-
"data-node-id":
|
|
1528
|
+
"data-node-id": a.value
|
|
1470
1529
|
}, [
|
|
1471
1530
|
t.closable ? (s(), o("button", {
|
|
1472
1531
|
key: 0,
|
|
1473
1532
|
type: "button",
|
|
1474
1533
|
class: "absolute top-3 right-3 text-[color:var(--neutrales/texto-principal,#565656)]/70 hover:opacity-100 opacity-70",
|
|
1475
1534
|
"aria-label": "Cerrar",
|
|
1476
|
-
onClick:
|
|
1477
|
-
}, [...
|
|
1535
|
+
onClick: g
|
|
1536
|
+
}, [...b[2] || (b[2] = [
|
|
1478
1537
|
l("svg", {
|
|
1479
1538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1480
1539
|
width: "18",
|
|
@@ -1499,27 +1558,27 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1499
1558
|
y2: "18"
|
|
1500
1559
|
})
|
|
1501
1560
|
], -1)
|
|
1502
|
-
])])) :
|
|
1561
|
+
])])) : h("", !0),
|
|
1503
1562
|
l("div", {
|
|
1504
|
-
class:
|
|
1563
|
+
class: x(["p-6", { "pb-0": p.value }])
|
|
1505
1564
|
}, [
|
|
1506
1565
|
l("div", {
|
|
1507
|
-
class:
|
|
1566
|
+
class: x(C.value)
|
|
1508
1567
|
}, [
|
|
1509
|
-
l("div",
|
|
1510
|
-
|
|
1568
|
+
l("div", ts, [
|
|
1569
|
+
r.value === "info" ? (s(), o("svg", {
|
|
1511
1570
|
key: 0,
|
|
1512
1571
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1513
1572
|
width: "24",
|
|
1514
1573
|
height: "24",
|
|
1515
1574
|
viewBox: "0 0 24 24",
|
|
1516
1575
|
fill: "none",
|
|
1517
|
-
class:
|
|
1576
|
+
class: x(f.value.icon),
|
|
1518
1577
|
stroke: "currentColor",
|
|
1519
1578
|
"stroke-width": "2",
|
|
1520
1579
|
"stroke-linecap": "round",
|
|
1521
1580
|
"stroke-linejoin": "round"
|
|
1522
|
-
}, [...
|
|
1581
|
+
}, [...b[3] || (b[3] = [
|
|
1523
1582
|
l("circle", {
|
|
1524
1583
|
cx: "12",
|
|
1525
1584
|
cy: "12",
|
|
@@ -1537,19 +1596,19 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1537
1596
|
x2: "12",
|
|
1538
1597
|
y2: "8"
|
|
1539
1598
|
}, null, -1)
|
|
1540
|
-
])], 2)) :
|
|
1599
|
+
])], 2)) : r.value === "warning" ? (s(), o("svg", {
|
|
1541
1600
|
key: 1,
|
|
1542
1601
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1543
1602
|
width: "24",
|
|
1544
1603
|
height: "24",
|
|
1545
1604
|
viewBox: "0 0 24 24",
|
|
1546
1605
|
fill: "none",
|
|
1547
|
-
class:
|
|
1606
|
+
class: x(f.value.icon),
|
|
1548
1607
|
stroke: "currentColor",
|
|
1549
1608
|
"stroke-width": "2",
|
|
1550
1609
|
"stroke-linecap": "round",
|
|
1551
1610
|
"stroke-linejoin": "round"
|
|
1552
|
-
}, [...
|
|
1611
|
+
}, [...b[4] || (b[4] = [
|
|
1553
1612
|
l("path", { d: "M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z" }, null, -1),
|
|
1554
1613
|
l("line", {
|
|
1555
1614
|
x1: "12",
|
|
@@ -1563,19 +1622,19 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1563
1622
|
x2: "12",
|
|
1564
1623
|
y2: "17"
|
|
1565
1624
|
}, null, -1)
|
|
1566
|
-
])], 2)) :
|
|
1625
|
+
])], 2)) : r.value === "success" ? (s(), o("svg", {
|
|
1567
1626
|
key: 2,
|
|
1568
1627
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1569
1628
|
width: "24",
|
|
1570
1629
|
height: "24",
|
|
1571
1630
|
viewBox: "0 0 24 24",
|
|
1572
1631
|
fill: "none",
|
|
1573
|
-
class:
|
|
1632
|
+
class: x(f.value.icon),
|
|
1574
1633
|
stroke: "currentColor",
|
|
1575
1634
|
"stroke-width": "2",
|
|
1576
1635
|
"stroke-linecap": "round",
|
|
1577
1636
|
"stroke-linejoin": "round"
|
|
1578
|
-
}, [...
|
|
1637
|
+
}, [...b[5] || (b[5] = [
|
|
1579
1638
|
l("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }, null, -1),
|
|
1580
1639
|
l("polyline", { points: "22 4 12 14.01 9 11.01" }, null, -1)
|
|
1581
1640
|
])], 2)) : (s(), o("svg", {
|
|
@@ -1585,12 +1644,12 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1585
1644
|
height: "24",
|
|
1586
1645
|
viewBox: "0 0 24 24",
|
|
1587
1646
|
fill: "none",
|
|
1588
|
-
class:
|
|
1647
|
+
class: x(f.value.icon),
|
|
1589
1648
|
stroke: "currentColor",
|
|
1590
1649
|
"stroke-width": "2",
|
|
1591
1650
|
"stroke-linecap": "round",
|
|
1592
1651
|
"stroke-linejoin": "round"
|
|
1593
|
-
}, [...
|
|
1652
|
+
}, [...b[6] || (b[6] = [
|
|
1594
1653
|
l("polygon", { points: "7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2" }, null, -1),
|
|
1595
1654
|
l("line", {
|
|
1596
1655
|
x1: "12",
|
|
@@ -1607,57 +1666,58 @@ const le = { class: "flex items-center gap-2 sm:gap-3 shrink-0" }, ae = {
|
|
|
1607
1666
|
])], 2))
|
|
1608
1667
|
]),
|
|
1609
1668
|
l("div", {
|
|
1610
|
-
class:
|
|
1669
|
+
class: x(["flex-1 flex gap-4 text-[14px]", [I.value, t.closable ? "pr-6" : "", { "whitespace-nowrap": !i.value, "whitespace-pre-wrap": i.value }]])
|
|
1611
1670
|
}, [
|
|
1612
1671
|
l("div", {
|
|
1613
|
-
class:
|
|
1614
|
-
}, w(
|
|
1672
|
+
class: x(["tracking-[0.1px] text-[color:var(--neutrales/texto-principal,#565656)] font-medium", V.value])
|
|
1673
|
+
}, w(v.value), 3),
|
|
1615
1674
|
l("div", {
|
|
1616
|
-
class:
|
|
1675
|
+
class: x(["flex-1 tracking-[0.25px] text-[color:var(--neutrales/texto-principal,#565656)]", { "overflow-hidden overflow-ellipsis": !i.value }])
|
|
1617
1676
|
}, [
|
|
1618
|
-
B(
|
|
1619
|
-
|
|
1677
|
+
B(T.$slots, "description", {}, () => [
|
|
1678
|
+
P(w(y.value), 1)
|
|
1620
1679
|
])
|
|
1621
1680
|
], 2)
|
|
1622
1681
|
], 2)
|
|
1623
1682
|
], 2)
|
|
1624
1683
|
], 2),
|
|
1625
|
-
|
|
1684
|
+
p.value ? (s(), o("div", ss, [
|
|
1626
1685
|
l("button", {
|
|
1627
1686
|
type: "button",
|
|
1628
1687
|
class: "px-4 py-1.5 rounded-[18px] text-[14px] tracking-[1.25px] font-bold text-[color:var(--neutrales/texto-principal,#565656)]",
|
|
1629
|
-
onClick:
|
|
1688
|
+
onClick: b[0] || (b[0] = (k) => T.$emit("cancel"))
|
|
1630
1689
|
}, [
|
|
1631
|
-
B(
|
|
1632
|
-
|
|
1690
|
+
B(T.$slots, "cancel", {}, () => [
|
|
1691
|
+
b[7] || (b[7] = P("Cancelar", -1))
|
|
1633
1692
|
])
|
|
1634
1693
|
]),
|
|
1635
1694
|
l("button", {
|
|
1636
1695
|
type: "button",
|
|
1637
|
-
class:
|
|
1638
|
-
onClick:
|
|
1696
|
+
class: x(["px-4 py-1.5 rounded-[18px] text-[14px] tracking-[1.25px] font-bold text-white", _.value]),
|
|
1697
|
+
onClick: b[1] || (b[1] = (k) => T.$emit("accept"))
|
|
1639
1698
|
}, [
|
|
1640
|
-
B(
|
|
1641
|
-
|
|
1699
|
+
B(T.$slots, "accept", {}, () => [
|
|
1700
|
+
b[8] || (b[8] = P("Aceptar", -1))
|
|
1642
1701
|
])
|
|
1643
1702
|
], 2)
|
|
1644
|
-
])) :
|
|
1645
|
-
], 10,
|
|
1703
|
+
])) : h("", !0)
|
|
1704
|
+
], 10, es));
|
|
1646
1705
|
}
|
|
1647
1706
|
});
|
|
1648
1707
|
export {
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1708
|
+
ys as Alert,
|
|
1709
|
+
as as AppBar,
|
|
1710
|
+
ns as Button,
|
|
1711
|
+
rs as Card,
|
|
1712
|
+
is as Dialog,
|
|
1713
|
+
ds as FileUpload,
|
|
1714
|
+
us as Icon,
|
|
1715
|
+
cs as Loader,
|
|
1716
|
+
fs as Menu,
|
|
1717
|
+
bs as Pagination,
|
|
1718
|
+
ps as Select,
|
|
1719
|
+
vs as Sidebar,
|
|
1720
|
+
gs as Table,
|
|
1721
|
+
xs as Tabs,
|
|
1722
|
+
hs as Text
|
|
1663
1723
|
};
|