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