@jsg-developer/vue-pack 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DEPENDENCY-LICENSES.txt +1 -1075
- package/dist/TabelData.vue_vue_type_script_setup_true_lang-DcKNY6tx.js +2164 -0
- package/dist/TabelData.vue_vue_type_script_setup_true_lang-OEDcnffc.cjs +1 -0
- package/dist/init.cjs.js +1 -1
- package/dist/init.es.js +1 -1
- package/dist/jsgd-vue-pack.cjs.js +1 -1
- package/dist/jsgd-vue-pack.es.js +10 -10
- package/dist/plugin/vue.cjs.js +1 -1
- package/dist/plugin/vue.es.js +41 -41
- package/dist/quill.snow-Bv2PnGeu.cjs +15 -0
- package/dist/quill.snow-CF-SW6JG.js +6297 -0
- package/dist/vue-pack.css +1 -0
- package/package.json +6 -4
- package/dist/TabelData-C_eyn6Uq.cjs +0 -1
- package/dist/TabelData-fKFaSnkC.js +0 -2142
- package/dist/TabelData.vue_vue_type_style_index_0_scoped_76b9b7a6_lang-Dtm1AO8H.js +0 -13685
- package/dist/TabelData.vue_vue_type_style_index_0_scoped_76b9b7a6_lang-jjKlGR9H.cjs +0 -64
- package/dist/jsgd-vue-pack.css +0 -7
|
@@ -0,0 +1,2164 @@
|
|
|
1
|
+
import { defineComponent as ge, createElementBlock as a, openBlock as d, mergeProps as Ve, renderSlot as Re, createTextVNode as re, toDisplayString as y, ref as I, computed as X, inject as Ze, resolveComponent as Je, createCommentVNode as N, createVNode as S, createElementVNode as s, unref as l, normalizeClass as Y, Fragment as G, renderList as R, createBlock as ie, normalizeStyle as Te, onMounted as Be, onUnmounted as Qe, Transition as we, withCtx as _e, withModifiers as Xe, watch as De, nextTick as Ce, withKeys as Ee, toRaw as Me, provide as Ye, withDirectives as Oe, isRef as Ke, vModelText as et, vModelCheckbox as Le } from "vue";
|
|
2
|
+
import tt from "dompurify";
|
|
3
|
+
import { y as ze, aa as Ue, K as ve, a9 as fe, ab as st, J as dt, I as He, L as at, _ as lt } from "./quill.snow-CF-SW6JG.js";
|
|
4
|
+
const nt = ["src", "alt"], aa = /* @__PURE__ */ ge({
|
|
5
|
+
__name: "BaseImage",
|
|
6
|
+
props: {
|
|
7
|
+
src: {},
|
|
8
|
+
alt: {}
|
|
9
|
+
},
|
|
10
|
+
setup(e) {
|
|
11
|
+
return (u, r) => (d(), a("img", Ve({
|
|
12
|
+
src: e.src,
|
|
13
|
+
alt: e.alt,
|
|
14
|
+
loading: "lazy",
|
|
15
|
+
decoding: "async",
|
|
16
|
+
class: "jsgd-object-cover"
|
|
17
|
+
}, u.$attrs), null, 16, nt));
|
|
18
|
+
}
|
|
19
|
+
}), ot = { class: "jsgd-block jsgd-mb-2 jsgd-cursor-default jsgd-transition-colors jsgd-duration-200 jsgd-text-slate-700 dark:jsgd-text-slate-300 jsgd-text-sm md:jsgd-text-base jsgd-font-medium hover:jsgd-animate-subtle-glow" }, z = /* @__PURE__ */ ge({
|
|
20
|
+
__name: "BaseLabel",
|
|
21
|
+
props: {
|
|
22
|
+
label: {}
|
|
23
|
+
},
|
|
24
|
+
setup(e) {
|
|
25
|
+
return (u, r) => (d(), a("label", ot, [
|
|
26
|
+
Re(u.$slots, "default", {}, () => [
|
|
27
|
+
re(y(e.label), 1)
|
|
28
|
+
])
|
|
29
|
+
]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function Se(e = "id-ID", u = "Asia/Jakarta") {
|
|
33
|
+
let r = e, n = u;
|
|
34
|
+
try {
|
|
35
|
+
typeof navigator < "u" && (r = navigator.language || e), n = Intl.DateTimeFormat().resolvedOptions().timeZone || u;
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
return { locale: r, timeZone: n };
|
|
39
|
+
}
|
|
40
|
+
function Ie(e, u = "id-ID") {
|
|
41
|
+
const r = Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
42
|
+
return r.length > 0 ? r[0] : u;
|
|
43
|
+
}
|
|
44
|
+
function Ne(e) {
|
|
45
|
+
return e instanceof Date && !isNaN(e.getTime());
|
|
46
|
+
}
|
|
47
|
+
const rt = (e) => {
|
|
48
|
+
try {
|
|
49
|
+
if (!e) return "-";
|
|
50
|
+
const u = new Date(e);
|
|
51
|
+
if (!Ne(u)) return e;
|
|
52
|
+
const { locale: r, timeZone: n } = Se();
|
|
53
|
+
return u.toLocaleDateString(Ie(r), {
|
|
54
|
+
weekday: "long",
|
|
55
|
+
year: "numeric",
|
|
56
|
+
month: "long",
|
|
57
|
+
day: "numeric",
|
|
58
|
+
timeZone: n
|
|
59
|
+
});
|
|
60
|
+
} catch {
|
|
61
|
+
return e;
|
|
62
|
+
}
|
|
63
|
+
}, it = (e) => {
|
|
64
|
+
try {
|
|
65
|
+
if (!e) return "-";
|
|
66
|
+
const u = /* @__PURE__ */ new Date(`1970-01-01T${e}`);
|
|
67
|
+
if (!Ne(u)) return e;
|
|
68
|
+
const { locale: r, timeZone: n } = Se();
|
|
69
|
+
return u.toLocaleTimeString(Ie(r), {
|
|
70
|
+
hour: "2-digit",
|
|
71
|
+
minute: "2-digit",
|
|
72
|
+
timeZone: n
|
|
73
|
+
});
|
|
74
|
+
} catch {
|
|
75
|
+
return e;
|
|
76
|
+
}
|
|
77
|
+
}, gt = (e) => {
|
|
78
|
+
try {
|
|
79
|
+
if (!e) return "-";
|
|
80
|
+
const u = new Date(e);
|
|
81
|
+
if (!Ne(u)) return e;
|
|
82
|
+
const { locale: r, timeZone: n } = Se();
|
|
83
|
+
return u.toLocaleString(Ie(r), {
|
|
84
|
+
weekday: "short",
|
|
85
|
+
year: "numeric",
|
|
86
|
+
month: "short",
|
|
87
|
+
day: "numeric",
|
|
88
|
+
hour: "2-digit",
|
|
89
|
+
minute: "2-digit",
|
|
90
|
+
timeZone: n
|
|
91
|
+
});
|
|
92
|
+
} catch {
|
|
93
|
+
return e;
|
|
94
|
+
}
|
|
95
|
+
}, ut = ["id"], ct = { key: 0 }, jt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, bt = { key: 1 }, ft = ["innerHTML"], mt = {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
98
|
+
}, ht = { key: 2 }, vt = ["innerHTML"], yt = {
|
|
99
|
+
key: 1,
|
|
100
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
101
|
+
}, kt = { key: 3 }, xt = { class: "jsgd-flex jsgd-items-center jsgd-gap-4" }, pt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-font-mono" }, wt = { key: 4 }, _t = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, Ct = { key: 5 }, Dt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, Mt = { key: 6 }, $t = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, At = { key: 7 }, Tt = { key: 8 }, Ot = { key: 0 }, Kt = ["href"], Ht = {
|
|
102
|
+
key: 1,
|
|
103
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2"
|
|
104
|
+
}, Vt = { class: "jsgd-text-sm jsgd-text-slate-500 dark:jsgd-text-slate-400" }, Bt = ["href"], St = {
|
|
105
|
+
key: 1,
|
|
106
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
107
|
+
}, It = { key: 9 }, Nt = {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: "jsgd-flex jsgd-flex-col jsgd-gap-2"
|
|
110
|
+
}, Lt = ["href"], Ft = {
|
|
111
|
+
key: 1,
|
|
112
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2"
|
|
113
|
+
}, Pt = { class: "jsgd-text-sm jsgd-text-slate-500 dark:jsgd-text-slate-400" }, Et = ["href"], zt = {
|
|
114
|
+
key: 1,
|
|
115
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
116
|
+
}, Ut = { key: 10 }, Wt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, Gt = { key: 11 }, qt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, Rt = { key: 12 }, Zt = ["href"], Jt = { key: 13 }, Qt = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, Xt = { key: 14 }, Yt = {
|
|
117
|
+
key: 0,
|
|
118
|
+
class: "jsgd-p-4 jsgd-border jsgd-border-slate-200 jsgd-rounded-md jsgd-bg-slate-50 jsgd-shadow-inner dark:jsgd-border-slate-700 dark:jsgd-bg-slate-800/50"
|
|
119
|
+
}, es = {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
122
|
+
}, ts = { key: 15 }, ss = { key: 0 }, ds = {
|
|
123
|
+
key: 1,
|
|
124
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
125
|
+
}, as = { key: 16 }, ls = {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: "jsgd-flex jsgd-flex-wrap jsgd-gap-4"
|
|
128
|
+
}, ns = {
|
|
129
|
+
key: 1,
|
|
130
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
131
|
+
}, os = { key: 17 }, rs = { class: "jsgd-flex jsgd-flex-wrap jsgd-gap-2" }, is = ["title", "onClick"], gs = {
|
|
132
|
+
key: 1,
|
|
133
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
134
|
+
}, us = { key: 18 }, cs = { class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed" }, js = { key: 19 }, bs = {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "jsgd-flex jsgd-flex-col jsgd-gap-4"
|
|
137
|
+
}, fs = {
|
|
138
|
+
key: 1,
|
|
139
|
+
class: "jsgd-text-slate-700 dark:jsgd-text-slate-200 jsgd-leading-relaxed jsgd-italic"
|
|
140
|
+
}, ms = {
|
|
141
|
+
key: 1,
|
|
142
|
+
class: "jsgd-pb-6 jsgd-mb-6 jsgd-border-b jsgd-border-slate-200 dark:jsgd-border-slate-700 last:jsgd-mb-0 last:jsgd-pb-0 last:jsgd-border-b-0"
|
|
143
|
+
}, hs = { class: "jsgd-flex jsgd-flex-col jsgd-gap-4" }, $e = /* @__PURE__ */ ge({
|
|
144
|
+
__name: "FieldDetailRenderer",
|
|
145
|
+
props: {
|
|
146
|
+
field: {},
|
|
147
|
+
fieldKey: {},
|
|
148
|
+
formData: {},
|
|
149
|
+
requiredText: {},
|
|
150
|
+
valueNullView: { type: Boolean },
|
|
151
|
+
optionalText: {},
|
|
152
|
+
lang: {}
|
|
153
|
+
},
|
|
154
|
+
emits: ["image-click"],
|
|
155
|
+
setup(e, { emit: u }) {
|
|
156
|
+
const r = I(!1), n = e, i = u, t = X(() => n.formData?.[n.fieldKey]), m = X(() => {
|
|
157
|
+
const K = t.value;
|
|
158
|
+
return n.valueNullView && n.field.type !== "optionGroupSchema" ? !0 : o(K);
|
|
159
|
+
}), v = Ze("TableComponents", {
|
|
160
|
+
labels: I(ze[n.lang ?? "en"])
|
|
161
|
+
}).labels, o = (K) => K != null && K !== "" && !(Array.isArray(K) && K.length === 0), j = X(() => {
|
|
162
|
+
let K = n.field.label || n.fieldKey || "";
|
|
163
|
+
return n.field.type === "optionGroupSchema" ? n.field.label ?? "" : K;
|
|
164
|
+
}), w = (K) => K instanceof File, F = (K) => URL.createObjectURL(K), _ = (K) => {
|
|
165
|
+
navigator.clipboard.writeText(K).then(() => console.log("Copied:", K)).catch(console.error);
|
|
166
|
+
};
|
|
167
|
+
return (K, B) => {
|
|
168
|
+
const E = Je("BaseImage");
|
|
169
|
+
return m.value ? (d(), a("div", {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "jsgd-pb-6 jsgd-mb-6 jsgd-border-b jsgd-border-slate-200 dark:jsgd-border-slate-700 last:jsgd-mb-0 last:jsgd-pb-0 last:jsgd-border-b-0",
|
|
172
|
+
id: e.fieldKey
|
|
173
|
+
}, [
|
|
174
|
+
e.field.type === "text" ? (d(), a("div", ct, [
|
|
175
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
176
|
+
s("p", jt, y(t.value || "-"), 1)
|
|
177
|
+
])) : e.field.type === "richText" ? (d(), a("div", bt, [
|
|
178
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
179
|
+
t.value ? (d(), a("div", {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: "prose-content",
|
|
182
|
+
innerHTML: t.value
|
|
183
|
+
}, null, 8, ft)) : (d(), a("p", mt, " - "))
|
|
184
|
+
])) : e.field.type === "textArea" ? (d(), a("div", ht, [
|
|
185
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
186
|
+
t.value ? (d(), a("div", {
|
|
187
|
+
key: 0,
|
|
188
|
+
class: "prose-content",
|
|
189
|
+
innerHTML: t.value
|
|
190
|
+
}, null, 8, vt)) : (d(), a("p", yt, " - "))
|
|
191
|
+
])) : e.field.type === "password" ? (d(), a("div", kt, [
|
|
192
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
193
|
+
s("div", xt, [
|
|
194
|
+
s("p", pt, y(r.value ? t.value ?? "-" : t.value ? "•".repeat(String(t.value).length) : "-"), 1),
|
|
195
|
+
t.value ? (d(), a("button", {
|
|
196
|
+
key: 0,
|
|
197
|
+
type: "button",
|
|
198
|
+
class: "jsgd-text-sm jsgd-text-blue-600 jsgd-bg-transparent jsgd-border-none jsgd-cursor-pointer jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300",
|
|
199
|
+
onClick: B[0] || (B[0] = (O) => r.value = !r.value)
|
|
200
|
+
}, y(r.value ? "Hide" : "Show"), 1)) : N("", !0)
|
|
201
|
+
])
|
|
202
|
+
])) : e.field.type === "date" ? (d(), a("div", wt, [
|
|
203
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
204
|
+
s("p", _t, y(t.value ? l(rt)(t.value) : "-"), 1)
|
|
205
|
+
])) : e.field.type === "time" ? (d(), a("div", Ct, [
|
|
206
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
207
|
+
s("p", Dt, y(t.value ? l(it)(t.value) : "-"), 1)
|
|
208
|
+
])) : e.field.type === "dateTime" ? (d(), a("div", Mt, [
|
|
209
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
210
|
+
s("p", $t, y(t.value ? l(gt)(t.value) : "-"), 1)
|
|
211
|
+
])) : e.field.type === "toggle" ? (d(), a("div", At, [
|
|
212
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
213
|
+
s("p", {
|
|
214
|
+
class: Y([
|
|
215
|
+
"jsgd-inline-flex jsgd-items-center jsgd-gap-2 jsgd-px-3 jsgd-py-1 jsgd-font-medium jsgd-rounded-full",
|
|
216
|
+
t.value ? "jsgd-bg-green-100 jsgd-text-green-800 dark:jsgd-bg-green-900 dark:jsgd-text-green-200" : "jsgd-bg-red-100 jsgd-text-red-800 dark:jsgd-bg-red-900 dark:jsgd-text-red-200"
|
|
217
|
+
])
|
|
218
|
+
}, y(t.value ? l(v).btn.toogle.active : l(v).btn.toogle.inactive) + " ⦿ ", 3)
|
|
219
|
+
])) : e.field.type === "file" ? (d(), a("div", Tt, [
|
|
220
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
221
|
+
t.value ? (d(), a("div", Ot, [
|
|
222
|
+
typeof t.value == "string" ? (d(), a("a", {
|
|
223
|
+
key: 0,
|
|
224
|
+
href: t.value,
|
|
225
|
+
target: "_blank",
|
|
226
|
+
rel: "noopener noreferrer",
|
|
227
|
+
class: "jsgd-font-medium jsgd-text-blue-600 jsgd-underline jsgd-underline-offset-2 jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300"
|
|
228
|
+
}, y(t.value.split("/").pop() || t.value), 9, Kt)) : w(t.value) ? (d(), a("div", Ht, [
|
|
229
|
+
s("span", null, y(t.value.name), 1),
|
|
230
|
+
s("span", Vt, "(" + y((t.value.size / 1024).toFixed(1)) + " KB)", 1),
|
|
231
|
+
s("a", {
|
|
232
|
+
href: F(t.value),
|
|
233
|
+
target: "_blank",
|
|
234
|
+
rel: "noopener noreferrer",
|
|
235
|
+
class: "jsgd-font-medium jsgd-text-blue-600 jsgd-underline jsgd-underline-offset-2 jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300"
|
|
236
|
+
}, " Preview ", 8, Bt)
|
|
237
|
+
])) : N("", !0)
|
|
238
|
+
])) : (d(), a("div", St, " - "))
|
|
239
|
+
])) : e.field.type === "fileArray" ? (d(), a("div", It, [
|
|
240
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
241
|
+
Array.isArray(t.value) && t.value.length ? (d(), a("div", Nt, [
|
|
242
|
+
(d(!0), a(G, null, R(t.value, (O, T) => (d(), a("div", { key: T }, [
|
|
243
|
+
typeof O == "string" ? (d(), a("a", {
|
|
244
|
+
key: 0,
|
|
245
|
+
href: O,
|
|
246
|
+
target: "_blank",
|
|
247
|
+
rel: "noopener noreferrer",
|
|
248
|
+
class: "jsgd-font-medium jsgd-text-blue-600 jsgd-underline jsgd-underline-offset-2 jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300"
|
|
249
|
+
}, y(O.split("/").pop() || O), 9, Lt)) : w(O) ? (d(), a("div", Ft, [
|
|
250
|
+
s("span", null, y(O.name), 1),
|
|
251
|
+
s("span", Pt, "(" + y((O.size / 1024).toFixed(1)) + " KB)", 1),
|
|
252
|
+
s("a", {
|
|
253
|
+
href: F(O),
|
|
254
|
+
target: "_blank",
|
|
255
|
+
rel: "noopener noreferrer",
|
|
256
|
+
class: "jsgd-font-medium jsgd-text-blue-600 jsgd-underline jsgd-underline-offset-2 jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300"
|
|
257
|
+
}, " Preview ", 8, Et)
|
|
258
|
+
])) : N("", !0)
|
|
259
|
+
]))), 128))
|
|
260
|
+
])) : (d(), a("div", zt, " - "))
|
|
261
|
+
])) : e.field.type === "number" ? (d(), a("div", Ut, [
|
|
262
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
263
|
+
s("p", Wt, y(t.value ?? "-"), 1)
|
|
264
|
+
])) : e.field.type === "email" ? (d(), a("div", Gt, [
|
|
265
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
266
|
+
s("p", qt, y(t.value ?? "-"), 1)
|
|
267
|
+
])) : e.field.type === "url" ? (d(), a("div", Rt, [
|
|
268
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
269
|
+
s("a", {
|
|
270
|
+
href: t.value,
|
|
271
|
+
target: "_blank",
|
|
272
|
+
rel: "noopener noreferrer",
|
|
273
|
+
class: "jsgd-font-medium jsgd-text-blue-600 jsgd-underline jsgd-underline-offset-2 jsgd-transition-colors hover:jsgd-text-blue-500 dark:jsgd-text-blue-400 dark:hover:jsgd-text-blue-300"
|
|
274
|
+
}, y(t.value ?? "-"), 9, Zt)
|
|
275
|
+
])) : e.field.type === "tag" ? (d(), a("div", Jt, [
|
|
276
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
277
|
+
s("p", Qt, y(t.value ?? "-"), 1)
|
|
278
|
+
])) : e.field.type === "object" ? (d(), a("div", Xt, [
|
|
279
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
280
|
+
t.value && typeof t.value == "object" && Object.keys(t.value).length ? (d(), a("div", Yt, [
|
|
281
|
+
(d(!0), a(G, null, R(e.field.schema, (O, T) => (d(), ie(l($e), {
|
|
282
|
+
key: T,
|
|
283
|
+
field: O,
|
|
284
|
+
"field-key": T,
|
|
285
|
+
"form-data": t.value,
|
|
286
|
+
"value-null-view": e.valueNullView,
|
|
287
|
+
"optional-text": e.optionalText,
|
|
288
|
+
"required-text": e.requiredText,
|
|
289
|
+
onImageClick: B[1] || (B[1] = (k) => i("image-click", k))
|
|
290
|
+
}, null, 8, ["field", "field-key", "form-data", "value-null-view", "optional-text", "required-text"]))), 128))
|
|
291
|
+
])) : (d(), a("div", es, " - "))
|
|
292
|
+
])) : e.field.type === "image" ? (d(), a("div", ts, [
|
|
293
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
294
|
+
t.value ? (d(), a("div", ss, [
|
|
295
|
+
S(E, {
|
|
296
|
+
src: t.value,
|
|
297
|
+
alt: "Image",
|
|
298
|
+
class: "jsgd-block jsgd-rounded-md jsgd-shadow-md jsgd-border jsgd-border-slate-200 jsgd-cursor-pointer jsgd-transition-all hover:jsgd-scale-105 hover:jsgd-shadow-lg jsgd-w-full jsgd-max-w-48 jsgd-aspect-video jsgd-object-contain dark:jsgd-border-slate-700",
|
|
299
|
+
onClick: B[2] || (B[2] = (O) => i("image-click", t.value))
|
|
300
|
+
}, null, 8, ["src"])
|
|
301
|
+
])) : (d(), a("div", ds, " - "))
|
|
302
|
+
])) : e.field.type === "imageArray" ? (d(), a("div", as, [
|
|
303
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
304
|
+
Array.isArray(t.value) && t.value.length ? (d(), a("div", ls, [
|
|
305
|
+
(d(!0), a(G, null, R(t.value, (O, T) => (d(), a("div", { key: T }, [
|
|
306
|
+
S(E, {
|
|
307
|
+
src: O,
|
|
308
|
+
alt: `Image ${T + 1}`,
|
|
309
|
+
class: "jsgd-block jsgd-rounded-md jsgd-shadow-md jsgd-border jsgd-border-slate-200 jsgd-cursor-pointer jsgd-transition-all hover:jsgd-scale-105 hover:jsgd-shadow-lg jsgd-w-24 jsgd-h-24 jsgd-object-contain dark:jsgd-border-slate-700",
|
|
310
|
+
onClick: (k) => i("image-click", O)
|
|
311
|
+
}, null, 8, ["src", "alt", "onClick"])
|
|
312
|
+
]))), 128))
|
|
313
|
+
])) : (d(), a("div", ns, " - "))
|
|
314
|
+
])) : e.field.type === "color" ? (d(), a("div", os, [
|
|
315
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
316
|
+
s("div", rs, [
|
|
317
|
+
Array.isArray(t.value) && t.value.length ? (d(!0), a(G, { key: 0 }, R(t.value, (O, T) => (d(), a("div", {
|
|
318
|
+
key: T,
|
|
319
|
+
class: "jsgd-w-8 jsgd-h-8 jsgd-rounded-full jsgd-border-2 jsgd-border-white jsgd-shadow-[0_0_0_1px] jsgd-shadow-slate-300 jsgd-cursor-pointer jsgd-transition-transform hover:jsgd-scale-110 dark:jsgd-border-slate-800 dark:jsgd-shadow-slate-600",
|
|
320
|
+
style: Te({ backgroundColor: O }),
|
|
321
|
+
title: O,
|
|
322
|
+
onClick: (k) => _(O)
|
|
323
|
+
}, null, 12, is))), 128)) : (d(), a("div", gs, " - "))
|
|
324
|
+
])
|
|
325
|
+
])) : e.field.type === "select" ? (d(), a("div", us, [
|
|
326
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
327
|
+
s("p", cs, y(t.value || "-"), 1)
|
|
328
|
+
])) : e.field.type === "arrayObject" ? (d(), a("div", js, [
|
|
329
|
+
S(l(z), { label: j.value }, null, 8, ["label"]),
|
|
330
|
+
Array.isArray(t.value) && t.value.length ? (d(), a("div", bs, [
|
|
331
|
+
(d(!0), a(G, null, R(t.value, (O, T) => (d(), a("div", {
|
|
332
|
+
key: T,
|
|
333
|
+
class: "jsgd-p-4 jsgd-border jsgd-border-slate-200 jsgd-rounded-md jsgd-bg-slate-50 jsgd-shadow-inner dark:jsgd-border-slate-700 dark:jsgd-bg-slate-800/50"
|
|
334
|
+
}, [
|
|
335
|
+
(d(!0), a(G, null, R(e.field.schema, (k, L) => (d(), ie(l($e), {
|
|
336
|
+
key: L,
|
|
337
|
+
field: k,
|
|
338
|
+
"field-key": L,
|
|
339
|
+
"form-data": O,
|
|
340
|
+
"value-null-view": e.valueNullView,
|
|
341
|
+
"optional-text": e.optionalText,
|
|
342
|
+
"required-text": e.requiredText,
|
|
343
|
+
onImageClick: B[3] || (B[3] = (U) => i("image-click", U))
|
|
344
|
+
}, null, 8, ["field", "field-key", "form-data", "value-null-view", "optional-text", "required-text"]))), 128))
|
|
345
|
+
]))), 128))
|
|
346
|
+
])) : (d(), a("div", fs, " - "))
|
|
347
|
+
])) : N("", !0)
|
|
348
|
+
], 8, ut)) : e.field.type === "optionGroupSchema" ? (d(), a("div", ms, [
|
|
349
|
+
e.formData[e.fieldKey] || j.value ? (d(), ie(l(z), {
|
|
350
|
+
key: 0,
|
|
351
|
+
label: e.formData[e.fieldKey] ? j.value + ":" + (e.formData[e.fieldKey] ?? "") : j.value,
|
|
352
|
+
class: "!jsgd-text-lg !jsgd-font-semibold !jsgd-text-slate-900 dark:!jsgd-text-slate-100 !jsgd-border-l-4 !jsgd-border-slate-400 !jsgd-pl-3 dark:!jsgd-border-slate-600"
|
|
353
|
+
}, null, 8, ["label"])) : N("", !0),
|
|
354
|
+
s("div", hs, [
|
|
355
|
+
(d(!0), a(G, null, R(e.field.options, (O, T) => (d(), a("div", {
|
|
356
|
+
key: T,
|
|
357
|
+
class: "jsgd-p-4 jsgd-border jsgd-border-slate-200 jsgd-rounded-md jsgd-bg-slate-50 jsgd-shadow-inner dark:jsgd-border-slate-700 dark:jsgd-bg-slate-800/50"
|
|
358
|
+
}, [
|
|
359
|
+
S(l(z), {
|
|
360
|
+
label: T,
|
|
361
|
+
class: "option-group-item-label"
|
|
362
|
+
}, null, 8, ["label"]),
|
|
363
|
+
B[5] || (B[5] = s("hr", { class: "option-group-divider" }, null, -1)),
|
|
364
|
+
(d(!0), a(G, null, R(O, (k, L) => (d(), ie(l($e), {
|
|
365
|
+
key: L,
|
|
366
|
+
field: k,
|
|
367
|
+
"field-key": L,
|
|
368
|
+
"form-data": e.formData,
|
|
369
|
+
"value-null-view": e.valueNullView,
|
|
370
|
+
"optional-text": e.optionalText,
|
|
371
|
+
"required-text": e.requiredText,
|
|
372
|
+
onImageClick: B[4] || (B[4] = (U) => i("image-click", U))
|
|
373
|
+
}, null, 8, ["field", "field-key", "form-data", "value-null-view", "optional-text", "required-text"]))), 128))
|
|
374
|
+
]))), 128))
|
|
375
|
+
])
|
|
376
|
+
])) : N("", !0);
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
}), vs = ["src", "alt"], la = /* @__PURE__ */ ge({
|
|
380
|
+
__name: "ImagePreview",
|
|
381
|
+
props: {
|
|
382
|
+
imageUrl: {},
|
|
383
|
+
watermarkUrl: { default: "https://res.cloudinary.com/doyufai9q/image/upload/v1754227461/Logo_transparent_b6qrek.png" },
|
|
384
|
+
watermarkSize: { default: 4 },
|
|
385
|
+
alt: { default: "" }
|
|
386
|
+
},
|
|
387
|
+
setup(e) {
|
|
388
|
+
const u = e, r = I(null), n = I(!0), i = (m) => new Promise((c, v) => {
|
|
389
|
+
const o = new Image();
|
|
390
|
+
o.crossOrigin = "anonymous", o.onload = () => c(o), o.onerror = (j) => v(j), o.src = m;
|
|
391
|
+
}), t = (m, c) => {
|
|
392
|
+
const v = document.createElement("canvas"), o = v.getContext("2d");
|
|
393
|
+
if (!o)
|
|
394
|
+
return console.error("Gagal mendapatkan konteks canvas 2D."), m.src;
|
|
395
|
+
v.width = m.width, v.height = m.height, o.drawImage(m, 0, 0);
|
|
396
|
+
const j = m.width / u.watermarkSize, w = c.height / c.width * j, F = m.width - j - 10, _ = m.height - w - 10;
|
|
397
|
+
return o.globalAlpha = 0.8, o.drawImage(c, F, _, j, w), o.globalAlpha = 1, v.toDataURL("image/png");
|
|
398
|
+
};
|
|
399
|
+
return Be(async () => {
|
|
400
|
+
try {
|
|
401
|
+
const m = await i(u.imageUrl), c = await i(u.watermarkUrl);
|
|
402
|
+
r.value = t(m, c);
|
|
403
|
+
} catch (m) {
|
|
404
|
+
console.error("Gagal menerapkan watermark, menampilkan gambar asli:", m), r.value = u.imageUrl;
|
|
405
|
+
} finally {
|
|
406
|
+
n.value = !1;
|
|
407
|
+
}
|
|
408
|
+
}), (m, c) => (d(), a(G, null, [
|
|
409
|
+
n.value ? (d(), a("div", Ve({
|
|
410
|
+
key: 0,
|
|
411
|
+
class: "jsgd-w-full jsgd-h-48 jsgd-bg-slate-200 dark:jsgd-bg-slate-700 jsgd-rounded-lg jsgd-animate-pulse"
|
|
412
|
+
}, m.$attrs), null, 16)) : N("", !0),
|
|
413
|
+
!n.value && r.value ? (d(), a("img", Ve({
|
|
414
|
+
key: 1,
|
|
415
|
+
loading: "lazy",
|
|
416
|
+
src: r.value,
|
|
417
|
+
alt: u.alt
|
|
418
|
+
}, m.$attrs), null, 16, vs)) : N("", !0)
|
|
419
|
+
], 64));
|
|
420
|
+
}
|
|
421
|
+
}), ys = { class: "modal-header" }, ks = { class: "header-content" }, xs = { class: "title-section" }, ps = { class: "modal-title" }, ws = { class: "modal-body" }, _s = { class: "form-fields-container" }, Cs = { class: "modal-footer" }, Ds = { class: "footer-buttons" }, Ms = { class: "btn-content" }, $s = ["src"], As = /* @__PURE__ */ ge({
|
|
422
|
+
__name: "ModalDetailData",
|
|
423
|
+
props: {
|
|
424
|
+
schema: {},
|
|
425
|
+
formData: {},
|
|
426
|
+
valueNullView: { type: Boolean },
|
|
427
|
+
title: {},
|
|
428
|
+
closeText: {},
|
|
429
|
+
requiredText: {},
|
|
430
|
+
optionalText: {},
|
|
431
|
+
lang: {}
|
|
432
|
+
},
|
|
433
|
+
emits: ["close"],
|
|
434
|
+
setup(e, { emit: u }) {
|
|
435
|
+
const r = u, n = I(!1), i = I(""), t = () => r("close"), m = (o) => {
|
|
436
|
+
i.value = o, n.value = !0;
|
|
437
|
+
}, c = I(!1), v = () => {
|
|
438
|
+
c.value = window.innerWidth < 768;
|
|
439
|
+
};
|
|
440
|
+
return Be(() => {
|
|
441
|
+
v(), window.addEventListener("resize", v);
|
|
442
|
+
}), Qe(() => {
|
|
443
|
+
window.removeEventListener("resize", v);
|
|
444
|
+
}), (o, j) => (d(), a(G, null, [
|
|
445
|
+
S(we, {
|
|
446
|
+
name: "modal-overlay",
|
|
447
|
+
appear: ""
|
|
448
|
+
}, {
|
|
449
|
+
default: _e(() => [
|
|
450
|
+
s("div", {
|
|
451
|
+
class: "modal-overlay",
|
|
452
|
+
onClick: Xe(t, ["self"])
|
|
453
|
+
}, [
|
|
454
|
+
S(we, {
|
|
455
|
+
name: "modal-container",
|
|
456
|
+
appear: ""
|
|
457
|
+
}, {
|
|
458
|
+
default: _e(() => [
|
|
459
|
+
s("div", {
|
|
460
|
+
class: Y(["modal-container", { "mobile-view": c.value }])
|
|
461
|
+
}, [
|
|
462
|
+
s("div", ys, [
|
|
463
|
+
s("div", ks, [
|
|
464
|
+
s("div", xs, [
|
|
465
|
+
j[1] || (j[1] = s("div", { class: "icon-container" }, [
|
|
466
|
+
s("svg", {
|
|
467
|
+
width: "24",
|
|
468
|
+
height: "24",
|
|
469
|
+
viewBox: "0 0 24 24",
|
|
470
|
+
fill: "none",
|
|
471
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
472
|
+
}, [
|
|
473
|
+
s("path", {
|
|
474
|
+
d: "M10 3H6C4.89543 3 4 3.89543 4 5V19C4 20.1046 4.89543 21 6 21H18C19.1046 21 20 20.1046 20 19V5C20 3.89543 19.1046 3 18 3H14M10 3V6C10 6.55228 10.4477 7 11 7H13C13.5523 7 14 6.55228 14 6V3M10 3V1M14 3V1M9 11H15M9 15H15",
|
|
475
|
+
stroke: "currentColor",
|
|
476
|
+
"stroke-width": "2",
|
|
477
|
+
"stroke-linecap": "round",
|
|
478
|
+
"stroke-linejoin": "round"
|
|
479
|
+
})
|
|
480
|
+
])
|
|
481
|
+
], -1)),
|
|
482
|
+
s("h2", ps, y(e.title ?? "Detail Data"), 1)
|
|
483
|
+
]),
|
|
484
|
+
s("button", {
|
|
485
|
+
class: "close-btn",
|
|
486
|
+
onClick: t,
|
|
487
|
+
"aria-label": "Close"
|
|
488
|
+
}, [...j[2] || (j[2] = [
|
|
489
|
+
s("svg", {
|
|
490
|
+
width: "20",
|
|
491
|
+
height: "20",
|
|
492
|
+
viewBox: "0 0 24 24",
|
|
493
|
+
fill: "none",
|
|
494
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
495
|
+
}, [
|
|
496
|
+
s("path", {
|
|
497
|
+
d: "M18 6L6 18M6 6L18 18",
|
|
498
|
+
stroke: "currentColor",
|
|
499
|
+
"stroke-width": "2",
|
|
500
|
+
"stroke-linecap": "round",
|
|
501
|
+
"stroke-linejoin": "round"
|
|
502
|
+
})
|
|
503
|
+
], -1)
|
|
504
|
+
])])
|
|
505
|
+
])
|
|
506
|
+
]),
|
|
507
|
+
s("div", ws, [
|
|
508
|
+
s("div", _s, [
|
|
509
|
+
(d(!0), a(G, null, R(e.schema, (w, F) => (d(), ie(l($e), {
|
|
510
|
+
key: F,
|
|
511
|
+
field: w,
|
|
512
|
+
"field-key": F,
|
|
513
|
+
"form-data": e.formData,
|
|
514
|
+
"required-text": e.requiredText,
|
|
515
|
+
"optional-text": e.optionalText,
|
|
516
|
+
"value-null-view": e.valueNullView,
|
|
517
|
+
onImageClick: m,
|
|
518
|
+
lang: e.lang
|
|
519
|
+
}, null, 8, ["field", "field-key", "form-data", "required-text", "optional-text", "value-null-view", "lang"]))), 128))
|
|
520
|
+
])
|
|
521
|
+
]),
|
|
522
|
+
s("div", Cs, [
|
|
523
|
+
s("div", Ds, [
|
|
524
|
+
s("button", {
|
|
525
|
+
type: "button",
|
|
526
|
+
onClick: t,
|
|
527
|
+
class: "btn btn-primary"
|
|
528
|
+
}, [
|
|
529
|
+
s("span", Ms, [
|
|
530
|
+
j[3] || (j[3] = s("svg", {
|
|
531
|
+
width: "16",
|
|
532
|
+
height: "16",
|
|
533
|
+
viewBox: "0 0 24 24",
|
|
534
|
+
fill: "none",
|
|
535
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
536
|
+
}, [
|
|
537
|
+
s("path", {
|
|
538
|
+
d: "M6 18L18 6M6 6L18 18",
|
|
539
|
+
stroke: "currentColor",
|
|
540
|
+
"stroke-width": "2",
|
|
541
|
+
"stroke-linecap": "round",
|
|
542
|
+
"stroke-linejoin": "round"
|
|
543
|
+
})
|
|
544
|
+
], -1)),
|
|
545
|
+
re(" " + y(e.closeText ?? "Close"), 1)
|
|
546
|
+
])
|
|
547
|
+
])
|
|
548
|
+
])
|
|
549
|
+
])
|
|
550
|
+
], 2)
|
|
551
|
+
]),
|
|
552
|
+
_: 1
|
|
553
|
+
})
|
|
554
|
+
])
|
|
555
|
+
]),
|
|
556
|
+
_: 1
|
|
557
|
+
}),
|
|
558
|
+
S(we, {
|
|
559
|
+
name: "modal-overlay",
|
|
560
|
+
appear: ""
|
|
561
|
+
}, {
|
|
562
|
+
default: _e(() => [
|
|
563
|
+
n.value ? (d(), a("div", {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: "modal-overlay image-preview-overlay",
|
|
566
|
+
onClick: j[0] || (j[0] = (w) => n.value = !1)
|
|
567
|
+
}, [
|
|
568
|
+
S(we, {
|
|
569
|
+
name: "modal-container",
|
|
570
|
+
appear: ""
|
|
571
|
+
}, {
|
|
572
|
+
default: _e(() => [
|
|
573
|
+
s("img", {
|
|
574
|
+
src: i.value,
|
|
575
|
+
alt: "Preview",
|
|
576
|
+
class: "image-preview-content"
|
|
577
|
+
}, null, 8, $s)
|
|
578
|
+
]),
|
|
579
|
+
_: 1
|
|
580
|
+
})
|
|
581
|
+
])) : N("", !0)
|
|
582
|
+
]),
|
|
583
|
+
_: 1
|
|
584
|
+
})
|
|
585
|
+
], 64));
|
|
586
|
+
}
|
|
587
|
+
}), Ts = /* @__PURE__ */ Ue(As, [["__scopeId", "data-v-a78353a9"]]), Os = ["innerHTML"], na = /* @__PURE__ */ ge({
|
|
588
|
+
__name: "SafeHtml",
|
|
589
|
+
props: {
|
|
590
|
+
html: {}
|
|
591
|
+
},
|
|
592
|
+
setup(e) {
|
|
593
|
+
const u = e, r = X(() => tt.sanitize(u.html));
|
|
594
|
+
return (n, i) => e.html ? (d(), a("div", {
|
|
595
|
+
key: 0,
|
|
596
|
+
innerHTML: r.value
|
|
597
|
+
}, null, 8, Os)) : N("", !0);
|
|
598
|
+
}
|
|
599
|
+
}), Ks = { class: "jsgd-sr-only" }, Hs = { class: "jsgd-font-semibold" }, Vs = /* @__PURE__ */ ge({
|
|
600
|
+
__name: "AlertApp",
|
|
601
|
+
setup(e, { expose: u }) {
|
|
602
|
+
const r = I([]), n = I([]), i = I([]);
|
|
603
|
+
let t = 0;
|
|
604
|
+
const m = (o) => {
|
|
605
|
+
const j = "jsgd-fixed jsgd-top-4 jsgd-right-4 jsgd-z-100 jsgd-flex jsgd-items-start jsgd-gap-3 jsgd-w-full jsgd-max-w-sm jsgd-p-4 jsgd-mb-4 jsgd-rounded-lg jsgd-shadow-lg jsgd-transition-all jsgd-duration-300 jsgd-ease-[cubic-bezier(0.4,0,0.2,1)] sm:jsgd-max-w-md max-sm:jsgd-left-4";
|
|
606
|
+
return o === "success" ? `${j} jsgd-border-1 jsgd-border-solid jsgd-border-green-200 jsgd-bg-green-50 jsgd-text-green-800 dark:jsgd-bg-green-800/30 dark:jsgd-border-green-700 dark:jsgd-text-green-200` : o === "error" ? `${j} jsgd-border-1 jsgd-border-solid jsgd-border-red-200 jsgd-bg-red-50 jsgd-text-red-800 dark:jsgd-bg-red-800/30 dark:jsgd-border-red-700 dark:jsgd-text-red-200` : j;
|
|
607
|
+
};
|
|
608
|
+
function c() {
|
|
609
|
+
let o = 0;
|
|
610
|
+
i.value = n.value.map((j) => {
|
|
611
|
+
const w = j?.offsetHeight || 0, F = o;
|
|
612
|
+
return o += w + 10, F;
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
function v(o) {
|
|
616
|
+
o.id = t++, o.show = !1, r.value.push(o), Ce(() => {
|
|
617
|
+
o.show = !0, c();
|
|
618
|
+
}), setTimeout(() => {
|
|
619
|
+
o.show = !1, Ce(() => {
|
|
620
|
+
c(), setTimeout(() => {
|
|
621
|
+
r.value = r.value.filter((j) => j.id !== o.id), Ce(c);
|
|
622
|
+
}, 200);
|
|
623
|
+
});
|
|
624
|
+
}, 5e3);
|
|
625
|
+
}
|
|
626
|
+
return De(r, () => {
|
|
627
|
+
Ce(c);
|
|
628
|
+
}), u({
|
|
629
|
+
addAlert: v
|
|
630
|
+
}), (o, j) => (d(!0), a(G, null, R(r.value, (w, F) => (d(), a("div", {
|
|
631
|
+
key: w.id,
|
|
632
|
+
ref_for: !0,
|
|
633
|
+
ref_key: "alertRefs",
|
|
634
|
+
ref: n,
|
|
635
|
+
class: Y(["alert-container", m(w.type)]),
|
|
636
|
+
style: Te({
|
|
637
|
+
top: `${i.value[F] ?? 0}px`,
|
|
638
|
+
transform: `translateX(${w.show ? "0" : "200%"})`
|
|
639
|
+
}),
|
|
640
|
+
role: "alert"
|
|
641
|
+
}, [
|
|
642
|
+
s("span", {
|
|
643
|
+
class: Y(["jsgd-shrink-0 jsgd-w-5 jsgd-h-5", [
|
|
644
|
+
w.type === "error" ? "jsgd-i-mdi-alert-circle" : "jsgd-i-mdi-check-circle",
|
|
645
|
+
w.type === "error" ? "jsgd-text-red-500 dark:jsgd-text-red-400" : "jsgd-text-green-500 dark:jsgd-text-green-400"
|
|
646
|
+
]])
|
|
647
|
+
}, null, 2),
|
|
648
|
+
s("span", Ks, y(w.type === "error" ? "Error" : "Success"), 1),
|
|
649
|
+
s("div", null, [
|
|
650
|
+
s("span", Hs, y(w.title), 1),
|
|
651
|
+
s("ul", {
|
|
652
|
+
class: Y([
|
|
653
|
+
"jsgd-mt-1 jsgd-pl-5 jsgd-text-sm jsgd-list-disc jsgd-list-inside",
|
|
654
|
+
w.type === "error" ? "[&::marker]:jsgd-text-red-500" : "[&::marker]:jsgd-text-green-500"
|
|
655
|
+
])
|
|
656
|
+
}, [
|
|
657
|
+
(d(!0), a(G, null, R(w.messages, (_, K) => (d(), a("li", { key: K }, y(_), 1))), 128))
|
|
658
|
+
], 2)
|
|
659
|
+
])
|
|
660
|
+
], 6))), 128));
|
|
661
|
+
}
|
|
662
|
+
}), Bs = ["aria-labelledby"], Ss = {
|
|
663
|
+
id: "dialog-title",
|
|
664
|
+
class: "jsgd-text-2xl jsgd-font-bold jsgd-text-slate-800 jsgd-mb-3 dark:jsgd-text-slate-100"
|
|
665
|
+
}, Is = {
|
|
666
|
+
id: "dialog-desc",
|
|
667
|
+
class: "jsgd-text-slate-500 jsgd-leading-relaxed jsgd-mb-10 dark:jsgd-text-slate-400"
|
|
668
|
+
}, Ns = { class: "jsgd-grid jsgd-grid-cols-2 jsgd-gap-4" }, Ls = /* @__PURE__ */ ge({
|
|
669
|
+
__name: "WarningForm",
|
|
670
|
+
props: {
|
|
671
|
+
title: { default: "Warning Title" },
|
|
672
|
+
message: { default: "Warning Message" },
|
|
673
|
+
isGreen: { type: Boolean, default: !1 }
|
|
674
|
+
},
|
|
675
|
+
emits: ["confirm", "close"],
|
|
676
|
+
setup(e, { emit: u }) {
|
|
677
|
+
const r = e, n = u;
|
|
678
|
+
return (i, t) => (d(), a("div", {
|
|
679
|
+
class: "jsgd-fixed jsgd-inset-0 jsgd-z-36 jsgd-grid jsgd-place-items-center jsgd-p-4 jsgd-bg-slate-900/60 jsgd-backdrop-blur-sm jsgd-animate-[fadeIn_250ms_ease-out]",
|
|
680
|
+
onKeydown: t[2] || (t[2] = Ee((m) => n("close"), ["esc"]))
|
|
681
|
+
}, [
|
|
682
|
+
s("div", {
|
|
683
|
+
class: "jsgd-relative jsgd-w-full jsgd-max-w-md jsgd-pt-16 jsgd-pb-8 jsgd-px-8 jsgd-bg-gradient-to-br jsgd-from-white jsgd-to-slate-50 jsgd-rounded-2xl jsgd-shadow-2xl jsgd-text-center jsgd-animate-[scaleIn_250ms_cubic-bezier(0.16,1,0.3,1)] jsgd-border-1 jsgd-border-solid jsgd-border-slate-200 dark:jsgd-from-slate-800 dark:jsgd-to-slate-900 dark:jsgd-border-slate-700",
|
|
684
|
+
role: "dialog",
|
|
685
|
+
"aria-modal": "true",
|
|
686
|
+
"aria-labelledby": r.title
|
|
687
|
+
}, [
|
|
688
|
+
s("div", {
|
|
689
|
+
class: Y([
|
|
690
|
+
"jsgd-absolute jsgd-top-[-2.25rem] jsgd-left-1/2 -jsgd-translate-x-1/2 jsgd-w-[4.5rem] jsgd-h-[4.5rem] jsgd-rounded-full jsgd-grid jsgd-place-items-center jsgd-border-4 jsgd-border-solid jsgd-border-white jsgd-shadow-md jsgd-animate-[scaleIn_400ms_150ms_ease-out_backwards] dark:jsgd-border-slate-800",
|
|
691
|
+
r.isGreen ? "jsgd-bg-green-100 dark:jsgd-bg-green-900/50" : "jsgd-bg-red-100 dark:jsgd-bg-red-900/50"
|
|
692
|
+
])
|
|
693
|
+
}, [
|
|
694
|
+
s("span", {
|
|
695
|
+
class: Y(["jsgd-w-9 jsgd-h-9", [
|
|
696
|
+
r.isGreen ? "jsgd-i-mdi-check-decagram" : "jsgd-i-mdi-alert-decagram",
|
|
697
|
+
r.isGreen ? "jsgd-text-green-600 dark:jsgd-text-green-400" : "jsgd-text-red-600 dark:jsgd-text-red-400"
|
|
698
|
+
]])
|
|
699
|
+
}, null, 2)
|
|
700
|
+
], 2),
|
|
701
|
+
s("h2", Ss, y(r.title), 1),
|
|
702
|
+
s("p", Is, y(r.message), 1),
|
|
703
|
+
s("div", Ns, [
|
|
704
|
+
s("button", {
|
|
705
|
+
class: Y([
|
|
706
|
+
"jsgd-w-full jsgd-py-3.5 jsgd-px-4 jsgd-rounded-lg jsgd-border-none jsgd-font-semibold jsgd-text-sm jsgd-cursor-pointer jsgd-transition-all jsgd-duration-300 jsgd-ease-[cubic-bezier(0.4,0,0.2,1)] jsgd-relative jsgd-overflow-hidden hover:-jsgd-translate-y-0.5 jsgd-text-white",
|
|
707
|
+
r.isGreen ? "jsgd-bg-gradient-to-br jsgd-from-green-500 jsgd-to-emerald-600 jsgd-shadow-lg jsgd-shadow-green-500/20 hover:jsgd-shadow-xl hover:jsgd-shadow-green-500/30" : "jsgd-bg-gradient-to-br jsgd-from-red-500 jsgd-to-rose-600 jsgd-shadow-lg jsgd-shadow-red-500/20 hover:jsgd-shadow-xl hover:jsgd-shadow-red-500/30"
|
|
708
|
+
]),
|
|
709
|
+
onClick: t[0] || (t[0] = (m) => n("confirm"))
|
|
710
|
+
}, " Ya ", 2),
|
|
711
|
+
s("button", {
|
|
712
|
+
class: "jsgd-w-full jsgd-py-3.5 jsgd-px-4 jsgd-rounded-lg jsgd-font-semibold jsgd-text-sm jsgd-cursor-pointer jsgd-transition-all jsgd-duration-300 jsgd-ease-[cubic-bezier(0.4,0,0.2,1)] jsgd-relative jsgd-overflow-hidden hover:-jsgd-translate-y-0.5 jsgd-bg-slate-200 jsgd-text-slate-700 jsgd-border-1 jsgd-border-solid jsgd-border-slate-300 hover:jsgd-bg-slate-300 dark:jsgd-bg-slate-700 dark:jsgd-text-slate-200 dark:jsgd-border-slate-600 dark:hover:jsgd-bg-slate-600",
|
|
713
|
+
onClick: t[1] || (t[1] = (m) => n("close"))
|
|
714
|
+
}, " Tidak ")
|
|
715
|
+
])
|
|
716
|
+
], 8, Bs)
|
|
717
|
+
], 32));
|
|
718
|
+
}
|
|
719
|
+
}), Fe = /* @__PURE__ */ Ue(Ls, [["__scopeId", "data-v-d74c76a7"]]);
|
|
720
|
+
async function Ae(e, u, r, n) {
|
|
721
|
+
const i = {};
|
|
722
|
+
for (const [t, m] of Object.entries(u)) {
|
|
723
|
+
const c = m?.type;
|
|
724
|
+
if (c === "select" && m.DB_NAME && !m.optionsIsNumber) {
|
|
725
|
+
const o = e[m.baseKey?.base ?? t];
|
|
726
|
+
if (o !== null) {
|
|
727
|
+
const j = await ve(m.DB_NAME, o);
|
|
728
|
+
i[t] = j[m.baseKey.name ?? "name"] ?? "";
|
|
729
|
+
} else
|
|
730
|
+
i[t] = "";
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
if (c === "object") {
|
|
734
|
+
const o = e[t] || {};
|
|
735
|
+
i[t] = await Ae(
|
|
736
|
+
e[t] || {},
|
|
737
|
+
m.schema || {},
|
|
738
|
+
o,
|
|
739
|
+
m.baseKey?.base ?? "id"
|
|
740
|
+
);
|
|
741
|
+
continue;
|
|
742
|
+
}
|
|
743
|
+
if (c === "optionGroupSchema" && m.options) {
|
|
744
|
+
if (m.withValue) {
|
|
745
|
+
const o = e[t];
|
|
746
|
+
i[t] = await he(o);
|
|
747
|
+
}
|
|
748
|
+
for (const [o, j] of Object.entries(
|
|
749
|
+
m.options
|
|
750
|
+
))
|
|
751
|
+
for (const [w, F] of Object.entries(j)) {
|
|
752
|
+
const _ = F, K = e[w];
|
|
753
|
+
if (_.type === "optionGroupSchema" && _.options) {
|
|
754
|
+
const B = await Ae(
|
|
755
|
+
e,
|
|
756
|
+
{ [w]: _ },
|
|
757
|
+
r,
|
|
758
|
+
n
|
|
759
|
+
);
|
|
760
|
+
Object.assign(i, B);
|
|
761
|
+
continue;
|
|
762
|
+
}
|
|
763
|
+
if (_.type === "object") {
|
|
764
|
+
i[w] = await Ae(
|
|
765
|
+
e[w] || {},
|
|
766
|
+
_.schema || {},
|
|
767
|
+
e[w] || {},
|
|
768
|
+
_.baseKey?.base ?? "id"
|
|
769
|
+
);
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
if (_.type === "select" && _.DB_NAME && !_.optionsIsNumber) {
|
|
773
|
+
const B = e[_.baseKey?.base ?? w];
|
|
774
|
+
if (B != null) {
|
|
775
|
+
const E = _.DB_NAME, O = await ve(E, B);
|
|
776
|
+
i[w] = O[_.baseKey?.name ?? "name"] ?? void 0;
|
|
777
|
+
} else
|
|
778
|
+
i[w] = void 0;
|
|
779
|
+
} else
|
|
780
|
+
i[w] = he(K);
|
|
781
|
+
}
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
const v = e[t];
|
|
785
|
+
i[t] = he(v);
|
|
786
|
+
}
|
|
787
|
+
return r && e?.[n ?? "id"] && (i[n ?? "id"] = e?.[n ?? "id"]), i;
|
|
788
|
+
}
|
|
789
|
+
async function ye(e, u) {
|
|
790
|
+
const r = {};
|
|
791
|
+
console.log(e);
|
|
792
|
+
for (const [n, i] of Object.entries(u)) {
|
|
793
|
+
const t = i?.type, m = e[i.baseKey?.base ?? n];
|
|
794
|
+
if (t === "select" && i.optionsView && i.options && m) {
|
|
795
|
+
const c = i.options.findIndex((v) => v === m);
|
|
796
|
+
if (!i.optionsView[c] && i.DB_NAME && i.baseKey.name) {
|
|
797
|
+
const o = (await ve(i.DB_NAME, m))[i.baseKey.name];
|
|
798
|
+
r[n] = o;
|
|
799
|
+
} else
|
|
800
|
+
r[n] = i.optionsView[c] ?? m;
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
if (t === "object") {
|
|
804
|
+
r[n] = await ye(m || {}, i.schema || {});
|
|
805
|
+
continue;
|
|
806
|
+
}
|
|
807
|
+
if (t === "optionGroupSchema") {
|
|
808
|
+
const c = [];
|
|
809
|
+
for (const [o, j] of Object.entries(
|
|
810
|
+
i.options
|
|
811
|
+
))
|
|
812
|
+
c.push(j);
|
|
813
|
+
const v = await We(e, c);
|
|
814
|
+
Object.assign(r, v);
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
if (t === "arrayObject") {
|
|
818
|
+
const c = [];
|
|
819
|
+
for (const v of m) {
|
|
820
|
+
const o = await ye(v, i.schema || {});
|
|
821
|
+
c.push(o);
|
|
822
|
+
}
|
|
823
|
+
r[n] = c;
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
r[n] = he(m);
|
|
827
|
+
}
|
|
828
|
+
return r;
|
|
829
|
+
}
|
|
830
|
+
async function We(e, u) {
|
|
831
|
+
const r = {};
|
|
832
|
+
for (const n of u)
|
|
833
|
+
for (const [i, t] of Object.entries(n)) {
|
|
834
|
+
const m = t?.type, c = e[t.baseKey?.base ?? i];
|
|
835
|
+
if (m === "select" && t.optionsView && t.options && c) {
|
|
836
|
+
const v = t.options.findIndex((o) => o === c);
|
|
837
|
+
if (!t.optionsView[v] && t.DB_NAME && t.baseKey.name) {
|
|
838
|
+
const j = (await ve(t.DB_NAME, c))[t.baseKey.name];
|
|
839
|
+
r[i] = j;
|
|
840
|
+
} else
|
|
841
|
+
r[i] = t.optionsView[v] ?? c;
|
|
842
|
+
} else if (m === "optionGroupSchema") {
|
|
843
|
+
const v = [];
|
|
844
|
+
for (const [j, w] of Object.entries(
|
|
845
|
+
t.options
|
|
846
|
+
))
|
|
847
|
+
v.push(w);
|
|
848
|
+
const o = await We(e, v);
|
|
849
|
+
Object.assign(r, o);
|
|
850
|
+
} else if (m === "object")
|
|
851
|
+
r[i] = await ye(c || {}, t.schema || {});
|
|
852
|
+
else if (m === "arrayObject") {
|
|
853
|
+
const v = [];
|
|
854
|
+
for (const o of c) {
|
|
855
|
+
const j = await ye(o, t.schema || {});
|
|
856
|
+
v.push(j);
|
|
857
|
+
}
|
|
858
|
+
r[i] = v;
|
|
859
|
+
continue;
|
|
860
|
+
} else
|
|
861
|
+
r[i] = he(c);
|
|
862
|
+
}
|
|
863
|
+
return r;
|
|
864
|
+
}
|
|
865
|
+
function he(e, u) {
|
|
866
|
+
return e ?? null;
|
|
867
|
+
}
|
|
868
|
+
function ce(e) {
|
|
869
|
+
const u = Me(e), r = Array.isArray(u) ? [] : {};
|
|
870
|
+
if (Array.isArray(u))
|
|
871
|
+
return u.map((n) => n !== null && typeof n == "object" && !(n instanceof File || n instanceof Blob || n instanceof Date) && !Array.isArray(n) ? ce(n) : n);
|
|
872
|
+
for (const n in u) {
|
|
873
|
+
const i = u[n];
|
|
874
|
+
i === void 0 ? r[n] = null : i instanceof File || i instanceof Blob || i instanceof Date ? r[n] = i : typeof i == "string" && (i.trim() === "" || i === "<p><br></p>") || typeof i == "number" && i === 0 ? r[n] = null : Array.isArray(i) ? r[n] = i.map((t) => t !== null && typeof t == "object" && !(t instanceof File || t instanceof Blob || t instanceof Date) && !Array.isArray(t) ? ce(t) : t) : typeof i == "object" && i !== null ? r[n] = ce(i) : r[n] = i;
|
|
875
|
+
}
|
|
876
|
+
return r;
|
|
877
|
+
}
|
|
878
|
+
function Ge(e) {
|
|
879
|
+
return e ? typeof e == "string" ? /\.(jpg|jpeg|png|webp|avif|gif|svg)$/.test(e.toLowerCase()) || e.startsWith("data:image/") || e.startsWith("blob:") : e instanceof File || typeof e == "object" && e.type?.startsWith("image/") : !1;
|
|
880
|
+
}
|
|
881
|
+
function Pe(e) {
|
|
882
|
+
return typeof e == "string" ? e : e instanceof File || typeof e == "object" && e.url ? e.url || URL.createObjectURL(e) : "";
|
|
883
|
+
}
|
|
884
|
+
function Fs(e) {
|
|
885
|
+
return Array.isArray(e) && e.every((u) => Ge(u));
|
|
886
|
+
}
|
|
887
|
+
function Ps(e) {
|
|
888
|
+
return Array.isArray(e) ? e.every((u) => qe(u)) : !1;
|
|
889
|
+
}
|
|
890
|
+
function qe(e) {
|
|
891
|
+
return typeof e != "string" ? !1 : /^#([0-9A-F]{3}){1,2}$/i.test(e) || /^rgb(a?)\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(,\s*[\d\.]+\s*)?\)$/i.test(e) || /^hsl(a?)\(\s*\d+\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%\s*(,\s*[\d\.]+\s*)?\)$/i.test(e) ? !0 : [
|
|
892
|
+
"red",
|
|
893
|
+
"blue",
|
|
894
|
+
"green",
|
|
895
|
+
"yellow",
|
|
896
|
+
"orange",
|
|
897
|
+
"purple",
|
|
898
|
+
"pink",
|
|
899
|
+
"brown",
|
|
900
|
+
"black",
|
|
901
|
+
"white",
|
|
902
|
+
"gray",
|
|
903
|
+
"cyan",
|
|
904
|
+
"magenta",
|
|
905
|
+
"lime",
|
|
906
|
+
"maroon",
|
|
907
|
+
"navy",
|
|
908
|
+
"olive",
|
|
909
|
+
"teal",
|
|
910
|
+
"silver",
|
|
911
|
+
"aqua"
|
|
912
|
+
].includes(e.toLowerCase());
|
|
913
|
+
}
|
|
914
|
+
function Es(e) {
|
|
915
|
+
return /<\/?[a-z][\s\S]*>/i.test(e);
|
|
916
|
+
}
|
|
917
|
+
function zs(e) {
|
|
918
|
+
return Object.keys(e).reduce((u, r) => (r !== "id" && (u[r] = e[r]), u), {});
|
|
919
|
+
}
|
|
920
|
+
function Us(e, u, r, n, i, t, m, c) {
|
|
921
|
+
const v = I({});
|
|
922
|
+
async function o(T) {
|
|
923
|
+
n.value?.show("loading", t.message.process.loading);
|
|
924
|
+
try {
|
|
925
|
+
const k = await m(e.data, T);
|
|
926
|
+
if (c.isUpdate.value = Number(T), !k) {
|
|
927
|
+
n.value?.show("error", t.message.notFound);
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
const L = e.base.schema.update ?? e.base.schema.global ?? {};
|
|
931
|
+
if (v.value = await Ae(
|
|
932
|
+
k,
|
|
933
|
+
L,
|
|
934
|
+
c.isUpdate.value,
|
|
935
|
+
e.keys?.idKey ?? "id"
|
|
936
|
+
), e.base?.justTabel || e.manual?.update || !e.endPoints?.update) {
|
|
937
|
+
u("edit", v.value, T), n.value?.hide();
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
c.FormModalOpen.value = !0, n.value?.hide();
|
|
941
|
+
} catch (k) {
|
|
942
|
+
const L = typeof k == "string" ? k : k instanceof Error ? k.message : JSON.stringify(k, Object.getOwnPropertyNames(k));
|
|
943
|
+
n.value?.show("error", L || "An unknown error occurred");
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
function j() {
|
|
947
|
+
if (e.base?.justTabel || e.manual?.create || !e.endPoints?.create) {
|
|
948
|
+
u("create");
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
c.isUpdate.value = null, c.FormModalOpen.value = !0;
|
|
952
|
+
}
|
|
953
|
+
async function w(T) {
|
|
954
|
+
n.value?.show("loading", t.message.process.loading);
|
|
955
|
+
try {
|
|
956
|
+
const k = await m(e.data, T);
|
|
957
|
+
if (c.isUpdate.value = Number(T), !k) {
|
|
958
|
+
n.value?.show("error", t.message.notFound);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (v.value = await ye(
|
|
962
|
+
k,
|
|
963
|
+
e.base?.schema.display ?? e.base?.schema.global ?? {}
|
|
964
|
+
), e.base.justTabel || e.manual?.display) {
|
|
965
|
+
u("show", v.value, T), n.value?.hide();
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
c.detailItemModal.value = !0, n.value?.hide();
|
|
969
|
+
} catch (k) {
|
|
970
|
+
n.value?.show("error", JSON.stringify(k));
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
function F(T) {
|
|
974
|
+
c.idData.value = T, c.showWarningModel.value = !0;
|
|
975
|
+
}
|
|
976
|
+
function _() {
|
|
977
|
+
c.showWarningModelSelected.value = !0;
|
|
978
|
+
}
|
|
979
|
+
function K() {
|
|
980
|
+
c.showWarningModel.value = !1, c.showWarningModelSelected.value = !1, c.FormModalOpen.value = !1, c.detailItemModal.value = !1, v.value = {}, c.isUpdate.value = null;
|
|
981
|
+
}
|
|
982
|
+
const B = async (T) => {
|
|
983
|
+
const k = c.isUpdate.value !== null, L = k ? e.endPoints?.update : e.endPoints?.create, U = k ? e.validation?.update || null : e.validation?.create || null, se = k ? "update" : "create", q = k ? t.message.success.update : t.message.success.create, Z = k ? t.message.error.update : t.message.error.create;
|
|
984
|
+
if (!L) {
|
|
985
|
+
n.value?.show(
|
|
986
|
+
"error",
|
|
987
|
+
k ? t.message.error.update : t.message.error.create
|
|
988
|
+
);
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
if (Array.isArray(c.dataChildDelete.value) && c.dataChildDelete.value.length > 0 && k) {
|
|
992
|
+
const W = e.base.schema.update ?? e.base.schema.global ?? {};
|
|
993
|
+
let P = "", ee, ae = await m(
|
|
994
|
+
e.data,
|
|
995
|
+
c.isUpdate.value
|
|
996
|
+
), ue, je, be = !0;
|
|
997
|
+
for (const te in W) {
|
|
998
|
+
const J = W[te];
|
|
999
|
+
if (J.type === "arrayObject") {
|
|
1000
|
+
P = te, ee = J.endPoint?.deleteMany ?? e.endPoints?.deleteMany, ue = J.DB_NAME ?? e.base.source.DB_NAME, je = J.deleteValidation ?? e.validation?.delete ?? void 0, be = !0;
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
if (Array.isArray(v.value[P]))
|
|
1005
|
+
for (let te = 0; te < c.dataChildDelete.value.length; te++) {
|
|
1006
|
+
const J = c.dataChildDelete.value[te];
|
|
1007
|
+
e.keys?.idKey, v.value[P] = v.value[P].filter((Q) => Q?.[e.keys?.idKey ?? "id"] !== J), ae && Array.isArray(ae[P]) && (ae[P] = ae[P].filter((Q) => Q?.[e.keys?.idKey ?? "id"] !== J));
|
|
1008
|
+
}
|
|
1009
|
+
const de = st(ce(T), ce(Me(v.value))), le = await O(
|
|
1010
|
+
c.dataChildDelete.value,
|
|
1011
|
+
ee,
|
|
1012
|
+
je,
|
|
1013
|
+
ue,
|
|
1014
|
+
be
|
|
1015
|
+
);
|
|
1016
|
+
if (le?.response && de) {
|
|
1017
|
+
n.value?.show("success", t.message.success.delete), await dt(ue, ce(Me(ae))), await r(), K();
|
|
1018
|
+
return;
|
|
1019
|
+
} else if (!le?.response) {
|
|
1020
|
+
n.value?.show("error", le.message);
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
try {
|
|
1025
|
+
n.value?.show(
|
|
1026
|
+
"loading",
|
|
1027
|
+
k ? t.message.process.update : t.message.process.create
|
|
1028
|
+
);
|
|
1029
|
+
const W = k ? e.submitOption?.update?.authType ?? e.submitOption?.global?.authType ?? "cookie" : e.submitOption?.create?.authType ?? e.submitOption?.global?.authType ?? "cookie", P = k ? e.submitOption?.update?.token ?? e.submitOption?.global?.token ?? void 0 : e.submitOption?.create?.token ?? e.submitOption?.global?.token ?? void 0, ee = k ? e.submitOption?.update?.customHeaders ?? e.submitOption?.global?.customHeaders ?? void 0 : e.submitOption?.create?.customHeaders ?? e.submitOption?.global?.customHeaders ?? void 0;
|
|
1030
|
+
await fe({
|
|
1031
|
+
data: ce(T),
|
|
1032
|
+
oldData: k ? ce(Me(v.value)) : void 0,
|
|
1033
|
+
validation: U ?? void 0,
|
|
1034
|
+
endpoint: L,
|
|
1035
|
+
mode: se,
|
|
1036
|
+
token: P,
|
|
1037
|
+
authType: W,
|
|
1038
|
+
customHeaders: ee,
|
|
1039
|
+
db: e.base.source.DB_NAME,
|
|
1040
|
+
...k ? e.submitOption?.update ?? e.submitOption?.global : e.submitOption?.create ?? e.submitOption?.global
|
|
1041
|
+
}), e.base.dataTabelCustomDisplay ? u("refreshData") : r(), n.value?.show("success", q), K();
|
|
1042
|
+
} catch (W) {
|
|
1043
|
+
i(
|
|
1044
|
+
"error",
|
|
1045
|
+
Z,
|
|
1046
|
+
Object.entries(W).map(([P, ee]) => `${P} : ${ee}`)
|
|
1047
|
+
), n.value?.show("error", Z);
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
async function E(T, k, L, U, se = !0) {
|
|
1051
|
+
if (e.base.justTabel || e.manual?.delete || !e.endPoints?.delete) {
|
|
1052
|
+
u("delete", T);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
if (k = k ?? e.endPoints?.delete, L = L ?? e.validation?.delete, U = U ?? e.base?.source.DB_NAME ?? void 0, !k) {
|
|
1056
|
+
n.value?.show("error", t.message.error.delete);
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
const q = { [e.keys?.idKey ?? "id"]: T };
|
|
1060
|
+
try {
|
|
1061
|
+
n.value?.show("loading", t.message.process.delete);
|
|
1062
|
+
const Z = e.submitOption?.delete?.authType ?? e.submitOption?.global?.authType ?? "cookie", W = e.submitOption?.delete?.token ?? e.submitOption?.global?.token ?? void 0, P = e.submitOption?.delete?.customHeaders ?? e.submitOption?.global?.customHeaders ?? void 0;
|
|
1063
|
+
await fe({
|
|
1064
|
+
data: q,
|
|
1065
|
+
validation: L ?? void 0,
|
|
1066
|
+
endpoint: k,
|
|
1067
|
+
mode: "delete",
|
|
1068
|
+
token: W,
|
|
1069
|
+
authType: Z,
|
|
1070
|
+
customHeaders: P,
|
|
1071
|
+
db: U,
|
|
1072
|
+
deleteDataDB: se,
|
|
1073
|
+
...e.submitOption?.delete ?? e.submitOption?.global
|
|
1074
|
+
}), e.base?.dataTabelCustomDisplay ? u("refreshData") : r(), n.value?.show("success", t.message.success.delete);
|
|
1075
|
+
} catch (Z) {
|
|
1076
|
+
i(
|
|
1077
|
+
"error",
|
|
1078
|
+
t.message.error.delete,
|
|
1079
|
+
Object.entries(Z).map(([W, P]) => `${W} : ${P}`)
|
|
1080
|
+
), n.value?.show("error", t.message.error.delete);
|
|
1081
|
+
} finally {
|
|
1082
|
+
K();
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
async function O(T, k, L, U, se = !0) {
|
|
1086
|
+
if (e.base?.justTabel || e.manual?.delete || !e.endPoints?.delete) {
|
|
1087
|
+
u("deleteMany", T);
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
if (k = k ?? e.endPoints?.deleteMany, L = L ?? e.validation?.deleteMany, U = U ?? e.base?.source.DB_NAME ?? void 0, !k) {
|
|
1091
|
+
n.value?.show("error", t.message.error.deleteMany);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
try {
|
|
1095
|
+
n.value?.show("loading", t.message.process.deleteMany);
|
|
1096
|
+
const q = e.submitOption?.delete?.authType ?? e.submitOption?.global?.authType ?? "cookie", Z = e.submitOption?.delete?.token ?? e.submitOption?.global?.token ?? void 0, W = e.submitOption?.delete?.customHeaders ?? e.submitOption?.global?.customHeaders ?? void 0, P = await fe({
|
|
1097
|
+
data: { [e.keys?.idsKey ?? "ids"]: T },
|
|
1098
|
+
validation: L ?? void 0,
|
|
1099
|
+
endpoint: k,
|
|
1100
|
+
mode: "delete",
|
|
1101
|
+
db: U,
|
|
1102
|
+
authType: q,
|
|
1103
|
+
token: Z,
|
|
1104
|
+
customHeaders: W,
|
|
1105
|
+
deleteDataDB: se
|
|
1106
|
+
});
|
|
1107
|
+
return c.selectedItems.value = [], e.base?.dataTabelCustomDisplay ? (u("refreshData"), n.value?.show("success", t.message.success.deleteMany), K(), P) : (await r(), n.value?.show("success", t.message.success.deleteMany), K(), P);
|
|
1108
|
+
} catch (q) {
|
|
1109
|
+
i(
|
|
1110
|
+
"error",
|
|
1111
|
+
t.message.error.deleteMany,
|
|
1112
|
+
Object.entries(q).map(([Z, W]) => `${Z} : ${W}`)
|
|
1113
|
+
), n.value?.show("error", t.message.error.deleteMany);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return {
|
|
1117
|
+
initialData: v,
|
|
1118
|
+
openEditModal: o,
|
|
1119
|
+
openCreateModal: j,
|
|
1120
|
+
openShowModal: w,
|
|
1121
|
+
openWarningDeleteData: F,
|
|
1122
|
+
openWarningDeleteSelectedData: _,
|
|
1123
|
+
closeModal: K,
|
|
1124
|
+
submitFormData: B,
|
|
1125
|
+
DeleteData: E,
|
|
1126
|
+
DeleteSeletedData: O
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
function Ws(e, u, r, n) {
|
|
1130
|
+
const i = I(""), t = I(1), m = I([]), c = I(!1), v = I(!1), o = I(!1), j = I(null), w = I(null), F = I("asc"), _ = I(!1), K = I(!1), B = I(null), E = I(null), O = X(() => e.pagination?.itemsPerPage ?? 10), T = X(() => e.pagination?.maxVisiblePages ?? 5);
|
|
1131
|
+
I(null), I("none");
|
|
1132
|
+
const k = X(() => {
|
|
1133
|
+
const b = e.keys?.idKey;
|
|
1134
|
+
return e.data.find((M) => M?.[b ?? "id"] === j.value) || {};
|
|
1135
|
+
}), L = X(() => {
|
|
1136
|
+
const b = e.keys?.idKey ?? "id", M = e.keys?.nameKey ?? "name";
|
|
1137
|
+
return e.data.filter((H) => m.value.includes(H[b])).map((H) => H[M]).join(", ");
|
|
1138
|
+
}), U = X(() => {
|
|
1139
|
+
let b = (e.base.data ?? []).filter(
|
|
1140
|
+
(M) => Object.values(M).some(
|
|
1141
|
+
(H) => String(H).toLowerCase().includes(i.value.toLowerCase())
|
|
1142
|
+
)
|
|
1143
|
+
);
|
|
1144
|
+
return w.value && b.sort((M, H) => {
|
|
1145
|
+
let p = M[w.value], D = H[w.value];
|
|
1146
|
+
return typeof p == "string" && (p = p.toLowerCase()), typeof D == "string" && (D = D.toLowerCase()), p < D ? F.value === "asc" ? -1 : 1 : p > D ? F.value === "asc" ? 1 : -1 : 0;
|
|
1147
|
+
}), b;
|
|
1148
|
+
}), se = X(() => {
|
|
1149
|
+
const b = (t.value - 1) * O.value;
|
|
1150
|
+
return U.value.slice(b, b + O.value);
|
|
1151
|
+
}), q = X(() => Math.ceil(U.value.length / O.value)), Z = X(() => {
|
|
1152
|
+
const b = [], M = q.value, H = t.value, p = T.value;
|
|
1153
|
+
if (M <= p + 2) {
|
|
1154
|
+
for (let x = 1; x <= M; x++) b.push(x);
|
|
1155
|
+
return b;
|
|
1156
|
+
}
|
|
1157
|
+
b.push(1);
|
|
1158
|
+
let D = Math.max(2, H - 2), f = Math.min(M - 1, H + 2);
|
|
1159
|
+
D > 2 && b.push("...");
|
|
1160
|
+
for (let x = D; x <= f; x++)
|
|
1161
|
+
b.push(x);
|
|
1162
|
+
return f < M - 1 && b.push("..."), b.push(M), b;
|
|
1163
|
+
});
|
|
1164
|
+
function W() {
|
|
1165
|
+
m.value = c.value ? se.value.map((b) => b?.[e.keys?.idKey ?? "id"]) : [];
|
|
1166
|
+
}
|
|
1167
|
+
function P(b) {
|
|
1168
|
+
w.value === b ? F.value = F.value === "desc" ? "asc" : "desc" : (w.value = b, F.value = "desc");
|
|
1169
|
+
}
|
|
1170
|
+
function ee() {
|
|
1171
|
+
t.value > 1 && t.value--;
|
|
1172
|
+
}
|
|
1173
|
+
function ae() {
|
|
1174
|
+
t.value < q.value && t.value++;
|
|
1175
|
+
}
|
|
1176
|
+
async function ue() {
|
|
1177
|
+
if (e.base.source.DB_NAME) {
|
|
1178
|
+
const b = await He(e.base.source.DB_NAME);
|
|
1179
|
+
if (e.base.source.connect?.length) {
|
|
1180
|
+
const M = {};
|
|
1181
|
+
return await Promise.all(
|
|
1182
|
+
e.base.source.connect.map(async (H) => {
|
|
1183
|
+
M[H.DB_NAME] = await He(H.DB_NAME);
|
|
1184
|
+
})
|
|
1185
|
+
), b.map((H) => {
|
|
1186
|
+
let p = { ...H };
|
|
1187
|
+
for (const D of e.base.source.connect) {
|
|
1188
|
+
const f = D.key, x = D.connectKey, $ = (M[D.DB_NAME] || []).filter(
|
|
1189
|
+
(V) => Q(V, x) === Q(H, f)
|
|
1190
|
+
);
|
|
1191
|
+
p[D.DB_NAME] = $.length > 0 ? $ : null;
|
|
1192
|
+
}
|
|
1193
|
+
return p;
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1196
|
+
return b;
|
|
1197
|
+
} else if (e.base.source.fetchApi?.getAll) {
|
|
1198
|
+
const b = e.submitOption?.delete?.authType ?? e.submitOption?.global?.authType ?? "cookie", M = e.submitOption?.delete?.token ?? e.submitOption?.global?.token, H = e.submitOption?.delete?.customHeaders ?? e.submitOption?.global?.customHeaders, p = await fe({
|
|
1199
|
+
mode: "get",
|
|
1200
|
+
endpoint: e.base.source.fetchApi?.getAll,
|
|
1201
|
+
db: e.base.source.DB_NAME,
|
|
1202
|
+
authType: b,
|
|
1203
|
+
token: M,
|
|
1204
|
+
customHeaders: H
|
|
1205
|
+
});
|
|
1206
|
+
if (e.base.source.fetchApi.connect?.length) {
|
|
1207
|
+
const D = {};
|
|
1208
|
+
return await Promise.all(
|
|
1209
|
+
e.base.source.fetchApi.connect.map(async (f) => {
|
|
1210
|
+
const x = await fe({
|
|
1211
|
+
mode: "get",
|
|
1212
|
+
endpoint: f.url,
|
|
1213
|
+
db: e.base.source.DB_NAME,
|
|
1214
|
+
authType: b,
|
|
1215
|
+
token: M,
|
|
1216
|
+
customHeaders: H
|
|
1217
|
+
}), $ = f.valueKey ?? f.url ?? f.key;
|
|
1218
|
+
D[$] = x.data ?? [];
|
|
1219
|
+
})
|
|
1220
|
+
), !p.data || !Array.isArray(p.data) ? p.data : p.data.map((f) => {
|
|
1221
|
+
let x = { ...f };
|
|
1222
|
+
for (const $ of e.base.source.fetchApi.connect) {
|
|
1223
|
+
const V = $.key, A = $.connectKey, g = $.valueKey ?? $.url ?? $.key, h = (D[g] || []).filter(
|
|
1224
|
+
(C) => Q(C, A) === Q(f, V)
|
|
1225
|
+
);
|
|
1226
|
+
x[g] = h.length > 0 ? h : null;
|
|
1227
|
+
}
|
|
1228
|
+
return x;
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
return p.data ?? [];
|
|
1232
|
+
} else
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
async function je(b, M) {
|
|
1236
|
+
if (b.connect?.withDB)
|
|
1237
|
+
return await ve(b.connect.withDB.DB_NAME, M);
|
|
1238
|
+
if (b.connect?.withFetch) {
|
|
1239
|
+
const H = e.submitOption?.delete?.authType ?? e.submitOption?.global?.authType ?? "cookie", p = e.submitOption?.delete?.token ?? e.submitOption?.global?.token ?? void 0, D = e.submitOption?.delete?.customHeaders ?? e.submitOption?.global?.customHeaders ?? void 0, f = await fe({
|
|
1240
|
+
mode: "get",
|
|
1241
|
+
endpoint: b.connect?.withFetch.url + "/" + M,
|
|
1242
|
+
db: e.base.source.DB_NAME,
|
|
1243
|
+
authType: H,
|
|
1244
|
+
token: p,
|
|
1245
|
+
customHeaders: D
|
|
1246
|
+
});
|
|
1247
|
+
if (f.data)
|
|
1248
|
+
return f.data;
|
|
1249
|
+
} else
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
async function be(b, M) {
|
|
1253
|
+
return b.find((H) => H[e.keys?.idKey ?? "id"] == M);
|
|
1254
|
+
}
|
|
1255
|
+
let de = !0, le = null;
|
|
1256
|
+
async function te() {
|
|
1257
|
+
if (de && r.value?.show("loading", n.message.process.loading), e.base?.dataTabelCustomDisplay && e.base?.dataTabelCustomDisplay.length !== 0) {
|
|
1258
|
+
e.base.data = e.base.dataTabelCustomDisplay, e.data = await ue(), await J(), de && (r.value?.hide(), de = !1);
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
const b = await ue();
|
|
1262
|
+
if (e.data = b, await J(), Array.isArray(b)) {
|
|
1263
|
+
const p = e.keys?.idKey ?? "id";
|
|
1264
|
+
b.sort((D, f) => D.updatedAt && f.updatedAt ? new Date(f.updatedAt).getTime() - new Date(D.updatedAt).getTime() : (f[p] ?? 0) - (D[p] ?? 0)), e.data = b;
|
|
1265
|
+
} else {
|
|
1266
|
+
de && (r.value?.hide(), de = !1);
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
const M = e.keys?.idKey, H = e.base.headersTabelDisplay?.length === 0 || e.base.headersTabelDisplay === void 0;
|
|
1270
|
+
e.base.data = await Promise.all(
|
|
1271
|
+
b.map(async (p) => {
|
|
1272
|
+
const D = {};
|
|
1273
|
+
if (M && p[M] != null && (D[M] = p[M], H && (!e.base.headersTabelDisplay?.includes(M) || e.base.headersTabelDisplay === void 0) && (e.base.headersTabelDisplay = [])), e.base.dataTabelDisplay)
|
|
1274
|
+
for (const [f, x] of Object.entries(e.base.dataTabelDisplay))
|
|
1275
|
+
if (typeof x == "string") {
|
|
1276
|
+
const $ = Q(p, x);
|
|
1277
|
+
D[f] = Array.isArray($) ? $.map((V) => ne(V)) : ne($ ?? "-"), H && !e.base.headersTabelDisplay?.includes(f) && e.base.headersTabelDisplay?.push(f);
|
|
1278
|
+
} else {
|
|
1279
|
+
let $ = Q(p, x.valueKey);
|
|
1280
|
+
if ((x.connect?.withDB || x.connect?.withFetch) && $)
|
|
1281
|
+
if (Array.isArray($)) {
|
|
1282
|
+
const V = await Promise.all(
|
|
1283
|
+
$.map(async (A) => {
|
|
1284
|
+
const g = await je(x, A);
|
|
1285
|
+
return g ? g[x.connect?.withDB?.valueKey ?? x.connect?.withFetch?.valueKey] : A;
|
|
1286
|
+
})
|
|
1287
|
+
);
|
|
1288
|
+
D[f] = V.map((A) => ne(A));
|
|
1289
|
+
} else {
|
|
1290
|
+
const V = await je(x, $);
|
|
1291
|
+
V && ($ = V[x.connect.withDB?.valueKey ?? x.connect.withFetch?.valueKey]), D[f] = ne($);
|
|
1292
|
+
}
|
|
1293
|
+
else
|
|
1294
|
+
D[f] = ne($);
|
|
1295
|
+
H && !e.base.headersTabelDisplay?.includes(f) && e.base.headersTabelDisplay?.push(f);
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
let f = 0;
|
|
1299
|
+
for (const [x, $] of Object.entries(p)) {
|
|
1300
|
+
if (x === M) continue;
|
|
1301
|
+
if (f >= 8) break;
|
|
1302
|
+
const V = me(x);
|
|
1303
|
+
D[V] = ne($), H && !e.base.headersTabelDisplay?.includes(V) && e.base.headersTabelDisplay?.push(V), f++;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
return D;
|
|
1307
|
+
})
|
|
1308
|
+
), de && (r.value?.hide(), de = !1), e.base?.source?.fetchApi?.autoRefresh?.time && (le && clearTimeout(le), le = setTimeout(() => {
|
|
1309
|
+
te();
|
|
1310
|
+
}, e.base.source.fetchApi.autoRefresh.time));
|
|
1311
|
+
}
|
|
1312
|
+
async function J() {
|
|
1313
|
+
const b = {
|
|
1314
|
+
global: e.base.schema.global ?? {},
|
|
1315
|
+
create: e.base.schema.create ?? {},
|
|
1316
|
+
update: e.base.schema.update ?? {},
|
|
1317
|
+
display: e.base.schema.display ?? {}
|
|
1318
|
+
}, M = (f) => ({
|
|
1319
|
+
authType: e.submitOption?.[f]?.authType ?? e.submitOption?.global?.authType ?? "cookie",
|
|
1320
|
+
token: e.submitOption?.[f]?.token ?? e.submitOption?.global?.token,
|
|
1321
|
+
customHeaders: e.submitOption?.[f]?.customHeaders ?? e.submitOption?.global?.customHeaders
|
|
1322
|
+
}), H = async (f) => {
|
|
1323
|
+
const x = f.options?.valueKey ?? "id", $ = f.options?.viewKey ?? "name";
|
|
1324
|
+
let V;
|
|
1325
|
+
if (f.options?.url && (V = await fe({
|
|
1326
|
+
mode: "get",
|
|
1327
|
+
endpoint: f.options.url,
|
|
1328
|
+
...M("get")
|
|
1329
|
+
}), Array.isArray(V?.data) && (f.options = V.data.map((A) => A[x]) ?? [], f.options?.viewKey ? f.optionsView = V.map((A) => A[$]) ?? [] : f.optionsView = V.map((A) => A[x]) ?? [])), f.options?.DB_NAME) {
|
|
1330
|
+
const A = f.options?.DB_NAME ?? f.optionsView?.DB_NAME;
|
|
1331
|
+
if (V = await He(A), Array.isArray(V)) {
|
|
1332
|
+
const g = f.options;
|
|
1333
|
+
g?.DB_NAME && (f.options = V.map((h) => h[x]) ?? []), g?.viewKey ? f.optionsView = V.map((h) => h[$]) ?? [] : f.optionsView = V.map((h) => h[x]) ?? [];
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}, p = (f, x) => {
|
|
1337
|
+
e.data && f.validate?.duplicate === !0 && (f.validate.duplicate = e.data.map(($) => $[x]) ?? []);
|
|
1338
|
+
};
|
|
1339
|
+
async function D(f) {
|
|
1340
|
+
for (const [x, $] of Object.entries(f)) {
|
|
1341
|
+
const V = $?.type;
|
|
1342
|
+
if (V === "select" && await H($), V === "text" && p($, x), V === "optionGroupSchema") {
|
|
1343
|
+
const A = $?.options ?? {};
|
|
1344
|
+
for (const [g, h] of Object.entries(A))
|
|
1345
|
+
await D(h);
|
|
1346
|
+
}
|
|
1347
|
+
V === "arrayObject" && $.schema && await D($.schema), V === "object" && $.schema && await D($.schema);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
for (const [f, x] of Object.entries(b))
|
|
1351
|
+
x && await D(x);
|
|
1352
|
+
}
|
|
1353
|
+
function Q(b, M) {
|
|
1354
|
+
if (!(!b || typeof M != "string"))
|
|
1355
|
+
try {
|
|
1356
|
+
const H = M.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
1357
|
+
let p = b;
|
|
1358
|
+
for (const D of H) {
|
|
1359
|
+
if (p == null) return;
|
|
1360
|
+
if (Array.isArray(p)) {
|
|
1361
|
+
const f = Number(D);
|
|
1362
|
+
isNaN(f) ? (p = p.map((x) => x?.[D]).filter((x) => x !== void 0), p.some((x) => Array.isArray(x)) && (p = p.flat()), p.length === 1 && (p = p[0])) : p = p[f];
|
|
1363
|
+
} else
|
|
1364
|
+
p = p?.[D];
|
|
1365
|
+
}
|
|
1366
|
+
return p;
|
|
1367
|
+
} catch {
|
|
1368
|
+
return "-";
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
function me(b) {
|
|
1372
|
+
return b.replace(/([A-Z])/g, " $1").replace(/[_\-]/g, " ").replace(/\s+/g, " ").trim().replace(/\w\S*/g, (M) => M.charAt(0).toUpperCase() + M.slice(1).toLowerCase());
|
|
1373
|
+
}
|
|
1374
|
+
function ne(b) {
|
|
1375
|
+
if (Array.isArray(b)) {
|
|
1376
|
+
if (b.length === 0) return "Empty";
|
|
1377
|
+
if (typeof b[0] == "string") return b.join(", ");
|
|
1378
|
+
if (typeof b[0] == "object") return `${b.length} item`;
|
|
1379
|
+
}
|
|
1380
|
+
return typeof b == "object" && b !== null ? Object.keys(b).length > 0 ? "Objek" : "Empty" : b != null ? String(b) : "—";
|
|
1381
|
+
}
|
|
1382
|
+
return {
|
|
1383
|
+
searchQuery: i,
|
|
1384
|
+
currentPage: t,
|
|
1385
|
+
selectedItems: m,
|
|
1386
|
+
selectAll: c,
|
|
1387
|
+
showWarningModel: v,
|
|
1388
|
+
showWarningModelSelected: o,
|
|
1389
|
+
idData: j,
|
|
1390
|
+
sortField: w,
|
|
1391
|
+
sortDirection: F,
|
|
1392
|
+
FormModalOpen: _,
|
|
1393
|
+
detailItemModal: K,
|
|
1394
|
+
isUpdate: B,
|
|
1395
|
+
dataChildDelete: E,
|
|
1396
|
+
selectedItem: k,
|
|
1397
|
+
selectedItemNames: L,
|
|
1398
|
+
filteredData: U,
|
|
1399
|
+
paginatedData: se,
|
|
1400
|
+
totalPages: q,
|
|
1401
|
+
visiblePages: Z,
|
|
1402
|
+
toggleAll: W,
|
|
1403
|
+
sortBy: P,
|
|
1404
|
+
prevPage: ee,
|
|
1405
|
+
nextPage: ae,
|
|
1406
|
+
summarizeValue: ne,
|
|
1407
|
+
setUpData: te,
|
|
1408
|
+
getValueByPath: Q,
|
|
1409
|
+
toTitleCase: me,
|
|
1410
|
+
GetDataById: be
|
|
1411
|
+
};
|
|
1412
|
+
}
|
|
1413
|
+
const Gs = {
|
|
1414
|
+
idKey: "id",
|
|
1415
|
+
idsKey: "ids"
|
|
1416
|
+
}, qs = {
|
|
1417
|
+
btnInfoActive: !0,
|
|
1418
|
+
searchQueryActive: !0,
|
|
1419
|
+
sortable: !0,
|
|
1420
|
+
createActive: !0,
|
|
1421
|
+
updateActive: !0,
|
|
1422
|
+
deleteActive: !0,
|
|
1423
|
+
deleteManyActive: !0,
|
|
1424
|
+
displayActive: !0
|
|
1425
|
+
}, oa = {
|
|
1426
|
+
create: !1,
|
|
1427
|
+
update: !1,
|
|
1428
|
+
delete: !1,
|
|
1429
|
+
deleteMany: !1,
|
|
1430
|
+
display: !1
|
|
1431
|
+
}, Rs = {
|
|
1432
|
+
itemsPerPage: 5,
|
|
1433
|
+
maxVisiblePages: 5
|
|
1434
|
+
}, Zs = {
|
|
1435
|
+
create: void 0,
|
|
1436
|
+
update: void 0,
|
|
1437
|
+
delete: void 0,
|
|
1438
|
+
deleteMany: void 0
|
|
1439
|
+
}, ra = {
|
|
1440
|
+
create: void 0,
|
|
1441
|
+
update: void 0,
|
|
1442
|
+
delete: void 0,
|
|
1443
|
+
deleteMany: void 0
|
|
1444
|
+
}, ia = {
|
|
1445
|
+
global: {
|
|
1446
|
+
authType: "cookie"
|
|
1447
|
+
}
|
|
1448
|
+
}, Js = { class: "jsgd-w-full jsgd-h-full jsgd-flex jsgd-flex-col jsgd-bg-white jsgd-text-slate-800 jsgd-relative jsgd-transition-all dark:jsgd-bg-slate-900 dark:jsgd-text-slate-100" }, Qs = { class: "jsgd-flex-1 jsgd-flex jsgd-flex-col jsgd-p-6 jsgd-gap-6 jsgd-box-border" }, Xs = { class: "jsgd-flex jsgd-justify-center jsgd-gap-4 jsgd-p-6 jsgd-bg-slate-50 jsgd-rounded-2xl jsgd-shadow-sm jsgd-border jsgd-border-slate-200 min-[512px]:jsgd-flex-col dark:jsgd-bg-slate-800 dark:jsgd-border-slate-700" }, Ys = { class: "jsgd-flex jsgd-items-center jsgd-flex-col jsgd-justify-center jsgd-gap-4 min-[512px]:jsgd-flex-row min-[512px]:jsgd-justify-between min-[512px]:jsgd-items-center" }, ed = { class: "jsgd-flex jsgd-items-center" }, td = { class: "jsgd-flex jsgd-gap-3 jsgd-flex-wrap" }, sd = ["disabled"], dd = { class: "jsgd-flex jsgd-items-center" }, ad = {
|
|
1449
|
+
key: 0,
|
|
1450
|
+
class: "jsgd-relative jsgd-min-w-[250px]"
|
|
1451
|
+
}, ld = ["placeholder"], nd = {
|
|
1452
|
+
key: 0,
|
|
1453
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-4 jsgd-py-3 jsgd-bg-blue-500 jsgd-text-white jsgd-rounded-lg jsgd-text-sm jsgd-font-medium jsgd-animate-[slideIn_0.3s_ease-out] dark:jsgd-bg-blue-600"
|
|
1454
|
+
}, od = { class: "jsgd-bg-white/20 jsgd-px-2 jsgd-py-1 jsgd-rounded-md jsgd-font-semibold" }, rd = {
|
|
1455
|
+
key: 0,
|
|
1456
|
+
class: "jsgd-flex jsgd-flex-col jsgd-items-center jsgd-justify-center jsgd-py-16 jsgd-px-8 jsgd-text-center jsgd-bg-slate-50 jsgd-rounded-2xl jsgd-border jsgd-border-slate-200 dark:jsgd-bg-slate-800 dark:jsgd-border-slate-700"
|
|
1457
|
+
}, id = { class: "jsgd-text-xl jsgd-font-semibold jsgd-text-slate-800 jsgd-mb-2 dark:jsgd-text-slate-100" }, gd = { class: "jsgd-text-slate-500 jsgd-mb-8 jsgd-max-w-[300px] dark:jsgd-text-slate-400" }, ud = {
|
|
1458
|
+
key: 1,
|
|
1459
|
+
class: "jsgd-flex jsgd-flex-col jsgd-flex-1 jsgd-gap-6"
|
|
1460
|
+
}, cd = { class: "jsgd-flex-1 jsgd-overflow-auto jsgd-rounded-lg jsgd-border jsgd-border-slate-200 jsgd-bg-white jsgd-shadow-sm table-scroll-container dark:jsgd-border-slate-700 dark:jsgd-bg-slate-900" }, jd = { class: "jsgd-w-full jsgd-border-collapse jsgd-bg-white dark:jsgd-bg-slate-900" }, bd = { class: "jsgd-bg-slate-50 jsgd-border-b jsgd-border-slate-200 dark:jsgd-bg-slate-800 dark:jsgd-border-slate-700" }, fd = { class: "jsgd-w-12 jsgd-p-4" }, md = { class: "jsgd-flex jsgd-items-center jsgd-gap-2" }, hd = ["onClick"], vd = { class: "jsgd-w-48 jsgd-text-xs jsgd-p-4 jsgd-text-right" }, yd = { class: "jsgd-bg-white dark:jsgd-bg-slate-900" }, kd = { class: "jsgd-text-center" }, xd = ["value"], pd = ["innerHTML"], wd = { key: 1 }, _d = {
|
|
1461
|
+
key: 2,
|
|
1462
|
+
class: "jsgd-whitespace-nowrap jsgd-overflow-hidden jsgd-text-ellipsis jsgd-flex jsgd-items-center jsgd-gap-2"
|
|
1463
|
+
}, Cd = {
|
|
1464
|
+
key: 3,
|
|
1465
|
+
class: "jsgd-whitespace-nowrap jsgd-overflow-hidden jsgd-text-ellipsis jsgd-flex jsgd-items-center jsgd-gap-2"
|
|
1466
|
+
}, Dd = {
|
|
1467
|
+
key: 4,
|
|
1468
|
+
class: "jsgd-whitespace-nowrap jsgd-overflow-hidden jsgd-text-ellipsis jsgd-flex jsgd-items-center jsgd-gap-2"
|
|
1469
|
+
}, Md = {
|
|
1470
|
+
key: 5,
|
|
1471
|
+
class: "jsgd-whitespace-nowrap"
|
|
1472
|
+
}, $d = { class: "jsgd-w-12 jsgd-h-12 jsgd-rounded-lg jsgd-overflow-hidden jsgd-border jsgd-border-slate-200 dark:jsgd-border-slate-700" }, Ad = ["src", "alt"], Td = {
|
|
1473
|
+
key: 6,
|
|
1474
|
+
class: "jsgd-whitespace-nowrap jsgd-flex jsgd-items-center jsgd-gap-1"
|
|
1475
|
+
}, Od = ["title"], Kd = {
|
|
1476
|
+
key: 0,
|
|
1477
|
+
class: "jsgd-text-xs jsgd-text-slate-400 jsgd-ml-1 dark:jsgd-text-slate-500"
|
|
1478
|
+
}, Hd = {
|
|
1479
|
+
key: 7,
|
|
1480
|
+
class: "jsgd-whitespace-nowrap"
|
|
1481
|
+
}, Vd = ["title"], Bd = {
|
|
1482
|
+
key: 8,
|
|
1483
|
+
class: "jsgd-whitespace-nowrap jsgd-flex jsgd-items-center jsgd-gap-1"
|
|
1484
|
+
}, Sd = ["src", "alt"], Id = {
|
|
1485
|
+
key: 0,
|
|
1486
|
+
class: "jsgd-text-xs jsgd-text-slate-400 jsgd-ml-1 dark:jsgd-text-slate-500"
|
|
1487
|
+
}, Nd = {
|
|
1488
|
+
key: 9,
|
|
1489
|
+
class: "jsgd-whitespace-nowrap jsgd-overflow-hidden jsgd-text-ellipsis"
|
|
1490
|
+
}, Ld = {
|
|
1491
|
+
key: 10,
|
|
1492
|
+
class: "jsgd-whitespace-nowrap jsgd-overflow-hidden jsgd-text-ellipsis"
|
|
1493
|
+
}, Fd = { class: "jsgd-p-4 jsgd-text-right" }, Pd = { class: "jsgd-flex jsgd-justify-end jsgd-gap-2" }, Ed = ["onClick"], zd = { class: "jsgd-hidden md:jsgd-inline" }, Ud = ["onClick"], Wd = { class: "jsgd-hidden md:jsgd-inline" }, Gd = ["onClick"], qd = { class: "jsgd-hidden md:jsgd-inline" }, Rd = { class: "jsgd-flex jsgd-flex-col jsgd-gap-4 jsgd-items-center jsgd-justify-between jsgd-p-6 jsgd-bg-slate-50 jsgd-rounded-2xl jsgd-border jsgd-border-slate-200 md:jsgd-flex-row dark:jsgd-bg-slate-800 dark:jsgd-border-slate-700" }, Zd = { class: "jsgd-text-sm jsgd-text-slate-500 dark:jsgd-text-slate-400" }, Jd = { class: "jsgd-flex jsgd-items-center jsgd-gap-2" }, Qd = ["disabled"], Xd = { class: "jsgd-flex jsgd-items-center jsgd-gap-1" }, Yd = ["onClick", "disabled"], ea = ["disabled"], ga = /* @__PURE__ */ ge({
|
|
1494
|
+
__name: "TabelData",
|
|
1495
|
+
props: {
|
|
1496
|
+
base: {},
|
|
1497
|
+
keys: { default: () => Gs },
|
|
1498
|
+
formDesign: {},
|
|
1499
|
+
submitOption: {},
|
|
1500
|
+
feature: { default: () => qs },
|
|
1501
|
+
pagination: { default: () => Rs },
|
|
1502
|
+
validation: { default: () => Zs },
|
|
1503
|
+
manual: {},
|
|
1504
|
+
endPoints: {}
|
|
1505
|
+
},
|
|
1506
|
+
emits: ["refreshData", "edit", "create", "show", "delete", "deleteMany"],
|
|
1507
|
+
setup(e, { emit: u }) {
|
|
1508
|
+
const r = (A) => typeof A == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(A), n = (A) => typeof A == "string" && /^\d{4}-\d{2}-\d{2}$/.test(A), i = (A) => typeof A == "string" && /^\d{2}:\d{2}$/.test(A);
|
|
1509
|
+
function t(A, g = "en") {
|
|
1510
|
+
try {
|
|
1511
|
+
const h = new Date(A), C = g === "id" ? "id-ID" : g;
|
|
1512
|
+
return new Intl.DateTimeFormat(C, {
|
|
1513
|
+
dateStyle: "medium",
|
|
1514
|
+
// "18 Okt 2025"
|
|
1515
|
+
timeStyle: "short"
|
|
1516
|
+
// "10.54"
|
|
1517
|
+
}).format(h);
|
|
1518
|
+
} catch {
|
|
1519
|
+
return A;
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
function m(A, g = "en") {
|
|
1523
|
+
try {
|
|
1524
|
+
const h = /* @__PURE__ */ new Date(`${A}T00:00:00`), C = g === "id" ? "id-ID" : g;
|
|
1525
|
+
return new Intl.DateTimeFormat(C, {
|
|
1526
|
+
dateStyle: "medium"
|
|
1527
|
+
// "18 Okt 2025"
|
|
1528
|
+
}).format(h);
|
|
1529
|
+
} catch {
|
|
1530
|
+
return A;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
function c(A, g = "en") {
|
|
1534
|
+
try {
|
|
1535
|
+
const [h, C] = A.split(":"), oe = /* @__PURE__ */ new Date();
|
|
1536
|
+
oe.setHours(parseInt(h, 10), parseInt(C, 10), 0, 0);
|
|
1537
|
+
const ke = g === "id" ? "id-ID" : g;
|
|
1538
|
+
return new Intl.DateTimeFormat(ke, {
|
|
1539
|
+
timeStyle: "short"
|
|
1540
|
+
// "10.54"
|
|
1541
|
+
}).format(oe);
|
|
1542
|
+
} catch {
|
|
1543
|
+
return A;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
const v = e, o = I({
|
|
1547
|
+
...v
|
|
1548
|
+
}), j = u, w = I(null), F = I(), _ = X(() => ze[v.base?.lang ?? "en"]), {
|
|
1549
|
+
searchQuery: K,
|
|
1550
|
+
currentPage: B,
|
|
1551
|
+
selectedItems: E,
|
|
1552
|
+
selectAll: O,
|
|
1553
|
+
showWarningModel: T,
|
|
1554
|
+
showWarningModelSelected: k,
|
|
1555
|
+
idData: L,
|
|
1556
|
+
FormModalOpen: U,
|
|
1557
|
+
detailItemModal: se,
|
|
1558
|
+
isUpdate: q,
|
|
1559
|
+
dataChildDelete: Z,
|
|
1560
|
+
selectedItem: W,
|
|
1561
|
+
filteredData: P,
|
|
1562
|
+
paginatedData: ee,
|
|
1563
|
+
totalPages: ae,
|
|
1564
|
+
visiblePages: ue,
|
|
1565
|
+
selectedItemNames: je,
|
|
1566
|
+
toggleAll: be,
|
|
1567
|
+
sortBy: de,
|
|
1568
|
+
prevPage: le,
|
|
1569
|
+
nextPage: te,
|
|
1570
|
+
setUpData: J,
|
|
1571
|
+
GetDataById: Q
|
|
1572
|
+
} = Ws(o.value, j, w, _.value), {
|
|
1573
|
+
initialData: me,
|
|
1574
|
+
openEditModal: ne,
|
|
1575
|
+
openCreateModal: b,
|
|
1576
|
+
openShowModal: M,
|
|
1577
|
+
openWarningDeleteData: H,
|
|
1578
|
+
openWarningDeleteSelectedData: p,
|
|
1579
|
+
closeModal: D,
|
|
1580
|
+
submitFormData: f,
|
|
1581
|
+
DeleteData: x,
|
|
1582
|
+
DeleteSeletedData: $
|
|
1583
|
+
} = Us(
|
|
1584
|
+
o.value,
|
|
1585
|
+
j,
|
|
1586
|
+
J,
|
|
1587
|
+
w,
|
|
1588
|
+
V,
|
|
1589
|
+
_.value,
|
|
1590
|
+
Q,
|
|
1591
|
+
{
|
|
1592
|
+
selectedItems: E,
|
|
1593
|
+
idData: L,
|
|
1594
|
+
isUpdate: q,
|
|
1595
|
+
FormModalOpen: U,
|
|
1596
|
+
detailItemModal: se,
|
|
1597
|
+
dataChildDelete: Z,
|
|
1598
|
+
showWarningModel: T,
|
|
1599
|
+
showWarningModelSelected: k
|
|
1600
|
+
}
|
|
1601
|
+
);
|
|
1602
|
+
De(E, (A) => {
|
|
1603
|
+
O.value = A.length === ee.value.length && ee.value.length > 0;
|
|
1604
|
+
}), De(K, () => {
|
|
1605
|
+
B.value = 1;
|
|
1606
|
+
}), De(
|
|
1607
|
+
() => v.base.dataTabelCustomDisplay || v.base.schema,
|
|
1608
|
+
async () => {
|
|
1609
|
+
Object.assign(o.value, {
|
|
1610
|
+
...v
|
|
1611
|
+
}), E.value = [], await J();
|
|
1612
|
+
}
|
|
1613
|
+
), Be(async () => {
|
|
1614
|
+
Object.assign(o.value, {
|
|
1615
|
+
...v
|
|
1616
|
+
}), await J();
|
|
1617
|
+
}), Ye("TableComponents", { ShowAlert: V, loader: w, labels: _ });
|
|
1618
|
+
function V(A, g, h) {
|
|
1619
|
+
const C = {
|
|
1620
|
+
type: A,
|
|
1621
|
+
title: g,
|
|
1622
|
+
messages: h
|
|
1623
|
+
};
|
|
1624
|
+
F.value?.addAlert(C);
|
|
1625
|
+
}
|
|
1626
|
+
return (A, g) => (d(), a("div", Js, [
|
|
1627
|
+
S(l(at), {
|
|
1628
|
+
ref_key: "loader",
|
|
1629
|
+
ref: w
|
|
1630
|
+
}, null, 512),
|
|
1631
|
+
l(T) ? (d(), ie(l(Fe), {
|
|
1632
|
+
key: 0,
|
|
1633
|
+
title: _.value.warning.delete,
|
|
1634
|
+
message: `${l(W).name ?? l(W)[o.value?.keys?.nameKey ?? o.value?.keys?.idKey ?? "id"]}`,
|
|
1635
|
+
onConfirm: g[0] || (g[0] = () => {
|
|
1636
|
+
l(L) !== null && l(x)(l(L));
|
|
1637
|
+
}),
|
|
1638
|
+
onClose: l(D)
|
|
1639
|
+
}, null, 8, ["title", "message", "onClose"])) : N("", !0),
|
|
1640
|
+
l(k) ? (d(), ie(l(Fe), {
|
|
1641
|
+
key: 1,
|
|
1642
|
+
title: _.value.warning.deleteMany,
|
|
1643
|
+
message: l(je),
|
|
1644
|
+
onConfirm: g[1] || (g[1] = () => l($)(l(E))),
|
|
1645
|
+
onClose: l(D)
|
|
1646
|
+
}, null, 8, ["title", "message", "onClose"])) : N("", !0),
|
|
1647
|
+
l(se) ? (d(), ie(l(Ts), {
|
|
1648
|
+
key: 2,
|
|
1649
|
+
title: _.value?.title?.display,
|
|
1650
|
+
"close-text": _.value?.btn?.close,
|
|
1651
|
+
schema: o.value?.base?.schema.display ?? o.value?.base?.schema.global ?? {},
|
|
1652
|
+
"form-data": l(me) ?? {},
|
|
1653
|
+
"value-null-view": !0,
|
|
1654
|
+
onClose: l(D)
|
|
1655
|
+
}, null, 8, ["title", "close-text", "schema", "form-data", "onClose"])) : N("", !0),
|
|
1656
|
+
S(l(Vs), {
|
|
1657
|
+
ref_key: "alert",
|
|
1658
|
+
ref: F
|
|
1659
|
+
}, null, 512),
|
|
1660
|
+
l(U) ? (d(), ie(lt, {
|
|
1661
|
+
key: 3,
|
|
1662
|
+
id: l(q) ?? null,
|
|
1663
|
+
"is-update": !!l(q),
|
|
1664
|
+
schema: l(q) ? o.value.base.schema.update ?? o.value.base.schema.global : o.value.base.schema.create ?? o.value.base.schema.global,
|
|
1665
|
+
"initial-data": l(q) ? l(me) : void 0,
|
|
1666
|
+
lang: o.value.base.lang ?? "en",
|
|
1667
|
+
onCancel: g[2] || (g[2] = (h) => U.value = !1),
|
|
1668
|
+
onDataChildRemove: g[3] || (g[3] = (h) => Z.value = h),
|
|
1669
|
+
onSubmit: l(f)
|
|
1670
|
+
}, null, 8, ["id", "is-update", "schema", "initial-data", "lang", "onSubmit"])) : N("", !0),
|
|
1671
|
+
s("div", Qs, [
|
|
1672
|
+
s("div", Xs, [
|
|
1673
|
+
s("div", Ys, [
|
|
1674
|
+
s("div", ed, [
|
|
1675
|
+
s("div", td, [
|
|
1676
|
+
o.value?.feature?.createActive ? (d(), a("button", {
|
|
1677
|
+
key: 0,
|
|
1678
|
+
onClick: g[4] || (g[4] = (h) => l(b)()),
|
|
1679
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-6 jsgd-py-3 jsgd-border-none jsgd-rounded-lg jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-relative jsgd-overflow-hidden disabled:jsgd-opacity-50 disabled:jsgd-cursor-not-allowed disabled:jsgd-transform-none before:jsgd-content-[''] before:jsgd-absolute before:jsgd-top-0 before:jsgd-left-[-100%] before:jsgd-w-full before:jsgd-h-full before:jsgd-bg-gradient-to-r before:jsgd-from-transparent before:jsgd-via-white/20 before:jsgd-to-transparent before:jsgd-transition-[left] before:jsgd-duration-600 hover:before:jsgd-left-full jsgd-bg-gradient-to-br jsgd-from-blue-500 jsgd-to-blue-600 jsgd-text-white jsgd-shadow-md hover:jsgd-shadow-lg hover:-jsgd-translate-y-0.5 dark:jsgd-from-blue-600 dark:jsgd-to-blue-700"
|
|
1680
|
+
}, [
|
|
1681
|
+
g[14] || (g[14] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
1682
|
+
s("svg", {
|
|
1683
|
+
width: "16",
|
|
1684
|
+
height: "16",
|
|
1685
|
+
viewBox: "0 0 24 24",
|
|
1686
|
+
fill: "none"
|
|
1687
|
+
}, [
|
|
1688
|
+
s("path", {
|
|
1689
|
+
d: "M12 5V19M5 12H19",
|
|
1690
|
+
stroke: "currentColor",
|
|
1691
|
+
"stroke-width": "2",
|
|
1692
|
+
"stroke-linecap": "round",
|
|
1693
|
+
"stroke-linejoin": "round"
|
|
1694
|
+
})
|
|
1695
|
+
])
|
|
1696
|
+
], -1)),
|
|
1697
|
+
re(" " + y(_.value?.btn?.add), 1)
|
|
1698
|
+
])) : N("", !0),
|
|
1699
|
+
l(E).length > 0 && o.value?.feature?.deleteManyActive ? (d(), a("button", {
|
|
1700
|
+
key: 1,
|
|
1701
|
+
onClick: g[5] || (g[5] = (h) => l(p)()),
|
|
1702
|
+
class: Y(["jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-6 jsgd-py-3 jsgd-border-none jsgd-rounded-lg jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-relative jsgd-overflow-hidden disabled:jsgd-opacity-50 disabled:jsgd-cursor-not-allowed disabled:jsgd-transform-none before:jsgd-content-[''] before:jsgd-absolute before:jsgd-top-0 before:jsgd-left-[-100%] before:jsgd-w-full before:jsgd-h-full before:jsgd-bg-gradient-to-r before:jsgd-from-transparent before:jsgd-via-white/20 before:jsgd-to-transparent before:jsgd-transition-[left] before:jsgd-duration-600 hover:before:jsgd-left-full jsgd-bg-gradient-to-br jsgd-from-red-500 jsgd-to-red-600 jsgd-text-white jsgd-shadow-md hover:jsgd-shadow-lg hover:-jsgd-translate-y-0.5 dark:jsgd-from-red-600 dark:jsgd-to-red-700", {
|
|
1703
|
+
"jsgd-bg-slate-100 jsgd-text-slate-400 dark:jsgd-bg-slate-700 dark:jsgd-text-slate-500": l(E).length === 0
|
|
1704
|
+
}]),
|
|
1705
|
+
disabled: l(E).length === 0
|
|
1706
|
+
}, [
|
|
1707
|
+
g[15] || (g[15] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
1708
|
+
s("svg", {
|
|
1709
|
+
width: "16",
|
|
1710
|
+
height: "16",
|
|
1711
|
+
viewBox: "0 0 24 24",
|
|
1712
|
+
fill: "none"
|
|
1713
|
+
}, [
|
|
1714
|
+
s("path", {
|
|
1715
|
+
d: "M19 7L18.1327 19.1425C18.0579 20.1891 17.187 21 16.1378 21H7.86224C6.81296 21 5.94208 20.1891 5.86732 19.1425L5 7M10 11V17M14 11V17M15 7V4C15 3.44772 14.5523 3 14 3H10C9.44772 3 9 3.44772 9 4V7M4 7H20",
|
|
1716
|
+
stroke: "currentColor",
|
|
1717
|
+
"stroke-width": "2",
|
|
1718
|
+
"stroke-linecap": "round",
|
|
1719
|
+
"stroke-linejoin": "round"
|
|
1720
|
+
})
|
|
1721
|
+
])
|
|
1722
|
+
], -1)),
|
|
1723
|
+
re(" " + y(_.value?.btn?.deleteMany), 1)
|
|
1724
|
+
], 10, sd)) : N("", !0)
|
|
1725
|
+
])
|
|
1726
|
+
]),
|
|
1727
|
+
s("div", dd, [
|
|
1728
|
+
o.value?.feature?.searchQueryActive ? (d(), a("div", ad, [
|
|
1729
|
+
g[16] || (g[16] = s("div", { class: "jsgd-absolute jsgd-left-3 jsgd-top-1/2 -jsgd-translate-y-1/2 jsgd-text-slate-400 jsgd-flex jsgd-items-center jsgd-justify-center dark:jsgd-text-slate-500" }, [
|
|
1730
|
+
s("svg", {
|
|
1731
|
+
width: "16",
|
|
1732
|
+
height: "16",
|
|
1733
|
+
viewBox: "0 0 24 24",
|
|
1734
|
+
fill: "none"
|
|
1735
|
+
}, [
|
|
1736
|
+
s("path", {
|
|
1737
|
+
d: "M21 21L16.514 16.506M19 10.5C19 15.194 15.194 19 10.5 19C5.806 19 2 15.194 2 10.5C2 5.806 5.806 2 10.5 2C15.194 2 19 5.806 19 10.5Z",
|
|
1738
|
+
stroke: "currentColor",
|
|
1739
|
+
"stroke-width": "2",
|
|
1740
|
+
"stroke-linecap": "round",
|
|
1741
|
+
"stroke-linejoin": "round"
|
|
1742
|
+
})
|
|
1743
|
+
])
|
|
1744
|
+
], -1)),
|
|
1745
|
+
Oe(s("input", {
|
|
1746
|
+
"onUpdate:modelValue": g[6] || (g[6] = (h) => Ke(K) ? K.value = h : null),
|
|
1747
|
+
type: "text",
|
|
1748
|
+
placeholder: _.value?.search || "Search...",
|
|
1749
|
+
class: "jsgd-w-full jsgd-py-3 jsgd-pr-3 jsgd-pl-10 jsgd-bg-white jsgd-border jsgd-border-slate-200 jsgd-rounded-lg jsgd-box-border jsgd-text-slate-800 jsgd-text-sm jsgd-transition-all focus:jsgd-outline-none focus:jsgd-border-blue-500 focus:jsgd-ring-3 focus:jsgd-ring-blue-500/10 dark:jsgd-bg-slate-900 dark:jsgd-border-slate-700 dark:jsgd-text-slate-100 dark:focus:jsgd-border-blue-400",
|
|
1750
|
+
onKeyup: g[7] || (g[7] = Ee((h) => B.value = 1, ["enter"]))
|
|
1751
|
+
}, null, 40, ld), [
|
|
1752
|
+
[et, l(K)]
|
|
1753
|
+
])
|
|
1754
|
+
])) : N("", !0)
|
|
1755
|
+
])
|
|
1756
|
+
]),
|
|
1757
|
+
l(E).length > 0 ? (d(), a("div", nd, [
|
|
1758
|
+
s("span", od, y(l(E).length), 1),
|
|
1759
|
+
re(" " + y(l(E).length === 1 ? _.value.selection.selectedOne ?? "item is selected" : _.value.selection.selected ?? "items are selected"), 1)
|
|
1760
|
+
])) : N("", !0)
|
|
1761
|
+
]),
|
|
1762
|
+
l(P).length === 0 ? (d(), a("div", rd, [
|
|
1763
|
+
g[18] || (g[18] = s("div", { class: "jsgd-text-slate-400 jsgd-mb-6 jsgd-opacity-70 dark:jsgd-text-slate-500" }, [
|
|
1764
|
+
s("svg", {
|
|
1765
|
+
width: "64",
|
|
1766
|
+
height: "64",
|
|
1767
|
+
viewBox: "0 0 24 24",
|
|
1768
|
+
fill: "none"
|
|
1769
|
+
}, [
|
|
1770
|
+
s("path", {
|
|
1771
|
+
d: "M3 7V17C3 18.1046 3.89543 19 5 19H19C20.1046 19 21 18.1046 21 17V9C21 7.89543 20.1046 7 19 7H3ZM3 7V5C3 3.89543 3.89543 3 5 3H9",
|
|
1772
|
+
stroke: "currentColor",
|
|
1773
|
+
"stroke-width": "2",
|
|
1774
|
+
"stroke-linecap": "round"
|
|
1775
|
+
}),
|
|
1776
|
+
s("path", {
|
|
1777
|
+
d: "M15 13C15 14.6569 13.6569 16 12 16C10.3431 16 9 14.6569 9 13C9 11.3431 10.3431 10 12 10C13.6569 10 15 11.3431 15 13Z",
|
|
1778
|
+
stroke: "currentColor",
|
|
1779
|
+
"stroke-width": "2"
|
|
1780
|
+
})
|
|
1781
|
+
])
|
|
1782
|
+
], -1)),
|
|
1783
|
+
s("h3", id, y(_.value?.message?.notFound), 1),
|
|
1784
|
+
s("p", gd, y(_.value?.message?.notFoundDesc || "No data available"), 1),
|
|
1785
|
+
o.value?.feature?.createActive ? (d(), a("button", {
|
|
1786
|
+
key: 0,
|
|
1787
|
+
onClick: g[8] || (g[8] = (h) => l(b)()),
|
|
1788
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-6 jsgd-py-3 jsgd-border-none jsgd-rounded-lg jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-relative jsgd-overflow-hidden disabled:jsgd-opacity-50 disabled:jsgd-cursor-not-allowed disabled:jsgd-transform-none before:jsgd-content-[''] before:jsgd-absolute before:jsgd-top-0 before:jsgd-left-[-100%] before:jsgd-w-full before:jsgd-h-full before:jsgd-bg-gradient-to-r before:jsgd-from-transparent before:jsgd-via-white/20 before:jsgd-to-transparent before:jsgd-transition-[left] before:jsgd-duration-600 hover:before:jsgd-left-full jsgd-bg-gradient-to-br jsgd-from-blue-500 jsgd-to-blue-600 jsgd-text-white jsgd-shadow-md hover:jsgd-shadow-lg hover:-jsgd-translate-y-0.5 jsgd-animate-[pulse_2s_infinite] dark:jsgd-from-blue-600 dark:jsgd-to-blue-700"
|
|
1789
|
+
}, [
|
|
1790
|
+
g[17] || (g[17] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
1791
|
+
s("svg", {
|
|
1792
|
+
width: "16",
|
|
1793
|
+
height: "16",
|
|
1794
|
+
viewBox: "0 0 24 24",
|
|
1795
|
+
fill: "none"
|
|
1796
|
+
}, [
|
|
1797
|
+
s("path", {
|
|
1798
|
+
d: "M12 5V19M5 12H19",
|
|
1799
|
+
stroke: "currentColor",
|
|
1800
|
+
"stroke-width": "2",
|
|
1801
|
+
"stroke-linecap": "round",
|
|
1802
|
+
"stroke-linejoin": "round"
|
|
1803
|
+
})
|
|
1804
|
+
])
|
|
1805
|
+
], -1)),
|
|
1806
|
+
re(" " + y(_.value?.btn?.add), 1)
|
|
1807
|
+
])) : N("", !0)
|
|
1808
|
+
])) : (d(), a("div", ud, [
|
|
1809
|
+
s("div", cd, [
|
|
1810
|
+
s("table", jd, [
|
|
1811
|
+
s("thead", bd, [
|
|
1812
|
+
s("tr", null, [
|
|
1813
|
+
s("th", fd, [
|
|
1814
|
+
o.value?.feature?.deleteManyActive ? Oe((d(), a("input", {
|
|
1815
|
+
key: 0,
|
|
1816
|
+
type: "checkbox",
|
|
1817
|
+
onChange: g[9] || (g[9] = //@ts-ignore
|
|
1818
|
+
(...h) => l(be) && l(be)(...h)),
|
|
1819
|
+
"onUpdate:modelValue": g[10] || (g[10] = (h) => Ke(O) ? O.value = h : null),
|
|
1820
|
+
class: "jsgd-w-4 jsgd-h-4 jsgd-border jsgd-border-slate-200 jsgd-rounded-sm jsgd-bg-white jsgd-cursor-pointer jsgd-transition-all checked:jsgd-bg-blue-500 checked:jsgd-border-blue-500 focus:jsgd-outline-none focus:jsgd-ring-3 focus:jsgd-ring-blue-500/10 dark:jsgd-border-slate-700 dark:jsgd-bg-slate-900 dark:checked:jsgd-bg-blue-600 dark:checked:jsgd-border-blue-600"
|
|
1821
|
+
}, null, 544)), [
|
|
1822
|
+
[Le, l(O)]
|
|
1823
|
+
]) : N("", !0)
|
|
1824
|
+
]),
|
|
1825
|
+
(d(!0), a(G, null, R(o.value?.base.headersTabelDisplay, (h, C) => (d(), a("th", {
|
|
1826
|
+
key: h,
|
|
1827
|
+
class: Y(["jsgd-p-4 jsgd-text-left jsgd-text-xs jsgd-font-semibold jsgd-text-slate-500 jsgd-uppercase jsgd-tracking-wider jsgd-whitespace-nowrap dark:jsgd-text-slate-400", { "jsgd-hidden md:jsgd-table-cell": C > 0 }])
|
|
1828
|
+
}, [
|
|
1829
|
+
s("div", md, [
|
|
1830
|
+
re(y(h) + " ", 1),
|
|
1831
|
+
o.value?.feature?.sortable ? (d(), a("button", {
|
|
1832
|
+
key: 0,
|
|
1833
|
+
onClick: (oe) => l(de)(h),
|
|
1834
|
+
class: "jsgd-bg-transparent jsgd-border-none jsgd-text-slate-400 jsgd-cursor-pointer jsgd-p-1 jsgd-rounded-md jsgd-transition-all jsgd-flex jsgd-items-center jsgd-justify-center hover:jsgd-text-slate-800 hover:jsgd-bg-slate-100 dark:jsgd-text-slate-500 dark:hover:jsgd-text-slate-100 dark:hover:jsgd-bg-slate-700"
|
|
1835
|
+
}, [...g[19] || (g[19] = [
|
|
1836
|
+
s("svg", {
|
|
1837
|
+
width: "16",
|
|
1838
|
+
height: "16",
|
|
1839
|
+
viewBox: "0 0 24 24",
|
|
1840
|
+
fill: "none"
|
|
1841
|
+
}, [
|
|
1842
|
+
s("path", {
|
|
1843
|
+
d: "M8 9L12 5L16 9M16 15L12 19L8 15",
|
|
1844
|
+
stroke: "currentColor",
|
|
1845
|
+
"stroke-width": "2",
|
|
1846
|
+
"stroke-linecap": "round",
|
|
1847
|
+
"stroke-linejoin": "round"
|
|
1848
|
+
})
|
|
1849
|
+
], -1)
|
|
1850
|
+
])], 8, hd)) : N("", !0)
|
|
1851
|
+
])
|
|
1852
|
+
], 2))), 128)),
|
|
1853
|
+
s("th", vd, y(_.value?.action || "Actions"), 1)
|
|
1854
|
+
])
|
|
1855
|
+
]),
|
|
1856
|
+
s("tbody", yd, [
|
|
1857
|
+
(d(!0), a(G, null, R(l(ee), (h) => (d(), a("tr", {
|
|
1858
|
+
key: h?.[o.value?.keys?.idKey ?? "id"],
|
|
1859
|
+
class: "jsgd-border-b jsgd-border-slate-50 jsgd-transition-all hover:jsgd-bg-slate-50 dark:jsgd-border-slate-800 dark:hover:jsgd-bg-slate-800"
|
|
1860
|
+
}, [
|
|
1861
|
+
s("td", kd, [
|
|
1862
|
+
o.value?.feature?.deleteManyActive ? Oe((d(), a("input", {
|
|
1863
|
+
key: 0,
|
|
1864
|
+
type: "checkbox",
|
|
1865
|
+
"onUpdate:modelValue": g[11] || (g[11] = (C) => Ke(E) ? E.value = C : null),
|
|
1866
|
+
value: h?.[o.value?.keys?.idKey ?? "id"],
|
|
1867
|
+
class: "jsgd-w-4 jsgd-h-4 jsgd-border jsgd-border-slate-200 jsgd-rounded-sm jsgd-bg-white jsgd-cursor-pointer jsgd-transition-all checked:jsgd-bg-blue-500 checked:jsgd-border-blue-500 focus:jsgd-outline-none focus:jsgd-ring-3 focus:jsgd-ring-blue-500/10 dark:jsgd-border-slate-700 dark:jsgd-bg-slate-900 dark:checked:jsgd-bg-blue-600 dark:checked:jsgd-border-blue-600"
|
|
1868
|
+
}, null, 8, xd)), [
|
|
1869
|
+
[Le, l(E)]
|
|
1870
|
+
]) : N("", !0)
|
|
1871
|
+
]),
|
|
1872
|
+
(d(!0), a(G, null, R(l(zs)(h), (C, oe, ke) => (d(), a("td", {
|
|
1873
|
+
key: oe,
|
|
1874
|
+
class: Y(["jsgd-p-4 jsgd-text-sm jsgd-text-slate-500 jsgd-max-w-[200px] dark:jsgd-text-slate-400", {
|
|
1875
|
+
"jsgd-hidden md:jsgd-table-cell": ke > 0,
|
|
1876
|
+
"jsgd-font-semibold jsgd-text-slate-800 dark:jsgd-text-slate-100": ke === 0
|
|
1877
|
+
}])
|
|
1878
|
+
}, [
|
|
1879
|
+
l(Es)(C) ? (d(), a("div", {
|
|
1880
|
+
key: 0,
|
|
1881
|
+
innerHTML: C,
|
|
1882
|
+
class: "jsgd-max-w-full jsgd-max-h-16 jsgd-overflow-hidden"
|
|
1883
|
+
}, null, 8, pd)) : oe === "status" || oe === "active" ? (d(), a("div", wd, [
|
|
1884
|
+
s("span", {
|
|
1885
|
+
class: Y(["jsgd-px-3 jsgd-py-1 jsgd-rounded-full jsgd-text-xs jsgd-font-medium jsgd-inline-block", {
|
|
1886
|
+
"jsgd-bg-green-500/10 jsgd-text-emerald-500 dark:jsgd-text-emerald-400": C,
|
|
1887
|
+
"jsgd-bg-red-500/10 jsgd-text-red-500 dark:jsgd-text-red-400": !C
|
|
1888
|
+
}])
|
|
1889
|
+
}, y(C ? _.value?.btn.toogle?.active || "Active" : _.value?.btn.toogle?.inactive || "Inactive"), 3)
|
|
1890
|
+
])) : r(C) ? (d(), a("div", _d, [
|
|
1891
|
+
g[20] || (g[20] = s("svg", {
|
|
1892
|
+
width: "14",
|
|
1893
|
+
height: "14",
|
|
1894
|
+
viewBox: "0 0 24 24",
|
|
1895
|
+
fill: "none",
|
|
1896
|
+
class: "jsgd-shrink-0 jsgd-text-slate-500 dark:jsgd-text-slate-400"
|
|
1897
|
+
}, [
|
|
1898
|
+
s("path", {
|
|
1899
|
+
d: "M8 7V3M16 7V3M4 11H20M5 21H19C20.1046 21 21 20.1046 21 19V7C21 5.89543 20.1046 5 19 5H5C3.89543 5 3 5.89543 3 7V19C3 20.1046 3.89543 21 5 21Z",
|
|
1900
|
+
stroke: "currentColor",
|
|
1901
|
+
"stroke-width": "2",
|
|
1902
|
+
"stroke-linecap": "round",
|
|
1903
|
+
"stroke-linejoin": "round"
|
|
1904
|
+
}),
|
|
1905
|
+
s("path", {
|
|
1906
|
+
d: "M12 15H12.01M12 18H12.01M16 15H16.01M16 18H16.01M8 15H8.01M8 18H8.01",
|
|
1907
|
+
stroke: "currentColor",
|
|
1908
|
+
"stroke-width": "2",
|
|
1909
|
+
"stroke-linecap": "round",
|
|
1910
|
+
"stroke-linejoin": "round"
|
|
1911
|
+
})
|
|
1912
|
+
], -1)),
|
|
1913
|
+
s("span", null, y(t(C, o.value.base.lang ?? "en")), 1)
|
|
1914
|
+
])) : n(C) ? (d(), a("div", Cd, [
|
|
1915
|
+
g[21] || (g[21] = s("svg", {
|
|
1916
|
+
width: "14",
|
|
1917
|
+
height: "14",
|
|
1918
|
+
viewBox: "0 0 24 24",
|
|
1919
|
+
fill: "none",
|
|
1920
|
+
class: "jsgd-shrink-0 jsgd-text-slate-500 dark:jsgd-text-slate-400"
|
|
1921
|
+
}, [
|
|
1922
|
+
s("path", {
|
|
1923
|
+
d: "M8 7V3M16 7V3M4 11H20M5 21H19C20.1046 21 21 20.1046 21 19V7C21 5.89543 20.1046 5 19 5H5C3.89543 5 3 5.89543 3 7V19C3 20.1046 3.89543 21 5 21Z",
|
|
1924
|
+
stroke: "currentColor",
|
|
1925
|
+
"stroke-width": "2",
|
|
1926
|
+
"stroke-linecap": "round",
|
|
1927
|
+
"stroke-linejoin": "round"
|
|
1928
|
+
})
|
|
1929
|
+
], -1)),
|
|
1930
|
+
s("span", null, y(m(C, o.value.base.lang ?? "en")), 1)
|
|
1931
|
+
])) : i(C) ? (d(), a("div", Dd, [
|
|
1932
|
+
g[22] || (g[22] = s("svg", {
|
|
1933
|
+
width: "14",
|
|
1934
|
+
height: "14",
|
|
1935
|
+
viewBox: "0 0 24 24",
|
|
1936
|
+
fill: "none",
|
|
1937
|
+
class: "jsgd-shrink-0 jsgd-text-slate-500 dark:jsgd-text-slate-400"
|
|
1938
|
+
}, [
|
|
1939
|
+
s("path", {
|
|
1940
|
+
d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",
|
|
1941
|
+
stroke: "currentColor",
|
|
1942
|
+
"stroke-width": "2",
|
|
1943
|
+
"stroke-linecap": "round",
|
|
1944
|
+
"stroke-linejoin": "round"
|
|
1945
|
+
}),
|
|
1946
|
+
s("path", {
|
|
1947
|
+
d: "M12 6V12L16 14",
|
|
1948
|
+
stroke: "currentColor",
|
|
1949
|
+
"stroke-width": "2",
|
|
1950
|
+
"stroke-linecap": "round",
|
|
1951
|
+
"stroke-linejoin": "round"
|
|
1952
|
+
})
|
|
1953
|
+
], -1)),
|
|
1954
|
+
s("span", null, y(c(C, o.value.base.lang ?? "en")), 1)
|
|
1955
|
+
])) : l(Ge)(C) ? (d(), a("div", Md, [
|
|
1956
|
+
s("div", $d, [
|
|
1957
|
+
s("img", {
|
|
1958
|
+
src: l(Pe)(C),
|
|
1959
|
+
class: "jsgd-w-full jsgd-h-full jsgd-object-cover",
|
|
1960
|
+
alt: `Preview ${oe}`
|
|
1961
|
+
}, null, 8, Ad)
|
|
1962
|
+
])
|
|
1963
|
+
])) : l(Ps)(C) ? (d(), a("div", Td, [
|
|
1964
|
+
(d(!0), a(G, null, R(C.slice(0, 3), (xe, pe) => (d(), a("div", {
|
|
1965
|
+
key: pe,
|
|
1966
|
+
style: Te({ backgroundColor: xe }),
|
|
1967
|
+
class: "jsgd-w-6 jsgd-h-6 jsgd-rounded-full jsgd-border-2 jsgd-border-slate-200 jsgd-inline-block jsgd-mr-1 jsgd-cursor-pointer jsgd-transition-all hover:jsgd-scale-110 dark:jsgd-border-slate-700",
|
|
1968
|
+
title: xe
|
|
1969
|
+
}, null, 12, Od))), 128)),
|
|
1970
|
+
C.length > 3 ? (d(), a("span", Kd, "+" + y(C.length - 3), 1)) : N("", !0)
|
|
1971
|
+
])) : l(qe)(C) ? (d(), a("div", Hd, [
|
|
1972
|
+
s("div", {
|
|
1973
|
+
style: Te({ backgroundColor: C }),
|
|
1974
|
+
class: "jsgd-w-6 jsgd-h-6 jsgd-rounded-full jsgd-border-2 jsgd-border-slate-200 jsgd-inline-block jsgd-mr-1 jsgd-cursor-pointer jsgd-transition-all hover:jsgd-scale-110 jsgd-w-8 jsgd-h-8 dark:jsgd-border-slate-700",
|
|
1975
|
+
title: C
|
|
1976
|
+
}, null, 12, Vd)
|
|
1977
|
+
])) : l(Fs)(C) ? (d(), a("div", Bd, [
|
|
1978
|
+
(d(!0), a(G, null, R(C.slice(0, 3), (xe, pe) => (d(), a("div", {
|
|
1979
|
+
key: pe,
|
|
1980
|
+
class: "jsgd-w-12 jsgd-h-12 jsgd-rounded-lg jsgd-overflow-hidden jsgd-border jsgd-border-slate-200 jsgd-w-8 jsgd-h-8 jsgd-rounded-md dark:jsgd-border-slate-700"
|
|
1981
|
+
}, [
|
|
1982
|
+
s("img", {
|
|
1983
|
+
src: l(Pe)(xe),
|
|
1984
|
+
class: "jsgd-w-full jsgd-h-full jsgd-object-cover",
|
|
1985
|
+
alt: `Preview ${oe}-${pe}`
|
|
1986
|
+
}, null, 8, Sd)
|
|
1987
|
+
]))), 128)),
|
|
1988
|
+
C.length > 3 ? (d(), a("span", Id, "+" + y(C.length - 3), 1)) : N("", !0)
|
|
1989
|
+
])) : Array.isArray(C) ? (d(), a("div", Nd, y(C.join(", ")), 1)) : (d(), a("div", Ld, y(C), 1))
|
|
1990
|
+
], 2))), 128)),
|
|
1991
|
+
s("td", Fd, [
|
|
1992
|
+
s("div", Pd, [
|
|
1993
|
+
o.value?.feature?.updateActive ? (d(), a("button", {
|
|
1994
|
+
key: 0,
|
|
1995
|
+
onClick: (C) => l(ne)(h?.[o.value?.keys?.idKey ?? "id"]),
|
|
1996
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-1.5 jsgd-px-3 jsgd-py-2 jsgd-border-none jsgd-rounded-lg jsgd-text-xs jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-whitespace-nowrap jsgd-bg-blue-500/10 jsgd-text-blue-500 hover:jsgd-bg-blue-500 hover:jsgd-text-white hover:-jsgd-translate-y-px dark:jsgd-text-blue-400 dark:hover:jsgd-bg-blue-600"
|
|
1997
|
+
}, [
|
|
1998
|
+
g[23] || (g[23] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
1999
|
+
s("svg", {
|
|
2000
|
+
width: "16",
|
|
2001
|
+
height: "16",
|
|
2002
|
+
viewBox: "0 0 24 24",
|
|
2003
|
+
fill: "none"
|
|
2004
|
+
}, [
|
|
2005
|
+
s("path", {
|
|
2006
|
+
d: "M11 5H6C4.89543 5 4 5.89543 4 7V18C4 19.1046 4.89543 20 6 20H17C18.1046 20 19 19.1046 19 18V13M17.5858 3.58579C18.3668 2.80474 19.6332 2.80474 20.4142 3.58579C21.1953 4.36683 21.1953 5.63316 20.4142 6.41421L11.8284 15H9L9 12.1716L17.5858 3.58579Z",
|
|
2007
|
+
stroke: "currentColor",
|
|
2008
|
+
"stroke-width": "2",
|
|
2009
|
+
"stroke-linecap": "round",
|
|
2010
|
+
"stroke-linejoin": "round"
|
|
2011
|
+
})
|
|
2012
|
+
])
|
|
2013
|
+
], -1)),
|
|
2014
|
+
s("span", zd, y(_.value?.btn?.update), 1)
|
|
2015
|
+
], 8, Ed)) : N("", !0),
|
|
2016
|
+
o.value?.feature?.deleteActive ? (d(), a("button", {
|
|
2017
|
+
key: 1,
|
|
2018
|
+
onClick: (C) => l(H)(h?.[o.value?.keys?.idKey ?? "id"]),
|
|
2019
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-1.5 jsgd-px-3 jsgd-py-2 jsgd-border-none jsgd-rounded-lg jsgd-text-xs jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-whitespace-nowrap jsgd-bg-red-500/10 jsgd-text-red-500 hover:jsgd-bg-red-500 hover:jsgd-text-white hover:-jsgd-translate-y-px dark:jsgd-text-red-400 dark:hover:jsgd-bg-red-600"
|
|
2020
|
+
}, [
|
|
2021
|
+
g[24] || (g[24] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
2022
|
+
s("svg", {
|
|
2023
|
+
width: "16",
|
|
2024
|
+
height: "16",
|
|
2025
|
+
viewBox: "0 0 24 24",
|
|
2026
|
+
fill: "none"
|
|
2027
|
+
}, [
|
|
2028
|
+
s("path", {
|
|
2029
|
+
d: "M19 7L18.1327 19.1425C18.0579 20.1891 17.187 21 16.1378 21H7.86224C6.81296 21 5.94208 20.1891 5.86732 19.1425L5 7M10 11V17M14 11V17M15 7V4C15 3.44772 14.5523 3 14 3H10C9.44772 3 9 3.44772 9 4V7M4 7H20",
|
|
2030
|
+
stroke: "currentColor",
|
|
2031
|
+
"stroke-width": "2",
|
|
2032
|
+
"stroke-linecap": "round",
|
|
2033
|
+
"stroke-linejoin": "round"
|
|
2034
|
+
})
|
|
2035
|
+
])
|
|
2036
|
+
], -1)),
|
|
2037
|
+
s("span", Wd, y(_.value?.btn?.remove), 1)
|
|
2038
|
+
], 8, Ud)) : N("", !0),
|
|
2039
|
+
o.value?.feature?.displayActive ? (d(), a("button", {
|
|
2040
|
+
key: 2,
|
|
2041
|
+
onClick: (C) => l(M)(h?.[o.value?.keys?.idKey ?? "id"]),
|
|
2042
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-1.5 jsgd-px-3 jsgd-py-2 jsgd-border-none jsgd-rounded-lg jsgd-text-xs jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all jsgd-whitespace-nowrap jsgd-bg-slate-500/10 jsgd-text-slate-500 hover:jsgd-bg-slate-500 hover:jsgd-text-white hover:-jsgd-translate-y-px dark:jsgd-text-slate-400 dark:hover:jsgd-bg-slate-400"
|
|
2043
|
+
}, [
|
|
2044
|
+
g[25] || (g[25] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
2045
|
+
s("svg", {
|
|
2046
|
+
width: "16",
|
|
2047
|
+
height: "16",
|
|
2048
|
+
viewBox: "0 0 24 24",
|
|
2049
|
+
fill: "none"
|
|
2050
|
+
}, [
|
|
2051
|
+
s("path", {
|
|
2052
|
+
d: "M1 12C1 12 5 4 12 4C19 4 23 12 23 12C23 12 19 20 12 20C5 20 1 12 1 12Z",
|
|
2053
|
+
stroke: "currentColor",
|
|
2054
|
+
"stroke-width": "2"
|
|
2055
|
+
}),
|
|
2056
|
+
s("path", {
|
|
2057
|
+
d: "M12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15Z",
|
|
2058
|
+
stroke: "currentColor",
|
|
2059
|
+
"stroke-width": "2"
|
|
2060
|
+
})
|
|
2061
|
+
])
|
|
2062
|
+
], -1)),
|
|
2063
|
+
s("span", qd, y(_.value?.btn?.display), 1)
|
|
2064
|
+
], 8, Gd)) : N("", !0)
|
|
2065
|
+
])
|
|
2066
|
+
])
|
|
2067
|
+
]))), 128))
|
|
2068
|
+
])
|
|
2069
|
+
])
|
|
2070
|
+
]),
|
|
2071
|
+
s("div", Rd, [
|
|
2072
|
+
s("div", Zd, y(o.value?.pagination?.indicator?.displayingText || "Showing") + " " + y((l(B) - 1) * (o.value?.pagination?.itemsPerPage ?? 5) + 1) + " - " + y(Math.min(
|
|
2073
|
+
l(B) * (o.value?.pagination?.itemsPerPage ?? 5),
|
|
2074
|
+
l(P).length
|
|
2075
|
+
)) + " of " + y(l(P).length) + " " + y(o.value?.pagination?.indicator?.dataText || "") + " data ", 1),
|
|
2076
|
+
s("div", Jd, [
|
|
2077
|
+
s("button", {
|
|
2078
|
+
onClick: g[12] || (g[12] = //@ts-ignore
|
|
2079
|
+
(...h) => l(le) && l(le)(...h)),
|
|
2080
|
+
disabled: l(B) === 1,
|
|
2081
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-4 jsgd-py-3 jsgd-bg-white jsgd-border jsgd-border-slate-200 jsgd-rounded-lg jsgd-text-slate-800 jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all hover:jsgd-bg-slate-100 hover:-jsgd-translate-y-px disabled:jsgd-opacity-50 disabled:jsgd-cursor-not-allowed disabled:jsgd-transform-none dark:jsgd-bg-slate-900 dark:jsgd-border-slate-700 dark:jsgd-text-slate-100 dark:hover:jsgd-bg-slate-800"
|
|
2082
|
+
}, [
|
|
2083
|
+
g[26] || (g[26] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
2084
|
+
s("svg", {
|
|
2085
|
+
width: "16",
|
|
2086
|
+
height: "16",
|
|
2087
|
+
viewBox: "0 0 24 24",
|
|
2088
|
+
fill: "none"
|
|
2089
|
+
}, [
|
|
2090
|
+
s("path", {
|
|
2091
|
+
d: "M15 18L9 12L15 6",
|
|
2092
|
+
stroke: "currentColor",
|
|
2093
|
+
"stroke-width": "2",
|
|
2094
|
+
"stroke-linecap": "round",
|
|
2095
|
+
"stroke-linejoin": "round"
|
|
2096
|
+
})
|
|
2097
|
+
])
|
|
2098
|
+
], -1)),
|
|
2099
|
+
re(" " + y(_.value?.btn?.prev || "Previous"), 1)
|
|
2100
|
+
], 8, Qd),
|
|
2101
|
+
s("div", Xd, [
|
|
2102
|
+
(d(!0), a(G, null, R(l(ue), (h) => (d(), a("button", {
|
|
2103
|
+
key: h + "",
|
|
2104
|
+
onClick: (C) => typeof h == "number" && (B.value = h),
|
|
2105
|
+
disabled: h === "...",
|
|
2106
|
+
class: Y([{
|
|
2107
|
+
"jsgd-bg-blue-500 jsgd-text-white jsgd-border-blue-500 dark:jsgd-bg-blue-600 dark:jsgd-border-blue-600": l(B) === h,
|
|
2108
|
+
"jsgd-bg-transparent jsgd-border-none jsgd-cursor-default": h === "..."
|
|
2109
|
+
}, "jsgd-min-w-10 jsgd-h-10 jsgd-flex jsgd-items-center jsgd-justify-center jsgd-bg-white jsgd-border jsgd-border-slate-200 jsgd-rounded-lg jsgd-text-slate-800 jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all hover:jsgd-bg-slate-100 dark:jsgd-bg-slate-900 dark:jsgd-border-slate-700 dark:jsgd-text-slate-100 dark:hover:jsgd-bg-slate-800"])
|
|
2110
|
+
}, y(h), 11, Yd))), 128))
|
|
2111
|
+
]),
|
|
2112
|
+
s("button", {
|
|
2113
|
+
onClick: g[13] || (g[13] = //@ts-ignore
|
|
2114
|
+
(...h) => l(te) && l(te)(...h)),
|
|
2115
|
+
disabled: l(B) === l(ae) || l(ae) === 0,
|
|
2116
|
+
class: "jsgd-flex jsgd-items-center jsgd-gap-2 jsgd-px-4 jsgd-py-3 jsgd-bg-white jsgd-border jsgd-border-slate-200 jsgd-rounded-lg jsgd-text-slate-800 jsgd-text-sm jsgd-font-medium jsgd-cursor-pointer jsgd-transition-all hover:jsgd-bg-slate-100 hover:-jsgd-translate-y-px disabled:jsgd-opacity-50 disabled:jsgd-cursor-not-allowed disabled:jsgd-transform-none dark:jsgd-bg-slate-900 dark:jsgd-border-slate-700 dark:jsgd-text-slate-100 dark:hover:jsgd-bg-slate-800"
|
|
2117
|
+
}, [
|
|
2118
|
+
re(y(_.value?.btn?.next || "Next") + " ", 1),
|
|
2119
|
+
g[27] || (g[27] = s("span", { class: "jsgd-flex jsgd-items-center jsgd-justify-center" }, [
|
|
2120
|
+
s("svg", {
|
|
2121
|
+
width: "16",
|
|
2122
|
+
height: "16",
|
|
2123
|
+
viewBox: "0 0 24 24",
|
|
2124
|
+
fill: "none"
|
|
2125
|
+
}, [
|
|
2126
|
+
s("path", {
|
|
2127
|
+
d: "M9 18L15 12L9 6",
|
|
2128
|
+
stroke: "currentColor",
|
|
2129
|
+
"stroke-width": "2",
|
|
2130
|
+
"stroke-linecap": "round",
|
|
2131
|
+
"stroke-linejoin": "round"
|
|
2132
|
+
})
|
|
2133
|
+
])
|
|
2134
|
+
], -1))
|
|
2135
|
+
], 8, ea)
|
|
2136
|
+
])
|
|
2137
|
+
])
|
|
2138
|
+
]))
|
|
2139
|
+
])
|
|
2140
|
+
]));
|
|
2141
|
+
}
|
|
2142
|
+
});
|
|
2143
|
+
export {
|
|
2144
|
+
Ts as M,
|
|
2145
|
+
Fe as W,
|
|
2146
|
+
ga as _,
|
|
2147
|
+
aa as a,
|
|
2148
|
+
z as b,
|
|
2149
|
+
$e as c,
|
|
2150
|
+
la as d,
|
|
2151
|
+
na as e,
|
|
2152
|
+
Vs as f,
|
|
2153
|
+
Gs as g,
|
|
2154
|
+
qs as h,
|
|
2155
|
+
oa as i,
|
|
2156
|
+
Rs as j,
|
|
2157
|
+
Zs as k,
|
|
2158
|
+
ra as l,
|
|
2159
|
+
ia as m,
|
|
2160
|
+
Se as n,
|
|
2161
|
+
rt as o,
|
|
2162
|
+
it as p,
|
|
2163
|
+
gt as q
|
|
2164
|
+
};
|