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