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