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