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