react-admin-crud-manager 1.0.23 → 1.0.25
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/index.cjs.js +34 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1138 -1092
- package/dist/index.es.js.map +1 -1
- package/dist/tailwind.css +21 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { createPortal as
|
|
1
|
+
import { jsx as e, Fragment as $, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import Oe, { useState as R, useRef as ae, useEffect as z, useMemo as Le } from "react";
|
|
3
|
+
import { Info as Ve, ChevronDown as Be, Search as Ae, Check as We, X as Se, Plus as qe, Filter as Ze, ChevronLeft as Je, ChevronRight as Qe, EllipsisVertical as Xe, User as Ue, Music as ea } from "lucide-react";
|
|
4
|
+
import { createPortal as aa } from "react-dom";
|
|
5
5
|
import { Icon as re } from "@iconify/react";
|
|
6
|
-
import { Editor as
|
|
7
|
-
import { SnackbarProvider as
|
|
6
|
+
import { Editor as ta } from "@tinymce/tinymce-react";
|
|
7
|
+
import { SnackbarProvider as ra, enqueueSnackbar as Me } from "notistack";
|
|
8
8
|
import r from "prop-types";
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
11
|
-
const
|
|
12
|
-
if (isNaN(
|
|
13
|
-
const i = (
|
|
14
|
-
YYYY:
|
|
15
|
-
YY: String(
|
|
16
|
-
MMMM:
|
|
17
|
-
MMM:
|
|
18
|
-
MM: i(
|
|
19
|
-
M:
|
|
20
|
-
DD: i(
|
|
21
|
-
D:
|
|
22
|
-
dddd:
|
|
23
|
-
ddd:
|
|
24
|
-
HH: i(
|
|
25
|
-
hh: i(
|
|
26
|
-
mm: i(
|
|
27
|
-
ss: i(
|
|
28
|
-
A:
|
|
9
|
+
const je = (h, o = "DD MMM YYYY") => {
|
|
10
|
+
if (!h) return "N/A";
|
|
11
|
+
const l = new Date(h);
|
|
12
|
+
if (isNaN(l)) return "Invalid Date";
|
|
13
|
+
const i = (n) => String(n).padStart(2, "0"), s = {
|
|
14
|
+
YYYY: l.getFullYear(),
|
|
15
|
+
YY: String(l.getFullYear()).slice(-2),
|
|
16
|
+
MMMM: l.toLocaleString("en-US", { month: "long" }),
|
|
17
|
+
MMM: l.toLocaleString("en-US", { month: "short" }),
|
|
18
|
+
MM: i(l.getMonth() + 1),
|
|
19
|
+
M: l.getMonth() + 1,
|
|
20
|
+
DD: i(l.getDate()),
|
|
21
|
+
D: l.getDate(),
|
|
22
|
+
dddd: l.toLocaleString("en-US", { weekday: "long" }),
|
|
23
|
+
ddd: l.toLocaleString("en-US", { weekday: "short" }),
|
|
24
|
+
HH: i(l.getHours()),
|
|
25
|
+
hh: i(l.getHours() % 12 || 12),
|
|
26
|
+
mm: i(l.getMinutes()),
|
|
27
|
+
ss: i(l.getSeconds()),
|
|
28
|
+
A: l.getHours() >= 12 ? "PM" : "AM"
|
|
29
29
|
};
|
|
30
30
|
return o.replace(
|
|
31
31
|
/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
|
|
32
|
-
(
|
|
32
|
+
(n) => s[n]
|
|
33
33
|
);
|
|
34
|
-
},
|
|
35
|
-
if (!(o != null && o.trim())) return
|
|
36
|
-
const i = o.toLowerCase(),
|
|
37
|
-
return
|
|
38
|
-
let
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
}) :
|
|
42
|
-
(
|
|
34
|
+
}, na = (h, o, l = []) => {
|
|
35
|
+
if (!(o != null && o.trim())) return h;
|
|
36
|
+
const i = o.toLowerCase(), s = (n) => n == null ? [] : typeof n == "object" ? Object.values(n).flatMap(s) : [String(n)];
|
|
37
|
+
return h.filter((n) => {
|
|
38
|
+
let p = [];
|
|
39
|
+
return l.length > 0 ? l.forEach((S) => {
|
|
40
|
+
n[S] !== void 0 && p.push(...s(n[S]));
|
|
41
|
+
}) : p = s(n), p.some(
|
|
42
|
+
(S) => S.toLowerCase().includes(i)
|
|
43
43
|
);
|
|
44
44
|
});
|
|
45
|
-
},
|
|
45
|
+
}, Q = Oe.forwardRef(
|
|
46
46
|
({
|
|
47
|
-
className:
|
|
47
|
+
className: h = "",
|
|
48
48
|
variant: o = "contained",
|
|
49
|
-
color:
|
|
49
|
+
color: l = "default",
|
|
50
50
|
size: i = "default",
|
|
51
|
-
fullWidth:
|
|
52
|
-
children:
|
|
53
|
-
...
|
|
54
|
-
},
|
|
55
|
-
var
|
|
56
|
-
const
|
|
51
|
+
fullWidth: s = !1,
|
|
52
|
+
children: n,
|
|
53
|
+
...p
|
|
54
|
+
}, S) => {
|
|
55
|
+
var u;
|
|
56
|
+
const D = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", d = {
|
|
57
57
|
sm: "h-8 px-3 rounded-md text-sm",
|
|
58
58
|
md: "h-9 px-4 rounded-md text-sm",
|
|
59
59
|
lg: "h-11 px-6 rounded-md text-base",
|
|
60
60
|
xl: "h-12 px-8 rounded-lg text-lg",
|
|
61
61
|
default: "h-9 px-4 rounded-md text-sm"
|
|
62
|
-
},
|
|
62
|
+
}, f = {
|
|
63
63
|
primary: {
|
|
64
64
|
contained: "bg-primary text-white hover:bg-primary-600 focus:ring-primary-500 shadow-sm",
|
|
65
65
|
outlined: "border border-primary bg-transparent text-primary hover:bg-primary-50 focus:ring-primary-500",
|
|
@@ -80,151 +80,165 @@ const Ue = (b, o = "DD MMM YYYY") => {
|
|
|
80
80
|
outlined: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500",
|
|
81
81
|
text: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500"
|
|
82
82
|
}
|
|
83
|
-
},
|
|
84
|
-
${
|
|
85
|
-
${
|
|
83
|
+
}, a = ((u = f[l]) == null ? void 0 : u[o]) || f.default.contained, m = d[i], v = `
|
|
84
|
+
${D}
|
|
85
|
+
${a}
|
|
86
86
|
${m}
|
|
87
|
-
${
|
|
88
|
-
${
|
|
87
|
+
${s ? "w-full" : ""}
|
|
88
|
+
${h}
|
|
89
89
|
`.trim();
|
|
90
90
|
return /* @__PURE__ */ e(
|
|
91
91
|
"button",
|
|
92
92
|
{
|
|
93
|
-
ref:
|
|
94
|
-
type:
|
|
93
|
+
ref: S,
|
|
94
|
+
type: p.type || "button",
|
|
95
95
|
className: v,
|
|
96
|
-
...
|
|
97
|
-
children:
|
|
96
|
+
...p,
|
|
97
|
+
children: n
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
|
-
|
|
103
|
-
function q({ label:
|
|
104
|
-
return /* @__PURE__ */ e(
|
|
105
|
-
|
|
106
|
-
o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
|
|
102
|
+
Q.displayName = "Button";
|
|
103
|
+
function q({ label: h, required: o = !1, infoText: l = "" }) {
|
|
104
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("label", { className: "flex text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
105
|
+
h,
|
|
106
|
+
o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" }),
|
|
107
|
+
l && /* @__PURE__ */ c("span", { className: "ml-2 relative group inline-flex items-center cursor-pointer", children: [
|
|
108
|
+
/* @__PURE__ */ e(Ve, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }),
|
|
109
|
+
/* @__PURE__ */ e(
|
|
110
|
+
"span",
|
|
111
|
+
{
|
|
112
|
+
className: `absolute left-1/2 top-full mt-2\r
|
|
113
|
+
w-max max-w-xs bg-white text-black dark:bg-black dark:text-white text-xs\r
|
|
114
|
+
rounded px-2 py-1 opacity-0 shadow-lg\r
|
|
115
|
+
group-hover:opacity-100 transition-opacity\r
|
|
116
|
+
duration-200 pointer-events-none z-50`,
|
|
117
|
+
children: l
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] })
|
|
107
121
|
] }) });
|
|
108
122
|
}
|
|
109
|
-
const
|
|
110
|
-
options:
|
|
123
|
+
const la = ({
|
|
124
|
+
options: h = [],
|
|
111
125
|
value: o = "",
|
|
112
|
-
defaultValue:
|
|
126
|
+
defaultValue: l = "",
|
|
113
127
|
onChange: i,
|
|
114
|
-
placeholder:
|
|
115
|
-
className:
|
|
116
|
-
disabled:
|
|
117
|
-
search:
|
|
118
|
-
label:
|
|
119
|
-
required:
|
|
120
|
-
name:
|
|
121
|
-
parentClass:
|
|
128
|
+
placeholder: s = "Select option",
|
|
129
|
+
className: n = "",
|
|
130
|
+
disabled: p = !1,
|
|
131
|
+
search: S = !1,
|
|
132
|
+
label: D = "",
|
|
133
|
+
required: d = !1,
|
|
134
|
+
name: f = "",
|
|
135
|
+
parentClass: a = "",
|
|
122
136
|
multiple: m = !1,
|
|
123
137
|
// ✅ NEW
|
|
124
138
|
dropdownMaxHeight: v = "",
|
|
125
|
-
formData:
|
|
126
|
-
dependencyKey:
|
|
139
|
+
formData: u = {},
|
|
140
|
+
dependencyKey: y = ""
|
|
127
141
|
}) => {
|
|
128
|
-
var
|
|
129
|
-
const [
|
|
130
|
-
let
|
|
131
|
-
const Y = (
|
|
132
|
-
|
|
142
|
+
var _;
|
|
143
|
+
const [x, N] = R(!1), [I, P] = R(""), [M, L] = R(!0), B = ae(null), F = ae(null), [C, E] = R([]);
|
|
144
|
+
let G = o || o === !1 ? o : l;
|
|
145
|
+
const Y = (k) => k == null || k === "" ? "" : String(typeof k == "boolean" ? k : k ?? "");
|
|
146
|
+
z(
|
|
133
147
|
() => {
|
|
134
148
|
(async () => {
|
|
135
|
-
if (typeof
|
|
136
|
-
const
|
|
137
|
-
|
|
149
|
+
if (typeof h == "function") {
|
|
150
|
+
const j = await h(u);
|
|
151
|
+
E(j);
|
|
138
152
|
} else
|
|
139
|
-
|
|
153
|
+
E(h || []);
|
|
140
154
|
})();
|
|
141
155
|
},
|
|
142
|
-
|
|
156
|
+
y ? [h, u == null ? void 0 : u[y]] : [h]
|
|
143
157
|
);
|
|
144
|
-
const
|
|
145
|
-
(
|
|
146
|
-
),
|
|
147
|
-
const
|
|
148
|
-
return m ?
|
|
158
|
+
const W = m ? (G || []).map(Y) : Y(G), U = C.filter(
|
|
159
|
+
(k) => k.label.toLowerCase().includes(I.toLowerCase())
|
|
160
|
+
), K = (k) => {
|
|
161
|
+
const j = Y(k);
|
|
162
|
+
return m ? W.includes(j) : j === W;
|
|
149
163
|
};
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
164
|
+
z(() => {
|
|
165
|
+
const k = (j) => {
|
|
166
|
+
B.current && !B.current.contains(j.target) && (N(!1), P(""));
|
|
153
167
|
};
|
|
154
|
-
return document.addEventListener("mousedown",
|
|
155
|
-
}, []),
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
|
|
168
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
169
|
+
}, []), z(() => {
|
|
170
|
+
if (x && B.current) {
|
|
171
|
+
const k = B.current.getBoundingClientRect(), X = window.innerHeight - k.bottom;
|
|
172
|
+
L(X < 200);
|
|
159
173
|
}
|
|
160
|
-
}, [
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
const
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
(
|
|
170
|
-
) :
|
|
174
|
+
}, [x]), z(() => {
|
|
175
|
+
x && F.current && F.current.focus();
|
|
176
|
+
}, [x]);
|
|
177
|
+
const Z = (k) => {
|
|
178
|
+
let j = k;
|
|
179
|
+
if (k === "true" ? j = !0 : k === "false" && (j = !1), m) {
|
|
180
|
+
const X = W.includes(Y(k));
|
|
181
|
+
let J;
|
|
182
|
+
X ? J = o.filter(
|
|
183
|
+
(ee) => Y(ee) !== Y(k)
|
|
184
|
+
) : J = [...o || [], j], i(J);
|
|
171
185
|
} else
|
|
172
|
-
i(
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
return
|
|
176
|
-
(
|
|
177
|
-
i(
|
|
186
|
+
i(j), N(!1);
|
|
187
|
+
P("");
|
|
188
|
+
}, O = m ? C.filter((k) => K(k.value)).map((k) => k.label).join(", ") : (_ = C.find((k) => K(k.value))) == null ? void 0 : _.label;
|
|
189
|
+
return z(() => {
|
|
190
|
+
(G || G === !1) && setTimeout(() => {
|
|
191
|
+
i(G);
|
|
178
192
|
}, 100);
|
|
179
|
-
}, []), /* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */ e(q, { label:
|
|
181
|
-
/* @__PURE__ */
|
|
193
|
+
}, []), /* @__PURE__ */ c("div", { className: a || "col-span-12", children: [
|
|
194
|
+
/* @__PURE__ */ e(q, { label: D, required: d }),
|
|
195
|
+
/* @__PURE__ */ c("div", { className: `relative ${n}`, ref: B, children: [
|
|
182
196
|
/* @__PURE__ */ e(
|
|
183
197
|
"select",
|
|
184
198
|
{
|
|
185
199
|
name: "hidden_select_for_validation",
|
|
186
|
-
value:
|
|
187
|
-
required:
|
|
200
|
+
value: O || "",
|
|
201
|
+
required: d,
|
|
188
202
|
multiple: m,
|
|
189
203
|
className: "absolute opacity-0 right-1/2 top-[80%] -translate-x-1/2 -translate-y-1/2 pointer-events-none h-[10px]",
|
|
190
|
-
children: /* @__PURE__ */ e("option", { hidden: !0, value:
|
|
204
|
+
children: /* @__PURE__ */ e("option", { hidden: !0, value: O, children: O })
|
|
191
205
|
}
|
|
192
206
|
),
|
|
193
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ c(
|
|
194
208
|
"button",
|
|
195
209
|
{
|
|
196
210
|
type: "button",
|
|
197
|
-
onClick: () => !
|
|
198
|
-
disabled:
|
|
211
|
+
onClick: () => !p && N(!x),
|
|
212
|
+
disabled: p,
|
|
199
213
|
className: `w-full h-10 px-3 border border-gray-300 dark:border-gray-600 rounded-md text-left text-sm flex items-center justify-between
|
|
200
|
-
${
|
|
201
|
-
${
|
|
214
|
+
${O ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
|
|
215
|
+
${p ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
|
|
202
216
|
children: [
|
|
203
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
217
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: O || s }),
|
|
204
218
|
/* @__PURE__ */ e(
|
|
205
|
-
|
|
219
|
+
Be,
|
|
206
220
|
{
|
|
207
|
-
className: `w-4 h-4 transition-transform ${
|
|
221
|
+
className: `w-4 h-4 transition-transform ${x ? "rotate-180" : ""}`
|
|
208
222
|
}
|
|
209
223
|
)
|
|
210
224
|
]
|
|
211
225
|
}
|
|
212
226
|
),
|
|
213
|
-
|
|
227
|
+
x && /* @__PURE__ */ c(
|
|
214
228
|
"div",
|
|
215
229
|
{
|
|
216
230
|
className: `absolute z-50 w-full border rounded-md bg-white dark:bg-gray-700 shadow-lg
|
|
217
|
-
${
|
|
231
|
+
${M ? "bottom-full mb-1" : "top-full mt-1"}`,
|
|
218
232
|
children: [
|
|
219
|
-
|
|
220
|
-
/* @__PURE__ */ e(
|
|
233
|
+
S && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
234
|
+
/* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
|
|
221
235
|
/* @__PURE__ */ e(
|
|
222
236
|
"input",
|
|
223
237
|
{
|
|
224
|
-
ref:
|
|
238
|
+
ref: F,
|
|
225
239
|
type: "text",
|
|
226
240
|
value: I,
|
|
227
|
-
onChange: (
|
|
241
|
+
onChange: (k) => P(k.target.value),
|
|
228
242
|
placeholder: "Search...",
|
|
229
243
|
className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none"
|
|
230
244
|
}
|
|
@@ -237,19 +251,19 @@ const ta = ({
|
|
|
237
251
|
style: {
|
|
238
252
|
maxHeight: v || ""
|
|
239
253
|
},
|
|
240
|
-
children:
|
|
254
|
+
children: U.length > 0 ? U.map((k) => /* @__PURE__ */ c(
|
|
241
255
|
"button",
|
|
242
256
|
{
|
|
243
257
|
type: "button",
|
|
244
|
-
onClick: () =>
|
|
258
|
+
onClick: () => Z(String(k.value)),
|
|
245
259
|
className: `w-full px-3 py-2 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-600
|
|
246
|
-
${
|
|
260
|
+
${K(k.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
|
|
247
261
|
children: [
|
|
248
|
-
/* @__PURE__ */ e("span", { children:
|
|
249
|
-
m &&
|
|
262
|
+
/* @__PURE__ */ e("span", { children: k.label }),
|
|
263
|
+
m && K(k.value) && /* @__PURE__ */ e(We, { className: "w-4 h-4" })
|
|
250
264
|
]
|
|
251
265
|
},
|
|
252
|
-
String(
|
|
266
|
+
String(k.value)
|
|
253
267
|
)) : /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No options found" })
|
|
254
268
|
}
|
|
255
269
|
)
|
|
@@ -257,27 +271,27 @@ const ta = ({
|
|
|
257
271
|
}
|
|
258
272
|
)
|
|
259
273
|
] })
|
|
260
|
-
] },
|
|
261
|
-
},
|
|
262
|
-
value:
|
|
274
|
+
] }, f);
|
|
275
|
+
}, oa = ({
|
|
276
|
+
value: h = !0,
|
|
263
277
|
onChange: o,
|
|
264
|
-
text:
|
|
278
|
+
text: l,
|
|
265
279
|
options: i = [],
|
|
266
|
-
label:
|
|
267
|
-
required:
|
|
268
|
-
name:
|
|
269
|
-
disabled:
|
|
270
|
-
parentClass:
|
|
280
|
+
label: s,
|
|
281
|
+
required: n,
|
|
282
|
+
name: p = "",
|
|
283
|
+
disabled: S = !1,
|
|
284
|
+
parentClass: D = ""
|
|
271
285
|
}) => {
|
|
272
|
-
const
|
|
286
|
+
const d = i.length > 0 ? i : [
|
|
273
287
|
{ label: "Active", value: !0 },
|
|
274
288
|
{ label: "Inactive", value: !1 }
|
|
275
289
|
];
|
|
276
|
-
return /* @__PURE__ */ e(
|
|
277
|
-
/* @__PURE__ */ e(q, { label:
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
|
|
280
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-6", children:
|
|
290
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
|
|
291
|
+
/* @__PURE__ */ e(q, { label: s, required: n }),
|
|
292
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
|
|
293
|
+
l && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: l }),
|
|
294
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: d.map((f, a) => /* @__PURE__ */ c(
|
|
281
295
|
"label",
|
|
282
296
|
{
|
|
283
297
|
className: "flex items-center gap-2 cursor-pointer select-none",
|
|
@@ -287,22 +301,22 @@ const ta = ({
|
|
|
287
301
|
{
|
|
288
302
|
type: "radio",
|
|
289
303
|
name: "switch-field",
|
|
290
|
-
required:
|
|
291
|
-
value:
|
|
292
|
-
disabled:
|
|
293
|
-
checked:
|
|
294
|
-
onChange: () => o(
|
|
304
|
+
required: n && a === 0,
|
|
305
|
+
value: f.value,
|
|
306
|
+
disabled: S,
|
|
307
|
+
checked: h === f.value,
|
|
308
|
+
onChange: () => o(f.value),
|
|
295
309
|
className: "w-4 h-4 border-gray-300 cursor-pointer"
|
|
296
310
|
}
|
|
297
311
|
),
|
|
298
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children:
|
|
312
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: f.label })
|
|
299
313
|
]
|
|
300
314
|
},
|
|
301
|
-
|
|
315
|
+
a
|
|
302
316
|
)) })
|
|
303
317
|
] })
|
|
304
|
-
] },
|
|
305
|
-
},
|
|
318
|
+
] }, p) });
|
|
319
|
+
}, ke = [
|
|
306
320
|
{ label: "Afghanistan", code: "AF", phone: "93" },
|
|
307
321
|
{ label: "Aland Islands", code: "AX", phone: "358" },
|
|
308
322
|
{ label: "Albania", code: "AL", phone: "355" },
|
|
@@ -554,63 +568,63 @@ const ta = ({
|
|
|
554
568
|
{ label: "Zambia", code: "ZM", phone: "260" },
|
|
555
569
|
{ label: "Zimbabwe", code: "ZW", phone: "263" }
|
|
556
570
|
];
|
|
557
|
-
function
|
|
558
|
-
label:
|
|
571
|
+
function ia({
|
|
572
|
+
label: h = "",
|
|
559
573
|
value: o = "",
|
|
560
|
-
name:
|
|
574
|
+
name: l = "",
|
|
561
575
|
parentClass: i = "",
|
|
562
|
-
onChange:
|
|
563
|
-
disabled:
|
|
564
|
-
required:
|
|
565
|
-
placeholder:
|
|
566
|
-
search:
|
|
567
|
-
countriesList:
|
|
568
|
-
defaultCountry:
|
|
576
|
+
onChange: s,
|
|
577
|
+
disabled: n = !1,
|
|
578
|
+
required: p = !1,
|
|
579
|
+
placeholder: S = "Phone number",
|
|
580
|
+
search: D = !1,
|
|
581
|
+
countriesList: d = !1,
|
|
582
|
+
defaultCountry: f = ""
|
|
569
583
|
}) {
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
), [
|
|
573
|
-
|
|
584
|
+
const a = (C) => ke.find((E) => E.code == C), [m, v] = R(
|
|
585
|
+
a(f) || ke[0]
|
|
586
|
+
), [u, y] = R(""), [x, N] = R(!1), [I, P] = R(""), M = ae();
|
|
587
|
+
z(() => {
|
|
574
588
|
if (typeof o == "string" && o.startsWith("+")) {
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
v(
|
|
589
|
+
const C = ke.filter((E) => o.startsWith("+" + E.phone)).sort((E, G) => G.phone.length - E.phone.length)[0];
|
|
590
|
+
if (C) {
|
|
591
|
+
v(C), y(o.replace("+" + C.phone, ""));
|
|
578
592
|
return;
|
|
579
593
|
}
|
|
580
594
|
}
|
|
581
|
-
|
|
595
|
+
y(o);
|
|
582
596
|
}, [o]);
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
},
|
|
587
|
-
v(
|
|
597
|
+
const L = (C) => {
|
|
598
|
+
const E = C.target.value.replace(/\D/g, "");
|
|
599
|
+
y(E), m && s && s("+" + m.phone + E);
|
|
600
|
+
}, B = (C) => {
|
|
601
|
+
v(C), s && s("+" + C.phone + u), N(!1), P("");
|
|
588
602
|
};
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
|
|
603
|
+
z(() => {
|
|
604
|
+
const C = (E) => {
|
|
605
|
+
M.current && !M.current.contains(E.target) && N(!1);
|
|
592
606
|
};
|
|
593
|
-
return document.addEventListener("mousedown",
|
|
607
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
594
608
|
}, []);
|
|
595
|
-
const
|
|
596
|
-
(
|
|
609
|
+
const F = ke.filter(
|
|
610
|
+
(C) => C.label.toLowerCase().includes(I.toLowerCase()) || C.phone.includes(I)
|
|
597
611
|
);
|
|
598
|
-
return
|
|
599
|
-
/* @__PURE__ */ e(q, { label:
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
612
|
+
return d ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i || "col-span-12", children: [
|
|
613
|
+
/* @__PURE__ */ e(q, { label: h, required: p }),
|
|
614
|
+
/* @__PURE__ */ c("div", { className: "relative ", ref: M, children: [
|
|
615
|
+
/* @__PURE__ */ c(
|
|
602
616
|
"div",
|
|
603
617
|
{
|
|
604
618
|
className: `h-[40px] flex items-center border rounded-md px-2 bg-white dark:bg-gray-700 transition-all
|
|
605
|
-
${
|
|
606
|
-
${
|
|
619
|
+
${x ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
|
|
620
|
+
${n ? "opacity-60 cursor-not-allowed" : ""}`,
|
|
607
621
|
children: [
|
|
608
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ c(
|
|
609
623
|
"button",
|
|
610
624
|
{
|
|
611
625
|
type: "button",
|
|
612
|
-
disabled:
|
|
613
|
-
onClick: () =>
|
|
626
|
+
disabled: n,
|
|
627
|
+
onClick: () => N(!x),
|
|
614
628
|
className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
|
|
615
629
|
children: [
|
|
616
630
|
m ? /* @__PURE__ */ e(
|
|
@@ -621,11 +635,11 @@ function la({
|
|
|
621
635
|
className: "w-5 h-3 object-cover"
|
|
622
636
|
}
|
|
623
637
|
) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "🌐" }),
|
|
624
|
-
/* @__PURE__ */ e(
|
|
638
|
+
/* @__PURE__ */ e(Be, { className: "w-3 h-3 text-gray-500" })
|
|
625
639
|
]
|
|
626
640
|
}
|
|
627
641
|
),
|
|
628
|
-
m && /* @__PURE__ */
|
|
642
|
+
m && /* @__PURE__ */ c("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
|
|
629
643
|
"+",
|
|
630
644
|
m.phone
|
|
631
645
|
] }),
|
|
@@ -633,11 +647,11 @@ function la({
|
|
|
633
647
|
"input",
|
|
634
648
|
{
|
|
635
649
|
type: "tel",
|
|
636
|
-
value:
|
|
637
|
-
onChange:
|
|
638
|
-
required:
|
|
639
|
-
disabled:
|
|
640
|
-
placeholder: m ?
|
|
650
|
+
value: u,
|
|
651
|
+
onChange: L,
|
|
652
|
+
required: p,
|
|
653
|
+
disabled: n || !m,
|
|
654
|
+
placeholder: m ? S : "Select a country",
|
|
641
655
|
className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
|
|
642
656
|
}
|
|
643
657
|
),
|
|
@@ -645,10 +659,10 @@ function la({
|
|
|
645
659
|
"input",
|
|
646
660
|
{
|
|
647
661
|
type: "tel",
|
|
648
|
-
required:
|
|
662
|
+
required: p,
|
|
649
663
|
tabIndex: -1,
|
|
650
664
|
readOnly: !0,
|
|
651
|
-
value: m &&
|
|
665
|
+
value: m && u ? "+" + m.phone + u : "",
|
|
652
666
|
style: {
|
|
653
667
|
position: "absolute",
|
|
654
668
|
opacity: 0,
|
|
@@ -660,61 +674,61 @@ function la({
|
|
|
660
674
|
]
|
|
661
675
|
}
|
|
662
676
|
),
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
/* @__PURE__ */ e(
|
|
677
|
+
x && /* @__PURE__ */ c("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
|
|
678
|
+
D && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
679
|
+
/* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
|
|
666
680
|
/* @__PURE__ */ e(
|
|
667
681
|
"input",
|
|
668
682
|
{
|
|
669
683
|
type: "text",
|
|
670
684
|
value: I,
|
|
671
|
-
onChange: (
|
|
685
|
+
onChange: (C) => P(C.target.value),
|
|
672
686
|
placeholder: "Search country...",
|
|
673
687
|
className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none "
|
|
674
688
|
}
|
|
675
689
|
)
|
|
676
690
|
] }) }),
|
|
677
|
-
|
|
691
|
+
F.map((C) => /* @__PURE__ */ c(
|
|
678
692
|
"button",
|
|
679
693
|
{
|
|
680
694
|
type: "button",
|
|
681
|
-
onClick: () =>
|
|
695
|
+
onClick: () => B(C),
|
|
682
696
|
className: "w-full flex items-center gap-2 px-2 py-1 text-sm hover:bg-blue-50 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-100",
|
|
683
697
|
children: [
|
|
684
698
|
/* @__PURE__ */ e(
|
|
685
699
|
"img",
|
|
686
700
|
{
|
|
687
|
-
src: `https://flagcdn.com/w20/${
|
|
688
|
-
alt:
|
|
701
|
+
src: `https://flagcdn.com/w20/${C.code.toLowerCase()}.png`,
|
|
702
|
+
alt: C.code,
|
|
689
703
|
className: "w-5 h-3 object-cover"
|
|
690
704
|
}
|
|
691
705
|
),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
|
|
706
|
+
/* @__PURE__ */ c("span", { children: [
|
|
707
|
+
C.label,
|
|
694
708
|
" (+",
|
|
695
|
-
|
|
709
|
+
C.phone,
|
|
696
710
|
")"
|
|
697
711
|
] })
|
|
698
712
|
]
|
|
699
713
|
},
|
|
700
|
-
|
|
714
|
+
C.code
|
|
701
715
|
))
|
|
702
716
|
] })
|
|
703
717
|
] })
|
|
704
|
-
] },
|
|
705
|
-
/* @__PURE__ */ e(q, { label:
|
|
718
|
+
] }, l) }) : /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i || "col-span-12", children: [
|
|
719
|
+
/* @__PURE__ */ e(q, { label: h, required: p }),
|
|
706
720
|
/* @__PURE__ */ e(
|
|
707
721
|
"input",
|
|
708
722
|
{
|
|
709
723
|
type: "text",
|
|
710
724
|
value: o,
|
|
711
|
-
onChange: (
|
|
712
|
-
const
|
|
713
|
-
|
|
725
|
+
onChange: (E) => {
|
|
726
|
+
const G = E.target.value.replace(/[^+\d]/g, ""), Y = G.startsWith("+") ? "+" + G.replace(/[+]/g, "").slice(0) : G;
|
|
727
|
+
s(Y);
|
|
714
728
|
},
|
|
715
|
-
placeholder:
|
|
716
|
-
disabled:
|
|
717
|
-
required:
|
|
729
|
+
placeholder: S,
|
|
730
|
+
disabled: n,
|
|
731
|
+
required: p,
|
|
718
732
|
className: `w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md \r
|
|
719
733
|
bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none \r
|
|
720
734
|
focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-200`,
|
|
@@ -722,94 +736,94 @@ function la({
|
|
|
722
736
|
pattern: "^\\+\\d{1,15}$"
|
|
723
737
|
}
|
|
724
738
|
)
|
|
725
|
-
] },
|
|
739
|
+
] }, l) });
|
|
726
740
|
}
|
|
727
|
-
const
|
|
728
|
-
({ className:
|
|
729
|
-
const
|
|
741
|
+
const Ee = Oe.forwardRef(
|
|
742
|
+
({ className: h = "", label: o, required: l, ...i }, s) => {
|
|
743
|
+
const n = `
|
|
730
744
|
placeholder-gray-400 dark:placeholder-gray-400
|
|
731
|
-
${
|
|
745
|
+
${h}
|
|
732
746
|
`.trim();
|
|
733
|
-
return /* @__PURE__ */ e(
|
|
734
|
-
/* @__PURE__ */ e(q, { label: o, required:
|
|
747
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: i.parentClass || "col-span-12", children: [
|
|
748
|
+
/* @__PURE__ */ e(q, { label: o, required: l }),
|
|
735
749
|
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
|
|
736
750
|
"textarea",
|
|
737
751
|
{
|
|
738
|
-
className:
|
|
739
|
-
ref:
|
|
740
|
-
required:
|
|
752
|
+
className: n,
|
|
753
|
+
ref: s,
|
|
754
|
+
required: l,
|
|
741
755
|
...i
|
|
742
756
|
}
|
|
743
757
|
) })
|
|
744
758
|
] }, i.name) });
|
|
745
759
|
}
|
|
746
760
|
);
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
label:
|
|
761
|
+
Ee.displayName = "TextArea";
|
|
762
|
+
const sa = ({
|
|
763
|
+
label: h = "",
|
|
750
764
|
value: o = null,
|
|
751
|
-
onChange:
|
|
765
|
+
onChange: l,
|
|
752
766
|
required: i = !1,
|
|
753
|
-
accept:
|
|
754
|
-
id:
|
|
755
|
-
dragDrop:
|
|
756
|
-
name:
|
|
757
|
-
parentClass:
|
|
767
|
+
accept: s = "image/*",
|
|
768
|
+
id: n,
|
|
769
|
+
dragDrop: p = !1,
|
|
770
|
+
name: S = "",
|
|
771
|
+
parentClass: D = ""
|
|
758
772
|
}) => {
|
|
759
|
-
const [
|
|
760
|
-
|
|
761
|
-
|
|
773
|
+
const [d, f] = R(o), [a, m] = R(!1), v = ae(null);
|
|
774
|
+
z(() => (o instanceof File ? f({ file: o, preview: URL.createObjectURL(o) }) : (o != null && o.preview, f(o)), () => {
|
|
775
|
+
d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview);
|
|
762
776
|
}), [o]);
|
|
763
|
-
const
|
|
764
|
-
if (!
|
|
777
|
+
const u = (M) => {
|
|
778
|
+
if (!M || M.length === 0)
|
|
765
779
|
return;
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
},
|
|
769
|
-
|
|
770
|
-
},
|
|
771
|
-
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
}, I = (
|
|
775
|
-
|
|
776
|
-
},
|
|
780
|
+
const L = M[0], B = URL.createObjectURL(L), F = { file: L, preview: B };
|
|
781
|
+
d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview), f(F), l == null || l(L);
|
|
782
|
+
}, y = (M) => {
|
|
783
|
+
M && M.stopPropagation(), d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview), f(null), l == null || l(null), v.current && (v.current.value = "");
|
|
784
|
+
}, x = (M) => {
|
|
785
|
+
p && (M.preventDefault(), m(!0));
|
|
786
|
+
}, N = (M) => {
|
|
787
|
+
p && (M.preventDefault(), m(!1));
|
|
788
|
+
}, I = (M) => {
|
|
789
|
+
p && (M.preventDefault(), m(!1), u(M.dataTransfer.files));
|
|
790
|
+
}, P = () => {
|
|
777
791
|
v.current.click();
|
|
778
792
|
};
|
|
779
|
-
return /* @__PURE__ */ e(
|
|
780
|
-
/* @__PURE__ */ e(q, { label:
|
|
781
|
-
/* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
|
|
794
|
+
/* @__PURE__ */ e(q, { label: h, required: i }),
|
|
795
|
+
/* @__PURE__ */ c(
|
|
782
796
|
"div",
|
|
783
797
|
{
|
|
784
|
-
className: `relative rounded-md p-2 transition-all ${
|
|
785
|
-
onDragOver:
|
|
786
|
-
onDragLeave:
|
|
798
|
+
className: `relative rounded-md p-2 transition-all ${a ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
|
|
799
|
+
onDragOver: x,
|
|
800
|
+
onDragLeave: N,
|
|
787
801
|
onDrop: I,
|
|
788
802
|
children: [
|
|
789
803
|
/* @__PURE__ */ e(
|
|
790
804
|
"input",
|
|
791
805
|
{
|
|
792
806
|
ref: v,
|
|
793
|
-
id:
|
|
807
|
+
id: n,
|
|
794
808
|
type: "file",
|
|
795
|
-
accept:
|
|
796
|
-
onChange: (
|
|
797
|
-
required: i && !
|
|
809
|
+
accept: s,
|
|
810
|
+
onChange: (M) => u(M.target.files),
|
|
811
|
+
required: i && !d,
|
|
798
812
|
className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
|
|
799
813
|
}
|
|
800
814
|
),
|
|
801
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ c(
|
|
802
816
|
"div",
|
|
803
817
|
{
|
|
804
|
-
className: `flex items-center space-x-4 transition-all ${
|
|
818
|
+
className: `flex items-center space-x-4 transition-all ${a ? "opacity-50" : ""}`,
|
|
805
819
|
children: [
|
|
806
|
-
|
|
820
|
+
d ? (
|
|
807
821
|
// Image preview with close button
|
|
808
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ c("div", { className: "relative group", children: [
|
|
809
823
|
/* @__PURE__ */ e(
|
|
810
824
|
"img",
|
|
811
825
|
{
|
|
812
|
-
src:
|
|
826
|
+
src: d.preview || d,
|
|
813
827
|
alt: "preview",
|
|
814
828
|
className: "object-cover w-20 h-20 rounded-full shadow-md"
|
|
815
829
|
}
|
|
@@ -818,7 +832,7 @@ const oa = ({
|
|
|
818
832
|
"button",
|
|
819
833
|
{
|
|
820
834
|
type: "button",
|
|
821
|
-
onClick:
|
|
835
|
+
onClick: y,
|
|
822
836
|
className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2",
|
|
823
837
|
"aria-label": "Remove image",
|
|
824
838
|
children: /* @__PURE__ */ e(re, { icon: "mdi:close", className: "w-3 h-3" })
|
|
@@ -835,149 +849,160 @@ const oa = ({
|
|
|
835
849
|
}
|
|
836
850
|
) })
|
|
837
851
|
),
|
|
838
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col items-center space-y-1", children: [
|
|
839
853
|
/* @__PURE__ */ e(
|
|
840
|
-
|
|
854
|
+
Q,
|
|
841
855
|
{
|
|
842
856
|
type: "button",
|
|
843
|
-
onClick:
|
|
857
|
+
onClick: P,
|
|
844
858
|
variant: "outlined",
|
|
845
859
|
color: "default",
|
|
846
|
-
children:
|
|
860
|
+
children: d ? "Change Image" : "Select Image"
|
|
847
861
|
}
|
|
848
862
|
),
|
|
849
|
-
|
|
863
|
+
p && !d && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
|
|
850
864
|
] })
|
|
851
865
|
]
|
|
852
866
|
}
|
|
853
867
|
),
|
|
854
|
-
|
|
868
|
+
p && a && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
|
|
855
869
|
]
|
|
856
870
|
}
|
|
857
871
|
)
|
|
858
|
-
] },
|
|
859
|
-
},
|
|
872
|
+
] }, S) });
|
|
873
|
+
}, $e = Oe.forwardRef(
|
|
860
874
|
({
|
|
861
|
-
label:
|
|
875
|
+
label: h,
|
|
862
876
|
required: o,
|
|
863
|
-
parentClass:
|
|
877
|
+
parentClass: l = "",
|
|
864
878
|
className: i = "",
|
|
865
|
-
type:
|
|
866
|
-
onKeyDown:
|
|
867
|
-
negativeNumberAllow:
|
|
868
|
-
defaultValue:
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
879
|
+
type: s = "text",
|
|
880
|
+
onKeyDown: n,
|
|
881
|
+
negativeNumberAllow: p = !0,
|
|
882
|
+
defaultValue: S = "",
|
|
883
|
+
field: D = {},
|
|
884
|
+
...d
|
|
885
|
+
}, f) => {
|
|
886
|
+
const [a, m] = R(!1), v = (y) => {
|
|
887
|
+
if (s === "number") {
|
|
888
|
+
if (["e", "E", "+"].includes(y.key)) {
|
|
889
|
+
y.preventDefault();
|
|
875
890
|
return;
|
|
876
891
|
}
|
|
877
|
-
if (
|
|
878
|
-
|
|
892
|
+
if (p == !1 && y.key === "-") {
|
|
893
|
+
y.preventDefault();
|
|
879
894
|
return;
|
|
880
895
|
}
|
|
881
|
-
if (["ArrowUp", "ArrowDown"].includes(
|
|
882
|
-
|
|
896
|
+
if (["ArrowUp", "ArrowDown"].includes(y.key)) {
|
|
897
|
+
y.preventDefault();
|
|
883
898
|
return;
|
|
884
899
|
}
|
|
885
900
|
}
|
|
886
|
-
|
|
887
|
-
},
|
|
901
|
+
n == null || n(y);
|
|
902
|
+
}, u = `
|
|
888
903
|
h-10 placeholder-gray-400 dark:placeholder-gray-400
|
|
889
|
-
${
|
|
890
|
-
${
|
|
904
|
+
${s === "password" ? "pr-10" : ""}
|
|
905
|
+
${s === "number" ? "no-spinner" : ""}
|
|
891
906
|
${i}
|
|
892
907
|
`.trim();
|
|
893
|
-
return
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
(
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
908
|
+
return z(() => {
|
|
909
|
+
if (S) {
|
|
910
|
+
let y = d.value || S;
|
|
911
|
+
setTimeout(() => {
|
|
912
|
+
var x;
|
|
913
|
+
(x = d.onChange) == null || x.call(d, { target: { value: y } });
|
|
914
|
+
}, 100);
|
|
915
|
+
}
|
|
916
|
+
}, [S]), /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: l || "col-span-12", children: [
|
|
917
|
+
/* @__PURE__ */ e(
|
|
918
|
+
q,
|
|
919
|
+
{
|
|
920
|
+
label: h,
|
|
921
|
+
required: o,
|
|
922
|
+
infoText: D.infoText
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
/* @__PURE__ */ c("div", { className: "relative", children: [
|
|
901
926
|
/* @__PURE__ */ e(
|
|
902
927
|
"input",
|
|
903
928
|
{
|
|
904
|
-
type:
|
|
905
|
-
ref:
|
|
929
|
+
type: s === "password" && a ? "text" : s,
|
|
930
|
+
ref: f,
|
|
906
931
|
required: o,
|
|
907
|
-
onKeyDown:
|
|
908
|
-
className:
|
|
909
|
-
...
|
|
932
|
+
onKeyDown: v,
|
|
933
|
+
className: u,
|
|
934
|
+
...d
|
|
910
935
|
}
|
|
911
936
|
),
|
|
912
|
-
|
|
937
|
+
s === "password" && /* @__PURE__ */ e(
|
|
913
938
|
"button",
|
|
914
939
|
{
|
|
915
940
|
type: "button",
|
|
916
941
|
tabIndex: -1,
|
|
917
|
-
onClick: () =>
|
|
942
|
+
onClick: () => m((y) => !y),
|
|
918
943
|
className: "absolute inset-y-0 right-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-200",
|
|
919
944
|
children: /* @__PURE__ */ e(
|
|
920
945
|
re,
|
|
921
946
|
{
|
|
922
|
-
icon:
|
|
947
|
+
icon: a ? "mdi:eye-outline" : "mdi:eye-off-outline",
|
|
923
948
|
className: "w-5 h-5"
|
|
924
949
|
}
|
|
925
950
|
)
|
|
926
951
|
}
|
|
927
952
|
)
|
|
928
953
|
] })
|
|
929
|
-
] },
|
|
954
|
+
] }, d.name) });
|
|
930
955
|
}
|
|
931
956
|
);
|
|
932
|
-
|
|
933
|
-
const
|
|
934
|
-
key:
|
|
957
|
+
$e.displayName = "Input";
|
|
958
|
+
const da = ({
|
|
959
|
+
key: h,
|
|
935
960
|
editorKey: o = "",
|
|
936
|
-
value:
|
|
961
|
+
value: l = "",
|
|
937
962
|
onChange: i,
|
|
938
|
-
label:
|
|
939
|
-
required:
|
|
940
|
-
placeholder:
|
|
941
|
-
parentClass:
|
|
942
|
-
height:
|
|
943
|
-
inline:
|
|
944
|
-
disabled:
|
|
945
|
-
plugins:
|
|
963
|
+
label: s = "",
|
|
964
|
+
required: n = !1,
|
|
965
|
+
placeholder: p = "",
|
|
966
|
+
parentClass: S = "col-span-12",
|
|
967
|
+
height: D = 400,
|
|
968
|
+
inline: d = !1,
|
|
969
|
+
disabled: f = !1,
|
|
970
|
+
plugins: a,
|
|
946
971
|
toolbar: m,
|
|
947
972
|
menubar: v = !1,
|
|
948
|
-
fontFamily:
|
|
949
|
-
initConfig:
|
|
950
|
-
imageUploadHandler:
|
|
973
|
+
fontFamily: u = "Inter, sans-serif",
|
|
974
|
+
initConfig: y = {},
|
|
975
|
+
imageUploadHandler: x
|
|
951
976
|
// ✅ Promise function passed from parent
|
|
952
|
-
}) => /* @__PURE__ */
|
|
953
|
-
|
|
977
|
+
}) => /* @__PURE__ */ c("div", { className: S, children: [
|
|
978
|
+
s && /* @__PURE__ */ e(q, { label: s, required: n }),
|
|
954
979
|
/* @__PURE__ */ e(
|
|
955
|
-
|
|
980
|
+
ta,
|
|
956
981
|
{
|
|
957
982
|
apiKey: o,
|
|
958
|
-
value:
|
|
959
|
-
disabled:
|
|
983
|
+
value: l,
|
|
984
|
+
disabled: f,
|
|
960
985
|
init: {
|
|
961
|
-
height:
|
|
962
|
-
inline:
|
|
986
|
+
height: D,
|
|
987
|
+
inline: d,
|
|
963
988
|
menubar: v,
|
|
964
989
|
branding: !1,
|
|
965
990
|
statusbar: !0,
|
|
966
991
|
automatic_uploads: !0,
|
|
967
|
-
images_upload_handler: (
|
|
968
|
-
if (!
|
|
969
|
-
|
|
992
|
+
images_upload_handler: (M) => new Promise((L, B) => {
|
|
993
|
+
if (!x) {
|
|
994
|
+
L(`data:${M.blob().type};base64,${M.base64()}`);
|
|
970
995
|
return;
|
|
971
996
|
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
}).catch((
|
|
975
|
-
|
|
976
|
-
typeof
|
|
997
|
+
x(M).then((F) => {
|
|
998
|
+
F ? L(F) : B("Upload failed: No URL returned");
|
|
999
|
+
}).catch((F) => {
|
|
1000
|
+
B(
|
|
1001
|
+
typeof F == "string" ? F : (F == null ? void 0 : F.message) || "Image upload failed"
|
|
977
1002
|
);
|
|
978
1003
|
});
|
|
979
1004
|
}),
|
|
980
|
-
plugins:
|
|
1005
|
+
plugins: a ?? [
|
|
981
1006
|
"advlist",
|
|
982
1007
|
"autolink",
|
|
983
1008
|
"lists",
|
|
@@ -997,177 +1022,177 @@ const ia = ({
|
|
|
997
1022
|
"wordcount"
|
|
998
1023
|
],
|
|
999
1024
|
toolbar: m ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
|
|
1000
|
-
placeholder:
|
|
1025
|
+
placeholder: p,
|
|
1001
1026
|
content_style: `
|
|
1002
1027
|
body {
|
|
1003
|
-
font-family: ${
|
|
1028
|
+
font-family: ${u};
|
|
1004
1029
|
}
|
|
1005
1030
|
`,
|
|
1006
|
-
...
|
|
1031
|
+
...y
|
|
1007
1032
|
},
|
|
1008
|
-
onEditorChange: (
|
|
1009
|
-
i && i(
|
|
1033
|
+
onEditorChange: (M) => {
|
|
1034
|
+
i && i(M);
|
|
1010
1035
|
}
|
|
1011
1036
|
}
|
|
1012
1037
|
)
|
|
1013
|
-
] },
|
|
1014
|
-
name:
|
|
1038
|
+
] }, h), ca = ({
|
|
1039
|
+
name: h = "",
|
|
1015
1040
|
label: o = "",
|
|
1016
1041
|
// label for single checkbox
|
|
1017
|
-
options:
|
|
1042
|
+
options: l = [],
|
|
1018
1043
|
// array of { label, value } for multiple
|
|
1019
1044
|
value: i = null,
|
|
1020
1045
|
// boolean for single, array for multiple, or string for single select
|
|
1021
|
-
onChange:
|
|
1022
|
-
disabled:
|
|
1023
|
-
required:
|
|
1024
|
-
parentClass:
|
|
1025
|
-
className:
|
|
1026
|
-
multiSelect:
|
|
1046
|
+
onChange: s,
|
|
1047
|
+
disabled: n = !1,
|
|
1048
|
+
required: p = !1,
|
|
1049
|
+
parentClass: S = "col-span-12",
|
|
1050
|
+
className: D = "",
|
|
1051
|
+
multiSelect: d = !1
|
|
1027
1052
|
// ✅ if true, only one option can be selected (like radio)
|
|
1028
1053
|
}) => {
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
}, v = (
|
|
1032
|
-
if (
|
|
1033
|
-
if (!
|
|
1034
|
-
|
|
1054
|
+
const f = Array.isArray(l) && l.length > 0, a = (u) => f ? d ? Array.isArray(i) && i.includes(u) : i === u : !!i, m = (u) => {
|
|
1055
|
+
s == null || s(u.target.checked, h);
|
|
1056
|
+
}, v = (u, y) => {
|
|
1057
|
+
if (s)
|
|
1058
|
+
if (!d)
|
|
1059
|
+
s(y ? u : "", h);
|
|
1035
1060
|
else {
|
|
1036
|
-
const
|
|
1037
|
-
if (
|
|
1038
|
-
|
|
1061
|
+
const x = Array.isArray(i) ? [...i] : [];
|
|
1062
|
+
if (y)
|
|
1063
|
+
x.includes(u) || x.push(u);
|
|
1039
1064
|
else {
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1065
|
+
const N = x.indexOf(u);
|
|
1066
|
+
N > -1 && x.splice(N, 1);
|
|
1042
1067
|
}
|
|
1043
|
-
|
|
1068
|
+
s(x, h);
|
|
1044
1069
|
}
|
|
1045
1070
|
};
|
|
1046
|
-
return
|
|
1047
|
-
/* @__PURE__ */ e(q, { label: o, required:
|
|
1048
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children:
|
|
1071
|
+
return f ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ c("div", { className: `${S}`, children: [
|
|
1072
|
+
/* @__PURE__ */ e(q, { label: o, required: p }),
|
|
1073
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: l.map((u, y) => /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1049
1074
|
/* @__PURE__ */ e(
|
|
1050
1075
|
"input",
|
|
1051
1076
|
{
|
|
1052
1077
|
type: "checkbox",
|
|
1053
|
-
name:
|
|
1054
|
-
value:
|
|
1055
|
-
checked: u
|
|
1056
|
-
disabled:
|
|
1057
|
-
required:
|
|
1058
|
-
onChange: (
|
|
1059
|
-
className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${
|
|
1078
|
+
name: h,
|
|
1079
|
+
value: u.value,
|
|
1080
|
+
checked: a(u.value),
|
|
1081
|
+
disabled: n || u.disabled,
|
|
1082
|
+
required: p && y === 0,
|
|
1083
|
+
onChange: (x) => v(u.value, x.target.checked),
|
|
1084
|
+
className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${D}`
|
|
1060
1085
|
},
|
|
1061
|
-
|
|
1086
|
+
h
|
|
1062
1087
|
),
|
|
1063
|
-
|
|
1088
|
+
u.label && /* @__PURE__ */ e(
|
|
1064
1089
|
"label",
|
|
1065
1090
|
{
|
|
1066
|
-
htmlFor:
|
|
1091
|
+
htmlFor: h,
|
|
1067
1092
|
className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
|
|
1068
|
-
children:
|
|
1093
|
+
children: u.label
|
|
1069
1094
|
}
|
|
1070
1095
|
)
|
|
1071
|
-
] },
|
|
1072
|
-
] }) }) : /* @__PURE__ */
|
|
1096
|
+
] }, u.value || u.label)) })
|
|
1097
|
+
] }) }) : /* @__PURE__ */ c("div", { className: `flex items-center ${S}`, children: [
|
|
1073
1098
|
/* @__PURE__ */ e(
|
|
1074
1099
|
"input",
|
|
1075
1100
|
{
|
|
1076
1101
|
type: "checkbox",
|
|
1077
|
-
name:
|
|
1078
|
-
checked:
|
|
1079
|
-
disabled:
|
|
1080
|
-
required:
|
|
1102
|
+
name: h,
|
|
1103
|
+
checked: a(),
|
|
1104
|
+
disabled: n,
|
|
1105
|
+
required: p,
|
|
1081
1106
|
onChange: m,
|
|
1082
|
-
className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${
|
|
1107
|
+
className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${D}`
|
|
1083
1108
|
}
|
|
1084
1109
|
),
|
|
1085
1110
|
o && /* @__PURE__ */ e(
|
|
1086
1111
|
"label",
|
|
1087
1112
|
{
|
|
1088
|
-
htmlFor:
|
|
1113
|
+
htmlFor: h,
|
|
1089
1114
|
className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
|
|
1090
1115
|
children: o
|
|
1091
1116
|
}
|
|
1092
1117
|
)
|
|
1093
1118
|
] });
|
|
1094
|
-
},
|
|
1095
|
-
label:
|
|
1119
|
+
}, ha = ({
|
|
1120
|
+
label: h = "",
|
|
1096
1121
|
value: o = null,
|
|
1097
|
-
onChange:
|
|
1122
|
+
onChange: l,
|
|
1098
1123
|
required: i = !1,
|
|
1099
|
-
accept:
|
|
1100
|
-
id:
|
|
1101
|
-
dragDrop:
|
|
1102
|
-
name:
|
|
1103
|
-
parentClass:
|
|
1124
|
+
accept: s = "audio/*",
|
|
1125
|
+
id: n,
|
|
1126
|
+
dragDrop: p = !1,
|
|
1127
|
+
name: S = "",
|
|
1128
|
+
parentClass: D = ""
|
|
1104
1129
|
}) => {
|
|
1105
|
-
const [
|
|
1106
|
-
|
|
1130
|
+
const [d, f] = R(null), [a, m] = R(!1), v = ae(null);
|
|
1131
|
+
z(() => {
|
|
1107
1132
|
if (!o) {
|
|
1108
|
-
|
|
1133
|
+
u(), f(null);
|
|
1109
1134
|
return;
|
|
1110
1135
|
}
|
|
1111
1136
|
if (o instanceof File) {
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1114
|
-
URL.revokeObjectURL(
|
|
1137
|
+
const L = URL.createObjectURL(o);
|
|
1138
|
+
return f({ file: o, preview: L }), () => {
|
|
1139
|
+
URL.revokeObjectURL(L);
|
|
1115
1140
|
};
|
|
1116
|
-
} else typeof o == "string" ?
|
|
1141
|
+
} else typeof o == "string" ? f({ preview: o }) : o != null && o.preview && f(o);
|
|
1117
1142
|
}, [o]);
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1121
|
-
if (!
|
|
1143
|
+
const u = () => {
|
|
1144
|
+
d != null && d.preview && d.preview.startsWith("blob:") && URL.revokeObjectURL(d.preview);
|
|
1145
|
+
}, y = (L) => {
|
|
1146
|
+
if (!L || L.length === 0)
|
|
1122
1147
|
return;
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1128
|
-
|
|
1129
|
-
}, I = (
|
|
1130
|
-
|
|
1131
|
-
},
|
|
1132
|
-
|
|
1133
|
-
},
|
|
1148
|
+
const B = L[0], F = URL.createObjectURL(B);
|
|
1149
|
+
u(), f({ file: B, preview: F }), l == null || l(B);
|
|
1150
|
+
}, x = (L) => {
|
|
1151
|
+
L && L.stopPropagation(), u(), f(null), l == null || l(null), v.current && (v.current.value = "");
|
|
1152
|
+
}, N = (L) => {
|
|
1153
|
+
p && (L.preventDefault(), m(!0));
|
|
1154
|
+
}, I = (L) => {
|
|
1155
|
+
p && (L.preventDefault(), m(!1));
|
|
1156
|
+
}, P = (L) => {
|
|
1157
|
+
p && (L.preventDefault(), m(!1), y(L.dataTransfer.files));
|
|
1158
|
+
}, M = () => {
|
|
1134
1159
|
v.current.click();
|
|
1135
1160
|
};
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */ e(q, { label:
|
|
1138
|
-
/* @__PURE__ */
|
|
1161
|
+
return /* @__PURE__ */ c("div", { className: D || "col-span-12", children: [
|
|
1162
|
+
/* @__PURE__ */ e(q, { label: h, required: i }),
|
|
1163
|
+
/* @__PURE__ */ c(
|
|
1139
1164
|
"div",
|
|
1140
1165
|
{
|
|
1141
|
-
className: `relative rounded-lg p-2 transition-all ${
|
|
1142
|
-
onDragOver:
|
|
1166
|
+
className: `relative rounded-lg p-2 transition-all ${a ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
|
|
1167
|
+
onDragOver: N,
|
|
1143
1168
|
onDragLeave: I,
|
|
1144
|
-
onDrop:
|
|
1169
|
+
onDrop: P,
|
|
1145
1170
|
children: [
|
|
1146
1171
|
/* @__PURE__ */ e(
|
|
1147
1172
|
"input",
|
|
1148
1173
|
{
|
|
1149
1174
|
ref: v,
|
|
1150
|
-
id:
|
|
1175
|
+
id: n,
|
|
1151
1176
|
type: "file",
|
|
1152
|
-
accept:
|
|
1153
|
-
onChange: (
|
|
1154
|
-
required: i && !
|
|
1177
|
+
accept: s,
|
|
1178
|
+
onChange: (L) => y(L.target.files),
|
|
1179
|
+
required: i && !d,
|
|
1155
1180
|
className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
|
|
1156
1181
|
}
|
|
1157
1182
|
),
|
|
1158
1183
|
/* @__PURE__ */ e(
|
|
1159
1184
|
"div",
|
|
1160
1185
|
{
|
|
1161
|
-
className: `flex items-center space-x-4 transition-all ${
|
|
1162
|
-
children:
|
|
1186
|
+
className: `flex items-center space-x-4 transition-all ${a ? "opacity-50" : ""}`,
|
|
1187
|
+
children: d ? (
|
|
1163
1188
|
// Audio player with close button and change button
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ c("div", { className: "flex items-center space-x-4", children: [
|
|
1190
|
+
/* @__PURE__ */ c("div", { className: "relative w-full", children: [
|
|
1166
1191
|
!i && /* @__PURE__ */ e(
|
|
1167
1192
|
"button",
|
|
1168
1193
|
{
|
|
1169
1194
|
type: "button",
|
|
1170
|
-
onClick:
|
|
1195
|
+
onClick: x,
|
|
1171
1196
|
className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors z-10 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800",
|
|
1172
1197
|
"aria-label": "Remove audio",
|
|
1173
1198
|
children: /* @__PURE__ */ e(re, { icon: "mdi:close", className: "w-3 h-3" })
|
|
@@ -1176,274 +1201,277 @@ const ia = ({
|
|
|
1176
1201
|
/* @__PURE__ */ e(
|
|
1177
1202
|
"audio",
|
|
1178
1203
|
{
|
|
1179
|
-
src:
|
|
1204
|
+
src: d.preview,
|
|
1180
1205
|
controls: !0,
|
|
1181
1206
|
controlsList: "nodownload"
|
|
1182
1207
|
},
|
|
1183
|
-
|
|
1208
|
+
d.preview
|
|
1184
1209
|
)
|
|
1185
1210
|
] }),
|
|
1186
|
-
/* @__PURE__ */ e(
|
|
1211
|
+
/* @__PURE__ */ e(Q, { type: "button", onClick: M, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
|
|
1187
1212
|
] })
|
|
1188
1213
|
) : (
|
|
1189
1214
|
// Empty state with upload button
|
|
1190
|
-
/* @__PURE__ */
|
|
1215
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-center space-x-4", children: [
|
|
1191
1216
|
/* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(re, { icon: "mdi:music", className: "text-gray-400 w-10 h-10" }) }),
|
|
1192
1217
|
/* @__PURE__ */ e(
|
|
1193
|
-
|
|
1218
|
+
Q,
|
|
1194
1219
|
{
|
|
1195
1220
|
type: "button",
|
|
1196
|
-
onClick:
|
|
1221
|
+
onClick: M,
|
|
1197
1222
|
variant: "outlined",
|
|
1198
1223
|
children: /* @__PURE__ */ e("span", { children: "Choose Audio File" })
|
|
1199
1224
|
}
|
|
1200
1225
|
),
|
|
1201
|
-
|
|
1226
|
+
p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
|
|
1202
1227
|
] })
|
|
1203
1228
|
)
|
|
1204
1229
|
}
|
|
1205
1230
|
),
|
|
1206
|
-
|
|
1231
|
+
p && a && !d && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
|
|
1207
1232
|
]
|
|
1208
1233
|
}
|
|
1209
1234
|
)
|
|
1210
|
-
] },
|
|
1211
|
-
},
|
|
1235
|
+
] }, S);
|
|
1236
|
+
}, Ge = ({ field: h, formData: o, handleChange: l }) => {
|
|
1212
1237
|
const {
|
|
1213
1238
|
key: i,
|
|
1214
|
-
label:
|
|
1215
|
-
type:
|
|
1216
|
-
options:
|
|
1217
|
-
placeholder:
|
|
1218
|
-
rows:
|
|
1219
|
-
inputClass:
|
|
1220
|
-
search:
|
|
1221
|
-
accept:
|
|
1239
|
+
label: s,
|
|
1240
|
+
type: n,
|
|
1241
|
+
options: p,
|
|
1242
|
+
placeholder: S,
|
|
1243
|
+
rows: D,
|
|
1244
|
+
inputClass: d,
|
|
1245
|
+
search: f,
|
|
1246
|
+
accept: a,
|
|
1222
1247
|
text: m,
|
|
1223
1248
|
required: v = !1,
|
|
1224
|
-
minLength:
|
|
1225
|
-
dragDrop:
|
|
1226
|
-
parentClass:
|
|
1227
|
-
countriesList:
|
|
1249
|
+
minLength: u,
|
|
1250
|
+
dragDrop: y,
|
|
1251
|
+
parentClass: x,
|
|
1252
|
+
countriesList: N,
|
|
1228
1253
|
defaultCountry: I,
|
|
1229
|
-
multiple:
|
|
1230
|
-
dropdownMaxHeight:
|
|
1231
|
-
editorKey:
|
|
1232
|
-
fontFamily:
|
|
1233
|
-
disabled:
|
|
1234
|
-
negativeNumberAllow:
|
|
1235
|
-
defaultValue:
|
|
1236
|
-
renderCondition:
|
|
1237
|
-
optionDependencyKey: Y
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1254
|
+
multiple: P,
|
|
1255
|
+
dropdownMaxHeight: M,
|
|
1256
|
+
editorKey: L,
|
|
1257
|
+
fontFamily: B,
|
|
1258
|
+
disabled: F,
|
|
1259
|
+
negativeNumberAllow: C,
|
|
1260
|
+
defaultValue: E,
|
|
1261
|
+
renderCondition: G,
|
|
1262
|
+
optionDependencyKey: Y,
|
|
1263
|
+
pattern: W
|
|
1264
|
+
} = h;
|
|
1265
|
+
let U = o == null ? void 0 : o[i];
|
|
1266
|
+
U == null && (U = "");
|
|
1267
|
+
const K = S || (n === "select" ? `Select ${s}` : `Enter ${s}`), Z = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
|
|
1268
|
+
if (G && typeof G == "function" && !G(o))
|
|
1243
1269
|
return null;
|
|
1244
|
-
switch (
|
|
1270
|
+
switch (n) {
|
|
1245
1271
|
case "select":
|
|
1246
1272
|
return /* @__PURE__ */ e(
|
|
1247
|
-
|
|
1273
|
+
la,
|
|
1248
1274
|
{
|
|
1249
|
-
options:
|
|
1250
|
-
value:
|
|
1275
|
+
options: p || [],
|
|
1276
|
+
value: U,
|
|
1251
1277
|
formData: o,
|
|
1252
1278
|
dependencyKey: Y,
|
|
1253
|
-
onChange: (
|
|
1254
|
-
placeholder:
|
|
1255
|
-
className:
|
|
1256
|
-
search:
|
|
1279
|
+
onChange: (O) => l(i, O),
|
|
1280
|
+
placeholder: K,
|
|
1281
|
+
className: d || "",
|
|
1282
|
+
search: f,
|
|
1257
1283
|
required: v,
|
|
1258
|
-
defaultValue:
|
|
1259
|
-
label:
|
|
1284
|
+
defaultValue: E,
|
|
1285
|
+
label: s,
|
|
1260
1286
|
name: i,
|
|
1261
|
-
disabled:
|
|
1262
|
-
parentClass:
|
|
1263
|
-
multiple:
|
|
1264
|
-
dropdownMaxHeight:
|
|
1287
|
+
disabled: F,
|
|
1288
|
+
parentClass: x,
|
|
1289
|
+
multiple: P,
|
|
1290
|
+
dropdownMaxHeight: M
|
|
1265
1291
|
}
|
|
1266
1292
|
);
|
|
1267
1293
|
case "checkbox":
|
|
1268
1294
|
return /* @__PURE__ */ e(
|
|
1269
|
-
|
|
1295
|
+
ca,
|
|
1270
1296
|
{
|
|
1271
1297
|
name: i,
|
|
1272
|
-
label:
|
|
1273
|
-
options:
|
|
1274
|
-
value:
|
|
1275
|
-
onChange: (
|
|
1298
|
+
label: s,
|
|
1299
|
+
options: p || [],
|
|
1300
|
+
value: U,
|
|
1301
|
+
onChange: (O) => l(i, O),
|
|
1276
1302
|
required: v,
|
|
1277
|
-
parentClass:
|
|
1278
|
-
className:
|
|
1279
|
-
multiSelect:
|
|
1280
|
-
disabled:
|
|
1303
|
+
parentClass: x,
|
|
1304
|
+
className: d || "",
|
|
1305
|
+
multiSelect: P,
|
|
1306
|
+
disabled: F
|
|
1281
1307
|
}
|
|
1282
1308
|
);
|
|
1283
1309
|
case "switch":
|
|
1284
1310
|
return /* @__PURE__ */ e(
|
|
1285
|
-
|
|
1311
|
+
oa,
|
|
1286
1312
|
{
|
|
1287
|
-
value:
|
|
1288
|
-
onChange: (
|
|
1313
|
+
value: U,
|
|
1314
|
+
onChange: (O) => l(i, O),
|
|
1289
1315
|
text: m,
|
|
1290
|
-
options:
|
|
1291
|
-
label:
|
|
1316
|
+
options: p || [],
|
|
1317
|
+
label: s,
|
|
1292
1318
|
required: v,
|
|
1293
1319
|
name: i,
|
|
1294
|
-
disabled:
|
|
1295
|
-
parentClass:
|
|
1320
|
+
disabled: F,
|
|
1321
|
+
parentClass: x
|
|
1296
1322
|
}
|
|
1297
1323
|
);
|
|
1298
1324
|
case "phone":
|
|
1299
1325
|
return /* @__PURE__ */ e(
|
|
1300
|
-
|
|
1326
|
+
ia,
|
|
1301
1327
|
{
|
|
1302
|
-
value:
|
|
1303
|
-
onChange: (
|
|
1304
|
-
countriesList:
|
|
1328
|
+
value: U,
|
|
1329
|
+
onChange: (O) => l(i, O),
|
|
1330
|
+
countriesList: N,
|
|
1305
1331
|
defaultCountry: I,
|
|
1306
1332
|
required: v,
|
|
1307
|
-
placeholder:
|
|
1308
|
-
search:
|
|
1309
|
-
label:
|
|
1333
|
+
placeholder: K,
|
|
1334
|
+
search: f,
|
|
1335
|
+
label: s,
|
|
1310
1336
|
name: i,
|
|
1311
|
-
disabled:
|
|
1312
|
-
parentClass:
|
|
1337
|
+
disabled: F,
|
|
1338
|
+
parentClass: x
|
|
1313
1339
|
}
|
|
1314
1340
|
);
|
|
1315
1341
|
case "textarea":
|
|
1316
1342
|
return /* @__PURE__ */ e(
|
|
1317
|
-
|
|
1343
|
+
Ee,
|
|
1318
1344
|
{
|
|
1319
|
-
value:
|
|
1320
|
-
onChange: (
|
|
1321
|
-
placeholder:
|
|
1322
|
-
rows:
|
|
1323
|
-
className: `${
|
|
1345
|
+
value: U,
|
|
1346
|
+
onChange: (O) => l(i, O.target.value),
|
|
1347
|
+
placeholder: K,
|
|
1348
|
+
rows: D || 3,
|
|
1349
|
+
className: `${Z} ${d || ""}`,
|
|
1324
1350
|
required: v,
|
|
1325
1351
|
name: i,
|
|
1326
|
-
label:
|
|
1327
|
-
disabled:
|
|
1328
|
-
parentClass:
|
|
1352
|
+
label: s,
|
|
1353
|
+
disabled: F,
|
|
1354
|
+
parentClass: x
|
|
1329
1355
|
}
|
|
1330
1356
|
);
|
|
1331
1357
|
case "image":
|
|
1332
1358
|
return /* @__PURE__ */ e(
|
|
1333
|
-
|
|
1359
|
+
sa,
|
|
1334
1360
|
{
|
|
1335
|
-
value:
|
|
1336
|
-
onChange: (
|
|
1361
|
+
value: U,
|
|
1362
|
+
onChange: (O) => l(i, O),
|
|
1337
1363
|
required: v,
|
|
1338
|
-
accept:
|
|
1364
|
+
accept: a || "image/*",
|
|
1339
1365
|
id: `file-${i}`,
|
|
1340
|
-
dragDrop:
|
|
1341
|
-
label:
|
|
1366
|
+
dragDrop: y,
|
|
1367
|
+
label: s,
|
|
1342
1368
|
name: i,
|
|
1343
|
-
parentClass:
|
|
1369
|
+
parentClass: x
|
|
1344
1370
|
}
|
|
1345
1371
|
);
|
|
1346
1372
|
case "audio":
|
|
1347
1373
|
return /* @__PURE__ */ e(
|
|
1348
|
-
|
|
1374
|
+
ha,
|
|
1349
1375
|
{
|
|
1350
|
-
value:
|
|
1351
|
-
onChange: (
|
|
1376
|
+
value: U,
|
|
1377
|
+
onChange: (O) => l(i, O),
|
|
1352
1378
|
required: v,
|
|
1353
|
-
accept:
|
|
1379
|
+
accept: a || "audio/*",
|
|
1354
1380
|
id: `file-${i}`,
|
|
1355
|
-
dragDrop:
|
|
1356
|
-
label:
|
|
1381
|
+
dragDrop: y,
|
|
1382
|
+
label: s,
|
|
1357
1383
|
name: i,
|
|
1358
|
-
parentClass:
|
|
1384
|
+
parentClass: x
|
|
1359
1385
|
}
|
|
1360
1386
|
);
|
|
1361
1387
|
case "tinyEditor":
|
|
1362
1388
|
return /* @__PURE__ */ e(
|
|
1363
|
-
|
|
1389
|
+
da,
|
|
1364
1390
|
{
|
|
1365
|
-
value:
|
|
1366
|
-
onChange: (
|
|
1391
|
+
value: U,
|
|
1392
|
+
onChange: (O) => l(i, O),
|
|
1367
1393
|
required: v,
|
|
1368
|
-
placeholder:
|
|
1369
|
-
label:
|
|
1370
|
-
parentClass:
|
|
1371
|
-
fontFamily:
|
|
1372
|
-
editorKey:
|
|
1373
|
-
disabled:
|
|
1394
|
+
placeholder: K,
|
|
1395
|
+
label: s,
|
|
1396
|
+
parentClass: x,
|
|
1397
|
+
fontFamily: B,
|
|
1398
|
+
editorKey: L,
|
|
1399
|
+
disabled: F
|
|
1374
1400
|
},
|
|
1375
1401
|
`editor-${i}`
|
|
1376
1402
|
);
|
|
1377
1403
|
default:
|
|
1378
1404
|
return /* @__PURE__ */ e(
|
|
1379
|
-
|
|
1405
|
+
$e,
|
|
1380
1406
|
{
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1407
|
+
field: h,
|
|
1408
|
+
type: n || "text",
|
|
1409
|
+
defaultValue: E,
|
|
1410
|
+
value: U,
|
|
1411
|
+
onChange: (O) => l(i, O.target.value),
|
|
1412
|
+
placeholder: K,
|
|
1413
|
+
className: `${Z} ${d || ""}`,
|
|
1387
1414
|
required: v,
|
|
1388
1415
|
name: i,
|
|
1389
|
-
minLength:
|
|
1390
|
-
label:
|
|
1391
|
-
negativeNumberAllow:
|
|
1392
|
-
parentClass:
|
|
1393
|
-
disabled:
|
|
1416
|
+
minLength: u,
|
|
1417
|
+
label: s,
|
|
1418
|
+
negativeNumberAllow: C,
|
|
1419
|
+
parentClass: x,
|
|
1420
|
+
disabled: F,
|
|
1421
|
+
pattern: W
|
|
1394
1422
|
}
|
|
1395
1423
|
);
|
|
1396
1424
|
}
|
|
1397
|
-
},
|
|
1398
|
-
var
|
|
1399
|
-
const [
|
|
1400
|
-
|
|
1401
|
-
}, M = () => {
|
|
1402
|
-
i == null || i(d), o();
|
|
1425
|
+
}, ua = ({ isOpen: h, onClose: o, config: l, onApply: i }) => {
|
|
1426
|
+
var d;
|
|
1427
|
+
const [s, n] = R({}), p = (f, a) => {
|
|
1428
|
+
n((m) => ({ ...m, [f]: a }));
|
|
1403
1429
|
}, S = () => {
|
|
1404
|
-
|
|
1430
|
+
i == null || i(s), o();
|
|
1431
|
+
}, D = () => {
|
|
1432
|
+
n({}), i == null || i({}), o();
|
|
1405
1433
|
};
|
|
1406
|
-
return /* @__PURE__ */
|
|
1434
|
+
return /* @__PURE__ */ c($, { children: [
|
|
1407
1435
|
/* @__PURE__ */ e(
|
|
1408
1436
|
"div",
|
|
1409
1437
|
{
|
|
1410
|
-
className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${
|
|
1438
|
+
className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${h ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
|
|
1411
1439
|
onClick: o
|
|
1412
1440
|
}
|
|
1413
1441
|
),
|
|
1414
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ c(
|
|
1415
1443
|
"div",
|
|
1416
1444
|
{
|
|
1417
1445
|
className: `fixed top-0 right-0 h-full w-[28rem] bg-white dark:bg-gray-900 shadow-2xl z-50 flex flex-col border-l border-gray-200 dark:border-gray-700
|
|
1418
1446
|
transform transition-transform duration-300 ease-in-out
|
|
1419
|
-
${
|
|
1447
|
+
${h ? "translate-x-0" : "translate-x-full"}
|
|
1420
1448
|
`,
|
|
1421
1449
|
children: [
|
|
1422
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
|
|
1423
1451
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Filters" }),
|
|
1424
1452
|
/* @__PURE__ */ e(
|
|
1425
1453
|
"button",
|
|
1426
1454
|
{
|
|
1427
1455
|
onClick: o,
|
|
1428
1456
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
|
|
1429
|
-
children: /* @__PURE__ */ e(
|
|
1457
|
+
children: /* @__PURE__ */ e(Se, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
|
|
1430
1458
|
}
|
|
1431
1459
|
)
|
|
1432
1460
|
] }),
|
|
1433
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children:
|
|
1434
|
-
|
|
1461
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: l != null && l.component ? /* @__PURE__ */ e(l.component, { filters: s, onFilterChange: p }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (d = l == null ? void 0 : l.fields) == null ? void 0 : d.map((f) => /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
1462
|
+
Ge,
|
|
1435
1463
|
{
|
|
1436
|
-
field:
|
|
1437
|
-
formData:
|
|
1438
|
-
handleChange:
|
|
1464
|
+
field: f,
|
|
1465
|
+
formData: s,
|
|
1466
|
+
handleChange: p
|
|
1439
1467
|
},
|
|
1440
|
-
|
|
1468
|
+
f.key
|
|
1441
1469
|
) })) }) }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1470
|
+
/* @__PURE__ */ c("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
|
|
1443
1471
|
/* @__PURE__ */ e(
|
|
1444
|
-
|
|
1472
|
+
Q,
|
|
1445
1473
|
{
|
|
1446
|
-
onClick:
|
|
1474
|
+
onClick: S,
|
|
1447
1475
|
variant: "contained",
|
|
1448
1476
|
color: "primary",
|
|
1449
1477
|
fullWidth: !0,
|
|
@@ -1451,9 +1479,9 @@ const ia = ({
|
|
|
1451
1479
|
}
|
|
1452
1480
|
),
|
|
1453
1481
|
/* @__PURE__ */ e(
|
|
1454
|
-
|
|
1482
|
+
Q,
|
|
1455
1483
|
{
|
|
1456
|
-
onClick:
|
|
1484
|
+
onClick: D,
|
|
1457
1485
|
variant: "contained",
|
|
1458
1486
|
className: "min-w-[150px]",
|
|
1459
1487
|
children: "Reset"
|
|
@@ -1464,7 +1492,7 @@ const ia = ({
|
|
|
1464
1492
|
}
|
|
1465
1493
|
)
|
|
1466
1494
|
] });
|
|
1467
|
-
},
|
|
1495
|
+
}, Fe = {
|
|
1468
1496
|
blue: {
|
|
1469
1497
|
bg: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
1470
1498
|
border: "border border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300"
|
|
@@ -1497,71 +1525,71 @@ const ia = ({
|
|
|
1497
1525
|
contained: "bg",
|
|
1498
1526
|
outline: "border !bg-transparent",
|
|
1499
1527
|
soft: "bg opacity-90"
|
|
1500
|
-
},
|
|
1501
|
-
label:
|
|
1528
|
+
}, Ke = ({
|
|
1529
|
+
label: h,
|
|
1502
1530
|
variant: o = "contained",
|
|
1503
1531
|
// contained | outline | soft
|
|
1504
|
-
color:
|
|
1532
|
+
color: l = "green",
|
|
1505
1533
|
className: i = ""
|
|
1506
1534
|
}) => {
|
|
1507
|
-
const
|
|
1535
|
+
const s = Fe[l] || Fe.green, n = Pe[o] || Pe.contained, p = o === "outline" ? s.border : s.bg;
|
|
1508
1536
|
return /* @__PURE__ */ e(
|
|
1509
1537
|
"span",
|
|
1510
1538
|
{
|
|
1511
1539
|
className: `inline-flex justify-center items-center rounded-sm text-xs font-semibold px-3 py-1 min-w-[78px]
|
|
1512
|
-
${
|
|
1513
|
-
${
|
|
1540
|
+
${p}
|
|
1541
|
+
${n}
|
|
1514
1542
|
${i}`,
|
|
1515
|
-
children:
|
|
1543
|
+
children: h
|
|
1516
1544
|
}
|
|
1517
1545
|
);
|
|
1518
|
-
},
|
|
1546
|
+
}, pa = ({ rows: h = 5, columns: o = 5 }) => /* @__PURE__ */ c($, { children: [
|
|
1519
1547
|
/* @__PURE__ */ e("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
|
|
1520
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((
|
|
1522
|
-
/* @__PURE__ */ e("tbody", { children: Array.from({ length:
|
|
1548
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse", children: [
|
|
1549
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((l, i) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, i)) }) }),
|
|
1550
|
+
/* @__PURE__ */ e("tbody", { children: Array.from({ length: h }).map((l, i) => /* @__PURE__ */ e(
|
|
1523
1551
|
"tr",
|
|
1524
1552
|
{
|
|
1525
1553
|
className: "border-t border-gray-200 dark:border-gray-800",
|
|
1526
|
-
children: Array.from({ length: o }).map((
|
|
1554
|
+
children: Array.from({ length: o }).map((s, n) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, n))
|
|
1527
1555
|
},
|
|
1528
1556
|
i
|
|
1529
1557
|
)) })
|
|
1530
1558
|
] }) })
|
|
1531
|
-
] }), _e = ({ src:
|
|
1532
|
-
const
|
|
1533
|
-
return
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1559
|
+
] }), _e = ({ src: h, alt: o = "preview", isOpen: l, setIsOpen: i }) => {
|
|
1560
|
+
const s = () => i(!1);
|
|
1561
|
+
return z(() => {
|
|
1562
|
+
const n = (p) => {
|
|
1563
|
+
p.key === "Escape" && s();
|
|
1536
1564
|
};
|
|
1537
|
-
return
|
|
1538
|
-
document.body.style.overflow = "", document.removeEventListener("keydown",
|
|
1565
|
+
return l && (document.body.style.overflow = "hidden", document.addEventListener("keydown", n)), () => {
|
|
1566
|
+
document.body.style.overflow = "", document.removeEventListener("keydown", n);
|
|
1539
1567
|
};
|
|
1540
|
-
}, [
|
|
1568
|
+
}, [l]), /* @__PURE__ */ e($, { children: /* @__PURE__ */ c(
|
|
1541
1569
|
"div",
|
|
1542
1570
|
{
|
|
1543
1571
|
className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
|
|
1544
1572
|
backdrop-blur-sm animate-in fade-in duration-200`,
|
|
1545
|
-
onClick:
|
|
1573
|
+
onClick: s,
|
|
1546
1574
|
children: [
|
|
1547
1575
|
/* @__PURE__ */ e(
|
|
1548
1576
|
"button",
|
|
1549
1577
|
{
|
|
1550
|
-
onClick:
|
|
1578
|
+
onClick: s,
|
|
1551
1579
|
className: `absolute top-4 right-4 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200\r
|
|
1552
1580
|
hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full p-2 shadow-lg transition`,
|
|
1553
|
-
children: /* @__PURE__ */ e(
|
|
1581
|
+
children: /* @__PURE__ */ e(Se, { size: 20 })
|
|
1554
1582
|
}
|
|
1555
1583
|
),
|
|
1556
1584
|
/* @__PURE__ */ e(
|
|
1557
1585
|
"div",
|
|
1558
1586
|
{
|
|
1559
1587
|
className: "max-w-5xl w-full px-4 transform transition-all duration-200 scale-95 animate-in zoom-in-95",
|
|
1560
|
-
onClick: (
|
|
1588
|
+
onClick: (n) => n.stopPropagation(),
|
|
1561
1589
|
children: /* @__PURE__ */ e(
|
|
1562
1590
|
"img",
|
|
1563
1591
|
{
|
|
1564
|
-
src:
|
|
1592
|
+
src: h,
|
|
1565
1593
|
alt: o,
|
|
1566
1594
|
className: "w-full max-h-[90vh] object-contain rounded-xl"
|
|
1567
1595
|
}
|
|
@@ -1571,405 +1599,424 @@ const ia = ({
|
|
|
1571
1599
|
]
|
|
1572
1600
|
}
|
|
1573
1601
|
) });
|
|
1574
|
-
},
|
|
1602
|
+
}, ba = ({
|
|
1603
|
+
config: h,
|
|
1604
|
+
setShowAdd: o,
|
|
1605
|
+
title: l,
|
|
1606
|
+
buttonText: i,
|
|
1607
|
+
description: s,
|
|
1608
|
+
showAddButton: n
|
|
1609
|
+
}) => {
|
|
1575
1610
|
const {
|
|
1576
|
-
data:
|
|
1577
|
-
table_head:
|
|
1578
|
-
loading:
|
|
1579
|
-
search:
|
|
1611
|
+
data: p = [],
|
|
1612
|
+
table_head: S = [],
|
|
1613
|
+
loading: D = !1,
|
|
1614
|
+
search: d = {
|
|
1580
1615
|
enabled: !1,
|
|
1581
1616
|
placeholder: "Search...",
|
|
1582
1617
|
useServerSideSearch: !1
|
|
1583
1618
|
},
|
|
1584
|
-
filter:
|
|
1619
|
+
filter: f = {
|
|
1585
1620
|
enabled: !1,
|
|
1586
1621
|
useServerSideFilters: !1
|
|
1587
1622
|
},
|
|
1588
|
-
pagination:
|
|
1623
|
+
pagination: a = {
|
|
1589
1624
|
enabled: !1,
|
|
1590
1625
|
rows_per_page: 10,
|
|
1591
1626
|
useServerSidePagination: !1
|
|
1592
1627
|
},
|
|
1593
|
-
emptyMessage:
|
|
1594
|
-
onMenuAction:
|
|
1595
|
-
setServerSidePaginationData:
|
|
1628
|
+
emptyMessage: m = "No data available",
|
|
1629
|
+
onMenuAction: v,
|
|
1630
|
+
setServerSidePaginationData: u = () => {
|
|
1596
1631
|
},
|
|
1597
|
-
onFilterApply:
|
|
1598
|
-
filterConfig:
|
|
1599
|
-
rowClick:
|
|
1600
|
-
} =
|
|
1601
|
-
if (
|
|
1602
|
-
const
|
|
1603
|
-
return
|
|
1604
|
-
}, [
|
|
1605
|
-
|
|
1632
|
+
onFilterApply: y,
|
|
1633
|
+
filterConfig: x = null,
|
|
1634
|
+
rowClick: N = null
|
|
1635
|
+
} = h, [I, P] = R(""), [M, L] = R(null), [B, F] = R([]), [C, E] = R({}), [G, Y] = R(!1), [W, U] = R(null), [K, Z] = R(!1), O = Le(() => !d.enabled || !I.trim() || d.useServerSideSearch ? p : na(p, I, d.searchKeys || []), [p, I, d]), [_, k] = R(1), [j, X] = R((a == null ? void 0 : a.rows_per_page) || 50), [J, ee] = R(O.length || 0), ne = a != null && a.useServerSidePagination ? a.total_pages : Math.ceil(O.length / j), ce = Le(() => {
|
|
1636
|
+
if (a.useServerSidePagination) return O;
|
|
1637
|
+
const t = (_ - 1) * j;
|
|
1638
|
+
return O.slice(t, t + j);
|
|
1639
|
+
}, [O, _, j]), le = ae(null), oe = ae({}), te = ae(null), he = (t) => {
|
|
1640
|
+
P(t), k(1), d.useServerSideSearch && (te.current && clearTimeout(te.current), te.current = setTimeout(async () => {
|
|
1606
1641
|
try {
|
|
1607
|
-
await
|
|
1608
|
-
...
|
|
1609
|
-
search:
|
|
1642
|
+
await u((g) => ({
|
|
1643
|
+
...g,
|
|
1644
|
+
search: t,
|
|
1610
1645
|
current_page: 1
|
|
1611
1646
|
}));
|
|
1612
|
-
} catch (
|
|
1613
|
-
console.error("Search error:",
|
|
1647
|
+
} catch (g) {
|
|
1648
|
+
console.error("Search error:", g);
|
|
1614
1649
|
}
|
|
1615
1650
|
}, 800));
|
|
1616
|
-
},
|
|
1617
|
-
|
|
1618
|
-
},
|
|
1619
|
-
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
top: Math.max(8, Math.min(
|
|
1625
|
-
left: Math.max(8, Math.min(
|
|
1626
|
-
}),
|
|
1627
|
-
},
|
|
1628
|
-
|
|
1629
|
-
},
|
|
1651
|
+
}, ue = (t, g, T) => {
|
|
1652
|
+
T.stopPropagation(), L(null), v == null || v(t.type, g);
|
|
1653
|
+
}, pe = (t, g, T) => {
|
|
1654
|
+
g.stopPropagation(), F(T);
|
|
1655
|
+
const b = g.currentTarget;
|
|
1656
|
+
oe.current[t] = b;
|
|
1657
|
+
const w = b.getBoundingClientRect(), A = 192, V = T.length * 40, H = window.innerWidth, Te = window.innerHeight, He = H - w.right < A ? w.left - A + w.width : w.left, Ye = Te - w.bottom < V && w.top > V ? w.top - V - 2 : w.bottom + 2;
|
|
1658
|
+
E({
|
|
1659
|
+
top: Math.max(8, Math.min(Ye, Te - V - 8)),
|
|
1660
|
+
left: Math.max(8, Math.min(He, H - A - 8))
|
|
1661
|
+
}), L(M === t ? null : t);
|
|
1662
|
+
}, be = (t) => (_ - 1) * j + t + 1, ge = (t) => {
|
|
1663
|
+
t && t.src instanceof File && (t = { ...t, src: URL.createObjectURL(t.src) }), U(t), Z(!0);
|
|
1664
|
+
}, ie = (t, g, T, b = null, w = null) => /* @__PURE__ */ e($, { children: t ? /* @__PURE__ */ e(
|
|
1630
1665
|
"img",
|
|
1631
1666
|
{
|
|
1632
|
-
src:
|
|
1633
|
-
alt:
|
|
1634
|
-
onClick: (
|
|
1635
|
-
|
|
1667
|
+
src: t instanceof File ? URL.createObjectURL(t) : t,
|
|
1668
|
+
alt: g || "Avatar",
|
|
1669
|
+
onClick: (A) => {
|
|
1670
|
+
A.stopPropagation(), A.preventDefault(), ge({ src: t, alt: g });
|
|
1636
1671
|
},
|
|
1637
|
-
className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${
|
|
1672
|
+
className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${T || ""}`
|
|
1638
1673
|
}
|
|
1639
|
-
) : /* @__PURE__ */ e(
|
|
1674
|
+
) : /* @__PURE__ */ e($, { children: b ? typeof b == "function" ? b(w) : b : /* @__PURE__ */ e(
|
|
1640
1675
|
"div",
|
|
1641
1676
|
{
|
|
1642
|
-
className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${
|
|
1643
|
-
children: /* @__PURE__ */ e(
|
|
1677
|
+
className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${T || ""}`,
|
|
1678
|
+
children: /* @__PURE__ */ e(Ue, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
|
|
1644
1679
|
}
|
|
1645
|
-
) }) }),
|
|
1680
|
+
) }) }), me = (t, g) => /* @__PURE__ */ e($, { children: t ? /* @__PURE__ */ e(
|
|
1646
1681
|
"audio",
|
|
1647
1682
|
{
|
|
1648
1683
|
controls: !0,
|
|
1649
|
-
src:
|
|
1650
|
-
onClick: (
|
|
1651
|
-
|
|
1684
|
+
src: t instanceof File ? URL.createObjectURL(t) : t,
|
|
1685
|
+
onClick: (T) => {
|
|
1686
|
+
T.stopPropagation();
|
|
1652
1687
|
},
|
|
1653
|
-
className: `w-64 cursor-pointer ${
|
|
1688
|
+
className: `w-64 cursor-pointer ${g || ""}`
|
|
1654
1689
|
},
|
|
1655
|
-
|
|
1656
|
-
) : /* @__PURE__ */ e(
|
|
1690
|
+
t instanceof File ? URL.createObjectURL(t) : t
|
|
1691
|
+
) : /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
1657
1692
|
"div",
|
|
1658
1693
|
{
|
|
1659
|
-
className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${
|
|
1660
|
-
children: /* @__PURE__ */ e(
|
|
1694
|
+
className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${g || ""}`,
|
|
1695
|
+
children: /* @__PURE__ */ e(ea, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
|
|
1661
1696
|
}
|
|
1662
|
-
) }) }),
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1697
|
+
) }) }), fe = (t, g) => /* @__PURE__ */ c("div", { className: `flex items-center space-x-4 ${g.className || ""}`, children: [
|
|
1698
|
+
g.imageKey ? ie(
|
|
1699
|
+
t[g.imageKey],
|
|
1700
|
+
t[g.titleKey],
|
|
1701
|
+
"group-avatar",
|
|
1702
|
+
g.fallback_icon,
|
|
1703
|
+
t
|
|
1704
|
+
) : "",
|
|
1705
|
+
/* @__PURE__ */ c("div", { children: [
|
|
1706
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: t[g.titleKey] || "" }),
|
|
1707
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: t[g.subtitleKey] || "" })
|
|
1667
1708
|
] })
|
|
1668
|
-
] }),
|
|
1669
|
-
var
|
|
1670
|
-
let
|
|
1671
|
-
const
|
|
1672
|
-
let
|
|
1673
|
-
if (((
|
|
1674
|
-
let
|
|
1675
|
-
|
|
1709
|
+
] }), ye = (t, g) => {
|
|
1710
|
+
var A;
|
|
1711
|
+
let T = String(t);
|
|
1712
|
+
const b = g.variant || "contained";
|
|
1713
|
+
let w = g.defaultColor;
|
|
1714
|
+
if (((A = g == null ? void 0 : g.chipOptions) == null ? void 0 : A.length) > 0) {
|
|
1715
|
+
let V = g == null ? void 0 : g.chipOptions.find((H) => H.value == t);
|
|
1716
|
+
V && (T = V.label, w = V.color);
|
|
1676
1717
|
}
|
|
1677
1718
|
return /* @__PURE__ */ e(
|
|
1678
|
-
|
|
1719
|
+
Ke,
|
|
1679
1720
|
{
|
|
1680
|
-
label:
|
|
1681
|
-
variant:
|
|
1682
|
-
color:
|
|
1683
|
-
className:
|
|
1721
|
+
label: T,
|
|
1722
|
+
variant: b,
|
|
1723
|
+
color: w,
|
|
1724
|
+
className: g.className || ""
|
|
1684
1725
|
}
|
|
1685
1726
|
);
|
|
1686
|
-
},
|
|
1687
|
-
const
|
|
1688
|
-
return
|
|
1727
|
+
}, xe = (t, g, T) => {
|
|
1728
|
+
const b = g[t.key];
|
|
1729
|
+
return t.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${t.className || ""}`, children: /* @__PURE__ */ e(
|
|
1689
1730
|
"button",
|
|
1690
1731
|
{
|
|
1691
|
-
ref: (
|
|
1692
|
-
onClick: (
|
|
1732
|
+
ref: (w) => oe.current[g.id || g._id] = w,
|
|
1733
|
+
onClick: (w) => pe(g.id || g._id, w, t.menuList),
|
|
1693
1734
|
className: "p-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-full transition text-gray-700 dark:text-gray-300",
|
|
1694
|
-
children: /* @__PURE__ */ e(
|
|
1735
|
+
children: /* @__PURE__ */ e(Xe, { className: "h-4 w-4" })
|
|
1695
1736
|
}
|
|
1696
|
-
) }) :
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1737
|
+
) }) : t.type === "index" ? /* @__PURE__ */ e("span", { className: t.className || "", children: be(T) }) : t.type === "group" ? fe(g, t) : t.type === "chip" ? /* @__PURE__ */ e($, { children: ye(b, t) }) : t.type === "date" ? /* @__PURE__ */ e("span", { className: t.className || "", children: je(b, t.format || "DD MMM YYYY") }) : t.type === "avatar" ? /* @__PURE__ */ e($, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ie(
|
|
1738
|
+
b,
|
|
1739
|
+
t.alt,
|
|
1740
|
+
t.className,
|
|
1741
|
+
t.fallback_icon,
|
|
1742
|
+
g
|
|
1743
|
+
) }) }) : t.type === "audio" ? /* @__PURE__ */ e($, { children: me(b, t.className) }) : /* @__PURE__ */ e("span", { className: t.className || "", children: b || "N/A" });
|
|
1744
|
+
}, ve = (t) => {
|
|
1745
|
+
if (typeof N == "function")
|
|
1746
|
+
return N(t);
|
|
1747
|
+
if (N)
|
|
1748
|
+
return v == null ? void 0 : v("view", t);
|
|
1749
|
+
}, we = (t, g) => {
|
|
1750
|
+
if (t.onClickDetails)
|
|
1751
|
+
return v == null ? void 0 : v("view", g);
|
|
1752
|
+
if (typeof t.handleClick == "function")
|
|
1753
|
+
return t.handleClick(g);
|
|
1754
|
+
}, se = () => N || typeof N == "function", de = (t) => t.onClickDetails || typeof t.handleClick == "function";
|
|
1755
|
+
return z(() => {
|
|
1756
|
+
const t = () => {
|
|
1757
|
+
M && L(null);
|
|
1711
1758
|
};
|
|
1712
|
-
return window.addEventListener("scroll",
|
|
1713
|
-
window.removeEventListener("scroll",
|
|
1759
|
+
return window.addEventListener("scroll", t, !0), () => {
|
|
1760
|
+
window.removeEventListener("scroll", t, !0);
|
|
1714
1761
|
};
|
|
1715
|
-
}, [
|
|
1716
|
-
const
|
|
1717
|
-
|
|
1762
|
+
}, [M]), z(() => {
|
|
1763
|
+
const t = (g) => {
|
|
1764
|
+
le.current && !le.current.contains(g.target) && L(null);
|
|
1718
1765
|
};
|
|
1719
|
-
return document.addEventListener("click",
|
|
1720
|
-
}, []),
|
|
1721
|
-
|
|
1766
|
+
return document.addEventListener("click", t), () => document.removeEventListener("click", t);
|
|
1767
|
+
}, []), z(() => {
|
|
1768
|
+
a != null && a.rows_per_page && (a != null && a.useServerSidePagination) && X((a == null ? void 0 : a.rows_per_page) || 50), a.current_page && k(a.current_page);
|
|
1722
1769
|
}, [
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
]),
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
),
|
|
1770
|
+
a.rows_per_page,
|
|
1771
|
+
a == null ? void 0 : a.useServerSidePagination,
|
|
1772
|
+
a.current_page
|
|
1773
|
+
]), z(() => {
|
|
1774
|
+
ee(
|
|
1775
|
+
a != null && a.useServerSidePagination ? a.total_records : O.length
|
|
1776
|
+
), O.length <= j * (_ - 1) && !(a != null && a.useServerSidePagination) && k((t) => t - 1 || 1);
|
|
1730
1777
|
}, [
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
]),
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children:
|
|
1738
|
-
/* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children:
|
|
1778
|
+
O.length,
|
|
1779
|
+
a.total_records,
|
|
1780
|
+
a == null ? void 0 : a.useServerSidePagination
|
|
1781
|
+
]), D ? /* @__PURE__ */ e(pa, { rows: 6, columns: 6 }) : /* @__PURE__ */ c($, { children: [
|
|
1782
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
|
|
1783
|
+
/* @__PURE__ */ c("div", { children: [
|
|
1784
|
+
/* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: l }),
|
|
1785
|
+
/* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: s })
|
|
1739
1786
|
] }),
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
|
|
1787
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col justify-end items-end gap-2", children: [
|
|
1788
|
+
n && /* @__PURE__ */ c(
|
|
1789
|
+
Q,
|
|
1743
1790
|
{
|
|
1744
1791
|
onClick: () => o(!0),
|
|
1745
1792
|
variant: "contained",
|
|
1746
1793
|
color: "primary",
|
|
1747
1794
|
children: [
|
|
1748
|
-
/* @__PURE__ */ e(
|
|
1795
|
+
/* @__PURE__ */ e(qe, { className: "w-4 h-4 mr-2" }),
|
|
1749
1796
|
i || "Add New"
|
|
1750
1797
|
]
|
|
1751
1798
|
}
|
|
1752
1799
|
),
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
|
|
1755
|
-
/* @__PURE__ */ e(
|
|
1800
|
+
/* @__PURE__ */ c("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1801
|
+
d.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ c("div", { className: "relative min-w-[300px]", children: [
|
|
1802
|
+
/* @__PURE__ */ e(Ae, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
|
|
1756
1803
|
/* @__PURE__ */ e(
|
|
1757
1804
|
"input",
|
|
1758
1805
|
{
|
|
1759
1806
|
type: "text",
|
|
1760
|
-
placeholder:
|
|
1761
|
-
value:
|
|
1762
|
-
onChange: (
|
|
1807
|
+
placeholder: d.placeholder || "Search...",
|
|
1808
|
+
value: I,
|
|
1809
|
+
onChange: (t) => he(t.target.value),
|
|
1763
1810
|
className: "w-full h-[36px] pl-9 pr-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-300 dark:ring-blue-200 disabled:opacity-50"
|
|
1764
1811
|
}
|
|
1765
1812
|
)
|
|
1766
1813
|
] }) }),
|
|
1767
|
-
|
|
1768
|
-
/* @__PURE__ */ e(
|
|
1814
|
+
x && f.enabled && /* @__PURE__ */ c(Q, { onClick: () => Y(!0), variant: "contained", children: [
|
|
1815
|
+
/* @__PURE__ */ e(Ze, { className: "w-4 h-4 mr-2" }),
|
|
1769
1816
|
"Filters"
|
|
1770
1817
|
] })
|
|
1771
1818
|
] })
|
|
1772
1819
|
] })
|
|
1773
1820
|
] }),
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children:
|
|
1821
|
+
/* @__PURE__ */ c("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
|
|
1822
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ c("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
|
|
1823
|
+
/* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: S.map((t) => /* @__PURE__ */ e(
|
|
1777
1824
|
"th",
|
|
1778
1825
|
{
|
|
1779
|
-
className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${
|
|
1780
|
-
children:
|
|
1826
|
+
className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${t.headClass || ""}`,
|
|
1827
|
+
children: t.title
|
|
1781
1828
|
},
|
|
1782
|
-
|
|
1829
|
+
t.key
|
|
1783
1830
|
)) }) }),
|
|
1784
|
-
/* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children:
|
|
1831
|
+
/* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: ce.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1785
1832
|
"td",
|
|
1786
1833
|
{
|
|
1787
|
-
colSpan:
|
|
1834
|
+
colSpan: S.length,
|
|
1788
1835
|
className: "text-center py-10 text-gray-500 dark:text-gray-400",
|
|
1789
|
-
children:
|
|
1836
|
+
children: m
|
|
1790
1837
|
}
|
|
1791
|
-
) }) :
|
|
1838
|
+
) }) : ce.map((t, g) => /* @__PURE__ */ e(
|
|
1792
1839
|
"tr",
|
|
1793
1840
|
{
|
|
1794
|
-
className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${
|
|
1795
|
-
onClick: (
|
|
1796
|
-
|
|
1841
|
+
className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${se() ? "cursor-pointer" : ""}`,
|
|
1842
|
+
onClick: (T) => {
|
|
1843
|
+
se() && ve(t);
|
|
1797
1844
|
},
|
|
1798
|
-
children:
|
|
1845
|
+
children: S.map((T) => /* @__PURE__ */ e(
|
|
1799
1846
|
"td",
|
|
1800
1847
|
{
|
|
1801
|
-
className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${
|
|
1802
|
-
title: String(
|
|
1803
|
-
onClick: (
|
|
1804
|
-
|
|
1848
|
+
className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${T.type == "audio" ? "" : "max-w-[300px]"} truncate ${de(T) ? "cursor-pointer" : ""}`,
|
|
1849
|
+
title: String(t[T.key] ?? ""),
|
|
1850
|
+
onClick: (b) => {
|
|
1851
|
+
de(T) && (b.stopPropagation(), b.preventDefault(), we(T, t));
|
|
1805
1852
|
},
|
|
1806
|
-
children:
|
|
1853
|
+
children: T.render ? T.render(t, g) : xe(T, t, g)
|
|
1807
1854
|
},
|
|
1808
|
-
|
|
1855
|
+
T.key
|
|
1809
1856
|
))
|
|
1810
1857
|
},
|
|
1811
|
-
|
|
1858
|
+
t.id || t._id || g
|
|
1812
1859
|
)) })
|
|
1813
1860
|
] }) }),
|
|
1814
|
-
(
|
|
1815
|
-
/* @__PURE__ */
|
|
1861
|
+
(a == null ? void 0 : a.enabled) && O.length > 0 && /* @__PURE__ */ c("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
|
|
1862
|
+
/* @__PURE__ */ c("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
|
|
1816
1863
|
"Showing ",
|
|
1817
|
-
(
|
|
1864
|
+
(_ - 1) * j + 1,
|
|
1818
1865
|
" to",
|
|
1819
1866
|
" ",
|
|
1820
|
-
Math.min(
|
|
1867
|
+
Math.min(_ * j, J),
|
|
1821
1868
|
" of ",
|
|
1822
1869
|
J,
|
|
1823
1870
|
" ",
|
|
1824
1871
|
"results"
|
|
1825
1872
|
] }),
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
|
|
1874
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1828
1875
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Rows per page:" }),
|
|
1829
1876
|
/* @__PURE__ */ e(
|
|
1830
1877
|
"select",
|
|
1831
1878
|
{
|
|
1832
|
-
value:
|
|
1833
|
-
onChange: (
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
...
|
|
1879
|
+
value: j,
|
|
1880
|
+
onChange: (t) => {
|
|
1881
|
+
const g = Number(t.target.value);
|
|
1882
|
+
X(g), k(1), a.useServerSidePagination && u((T) => ({
|
|
1883
|
+
...T,
|
|
1837
1884
|
current_page: 1,
|
|
1838
|
-
rows_per_page:
|
|
1885
|
+
rows_per_page: g
|
|
1839
1886
|
}));
|
|
1840
1887
|
},
|
|
1841
1888
|
className: "border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-sm rounded-md px-2 py-1 focus:outline-none focus:ring-1 focus:ring-blue-500",
|
|
1842
|
-
children: [2, 10, 25, 50, 100].map((
|
|
1889
|
+
children: [2, 10, 25, 50, 100].map((t) => /* @__PURE__ */ e("option", { value: t, children: t }, t))
|
|
1843
1890
|
}
|
|
1844
1891
|
)
|
|
1845
1892
|
] }),
|
|
1846
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1847
1894
|
/* @__PURE__ */ e(
|
|
1848
1895
|
"button",
|
|
1849
1896
|
{
|
|
1850
1897
|
onClick: () => {
|
|
1851
|
-
if (
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1854
|
-
...
|
|
1855
|
-
current_page:
|
|
1898
|
+
if (_ > 1) {
|
|
1899
|
+
const t = _ - 1;
|
|
1900
|
+
k(t), a.useServerSidePagination && u((g) => ({
|
|
1901
|
+
...g,
|
|
1902
|
+
current_page: t
|
|
1856
1903
|
}));
|
|
1857
1904
|
}
|
|
1858
1905
|
},
|
|
1859
|
-
disabled:
|
|
1906
|
+
disabled: _ === 1,
|
|
1860
1907
|
className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
|
|
1861
|
-
children: /* @__PURE__ */ e(
|
|
1908
|
+
children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" })
|
|
1862
1909
|
}
|
|
1863
1910
|
),
|
|
1864
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
|
|
1865
1912
|
"Page ",
|
|
1866
|
-
|
|
1913
|
+
_,
|
|
1867
1914
|
" of ",
|
|
1868
|
-
|
|
1915
|
+
ne
|
|
1869
1916
|
] }),
|
|
1870
1917
|
/* @__PURE__ */ e(
|
|
1871
1918
|
"button",
|
|
1872
1919
|
{
|
|
1873
1920
|
onClick: () => {
|
|
1874
|
-
if (
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
...
|
|
1878
|
-
current_page:
|
|
1921
|
+
if (_ < ne) {
|
|
1922
|
+
const t = _ + 1;
|
|
1923
|
+
k(t), a.useServerSidePagination && u((g) => ({
|
|
1924
|
+
...g,
|
|
1925
|
+
current_page: t
|
|
1879
1926
|
}));
|
|
1880
1927
|
}
|
|
1881
1928
|
},
|
|
1882
|
-
disabled:
|
|
1929
|
+
disabled: _ === ne,
|
|
1883
1930
|
className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
|
|
1884
|
-
children: /* @__PURE__ */ e(
|
|
1931
|
+
children: /* @__PURE__ */ e(Qe, { className: "h-4 w-4" })
|
|
1885
1932
|
}
|
|
1886
1933
|
)
|
|
1887
1934
|
] })
|
|
1888
1935
|
] })
|
|
1889
1936
|
] })
|
|
1890
1937
|
] }),
|
|
1891
|
-
|
|
1938
|
+
M && aa(
|
|
1892
1939
|
/* @__PURE__ */ e(
|
|
1893
1940
|
"div",
|
|
1894
1941
|
{
|
|
1895
|
-
ref:
|
|
1942
|
+
ref: le,
|
|
1896
1943
|
style: {
|
|
1897
1944
|
position: "fixed",
|
|
1898
|
-
top: `${
|
|
1899
|
-
left: `${
|
|
1945
|
+
top: `${C.top}px`,
|
|
1946
|
+
left: `${C.left}px`,
|
|
1900
1947
|
zIndex: 9999
|
|
1901
1948
|
},
|
|
1902
1949
|
className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
|
|
1903
|
-
children:
|
|
1950
|
+
children: B.map((t, g) => /* @__PURE__ */ c(
|
|
1904
1951
|
"button",
|
|
1905
1952
|
{
|
|
1906
|
-
onClick: (
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
(
|
|
1953
|
+
onClick: (T) => ue(
|
|
1954
|
+
t,
|
|
1955
|
+
p.find(
|
|
1956
|
+
(b) => b.id === M || b._id == M
|
|
1910
1957
|
),
|
|
1911
|
-
|
|
1958
|
+
T
|
|
1912
1959
|
),
|
|
1913
|
-
className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${
|
|
1960
|
+
className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${t.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
|
|
1914
1961
|
children: [
|
|
1915
|
-
|
|
1916
|
-
|
|
1962
|
+
t.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: t.icon }),
|
|
1963
|
+
t.title
|
|
1917
1964
|
]
|
|
1918
1965
|
},
|
|
1919
|
-
|
|
1966
|
+
g
|
|
1920
1967
|
))
|
|
1921
1968
|
}
|
|
1922
1969
|
),
|
|
1923
1970
|
document.body
|
|
1924
1971
|
),
|
|
1925
|
-
|
|
1926
|
-
|
|
1972
|
+
x && /* @__PURE__ */ e(
|
|
1973
|
+
ua,
|
|
1927
1974
|
{
|
|
1928
|
-
isOpen:
|
|
1929
|
-
onClose: () =>
|
|
1930
|
-
config:
|
|
1931
|
-
onApply:
|
|
1975
|
+
isOpen: G,
|
|
1976
|
+
onClose: () => Y(!1),
|
|
1977
|
+
config: x,
|
|
1978
|
+
onApply: y
|
|
1932
1979
|
}
|
|
1933
1980
|
),
|
|
1934
|
-
|
|
1981
|
+
K && /* @__PURE__ */ e(
|
|
1935
1982
|
_e,
|
|
1936
1983
|
{
|
|
1937
|
-
src:
|
|
1938
|
-
alt:
|
|
1939
|
-
isOpen:
|
|
1940
|
-
setIsOpen:
|
|
1984
|
+
src: W.src,
|
|
1985
|
+
alt: W.alt,
|
|
1986
|
+
isOpen: K,
|
|
1987
|
+
setIsOpen: Z
|
|
1941
1988
|
}
|
|
1942
1989
|
)
|
|
1943
1990
|
] });
|
|
1944
|
-
},
|
|
1945
|
-
isOpen:
|
|
1991
|
+
}, Ne = ({
|
|
1992
|
+
isOpen: h,
|
|
1946
1993
|
onClose: o,
|
|
1947
|
-
icon:
|
|
1994
|
+
icon: l,
|
|
1948
1995
|
title: i,
|
|
1949
|
-
children:
|
|
1950
|
-
size:
|
|
1951
|
-
actionButtons:
|
|
1952
|
-
actions:
|
|
1953
|
-
showDefaultClose:
|
|
1954
|
-
footerConfig:
|
|
1955
|
-
hideFooter:
|
|
1956
|
-
onFormSubmit:
|
|
1996
|
+
children: s,
|
|
1997
|
+
size: n = "md",
|
|
1998
|
+
actionButtons: p = [],
|
|
1999
|
+
actions: S,
|
|
2000
|
+
showDefaultClose: D = !0,
|
|
2001
|
+
footerConfig: d = null,
|
|
2002
|
+
hideFooter: f = !1,
|
|
2003
|
+
onFormSubmit: a = () => {
|
|
1957
2004
|
},
|
|
1958
2005
|
onCancel: m,
|
|
1959
2006
|
loadingBtn: v = !1,
|
|
1960
|
-
executeFunction:
|
|
2007
|
+
executeFunction: u = () => {
|
|
1961
2008
|
},
|
|
1962
|
-
selectedItem:
|
|
2009
|
+
selectedItem: y = null
|
|
1963
2010
|
}) => {
|
|
1964
|
-
if (!
|
|
1965
|
-
const
|
|
2011
|
+
if (!h) return null;
|
|
2012
|
+
const x = {
|
|
1966
2013
|
sm: "max-w-md",
|
|
1967
2014
|
md: "max-w-lg",
|
|
1968
2015
|
lg: "max-w-2xl",
|
|
1969
2016
|
xl: "max-w-4xl",
|
|
1970
2017
|
full: "max-w-full"
|
|
1971
2018
|
};
|
|
1972
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ c("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
|
|
1973
2020
|
/* @__PURE__ */ e(
|
|
1974
2021
|
"div",
|
|
1975
2022
|
{
|
|
@@ -1977,14 +2024,14 @@ const ia = ({
|
|
|
1977
2024
|
onClick: () => o()
|
|
1978
2025
|
}
|
|
1979
2026
|
),
|
|
1980
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ c(
|
|
1981
2028
|
"div",
|
|
1982
2029
|
{
|
|
1983
|
-
className: `relative bg-white rounded-lg shadow-xl w-full ${
|
|
2030
|
+
className: `relative bg-white rounded-lg shadow-xl w-full ${x[n] || x.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
|
|
1984
2031
|
children: [
|
|
1985
|
-
/* @__PURE__ */
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
|
|
2032
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
|
|
2033
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
2034
|
+
l && /* @__PURE__ */ e("span", { children: l }),
|
|
1988
2035
|
/* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: i })
|
|
1989
2036
|
] }),
|
|
1990
2037
|
/* @__PURE__ */ e(
|
|
@@ -1992,148 +2039,148 @@ const ia = ({
|
|
|
1992
2039
|
{
|
|
1993
2040
|
onClick: () => o(),
|
|
1994
2041
|
className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
|
|
1995
|
-
children: /* @__PURE__ */ e(
|
|
2042
|
+
children: /* @__PURE__ */ e(Se, { className: "w-6 h-6" })
|
|
1996
2043
|
}
|
|
1997
2044
|
)
|
|
1998
2045
|
] }),
|
|
1999
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children:
|
|
2000
|
-
|
|
2001
|
-
|
|
2046
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: s }),
|
|
2047
|
+
p.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: p.map((N) => /* @__PURE__ */ e(
|
|
2048
|
+
Q,
|
|
2002
2049
|
{
|
|
2003
2050
|
onClick: (I) => {
|
|
2004
|
-
|
|
2051
|
+
N.type == "submit" ? a(I) : u(
|
|
2005
2052
|
() => {
|
|
2006
|
-
var
|
|
2007
|
-
return (
|
|
2053
|
+
var P;
|
|
2054
|
+
return (P = N == null ? void 0 : N.onClick) == null ? void 0 : P.call(N, I, y);
|
|
2008
2055
|
},
|
|
2009
|
-
(
|
|
2056
|
+
(P) => o == null ? void 0 : o(P)
|
|
2010
2057
|
);
|
|
2011
2058
|
},
|
|
2012
|
-
disabled: v ||
|
|
2013
|
-
variant:
|
|
2014
|
-
color:
|
|
2015
|
-
className: `min-w-[100px] ${
|
|
2016
|
-
type:
|
|
2017
|
-
children: v ? /* @__PURE__ */
|
|
2059
|
+
disabled: v || N.disabled,
|
|
2060
|
+
variant: N.variant || "contained",
|
|
2061
|
+
color: N.color || "primary",
|
|
2062
|
+
className: `min-w-[100px] ${N.className}`,
|
|
2063
|
+
type: N.type || "button",
|
|
2064
|
+
children: v ? /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
2018
2065
|
/* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-white/30 border-t-2 border-t-white mr-2" }),
|
|
2019
|
-
|
|
2066
|
+
N.label || "Submit",
|
|
2020
2067
|
"..."
|
|
2021
|
-
] }) :
|
|
2068
|
+
] }) : N.label || "Submit"
|
|
2022
2069
|
}
|
|
2023
2070
|
)) })
|
|
2024
2071
|
]
|
|
2025
2072
|
}
|
|
2026
2073
|
)
|
|
2027
2074
|
] });
|
|
2028
|
-
},
|
|
2029
|
-
const { formClass:
|
|
2030
|
-
|
|
2031
|
-
|
|
2075
|
+
}, Ie = ({ config: h, onSubmit: o, initialData: l = {}, type: i = "add" }) => {
|
|
2076
|
+
const { formClass: s = "grid grid-cols-12 gap-4", formFields: n = [] } = h || {}, [p, S] = R(l);
|
|
2077
|
+
z(() => {
|
|
2078
|
+
S(l);
|
|
2032
2079
|
}, []);
|
|
2033
|
-
const
|
|
2034
|
-
|
|
2035
|
-
},
|
|
2036
|
-
|
|
2037
|
-
const
|
|
2038
|
-
if (!
|
|
2039
|
-
|
|
2080
|
+
const D = (f, a) => {
|
|
2081
|
+
S((m) => ({ ...m, [f]: a }));
|
|
2082
|
+
}, d = (f) => {
|
|
2083
|
+
f.preventDefault();
|
|
2084
|
+
const a = f.target;
|
|
2085
|
+
if (!a.checkValidity()) {
|
|
2086
|
+
a.reportValidity();
|
|
2040
2087
|
return;
|
|
2041
2088
|
}
|
|
2042
|
-
o(
|
|
2089
|
+
o(p);
|
|
2043
2090
|
};
|
|
2044
2091
|
return /* @__PURE__ */ e(
|
|
2045
2092
|
"form",
|
|
2046
2093
|
{
|
|
2047
2094
|
id: i == "add" ? "addForm" : i == "edit" ? "editForm" : "defaultForm",
|
|
2048
|
-
onSubmit:
|
|
2049
|
-
className:
|
|
2095
|
+
onSubmit: d,
|
|
2096
|
+
className: s,
|
|
2050
2097
|
noValidate: !1,
|
|
2051
|
-
children:
|
|
2052
|
-
|
|
2098
|
+
children: n.map((f) => /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(
|
|
2099
|
+
Ge,
|
|
2053
2100
|
{
|
|
2054
|
-
field:
|
|
2055
|
-
formData:
|
|
2056
|
-
handleChange:
|
|
2101
|
+
field: f,
|
|
2102
|
+
formData: p,
|
|
2103
|
+
handleChange: D
|
|
2057
2104
|
},
|
|
2058
|
-
|
|
2105
|
+
f.key
|
|
2059
2106
|
) }))
|
|
2060
2107
|
}
|
|
2061
2108
|
);
|
|
2062
2109
|
};
|
|
2063
|
-
function
|
|
2064
|
-
const { fields:
|
|
2065
|
-
|
|
2066
|
-
},
|
|
2110
|
+
function ga({ data: h, config: o }) {
|
|
2111
|
+
const { fields: l, containerClass: i } = o, [s, n] = R(null), [p, S] = R(!1), D = (a) => {
|
|
2112
|
+
a && a.src instanceof File && (a = { ...a, src: URL.createObjectURL(a.src) }), n(a), S(!0);
|
|
2113
|
+
}, d = ({ col: a }) => {
|
|
2067
2114
|
var I;
|
|
2068
|
-
let m =
|
|
2069
|
-
if (
|
|
2070
|
-
let
|
|
2071
|
-
|
|
2115
|
+
let m = a == null ? void 0 : a.icon, v = a.label, u = h[a.key], y = a.type, x = a.variant || "outline", N = a.defaultColor;
|
|
2116
|
+
if (y === "chip" && ((I = a.chipOptions) == null ? void 0 : I.length) > 0) {
|
|
2117
|
+
let P = a == null ? void 0 : a.chipOptions.find((M) => M.value == u);
|
|
2118
|
+
P && (u = P.label, N = P.color);
|
|
2072
2119
|
}
|
|
2073
|
-
return /* @__PURE__ */
|
|
2120
|
+
return /* @__PURE__ */ c(
|
|
2074
2121
|
"div",
|
|
2075
2122
|
{
|
|
2076
2123
|
className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
|
|
2077
|
-
bg-gray-100 dark:bg-gray-900 ${
|
|
2124
|
+
bg-gray-100 dark:bg-gray-900 ${a.blockClass || ""}`,
|
|
2078
2125
|
children: [
|
|
2079
2126
|
m && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m }),
|
|
2080
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
2081
2128
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: v }),
|
|
2082
|
-
|
|
2083
|
-
|
|
2129
|
+
y === "chip" ? /* @__PURE__ */ e(
|
|
2130
|
+
Ke,
|
|
2084
2131
|
{
|
|
2085
|
-
label:
|
|
2086
|
-
variant:
|
|
2087
|
-
color:
|
|
2132
|
+
label: u,
|
|
2133
|
+
variant: x,
|
|
2134
|
+
color: N,
|
|
2088
2135
|
className: "mt-1"
|
|
2089
2136
|
}
|
|
2090
2137
|
) : (
|
|
2091
2138
|
/* TINY EDITOR */
|
|
2092
|
-
|
|
2139
|
+
y === "tinyEditor" ? /* @__PURE__ */ e(
|
|
2093
2140
|
"p",
|
|
2094
2141
|
{
|
|
2095
2142
|
className: "mt-1 text-sm text-gray-900 dark:text-white break-words",
|
|
2096
2143
|
dangerouslySetInnerHTML: {
|
|
2097
|
-
__html:
|
|
2144
|
+
__html: u
|
|
2098
2145
|
}
|
|
2099
2146
|
}
|
|
2100
|
-
) :
|
|
2147
|
+
) : y === "audio" ? u ? /* @__PURE__ */ e(
|
|
2101
2148
|
"audio",
|
|
2102
2149
|
{
|
|
2103
2150
|
controls: !0,
|
|
2104
|
-
src:
|
|
2105
|
-
onClick: (
|
|
2106
|
-
className: "shadow-md rounded-full"
|
|
2151
|
+
src: u instanceof File ? URL.createObjectURL(u) : u,
|
|
2152
|
+
onClick: (P) => P.stopPropagation(),
|
|
2153
|
+
className: "shadow-md rounded-full mt-1"
|
|
2107
2154
|
},
|
|
2108
|
-
|
|
2155
|
+
u instanceof File ? URL.createObjectURL(u) : u
|
|
2109
2156
|
) : /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-400", children: "N/A" }) : (
|
|
2110
2157
|
/* DEFAULT */
|
|
2111
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children:
|
|
2158
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: y == "date" ? /* @__PURE__ */ e("span", { children: je(u, a.format || "DD MMM YYYY") }) : u || "N/A" })
|
|
2112
2159
|
)
|
|
2113
2160
|
)
|
|
2114
2161
|
] })
|
|
2115
2162
|
]
|
|
2116
2163
|
}
|
|
2117
2164
|
);
|
|
2118
|
-
},
|
|
2119
|
-
let m =
|
|
2120
|
-
return /* @__PURE__ */
|
|
2165
|
+
}, f = ({ col: a }) => {
|
|
2166
|
+
let m = h[a.titleKey], v = h[a.subtitleKey], u = h[a.imageKey], y = a.fallback_icon;
|
|
2167
|
+
return /* @__PURE__ */ c(
|
|
2121
2168
|
"div",
|
|
2122
2169
|
{
|
|
2123
2170
|
className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
|
|
2124
2171
|
bg-gray-100 dark:bg-gray-900
|
|
2125
|
-
${
|
|
2172
|
+
${a.blockClass}`,
|
|
2126
2173
|
children: [
|
|
2127
|
-
|
|
2174
|
+
u ? /* @__PURE__ */ e(
|
|
2128
2175
|
"img",
|
|
2129
2176
|
{
|
|
2130
|
-
src:
|
|
2177
|
+
src: u instanceof File ? URL.createObjectURL(u) : u,
|
|
2131
2178
|
alt: m,
|
|
2132
|
-
onClick: () =>
|
|
2179
|
+
onClick: () => D({ src: u, alt: m }),
|
|
2133
2180
|
className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
|
|
2134
2181
|
}
|
|
2135
|
-
) :
|
|
2136
|
-
/* @__PURE__ */
|
|
2182
|
+
) : y ? y instanceof Function ? y(h) : y : /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ue, { className: "w-8 h-8 text-gray-400" }) }),
|
|
2183
|
+
/* @__PURE__ */ c("div", { children: [
|
|
2137
2184
|
/* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: m }),
|
|
2138
2185
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: v })
|
|
2139
2186
|
] })
|
|
@@ -2141,116 +2188,114 @@ function ba({ data: b, config: o }) {
|
|
|
2141
2188
|
}
|
|
2142
2189
|
);
|
|
2143
2190
|
};
|
|
2144
|
-
return /* @__PURE__ */
|
|
2145
|
-
|
|
2191
|
+
return /* @__PURE__ */ c($, { children: [
|
|
2192
|
+
p && /* @__PURE__ */ e(
|
|
2146
2193
|
_e,
|
|
2147
2194
|
{
|
|
2148
|
-
src:
|
|
2149
|
-
alt:
|
|
2150
|
-
isOpen:
|
|
2151
|
-
setIsOpen:
|
|
2195
|
+
src: s.src,
|
|
2196
|
+
alt: s.alt,
|
|
2197
|
+
isOpen: p,
|
|
2198
|
+
setIsOpen: S
|
|
2152
2199
|
}
|
|
2153
2200
|
),
|
|
2154
|
-
/* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children:
|
|
2155
|
-
(u) => u.type == "group" ? /* @__PURE__ */ e(l, { col: u }) : /* @__PURE__ */ e(p, { col: u })
|
|
2156
|
-
) })
|
|
2201
|
+
/* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: l.map((a) => a.renderCondition && typeof a.renderCondition == "function" && !a.renderCondition(h) ? null : a.type == "group" ? /* @__PURE__ */ e(f, { col: a }) : /* @__PURE__ */ e(d, { col: a })) })
|
|
2157
2202
|
] });
|
|
2158
2203
|
}
|
|
2159
|
-
const
|
|
2160
|
-
var
|
|
2204
|
+
const ze = ({ config: h }) => {
|
|
2205
|
+
var oe, te, he, ue, pe, be, ge, ie, me, fe, ye, xe, ve, we, se, de, t, g, T;
|
|
2161
2206
|
const {
|
|
2162
2207
|
title: o,
|
|
2163
|
-
fetchData:
|
|
2208
|
+
fetchData: l = async () => {
|
|
2164
2209
|
},
|
|
2165
2210
|
isStaticData: i = !1,
|
|
2166
|
-
tableConfig:
|
|
2167
|
-
modalConfig:
|
|
2168
|
-
filterConfig:
|
|
2169
|
-
} =
|
|
2211
|
+
tableConfig: s = {},
|
|
2212
|
+
modalConfig: n = {},
|
|
2213
|
+
filterConfig: p
|
|
2214
|
+
} = h, [S, D] = R(!0), [d, f] = R(!1), [a, m] = R([]), [v, u] = R(null), [y, x] = R({
|
|
2170
2215
|
search: "",
|
|
2171
2216
|
rows_per_page: 50,
|
|
2172
2217
|
current_page: 1
|
|
2173
|
-
}), [
|
|
2174
|
-
|
|
2175
|
-
},
|
|
2176
|
-
|
|
2218
|
+
}), [N, I] = R({}), [P, M] = R(!1), [L, B] = R(!1), [F, C] = R(!1), [E, G] = R(!1), [Y, W] = R(!1), [U, K] = R(null), Z = (b, w) => {
|
|
2219
|
+
b === "edit" ? (K(w), C(!0)) : b === "view" ? (K(w), W(!0)) : b === "delete" && (K(w), G(!0));
|
|
2220
|
+
}, O = async (b, w, A = "", V = "") => {
|
|
2221
|
+
f(!0);
|
|
2177
2222
|
try {
|
|
2178
|
-
const
|
|
2179
|
-
(
|
|
2223
|
+
const H = await (b == null ? void 0 : b());
|
|
2224
|
+
(A || H.message) && Me(A || H.message, {
|
|
2180
2225
|
variant: "success"
|
|
2181
|
-
}),
|
|
2182
|
-
} catch (
|
|
2183
|
-
(
|
|
2226
|
+
}), w == null || w(H);
|
|
2227
|
+
} catch (H) {
|
|
2228
|
+
(V || H.message) && Me(V || H.message, { variant: "error" });
|
|
2184
2229
|
} finally {
|
|
2185
|
-
|
|
2230
|
+
f(!1);
|
|
2186
2231
|
}
|
|
2187
|
-
},
|
|
2188
|
-
let
|
|
2189
|
-
i ? (m((
|
|
2190
|
-
...
|
|
2232
|
+
}, _ = (b) => {
|
|
2233
|
+
let w = b.newObject;
|
|
2234
|
+
i ? (m((A) => [w, ...A]), u((A) => ({
|
|
2235
|
+
...A,
|
|
2191
2236
|
current_page: 1
|
|
2192
|
-
}))) : (
|
|
2193
|
-
...
|
|
2237
|
+
}))) : (x((A) => ({
|
|
2238
|
+
...A,
|
|
2194
2239
|
current_page: 1
|
|
2195
|
-
})),
|
|
2196
|
-
},
|
|
2197
|
-
let
|
|
2240
|
+
})), y.current_page == 1 && ee()), B(!1);
|
|
2241
|
+
}, k = (b) => {
|
|
2242
|
+
let w = b.newObject, A = b.targetObject;
|
|
2198
2243
|
i ? m(
|
|
2199
|
-
(
|
|
2200
|
-
(
|
|
2244
|
+
(V) => V.map(
|
|
2245
|
+
(H) => H.id === A.id ? { ...H, ...w } : H
|
|
2201
2246
|
)
|
|
2202
|
-
) :
|
|
2203
|
-
},
|
|
2204
|
-
if (!
|
|
2205
|
-
|
|
2247
|
+
) : ee(), C(!1);
|
|
2248
|
+
}, j = (b) => {
|
|
2249
|
+
if (!b) {
|
|
2250
|
+
G(!1), K(null);
|
|
2206
2251
|
return;
|
|
2207
2252
|
}
|
|
2208
2253
|
i ? m(
|
|
2209
|
-
(
|
|
2210
|
-
) :
|
|
2211
|
-
...
|
|
2212
|
-
current_page:
|
|
2213
|
-
})) :
|
|
2214
|
-
},
|
|
2254
|
+
(w) => w.filter((A) => A.id !== b.targetObject.id)
|
|
2255
|
+
) : a.length == 1 && y.current_page > 1 ? x((w) => ({
|
|
2256
|
+
...w,
|
|
2257
|
+
current_page: w.current_page - 1
|
|
2258
|
+
})) : ee(), G(!1), K(null);
|
|
2259
|
+
}, X = (b) => O(
|
|
2215
2260
|
() => {
|
|
2216
|
-
var
|
|
2217
|
-
return (
|
|
2261
|
+
var w, A;
|
|
2262
|
+
return (A = (w = n == null ? void 0 : n.addModal) == null ? void 0 : w.handleSubmit) == null ? void 0 : A.call(w, b);
|
|
2218
2263
|
},
|
|
2219
|
-
|
|
2220
|
-
),
|
|
2264
|
+
_
|
|
2265
|
+
), J = (b) => O(
|
|
2221
2266
|
() => {
|
|
2222
|
-
var
|
|
2223
|
-
return (
|
|
2267
|
+
var w, A;
|
|
2268
|
+
return (A = (w = n == null ? void 0 : n.editModal) == null ? void 0 : w.handleSubmit) == null ? void 0 : A.call(w, b, U);
|
|
2224
2269
|
},
|
|
2225
|
-
|
|
2226
|
-
),
|
|
2227
|
-
|
|
2228
|
-
m(
|
|
2229
|
-
}).catch((
|
|
2230
|
-
|
|
2270
|
+
k
|
|
2271
|
+
), ee = async () => {
|
|
2272
|
+
D(!0), l == null || l({ ...y, ...N }).then((b) => {
|
|
2273
|
+
m(b.data), u(b.pagination);
|
|
2274
|
+
}).catch((b) => {
|
|
2275
|
+
Me(b.message, { variant: "error" });
|
|
2231
2276
|
}).finally(() => {
|
|
2232
|
-
|
|
2277
|
+
D(!1);
|
|
2233
2278
|
});
|
|
2234
|
-
},
|
|
2235
|
-
var
|
|
2236
|
-
I((
|
|
2237
|
-
...
|
|
2238
|
-
})), (
|
|
2239
|
-
},
|
|
2240
|
-
(
|
|
2241
|
-
),
|
|
2242
|
-
var
|
|
2243
|
-
return (
|
|
2244
|
-
}, [
|
|
2245
|
-
return
|
|
2246
|
-
|
|
2279
|
+
}, ne = (b) => {
|
|
2280
|
+
var w;
|
|
2281
|
+
I((A) => ({
|
|
2282
|
+
...b
|
|
2283
|
+
})), (w = s == null ? void 0 : s.filter) != null && w.useServerSideFilters && M((A) => !A);
|
|
2284
|
+
}, ce = (b, w) => b.filter(
|
|
2285
|
+
(A) => Object.entries(w).every(([V, H]) => A[V] === H)
|
|
2286
|
+
), le = Le(() => {
|
|
2287
|
+
var b;
|
|
2288
|
+
return (b = s == null ? void 0 : s.filter) != null && b.useServerSideFilters ? a : ce(a, N);
|
|
2289
|
+
}, [a, N]);
|
|
2290
|
+
return z(() => {
|
|
2291
|
+
ee();
|
|
2247
2292
|
}, [
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2293
|
+
y.search,
|
|
2294
|
+
y.rows_per_page,
|
|
2295
|
+
y.current_page,
|
|
2296
|
+
P
|
|
2252
2297
|
]), /* @__PURE__ */ e(
|
|
2253
|
-
|
|
2298
|
+
ra,
|
|
2254
2299
|
{
|
|
2255
2300
|
maxSnack: 3,
|
|
2256
2301
|
anchorOrigin: {
|
|
@@ -2258,133 +2303,134 @@ const Ke = ({ config: b }) => {
|
|
|
2258
2303
|
horizontal: "right"
|
|
2259
2304
|
},
|
|
2260
2305
|
autoHideDuration: 3e3,
|
|
2261
|
-
action: (
|
|
2306
|
+
action: (b) => /* @__PURE__ */ e(
|
|
2262
2307
|
"button",
|
|
2263
2308
|
{
|
|
2264
2309
|
onClick: () => {
|
|
2265
2310
|
window.dispatchEvent(
|
|
2266
|
-
new CustomEvent("closeSnackbar", { detail:
|
|
2311
|
+
new CustomEvent("closeSnackbar", { detail: b })
|
|
2267
2312
|
);
|
|
2268
2313
|
},
|
|
2269
2314
|
className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
|
|
2270
|
-
children: /* @__PURE__ */ e(
|
|
2315
|
+
children: /* @__PURE__ */ e(Se, { className: "h-4 w-4" })
|
|
2271
2316
|
}
|
|
2272
2317
|
),
|
|
2273
|
-
children: /* @__PURE__ */
|
|
2318
|
+
children: /* @__PURE__ */ c("div", { children: [
|
|
2274
2319
|
/* @__PURE__ */ e(
|
|
2275
|
-
|
|
2320
|
+
ba,
|
|
2276
2321
|
{
|
|
2277
2322
|
title: o,
|
|
2278
|
-
setShowAdd:
|
|
2279
|
-
description:
|
|
2280
|
-
buttonText:
|
|
2323
|
+
setShowAdd: B,
|
|
2324
|
+
description: h.description,
|
|
2325
|
+
buttonText: h.buttonText,
|
|
2326
|
+
showAddButton: !!n.addModal,
|
|
2281
2327
|
config: {
|
|
2282
|
-
...
|
|
2328
|
+
...s,
|
|
2283
2329
|
pagination: {
|
|
2284
|
-
...
|
|
2330
|
+
...s.pagination,
|
|
2285
2331
|
...v
|
|
2286
2332
|
},
|
|
2287
|
-
data:
|
|
2288
|
-
setServerSidePaginationData:
|
|
2289
|
-
onMenuAction:
|
|
2290
|
-
filterConfig:
|
|
2291
|
-
onFilterApply:
|
|
2292
|
-
loading:
|
|
2333
|
+
data: le,
|
|
2334
|
+
setServerSidePaginationData: x,
|
|
2335
|
+
onMenuAction: Z,
|
|
2336
|
+
filterConfig: p,
|
|
2337
|
+
onFilterApply: ne,
|
|
2338
|
+
loading: S
|
|
2293
2339
|
}
|
|
2294
2340
|
}
|
|
2295
2341
|
),
|
|
2296
2342
|
/* @__PURE__ */ e(
|
|
2297
|
-
|
|
2343
|
+
Ne,
|
|
2298
2344
|
{
|
|
2299
|
-
isOpen:
|
|
2345
|
+
isOpen: L,
|
|
2300
2346
|
onClose: () => {
|
|
2301
|
-
|
|
2347
|
+
d || B(!1);
|
|
2302
2348
|
},
|
|
2303
|
-
icon: (
|
|
2304
|
-
title: ((
|
|
2305
|
-
size: ((
|
|
2349
|
+
icon: (oe = n.addModal) == null ? void 0 : oe.icon,
|
|
2350
|
+
title: ((te = n.addModal) == null ? void 0 : te.title) || "Add New",
|
|
2351
|
+
size: ((he = n.addModal) == null ? void 0 : he.size) || "md",
|
|
2306
2352
|
onFormSubmit: () => {
|
|
2307
|
-
var
|
|
2308
|
-
return (
|
|
2353
|
+
var b;
|
|
2354
|
+
return (b = document.querySelector("#addForm")) == null ? void 0 : b.requestSubmit();
|
|
2309
2355
|
},
|
|
2310
|
-
loadingBtn:
|
|
2311
|
-
actionButtons:
|
|
2356
|
+
loadingBtn: d,
|
|
2357
|
+
actionButtons: ((ue = n == null ? void 0 : n.addModal) == null ? void 0 : ue.actionButtons) || [],
|
|
2312
2358
|
children: /* @__PURE__ */ e(
|
|
2313
|
-
|
|
2359
|
+
Ie,
|
|
2314
2360
|
{
|
|
2315
|
-
config: (
|
|
2316
|
-
onSubmit:
|
|
2361
|
+
config: (n == null ? void 0 : n.addModal) || {},
|
|
2362
|
+
onSubmit: X,
|
|
2317
2363
|
initialData: {},
|
|
2318
2364
|
type: "add",
|
|
2319
|
-
loading:
|
|
2365
|
+
loading: d
|
|
2320
2366
|
}
|
|
2321
2367
|
)
|
|
2322
2368
|
}
|
|
2323
2369
|
),
|
|
2324
2370
|
/* @__PURE__ */ e(
|
|
2325
|
-
|
|
2371
|
+
Ne,
|
|
2326
2372
|
{
|
|
2327
|
-
isOpen:
|
|
2373
|
+
isOpen: F,
|
|
2328
2374
|
onClose: () => {
|
|
2329
|
-
|
|
2375
|
+
d || C(!1);
|
|
2330
2376
|
},
|
|
2331
|
-
icon: (
|
|
2332
|
-
title: ((
|
|
2333
|
-
size: ((
|
|
2377
|
+
icon: (pe = n.editModal) == null ? void 0 : pe.icon,
|
|
2378
|
+
title: ((be = n.editModal) == null ? void 0 : be.title) || "Edit",
|
|
2379
|
+
size: ((ge = n.editModal) == null ? void 0 : ge.size) || "md",
|
|
2334
2380
|
onFormSubmit: () => {
|
|
2335
|
-
var
|
|
2336
|
-
return (
|
|
2381
|
+
var b;
|
|
2382
|
+
return (b = document.querySelector("#editForm")) == null ? void 0 : b.requestSubmit();
|
|
2337
2383
|
},
|
|
2338
|
-
actionButtons:
|
|
2339
|
-
loadingBtn:
|
|
2384
|
+
actionButtons: ((ie = n == null ? void 0 : n.editModal) == null ? void 0 : ie.actionButtons) || [],
|
|
2385
|
+
loadingBtn: d,
|
|
2340
2386
|
children: /* @__PURE__ */ e(
|
|
2341
|
-
|
|
2387
|
+
Ie,
|
|
2342
2388
|
{
|
|
2343
|
-
config:
|
|
2344
|
-
onSubmit:
|
|
2345
|
-
initialData:
|
|
2389
|
+
config: n.editModal || {},
|
|
2390
|
+
onSubmit: J,
|
|
2391
|
+
initialData: U,
|
|
2346
2392
|
type: "edit",
|
|
2347
|
-
loading:
|
|
2393
|
+
loading: d
|
|
2348
2394
|
}
|
|
2349
2395
|
)
|
|
2350
2396
|
}
|
|
2351
2397
|
),
|
|
2352
|
-
|
|
2353
|
-
|
|
2398
|
+
E && /* @__PURE__ */ e(
|
|
2399
|
+
Ne,
|
|
2354
2400
|
{
|
|
2355
|
-
isOpen:
|
|
2356
|
-
onClose: (
|
|
2357
|
-
|
|
2401
|
+
isOpen: E,
|
|
2402
|
+
onClose: (b) => {
|
|
2403
|
+
j(b);
|
|
2358
2404
|
},
|
|
2359
|
-
icon: ((
|
|
2360
|
-
title: ((
|
|
2361
|
-
size: ((
|
|
2362
|
-
loading:
|
|
2363
|
-
actionButtons:
|
|
2364
|
-
executeFunction:
|
|
2365
|
-
selectedItem:
|
|
2366
|
-
children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((
|
|
2368
|
-
((
|
|
2405
|
+
icon: ((me = n.deleteModal) == null ? void 0 : me.icon) || /* @__PURE__ */ e(re, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
|
|
2406
|
+
title: ((fe = n.deleteModal) == null ? void 0 : fe.title) || "Confirm Delete",
|
|
2407
|
+
size: ((ye = n.deleteModal) == null ? void 0 : ye.size) || "md",
|
|
2408
|
+
loading: d,
|
|
2409
|
+
actionButtons: ((xe = n == null ? void 0 : n.deleteModal) == null ? void 0 : xe.actionButtons) || [],
|
|
2410
|
+
executeFunction: O,
|
|
2411
|
+
selectedItem: U,
|
|
2412
|
+
children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ c("div", { children: [
|
|
2413
|
+
/* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((ve = n.deleteModal) == null ? void 0 : ve.confirmText) || "Are you sure you want to delete this item?" }),
|
|
2414
|
+
((we = n.deleteModal) == null ? void 0 : we.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: U[(se = n.deleteModal) == null ? void 0 : se.referenceKey] })
|
|
2369
2415
|
] }) })
|
|
2370
2416
|
}
|
|
2371
2417
|
),
|
|
2372
|
-
|
|
2373
|
-
|
|
2418
|
+
n.viewModal && /* @__PURE__ */ e(
|
|
2419
|
+
Ne,
|
|
2374
2420
|
{
|
|
2375
2421
|
isOpen: Y,
|
|
2376
2422
|
onClose: () => {
|
|
2377
|
-
|
|
2423
|
+
W(!1), K(null);
|
|
2378
2424
|
},
|
|
2379
|
-
icon: (
|
|
2380
|
-
title: ((
|
|
2381
|
-
size: ((
|
|
2382
|
-
footerConfig:
|
|
2383
|
-
children: (
|
|
2384
|
-
|
|
2425
|
+
icon: (de = n.viewModal) == null ? void 0 : de.icon,
|
|
2426
|
+
title: ((t = n.viewModal) == null ? void 0 : t.title) || "View Details",
|
|
2427
|
+
size: ((g = n.viewModal) == null ? void 0 : g.size) || "lg",
|
|
2428
|
+
footerConfig: n == null ? void 0 : n.viewModal.footer,
|
|
2429
|
+
children: (T = n.viewModal) != null && T.component ? /* @__PURE__ */ e(n.viewModal.component, { data: U }) : /* @__PURE__ */ e(
|
|
2430
|
+
ga,
|
|
2385
2431
|
{
|
|
2386
|
-
data:
|
|
2387
|
-
config:
|
|
2432
|
+
data: U,
|
|
2433
|
+
config: n.viewModal || {}
|
|
2388
2434
|
}
|
|
2389
2435
|
)
|
|
2390
2436
|
}
|
|
@@ -2392,7 +2438,7 @@ const Ke = ({ config: b }) => {
|
|
|
2392
2438
|
] })
|
|
2393
2439
|
}
|
|
2394
2440
|
);
|
|
2395
|
-
},
|
|
2441
|
+
}, De = r.shape({
|
|
2396
2442
|
value: r.oneOfType([
|
|
2397
2443
|
r.string,
|
|
2398
2444
|
r.number,
|
|
@@ -2400,18 +2446,18 @@ const Ke = ({ config: b }) => {
|
|
|
2400
2446
|
]).isRequired,
|
|
2401
2447
|
label: r.string.isRequired,
|
|
2402
2448
|
color: r.string
|
|
2403
|
-
}),
|
|
2449
|
+
}), Ce = r.shape({
|
|
2404
2450
|
type: r.string.isRequired,
|
|
2405
2451
|
label: r.string.isRequired,
|
|
2406
2452
|
color: r.string,
|
|
2407
2453
|
variant: r.string,
|
|
2408
2454
|
onClick: r.func
|
|
2409
|
-
}),
|
|
2455
|
+
}), ma = r.shape({
|
|
2410
2456
|
title: r.string.isRequired,
|
|
2411
2457
|
type: r.string.isRequired,
|
|
2412
2458
|
variant: r.string,
|
|
2413
2459
|
icon: r.node
|
|
2414
|
-
}),
|
|
2460
|
+
}), fa = r.shape({
|
|
2415
2461
|
key: r.string.isRequired,
|
|
2416
2462
|
title: r.string,
|
|
2417
2463
|
type: r.string,
|
|
@@ -2420,12 +2466,12 @@ const Ke = ({ config: b }) => {
|
|
|
2420
2466
|
subtitleKey: r.string,
|
|
2421
2467
|
onClickDetails: r.bool,
|
|
2422
2468
|
variant: r.string,
|
|
2423
|
-
chipOptions: r.arrayOf(
|
|
2469
|
+
chipOptions: r.arrayOf(De),
|
|
2424
2470
|
defaultColor: r.string,
|
|
2425
2471
|
className: r.string,
|
|
2426
2472
|
format: r.string,
|
|
2427
|
-
menuList: r.arrayOf(
|
|
2428
|
-
}),
|
|
2473
|
+
menuList: r.arrayOf(ma)
|
|
2474
|
+
}), Re = r.shape({
|
|
2429
2475
|
key: r.string.isRequired,
|
|
2430
2476
|
label: r.string,
|
|
2431
2477
|
type: r.string.isRequired,
|
|
@@ -2442,8 +2488,8 @@ const Ke = ({ config: b }) => {
|
|
|
2442
2488
|
rows: r.number,
|
|
2443
2489
|
text: r.string,
|
|
2444
2490
|
editorKey: r.string,
|
|
2445
|
-
options: r.arrayOf(
|
|
2446
|
-
}),
|
|
2491
|
+
options: r.arrayOf(De)
|
|
2492
|
+
}), ya = r.shape({
|
|
2447
2493
|
key: r.string,
|
|
2448
2494
|
label: r.string,
|
|
2449
2495
|
type: r.string,
|
|
@@ -2453,12 +2499,12 @@ const Ke = ({ config: b }) => {
|
|
|
2453
2499
|
blockClass: r.string,
|
|
2454
2500
|
icon: r.node,
|
|
2455
2501
|
variant: r.string,
|
|
2456
|
-
chipOptions: r.arrayOf(
|
|
2502
|
+
chipOptions: r.arrayOf(De),
|
|
2457
2503
|
defaultColor: r.string,
|
|
2458
2504
|
className: r.string,
|
|
2459
2505
|
format: r.string
|
|
2460
2506
|
});
|
|
2461
|
-
|
|
2507
|
+
ze.propTypes = {
|
|
2462
2508
|
config: r.shape({
|
|
2463
2509
|
title: r.string.isRequired,
|
|
2464
2510
|
description: r.string,
|
|
@@ -2467,7 +2513,7 @@ Ke.propTypes = {
|
|
|
2467
2513
|
isStaticData: r.bool,
|
|
2468
2514
|
/* ================= TABLE CONFIG ================= */
|
|
2469
2515
|
tableConfig: r.shape({
|
|
2470
|
-
table_head: r.arrayOf(
|
|
2516
|
+
table_head: r.arrayOf(fa).isRequired,
|
|
2471
2517
|
search: r.shape({
|
|
2472
2518
|
enabled: r.bool,
|
|
2473
2519
|
useServerSideSearch: r.bool,
|
|
@@ -2488,24 +2534,24 @@ Ke.propTypes = {
|
|
|
2488
2534
|
title: r.string.isRequired,
|
|
2489
2535
|
size: r.string,
|
|
2490
2536
|
formClass: r.string,
|
|
2491
|
-
formFields: r.arrayOf(
|
|
2537
|
+
formFields: r.arrayOf(Re),
|
|
2492
2538
|
handleSubmit: r.func.isRequired,
|
|
2493
|
-
actionButtons: r.arrayOf(
|
|
2539
|
+
actionButtons: r.arrayOf(Ce)
|
|
2494
2540
|
}),
|
|
2495
2541
|
editModal: r.shape({
|
|
2496
2542
|
title: r.string.isRequired,
|
|
2497
2543
|
size: r.string,
|
|
2498
2544
|
formClass: r.string,
|
|
2499
|
-
formFields: r.arrayOf(
|
|
2545
|
+
formFields: r.arrayOf(Re),
|
|
2500
2546
|
handleSubmit: r.func.isRequired,
|
|
2501
|
-
actionButtons: r.arrayOf(
|
|
2547
|
+
actionButtons: r.arrayOf(Ce)
|
|
2502
2548
|
}),
|
|
2503
2549
|
deleteModal: r.shape({
|
|
2504
2550
|
title: r.string.isRequired,
|
|
2505
2551
|
size: r.string,
|
|
2506
2552
|
confirmText: r.string,
|
|
2507
2553
|
referenceKey: r.string,
|
|
2508
|
-
actionButtons: r.arrayOf(
|
|
2554
|
+
actionButtons: r.arrayOf(Ce)
|
|
2509
2555
|
}),
|
|
2510
2556
|
viewModal: r.shape({
|
|
2511
2557
|
title: r.string.isRequired,
|
|
@@ -2513,7 +2559,7 @@ Ke.propTypes = {
|
|
|
2513
2559
|
// 👇 This covers your commented code:
|
|
2514
2560
|
component: r.elementType,
|
|
2515
2561
|
// for custom component like TeamMemberDetail
|
|
2516
|
-
fields: r.arrayOf(
|
|
2562
|
+
fields: r.arrayOf(ya),
|
|
2517
2563
|
footer: r.shape({
|
|
2518
2564
|
cancelButton: r.bool,
|
|
2519
2565
|
cancelText: r.string
|
|
@@ -2522,14 +2568,14 @@ Ke.propTypes = {
|
|
|
2522
2568
|
}),
|
|
2523
2569
|
/* ================= FILTER CONFIG ================= */
|
|
2524
2570
|
filterConfig: r.shape({
|
|
2525
|
-
fields: r.arrayOf(
|
|
2571
|
+
fields: r.arrayOf(Re)
|
|
2526
2572
|
})
|
|
2527
2573
|
}).isRequired
|
|
2528
2574
|
};
|
|
2529
|
-
const
|
|
2575
|
+
const xa = () => {
|
|
2530
2576
|
if (typeof document > "u" || document.getElementById("react-admin-crud-manager-styles")) return;
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2577
|
+
const h = document.createElement("style");
|
|
2578
|
+
h.id = "react-admin-crud-manager-styles";
|
|
2533
2579
|
const o = `
|
|
2534
2580
|
.no-spinner::-webkit-outer-spin-button,
|
|
2535
2581
|
.no-spinner::-webkit-inner-spin-button {
|
|
@@ -2546,14 +2592,14 @@ const fa = () => {
|
|
|
2546
2592
|
box-shadow: none !important;
|
|
2547
2593
|
}
|
|
2548
2594
|
`;
|
|
2549
|
-
|
|
2595
|
+
h.textContent = o, document.head.appendChild(h);
|
|
2550
2596
|
};
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2553
|
-
|
|
2554
|
-
}, []), /* @__PURE__ */ e(
|
|
2597
|
+
function Aa(h) {
|
|
2598
|
+
return z(() => {
|
|
2599
|
+
xa();
|
|
2600
|
+
}, []), /* @__PURE__ */ e($, { children: /* @__PURE__ */ e(ze, { config: h.config }) });
|
|
2555
2601
|
}
|
|
2556
2602
|
export {
|
|
2557
|
-
|
|
2603
|
+
Aa as default
|
|
2558
2604
|
};
|
|
2559
2605
|
//# sourceMappingURL=index.es.js.map
|