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