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