zabi-components 1.0.4 → 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 +339 -98
- package/dist/{Tabs-CQvsdYPW.js → Tabs-ksSPSd0I.js} +254 -258
- package/dist/Toggle-DYKQFP4Y.js +2277 -0
- package/dist/{Tooltip-B-wUMg6c.js → Tooltip-D6yYgExv.js} +238 -242
- package/dist/atoms/index.js +2 -2
- package/dist/index/index.js +3 -3
- package/dist/molecules/index.js +2 -2
- package/dist/zabi-components.css +1 -0
- package/package.json +1 -1
- package/dist/Toggle-DuPArdKN.js +0 -2315
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as I, Q as
|
|
2
|
-
import { createEventDispatcher as
|
|
3
|
-
import { B as le, T as Ae, S as Fe, C as Re, c as Oe, a as Ve, b as He, I as Ke } from "./Toggle-
|
|
4
|
-
function Ne(
|
|
5
|
-
var
|
|
1
|
+
import { t as I, Q as $e, R as Ce, S as je, T as Me, U as ue, p as j, C as se, D as ye, i as ie, f as _, c as M, s as fe, g as d, h as oe, j as ve, r as y, o as k, n as o, u as r, l as e, m as K, q as ee, v as H, k as x, e as te, B as Z, V as Te, w as re, b as J, d as he, W as ne, P as Ue, E as xe, Y as me, a as qe, G as Be, Z as _e, x as Le, F as De, y as Ee, A as Pe } from "./x-DpVwziig.js";
|
|
2
|
+
import { createEventDispatcher as ce, onMount as Ie, onDestroy as Se } from "svelte";
|
|
3
|
+
import { B as le, T as Ae, S as Fe, C as Re, c as Oe, a as Ve, b as He, I as Ke } from "./Toggle-DYKQFP4Y.js";
|
|
4
|
+
function Ne(N, v, n = !1, c = !1, w = !1) {
|
|
5
|
+
var i = N, D = "";
|
|
6
6
|
I(() => {
|
|
7
7
|
var f = (
|
|
8
8
|
/** @type {Effect} */
|
|
9
|
-
|
|
9
|
+
$e
|
|
10
10
|
);
|
|
11
11
|
if (D !== (D = v() ?? "") && (f.nodes_start !== null && (Ce(
|
|
12
12
|
f.nodes_start,
|
|
@@ -14,45 +14,44 @@ function Ne(W, v, n = !1, d = !1, w = !1) {
|
|
|
14
14
|
f.nodes_end
|
|
15
15
|
), f.nodes_start = f.nodes_end = null), D !== "")) {
|
|
16
16
|
var t = D + "";
|
|
17
|
-
n ? t = `<svg>${t}</svg>` :
|
|
18
|
-
var
|
|
19
|
-
if ((n ||
|
|
20
|
-
ue(
|
|
17
|
+
n ? t = `<svg>${t}</svg>` : c && (t = `<math>${t}</math>`);
|
|
18
|
+
var m = je(t);
|
|
19
|
+
if ((n || c) && (m = /** @type {Element} */
|
|
20
|
+
ue(m)), Me(
|
|
21
21
|
/** @type {TemplateNode} */
|
|
22
|
-
ue(
|
|
22
|
+
ue(m),
|
|
23
23
|
/** @type {TemplateNode} */
|
|
24
|
-
|
|
25
|
-
), n ||
|
|
26
|
-
for (; ue(
|
|
27
|
-
|
|
24
|
+
m.lastChild
|
|
25
|
+
), n || c)
|
|
26
|
+
for (; ue(m); )
|
|
27
|
+
i.before(
|
|
28
28
|
/** @type {Node} */
|
|
29
|
-
ue(
|
|
29
|
+
ue(m)
|
|
30
30
|
);
|
|
31
31
|
else
|
|
32
|
-
|
|
32
|
+
i.before(m);
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
var We = _('<button class="absolute top-2 right-2 z-10 w-6 h-6 flex items-center justify-center rounded-full text-secondary hover:text-primary transition-colors duration-200 motion-reduce:transition-none group focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2" aria-label="Dismiss alert" type="button"><svg class="w-4 h-4 text-current group-hover:scale-110 transition-transform duration-200 motion-reduce:transition-none" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>'), Ge = _('<h4 class="font-semibold text-sm mb-1"> </h4>'), Qe = _('<p class="text-sm leading-relaxed"> </p>'), Ye = _('<div aria-atomic="true"><!> <div><div class="flex-shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><!> <!></div></div
|
|
37
|
-
function
|
|
36
|
+
var We = _('<button class="absolute top-2 right-2 z-10 w-6 h-6 flex items-center justify-center rounded-full text-secondary hover:text-primary transition-colors duration-200 motion-reduce:transition-none group focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2" aria-label="Dismiss alert" type="button"><svg class="w-4 h-4 text-current group-hover:scale-110 transition-transform duration-200 motion-reduce:transition-none" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>'), Ge = _('<h4 class="font-semibold text-sm mb-1"> </h4>'), Qe = _('<p class="text-sm leading-relaxed"> </p>'), Ye = _('<div aria-atomic="true"><!> <div><div class="flex-shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><!> <!> <!></div></div></div>');
|
|
37
|
+
function zt(N, v) {
|
|
38
38
|
ve(v, !1);
|
|
39
|
-
const n =
|
|
40
|
-
let
|
|
41
|
-
const
|
|
42
|
-
function F() {
|
|
43
|
-
|
|
39
|
+
const n = K(), c = K(), w = K();
|
|
40
|
+
let i = j(v, "variant", 8, "info"), D = j(v, "title", 8, ""), f = j(v, "message", 8, ""), t = j(v, "closable", 8, !1), m = j(v, "className", 8, "");
|
|
41
|
+
const z = ce();
|
|
42
|
+
function F(s) {
|
|
43
|
+
z("close", { value: !0, event: s });
|
|
44
44
|
}
|
|
45
45
|
se(() => {
|
|
46
46
|
}, () => {
|
|
47
47
|
x(n, {
|
|
48
|
-
info: "bg-info-light text-info-dark border border-info",
|
|
49
|
-
success: "bg-success-light text-success-dark border border-success",
|
|
50
|
-
warning: "bg-warning-light text-warning-dark border border-warning",
|
|
51
|
-
error: "bg-error-light text-error-dark border border-error"
|
|
52
|
-
"game-error": "bg-error-light text-error-dark border border-error"
|
|
48
|
+
info: "bg-[var(--zabi-info-light)] text-[var(--zabi-info-dark)] border border-[var(--zabi-info)]",
|
|
49
|
+
success: "bg-[var(--zabi-success-light)] text-[var(--zabi-success-dark)] border border-[var(--zabi-success)]",
|
|
50
|
+
warning: "bg-[var(--zabi-warning-light)] text-[var(--zabi-warning-dark)] border border-[var(--zabi-warning)]",
|
|
51
|
+
error: "bg-[var(--zabi-error-light)] text-[var(--zabi-error-dark)] border border-[var(--zabi-error)]"
|
|
53
52
|
});
|
|
54
|
-
}), se(() => y(
|
|
55
|
-
x(
|
|
53
|
+
}), se(() => y(i()), () => {
|
|
54
|
+
x(c, i() === "success" || i() === "info" ? "status" : "alert");
|
|
56
55
|
}), se(() => {
|
|
57
56
|
}, () => {
|
|
58
57
|
x(w, {
|
|
@@ -67,137 +66,134 @@ function $t(W, v) {
|
|
|
67
66
|
</svg>`,
|
|
68
67
|
error: `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
69
68
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
|
70
|
-
</svg>`,
|
|
71
|
-
"game-error": `<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
72
|
-
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
|
73
69
|
</svg>`
|
|
74
70
|
});
|
|
75
|
-
}), ye(),
|
|
76
|
-
var
|
|
71
|
+
}), ye(), ie();
|
|
72
|
+
var $ = Ye(), E = o($);
|
|
77
73
|
{
|
|
78
74
|
var O = (s) => {
|
|
79
75
|
var l = We();
|
|
80
|
-
te("click", l, F),
|
|
76
|
+
te("click", l, F), d(s, l);
|
|
81
77
|
};
|
|
82
|
-
|
|
78
|
+
M(E, (s) => {
|
|
83
79
|
t() && s(O);
|
|
84
80
|
});
|
|
85
81
|
}
|
|
86
|
-
var
|
|
87
|
-
Ne(T, () => (e(w), y(
|
|
88
|
-
var
|
|
82
|
+
var W = k(E, 2), h = o(W), T = o(h);
|
|
83
|
+
Ne(T, () => (e(w), y(i()), r(() => e(w)[i()])));
|
|
84
|
+
var U = k(h, 2), q = o(U);
|
|
89
85
|
{
|
|
90
86
|
var B = (s) => {
|
|
91
|
-
var l = Ge(), u =
|
|
92
|
-
I(() => Z(u, D())),
|
|
87
|
+
var l = Ge(), u = o(l);
|
|
88
|
+
I(() => Z(u, D())), d(s, l);
|
|
93
89
|
};
|
|
94
|
-
|
|
90
|
+
M(q, (s) => {
|
|
95
91
|
D() && s(B);
|
|
96
92
|
});
|
|
97
93
|
}
|
|
98
|
-
var Y = k(
|
|
94
|
+
var Y = k(q, 2);
|
|
99
95
|
{
|
|
100
96
|
var p = (s) => {
|
|
101
|
-
var l = Qe(), u =
|
|
102
|
-
I(() => Z(u, f())),
|
|
97
|
+
var l = Qe(), u = o(l);
|
|
98
|
+
I(() => Z(u, f())), d(s, l);
|
|
103
99
|
};
|
|
104
|
-
|
|
100
|
+
M(Y, (s) => {
|
|
105
101
|
f() && s(p);
|
|
106
102
|
});
|
|
107
103
|
}
|
|
108
|
-
var a = k(
|
|
104
|
+
var a = k(Y, 2);
|
|
109
105
|
fe(a, v, "default", {}, null), I(() => {
|
|
110
|
-
ee(
|
|
111
|
-
}),
|
|
106
|
+
ee($, 1, `relative rounded-md p-4 border ${e(n), y(i()), r(() => e(n)[i()]) ?? ""} transition-all duration-200 motion-reduce:transition-none ${m() ?? ""}`), H($, "role", e(c)), H($, "aria-live", i() === "success" || i() === "info" ? "polite" : "assertive"), ee(W, 1, `flex items-start gap-3 ${t() ? "pr-8" : ""}`);
|
|
107
|
+
}), d(N, $), oe();
|
|
112
108
|
}
|
|
113
109
|
var Ze = _('<button type="button" class="text-tertiary hover:text-primary focus:outline-none focus:ring-2 focus:ring-primary rounded-lg p-1 transition-colors" aria-label="Close dialog"><svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>'), Je = _('<div class="flex items-center justify-end gap-3 p-6 border-t border-primary bg-surface-secondary"><!></div>'), Xe = _('<div class="fixed inset-0 bg-black/60 backdrop-blur-sm z-modal-backdrop flex items-center justify-center p-4" role="presentation" tabindex="-1"><div class="bg-surface-elevated rounded-xl shadow-adaptive-xl max-w-md w-full max-h-[90vh] overflow-y-auto border border-primary focus:outline-none" role="dialog" aria-modal="true" aria-labelledby="dialog-title" tabindex="-1"><div class="flex items-center justify-between p-6 border-b border-primary"><h2 id="dialog-title" class="text-xl font-semibold text-primary"> </h2> <!></div> <div class="p-6 text-primary"><!></div> <!></div></div>');
|
|
114
|
-
function et(
|
|
110
|
+
function et(N, v) {
|
|
115
111
|
const n = Te(v);
|
|
116
112
|
ve(v, !1);
|
|
117
|
-
let
|
|
118
|
-
const D =
|
|
119
|
-
let f =
|
|
120
|
-
function
|
|
121
|
-
|
|
113
|
+
let c = j(v, "isOpen", 12, !1), w = j(v, "title", 8, ""), i = j(v, "showCloseButton", 8, !0);
|
|
114
|
+
const D = ce();
|
|
115
|
+
let f = K(), t = K(null);
|
|
116
|
+
function m() {
|
|
117
|
+
c(!1), D("close");
|
|
122
118
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
119
|
+
function z(h) {
|
|
120
|
+
h.target === h.currentTarget && m();
|
|
125
121
|
}
|
|
126
|
-
function F(
|
|
127
|
-
|
|
122
|
+
function F(h) {
|
|
123
|
+
h.key === "Escape" && m();
|
|
128
124
|
}
|
|
129
|
-
function
|
|
125
|
+
function $(h) {
|
|
130
126
|
var B;
|
|
131
|
-
if (!
|
|
127
|
+
if (!c()) return;
|
|
132
128
|
const T = (B = e(f)) == null ? void 0 : B.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
133
129
|
if (!T.length) return;
|
|
134
|
-
const
|
|
135
|
-
|
|
130
|
+
const U = T[0], q = T[T.length - 1];
|
|
131
|
+
h.key === "Tab" && (h.shiftKey ? document.activeElement === U && (h.preventDefault(), q.focus()) : document.activeElement === q && (h.preventDefault(), U.focus()));
|
|
136
132
|
}
|
|
137
133
|
Ie(() => () => {
|
|
138
134
|
e(t) && e(t).focus();
|
|
139
|
-
}), se(() => (y(
|
|
140
|
-
|
|
135
|
+
}), se(() => (y(c()), e(f)), () => {
|
|
136
|
+
c() && (x(t, document.activeElement), setTimeout(
|
|
141
137
|
() => {
|
|
142
138
|
var T;
|
|
143
|
-
const
|
|
144
|
-
|
|
139
|
+
const h = (T = e(f)) == null ? void 0 : T.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
140
|
+
h == null || h.focus();
|
|
145
141
|
},
|
|
146
142
|
0
|
|
147
143
|
));
|
|
148
|
-
}), ye(),
|
|
144
|
+
}), ye(), ie();
|
|
149
145
|
var E = re(), O = J(E);
|
|
150
146
|
{
|
|
151
|
-
var
|
|
152
|
-
var T = Xe(),
|
|
147
|
+
var W = (h) => {
|
|
148
|
+
var T = Xe(), U = o(T), q = o(U), B = o(q), Y = o(B), p = k(B, 2);
|
|
153
149
|
{
|
|
154
150
|
var a = (g) => {
|
|
155
|
-
var
|
|
156
|
-
te("click",
|
|
151
|
+
var b = Ze();
|
|
152
|
+
te("click", b, m), d(g, b);
|
|
157
153
|
};
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
M(p, (g) => {
|
|
155
|
+
i() && g(a);
|
|
160
156
|
});
|
|
161
157
|
}
|
|
162
|
-
var s = k(
|
|
158
|
+
var s = k(q, 2), l = o(s);
|
|
163
159
|
fe(l, v, "default", {}, null);
|
|
164
160
|
var u = k(s, 2);
|
|
165
161
|
{
|
|
166
162
|
var S = (g) => {
|
|
167
|
-
var
|
|
168
|
-
fe(
|
|
163
|
+
var b = Je(), L = o(b);
|
|
164
|
+
fe(L, v, "footer", {}, null), d(g, b);
|
|
169
165
|
};
|
|
170
|
-
|
|
166
|
+
M(u, (g) => {
|
|
171
167
|
r(() => n.footer) && g(S);
|
|
172
168
|
});
|
|
173
169
|
}
|
|
174
|
-
|
|
170
|
+
he(U, (g) => x(f, g), () => e(f)), I(() => Z(Y, w())), te("keydown", U, $), te("click", T, z), te("keydown", T, F), d(h, T);
|
|
175
171
|
};
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
M(O, (h) => {
|
|
173
|
+
c() && h(W);
|
|
178
174
|
});
|
|
179
175
|
}
|
|
180
|
-
|
|
176
|
+
d(N, E), oe();
|
|
181
177
|
}
|
|
182
|
-
var tt = _('<div class="relative group"><img alt="" class="w-full h-32 object-cover rounded-lg border border-stone-600"/> <div class="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center"><div class="flex gap-2"><!> <!></div></div></div>'), at = _('<div class="border-2 border-dashed border-stone-600 rounded-lg p-6 text-center hover:border-stone-500 transition-colors"><div class="space-y-3"><div class="w-12 h-12 mx-auto bg-stone-700 rounded-lg flex items-center justify-center"><svg class="w-6 h-6 text-stone-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg></div> <div><p class="text-stone-300 font-medium"> </p> <p class="text-stone-500 text-sm">Choose a file to upload</p></div> <div class="flex gap-2 justify-center"><!></div></div></div>'), rt = _('<div class="space-y-3"><div class="text-sm font-medium text-stone-300">Choose File</div> <input type="file" class="block w-full text-sm text-stone-300 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-blue-900/30 file:text-blue-300 hover:file:bg-blue-900/50"/> <p class="text-xs text-stone-500"> </p></div>'), st = _('<img alt="Preview" class="w-full h-48 object-cover rounded-lg border border-stone-600"/>'), nt = _('<div class="w-full h-48 bg-stone-700 rounded-lg border border-stone-600 flex items-center justify-center"><div class="text-center"><svg class="w-12 h-12 text-stone-400 mx-auto mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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"></path></svg> <p class="text-stone-300 text-sm"> </p></div></div>'), lt = _('<div class="absolute inset-0 bg-black/50 flex items-center justify-center rounded-lg"><div class="text-center"><div class="w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-2"></div> <p class="text-white text-sm">Uploading...</p></div></div>'),
|
|
183
|
-
function
|
|
178
|
+
var tt = _('<div class="relative group"><img alt="" class="w-full h-32 object-cover rounded-lg border border-stone-600"/> <div class="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity rounded-lg flex items-center justify-center"><div class="flex gap-2"><!> <!></div></div></div>'), at = _('<div class="border-2 border-dashed border-stone-600 rounded-lg p-6 text-center hover:border-stone-500 transition-colors"><div class="space-y-3"><div class="w-12 h-12 mx-auto bg-stone-700 rounded-lg flex items-center justify-center"><svg class="w-6 h-6 text-stone-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"></path></svg></div> <div><p class="text-stone-300 font-medium"> </p> <p class="text-stone-500 text-sm">Choose a file to upload</p></div> <div class="flex gap-2 justify-center"><!></div></div></div>'), rt = _('<div class="space-y-3"><div class="text-sm font-medium text-stone-300">Choose File</div> <input type="file" class="block w-full text-sm text-stone-300 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-blue-900/30 file:text-blue-300 hover:file:bg-blue-900/50"/> <p class="text-xs text-stone-500"> </p></div>'), st = _('<img alt="Preview" class="w-full h-48 object-cover rounded-lg border border-stone-600"/>'), nt = _('<div class="w-full h-48 bg-stone-700 rounded-lg border border-stone-600 flex items-center justify-center"><div class="text-center"><svg class="w-12 h-12 text-stone-400 mx-auto mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" 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"></path></svg> <p class="text-stone-300 text-sm"> </p></div></div>'), lt = _('<div class="absolute inset-0 bg-black/50 flex items-center justify-center rounded-lg"><div class="text-center"><div class="w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-2"></div> <p class="text-white text-sm">Uploading...</p></div></div>'), it = _('<div class="space-y-2"><div class="flex justify-between text-sm text-stone-400"><span>Uploading...</span> <span> </span></div> <div class="w-full bg-stone-700 rounded-full h-2"><div class="bg-blue-500 h-2 rounded-full transition-all duration-300"></div></div></div>'), ot = _('<div class="space-y-4"><div class="relative"><!> <!></div> <!></div>'), vt = _('<div class="space-y-4"><!></div>'), ct = _("<!> <!>", 1), dt = _('<div class="space-y-3"><!> <!></div>');
|
|
179
|
+
function $t(N, v) {
|
|
184
180
|
ve(v, !1);
|
|
185
|
-
let n =
|
|
181
|
+
let n = j(v, "value", 12, null), c = j(v, "disabled", 8, !1), w = j(v, "accept", 8, "image/*"), i = j(
|
|
186
182
|
v,
|
|
187
183
|
"maxSize",
|
|
188
184
|
8,
|
|
189
185
|
5 * 1024 * 1024
|
|
190
186
|
// 5MB default
|
|
191
|
-
), D =
|
|
192
|
-
const f =
|
|
193
|
-
let t =
|
|
187
|
+
), D = j(v, "placeholder", 8, "No image selected");
|
|
188
|
+
const f = ce();
|
|
189
|
+
let t = K(!1), m = K(null), z = K(null), F = K(!1), $ = K(0);
|
|
194
190
|
function E(a) {
|
|
195
191
|
const s = a.target;
|
|
196
192
|
if (!s.files || s.files.length === 0) return;
|
|
197
193
|
const l = s.files, u = l[0];
|
|
198
|
-
if (u.size >
|
|
194
|
+
if (u.size > i()) {
|
|
199
195
|
f("error", {
|
|
200
|
-
message: `File size must be less than ${Math.round(
|
|
196
|
+
message: `File size must be less than ${Math.round(i() / 1024 / 1024)}MB`
|
|
201
197
|
});
|
|
202
198
|
return;
|
|
203
199
|
}
|
|
@@ -205,90 +201,90 @@ function zt(W, v) {
|
|
|
205
201
|
f("error", { message: "Please select a valid file type" });
|
|
206
202
|
return;
|
|
207
203
|
}
|
|
208
|
-
x(
|
|
204
|
+
x(m, u), x(z, URL.createObjectURL(u)), f("upload", { files: l });
|
|
209
205
|
}
|
|
210
206
|
async function O() {
|
|
211
|
-
if (!(!e(
|
|
212
|
-
x(F, !0), x(
|
|
207
|
+
if (!(!e(m) || !e(z))) {
|
|
208
|
+
x(F, !0), x($, 0);
|
|
213
209
|
try {
|
|
214
210
|
const a = setInterval(
|
|
215
211
|
() => {
|
|
216
|
-
e(
|
|
212
|
+
e($) < 90 && x($, e($) + Math.random() * 10);
|
|
217
213
|
},
|
|
218
214
|
200
|
|
219
215
|
);
|
|
220
|
-
await new Promise((s) => setTimeout(s, 1e3)), clearInterval(a), x(
|
|
216
|
+
await new Promise((s) => setTimeout(s, 1e3)), clearInterval(a), x($, 100), n(e(z)), f("change", { value: e(z) }), x(t, !1), h();
|
|
221
217
|
} catch (a) {
|
|
222
218
|
f("error", { message: `Upload failed: ${a}` });
|
|
223
219
|
} finally {
|
|
224
|
-
x(F, !1), x(
|
|
220
|
+
x(F, !1), x($, 0);
|
|
225
221
|
}
|
|
226
222
|
}
|
|
227
223
|
}
|
|
228
|
-
function
|
|
224
|
+
function W() {
|
|
229
225
|
n(null), f("change", { value: null });
|
|
230
226
|
}
|
|
231
|
-
function
|
|
232
|
-
x(
|
|
227
|
+
function h() {
|
|
228
|
+
x(m, null), e(z) && (URL.revokeObjectURL(e(z)), x(z, null)), x($, 0);
|
|
233
229
|
}
|
|
234
230
|
function T() {
|
|
235
|
-
e(
|
|
231
|
+
e(z) && (URL.revokeObjectURL(e(z)), x(z, null));
|
|
236
232
|
}
|
|
237
233
|
Se(() => {
|
|
238
234
|
T();
|
|
239
|
-
}),
|
|
240
|
-
var
|
|
235
|
+
}), ie();
|
|
236
|
+
var U = dt(), q = o(U);
|
|
241
237
|
{
|
|
242
238
|
var B = (a) => {
|
|
243
|
-
var s = tt(), l =
|
|
239
|
+
var s = tt(), l = o(s), u = k(l, 2), S = o(u), g = o(S);
|
|
244
240
|
le(g, {
|
|
245
241
|
variant: "secondary",
|
|
246
242
|
size: "sm",
|
|
247
243
|
get disabled() {
|
|
248
|
-
return
|
|
244
|
+
return c();
|
|
249
245
|
},
|
|
250
246
|
$$events: { click: () => x(t, !0) },
|
|
251
|
-
children: (
|
|
247
|
+
children: (L, A) => {
|
|
252
248
|
var R = ne("Change");
|
|
253
|
-
|
|
249
|
+
d(L, R);
|
|
254
250
|
},
|
|
255
251
|
$$slots: { default: !0 }
|
|
256
252
|
});
|
|
257
|
-
var
|
|
258
|
-
le(
|
|
253
|
+
var b = k(g, 2);
|
|
254
|
+
le(b, {
|
|
259
255
|
variant: "danger",
|
|
260
256
|
size: "sm",
|
|
261
257
|
get disabled() {
|
|
262
|
-
return
|
|
258
|
+
return c();
|
|
263
259
|
},
|
|
264
|
-
$$events: { click:
|
|
265
|
-
children: (
|
|
260
|
+
$$events: { click: W },
|
|
261
|
+
children: (L, A) => {
|
|
266
262
|
var R = ne("Remove");
|
|
267
|
-
|
|
263
|
+
d(L, R);
|
|
268
264
|
},
|
|
269
265
|
$$slots: { default: !0 }
|
|
270
|
-
}), I(() => H(l, "src", n())),
|
|
266
|
+
}), I(() => H(l, "src", n())), d(a, s);
|
|
271
267
|
}, Y = (a) => {
|
|
272
|
-
var s = at(), l =
|
|
273
|
-
le(
|
|
268
|
+
var s = at(), l = o(s), u = k(o(l), 2), S = o(u), g = o(S), b = k(u, 2), L = o(b);
|
|
269
|
+
le(L, {
|
|
274
270
|
variant: "primary",
|
|
275
271
|
size: "sm",
|
|
276
272
|
get disabled() {
|
|
277
|
-
return
|
|
273
|
+
return c();
|
|
278
274
|
},
|
|
279
275
|
$$events: { click: () => x(t, !0) },
|
|
280
276
|
children: (A, R) => {
|
|
281
277
|
var V = ne("Upload File");
|
|
282
|
-
|
|
278
|
+
d(A, V);
|
|
283
279
|
},
|
|
284
280
|
$$slots: { default: !0 }
|
|
285
|
-
}), I(() => Z(g, D())),
|
|
281
|
+
}), I(() => Z(g, D())), d(a, s);
|
|
286
282
|
};
|
|
287
|
-
|
|
283
|
+
M(q, (a) => {
|
|
288
284
|
n() ? a(B) : a(Y, !1);
|
|
289
285
|
});
|
|
290
286
|
}
|
|
291
|
-
var p = k(
|
|
287
|
+
var p = k(q, 2);
|
|
292
288
|
et(p, {
|
|
293
289
|
title: "Upload File",
|
|
294
290
|
get isOpen() {
|
|
@@ -299,92 +295,92 @@ function zt(W, v) {
|
|
|
299
295
|
},
|
|
300
296
|
$$events: {
|
|
301
297
|
close: () => {
|
|
302
|
-
x(t, !1),
|
|
298
|
+
x(t, !1), h();
|
|
303
299
|
}
|
|
304
300
|
},
|
|
305
301
|
children: (a, s) => {
|
|
306
|
-
var l = vt(), u =
|
|
302
|
+
var l = vt(), u = o(l);
|
|
307
303
|
{
|
|
308
|
-
var S = (
|
|
309
|
-
var
|
|
304
|
+
var S = (b) => {
|
|
305
|
+
var L = rt(), A = k(o(L), 2), R = k(A, 2), V = o(R);
|
|
310
306
|
I(
|
|
311
307
|
(C) => {
|
|
312
308
|
H(A, "accept", w()), Z(V, `Max size: ${C ?? ""}MB`);
|
|
313
309
|
},
|
|
314
310
|
[
|
|
315
|
-
() => (y(
|
|
311
|
+
() => (y(i()), r(() => Math.round(i() / 1024 / 1024)))
|
|
316
312
|
]
|
|
317
|
-
), te("change", A, E),
|
|
318
|
-
}, g = (
|
|
319
|
-
var
|
|
313
|
+
), te("change", A, E), d(b, L);
|
|
314
|
+
}, g = (b) => {
|
|
315
|
+
var L = ot(), A = o(L), R = o(A);
|
|
320
316
|
{
|
|
321
317
|
var V = (P) => {
|
|
322
318
|
var Q = st();
|
|
323
|
-
I(() => H(Q, "src", e(
|
|
319
|
+
I(() => H(Q, "src", e(z))), d(P, Q);
|
|
324
320
|
}, C = (P) => {
|
|
325
|
-
var Q = nt(),
|
|
326
|
-
I(() => Z(
|
|
321
|
+
var Q = nt(), de = o(Q), ge = k(o(de), 2), be = o(ge);
|
|
322
|
+
I(() => Z(be, (e(m), r(() => e(m).name)))), d(P, Q);
|
|
327
323
|
};
|
|
328
|
-
|
|
329
|
-
e(
|
|
324
|
+
M(R, (P) => {
|
|
325
|
+
e(m), r(() => e(m).type.startsWith("image/")) ? P(V) : P(C, !1);
|
|
330
326
|
});
|
|
331
327
|
}
|
|
332
328
|
var G = k(R, 2);
|
|
333
329
|
{
|
|
334
330
|
var ae = (P) => {
|
|
335
331
|
var Q = lt();
|
|
336
|
-
|
|
332
|
+
d(P, Q);
|
|
337
333
|
};
|
|
338
|
-
|
|
334
|
+
M(G, (P) => {
|
|
339
335
|
e(F) && P(ae);
|
|
340
336
|
});
|
|
341
337
|
}
|
|
342
338
|
var pe = k(A, 2);
|
|
343
339
|
{
|
|
344
340
|
var X = (P) => {
|
|
345
|
-
var Q =
|
|
341
|
+
var Q = it(), de = o(Q), ge = k(o(de), 2), be = o(ge), ke = k(de, 2), we = o(ke);
|
|
346
342
|
I(
|
|
347
|
-
(
|
|
348
|
-
Z(
|
|
343
|
+
(ze) => {
|
|
344
|
+
Z(be, `${ze ?? ""}%`), Ue(we, `width: ${e($) ?? ""}%`);
|
|
349
345
|
},
|
|
350
346
|
[
|
|
351
|
-
() => (e(
|
|
347
|
+
() => (e($), r(() => Math.round(e($))))
|
|
352
348
|
]
|
|
353
|
-
),
|
|
349
|
+
), d(P, Q);
|
|
354
350
|
};
|
|
355
|
-
|
|
351
|
+
M(pe, (P) => {
|
|
356
352
|
e(F) && P(X);
|
|
357
353
|
});
|
|
358
354
|
}
|
|
359
|
-
|
|
355
|
+
d(b, L);
|
|
360
356
|
};
|
|
361
|
-
|
|
362
|
-
e(
|
|
357
|
+
M(u, (b) => {
|
|
358
|
+
e(m) ? b(g, !1) : b(S);
|
|
363
359
|
});
|
|
364
360
|
}
|
|
365
|
-
|
|
361
|
+
d(a, l);
|
|
366
362
|
},
|
|
367
363
|
$$slots: {
|
|
368
364
|
default: !0,
|
|
369
365
|
footer: (a, s) => {
|
|
370
|
-
var l =
|
|
366
|
+
var l = ct(), u = J(l);
|
|
371
367
|
le(u, {
|
|
372
368
|
variant: "secondary",
|
|
373
369
|
$$events: {
|
|
374
370
|
click: () => {
|
|
375
|
-
x(t, !1),
|
|
371
|
+
x(t, !1), h();
|
|
376
372
|
}
|
|
377
373
|
},
|
|
378
|
-
children: (
|
|
374
|
+
children: (b, L) => {
|
|
379
375
|
var A = ne("Cancel");
|
|
380
|
-
|
|
376
|
+
d(b, A);
|
|
381
377
|
},
|
|
382
378
|
$$slots: { default: !0 }
|
|
383
379
|
});
|
|
384
380
|
var S = k(u, 2);
|
|
385
381
|
{
|
|
386
|
-
var g = (
|
|
387
|
-
le(
|
|
382
|
+
var g = (b) => {
|
|
383
|
+
le(b, {
|
|
388
384
|
variant: "primary",
|
|
389
385
|
get disabled() {
|
|
390
386
|
return e(F);
|
|
@@ -393,40 +389,40 @@ function zt(W, v) {
|
|
|
393
389
|
return e(F);
|
|
394
390
|
},
|
|
395
391
|
$$events: { click: O },
|
|
396
|
-
children: (
|
|
392
|
+
children: (L, A) => {
|
|
397
393
|
var R = ne();
|
|
398
|
-
I(() => Z(R, e(F) ? "Uploading..." : "Upload File")),
|
|
394
|
+
I(() => Z(R, e(F) ? "Uploading..." : "Upload File")), d(L, R);
|
|
399
395
|
},
|
|
400
396
|
$$slots: { default: !0 }
|
|
401
397
|
});
|
|
402
398
|
};
|
|
403
|
-
|
|
404
|
-
e(
|
|
399
|
+
M(S, (b) => {
|
|
400
|
+
e(m) && b(g);
|
|
405
401
|
});
|
|
406
402
|
}
|
|
407
|
-
|
|
403
|
+
d(a, l);
|
|
408
404
|
}
|
|
409
405
|
},
|
|
410
406
|
$$legacy: !0
|
|
411
|
-
}),
|
|
407
|
+
}), d(N, U), oe();
|
|
412
408
|
}
|
|
413
409
|
var ut = _("<div><!></div>"), ft = _('<div class="flex flex-wrap gap-4"></div>');
|
|
414
|
-
function Ct(
|
|
410
|
+
function Ct(N, v) {
|
|
415
411
|
ve(v, !1);
|
|
416
|
-
let n =
|
|
417
|
-
const w =
|
|
418
|
-
function
|
|
412
|
+
let n = j(v, "values", 28, () => ({})), c = j(v, "fields", 24, () => []);
|
|
413
|
+
const w = ce();
|
|
414
|
+
function i(f) {
|
|
419
415
|
const t = f.detail;
|
|
420
416
|
t && typeof t == "object" && w("input", t);
|
|
421
417
|
}
|
|
422
|
-
|
|
418
|
+
ie();
|
|
423
419
|
var D = ft();
|
|
424
|
-
xe(D, 5,
|
|
425
|
-
var
|
|
420
|
+
xe(D, 5, c, (f) => f.key, (f, t) => {
|
|
421
|
+
var m = ut(), z = o(m);
|
|
426
422
|
{
|
|
427
423
|
var F = (E) => {
|
|
428
424
|
{
|
|
429
|
-
let O =
|
|
425
|
+
let O = me(() => (e(t), r(() => e(t).rows || 3)));
|
|
430
426
|
Ae(E, {
|
|
431
427
|
get label() {
|
|
432
428
|
return e(t), r(() => e(t).label);
|
|
@@ -445,22 +441,22 @@ function Ct(W, v) {
|
|
|
445
441
|
get value() {
|
|
446
442
|
return n()[e(t).key];
|
|
447
443
|
},
|
|
448
|
-
set value(
|
|
449
|
-
n(n()[e(t).key] =
|
|
444
|
+
set value(W) {
|
|
445
|
+
n(n()[e(t).key] = W, !0);
|
|
450
446
|
},
|
|
451
|
-
$$events: { input:
|
|
447
|
+
$$events: { input: i, change: i },
|
|
452
448
|
$$legacy: !0
|
|
453
449
|
});
|
|
454
450
|
}
|
|
455
|
-
},
|
|
456
|
-
var O = re(),
|
|
451
|
+
}, $ = (E) => {
|
|
452
|
+
var O = re(), W = J(O);
|
|
457
453
|
{
|
|
458
|
-
var
|
|
454
|
+
var h = (U) => {
|
|
459
455
|
{
|
|
460
|
-
let
|
|
461
|
-
Fe(
|
|
456
|
+
let q = me(() => (e(t), r(() => e(t).options || [])));
|
|
457
|
+
Fe(U, {
|
|
462
458
|
get options() {
|
|
463
|
-
return e(
|
|
459
|
+
return e(q);
|
|
464
460
|
},
|
|
465
461
|
get label() {
|
|
466
462
|
return e(t), r(() => e(t).label);
|
|
@@ -479,12 +475,12 @@ function Ct(W, v) {
|
|
|
479
475
|
set value(B) {
|
|
480
476
|
n(n()[e(t).key] = B, !0);
|
|
481
477
|
},
|
|
482
|
-
$$events: { input:
|
|
478
|
+
$$events: { input: i, change: i },
|
|
483
479
|
$$legacy: !0
|
|
484
480
|
});
|
|
485
481
|
}
|
|
486
|
-
}, T = (
|
|
487
|
-
var
|
|
482
|
+
}, T = (U) => {
|
|
483
|
+
var q = re(), B = J(q);
|
|
488
484
|
{
|
|
489
485
|
var Y = (a) => {
|
|
490
486
|
Re(a, {
|
|
@@ -502,7 +498,7 @@ function Ct(W, v) {
|
|
|
502
498
|
set checked(s) {
|
|
503
499
|
n(n()[e(t).key] = s, !0);
|
|
504
500
|
},
|
|
505
|
-
$$events: { input:
|
|
501
|
+
$$events: { input: i, change: i },
|
|
506
502
|
$$legacy: !0
|
|
507
503
|
});
|
|
508
504
|
}, p = (a) => {
|
|
@@ -516,14 +512,14 @@ function Ct(W, v) {
|
|
|
516
512
|
get checked() {
|
|
517
513
|
return n()[e(t).key];
|
|
518
514
|
},
|
|
519
|
-
set checked(
|
|
520
|
-
n(n()[e(t).key] =
|
|
515
|
+
set checked(b) {
|
|
516
|
+
n(n()[e(t).key] = b, !0);
|
|
521
517
|
},
|
|
522
|
-
$$events: { input:
|
|
518
|
+
$$events: { input: i, change: i },
|
|
523
519
|
$$legacy: !0
|
|
524
520
|
});
|
|
525
521
|
}, S = (g) => {
|
|
526
|
-
var
|
|
522
|
+
var b = re(), L = J(b);
|
|
527
523
|
{
|
|
528
524
|
var A = (V) => {
|
|
529
525
|
Ve(V, {
|
|
@@ -541,7 +537,7 @@ function Ct(W, v) {
|
|
|
541
537
|
set value(C) {
|
|
542
538
|
n(n()[e(t).key] = C, !0);
|
|
543
539
|
},
|
|
544
|
-
$$events: { input:
|
|
540
|
+
$$events: { input: i, change: i },
|
|
545
541
|
$$legacy: !0
|
|
546
542
|
});
|
|
547
543
|
}, R = (V) => {
|
|
@@ -562,12 +558,12 @@ function Ct(W, v) {
|
|
|
562
558
|
set value(P) {
|
|
563
559
|
n(n()[e(t).key] = P, !0);
|
|
564
560
|
},
|
|
565
|
-
$$events: { input:
|
|
561
|
+
$$events: { input: i, change: i },
|
|
566
562
|
$$legacy: !0
|
|
567
563
|
});
|
|
568
564
|
}, pe = (X) => {
|
|
569
565
|
{
|
|
570
|
-
let P =
|
|
566
|
+
let P = me(() => (e(t), r(() => e(t).type || "text")));
|
|
571
567
|
Ke(X, {
|
|
572
568
|
get type() {
|
|
573
569
|
return e(P);
|
|
@@ -589,12 +585,12 @@ function Ct(W, v) {
|
|
|
589
585
|
set value(Q) {
|
|
590
586
|
n(n()[e(t).key] = Q, !0);
|
|
591
587
|
},
|
|
592
|
-
$$events: { input:
|
|
588
|
+
$$events: { input: i, change: i },
|
|
593
589
|
$$legacy: !0
|
|
594
590
|
});
|
|
595
591
|
}
|
|
596
592
|
};
|
|
597
|
-
|
|
593
|
+
M(
|
|
598
594
|
G,
|
|
599
595
|
(X) => {
|
|
600
596
|
e(t), r(() => e(t).type === "textalignment") ? X(ae) : X(pe, !1);
|
|
@@ -602,19 +598,19 @@ function Ct(W, v) {
|
|
|
602
598
|
!0
|
|
603
599
|
);
|
|
604
600
|
}
|
|
605
|
-
|
|
601
|
+
d(V, C);
|
|
606
602
|
};
|
|
607
|
-
|
|
608
|
-
|
|
603
|
+
M(
|
|
604
|
+
L,
|
|
609
605
|
(V) => {
|
|
610
606
|
e(t), r(() => e(t).type === "colorpicker") ? V(A) : V(R, !1);
|
|
611
607
|
},
|
|
612
608
|
!0
|
|
613
609
|
);
|
|
614
610
|
}
|
|
615
|
-
|
|
611
|
+
d(g, b);
|
|
616
612
|
};
|
|
617
|
-
|
|
613
|
+
M(
|
|
618
614
|
l,
|
|
619
615
|
(g) => {
|
|
620
616
|
e(t), r(() => e(t).type === "toggle") ? g(u) : g(S, !1);
|
|
@@ -622,9 +618,9 @@ function Ct(W, v) {
|
|
|
622
618
|
!0
|
|
623
619
|
);
|
|
624
620
|
}
|
|
625
|
-
|
|
621
|
+
d(a, s);
|
|
626
622
|
};
|
|
627
|
-
|
|
623
|
+
M(
|
|
628
624
|
B,
|
|
629
625
|
(a) => {
|
|
630
626
|
e(t), r(() => e(t).type === "checkbox") ? a(Y) : a(p, !1);
|
|
@@ -632,30 +628,30 @@ function Ct(W, v) {
|
|
|
632
628
|
!0
|
|
633
629
|
);
|
|
634
630
|
}
|
|
635
|
-
|
|
631
|
+
d(U, q);
|
|
636
632
|
};
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
(
|
|
640
|
-
e(t), r(() => e(t).type === "select") ?
|
|
633
|
+
M(
|
|
634
|
+
W,
|
|
635
|
+
(U) => {
|
|
636
|
+
e(t), r(() => e(t).type === "select") ? U(h) : U(T, !1);
|
|
641
637
|
},
|
|
642
638
|
!0
|
|
643
639
|
);
|
|
644
640
|
}
|
|
645
|
-
|
|
641
|
+
d(E, O);
|
|
646
642
|
};
|
|
647
|
-
|
|
648
|
-
e(t), r(() => e(t).type === "textarea") ? E(F) : E(
|
|
643
|
+
M(z, (E) => {
|
|
644
|
+
e(t), r(() => e(t).type === "textarea") ? E(F) : E($, !1);
|
|
649
645
|
});
|
|
650
646
|
}
|
|
651
|
-
I(() => ee(
|
|
652
|
-
}),
|
|
647
|
+
I(() => ee(m, 1, `flex-${e(t), r(() => e(t).flex === "full" ? "none" : e(t).flex || "1") ?? ""} ${e(t), r(() => e(t).type === "textarea" || e(t).key === "title" || e(t).key === "subtitle" || e(t).flex === "full" ? "w-full" : "w-full sm:w-auto sm:flex-1") ?? ""} min-w-0 ${e(t), r(() => e(t).type === "toggle" ? "flex items-center justify-center" : "") ?? ""}`)), d(f, m);
|
|
648
|
+
}), d(N, D), oe();
|
|
653
649
|
}
|
|
654
|
-
var pt =
|
|
650
|
+
var pt = Le('<svg fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" clip-rule="evenodd" class="svelte-fn6h9a"></path></svg>'), gt = _(`<span class="
|
|
655
651
|
ml-1 px-1.5 py-0.5 text-xs font-medium
|
|
656
652
|
bg-primary-100 text-primary-800 rounded-full
|
|
657
653
|
dark:bg-primary-900 dark:text-primary-200
|
|
658
|
-
svelte-fn6h9a"> </span>`),
|
|
654
|
+
svelte-fn6h9a"> </span>`), bt = _('<div class="absolute bottom-0 left-0 right-0 h-0.5 bg-primary-500 rounded-full svelte-fn6h9a"></div>'), mt = _('<button type="button" role="tab"><!> <span class="svelte-fn6h9a"> </span> <!></button> <!>', 1), ht = _('<div role="tabpanel"><!></div>'), xt = _('<div><div role="tablist" tabindex="0"></div> <div class="tab-panels svelte-fn6h9a"></div></div>');
|
|
659
655
|
const yt = {
|
|
660
656
|
hash: "svelte-fn6h9a",
|
|
661
657
|
code: `
|
|
@@ -680,11 +676,11 @@ const yt = {
|
|
|
680
676
|
|
|
681
677
|
/* Vertical tabs specific styles */.tabs-container.vertical.svelte-fn6h9a {align-items:flex-start;}.tabs-container.vertical.svelte-fn6h9a [role="tablist"]:where(.svelte-fn6h9a) {min-width:200px;}.tabs-container.vertical.svelte-fn6h9a [role="tab"]:where(.svelte-fn6h9a) {justify-content:flex-start;text-align:left;}`
|
|
682
678
|
};
|
|
683
|
-
function
|
|
684
|
-
ve(v, !1),
|
|
685
|
-
let n =
|
|
686
|
-
const
|
|
687
|
-
let
|
|
679
|
+
function jt(N, v) {
|
|
680
|
+
ve(v, !1), qe(N, yt);
|
|
681
|
+
let n = j(v, "tabs", 24, () => []), c = j(v, "activeTab", 12, ""), w = j(v, "variant", 8, "default"), i = j(v, "size", 8, "md"), D = j(v, "orientation", 8, "horizontal"), f = j(v, "fullWidth", 8, !1), t = j(v, "className", 8, "");
|
|
682
|
+
const m = ce();
|
|
683
|
+
let z = K(), F = K(), $ = K(0);
|
|
688
684
|
const E = {
|
|
689
685
|
sm: { tab: "px-3 py-1.5 text-sm", panel: "p-3", icon: "w-4 h-4" },
|
|
690
686
|
md: { tab: "px-4 py-2 text-base", panel: "p-4", icon: "w-5 h-5" },
|
|
@@ -715,16 +711,16 @@ function Mt(W, v) {
|
|
|
715
711
|
panel: "mt-4"
|
|
716
712
|
}
|
|
717
713
|
};
|
|
718
|
-
function
|
|
714
|
+
function W(p, a) {
|
|
719
715
|
if (p.disabled) {
|
|
720
716
|
a.preventDefault();
|
|
721
717
|
return;
|
|
722
718
|
}
|
|
723
|
-
|
|
719
|
+
c(p.id), m("change", { activeTab: c(), tab: p }), m("tabClick", { tab: p, event: a });
|
|
724
720
|
}
|
|
725
|
-
function
|
|
726
|
-
if (!e(
|
|
727
|
-
const a = Array.from(e(
|
|
721
|
+
function h(p) {
|
|
722
|
+
if (!e(z)) return;
|
|
723
|
+
const a = Array.from(e(z).querySelectorAll('[role="tab"]')), s = a.findIndex((u) => u === document.activeElement);
|
|
728
724
|
let l = s;
|
|
729
725
|
switch (p.key) {
|
|
730
726
|
case "ArrowRight":
|
|
@@ -752,53 +748,53 @@ function Mt(W, v) {
|
|
|
752
748
|
}
|
|
753
749
|
function T(p) {
|
|
754
750
|
var s;
|
|
755
|
-
const a = (s = e(
|
|
751
|
+
const a = (s = e(z)) == null ? void 0 : s.querySelector(`[data-tab-id="${p}"]`);
|
|
756
752
|
a == null || a.focus();
|
|
757
753
|
}
|
|
758
|
-
se(() => (y(n()), y(
|
|
759
|
-
n().length > 0 && !
|
|
760
|
-
}), se(() => (y(n()), y(
|
|
761
|
-
x(
|
|
754
|
+
se(() => (y(n()), y(c())), () => {
|
|
755
|
+
n().length > 0 && !c() && c(n()[0].id);
|
|
756
|
+
}), se(() => (y(n()), y(c())), () => {
|
|
757
|
+
x($, n().findIndex((p) => p.id === c()));
|
|
762
758
|
}), ye();
|
|
763
|
-
var
|
|
764
|
-
|
|
765
|
-
var
|
|
759
|
+
var U = { focusTab: T };
|
|
760
|
+
ie();
|
|
761
|
+
var q = xt(), B = o(q);
|
|
766
762
|
xe(B, 5, n, _e, (p, a) => {
|
|
767
|
-
var s =
|
|
763
|
+
var s = mt(), l = J(s), u = o(l);
|
|
768
764
|
{
|
|
769
765
|
var S = (C) => {
|
|
770
|
-
var G = pt(), ae =
|
|
766
|
+
var G = pt(), ae = o(G);
|
|
771
767
|
I(() => {
|
|
772
768
|
ee(
|
|
773
769
|
G,
|
|
774
770
|
0,
|
|
775
|
-
De((y(
|
|
771
|
+
De((y(i()), r(() => E[i()].icon))),
|
|
776
772
|
"svelte-fn6h9a"
|
|
777
773
|
), H(ae, "d", (e(a), r(() => e(a).icon)));
|
|
778
|
-
}),
|
|
774
|
+
}), d(C, G);
|
|
779
775
|
};
|
|
780
|
-
|
|
776
|
+
M(u, (C) => {
|
|
781
777
|
e(a), r(() => e(a).icon) && C(S);
|
|
782
778
|
});
|
|
783
779
|
}
|
|
784
|
-
var g = k(u, 2),
|
|
780
|
+
var g = k(u, 2), b = o(g), L = k(g, 2);
|
|
785
781
|
{
|
|
786
782
|
var A = (C) => {
|
|
787
|
-
var G = gt(), ae =
|
|
788
|
-
I(() => Z(ae, (e(a), r(() => e(a).badge)))),
|
|
783
|
+
var G = gt(), ae = o(G);
|
|
784
|
+
I(() => Z(ae, (e(a), r(() => e(a).badge)))), d(C, G);
|
|
789
785
|
};
|
|
790
|
-
|
|
786
|
+
M(L, (C) => {
|
|
791
787
|
e(a), r(() => e(a).badge) && C(A);
|
|
792
788
|
});
|
|
793
789
|
}
|
|
794
790
|
var R = k(l, 2);
|
|
795
791
|
{
|
|
796
792
|
var V = (C) => {
|
|
797
|
-
var G =
|
|
798
|
-
|
|
793
|
+
var G = bt();
|
|
794
|
+
d(C, G);
|
|
799
795
|
};
|
|
800
|
-
|
|
801
|
-
y(w()), e(a), y(
|
|
796
|
+
M(R, (C) => {
|
|
797
|
+
y(w()), e(a), y(c()), r(() => w() === "underline" && e(a).id === c()) && C(V);
|
|
802
798
|
});
|
|
803
799
|
}
|
|
804
800
|
I(() => {
|
|
@@ -806,27 +802,27 @@ function Mt(W, v) {
|
|
|
806
802
|
l,
|
|
807
803
|
1,
|
|
808
804
|
`
|
|
809
|
-
${y(
|
|
805
|
+
${y(i()), r(() => E[i()].tab) ?? ""}
|
|
810
806
|
${y(w()), r(() => O[w()].tab) ?? ""}
|
|
811
|
-
${e(a), y(
|
|
807
|
+
${e(a), y(c()), y(w()), r(() => e(a).id === c() ? O[w()].activeTab : "") ?? ""}
|
|
812
808
|
${e(a), r(() => e(a).disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer") ?? ""}
|
|
813
809
|
${f() ? "flex-1" : ""}
|
|
814
810
|
flex items-center justify-center gap-2
|
|
815
811
|
`,
|
|
816
812
|
"svelte-fn6h9a"
|
|
817
|
-
), H(l, "aria-selected", (e(a), y(
|
|
818
|
-
}), te("click", l, (C) =>
|
|
819
|
-
}),
|
|
813
|
+
), H(l, "aria-selected", (e(a), y(c()), r(() => e(a).id === c()))), H(l, "aria-controls", `tabpanel-${e(a), r(() => e(a).id) ?? ""}`), H(l, "aria-disabled", (e(a), r(() => e(a).disabled))), H(l, "tabindex", (e(a), y(c()), r(() => e(a).id === c() ? 0 : -1))), Z(b, (e(a), r(() => e(a).label)));
|
|
814
|
+
}), te("click", l, (C) => W(e(a), C)), d(p, s);
|
|
815
|
+
}), he(B, (p) => x(z, p), () => e(z));
|
|
820
816
|
var Y = k(B, 2);
|
|
821
817
|
return xe(Y, 5, n, _e, (p, a) => {
|
|
822
|
-
var s =
|
|
818
|
+
var s = ht(), l = o(s);
|
|
823
819
|
{
|
|
824
820
|
var u = (S) => {
|
|
825
|
-
var g = re(),
|
|
826
|
-
fe(
|
|
821
|
+
var g = re(), b = J(g);
|
|
822
|
+
fe(b, v, "content", {}, null), d(S, g);
|
|
827
823
|
};
|
|
828
|
-
|
|
829
|
-
e(a), y(
|
|
824
|
+
M(l, (S) => {
|
|
825
|
+
e(a), y(c()), r(() => e(a).id === c()) && S(u);
|
|
830
826
|
});
|
|
831
827
|
}
|
|
832
828
|
I(() => {
|
|
@@ -834,15 +830,15 @@ function Mt(W, v) {
|
|
|
834
830
|
s,
|
|
835
831
|
1,
|
|
836
832
|
`
|
|
837
|
-
${y(
|
|
833
|
+
${y(i()), r(() => E[i()].panel) ?? ""}
|
|
838
834
|
${y(w()), r(() => O[w()].panel) ?? ""}
|
|
839
|
-
${e(a), y(
|
|
835
|
+
${e(a), y(c()), r(() => e(a).id === c() ? "block" : "hidden") ?? ""}
|
|
840
836
|
`,
|
|
841
837
|
"svelte-fn6h9a"
|
|
842
838
|
);
|
|
843
|
-
}), Ee(3, s, () => Pe, () => ({ duration: 200 })),
|
|
844
|
-
}),
|
|
845
|
-
ee(
|
|
839
|
+
}), Ee(3, s, () => Pe, () => ({ duration: 200 })), d(p, s);
|
|
840
|
+
}), he(Y, (p) => x(F, p), () => e(F)), I(() => {
|
|
841
|
+
ee(q, 1, `tabs-container ${D() === "vertical" ? "flex" : ""} ${t() ?? ""}`, "svelte-fn6h9a"), ee(
|
|
846
842
|
B,
|
|
847
843
|
1,
|
|
848
844
|
`
|
|
@@ -852,12 +848,12 @@ function Mt(W, v) {
|
|
|
852
848
|
`,
|
|
853
849
|
"svelte-fn6h9a"
|
|
854
850
|
), H(B, "aria-orientation", D());
|
|
855
|
-
}), te("keydown", B,
|
|
851
|
+
}), te("keydown", B, h), d(N, q), Be(v, "focusTab", T), oe(U);
|
|
856
852
|
}
|
|
857
853
|
export {
|
|
858
|
-
|
|
859
|
-
|
|
854
|
+
zt as A,
|
|
855
|
+
$t as I,
|
|
860
856
|
Ct as K,
|
|
861
857
|
et as M,
|
|
862
|
-
|
|
858
|
+
jt as T
|
|
863
859
|
};
|