react-admin-crud-manager 1.0.4 → 1.0.5
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 +37 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1105 -1441
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -3
package/dist/index.es.js
CHANGED
|
@@ -1,626 +1,290 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ChevronDown as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Editor as
|
|
6
|
-
import { SnackbarProvider as
|
|
1
|
+
import ve, { useState as T, useRef as ce, useEffect as W, useMemo as Se } from "react";
|
|
2
|
+
import { ChevronDown as Fe, Search as Ce, Check as ze, X as je, Filter as He, ChevronLeft as Ue, ChevronRight as Ve, EllipsisVertical as We, User as De, Plus as qe } from "lucide-react";
|
|
3
|
+
import { createPortal as Je } from "react-dom";
|
|
4
|
+
import { Icon as Re } from "@iconify/react";
|
|
5
|
+
import { Editor as Ze } from "@tinymce/tinymce-react";
|
|
6
|
+
import { SnackbarProvider as Xe, enqueueSnackbar as ke } from "notistack";
|
|
7
7
|
import a from "prop-types";
|
|
8
|
-
var
|
|
8
|
+
var Me = { exports: {} }, ge = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
|
-
* react-jsx-runtime.production.
|
|
11
|
+
* react-jsx-runtime.production.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
var Ee;
|
|
19
|
+
function Qe() {
|
|
20
|
+
if (Ee) return ge;
|
|
21
|
+
Ee = 1;
|
|
22
|
+
var c = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
23
|
+
function s(i, l, r) {
|
|
24
|
+
var n = null;
|
|
25
|
+
if (r !== void 0 && (n = "" + r), l.key !== void 0 && (n = "" + l.key), "key" in l) {
|
|
26
|
+
r = {};
|
|
27
|
+
for (var k in l)
|
|
28
|
+
k !== "key" && (r[k] = l[k]);
|
|
29
|
+
} else r = l;
|
|
30
|
+
return l = r.ref, {
|
|
31
|
+
$$typeof: c,
|
|
32
|
+
type: i,
|
|
33
|
+
key: n,
|
|
34
|
+
ref: l !== void 0 ? l : null,
|
|
35
|
+
props: r
|
|
36
|
+
};
|
|
29
37
|
}
|
|
30
|
-
return
|
|
38
|
+
return ge.Fragment = d, ge.jsx = s, ge.jsxs = s, ge;
|
|
31
39
|
}
|
|
32
|
-
var
|
|
40
|
+
var pe = {};
|
|
33
41
|
/**
|
|
34
42
|
* @license React
|
|
35
43
|
* react-jsx-runtime.development.js
|
|
36
44
|
*
|
|
37
|
-
* Copyright (c)
|
|
45
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
46
|
*
|
|
39
47
|
* This source code is licensed under the MIT license found in the
|
|
40
48
|
* LICENSE file in the root directory of this source tree.
|
|
41
49
|
*/
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
return null;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var R = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
-
function w(r) {
|
|
54
|
-
{
|
|
55
|
-
for (var o = arguments.length, b = new Array(o > 1 ? o - 1 : 0), k = 1; k < o; k++)
|
|
56
|
-
b[k - 1] = arguments[k];
|
|
57
|
-
L("error", r, b);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function L(r, o, b) {
|
|
61
|
-
{
|
|
62
|
-
var k = R.ReactDebugCurrentFrame, I = k.getStackAddendum();
|
|
63
|
-
I !== "" && (o += "%s", b = b.concat([I]));
|
|
64
|
-
var Y = b.map(function(D) {
|
|
65
|
-
return String(D);
|
|
66
|
-
});
|
|
67
|
-
Y.unshift("Warning: " + o), Function.prototype.apply.call(console[r], console, Y);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
var U = !1, V = !1, Z = !1, $ = !1, x = !1, B;
|
|
71
|
-
B = Symbol.for("react.module.reference");
|
|
72
|
-
function G(r) {
|
|
73
|
-
return !!(typeof r == "string" || typeof r == "function" || r === i || r === t || x || r === d || r === v || r === f || $ || r === C || U || V || Z || typeof r == "object" && r !== null && (r.$$typeof === g || r.$$typeof === u || r.$$typeof === n || r.$$typeof === N || r.$$typeof === y || // This needs to include all possible module reference object
|
|
74
|
-
// types supported by any Flight configuration anywhere since
|
|
75
|
-
// we don't know which Flight build this will end up being used
|
|
76
|
-
// with.
|
|
77
|
-
r.$$typeof === B || r.getModuleId !== void 0));
|
|
78
|
-
}
|
|
79
|
-
function T(r, o, b) {
|
|
80
|
-
var k = r.displayName;
|
|
81
|
-
if (k)
|
|
82
|
-
return k;
|
|
83
|
-
var I = o.displayName || o.name || "";
|
|
84
|
-
return I !== "" ? b + "(" + I + ")" : b;
|
|
85
|
-
}
|
|
86
|
-
function S(r) {
|
|
87
|
-
return r.displayName || "Context";
|
|
88
|
-
}
|
|
89
|
-
function O(r) {
|
|
90
|
-
if (r == null)
|
|
91
|
-
return null;
|
|
92
|
-
if (typeof r.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
93
|
-
return r.displayName || r.name || null;
|
|
94
|
-
if (typeof r == "string")
|
|
95
|
-
return r;
|
|
96
|
-
switch (r) {
|
|
97
|
-
case i:
|
|
50
|
+
var _e;
|
|
51
|
+
function ea() {
|
|
52
|
+
return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
53
|
+
function c(t) {
|
|
54
|
+
if (t == null) return null;
|
|
55
|
+
if (typeof t == "function")
|
|
56
|
+
return t.$$typeof === C ? null : t.displayName || t.name || null;
|
|
57
|
+
if (typeof t == "string") return t;
|
|
58
|
+
switch (t) {
|
|
59
|
+
case j:
|
|
98
60
|
return "Fragment";
|
|
99
|
-
case
|
|
100
|
-
return "Portal";
|
|
101
|
-
case t:
|
|
61
|
+
case R:
|
|
102
62
|
return "Profiler";
|
|
103
|
-
case
|
|
63
|
+
case S:
|
|
104
64
|
return "StrictMode";
|
|
105
|
-
case
|
|
65
|
+
case z:
|
|
106
66
|
return "Suspense";
|
|
107
|
-
case
|
|
67
|
+
case O:
|
|
108
68
|
return "SuspenseList";
|
|
69
|
+
case F:
|
|
70
|
+
return "Activity";
|
|
109
71
|
}
|
|
110
|
-
if (typeof
|
|
111
|
-
switch (
|
|
72
|
+
if (typeof t == "object")
|
|
73
|
+
switch (typeof t.tag == "number" && console.error(
|
|
74
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
75
|
+
), t.$$typeof) {
|
|
112
76
|
case N:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
|
|
77
|
+
return "Portal";
|
|
78
|
+
case B:
|
|
79
|
+
return t.displayName || "Context";
|
|
80
|
+
case P:
|
|
81
|
+
return (t._context.displayName || "Context") + ".Consumer";
|
|
82
|
+
case Y:
|
|
83
|
+
var y = t.render;
|
|
84
|
+
return t = t.displayName, t || (t = y.displayName || y.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
85
|
+
case p:
|
|
86
|
+
return y = t.displayName || null, y !== null ? y : c(t.type) || "Memo";
|
|
87
|
+
case _:
|
|
88
|
+
y = t._payload, t = t._init;
|
|
125
89
|
try {
|
|
126
|
-
return
|
|
90
|
+
return c(t(y));
|
|
127
91
|
} catch {
|
|
128
|
-
return null;
|
|
129
92
|
}
|
|
130
|
-
}
|
|
131
93
|
}
|
|
132
94
|
return null;
|
|
133
95
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
Se.__reactDisabledLog = !0;
|
|
138
|
-
function Ee() {
|
|
139
|
-
{
|
|
140
|
-
if (Q === 0) {
|
|
141
|
-
oe = console.log, pe = console.info, ye = console.warn, ge = console.error, ve = console.group, fe = console.groupCollapsed, se = console.groupEnd;
|
|
142
|
-
var r = {
|
|
143
|
-
configurable: !0,
|
|
144
|
-
enumerable: !0,
|
|
145
|
-
value: Se,
|
|
146
|
-
writable: !0
|
|
147
|
-
};
|
|
148
|
-
Object.defineProperties(console, {
|
|
149
|
-
info: r,
|
|
150
|
-
log: r,
|
|
151
|
-
warn: r,
|
|
152
|
-
error: r,
|
|
153
|
-
group: r,
|
|
154
|
-
groupCollapsed: r,
|
|
155
|
-
groupEnd: r
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
Q++;
|
|
159
|
-
}
|
|
96
|
+
function d(t) {
|
|
97
|
+
return "" + t;
|
|
160
98
|
}
|
|
161
|
-
function
|
|
162
|
-
{
|
|
163
|
-
if (Q--, Q === 0) {
|
|
164
|
-
var r = {
|
|
165
|
-
configurable: !0,
|
|
166
|
-
enumerable: !0,
|
|
167
|
-
writable: !0
|
|
168
|
-
};
|
|
169
|
-
Object.defineProperties(console, {
|
|
170
|
-
log: W({}, r, {
|
|
171
|
-
value: oe
|
|
172
|
-
}),
|
|
173
|
-
info: W({}, r, {
|
|
174
|
-
value: pe
|
|
175
|
-
}),
|
|
176
|
-
warn: W({}, r, {
|
|
177
|
-
value: ye
|
|
178
|
-
}),
|
|
179
|
-
error: W({}, r, {
|
|
180
|
-
value: ge
|
|
181
|
-
}),
|
|
182
|
-
group: W({}, r, {
|
|
183
|
-
value: ve
|
|
184
|
-
}),
|
|
185
|
-
groupCollapsed: W({}, r, {
|
|
186
|
-
value: fe
|
|
187
|
-
}),
|
|
188
|
-
groupEnd: W({}, r, {
|
|
189
|
-
value: se
|
|
190
|
-
})
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
Q < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
var me = R.ReactCurrentDispatcher, ie;
|
|
197
|
-
function de(r, o, b) {
|
|
198
|
-
{
|
|
199
|
-
if (ie === void 0)
|
|
200
|
-
try {
|
|
201
|
-
throw Error();
|
|
202
|
-
} catch (I) {
|
|
203
|
-
var k = I.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
-
ie = k && k[1] || "";
|
|
205
|
-
}
|
|
206
|
-
return `
|
|
207
|
-
` + ie + r;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
var xe = !1, ce;
|
|
211
|
-
{
|
|
212
|
-
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
-
ce = new Ne();
|
|
214
|
-
}
|
|
215
|
-
function we(r, o) {
|
|
216
|
-
if (!r || xe)
|
|
217
|
-
return "";
|
|
218
|
-
{
|
|
219
|
-
var b = ce.get(r);
|
|
220
|
-
if (b !== void 0)
|
|
221
|
-
return b;
|
|
222
|
-
}
|
|
223
|
-
var k;
|
|
224
|
-
xe = !0;
|
|
225
|
-
var I = Error.prepareStackTrace;
|
|
226
|
-
Error.prepareStackTrace = void 0;
|
|
227
|
-
var Y;
|
|
228
|
-
Y = me.current, me.current = null, Ee();
|
|
99
|
+
function s(t) {
|
|
229
100
|
try {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (Object.defineProperty(D.prototype, "props", {
|
|
235
|
-
set: function() {
|
|
236
|
-
throw Error();
|
|
237
|
-
}
|
|
238
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
|
-
try {
|
|
240
|
-
Reflect.construct(D, []);
|
|
241
|
-
} catch (he) {
|
|
242
|
-
k = he;
|
|
243
|
-
}
|
|
244
|
-
Reflect.construct(r, [], D);
|
|
245
|
-
} else {
|
|
246
|
-
try {
|
|
247
|
-
D.call();
|
|
248
|
-
} catch (he) {
|
|
249
|
-
k = he;
|
|
250
|
-
}
|
|
251
|
-
r.call(D.prototype);
|
|
252
|
-
}
|
|
253
|
-
} else {
|
|
254
|
-
try {
|
|
255
|
-
throw Error();
|
|
256
|
-
} catch (he) {
|
|
257
|
-
k = he;
|
|
258
|
-
}
|
|
259
|
-
r();
|
|
260
|
-
}
|
|
261
|
-
} catch (he) {
|
|
262
|
-
if (he && k && typeof he.stack == "string") {
|
|
263
|
-
for (var _ = he.stack.split(`
|
|
264
|
-
`), re = k.stack.split(`
|
|
265
|
-
`), q = _.length - 1, J = re.length - 1; q >= 1 && J >= 0 && _[q] !== re[J]; )
|
|
266
|
-
J--;
|
|
267
|
-
for (; q >= 1 && J >= 0; q--, J--)
|
|
268
|
-
if (_[q] !== re[J]) {
|
|
269
|
-
if (q !== 1 || J !== 1)
|
|
270
|
-
do
|
|
271
|
-
if (q--, J--, J < 0 || _[q] !== re[J]) {
|
|
272
|
-
var ne = `
|
|
273
|
-
` + _[q].replace(" at new ", " at ");
|
|
274
|
-
return r.displayName && ne.includes("<anonymous>") && (ne = ne.replace("<anonymous>", r.displayName)), typeof r == "function" && ce.set(r, ne), ne;
|
|
275
|
-
}
|
|
276
|
-
while (q >= 1 && J >= 0);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
} finally {
|
|
281
|
-
xe = !1, me.current = Y, Te(), Error.prepareStackTrace = I;
|
|
282
|
-
}
|
|
283
|
-
var Re = r ? r.displayName || r.name : "", tr = Re ? de(Re) : "";
|
|
284
|
-
return typeof r == "function" && ce.set(r, tr), tr;
|
|
285
|
-
}
|
|
286
|
-
function l(r, o, b) {
|
|
287
|
-
return we(r, !1);
|
|
288
|
-
}
|
|
289
|
-
function m(r) {
|
|
290
|
-
var o = r.prototype;
|
|
291
|
-
return !!(o && o.isReactComponent);
|
|
292
|
-
}
|
|
293
|
-
function A(r, o, b) {
|
|
294
|
-
if (r == null)
|
|
295
|
-
return "";
|
|
296
|
-
if (typeof r == "function")
|
|
297
|
-
return we(r, m(r));
|
|
298
|
-
if (typeof r == "string")
|
|
299
|
-
return de(r);
|
|
300
|
-
switch (r) {
|
|
301
|
-
case v:
|
|
302
|
-
return de("Suspense");
|
|
303
|
-
case f:
|
|
304
|
-
return de("SuspenseList");
|
|
305
|
-
}
|
|
306
|
-
if (typeof r == "object")
|
|
307
|
-
switch (r.$$typeof) {
|
|
308
|
-
case y:
|
|
309
|
-
return l(r.render);
|
|
310
|
-
case u:
|
|
311
|
-
return A(r.type, o, b);
|
|
312
|
-
case g: {
|
|
313
|
-
var k = r, I = k._payload, Y = k._init;
|
|
314
|
-
try {
|
|
315
|
-
return A(Y(I), o, b);
|
|
316
|
-
} catch {
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return "";
|
|
321
|
-
}
|
|
322
|
-
var H = Object.prototype.hasOwnProperty, z = {}, te = R.ReactDebugCurrentFrame;
|
|
323
|
-
function X(r) {
|
|
324
|
-
if (r) {
|
|
325
|
-
var o = r._owner, b = A(r.type, r._source, o ? o.type : null);
|
|
326
|
-
te.setExtraStackFrame(b);
|
|
327
|
-
} else
|
|
328
|
-
te.setExtraStackFrame(null);
|
|
329
|
-
}
|
|
330
|
-
function ue(r, o, b, k, I) {
|
|
331
|
-
{
|
|
332
|
-
var Y = Function.call.bind(H);
|
|
333
|
-
for (var D in r)
|
|
334
|
-
if (Y(r, D)) {
|
|
335
|
-
var _ = void 0;
|
|
336
|
-
try {
|
|
337
|
-
if (typeof r[D] != "function") {
|
|
338
|
-
var re = Error((k || "React class") + ": " + b + " type `" + D + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[D] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
-
throw re.name = "Invariant Violation", re;
|
|
340
|
-
}
|
|
341
|
-
_ = r[D](o, D, k, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
-
} catch (q) {
|
|
343
|
-
_ = q;
|
|
344
|
-
}
|
|
345
|
-
_ && !(_ instanceof Error) && (X(I), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", k || "React class", b, D, typeof _), X(null)), _ instanceof Error && !(_.message in z) && (z[_.message] = !0, X(I), w("Failed %s type: %s", b, _.message), X(null));
|
|
346
|
-
}
|
|
101
|
+
d(t);
|
|
102
|
+
var y = !1;
|
|
103
|
+
} catch {
|
|
104
|
+
y = !0;
|
|
347
105
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
return b;
|
|
106
|
+
if (y) {
|
|
107
|
+
y = console;
|
|
108
|
+
var L = y.error, G = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
109
|
+
return L.call(
|
|
110
|
+
y,
|
|
111
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
112
|
+
G
|
|
113
|
+
), d(t);
|
|
357
114
|
}
|
|
358
115
|
}
|
|
359
|
-
function
|
|
116
|
+
function i(t) {
|
|
117
|
+
if (t === j) return "<>";
|
|
118
|
+
if (typeof t == "object" && t !== null && t.$$typeof === _)
|
|
119
|
+
return "<...>";
|
|
360
120
|
try {
|
|
361
|
-
|
|
121
|
+
var y = c(t);
|
|
122
|
+
return y ? "<" + y + ">" : "<...>";
|
|
362
123
|
} catch {
|
|
363
|
-
return
|
|
124
|
+
return "<...>";
|
|
364
125
|
}
|
|
365
126
|
}
|
|
366
|
-
function
|
|
367
|
-
|
|
127
|
+
function l() {
|
|
128
|
+
var t = f.A;
|
|
129
|
+
return t === null ? null : t.getOwner();
|
|
368
130
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
371
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", F(r)), le(r);
|
|
131
|
+
function r() {
|
|
132
|
+
return Error("react-stack-top-frame");
|
|
372
133
|
}
|
|
373
|
-
|
|
374
|
-
key
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
__source: !0
|
|
378
|
-
}, qe, Je;
|
|
379
|
-
function yr(r) {
|
|
380
|
-
if (H.call(r, "ref")) {
|
|
381
|
-
var o = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
382
|
-
if (o && o.isReactWarning)
|
|
383
|
-
return !1;
|
|
134
|
+
function n(t) {
|
|
135
|
+
if (A.call(t, "key")) {
|
|
136
|
+
var y = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
137
|
+
if (y && y.isReactWarning) return !1;
|
|
384
138
|
}
|
|
385
|
-
return
|
|
139
|
+
return t.key !== void 0;
|
|
386
140
|
}
|
|
387
|
-
function
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
141
|
+
function k(t, y) {
|
|
142
|
+
function L() {
|
|
143
|
+
X || (X = !0, console.error(
|
|
144
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
145
|
+
y
|
|
146
|
+
));
|
|
392
147
|
}
|
|
393
|
-
|
|
148
|
+
L.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
149
|
+
get: L,
|
|
150
|
+
configurable: !0
|
|
151
|
+
});
|
|
394
152
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
var b = function() {
|
|
401
|
-
qe || (qe = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
|
|
402
|
-
};
|
|
403
|
-
b.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
404
|
-
get: b,
|
|
405
|
-
configurable: !0
|
|
406
|
-
});
|
|
407
|
-
}
|
|
153
|
+
function M() {
|
|
154
|
+
var t = c(this.type);
|
|
155
|
+
return ae[t] || (ae[t] = !0, console.error(
|
|
156
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
157
|
+
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
408
158
|
}
|
|
409
|
-
function
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
var _ = {
|
|
422
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
423
|
-
$$typeof: c,
|
|
424
|
-
// Built-in properties that belong on the element
|
|
425
|
-
type: r,
|
|
426
|
-
key: o,
|
|
427
|
-
ref: b,
|
|
428
|
-
props: D,
|
|
429
|
-
// Record the component responsible for creating this element.
|
|
430
|
-
_owner: Y
|
|
431
|
-
};
|
|
432
|
-
return _._store = {}, Object.defineProperty(_._store, "validated", {
|
|
159
|
+
function x(t, y, L, G, te, ne) {
|
|
160
|
+
var I = L.ref;
|
|
161
|
+
return t = {
|
|
162
|
+
$$typeof: h,
|
|
163
|
+
type: t,
|
|
164
|
+
key: y,
|
|
165
|
+
props: L,
|
|
166
|
+
_owner: G
|
|
167
|
+
}, (I !== void 0 ? I : null) !== null ? Object.defineProperty(t, "ref", {
|
|
168
|
+
enumerable: !1,
|
|
169
|
+
get: M
|
|
170
|
+
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
433
171
|
configurable: !1,
|
|
434
172
|
enumerable: !1,
|
|
435
173
|
writable: !0,
|
|
436
|
-
value:
|
|
437
|
-
}), Object.defineProperty(
|
|
174
|
+
value: 0
|
|
175
|
+
}), Object.defineProperty(t, "_debugInfo", {
|
|
438
176
|
configurable: !1,
|
|
439
177
|
enumerable: !1,
|
|
440
|
-
writable: !
|
|
441
|
-
value:
|
|
442
|
-
}), Object.defineProperty(
|
|
178
|
+
writable: !0,
|
|
179
|
+
value: null
|
|
180
|
+
}), Object.defineProperty(t, "_debugStack", {
|
|
443
181
|
configurable: !1,
|
|
444
182
|
enumerable: !1,
|
|
445
|
-
writable: !
|
|
446
|
-
value:
|
|
447
|
-
}), Object.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
for (Y in o)
|
|
454
|
-
H.call(o, Y) && !xr.hasOwnProperty(Y) && (D[Y] = o[Y]);
|
|
455
|
-
if (r && r.defaultProps) {
|
|
456
|
-
var q = r.defaultProps;
|
|
457
|
-
for (Y in q)
|
|
458
|
-
D[Y] === void 0 && (D[Y] = q[Y]);
|
|
459
|
-
}
|
|
460
|
-
if (_ || re) {
|
|
461
|
-
var J = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
462
|
-
_ && jr(D, J), re && kr(D, J);
|
|
463
|
-
}
|
|
464
|
-
return Sr(r, _, re, I, k, We.current, D);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
var Ie = R.ReactCurrentOwner, Ze = R.ReactDebugCurrentFrame;
|
|
468
|
-
function Ce(r) {
|
|
469
|
-
if (r) {
|
|
470
|
-
var o = r._owner, b = A(r.type, r._source, o ? o.type : null);
|
|
471
|
-
Ze.setExtraStackFrame(b);
|
|
472
|
-
} else
|
|
473
|
-
Ze.setExtraStackFrame(null);
|
|
474
|
-
}
|
|
475
|
-
var Le;
|
|
476
|
-
Le = !1;
|
|
477
|
-
function Be(r) {
|
|
478
|
-
return typeof r == "object" && r !== null && r.$$typeof === c;
|
|
479
|
-
}
|
|
480
|
-
function Xe() {
|
|
481
|
-
{
|
|
482
|
-
if (Ie.current) {
|
|
483
|
-
var r = O(Ie.current.type);
|
|
484
|
-
if (r)
|
|
485
|
-
return `
|
|
486
|
-
|
|
487
|
-
Check the render method of \`` + r + "`.";
|
|
488
|
-
}
|
|
489
|
-
return "";
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
function Cr(r) {
|
|
493
|
-
return "";
|
|
494
|
-
}
|
|
495
|
-
var Qe = {};
|
|
496
|
-
function Rr(r) {
|
|
497
|
-
{
|
|
498
|
-
var o = Xe();
|
|
499
|
-
if (!o) {
|
|
500
|
-
var b = typeof r == "string" ? r : r.displayName || r.name;
|
|
501
|
-
b && (o = `
|
|
502
|
-
|
|
503
|
-
Check the top-level render call using <` + b + ">.");
|
|
504
|
-
}
|
|
505
|
-
return o;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
function er(r, o) {
|
|
509
|
-
{
|
|
510
|
-
if (!r._store || r._store.validated || r.key != null)
|
|
511
|
-
return;
|
|
512
|
-
r._store.validated = !0;
|
|
513
|
-
var b = Rr(o);
|
|
514
|
-
if (Qe[b])
|
|
515
|
-
return;
|
|
516
|
-
Qe[b] = !0;
|
|
517
|
-
var k = "";
|
|
518
|
-
r && r._owner && r._owner !== Ie.current && (k = " It was passed a child from " + O(r._owner.type) + "."), Ce(r), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, k), Ce(null);
|
|
519
|
-
}
|
|
183
|
+
writable: !0,
|
|
184
|
+
value: te
|
|
185
|
+
}), Object.defineProperty(t, "_debugTask", {
|
|
186
|
+
configurable: !1,
|
|
187
|
+
enumerable: !1,
|
|
188
|
+
writable: !0,
|
|
189
|
+
value: ne
|
|
190
|
+
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
520
191
|
}
|
|
521
|
-
function
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
192
|
+
function m(t, y, L, G, te, ne) {
|
|
193
|
+
var I = y.children;
|
|
194
|
+
if (I !== void 0)
|
|
195
|
+
if (G)
|
|
196
|
+
if (U(I)) {
|
|
197
|
+
for (G = 0; G < I.length; G++)
|
|
198
|
+
u(I[G]);
|
|
199
|
+
Object.freeze && Object.freeze(I);
|
|
200
|
+
} else
|
|
201
|
+
console.error(
|
|
202
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
203
|
+
);
|
|
204
|
+
else u(I);
|
|
205
|
+
if (A.call(y, "key")) {
|
|
206
|
+
I = c(t);
|
|
207
|
+
var J = Object.keys(y).filter(function(ue) {
|
|
208
|
+
return ue !== "key";
|
|
209
|
+
});
|
|
210
|
+
G = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", ie[I + G] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
211
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
212
|
+
let props = %s;
|
|
213
|
+
<%s {...props} />
|
|
214
|
+
React keys must be passed directly to JSX without using spread:
|
|
215
|
+
let props = %s;
|
|
216
|
+
<%s key={someKey} {...props} />`,
|
|
217
|
+
G,
|
|
218
|
+
I,
|
|
219
|
+
J,
|
|
220
|
+
I
|
|
221
|
+
), ie[I + G] = !0);
|
|
538
222
|
}
|
|
223
|
+
if (I = null, L !== void 0 && (s(L), I = "" + L), n(y) && (s(y.key), I = "" + y.key), "key" in y) {
|
|
224
|
+
L = {};
|
|
225
|
+
for (var le in y)
|
|
226
|
+
le !== "key" && (L[le] = y[le]);
|
|
227
|
+
} else L = y;
|
|
228
|
+
return I && k(
|
|
229
|
+
L,
|
|
230
|
+
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
231
|
+
), x(
|
|
232
|
+
t,
|
|
233
|
+
I,
|
|
234
|
+
L,
|
|
235
|
+
l(),
|
|
236
|
+
te,
|
|
237
|
+
ne
|
|
238
|
+
);
|
|
539
239
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
542
|
-
var o = r.type;
|
|
543
|
-
if (o == null || typeof o == "string")
|
|
544
|
-
return;
|
|
545
|
-
var b;
|
|
546
|
-
if (typeof o == "function")
|
|
547
|
-
b = o.propTypes;
|
|
548
|
-
else if (typeof o == "object" && (o.$$typeof === y || // Note: Memo only checks outer props here.
|
|
549
|
-
// Inner props are checked in the reconciler.
|
|
550
|
-
o.$$typeof === u))
|
|
551
|
-
b = o.propTypes;
|
|
552
|
-
else
|
|
553
|
-
return;
|
|
554
|
-
if (b) {
|
|
555
|
-
var k = O(o);
|
|
556
|
-
ue(b, r.props, "prop", k, r);
|
|
557
|
-
} else if (o.PropTypes !== void 0 && !Le) {
|
|
558
|
-
Le = !0;
|
|
559
|
-
var I = O(o);
|
|
560
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "Unknown");
|
|
561
|
-
}
|
|
562
|
-
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
563
|
-
}
|
|
240
|
+
function u(t) {
|
|
241
|
+
b(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === _ && (t._payload.status === "fulfilled" ? b(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
564
242
|
}
|
|
565
|
-
function
|
|
566
|
-
|
|
567
|
-
for (var o = Object.keys(r.props), b = 0; b < o.length; b++) {
|
|
568
|
-
var k = o[b];
|
|
569
|
-
if (k !== "children" && k !== "key") {
|
|
570
|
-
Ce(r), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", k), Ce(null);
|
|
571
|
-
break;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
r.ref !== null && (Ce(r), w("Invalid attribute `ref` supplied to `React.Fragment`."), Ce(null));
|
|
575
|
-
}
|
|
243
|
+
function b(t) {
|
|
244
|
+
return typeof t == "object" && t !== null && t.$$typeof === h;
|
|
576
245
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var re = Cr();
|
|
584
|
-
re ? _ += re : _ += Xe();
|
|
585
|
-
var q;
|
|
586
|
-
r === null ? q = "null" : j(r) ? q = "array" : r !== void 0 && r.$$typeof === c ? (q = "<" + (O(r.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : q = typeof r, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, _);
|
|
587
|
-
}
|
|
588
|
-
var J = Nr(r, o, b, I, Y);
|
|
589
|
-
if (J == null)
|
|
590
|
-
return J;
|
|
591
|
-
if (D) {
|
|
592
|
-
var ne = o.children;
|
|
593
|
-
if (ne !== void 0)
|
|
594
|
-
if (k)
|
|
595
|
-
if (j(ne)) {
|
|
596
|
-
for (var Re = 0; Re < ne.length; Re++)
|
|
597
|
-
rr(ne[Re], r);
|
|
598
|
-
Object.freeze && Object.freeze(ne);
|
|
599
|
-
} else
|
|
600
|
-
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
601
|
-
else
|
|
602
|
-
rr(ne, r);
|
|
603
|
-
}
|
|
604
|
-
return r === i ? Er(J) : Mr(J), J;
|
|
246
|
+
var v = ve, h = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), B = Symbol.for("react.context"), Y = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), O = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), f = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, U = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
247
|
+
return null;
|
|
248
|
+
};
|
|
249
|
+
v = {
|
|
250
|
+
react_stack_bottom_frame: function(t) {
|
|
251
|
+
return t();
|
|
605
252
|
}
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
253
|
+
};
|
|
254
|
+
var X, ae = {}, oe = v.react_stack_bottom_frame.bind(
|
|
255
|
+
v,
|
|
256
|
+
r
|
|
257
|
+
)(), re = V(i(r)), ie = {};
|
|
258
|
+
pe.Fragment = j, pe.jsx = function(t, y, L) {
|
|
259
|
+
var G = 1e4 > f.recentlyCreatedOwnerStacks++;
|
|
260
|
+
return m(
|
|
261
|
+
t,
|
|
262
|
+
y,
|
|
263
|
+
L,
|
|
264
|
+
!1,
|
|
265
|
+
G ? Error("react-stack-top-frame") : oe,
|
|
266
|
+
G ? V(i(t)) : re
|
|
267
|
+
);
|
|
268
|
+
}, pe.jsxs = function(t, y, L) {
|
|
269
|
+
var G = 1e4 > f.recentlyCreatedOwnerStacks++;
|
|
270
|
+
return m(
|
|
271
|
+
t,
|
|
272
|
+
y,
|
|
273
|
+
L,
|
|
274
|
+
!0,
|
|
275
|
+
G ? Error("react-stack-top-frame") : oe,
|
|
276
|
+
G ? V(i(t)) : re
|
|
277
|
+
);
|
|
278
|
+
};
|
|
279
|
+
}()), pe;
|
|
616
280
|
}
|
|
617
|
-
process.env.NODE_ENV === "production" ?
|
|
618
|
-
var e =
|
|
619
|
-
const
|
|
620
|
-
if (!
|
|
621
|
-
const s = new Date(
|
|
281
|
+
process.env.NODE_ENV === "production" ? Me.exports = Qe() : Me.exports = ea();
|
|
282
|
+
var e = Me.exports;
|
|
283
|
+
const Le = (c, d = "DD MMM YYYY") => {
|
|
284
|
+
if (!c) return "N/A";
|
|
285
|
+
const s = new Date(c);
|
|
622
286
|
if (isNaN(s)) return "Invalid Date";
|
|
623
|
-
const i = (
|
|
287
|
+
const i = (r) => String(r).padStart(2, "0"), l = {
|
|
624
288
|
YYYY: s.getFullYear(),
|
|
625
289
|
YY: String(s.getFullYear()).slice(-2),
|
|
626
290
|
MMMM: s.toLocaleString("en-US", { month: "long" }),
|
|
@@ -637,39 +301,39 @@ const ur = (h, c = "DD MMM YYYY") => {
|
|
|
637
301
|
ss: i(s.getSeconds()),
|
|
638
302
|
A: s.getHours() >= 12 ? "PM" : "AM"
|
|
639
303
|
};
|
|
640
|
-
return
|
|
304
|
+
return d.replace(
|
|
641
305
|
/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
|
|
642
|
-
(
|
|
306
|
+
(r) => l[r]
|
|
643
307
|
);
|
|
644
|
-
},
|
|
645
|
-
if (!(
|
|
646
|
-
const i =
|
|
647
|
-
return
|
|
308
|
+
}, aa = (c, d, s = []) => {
|
|
309
|
+
if (!(d != null && d.trim())) return c;
|
|
310
|
+
const i = d.toLowerCase(), l = (r) => r == null ? [] : typeof r == "object" ? Object.values(r).flatMap(l) : [String(r)];
|
|
311
|
+
return c.filter((r) => {
|
|
648
312
|
let n = [];
|
|
649
|
-
return s.length > 0 ? s.forEach((
|
|
650
|
-
|
|
651
|
-
}) : n =
|
|
652
|
-
(
|
|
313
|
+
return s.length > 0 ? s.forEach((k) => {
|
|
314
|
+
r[k] !== void 0 && n.push(...l(r[k]));
|
|
315
|
+
}) : n = l(r), n.some(
|
|
316
|
+
(k) => k.toLowerCase().includes(i)
|
|
653
317
|
);
|
|
654
318
|
});
|
|
655
|
-
},
|
|
319
|
+
}, he = ve.forwardRef(
|
|
656
320
|
({
|
|
657
|
-
className:
|
|
658
|
-
variant:
|
|
321
|
+
className: c = "",
|
|
322
|
+
variant: d = "contained",
|
|
659
323
|
color: s = "default",
|
|
660
324
|
size: i = "default",
|
|
661
|
-
fullWidth:
|
|
662
|
-
children:
|
|
325
|
+
fullWidth: l = !1,
|
|
326
|
+
children: r,
|
|
663
327
|
...n
|
|
664
|
-
},
|
|
665
|
-
var
|
|
666
|
-
const
|
|
328
|
+
}, k) => {
|
|
329
|
+
var h;
|
|
330
|
+
const M = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", x = {
|
|
667
331
|
sm: "h-8 px-3 rounded-md text-sm",
|
|
668
332
|
md: "h-9 px-4 rounded-md text-sm",
|
|
669
333
|
lg: "h-11 px-6 rounded-md text-base",
|
|
670
334
|
xl: "h-12 px-8 rounded-lg text-lg",
|
|
671
335
|
default: "h-9 px-4 rounded-md text-sm"
|
|
672
|
-
},
|
|
336
|
+
}, m = {
|
|
673
337
|
primary: {
|
|
674
338
|
contained: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500 shadow-sm",
|
|
675
339
|
outlined: "border border-blue-600 bg-transparent text-blue-600 hover:bg-blue-50 focus:ring-blue-500",
|
|
@@ -690,118 +354,118 @@ const ur = (h, c = "DD MMM YYYY") => {
|
|
|
690
354
|
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",
|
|
691
355
|
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"
|
|
692
356
|
}
|
|
693
|
-
}, u = ((
|
|
694
|
-
${
|
|
357
|
+
}, u = ((h = m[s]) == null ? void 0 : h[d]) || m.default.contained, b = x[i], v = `
|
|
358
|
+
${M}
|
|
695
359
|
${u}
|
|
696
|
-
${
|
|
697
|
-
${
|
|
698
|
-
${
|
|
360
|
+
${b}
|
|
361
|
+
${l ? "w-full" : ""}
|
|
362
|
+
${c}
|
|
699
363
|
`.trim();
|
|
700
364
|
return /* @__PURE__ */ e.jsx(
|
|
701
365
|
"button",
|
|
702
366
|
{
|
|
703
|
-
ref:
|
|
367
|
+
ref: k,
|
|
704
368
|
type: n.type || "button",
|
|
705
|
-
className:
|
|
369
|
+
className: v,
|
|
706
370
|
...n,
|
|
707
|
-
children:
|
|
371
|
+
children: r
|
|
708
372
|
}
|
|
709
373
|
);
|
|
710
374
|
}
|
|
711
375
|
);
|
|
712
|
-
|
|
713
|
-
function
|
|
376
|
+
he.displayName = "Button";
|
|
377
|
+
function ee({ label: c, required: d = !1 }) {
|
|
714
378
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
715
|
-
|
|
716
|
-
|
|
379
|
+
c,
|
|
380
|
+
d && /* @__PURE__ */ e.jsx("span", { className: "ml-1", children: "*" })
|
|
717
381
|
] }) });
|
|
718
382
|
}
|
|
719
|
-
const
|
|
720
|
-
options:
|
|
721
|
-
value:
|
|
383
|
+
const ra = ({
|
|
384
|
+
options: c = [],
|
|
385
|
+
value: d,
|
|
722
386
|
onChange: s,
|
|
723
387
|
placeholder: i = "Select option",
|
|
724
|
-
className:
|
|
725
|
-
disabled:
|
|
388
|
+
className: l = "",
|
|
389
|
+
disabled: r = !1,
|
|
726
390
|
search: n = !1,
|
|
727
|
-
label:
|
|
728
|
-
required:
|
|
729
|
-
name:
|
|
730
|
-
parentClass:
|
|
391
|
+
label: k = "",
|
|
392
|
+
required: M = !1,
|
|
393
|
+
name: x = "",
|
|
394
|
+
parentClass: m = "",
|
|
731
395
|
multiple: u = !1,
|
|
732
396
|
// ✅ NEW
|
|
733
|
-
dropdownMaxHeight:
|
|
397
|
+
dropdownMaxHeight: b = ""
|
|
734
398
|
}) => {
|
|
735
|
-
var
|
|
736
|
-
const [
|
|
737
|
-
(
|
|
738
|
-
),
|
|
739
|
-
const
|
|
740
|
-
return u ?
|
|
399
|
+
var C;
|
|
400
|
+
const [v, h] = T(!1), [N, j] = T(""), [S, R] = T(!0), P = ce(null), B = ce(null), Y = (f) => String(typeof f == "boolean" ? f : f ?? ""), z = u ? (d || []).map(Y) : Y(d), O = c.filter(
|
|
401
|
+
(f) => f.label.toLowerCase().includes(N.toLowerCase())
|
|
402
|
+
), p = (f) => {
|
|
403
|
+
const A = Y(f);
|
|
404
|
+
return u ? z.includes(A) : A === z;
|
|
741
405
|
};
|
|
742
|
-
|
|
743
|
-
const
|
|
744
|
-
|
|
406
|
+
W(() => {
|
|
407
|
+
const f = (A) => {
|
|
408
|
+
P.current && !P.current.contains(A.target) && (h(!1), j(""));
|
|
745
409
|
};
|
|
746
|
-
return document.addEventListener("mousedown",
|
|
747
|
-
}, []),
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
750
|
-
|
|
410
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
411
|
+
}, []), W(() => {
|
|
412
|
+
if (v && P.current) {
|
|
413
|
+
const f = P.current.getBoundingClientRect(), U = window.innerHeight - f.bottom;
|
|
414
|
+
R(U < 200);
|
|
751
415
|
}
|
|
752
|
-
}, [
|
|
753
|
-
|
|
754
|
-
}, [
|
|
755
|
-
const
|
|
756
|
-
let
|
|
757
|
-
if (
|
|
758
|
-
const
|
|
759
|
-
let
|
|
760
|
-
|
|
761
|
-
(
|
|
762
|
-
) :
|
|
416
|
+
}, [v]), W(() => {
|
|
417
|
+
v && B.current && B.current.focus();
|
|
418
|
+
}, [v]);
|
|
419
|
+
const _ = (f) => {
|
|
420
|
+
let A = f;
|
|
421
|
+
if (f === "true" ? A = !0 : f === "false" && (A = !1), u) {
|
|
422
|
+
const U = z.includes(Y(f));
|
|
423
|
+
let V;
|
|
424
|
+
U ? V = d.filter(
|
|
425
|
+
(X) => Y(X) !== Y(f)
|
|
426
|
+
) : V = [...d || [], A], s(V);
|
|
763
427
|
} else
|
|
764
|
-
s(
|
|
765
|
-
|
|
766
|
-
},
|
|
767
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
768
|
-
/* @__PURE__ */ e.jsx(
|
|
769
|
-
/* @__PURE__ */ e.jsxs("div", { className: `relative ${
|
|
428
|
+
s(A), h(!1);
|
|
429
|
+
j("");
|
|
430
|
+
}, F = u ? c.filter((f) => p(f.value)).map((f) => f.label).join(", ") : (C = c.find((f) => p(f.value))) == null ? void 0 : C.label;
|
|
431
|
+
return /* @__PURE__ */ e.jsxs("div", { className: m || "col-span-12", children: [
|
|
432
|
+
/* @__PURE__ */ e.jsx(ee, { label: k, required: M }),
|
|
433
|
+
/* @__PURE__ */ e.jsxs("div", { className: `relative ${l}`, ref: P, children: [
|
|
770
434
|
/* @__PURE__ */ e.jsxs(
|
|
771
435
|
"button",
|
|
772
436
|
{
|
|
773
437
|
type: "button",
|
|
774
|
-
onClick: () => !
|
|
775
|
-
disabled:
|
|
438
|
+
onClick: () => !r && h(!v),
|
|
439
|
+
disabled: r,
|
|
776
440
|
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
|
|
777
|
-
${
|
|
778
|
-
${
|
|
441
|
+
${F ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
|
|
442
|
+
${r ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
|
|
779
443
|
children: [
|
|
780
|
-
/* @__PURE__ */ e.jsx("span", { className: "truncate", children:
|
|
444
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: F || i }),
|
|
781
445
|
/* @__PURE__ */ e.jsx(
|
|
782
|
-
|
|
446
|
+
Fe,
|
|
783
447
|
{
|
|
784
|
-
className: `w-4 h-4 transition-transform ${
|
|
448
|
+
className: `w-4 h-4 transition-transform ${v ? "rotate-180" : ""}`
|
|
785
449
|
}
|
|
786
450
|
)
|
|
787
451
|
]
|
|
788
452
|
}
|
|
789
453
|
),
|
|
790
|
-
|
|
454
|
+
v && /* @__PURE__ */ e.jsxs(
|
|
791
455
|
"div",
|
|
792
456
|
{
|
|
793
457
|
className: `absolute z-50 w-full border rounded-md bg-white dark:bg-gray-700 shadow-lg
|
|
794
|
-
${
|
|
458
|
+
${S ? "bottom-full mb-1" : "top-full mt-1"}`,
|
|
795
459
|
children: [
|
|
796
460
|
n && /* @__PURE__ */ e.jsx("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
797
|
-
/* @__PURE__ */ e.jsx(
|
|
461
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
|
|
798
462
|
/* @__PURE__ */ e.jsx(
|
|
799
463
|
"input",
|
|
800
464
|
{
|
|
801
|
-
ref:
|
|
465
|
+
ref: B,
|
|
802
466
|
type: "text",
|
|
803
|
-
value:
|
|
804
|
-
onChange: (
|
|
467
|
+
value: N,
|
|
468
|
+
onChange: (f) => j(f.target.value),
|
|
805
469
|
placeholder: "Search...",
|
|
806
470
|
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"
|
|
807
471
|
}
|
|
@@ -812,21 +476,21 @@ const Hr = ({
|
|
|
812
476
|
{
|
|
813
477
|
className: "max-h-40 overflow-y-auto",
|
|
814
478
|
style: {
|
|
815
|
-
maxHeight:
|
|
479
|
+
maxHeight: b || ""
|
|
816
480
|
},
|
|
817
|
-
children:
|
|
481
|
+
children: O.length > 0 ? O.map((f) => /* @__PURE__ */ e.jsxs(
|
|
818
482
|
"button",
|
|
819
483
|
{
|
|
820
484
|
type: "button",
|
|
821
|
-
onClick: () =>
|
|
485
|
+
onClick: () => _(String(f.value)),
|
|
822
486
|
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
|
|
823
|
-
${
|
|
487
|
+
${p(f.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
|
|
824
488
|
children: [
|
|
825
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
826
|
-
u &&
|
|
489
|
+
/* @__PURE__ */ e.jsx("span", { children: f.label }),
|
|
490
|
+
u && p(f.value) && /* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4" })
|
|
827
491
|
]
|
|
828
492
|
},
|
|
829
|
-
String(
|
|
493
|
+
String(f.value)
|
|
830
494
|
)) : /* @__PURE__ */ e.jsx("div", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No options found" })
|
|
831
495
|
}
|
|
832
496
|
)
|
|
@@ -834,27 +498,27 @@ const Hr = ({
|
|
|
834
498
|
}
|
|
835
499
|
)
|
|
836
500
|
] })
|
|
837
|
-
] },
|
|
838
|
-
},
|
|
839
|
-
value:
|
|
840
|
-
onChange:
|
|
501
|
+
] }, x);
|
|
502
|
+
}, ta = ({
|
|
503
|
+
value: c = !0,
|
|
504
|
+
onChange: d,
|
|
841
505
|
text: s,
|
|
842
506
|
options: i = [],
|
|
843
|
-
label:
|
|
844
|
-
required:
|
|
507
|
+
label: l,
|
|
508
|
+
required: r,
|
|
845
509
|
name: n = "",
|
|
846
|
-
disabled:
|
|
847
|
-
parentClass:
|
|
510
|
+
disabled: k = !1,
|
|
511
|
+
parentClass: M = ""
|
|
848
512
|
}) => {
|
|
849
|
-
const
|
|
513
|
+
const x = i.length > 0 ? i : [
|
|
850
514
|
{ label: "Active", value: !0 },
|
|
851
515
|
{ label: "Inactive", value: !1 }
|
|
852
516
|
];
|
|
853
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
854
|
-
/* @__PURE__ */ e.jsx(
|
|
517
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: M || "col-span-12", children: [
|
|
518
|
+
/* @__PURE__ */ e.jsx(ee, { label: l, required: r }),
|
|
855
519
|
/* @__PURE__ */ e.jsxs("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: [
|
|
856
520
|
s && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: s }),
|
|
857
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-6", children:
|
|
521
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-6", children: x.map((m, u) => /* @__PURE__ */ e.jsxs(
|
|
858
522
|
"label",
|
|
859
523
|
{
|
|
860
524
|
className: "flex items-center gap-2 cursor-pointer select-none",
|
|
@@ -864,22 +528,22 @@ const Hr = ({
|
|
|
864
528
|
{
|
|
865
529
|
type: "radio",
|
|
866
530
|
name: "switch-field",
|
|
867
|
-
required:
|
|
868
|
-
value:
|
|
869
|
-
disabled:
|
|
870
|
-
checked:
|
|
871
|
-
onChange: () =>
|
|
531
|
+
required: r && u === 0,
|
|
532
|
+
value: m.value,
|
|
533
|
+
disabled: k,
|
|
534
|
+
checked: c === m.value,
|
|
535
|
+
onChange: () => d(m.value),
|
|
872
536
|
className: "w-4 h-4 border-gray-300 cursor-pointer"
|
|
873
537
|
}
|
|
874
538
|
),
|
|
875
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-gray-700 dark:text-white", children:
|
|
539
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm text-gray-700 dark:text-white", children: m.label })
|
|
876
540
|
]
|
|
877
541
|
},
|
|
878
542
|
u
|
|
879
543
|
)) })
|
|
880
544
|
] })
|
|
881
545
|
] }, n) });
|
|
882
|
-
},
|
|
546
|
+
}, fe = [
|
|
883
547
|
{ label: "Afghanistan", code: "AF", phone: "93" },
|
|
884
548
|
{ label: "Aland Islands", code: "AX", phone: "358" },
|
|
885
549
|
{ label: "Albania", code: "AL", phone: "355" },
|
|
@@ -1131,62 +795,62 @@ const Hr = ({
|
|
|
1131
795
|
{ label: "Zambia", code: "ZM", phone: "260" },
|
|
1132
796
|
{ label: "Zimbabwe", code: "ZW", phone: "263" }
|
|
1133
797
|
];
|
|
1134
|
-
function
|
|
1135
|
-
label:
|
|
1136
|
-
value:
|
|
798
|
+
function na({
|
|
799
|
+
label: c = "",
|
|
800
|
+
value: d = "",
|
|
1137
801
|
name: s = "",
|
|
1138
802
|
parentClass: i = "",
|
|
1139
|
-
onChange:
|
|
1140
|
-
disabled:
|
|
803
|
+
onChange: l,
|
|
804
|
+
disabled: r = !1,
|
|
1141
805
|
required: n = !1,
|
|
1142
|
-
placeholder:
|
|
1143
|
-
search:
|
|
1144
|
-
countriesList:
|
|
1145
|
-
defaultCountry:
|
|
806
|
+
placeholder: k = "Phone number",
|
|
807
|
+
search: M = !1,
|
|
808
|
+
countriesList: x = !1,
|
|
809
|
+
defaultCountry: m = ""
|
|
1146
810
|
}) {
|
|
1147
|
-
const u = (
|
|
1148
|
-
u(
|
|
1149
|
-
), [
|
|
1150
|
-
|
|
1151
|
-
if (typeof
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
|
|
811
|
+
const u = (p) => fe.find((_) => _.code == p), [b, v] = T(
|
|
812
|
+
u(m) || fe[0]
|
|
813
|
+
), [h, N] = T(""), [j, S] = T(!1), [R, P] = T(""), B = ce();
|
|
814
|
+
W(() => {
|
|
815
|
+
if (typeof d == "string" && d.startsWith("+")) {
|
|
816
|
+
const p = fe.filter((_) => d.startsWith("+" + _.phone)).sort((_, F) => F.phone.length - _.phone.length)[0];
|
|
817
|
+
if (p) {
|
|
818
|
+
v(p), N(d.replace("+" + p.phone, ""));
|
|
1155
819
|
return;
|
|
1156
820
|
}
|
|
1157
821
|
}
|
|
1158
|
-
|
|
1159
|
-
}, [
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
},
|
|
1164
|
-
|
|
822
|
+
N(d);
|
|
823
|
+
}, [d]);
|
|
824
|
+
const Y = (p) => {
|
|
825
|
+
const _ = p.target.value.replace(/\D/g, "");
|
|
826
|
+
N(_), b && l && l("+" + b.phone + _);
|
|
827
|
+
}, z = (p) => {
|
|
828
|
+
v(p), l && l("+" + p.phone + h), S(!1), P("");
|
|
1165
829
|
};
|
|
1166
|
-
|
|
1167
|
-
const
|
|
1168
|
-
|
|
830
|
+
W(() => {
|
|
831
|
+
const p = (_) => {
|
|
832
|
+
B.current && !B.current.contains(_.target) && S(!1);
|
|
1169
833
|
};
|
|
1170
|
-
return document.addEventListener("mousedown",
|
|
834
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
1171
835
|
}, []);
|
|
1172
|
-
const
|
|
1173
|
-
(
|
|
836
|
+
const O = fe.filter(
|
|
837
|
+
(p) => p.label.toLowerCase().includes(R.toLowerCase()) || p.phone.includes(R)
|
|
1174
838
|
);
|
|
1175
|
-
if (!
|
|
1176
|
-
const
|
|
1177
|
-
const
|
|
1178
|
-
|
|
839
|
+
if (!x) {
|
|
840
|
+
const p = (_) => {
|
|
841
|
+
const F = _.target.value.replace(/[^+\d]/g, ""), C = F.startsWith("+") ? "+" + F.replace(/[+]/g, "").slice(0) : F;
|
|
842
|
+
l(C);
|
|
1179
843
|
};
|
|
1180
844
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: i || "col-span-12", children: [
|
|
1181
|
-
/* @__PURE__ */ e.jsx(
|
|
845
|
+
/* @__PURE__ */ e.jsx(ee, { label: c, required: n }),
|
|
1182
846
|
/* @__PURE__ */ e.jsx(
|
|
1183
847
|
"input",
|
|
1184
848
|
{
|
|
1185
849
|
type: "text",
|
|
1186
|
-
value:
|
|
1187
|
-
onChange:
|
|
1188
|
-
placeholder:
|
|
1189
|
-
disabled:
|
|
850
|
+
value: d,
|
|
851
|
+
onChange: p,
|
|
852
|
+
placeholder: k,
|
|
853
|
+
disabled: r,
|
|
1190
854
|
required: n,
|
|
1191
855
|
className: `w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md \r
|
|
1192
856
|
bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none \r
|
|
@@ -1198,48 +862,48 @@ function Wr({
|
|
|
1198
862
|
] }, s) });
|
|
1199
863
|
}
|
|
1200
864
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: i || "col-span-12", children: [
|
|
1201
|
-
/* @__PURE__ */ e.jsx(
|
|
1202
|
-
/* @__PURE__ */ e.jsxs("div", { className: "relative ", ref:
|
|
865
|
+
/* @__PURE__ */ e.jsx(ee, { label: c, required: n }),
|
|
866
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative ", ref: B, children: [
|
|
1203
867
|
/* @__PURE__ */ e.jsxs(
|
|
1204
868
|
"div",
|
|
1205
869
|
{
|
|
1206
870
|
className: `h-[40px] flex items-center border rounded-md px-2 bg-white dark:bg-gray-700 transition-all
|
|
1207
|
-
${
|
|
1208
|
-
${
|
|
871
|
+
${j ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
|
|
872
|
+
${r ? "opacity-60 cursor-not-allowed" : ""}`,
|
|
1209
873
|
children: [
|
|
1210
874
|
/* @__PURE__ */ e.jsxs(
|
|
1211
875
|
"button",
|
|
1212
876
|
{
|
|
1213
877
|
type: "button",
|
|
1214
|
-
disabled:
|
|
1215
|
-
onClick: () =>
|
|
878
|
+
disabled: r,
|
|
879
|
+
onClick: () => S(!j),
|
|
1216
880
|
className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
|
|
1217
881
|
children: [
|
|
1218
|
-
|
|
882
|
+
b ? /* @__PURE__ */ e.jsx(
|
|
1219
883
|
"img",
|
|
1220
884
|
{
|
|
1221
|
-
src: `https://flagcdn.com/w20/${
|
|
1222
|
-
alt:
|
|
885
|
+
src: `https://flagcdn.com/w20/${b.code.toLowerCase()}.png`,
|
|
886
|
+
alt: b.code,
|
|
1223
887
|
className: "w-5 h-3 object-cover"
|
|
1224
888
|
}
|
|
1225
889
|
) : /* @__PURE__ */ e.jsx("span", { className: "text-gray-400 text-xs", children: "🌐" }),
|
|
1226
|
-
/* @__PURE__ */ e.jsx(
|
|
890
|
+
/* @__PURE__ */ e.jsx(Fe, { className: "w-3 h-3 text-gray-500" })
|
|
1227
891
|
]
|
|
1228
892
|
}
|
|
1229
893
|
),
|
|
1230
|
-
|
|
894
|
+
b && /* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
|
|
1231
895
|
"+",
|
|
1232
|
-
|
|
896
|
+
b.phone
|
|
1233
897
|
] }),
|
|
1234
898
|
/* @__PURE__ */ e.jsx(
|
|
1235
899
|
"input",
|
|
1236
900
|
{
|
|
1237
901
|
type: "tel",
|
|
1238
|
-
value:
|
|
1239
|
-
onChange:
|
|
902
|
+
value: h,
|
|
903
|
+
onChange: Y,
|
|
1240
904
|
required: n,
|
|
1241
|
-
disabled:
|
|
1242
|
-
placeholder:
|
|
905
|
+
disabled: r || !b,
|
|
906
|
+
placeholder: b ? k : "Select a country",
|
|
1243
907
|
className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
|
|
1244
908
|
}
|
|
1245
909
|
),
|
|
@@ -1250,7 +914,7 @@ function Wr({
|
|
|
1250
914
|
required: n,
|
|
1251
915
|
tabIndex: -1,
|
|
1252
916
|
readOnly: !0,
|
|
1253
|
-
value:
|
|
917
|
+
value: b && h ? "+" + b.phone + h : "",
|
|
1254
918
|
style: {
|
|
1255
919
|
position: "absolute",
|
|
1256
920
|
opacity: 0,
|
|
@@ -1262,62 +926,62 @@ function Wr({
|
|
|
1262
926
|
]
|
|
1263
927
|
}
|
|
1264
928
|
),
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
/* @__PURE__ */ e.jsx(
|
|
929
|
+
j && /* @__PURE__ */ e.jsxs("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: [
|
|
930
|
+
M && /* @__PURE__ */ e.jsx("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
931
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
|
|
1268
932
|
/* @__PURE__ */ e.jsx(
|
|
1269
933
|
"input",
|
|
1270
934
|
{
|
|
1271
935
|
type: "text",
|
|
1272
|
-
value:
|
|
1273
|
-
onChange: (
|
|
936
|
+
value: R,
|
|
937
|
+
onChange: (p) => P(p.target.value),
|
|
1274
938
|
placeholder: "Search country...",
|
|
1275
939
|
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 "
|
|
1276
940
|
}
|
|
1277
941
|
)
|
|
1278
942
|
] }) }),
|
|
1279
|
-
|
|
943
|
+
O.map((p) => /* @__PURE__ */ e.jsxs(
|
|
1280
944
|
"button",
|
|
1281
945
|
{
|
|
1282
946
|
type: "button",
|
|
1283
|
-
onClick: () =>
|
|
947
|
+
onClick: () => z(p),
|
|
1284
948
|
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",
|
|
1285
949
|
children: [
|
|
1286
950
|
/* @__PURE__ */ e.jsx(
|
|
1287
951
|
"img",
|
|
1288
952
|
{
|
|
1289
|
-
src: `https://flagcdn.com/w20/${
|
|
1290
|
-
alt:
|
|
953
|
+
src: `https://flagcdn.com/w20/${p.code.toLowerCase()}.png`,
|
|
954
|
+
alt: p.code,
|
|
1291
955
|
className: "w-5 h-3 object-cover"
|
|
1292
956
|
}
|
|
1293
957
|
),
|
|
1294
958
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
1295
|
-
|
|
959
|
+
p.label,
|
|
1296
960
|
" (+",
|
|
1297
|
-
|
|
961
|
+
p.phone,
|
|
1298
962
|
")"
|
|
1299
963
|
] })
|
|
1300
964
|
]
|
|
1301
965
|
},
|
|
1302
|
-
|
|
966
|
+
p.code
|
|
1303
967
|
))
|
|
1304
968
|
] })
|
|
1305
969
|
] })
|
|
1306
970
|
] }, s) });
|
|
1307
971
|
}
|
|
1308
|
-
const
|
|
1309
|
-
({ className:
|
|
1310
|
-
const
|
|
972
|
+
const Ie = ve.forwardRef(
|
|
973
|
+
({ className: c = "", label: d, required: s, ...i }, l) => {
|
|
974
|
+
const r = `
|
|
1311
975
|
placeholder-gray-400 dark:placeholder-gray-400
|
|
1312
|
-
${
|
|
976
|
+
${c}
|
|
1313
977
|
`.trim();
|
|
1314
978
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: i.parentClass || "col-span-12", children: [
|
|
1315
|
-
/* @__PURE__ */ e.jsx(
|
|
979
|
+
/* @__PURE__ */ e.jsx(ee, { label: d, required: s }),
|
|
1316
980
|
/* @__PURE__ */ e.jsx("div", { className: "relative", children: /* @__PURE__ */ e.jsx(
|
|
1317
981
|
"textarea",
|
|
1318
982
|
{
|
|
1319
|
-
className:
|
|
1320
|
-
ref:
|
|
983
|
+
className: r,
|
|
984
|
+
ref: l,
|
|
1321
985
|
required: s,
|
|
1322
986
|
...i
|
|
1323
987
|
}
|
|
@@ -1325,45 +989,45 @@ const hr = Oe.forwardRef(
|
|
|
1325
989
|
] }, i.name) });
|
|
1326
990
|
}
|
|
1327
991
|
);
|
|
1328
|
-
|
|
1329
|
-
const
|
|
1330
|
-
label:
|
|
1331
|
-
value:
|
|
992
|
+
Ie.displayName = "TextArea";
|
|
993
|
+
const la = ({
|
|
994
|
+
label: c = "",
|
|
995
|
+
value: d = null,
|
|
1332
996
|
onChange: s,
|
|
1333
997
|
required: i = !1,
|
|
1334
|
-
accept:
|
|
1335
|
-
id:
|
|
998
|
+
accept: l = "image/*",
|
|
999
|
+
id: r,
|
|
1336
1000
|
dragDrop: n = !1,
|
|
1337
|
-
name:
|
|
1338
|
-
parentClass:
|
|
1001
|
+
name: k = "",
|
|
1002
|
+
parentClass: M = ""
|
|
1339
1003
|
}) => {
|
|
1340
|
-
const [
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
}, [
|
|
1344
|
-
const
|
|
1345
|
-
if (!
|
|
1346
|
-
|
|
1004
|
+
const [x, m] = T(d), [u, b] = T(!1), v = ce(null);
|
|
1005
|
+
W(() => {
|
|
1006
|
+
m(d);
|
|
1007
|
+
}, [d]);
|
|
1008
|
+
const h = (R) => {
|
|
1009
|
+
if (!R || R.length === 0) {
|
|
1010
|
+
m(null), s == null || s(null);
|
|
1347
1011
|
return;
|
|
1348
1012
|
}
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1351
|
-
},
|
|
1352
|
-
n && (
|
|
1353
|
-
},
|
|
1354
|
-
n && (
|
|
1355
|
-
},
|
|
1356
|
-
n && (
|
|
1013
|
+
const P = R[0], B = URL.createObjectURL(P);
|
|
1014
|
+
m({ file: P, preview: B }), s == null || s(B);
|
|
1015
|
+
}, N = (R) => {
|
|
1016
|
+
n && (R.preventDefault(), b(!0));
|
|
1017
|
+
}, j = (R) => {
|
|
1018
|
+
n && (R.preventDefault(), b(!1));
|
|
1019
|
+
}, S = (R) => {
|
|
1020
|
+
n && (R.preventDefault(), b(!1), h(R.dataTransfer.files));
|
|
1357
1021
|
};
|
|
1358
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className:
|
|
1359
|
-
/* @__PURE__ */ e.jsx(
|
|
1022
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: M || "col-span-12", children: [
|
|
1023
|
+
/* @__PURE__ */ e.jsx(ee, { label: c, required: i }),
|
|
1360
1024
|
/* @__PURE__ */ e.jsxs(
|
|
1361
1025
|
"div",
|
|
1362
1026
|
{
|
|
1363
1027
|
className: `relative rounded-md p-2 transition-all ${u ? "border border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900" : "border bg-gray-50 dark:bg-gray-700"}`,
|
|
1364
|
-
onDragOver:
|
|
1365
|
-
onDragLeave:
|
|
1366
|
-
onDrop:
|
|
1028
|
+
onDragOver: N,
|
|
1029
|
+
onDragLeave: j,
|
|
1030
|
+
onDrop: S,
|
|
1367
1031
|
children: [
|
|
1368
1032
|
/* @__PURE__ */ e.jsxs(
|
|
1369
1033
|
"div",
|
|
@@ -1374,16 +1038,16 @@ const qr = ({
|
|
|
1374
1038
|
"div",
|
|
1375
1039
|
{
|
|
1376
1040
|
className: "cursor-pointer",
|
|
1377
|
-
onClick: () =>
|
|
1378
|
-
children:
|
|
1041
|
+
onClick: () => v.current.click(),
|
|
1042
|
+
children: x ? /* @__PURE__ */ e.jsx(
|
|
1379
1043
|
"img",
|
|
1380
1044
|
{
|
|
1381
|
-
src:
|
|
1045
|
+
src: x.preview || x,
|
|
1382
1046
|
alt: "preview",
|
|
1383
1047
|
className: "object-cover w-20 h-20 rounded-full"
|
|
1384
1048
|
}
|
|
1385
1049
|
) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx("div", { className: "rounded-full bg-gray-200 dark:bg-gray-800 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
|
|
1386
|
-
|
|
1050
|
+
Re,
|
|
1387
1051
|
{
|
|
1388
1052
|
icon: "ri:image-add-fill",
|
|
1389
1053
|
className: "text-gray-400 w-10 h-10"
|
|
@@ -1394,12 +1058,12 @@ const qr = ({
|
|
|
1394
1058
|
/* @__PURE__ */ e.jsx(
|
|
1395
1059
|
"input",
|
|
1396
1060
|
{
|
|
1397
|
-
ref:
|
|
1398
|
-
id:
|
|
1061
|
+
ref: v,
|
|
1062
|
+
id: r,
|
|
1399
1063
|
type: "file",
|
|
1400
|
-
accept:
|
|
1401
|
-
onChange: (
|
|
1402
|
-
required: i && !
|
|
1064
|
+
accept: l,
|
|
1065
|
+
onChange: (R) => h(R.target.files),
|
|
1066
|
+
required: i && !x,
|
|
1403
1067
|
className: "inline-flex items-center justify-center p-2 text-gray-400 text-sm file:cursor-pointer"
|
|
1404
1068
|
}
|
|
1405
1069
|
)
|
|
@@ -1410,49 +1074,49 @@ const qr = ({
|
|
|
1410
1074
|
]
|
|
1411
1075
|
}
|
|
1412
1076
|
)
|
|
1413
|
-
] },
|
|
1414
|
-
},
|
|
1077
|
+
] }, k) });
|
|
1078
|
+
}, Be = ve.forwardRef(
|
|
1415
1079
|
({
|
|
1416
|
-
label:
|
|
1417
|
-
required:
|
|
1080
|
+
label: c,
|
|
1081
|
+
required: d,
|
|
1418
1082
|
parentClass: s = "",
|
|
1419
1083
|
className: i = "",
|
|
1420
|
-
type:
|
|
1421
|
-
onKeyDown:
|
|
1084
|
+
type: l = "text",
|
|
1085
|
+
onKeyDown: r,
|
|
1422
1086
|
...n
|
|
1423
|
-
},
|
|
1424
|
-
const [
|
|
1425
|
-
|
|
1087
|
+
}, k) => {
|
|
1088
|
+
const [M, x] = T(!1), m = (b) => {
|
|
1089
|
+
l === "number" && ["e", "E"].includes(b.key) && b.preventDefault(), r == null || r(b);
|
|
1426
1090
|
}, u = `
|
|
1427
1091
|
h-10 placeholder-gray-400 dark:placeholder-gray-400
|
|
1428
|
-
${
|
|
1092
|
+
${l === "password" ? "pr-10" : ""}
|
|
1429
1093
|
${i}
|
|
1430
1094
|
`.trim();
|
|
1431
1095
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: s || "col-span-12", children: [
|
|
1432
|
-
/* @__PURE__ */ e.jsx(
|
|
1096
|
+
/* @__PURE__ */ e.jsx(ee, { label: c, required: d }),
|
|
1433
1097
|
/* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
1434
1098
|
/* @__PURE__ */ e.jsx(
|
|
1435
1099
|
"input",
|
|
1436
1100
|
{
|
|
1437
|
-
type:
|
|
1438
|
-
ref:
|
|
1439
|
-
required:
|
|
1440
|
-
onKeyDown:
|
|
1101
|
+
type: l === "password" && M ? "text" : l,
|
|
1102
|
+
ref: k,
|
|
1103
|
+
required: d,
|
|
1104
|
+
onKeyDown: m,
|
|
1441
1105
|
className: u,
|
|
1442
1106
|
...n
|
|
1443
1107
|
}
|
|
1444
1108
|
),
|
|
1445
|
-
|
|
1109
|
+
l === "password" && /* @__PURE__ */ e.jsx(
|
|
1446
1110
|
"button",
|
|
1447
1111
|
{
|
|
1448
1112
|
type: "button",
|
|
1449
1113
|
tabIndex: -1,
|
|
1450
|
-
onClick: () =>
|
|
1114
|
+
onClick: () => x((b) => !b),
|
|
1451
1115
|
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",
|
|
1452
1116
|
children: /* @__PURE__ */ e.jsx(
|
|
1453
|
-
|
|
1117
|
+
Re,
|
|
1454
1118
|
{
|
|
1455
|
-
icon:
|
|
1119
|
+
icon: M ? "mdi:eye-off-outline" : "mdi:eye-outline",
|
|
1456
1120
|
className: "w-5 h-5"
|
|
1457
1121
|
}
|
|
1458
1122
|
)
|
|
@@ -1462,28 +1126,28 @@ const qr = ({
|
|
|
1462
1126
|
] }, n.name) });
|
|
1463
1127
|
}
|
|
1464
1128
|
);
|
|
1465
|
-
|
|
1466
|
-
const
|
|
1467
|
-
key:
|
|
1468
|
-
editorKey:
|
|
1129
|
+
Be.displayName = "Input";
|
|
1130
|
+
const sa = ({
|
|
1131
|
+
key: c,
|
|
1132
|
+
editorKey: d = "",
|
|
1469
1133
|
value: s = "",
|
|
1470
1134
|
onChange: i,
|
|
1471
|
-
label:
|
|
1472
|
-
required:
|
|
1135
|
+
label: l = "",
|
|
1136
|
+
required: r = !1,
|
|
1473
1137
|
placeholder: n = "",
|
|
1474
|
-
parentClass:
|
|
1475
|
-
height:
|
|
1476
|
-
inline:
|
|
1477
|
-
disabled:
|
|
1138
|
+
parentClass: k = "col-span-12",
|
|
1139
|
+
height: M = 400,
|
|
1140
|
+
inline: x = !1,
|
|
1141
|
+
disabled: m = !1,
|
|
1478
1142
|
plugins: u,
|
|
1479
|
-
toolbar:
|
|
1480
|
-
menubar:
|
|
1481
|
-
fontFamily:
|
|
1482
|
-
initConfig:
|
|
1483
|
-
imageUploadHandler:
|
|
1143
|
+
toolbar: b,
|
|
1144
|
+
menubar: v = !1,
|
|
1145
|
+
fontFamily: h = "Inter, sans-serif",
|
|
1146
|
+
initConfig: N = {},
|
|
1147
|
+
imageUploadHandler: j
|
|
1484
1148
|
// ✅ Promise function passed from parent
|
|
1485
1149
|
}) => {
|
|
1486
|
-
const
|
|
1150
|
+
const S = [
|
|
1487
1151
|
"advlist",
|
|
1488
1152
|
"autolink",
|
|
1489
1153
|
"lists",
|
|
@@ -1501,307 +1165,307 @@ const Jr = ({
|
|
|
1501
1165
|
"table",
|
|
1502
1166
|
"help",
|
|
1503
1167
|
"wordcount"
|
|
1504
|
-
],
|
|
1505
|
-
if (!
|
|
1506
|
-
|
|
1168
|
+
], R = "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview", P = (B) => new Promise((Y, z) => {
|
|
1169
|
+
if (!j) {
|
|
1170
|
+
Y(`data:${B.blob().type};base64,${B.base64()}`);
|
|
1507
1171
|
return;
|
|
1508
1172
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
}).catch((
|
|
1512
|
-
|
|
1513
|
-
typeof
|
|
1173
|
+
j(B).then((O) => {
|
|
1174
|
+
O ? Y(O) : z("Upload failed: No URL returned");
|
|
1175
|
+
}).catch((O) => {
|
|
1176
|
+
z(
|
|
1177
|
+
typeof O == "string" ? O : (O == null ? void 0 : O.message) || "Image upload failed"
|
|
1514
1178
|
);
|
|
1515
1179
|
});
|
|
1516
1180
|
});
|
|
1517
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
1518
|
-
|
|
1181
|
+
return /* @__PURE__ */ e.jsxs("div", { className: k, children: [
|
|
1182
|
+
l && /* @__PURE__ */ e.jsx(ee, { label: l, required: r }),
|
|
1519
1183
|
/* @__PURE__ */ e.jsx(
|
|
1520
|
-
|
|
1184
|
+
Ze,
|
|
1521
1185
|
{
|
|
1522
|
-
apiKey:
|
|
1186
|
+
apiKey: d,
|
|
1523
1187
|
value: s,
|
|
1524
|
-
disabled:
|
|
1188
|
+
disabled: m,
|
|
1525
1189
|
init: {
|
|
1526
|
-
height:
|
|
1527
|
-
inline:
|
|
1528
|
-
menubar:
|
|
1190
|
+
height: M,
|
|
1191
|
+
inline: x,
|
|
1192
|
+
menubar: v,
|
|
1529
1193
|
branding: !1,
|
|
1530
1194
|
statusbar: !0,
|
|
1531
1195
|
automatic_uploads: !0,
|
|
1532
|
-
images_upload_handler:
|
|
1533
|
-
plugins: u ??
|
|
1534
|
-
toolbar:
|
|
1196
|
+
images_upload_handler: P,
|
|
1197
|
+
plugins: u ?? S,
|
|
1198
|
+
toolbar: b ?? R,
|
|
1535
1199
|
placeholder: n,
|
|
1536
1200
|
content_style: `
|
|
1537
1201
|
body {
|
|
1538
|
-
font-family: ${
|
|
1202
|
+
font-family: ${h};
|
|
1539
1203
|
}
|
|
1540
1204
|
`,
|
|
1541
|
-
...
|
|
1205
|
+
...N
|
|
1542
1206
|
},
|
|
1543
|
-
onEditorChange: (
|
|
1544
|
-
i && i(
|
|
1207
|
+
onEditorChange: (B) => {
|
|
1208
|
+
i && i(B);
|
|
1545
1209
|
}
|
|
1546
1210
|
}
|
|
1547
1211
|
)
|
|
1548
|
-
] },
|
|
1549
|
-
},
|
|
1550
|
-
name:
|
|
1551
|
-
label:
|
|
1212
|
+
] }, c);
|
|
1213
|
+
}, oa = ({
|
|
1214
|
+
name: c = "",
|
|
1215
|
+
label: d = "",
|
|
1552
1216
|
// label for single checkbox
|
|
1553
1217
|
options: s = [],
|
|
1554
1218
|
// array of { label, value } for multiple
|
|
1555
1219
|
value: i = null,
|
|
1556
1220
|
// boolean for single, array for multiple, or string for single select
|
|
1557
|
-
onChange:
|
|
1558
|
-
disabled:
|
|
1221
|
+
onChange: l,
|
|
1222
|
+
disabled: r = !1,
|
|
1559
1223
|
required: n = !1,
|
|
1560
|
-
parentClass:
|
|
1561
|
-
className:
|
|
1562
|
-
multiSelect:
|
|
1224
|
+
parentClass: k = "col-span-12",
|
|
1225
|
+
className: M = "",
|
|
1226
|
+
multiSelect: x = !1
|
|
1563
1227
|
// ✅ if true, only one option can be selected (like radio)
|
|
1564
1228
|
}) => {
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1567
|
-
},
|
|
1568
|
-
if (
|
|
1569
|
-
if (!
|
|
1570
|
-
|
|
1229
|
+
const m = Array.isArray(s) && s.length > 0, u = (h) => m ? x ? Array.isArray(i) && i.includes(h) : i === h : !!i, b = (h) => {
|
|
1230
|
+
l == null || l(h.target.checked, c);
|
|
1231
|
+
}, v = (h, N) => {
|
|
1232
|
+
if (l)
|
|
1233
|
+
if (!x)
|
|
1234
|
+
l(N ? h : "", c);
|
|
1571
1235
|
else {
|
|
1572
|
-
const
|
|
1573
|
-
if (
|
|
1574
|
-
|
|
1236
|
+
const j = Array.isArray(i) ? [...i] : [];
|
|
1237
|
+
if (N)
|
|
1238
|
+
j.includes(h) || j.push(h);
|
|
1575
1239
|
else {
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1240
|
+
const S = j.indexOf(h);
|
|
1241
|
+
S > -1 && j.splice(S, 1);
|
|
1578
1242
|
}
|
|
1579
|
-
|
|
1243
|
+
l(j, c);
|
|
1580
1244
|
}
|
|
1581
1245
|
};
|
|
1582
|
-
return
|
|
1583
|
-
/* @__PURE__ */ e.jsx(
|
|
1584
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: s.map((
|
|
1246
|
+
return m ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { className: `${k}`, children: [
|
|
1247
|
+
/* @__PURE__ */ e.jsx(ee, { label: d, required: n }),
|
|
1248
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-y-2", children: s.map((h, N) => /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
1585
1249
|
/* @__PURE__ */ e.jsx(
|
|
1586
1250
|
"input",
|
|
1587
1251
|
{
|
|
1588
1252
|
type: "checkbox",
|
|
1589
|
-
name:
|
|
1590
|
-
value:
|
|
1591
|
-
checked: u(
|
|
1592
|
-
disabled:
|
|
1593
|
-
required: n &&
|
|
1594
|
-
onChange: (
|
|
1595
|
-
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 ${
|
|
1253
|
+
name: c,
|
|
1254
|
+
value: h.value,
|
|
1255
|
+
checked: u(h.value),
|
|
1256
|
+
disabled: r || h.disabled,
|
|
1257
|
+
required: n && N === 0,
|
|
1258
|
+
onChange: (j) => v(h.value, j.target.checked),
|
|
1259
|
+
className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${M}`
|
|
1596
1260
|
},
|
|
1597
|
-
|
|
1261
|
+
c
|
|
1598
1262
|
),
|
|
1599
|
-
|
|
1263
|
+
h.label && /* @__PURE__ */ e.jsx(
|
|
1600
1264
|
"label",
|
|
1601
1265
|
{
|
|
1602
|
-
htmlFor:
|
|
1266
|
+
htmlFor: c,
|
|
1603
1267
|
className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
|
|
1604
|
-
children:
|
|
1268
|
+
children: h.label
|
|
1605
1269
|
}
|
|
1606
1270
|
)
|
|
1607
|
-
] },
|
|
1608
|
-
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: `flex items-center ${
|
|
1271
|
+
] }, h.value || h.label)) })
|
|
1272
|
+
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: `flex items-center ${k}`, children: [
|
|
1609
1273
|
/* @__PURE__ */ e.jsx(
|
|
1610
1274
|
"input",
|
|
1611
1275
|
{
|
|
1612
1276
|
type: "checkbox",
|
|
1613
|
-
name:
|
|
1277
|
+
name: c,
|
|
1614
1278
|
checked: u(),
|
|
1615
|
-
disabled:
|
|
1279
|
+
disabled: r,
|
|
1616
1280
|
required: n,
|
|
1617
|
-
onChange:
|
|
1618
|
-
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 ${
|
|
1281
|
+
onChange: b,
|
|
1282
|
+
className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${M}`
|
|
1619
1283
|
}
|
|
1620
1284
|
),
|
|
1621
|
-
|
|
1285
|
+
d && /* @__PURE__ */ e.jsx(
|
|
1622
1286
|
"label",
|
|
1623
1287
|
{
|
|
1624
|
-
htmlFor:
|
|
1288
|
+
htmlFor: c,
|
|
1625
1289
|
className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
|
|
1626
|
-
children:
|
|
1290
|
+
children: d
|
|
1627
1291
|
}
|
|
1628
1292
|
)
|
|
1629
1293
|
] });
|
|
1630
|
-
},
|
|
1294
|
+
}, $e = ({ field: c, formData: d, handleChange: s }) => {
|
|
1631
1295
|
const {
|
|
1632
1296
|
key: i,
|
|
1633
|
-
label:
|
|
1634
|
-
type:
|
|
1297
|
+
label: l,
|
|
1298
|
+
type: r,
|
|
1635
1299
|
options: n,
|
|
1636
|
-
placeholder:
|
|
1637
|
-
rows:
|
|
1638
|
-
inputClass:
|
|
1639
|
-
search:
|
|
1300
|
+
placeholder: k,
|
|
1301
|
+
rows: M,
|
|
1302
|
+
inputClass: x,
|
|
1303
|
+
search: m,
|
|
1640
1304
|
accept: u,
|
|
1641
|
-
text:
|
|
1642
|
-
required:
|
|
1643
|
-
minLength:
|
|
1644
|
-
dragDrop:
|
|
1645
|
-
parentClass:
|
|
1646
|
-
countriesList:
|
|
1647
|
-
defaultCountry:
|
|
1648
|
-
multiple:
|
|
1649
|
-
dropdownMaxHeight:
|
|
1650
|
-
editorKey:
|
|
1651
|
-
fontFamily:
|
|
1652
|
-
disabled:
|
|
1653
|
-
} =
|
|
1654
|
-
let
|
|
1655
|
-
|
|
1656
|
-
const
|
|
1657
|
-
switch (
|
|
1305
|
+
text: b,
|
|
1306
|
+
required: v = !1,
|
|
1307
|
+
minLength: h,
|
|
1308
|
+
dragDrop: N,
|
|
1309
|
+
parentClass: j,
|
|
1310
|
+
countriesList: S,
|
|
1311
|
+
defaultCountry: R,
|
|
1312
|
+
multiple: P,
|
|
1313
|
+
dropdownMaxHeight: B,
|
|
1314
|
+
editorKey: Y,
|
|
1315
|
+
fontFamily: z,
|
|
1316
|
+
disabled: O
|
|
1317
|
+
} = c;
|
|
1318
|
+
let p = d == null ? void 0 : d[i];
|
|
1319
|
+
p == null && (p = "");
|
|
1320
|
+
const _ = k || (r === "select" ? `Select ${l}` : `Enter ${l}`), F = "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";
|
|
1321
|
+
switch (r) {
|
|
1658
1322
|
case "select":
|
|
1659
1323
|
return /* @__PURE__ */ e.jsx(
|
|
1660
|
-
|
|
1324
|
+
ra,
|
|
1661
1325
|
{
|
|
1662
1326
|
options: n || [],
|
|
1663
|
-
value:
|
|
1664
|
-
onChange: (
|
|
1665
|
-
placeholder:
|
|
1666
|
-
className:
|
|
1667
|
-
search:
|
|
1668
|
-
required:
|
|
1669
|
-
label:
|
|
1327
|
+
value: p,
|
|
1328
|
+
onChange: (C) => s(i, C),
|
|
1329
|
+
placeholder: _,
|
|
1330
|
+
className: x || "",
|
|
1331
|
+
search: m,
|
|
1332
|
+
required: v,
|
|
1333
|
+
label: l,
|
|
1670
1334
|
name: i,
|
|
1671
|
-
disabled:
|
|
1672
|
-
parentClass:
|
|
1673
|
-
multiple:
|
|
1674
|
-
dropdownMaxHeight:
|
|
1335
|
+
disabled: O,
|
|
1336
|
+
parentClass: j,
|
|
1337
|
+
multiple: P,
|
|
1338
|
+
dropdownMaxHeight: B
|
|
1675
1339
|
}
|
|
1676
1340
|
);
|
|
1677
1341
|
case "checkbox":
|
|
1678
1342
|
return /* @__PURE__ */ e.jsx(
|
|
1679
|
-
|
|
1343
|
+
oa,
|
|
1680
1344
|
{
|
|
1681
1345
|
name: i,
|
|
1682
|
-
label:
|
|
1346
|
+
label: l,
|
|
1683
1347
|
options: n || [],
|
|
1684
|
-
value:
|
|
1685
|
-
onChange: (
|
|
1686
|
-
required:
|
|
1687
|
-
parentClass:
|
|
1688
|
-
className:
|
|
1689
|
-
multiSelect:
|
|
1690
|
-
disabled:
|
|
1348
|
+
value: p,
|
|
1349
|
+
onChange: (C) => s(i, C),
|
|
1350
|
+
required: v,
|
|
1351
|
+
parentClass: j,
|
|
1352
|
+
className: x || "",
|
|
1353
|
+
multiSelect: P,
|
|
1354
|
+
disabled: O
|
|
1691
1355
|
}
|
|
1692
1356
|
);
|
|
1693
1357
|
case "switch":
|
|
1694
1358
|
return /* @__PURE__ */ e.jsx(
|
|
1695
|
-
|
|
1359
|
+
ta,
|
|
1696
1360
|
{
|
|
1697
|
-
value:
|
|
1698
|
-
onChange: (
|
|
1699
|
-
text:
|
|
1361
|
+
value: p,
|
|
1362
|
+
onChange: (C) => s(i, C),
|
|
1363
|
+
text: b,
|
|
1700
1364
|
options: n || [],
|
|
1701
|
-
label:
|
|
1702
|
-
required:
|
|
1365
|
+
label: l,
|
|
1366
|
+
required: v,
|
|
1703
1367
|
name: i,
|
|
1704
|
-
disabled:
|
|
1705
|
-
parentClass:
|
|
1368
|
+
disabled: O,
|
|
1369
|
+
parentClass: j
|
|
1706
1370
|
}
|
|
1707
1371
|
);
|
|
1708
1372
|
case "phone":
|
|
1709
1373
|
return /* @__PURE__ */ e.jsx(
|
|
1710
|
-
|
|
1374
|
+
na,
|
|
1711
1375
|
{
|
|
1712
|
-
value:
|
|
1713
|
-
onChange: (
|
|
1714
|
-
countriesList:
|
|
1715
|
-
defaultCountry:
|
|
1716
|
-
required:
|
|
1717
|
-
placeholder:
|
|
1718
|
-
search:
|
|
1719
|
-
label:
|
|
1376
|
+
value: p,
|
|
1377
|
+
onChange: (C) => s(i, C),
|
|
1378
|
+
countriesList: S,
|
|
1379
|
+
defaultCountry: R,
|
|
1380
|
+
required: v,
|
|
1381
|
+
placeholder: _,
|
|
1382
|
+
search: m,
|
|
1383
|
+
label: l,
|
|
1720
1384
|
name: i,
|
|
1721
|
-
disabled:
|
|
1722
|
-
parentClass:
|
|
1385
|
+
disabled: O,
|
|
1386
|
+
parentClass: j
|
|
1723
1387
|
}
|
|
1724
1388
|
);
|
|
1725
1389
|
case "textarea":
|
|
1726
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1727
|
-
|
|
1391
|
+
Ie,
|
|
1728
1392
|
{
|
|
1729
|
-
value:
|
|
1730
|
-
onChange: (
|
|
1731
|
-
placeholder:
|
|
1732
|
-
rows:
|
|
1733
|
-
className: `${
|
|
1734
|
-
required:
|
|
1393
|
+
value: p,
|
|
1394
|
+
onChange: (C) => s(i, C.target.value),
|
|
1395
|
+
placeholder: _,
|
|
1396
|
+
rows: M || 3,
|
|
1397
|
+
className: `${F} ${x || ""}`,
|
|
1398
|
+
required: v,
|
|
1735
1399
|
name: i,
|
|
1736
|
-
label:
|
|
1737
|
-
disabled:
|
|
1738
|
-
parentClass:
|
|
1400
|
+
label: l,
|
|
1401
|
+
disabled: O,
|
|
1402
|
+
parentClass: j
|
|
1739
1403
|
}
|
|
1740
1404
|
);
|
|
1741
1405
|
case "image":
|
|
1742
1406
|
return /* @__PURE__ */ e.jsx(
|
|
1743
|
-
|
|
1407
|
+
la,
|
|
1744
1408
|
{
|
|
1745
|
-
value:
|
|
1746
|
-
onChange: (
|
|
1747
|
-
required:
|
|
1409
|
+
value: p,
|
|
1410
|
+
onChange: (C) => s(i, C),
|
|
1411
|
+
required: v,
|
|
1748
1412
|
accept: u || "image/*",
|
|
1749
1413
|
id: `file-${i}`,
|
|
1750
|
-
dragDrop:
|
|
1751
|
-
label:
|
|
1414
|
+
dragDrop: N,
|
|
1415
|
+
label: l,
|
|
1752
1416
|
name: i,
|
|
1753
|
-
parentClass:
|
|
1417
|
+
parentClass: j
|
|
1754
1418
|
}
|
|
1755
1419
|
);
|
|
1756
1420
|
case "tinyEditor":
|
|
1757
1421
|
return /* @__PURE__ */ e.jsx(
|
|
1758
|
-
|
|
1422
|
+
sa,
|
|
1759
1423
|
{
|
|
1760
|
-
value:
|
|
1761
|
-
onChange: (
|
|
1762
|
-
required:
|
|
1763
|
-
placeholder:
|
|
1764
|
-
label:
|
|
1765
|
-
parentClass:
|
|
1766
|
-
fontFamily:
|
|
1767
|
-
editorKey:
|
|
1768
|
-
disabled:
|
|
1424
|
+
value: p,
|
|
1425
|
+
onChange: (C) => s(i, C),
|
|
1426
|
+
required: v,
|
|
1427
|
+
placeholder: _,
|
|
1428
|
+
label: l,
|
|
1429
|
+
parentClass: j,
|
|
1430
|
+
fontFamily: z,
|
|
1431
|
+
editorKey: Y,
|
|
1432
|
+
disabled: O
|
|
1769
1433
|
},
|
|
1770
1434
|
`editor-${i}`
|
|
1771
1435
|
);
|
|
1772
1436
|
default:
|
|
1773
1437
|
return /* @__PURE__ */ e.jsx(
|
|
1774
|
-
|
|
1438
|
+
Be,
|
|
1775
1439
|
{
|
|
1776
|
-
type:
|
|
1777
|
-
value:
|
|
1778
|
-
onChange: (
|
|
1779
|
-
placeholder:
|
|
1780
|
-
className: `${
|
|
1781
|
-
required:
|
|
1440
|
+
type: r || "text",
|
|
1441
|
+
value: p,
|
|
1442
|
+
onChange: (C) => s(i, C.target.value),
|
|
1443
|
+
placeholder: _,
|
|
1444
|
+
className: `${F} ${x || ""}`,
|
|
1445
|
+
required: v,
|
|
1782
1446
|
name: i,
|
|
1783
|
-
minLength:
|
|
1784
|
-
label:
|
|
1785
|
-
parentClass:
|
|
1786
|
-
disabled:
|
|
1447
|
+
minLength: h,
|
|
1448
|
+
label: l,
|
|
1449
|
+
parentClass: j,
|
|
1450
|
+
disabled: O
|
|
1787
1451
|
}
|
|
1788
1452
|
);
|
|
1789
1453
|
}
|
|
1790
|
-
},
|
|
1791
|
-
var
|
|
1792
|
-
const [
|
|
1793
|
-
|
|
1794
|
-
},
|
|
1795
|
-
i == null || i(
|
|
1796
|
-
},
|
|
1797
|
-
|
|
1454
|
+
}, ia = ({ isOpen: c, onClose: d, config: s, onApply: i }) => {
|
|
1455
|
+
var x;
|
|
1456
|
+
const [l, r] = T({}), n = (m, u) => {
|
|
1457
|
+
r((b) => ({ ...b, [m]: u }));
|
|
1458
|
+
}, k = () => {
|
|
1459
|
+
i == null || i(l), d();
|
|
1460
|
+
}, M = () => {
|
|
1461
|
+
r({}), i == null || i({}), d();
|
|
1798
1462
|
};
|
|
1799
1463
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1800
1464
|
/* @__PURE__ */ e.jsx(
|
|
1801
1465
|
"div",
|
|
1802
1466
|
{
|
|
1803
|
-
className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${
|
|
1804
|
-
onClick:
|
|
1467
|
+
className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${c ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
|
|
1468
|
+
onClick: d
|
|
1805
1469
|
}
|
|
1806
1470
|
),
|
|
1807
1471
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1809,7 +1473,7 @@ const Jr = ({
|
|
|
1809
1473
|
{
|
|
1810
1474
|
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
|
|
1811
1475
|
transform transition-transform duration-300 ease-in-out
|
|
1812
|
-
${
|
|
1476
|
+
${c ? "translate-x-0" : "translate-x-full"}
|
|
1813
1477
|
`,
|
|
1814
1478
|
children: [
|
|
1815
1479
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
|
|
@@ -1817,26 +1481,26 @@ const Jr = ({
|
|
|
1817
1481
|
/* @__PURE__ */ e.jsx(
|
|
1818
1482
|
"button",
|
|
1819
1483
|
{
|
|
1820
|
-
onClick:
|
|
1484
|
+
onClick: d,
|
|
1821
1485
|
className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
|
|
1822
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1486
|
+
children: /* @__PURE__ */ e.jsx(je, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
|
|
1823
1487
|
}
|
|
1824
1488
|
)
|
|
1825
1489
|
] }),
|
|
1826
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: s != null && s.component ? /* @__PURE__ */ e.jsx(s.component, { filters:
|
|
1827
|
-
|
|
1490
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: s != null && s.component ? /* @__PURE__ */ e.jsx(s.component, { filters: l, onFilterChange: n }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: (x = s == null ? void 0 : s.fields) == null ? void 0 : x.map((m) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
1491
|
+
$e,
|
|
1828
1492
|
{
|
|
1829
|
-
field:
|
|
1830
|
-
formData:
|
|
1493
|
+
field: m,
|
|
1494
|
+
formData: l,
|
|
1831
1495
|
handleChange: n
|
|
1832
1496
|
},
|
|
1833
|
-
|
|
1497
|
+
m.key
|
|
1834
1498
|
) })) }) }),
|
|
1835
1499
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
|
|
1836
1500
|
/* @__PURE__ */ e.jsx(
|
|
1837
|
-
|
|
1501
|
+
he,
|
|
1838
1502
|
{
|
|
1839
|
-
onClick:
|
|
1503
|
+
onClick: k,
|
|
1840
1504
|
variant: "contained",
|
|
1841
1505
|
color: "primary",
|
|
1842
1506
|
fullWidth: !0,
|
|
@@ -1844,9 +1508,9 @@ const Jr = ({
|
|
|
1844
1508
|
}
|
|
1845
1509
|
),
|
|
1846
1510
|
/* @__PURE__ */ e.jsx(
|
|
1847
|
-
|
|
1511
|
+
he,
|
|
1848
1512
|
{
|
|
1849
|
-
onClick:
|
|
1513
|
+
onClick: M,
|
|
1850
1514
|
variant: "contained",
|
|
1851
1515
|
className: "min-w-[150px]",
|
|
1852
1516
|
children: "Reset"
|
|
@@ -1857,7 +1521,7 @@ const Jr = ({
|
|
|
1857
1521
|
}
|
|
1858
1522
|
)
|
|
1859
1523
|
] });
|
|
1860
|
-
},
|
|
1524
|
+
}, Ae = {
|
|
1861
1525
|
blue: {
|
|
1862
1526
|
bg: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
|
|
1863
1527
|
border: "border border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300"
|
|
@@ -1886,76 +1550,76 @@ const Jr = ({
|
|
|
1886
1550
|
bg: "bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300",
|
|
1887
1551
|
border: "border border-gray-300 text-gray-700 dark:border-gray-700 dark:text-gray-300"
|
|
1888
1552
|
}
|
|
1889
|
-
},
|
|
1553
|
+
}, Pe = {
|
|
1890
1554
|
contained: "bg",
|
|
1891
1555
|
outline: "border !bg-transparent",
|
|
1892
1556
|
soft: "bg opacity-90"
|
|
1893
|
-
},
|
|
1894
|
-
label:
|
|
1895
|
-
variant:
|
|
1557
|
+
}, Ge = ({
|
|
1558
|
+
label: c,
|
|
1559
|
+
variant: d = "contained",
|
|
1896
1560
|
// contained | outline | soft
|
|
1897
1561
|
color: s = "green",
|
|
1898
1562
|
className: i = ""
|
|
1899
1563
|
}) => {
|
|
1900
|
-
const
|
|
1564
|
+
const l = Ae[s] || Ae.green, r = Pe[d] || Pe.contained, n = d === "outline" ? l.border : l.bg;
|
|
1901
1565
|
return /* @__PURE__ */ e.jsx(
|
|
1902
1566
|
"span",
|
|
1903
1567
|
{
|
|
1904
1568
|
className: `inline-flex justify-center items-center rounded-sm text-xs font-semibold px-3 py-1 min-w-[78px]
|
|
1905
1569
|
${n}
|
|
1906
|
-
${
|
|
1570
|
+
${r}
|
|
1907
1571
|
${i}`,
|
|
1908
|
-
children:
|
|
1572
|
+
children: c
|
|
1909
1573
|
}
|
|
1910
1574
|
);
|
|
1911
|
-
},
|
|
1575
|
+
}, da = ({ rows: c = 5, columns: d = 5 }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1912
1576
|
/* @__PURE__ */ e.jsx("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e.jsx("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
|
|
1913
1577
|
/* @__PURE__ */ e.jsx("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full border-collapse", children: [
|
|
1914
|
-
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsx("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length:
|
|
1915
|
-
/* @__PURE__ */ e.jsx("tbody", { children: Array.from({ length:
|
|
1578
|
+
/* @__PURE__ */ e.jsx("thead", { children: /* @__PURE__ */ e.jsx("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: d }).map((s, i) => /* @__PURE__ */ e.jsx("th", { className: "px-4 py-3", children: /* @__PURE__ */ e.jsx("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, i)) }) }),
|
|
1579
|
+
/* @__PURE__ */ e.jsx("tbody", { children: Array.from({ length: c }).map((s, i) => /* @__PURE__ */ e.jsx(
|
|
1916
1580
|
"tr",
|
|
1917
1581
|
{
|
|
1918
1582
|
className: "border-t border-gray-200 dark:border-gray-800",
|
|
1919
|
-
children: Array.from({ length:
|
|
1583
|
+
children: Array.from({ length: d }).map((l, r) => /* @__PURE__ */ e.jsx("td", { className: "px-4 py-6", children: /* @__PURE__ */ e.jsx("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, r))
|
|
1920
1584
|
},
|
|
1921
1585
|
i
|
|
1922
1586
|
)) })
|
|
1923
1587
|
] }) })
|
|
1924
|
-
] }),
|
|
1925
|
-
const
|
|
1926
|
-
return
|
|
1927
|
-
const
|
|
1928
|
-
n.key === "Escape" &&
|
|
1588
|
+
] }), Ye = ({ src: c, alt: d = "preview", isOpen: s, setIsOpen: i }) => {
|
|
1589
|
+
const l = () => i(!1);
|
|
1590
|
+
return W(() => {
|
|
1591
|
+
const r = (n) => {
|
|
1592
|
+
n.key === "Escape" && l();
|
|
1929
1593
|
};
|
|
1930
|
-
return s && (document.body.style.overflow = "hidden", document.addEventListener("keydown",
|
|
1931
|
-
document.body.style.overflow = "", document.removeEventListener("keydown",
|
|
1594
|
+
return s && (document.body.style.overflow = "hidden", document.addEventListener("keydown", r)), () => {
|
|
1595
|
+
document.body.style.overflow = "", document.removeEventListener("keydown", r);
|
|
1932
1596
|
};
|
|
1933
1597
|
}, [s]), /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1934
1598
|
"div",
|
|
1935
1599
|
{
|
|
1936
1600
|
className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
|
|
1937
1601
|
backdrop-blur-sm animate-in fade-in duration-200`,
|
|
1938
|
-
onClick:
|
|
1602
|
+
onClick: l,
|
|
1939
1603
|
children: [
|
|
1940
1604
|
/* @__PURE__ */ e.jsx(
|
|
1941
1605
|
"button",
|
|
1942
1606
|
{
|
|
1943
|
-
onClick:
|
|
1607
|
+
onClick: l,
|
|
1944
1608
|
className: `absolute top-4 right-4 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200\r
|
|
1945
1609
|
hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full p-2 shadow-lg transition`,
|
|
1946
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1610
|
+
children: /* @__PURE__ */ e.jsx(je, { size: 20 })
|
|
1947
1611
|
}
|
|
1948
1612
|
),
|
|
1949
1613
|
/* @__PURE__ */ e.jsx(
|
|
1950
1614
|
"div",
|
|
1951
1615
|
{
|
|
1952
1616
|
className: "max-w-5xl w-full px-4 transform transition-all duration-200 scale-95 animate-in zoom-in-95",
|
|
1953
|
-
onClick: (
|
|
1617
|
+
onClick: (r) => r.stopPropagation(),
|
|
1954
1618
|
children: /* @__PURE__ */ e.jsx(
|
|
1955
1619
|
"img",
|
|
1956
1620
|
{
|
|
1957
|
-
src:
|
|
1958
|
-
alt:
|
|
1621
|
+
src: c,
|
|
1622
|
+
alt: d,
|
|
1959
1623
|
className: "w-full max-h-[90vh] object-contain rounded-xl"
|
|
1960
1624
|
}
|
|
1961
1625
|
)
|
|
@@ -1964,17 +1628,17 @@ const Jr = ({
|
|
|
1964
1628
|
]
|
|
1965
1629
|
}
|
|
1966
1630
|
) });
|
|
1967
|
-
},
|
|
1631
|
+
}, ca = ({ config: c }) => {
|
|
1968
1632
|
const {
|
|
1969
|
-
data:
|
|
1633
|
+
data: d = [],
|
|
1970
1634
|
table_head: s = [],
|
|
1971
1635
|
loading: i = !1,
|
|
1972
|
-
search:
|
|
1636
|
+
search: l = {
|
|
1973
1637
|
enabled: !1,
|
|
1974
1638
|
placeholder: "Search...",
|
|
1975
1639
|
useServerSideSearch: !1
|
|
1976
1640
|
},
|
|
1977
|
-
filter:
|
|
1641
|
+
filter: r = {
|
|
1978
1642
|
enabled: !1,
|
|
1979
1643
|
useServerSideFilters: !1
|
|
1980
1644
|
},
|
|
@@ -1983,188 +1647,188 @@ const Jr = ({
|
|
|
1983
1647
|
rows_per_page: 10,
|
|
1984
1648
|
useServerSidePagination: !1
|
|
1985
1649
|
},
|
|
1986
|
-
emptyMessage:
|
|
1987
|
-
onMenuAction:
|
|
1988
|
-
setServerSidePaginationData:
|
|
1650
|
+
emptyMessage: k = "No data available",
|
|
1651
|
+
onMenuAction: M,
|
|
1652
|
+
setServerSidePaginationData: x = () => {
|
|
1989
1653
|
},
|
|
1990
|
-
onFilterApply:
|
|
1654
|
+
onFilterApply: m,
|
|
1991
1655
|
filterConfig: u = null
|
|
1992
|
-
} =
|
|
1993
|
-
if (n.useServerSidePagination) return
|
|
1994
|
-
const
|
|
1995
|
-
return
|
|
1996
|
-
}, [
|
|
1997
|
-
|
|
1656
|
+
} = c, [b, v] = T(""), [h, N] = T(null), [j, S] = T([]), [R, P] = T({}), [B, Y] = T(!1), [z, O] = T(null), [p, _] = T(!1), F = Se(() => !l.enabled || !b.trim() || l.useServerSideSearch ? d : aa(d, b, l.searchKeys || []), [d, b, l]), [C, f] = T(1), [A, U] = T((n == null ? void 0 : n.rows_per_page) || 50), [V, X] = T(F.length || 0), ae = n != null && n.useServerSidePagination ? n.total_pages : Math.ceil(F.length / A), oe = Se(() => {
|
|
1657
|
+
if (n.useServerSidePagination) return F;
|
|
1658
|
+
const o = (C - 1) * A;
|
|
1659
|
+
return F.slice(o, o + A);
|
|
1660
|
+
}, [F, C, A]), re = ce(null), ie = ce({}), t = ce(null), y = (o) => {
|
|
1661
|
+
v(o), f(1), l.useServerSideSearch && (t.current && clearTimeout(t.current), t.current = setTimeout(async () => {
|
|
1998
1662
|
try {
|
|
1999
|
-
await
|
|
2000
|
-
...
|
|
2001
|
-
search:
|
|
1663
|
+
await x((g) => ({
|
|
1664
|
+
...g,
|
|
1665
|
+
search: o,
|
|
2002
1666
|
current_page: 1
|
|
2003
1667
|
}));
|
|
2004
|
-
} catch (
|
|
2005
|
-
console.error("Search error:",
|
|
1668
|
+
} catch (g) {
|
|
1669
|
+
console.error("Search error:", g);
|
|
2006
1670
|
}
|
|
2007
1671
|
}, 800));
|
|
2008
|
-
},
|
|
2009
|
-
|
|
2010
|
-
},
|
|
2011
|
-
|
|
2012
|
-
const H =
|
|
2013
|
-
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
top: Math.max(8, Math.min(
|
|
2017
|
-
left: Math.max(8, Math.min(
|
|
2018
|
-
}),
|
|
2019
|
-
},
|
|
2020
|
-
|
|
2021
|
-
},
|
|
1672
|
+
}, L = (o, g, D) => {
|
|
1673
|
+
D.stopPropagation(), N(null), M == null || M(o.type, g);
|
|
1674
|
+
}, G = (o, g, D) => {
|
|
1675
|
+
g.stopPropagation(), S(D);
|
|
1676
|
+
const H = g.currentTarget;
|
|
1677
|
+
ie.current[o] = H;
|
|
1678
|
+
const K = H.getBoundingClientRect(), Q = 192, Z = D.length * 40, de = window.innerWidth, be = window.innerHeight, E = de - K.right < Q ? K.left - Q + K.width : K.left, se = be - K.bottom < Z && K.top > Z ? K.top - Z - 2 : K.bottom + 2;
|
|
1679
|
+
P({
|
|
1680
|
+
top: Math.max(8, Math.min(se, be - Z - 8)),
|
|
1681
|
+
left: Math.max(8, Math.min(E, de - Q - 8))
|
|
1682
|
+
}), N(h === o ? null : o);
|
|
1683
|
+
}, te = (o) => (C - 1) * A + o + 1, ne = (o) => {
|
|
1684
|
+
O(o), _(!0);
|
|
1685
|
+
}, I = (o, g, D, H = null) => /* @__PURE__ */ e.jsx(e.Fragment, { children: o ? /* @__PURE__ */ e.jsx(
|
|
2022
1686
|
"img",
|
|
2023
1687
|
{
|
|
2024
|
-
src:
|
|
2025
|
-
alt:
|
|
2026
|
-
onClick: (
|
|
2027
|
-
|
|
1688
|
+
src: o,
|
|
1689
|
+
alt: g || "Avatar",
|
|
1690
|
+
onClick: (K) => {
|
|
1691
|
+
K.stopPropagation(), K.preventDefault(), ne({ src: o, alt: g });
|
|
2028
1692
|
},
|
|
2029
|
-
className: `w-10 h-10 cursor-pointer rounded-full object-cover border border-gray-200 dark:border-gray-700 ${
|
|
1693
|
+
className: `w-10 h-10 cursor-pointer rounded-full object-cover border border-gray-200 dark:border-gray-700 ${D || ""}`
|
|
2030
1694
|
}
|
|
2031
1695
|
) : /* @__PURE__ */ e.jsx(e.Fragment, { children: H || /* @__PURE__ */ e.jsx(
|
|
2032
1696
|
"div",
|
|
2033
1697
|
{
|
|
2034
|
-
className: `w-10 h-10 flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${
|
|
2035
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1698
|
+
className: `w-10 h-10 flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${D || ""}`,
|
|
1699
|
+
children: /* @__PURE__ */ e.jsx(De, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
|
|
2036
1700
|
}
|
|
2037
|
-
) }) }),
|
|
2038
|
-
|
|
1701
|
+
) }) }), J = (o, g) => /* @__PURE__ */ e.jsxs("div", { className: `flex items-center space-x-4 ${g.className || ""}`, children: [
|
|
1702
|
+
g.imageKey ? I(o[g.imageKey], o[g.titleKey], "group-avatar") : "",
|
|
2039
1703
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2040
|
-
/* @__PURE__ */ e.jsx("p", { className: "font-medium text-gray-900 dark:text-white group-title", children:
|
|
2041
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children:
|
|
1704
|
+
/* @__PURE__ */ e.jsx("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: o[g.titleKey] || "" }),
|
|
1705
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: o[g.subtitleKey] || "" })
|
|
2042
1706
|
] })
|
|
2043
|
-
] }),
|
|
2044
|
-
var
|
|
2045
|
-
let
|
|
2046
|
-
const H =
|
|
2047
|
-
let
|
|
2048
|
-
if (((
|
|
2049
|
-
let
|
|
2050
|
-
|
|
1707
|
+
] }), le = (o, g) => {
|
|
1708
|
+
var Q;
|
|
1709
|
+
let D = String(o);
|
|
1710
|
+
const H = g.variant || "contained";
|
|
1711
|
+
let K = g.defaultColor;
|
|
1712
|
+
if (((Q = g == null ? void 0 : g.chipOptions) == null ? void 0 : Q.length) > 0) {
|
|
1713
|
+
let Z = g == null ? void 0 : g.chipOptions.find((de) => de.value == o);
|
|
1714
|
+
Z && (D = Z.label, K = Z.color);
|
|
2051
1715
|
}
|
|
2052
1716
|
return /* @__PURE__ */ e.jsx(
|
|
2053
|
-
|
|
1717
|
+
Ge,
|
|
2054
1718
|
{
|
|
2055
|
-
label:
|
|
1719
|
+
label: D,
|
|
2056
1720
|
variant: H,
|
|
2057
|
-
color:
|
|
2058
|
-
className:
|
|
1721
|
+
color: K,
|
|
1722
|
+
className: g.className || ""
|
|
2059
1723
|
}
|
|
2060
1724
|
);
|
|
2061
|
-
},
|
|
2062
|
-
const H =
|
|
2063
|
-
return
|
|
1725
|
+
}, ue = (o, g, D) => {
|
|
1726
|
+
const H = g[o.key];
|
|
1727
|
+
return o.type === "menu_actions" ? /* @__PURE__ */ e.jsx("div", { className: `text-center ${o.className || ""}`, children: /* @__PURE__ */ e.jsx(
|
|
2064
1728
|
"button",
|
|
2065
1729
|
{
|
|
2066
|
-
ref: (
|
|
2067
|
-
onClick: (
|
|
1730
|
+
ref: (K) => ie.current[g.id] = K,
|
|
1731
|
+
onClick: (K) => G(g.id, K, o.menuList),
|
|
2068
1732
|
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",
|
|
2069
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1733
|
+
children: /* @__PURE__ */ e.jsx(We, { className: "h-4 w-4" })
|
|
2070
1734
|
}
|
|
2071
|
-
) }) :
|
|
2072
|
-
},
|
|
2073
|
-
if (
|
|
2074
|
-
return
|
|
2075
|
-
if (typeof
|
|
2076
|
-
return
|
|
2077
|
-
},
|
|
2078
|
-
return
|
|
2079
|
-
const
|
|
2080
|
-
|
|
1735
|
+
) }) : o.type === "index" ? /* @__PURE__ */ e.jsx("span", { className: o.className || "", children: te(D) }) : o.type === "group" ? J(g, o) : o.type === "chip" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: le(H, o) }) : o.type === "date" ? /* @__PURE__ */ e.jsx("span", { className: o.className || "", children: Le(H, o.format || "DD MMM YYYY") }) : o.type === "avatar" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: I(H, o.alt, o.className, o.fallback_icon) }) : /* @__PURE__ */ e.jsx("span", { className: o.className || "", children: H || "N/A" });
|
|
1736
|
+
}, me = (o, g) => {
|
|
1737
|
+
if (o.onClickDetails)
|
|
1738
|
+
return M == null ? void 0 : M("view", g);
|
|
1739
|
+
if (typeof o.handleClick == "function")
|
|
1740
|
+
return o.handleClick(g);
|
|
1741
|
+
}, xe = (o) => o.onClickDetails || typeof o.handleClick == "function";
|
|
1742
|
+
return W(() => {
|
|
1743
|
+
const o = () => {
|
|
1744
|
+
h && N(null);
|
|
2081
1745
|
};
|
|
2082
|
-
return window.addEventListener("scroll",
|
|
2083
|
-
window.removeEventListener("scroll",
|
|
1746
|
+
return window.addEventListener("scroll", o, !0), () => {
|
|
1747
|
+
window.removeEventListener("scroll", o, !0);
|
|
2084
1748
|
};
|
|
2085
|
-
}, [
|
|
2086
|
-
const
|
|
2087
|
-
|
|
1749
|
+
}, [h]), W(() => {
|
|
1750
|
+
const o = (g) => {
|
|
1751
|
+
re.current && !re.current.contains(g.target) && N(null);
|
|
2088
1752
|
};
|
|
2089
|
-
return document.addEventListener("click",
|
|
2090
|
-
}, []),
|
|
2091
|
-
n != null && n.rows_per_page && (n != null && n.useServerSidePagination) &&
|
|
1753
|
+
return document.addEventListener("click", o), () => document.removeEventListener("click", o);
|
|
1754
|
+
}, []), W(() => {
|
|
1755
|
+
n != null && n.rows_per_page && (n != null && n.useServerSidePagination) && U((n == null ? void 0 : n.rows_per_page) || 50), n.current_page && f(n.current_page);
|
|
2092
1756
|
}, [
|
|
2093
1757
|
n.rows_per_page,
|
|
2094
1758
|
n == null ? void 0 : n.useServerSidePagination,
|
|
2095
1759
|
n.current_page
|
|
2096
|
-
]),
|
|
2097
|
-
|
|
2098
|
-
n != null && n.useServerSidePagination ? n.total_records :
|
|
2099
|
-
),
|
|
1760
|
+
]), W(() => {
|
|
1761
|
+
X(
|
|
1762
|
+
n != null && n.useServerSidePagination ? n.total_records : F.length
|
|
1763
|
+
), F.length <= A * (C - 1) && !(n != null && n.useServerSidePagination) && f((o) => o - 1 || 1);
|
|
2100
1764
|
}, [
|
|
2101
|
-
|
|
1765
|
+
F.length,
|
|
2102
1766
|
n.total_records,
|
|
2103
1767
|
n == null ? void 0 : n.useServerSidePagination
|
|
2104
|
-
]), i ? /* @__PURE__ */ e.jsx(
|
|
1768
|
+
]), i ? /* @__PURE__ */ e.jsx(da, { rows: 6, columns: 6 }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2105
1769
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end items-center mb-6 gap-2", children: [
|
|
2106
|
-
|
|
2107
|
-
/* @__PURE__ */ e.jsx(
|
|
1770
|
+
l.enabled && /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsxs("div", { className: "relative min-w-[300px]", children: [
|
|
1771
|
+
/* @__PURE__ */ e.jsx(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
|
|
2108
1772
|
/* @__PURE__ */ e.jsx(
|
|
2109
1773
|
"input",
|
|
2110
1774
|
{
|
|
2111
1775
|
type: "text",
|
|
2112
|
-
placeholder:
|
|
2113
|
-
value:
|
|
2114
|
-
onChange: (
|
|
1776
|
+
placeholder: l.placeholder || "Search...",
|
|
1777
|
+
value: b,
|
|
1778
|
+
onChange: (o) => y(o.target.value),
|
|
2115
1779
|
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"
|
|
2116
1780
|
}
|
|
2117
1781
|
)
|
|
2118
1782
|
] }) }),
|
|
2119
|
-
u &&
|
|
2120
|
-
/* @__PURE__ */ e.jsx(
|
|
1783
|
+
u && r.enabled && /* @__PURE__ */ e.jsxs(he, { onClick: () => Y(!0), variant: "contained", children: [
|
|
1784
|
+
/* @__PURE__ */ e.jsx(He, { className: "w-4 h-4 mr-2" }),
|
|
2121
1785
|
"Filters"
|
|
2122
1786
|
] })
|
|
2123
1787
|
] }),
|
|
2124
1788
|
/* @__PURE__ */ e.jsxs("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
|
|
2125
1789
|
/* @__PURE__ */ e.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ e.jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
|
|
2126
|
-
/* @__PURE__ */ e.jsx("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e.jsx("tr", { children: s.map((
|
|
1790
|
+
/* @__PURE__ */ e.jsx("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e.jsx("tr", { children: s.map((o) => /* @__PURE__ */ e.jsx(
|
|
2127
1791
|
"th",
|
|
2128
1792
|
{
|
|
2129
1793
|
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",
|
|
2130
|
-
children:
|
|
1794
|
+
children: o.title
|
|
2131
1795
|
},
|
|
2132
|
-
|
|
1796
|
+
o.key
|
|
2133
1797
|
)) }) }),
|
|
2134
|
-
/* @__PURE__ */ e.jsx("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children:
|
|
1798
|
+
/* @__PURE__ */ e.jsx("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: oe.length === 0 ? /* @__PURE__ */ e.jsx("tr", { children: /* @__PURE__ */ e.jsx(
|
|
2135
1799
|
"td",
|
|
2136
1800
|
{
|
|
2137
1801
|
colSpan: s.length,
|
|
2138
1802
|
className: "text-center py-10 text-gray-500 dark:text-gray-400",
|
|
2139
|
-
children:
|
|
1803
|
+
children: k
|
|
2140
1804
|
}
|
|
2141
|
-
) }) :
|
|
1805
|
+
) }) : oe.map((o, g) => /* @__PURE__ */ e.jsx(
|
|
2142
1806
|
"tr",
|
|
2143
1807
|
{
|
|
2144
1808
|
className: "hover:bg-gray-50 dark:hover:bg-blue-800/10 transition",
|
|
2145
|
-
children: s.map((
|
|
1809
|
+
children: s.map((D) => /* @__PURE__ */ e.jsx(
|
|
2146
1810
|
"td",
|
|
2147
1811
|
{
|
|
2148
|
-
className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max max-w-[300px] truncate ${
|
|
2149
|
-
title: String(
|
|
2150
|
-
onClick: () =>
|
|
2151
|
-
children:
|
|
1812
|
+
className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max max-w-[300px] truncate ${xe(D) ? "cursor-pointer" : ""}`,
|
|
1813
|
+
title: String(o[D.key] ?? ""),
|
|
1814
|
+
onClick: () => me(D, o),
|
|
1815
|
+
children: D.render ? D.render(o, g) : ue(D, o, g)
|
|
2152
1816
|
},
|
|
2153
|
-
|
|
1817
|
+
D.key
|
|
2154
1818
|
))
|
|
2155
1819
|
},
|
|
2156
|
-
|
|
1820
|
+
o.id || g
|
|
2157
1821
|
)) })
|
|
2158
1822
|
] }) }),
|
|
2159
|
-
(n == null ? void 0 : n.enabled) &&
|
|
1823
|
+
(n == null ? void 0 : n.enabled) && F.length > 0 && /* @__PURE__ */ e.jsxs("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: [
|
|
2160
1824
|
/* @__PURE__ */ e.jsxs("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
|
|
2161
1825
|
"Showing ",
|
|
2162
|
-
(
|
|
1826
|
+
(C - 1) * A + 1,
|
|
2163
1827
|
" to",
|
|
2164
1828
|
" ",
|
|
2165
|
-
Math.min(
|
|
1829
|
+
Math.min(C * A, V),
|
|
2166
1830
|
" of ",
|
|
2167
|
-
|
|
1831
|
+
V,
|
|
2168
1832
|
" ",
|
|
2169
1833
|
"results"
|
|
2170
1834
|
] }),
|
|
@@ -2174,17 +1838,17 @@ const Jr = ({
|
|
|
2174
1838
|
/* @__PURE__ */ e.jsx(
|
|
2175
1839
|
"select",
|
|
2176
1840
|
{
|
|
2177
|
-
value:
|
|
2178
|
-
onChange: (
|
|
2179
|
-
const
|
|
2180
|
-
|
|
2181
|
-
...
|
|
1841
|
+
value: A,
|
|
1842
|
+
onChange: (o) => {
|
|
1843
|
+
const g = Number(o.target.value);
|
|
1844
|
+
U(g), f(1), n.useServerSidePagination && x((D) => ({
|
|
1845
|
+
...D,
|
|
2182
1846
|
current_page: 1,
|
|
2183
|
-
rows_per_page:
|
|
1847
|
+
rows_per_page: g
|
|
2184
1848
|
}));
|
|
2185
1849
|
},
|
|
2186
1850
|
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",
|
|
2187
|
-
children: [2, 10, 25, 50, 100].map((
|
|
1851
|
+
children: [2, 10, 25, 50, 100].map((o) => /* @__PURE__ */ e.jsx("option", { value: o, children: o }, o))
|
|
2188
1852
|
}
|
|
2189
1853
|
)
|
|
2190
1854
|
] }),
|
|
@@ -2193,119 +1857,119 @@ const Jr = ({
|
|
|
2193
1857
|
"button",
|
|
2194
1858
|
{
|
|
2195
1859
|
onClick: () => {
|
|
2196
|
-
if (
|
|
2197
|
-
const
|
|
2198
|
-
|
|
2199
|
-
...
|
|
2200
|
-
current_page:
|
|
1860
|
+
if (C > 1) {
|
|
1861
|
+
const o = C - 1;
|
|
1862
|
+
f(o), n.useServerSidePagination && x((g) => ({
|
|
1863
|
+
...g,
|
|
1864
|
+
current_page: o
|
|
2201
1865
|
}));
|
|
2202
1866
|
}
|
|
2203
1867
|
},
|
|
2204
|
-
disabled:
|
|
1868
|
+
disabled: C === 1,
|
|
2205
1869
|
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",
|
|
2206
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1870
|
+
children: /* @__PURE__ */ e.jsx(Ue, { className: "h-4 w-4" })
|
|
2207
1871
|
}
|
|
2208
1872
|
),
|
|
2209
1873
|
/* @__PURE__ */ e.jsxs("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
|
|
2210
1874
|
"Page ",
|
|
2211
|
-
|
|
1875
|
+
C,
|
|
2212
1876
|
" of ",
|
|
2213
|
-
|
|
1877
|
+
ae
|
|
2214
1878
|
] }),
|
|
2215
1879
|
/* @__PURE__ */ e.jsx(
|
|
2216
1880
|
"button",
|
|
2217
1881
|
{
|
|
2218
1882
|
onClick: () => {
|
|
2219
|
-
if (
|
|
2220
|
-
const
|
|
2221
|
-
|
|
2222
|
-
...
|
|
2223
|
-
current_page:
|
|
1883
|
+
if (C < ae) {
|
|
1884
|
+
const o = C + 1;
|
|
1885
|
+
f(o), n.useServerSidePagination && x((g) => ({
|
|
1886
|
+
...g,
|
|
1887
|
+
current_page: o
|
|
2224
1888
|
}));
|
|
2225
1889
|
}
|
|
2226
1890
|
},
|
|
2227
|
-
disabled:
|
|
1891
|
+
disabled: C === ae,
|
|
2228
1892
|
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",
|
|
2229
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1893
|
+
children: /* @__PURE__ */ e.jsx(Ve, { className: "h-4 w-4" })
|
|
2230
1894
|
}
|
|
2231
1895
|
)
|
|
2232
1896
|
] })
|
|
2233
1897
|
] })
|
|
2234
1898
|
] })
|
|
2235
1899
|
] }),
|
|
2236
|
-
|
|
1900
|
+
h && Je(
|
|
2237
1901
|
/* @__PURE__ */ e.jsx(
|
|
2238
1902
|
"div",
|
|
2239
1903
|
{
|
|
2240
|
-
ref:
|
|
1904
|
+
ref: re,
|
|
2241
1905
|
style: {
|
|
2242
1906
|
position: "fixed",
|
|
2243
|
-
top: `${
|
|
2244
|
-
left: `${
|
|
1907
|
+
top: `${R.top}px`,
|
|
1908
|
+
left: `${R.left}px`,
|
|
2245
1909
|
zIndex: 9999
|
|
2246
1910
|
},
|
|
2247
1911
|
className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
|
|
2248
|
-
children:
|
|
1912
|
+
children: j.map((o, g) => /* @__PURE__ */ e.jsxs(
|
|
2249
1913
|
"button",
|
|
2250
1914
|
{
|
|
2251
|
-
onClick: (
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
1915
|
+
onClick: (D) => L(
|
|
1916
|
+
o,
|
|
1917
|
+
d.find((H) => H.id === h),
|
|
1918
|
+
D
|
|
2255
1919
|
),
|
|
2256
|
-
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 ${
|
|
1920
|
+
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 ${o.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
|
|
2257
1921
|
children: [
|
|
2258
|
-
|
|
2259
|
-
|
|
1922
|
+
o.icon && /* @__PURE__ */ e.jsx("span", { className: "shrink-0", children: o.icon }),
|
|
1923
|
+
o.title
|
|
2260
1924
|
]
|
|
2261
1925
|
},
|
|
2262
|
-
|
|
1926
|
+
g
|
|
2263
1927
|
))
|
|
2264
1928
|
}
|
|
2265
1929
|
),
|
|
2266
1930
|
document.body
|
|
2267
1931
|
),
|
|
2268
1932
|
u && /* @__PURE__ */ e.jsx(
|
|
2269
|
-
|
|
1933
|
+
ia,
|
|
2270
1934
|
{
|
|
2271
|
-
isOpen:
|
|
2272
|
-
onClose: () =>
|
|
1935
|
+
isOpen: B,
|
|
1936
|
+
onClose: () => Y(!1),
|
|
2273
1937
|
config: u,
|
|
2274
|
-
onApply:
|
|
1938
|
+
onApply: m
|
|
2275
1939
|
}
|
|
2276
1940
|
),
|
|
2277
|
-
|
|
2278
|
-
|
|
1941
|
+
p && /* @__PURE__ */ e.jsx(
|
|
1942
|
+
Ye,
|
|
2279
1943
|
{
|
|
2280
|
-
src:
|
|
2281
|
-
alt:
|
|
2282
|
-
isOpen:
|
|
2283
|
-
setIsOpen:
|
|
1944
|
+
src: z.src,
|
|
1945
|
+
alt: z.alt,
|
|
1946
|
+
isOpen: p,
|
|
1947
|
+
setIsOpen: _
|
|
2284
1948
|
}
|
|
2285
1949
|
)
|
|
2286
1950
|
] });
|
|
2287
|
-
},
|
|
2288
|
-
isOpen:
|
|
2289
|
-
onClose:
|
|
1951
|
+
}, ye = ({
|
|
1952
|
+
isOpen: c,
|
|
1953
|
+
onClose: d,
|
|
2290
1954
|
icon: s,
|
|
2291
1955
|
title: i,
|
|
2292
|
-
children:
|
|
2293
|
-
size:
|
|
1956
|
+
children: l,
|
|
1957
|
+
size: r = "md",
|
|
2294
1958
|
actionButtons: n = [],
|
|
2295
|
-
actions:
|
|
2296
|
-
showDefaultClose:
|
|
2297
|
-
footerConfig:
|
|
2298
|
-
hideFooter:
|
|
1959
|
+
actions: k,
|
|
1960
|
+
showDefaultClose: M = !0,
|
|
1961
|
+
footerConfig: x = null,
|
|
1962
|
+
hideFooter: m = !1,
|
|
2299
1963
|
onFormSubmit: u = () => {
|
|
2300
1964
|
},
|
|
2301
|
-
onCancel:
|
|
2302
|
-
loadingBtn:
|
|
2303
|
-
executeFunction:
|
|
1965
|
+
onCancel: b,
|
|
1966
|
+
loadingBtn: v = !1,
|
|
1967
|
+
executeFunction: h = () => {
|
|
2304
1968
|
},
|
|
2305
|
-
selectedItem:
|
|
1969
|
+
selectedItem: N = null
|
|
2306
1970
|
}) => {
|
|
2307
|
-
if (!
|
|
2308
|
-
const
|
|
1971
|
+
if (!c) return null;
|
|
1972
|
+
const j = {
|
|
2309
1973
|
sm: "max-w-md",
|
|
2310
1974
|
md: "max-w-lg",
|
|
2311
1975
|
lg: "max-w-2xl",
|
|
@@ -2317,13 +1981,13 @@ const Jr = ({
|
|
|
2317
1981
|
"div",
|
|
2318
1982
|
{
|
|
2319
1983
|
className: "fixed inset-0 bg-gray-500 opacity-75",
|
|
2320
|
-
onClick: () =>
|
|
1984
|
+
onClick: () => d()
|
|
2321
1985
|
}
|
|
2322
1986
|
),
|
|
2323
1987
|
/* @__PURE__ */ e.jsxs(
|
|
2324
1988
|
"div",
|
|
2325
1989
|
{
|
|
2326
|
-
className: `relative bg-white rounded-lg shadow-xl w-full ${
|
|
1990
|
+
className: `relative bg-white rounded-lg shadow-xl w-full ${j[r] || j.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
|
|
2327
1991
|
children: [
|
|
2328
1992
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
|
|
2329
1993
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -2333,85 +1997,85 @@ const Jr = ({
|
|
|
2333
1997
|
/* @__PURE__ */ e.jsx(
|
|
2334
1998
|
"button",
|
|
2335
1999
|
{
|
|
2336
|
-
onClick: () =>
|
|
2000
|
+
onClick: () => d(),
|
|
2337
2001
|
className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
|
|
2338
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2002
|
+
children: /* @__PURE__ */ e.jsx(je, { className: "w-6 h-6" })
|
|
2339
2003
|
}
|
|
2340
2004
|
)
|
|
2341
2005
|
] }),
|
|
2342
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-4", children:
|
|
2343
|
-
n.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: n.map((
|
|
2344
|
-
|
|
2006
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-4", children: l }),
|
|
2007
|
+
n.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: n.map((S) => /* @__PURE__ */ e.jsx(
|
|
2008
|
+
he,
|
|
2345
2009
|
{
|
|
2346
|
-
onClick: (
|
|
2347
|
-
|
|
2010
|
+
onClick: (R) => {
|
|
2011
|
+
S.type == "submit" ? u(R) : h(
|
|
2348
2012
|
() => {
|
|
2349
|
-
var
|
|
2350
|
-
return (
|
|
2013
|
+
var P;
|
|
2014
|
+
return (P = S == null ? void 0 : S.onClick) == null ? void 0 : P.call(S, R, N);
|
|
2351
2015
|
},
|
|
2352
|
-
(
|
|
2016
|
+
(P) => d == null ? void 0 : d(P)
|
|
2353
2017
|
);
|
|
2354
2018
|
},
|
|
2355
|
-
disabled:
|
|
2356
|
-
variant:
|
|
2357
|
-
color:
|
|
2358
|
-
className: `min-w-[100px] ${
|
|
2359
|
-
type:
|
|
2360
|
-
children:
|
|
2019
|
+
disabled: v || S.disabled,
|
|
2020
|
+
variant: S.variant || "contained",
|
|
2021
|
+
color: S.color || "primary",
|
|
2022
|
+
className: `min-w-[100px] ${S.className}`,
|
|
2023
|
+
type: S.type || "button",
|
|
2024
|
+
children: v ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
|
|
2361
2025
|
/* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-white/30 border-t-2 border-t-white mr-2" }),
|
|
2362
|
-
|
|
2026
|
+
S.label || "Submit",
|
|
2363
2027
|
"..."
|
|
2364
|
-
] }) :
|
|
2028
|
+
] }) : S.label || "Submit"
|
|
2365
2029
|
}
|
|
2366
2030
|
)) })
|
|
2367
2031
|
]
|
|
2368
2032
|
}
|
|
2369
2033
|
)
|
|
2370
2034
|
] });
|
|
2371
|
-
},
|
|
2372
|
-
var
|
|
2373
|
-
const { formClass: i = "grid grid-cols-12 gap-4", formFields:
|
|
2374
|
-
|
|
2035
|
+
}, Oe = ({ config: c, onSubmit: d, initialData: s = {} }) => {
|
|
2036
|
+
var x;
|
|
2037
|
+
const { formClass: i = "grid grid-cols-12 gap-4", formFields: l = [] } = c || {}, [r, n] = T(s);
|
|
2038
|
+
W(() => {
|
|
2375
2039
|
n(s);
|
|
2376
2040
|
}, []);
|
|
2377
|
-
const
|
|
2378
|
-
n((
|
|
2379
|
-
},
|
|
2380
|
-
|
|
2381
|
-
const u =
|
|
2041
|
+
const k = (m, u) => {
|
|
2042
|
+
n((b) => ({ ...b, [m]: u }));
|
|
2043
|
+
}, M = (m) => {
|
|
2044
|
+
m.preventDefault();
|
|
2045
|
+
const u = m.target;
|
|
2382
2046
|
if (!u.checkValidity()) {
|
|
2383
2047
|
u.reportValidity();
|
|
2384
2048
|
return;
|
|
2385
2049
|
}
|
|
2386
|
-
|
|
2050
|
+
d(r);
|
|
2387
2051
|
};
|
|
2388
2052
|
return /* @__PURE__ */ e.jsx(
|
|
2389
2053
|
"form",
|
|
2390
2054
|
{
|
|
2391
|
-
id: (
|
|
2392
|
-
onSubmit:
|
|
2055
|
+
id: (x = c.title) != null && x.toLowerCase().includes("edit") ? "editForm" : "addForm",
|
|
2056
|
+
onSubmit: M,
|
|
2393
2057
|
className: i,
|
|
2394
2058
|
noValidate: !1,
|
|
2395
|
-
children:
|
|
2396
|
-
|
|
2059
|
+
children: l.map((m) => /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
2060
|
+
$e,
|
|
2397
2061
|
{
|
|
2398
|
-
field:
|
|
2399
|
-
formData:
|
|
2400
|
-
handleChange:
|
|
2062
|
+
field: m,
|
|
2063
|
+
formData: r,
|
|
2064
|
+
handleChange: k
|
|
2401
2065
|
},
|
|
2402
|
-
|
|
2066
|
+
m.key
|
|
2403
2067
|
) }))
|
|
2404
2068
|
}
|
|
2405
2069
|
);
|
|
2406
2070
|
};
|
|
2407
|
-
function
|
|
2408
|
-
const { fields: s, containerClass: i } =
|
|
2409
|
-
|
|
2410
|
-
},
|
|
2411
|
-
let
|
|
2412
|
-
if (
|
|
2413
|
-
let
|
|
2414
|
-
|
|
2071
|
+
function ua({ data: c, config: d }) {
|
|
2072
|
+
const { fields: s, containerClass: i } = d, [l, r] = T(null), [n, k] = T(!1), M = (u) => {
|
|
2073
|
+
r(u), k(!0);
|
|
2074
|
+
}, x = ({ col: u }) => {
|
|
2075
|
+
let b = u == null ? void 0 : u.icon, v = u.label, h = c[u.key], N = u.type, j = u.variant || "outline", S = u.defaultColor;
|
|
2076
|
+
if (N == "chip" && u.chipOptions.length > 0) {
|
|
2077
|
+
let R = u == null ? void 0 : u.chipOptions.find((P) => P.value == h);
|
|
2078
|
+
R && (h = R.label, S = R.color);
|
|
2415
2079
|
}
|
|
2416
2080
|
return /* @__PURE__ */ e.jsxs(
|
|
2417
2081
|
"div",
|
|
@@ -2419,32 +2083,32 @@ function ra({ data: h, config: c }) {
|
|
|
2419
2083
|
className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
|
|
2420
2084
|
bg-gray-100 dark:bg-gray-900 ${u.blockClass}`,
|
|
2421
2085
|
children: [
|
|
2422
|
-
|
|
2086
|
+
b && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0", children: b }),
|
|
2423
2087
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2424
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children:
|
|
2425
|
-
|
|
2426
|
-
|
|
2088
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: v }),
|
|
2089
|
+
N == "chip" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
2090
|
+
Ge,
|
|
2427
2091
|
{
|
|
2428
|
-
label:
|
|
2429
|
-
variant:
|
|
2430
|
-
color:
|
|
2092
|
+
label: h,
|
|
2093
|
+
variant: j,
|
|
2094
|
+
color: S,
|
|
2431
2095
|
className: "mt-1"
|
|
2432
2096
|
}
|
|
2433
|
-
) }) :
|
|
2097
|
+
) }) : N == "tinyEditor" ? /* @__PURE__ */ e.jsx(
|
|
2434
2098
|
"p",
|
|
2435
2099
|
{
|
|
2436
2100
|
className: "mt-1 text-sm text-gray-900 dark:text-white break-words",
|
|
2437
2101
|
dangerouslySetInnerHTML: {
|
|
2438
|
-
__html:
|
|
2102
|
+
__html: h
|
|
2439
2103
|
}
|
|
2440
2104
|
}
|
|
2441
|
-
) : /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children:
|
|
2105
|
+
) : /* @__PURE__ */ e.jsx("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: N == "date" ? /* @__PURE__ */ e.jsx("span", { children: Le(h, u.format || "DD MMM YYYY") }) : h || "N/A" })
|
|
2442
2106
|
] })
|
|
2443
2107
|
]
|
|
2444
2108
|
}
|
|
2445
2109
|
);
|
|
2446
|
-
},
|
|
2447
|
-
let
|
|
2110
|
+
}, m = ({ col: u }) => {
|
|
2111
|
+
let b = c[u.titleKey], v = c[u.subtitleKey], h = c[u.imageKey], N = c[u.fallback_icon];
|
|
2448
2112
|
return /* @__PURE__ */ e.jsxs(
|
|
2449
2113
|
"div",
|
|
2450
2114
|
{
|
|
@@ -2452,18 +2116,18 @@ function ra({ data: h, config: c }) {
|
|
|
2452
2116
|
bg-gray-100 dark:bg-gray-900
|
|
2453
2117
|
${u.blockClass}`,
|
|
2454
2118
|
children: [
|
|
2455
|
-
|
|
2119
|
+
h ? /* @__PURE__ */ e.jsx(
|
|
2456
2120
|
"img",
|
|
2457
2121
|
{
|
|
2458
|
-
src:
|
|
2459
|
-
alt:
|
|
2460
|
-
onClick: () =>
|
|
2122
|
+
src: h,
|
|
2123
|
+
alt: b,
|
|
2124
|
+
onClick: () => M({ src: h, alt: b }),
|
|
2461
2125
|
className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
|
|
2462
2126
|
}
|
|
2463
|
-
) :
|
|
2127
|
+
) : N || /* @__PURE__ */ e.jsx("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.jsx(De, { className: "w-8 h-8 text-gray-400" }) }),
|
|
2464
2128
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2465
|
-
/* @__PURE__ */ e.jsx("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children:
|
|
2466
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children:
|
|
2129
|
+
/* @__PURE__ */ e.jsx("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: b }),
|
|
2130
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: v })
|
|
2467
2131
|
] })
|
|
2468
2132
|
]
|
|
2469
2133
|
}
|
|
@@ -2471,114 +2135,114 @@ function ra({ data: h, config: c }) {
|
|
|
2471
2135
|
};
|
|
2472
2136
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2473
2137
|
n && /* @__PURE__ */ e.jsx(
|
|
2474
|
-
|
|
2138
|
+
Ye,
|
|
2475
2139
|
{
|
|
2476
|
-
src:
|
|
2477
|
-
alt:
|
|
2140
|
+
src: l.src,
|
|
2141
|
+
alt: l.alt,
|
|
2478
2142
|
isOpen: n,
|
|
2479
|
-
setIsOpen:
|
|
2143
|
+
setIsOpen: k
|
|
2480
2144
|
}
|
|
2481
2145
|
),
|
|
2482
2146
|
/* @__PURE__ */ e.jsx("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: s.map(
|
|
2483
|
-
(u) => u.type == "group" ? /* @__PURE__ */ e.jsx(
|
|
2147
|
+
(u) => u.type == "group" ? /* @__PURE__ */ e.jsx(m, { col: u }) : /* @__PURE__ */ e.jsx(x, { col: u })
|
|
2484
2148
|
) })
|
|
2485
2149
|
] });
|
|
2486
2150
|
}
|
|
2487
|
-
const
|
|
2488
|
-
var
|
|
2151
|
+
const Ke = ({ config: c }) => {
|
|
2152
|
+
var ne, I, J, le, ue, me, xe, o, g, D, H, K, Q, Z, de, be;
|
|
2489
2153
|
const {
|
|
2490
|
-
title:
|
|
2154
|
+
title: d,
|
|
2491
2155
|
fetchData: s = async () => {
|
|
2492
2156
|
},
|
|
2493
2157
|
isStaticData: i = !1,
|
|
2494
|
-
tableConfig:
|
|
2495
|
-
modalConfig:
|
|
2158
|
+
tableConfig: l = {},
|
|
2159
|
+
modalConfig: r = {},
|
|
2496
2160
|
filterConfig: n
|
|
2497
|
-
} =
|
|
2161
|
+
} = c, [k, M] = T(!0), [x, m] = T(!1), [u, b] = T([]), [v, h] = T(null), [N, j] = T({
|
|
2498
2162
|
search: "",
|
|
2499
2163
|
rows_per_page: 50,
|
|
2500
2164
|
current_page: 1
|
|
2501
|
-
}), [
|
|
2502
|
-
|
|
2503
|
-
},
|
|
2504
|
-
|
|
2165
|
+
}), [S, R] = T({}), [P, B] = T(!1), [Y, z] = T(!1), [O, p] = T(!1), [_, F] = T(!1), [C, f] = T(!1), [A, U] = T(null), V = (w, E) => {
|
|
2166
|
+
w === "edit" ? (U(E), p(!0)) : w === "view" ? (U(E), f(!0)) : w === "delete" && (U(E), F(!0));
|
|
2167
|
+
}, X = async (w, E, $ = "", se = "") => {
|
|
2168
|
+
m(!0);
|
|
2505
2169
|
try {
|
|
2506
|
-
const
|
|
2507
|
-
(
|
|
2170
|
+
const q = await (w == null ? void 0 : w());
|
|
2171
|
+
($ || q.message) && ke($ || q.message, {
|
|
2508
2172
|
variant: "success"
|
|
2509
|
-
}),
|
|
2510
|
-
} catch (
|
|
2511
|
-
(
|
|
2173
|
+
}), E == null || E(q);
|
|
2174
|
+
} catch (q) {
|
|
2175
|
+
(se || q.message) && ke(se || q.message, { variant: "error" });
|
|
2512
2176
|
} finally {
|
|
2513
|
-
|
|
2177
|
+
m(!1);
|
|
2514
2178
|
}
|
|
2515
|
-
},
|
|
2516
|
-
let
|
|
2517
|
-
i ? (
|
|
2518
|
-
|
|
2179
|
+
}, ae = (w) => {
|
|
2180
|
+
let E = w.newObject;
|
|
2181
|
+
i ? (b(($) => [E, ...$]), h(($) => ({
|
|
2182
|
+
...$,
|
|
2519
2183
|
current_page: 1
|
|
2520
|
-
}))) : (
|
|
2521
|
-
|
|
2184
|
+
}))) : (j(($) => ({
|
|
2185
|
+
...$,
|
|
2522
2186
|
current_page: 1
|
|
2523
|
-
})),
|
|
2524
|
-
},
|
|
2525
|
-
let
|
|
2526
|
-
i ?
|
|
2527
|
-
(
|
|
2528
|
-
(
|
|
2187
|
+
})), N.current_page == 1 && y()), z(!1);
|
|
2188
|
+
}, oe = (w) => {
|
|
2189
|
+
let E = w.newObject, $ = w.targetObject;
|
|
2190
|
+
i ? b(
|
|
2191
|
+
(se) => se.map(
|
|
2192
|
+
(q) => q.id === $.id ? { ...q, ...E } : q
|
|
2529
2193
|
)
|
|
2530
|
-
) :
|
|
2531
|
-
},
|
|
2532
|
-
if (!
|
|
2533
|
-
|
|
2194
|
+
) : y(), p(!1);
|
|
2195
|
+
}, re = (w) => {
|
|
2196
|
+
if (!w) {
|
|
2197
|
+
F(!1), U(null);
|
|
2534
2198
|
return;
|
|
2535
2199
|
}
|
|
2536
|
-
i ?
|
|
2537
|
-
(
|
|
2538
|
-
) : u.length == 1 &&
|
|
2539
|
-
...
|
|
2540
|
-
current_page:
|
|
2541
|
-
})) :
|
|
2542
|
-
},
|
|
2200
|
+
i ? b(
|
|
2201
|
+
(E) => E.filter(($) => $.id !== w.targetObject.id)
|
|
2202
|
+
) : u.length == 1 && N.current_page > 1 ? j((E) => ({
|
|
2203
|
+
...E,
|
|
2204
|
+
current_page: E.current_page - 1
|
|
2205
|
+
})) : y(), F(!1), U(null);
|
|
2206
|
+
}, ie = (w) => X(
|
|
2543
2207
|
() => {
|
|
2544
|
-
var
|
|
2545
|
-
return (
|
|
2208
|
+
var E, $;
|
|
2209
|
+
return ($ = (E = r == null ? void 0 : r.addModal) == null ? void 0 : E.handleSubmit) == null ? void 0 : $.call(E, w);
|
|
2546
2210
|
},
|
|
2547
|
-
|
|
2548
|
-
),
|
|
2211
|
+
ae
|
|
2212
|
+
), t = (w) => X(
|
|
2549
2213
|
() => {
|
|
2550
|
-
var
|
|
2551
|
-
return (
|
|
2214
|
+
var E, $;
|
|
2215
|
+
return ($ = (E = r == null ? void 0 : r.editModal) == null ? void 0 : E.handleSubmit) == null ? void 0 : $.call(E, w, A);
|
|
2552
2216
|
},
|
|
2553
|
-
|
|
2554
|
-
),
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
}).catch((
|
|
2558
|
-
|
|
2217
|
+
oe
|
|
2218
|
+
), y = async () => {
|
|
2219
|
+
M(!0), s == null || s({ ...N, ...S }).then((w) => {
|
|
2220
|
+
b(w.data), h(w.pagination);
|
|
2221
|
+
}).catch((w) => {
|
|
2222
|
+
ke(w.message, { variant: "error" });
|
|
2559
2223
|
}).finally(() => {
|
|
2560
|
-
|
|
2224
|
+
M(!1);
|
|
2561
2225
|
});
|
|
2562
|
-
},
|
|
2563
|
-
var
|
|
2564
|
-
|
|
2565
|
-
...
|
|
2566
|
-
})), (
|
|
2567
|
-
},
|
|
2568
|
-
(
|
|
2569
|
-
),
|
|
2570
|
-
var
|
|
2571
|
-
return (
|
|
2572
|
-
}, [u,
|
|
2573
|
-
return
|
|
2574
|
-
|
|
2226
|
+
}, L = (w) => {
|
|
2227
|
+
var E;
|
|
2228
|
+
R(($) => ({
|
|
2229
|
+
...w
|
|
2230
|
+
})), (E = l == null ? void 0 : l.filter) != null && E.useServerSideFilters && B(($) => !$);
|
|
2231
|
+
}, G = (w, E) => w.filter(
|
|
2232
|
+
($) => Object.entries(E).every(([se, q]) => $[se] === q)
|
|
2233
|
+
), te = Se(() => {
|
|
2234
|
+
var w;
|
|
2235
|
+
return (w = l == null ? void 0 : l.filter) != null && w.useServerSideFilters ? data : G(u, S);
|
|
2236
|
+
}, [u, S]);
|
|
2237
|
+
return W(() => {
|
|
2238
|
+
y();
|
|
2575
2239
|
}, [
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2240
|
+
N.search,
|
|
2241
|
+
N.rows_per_page,
|
|
2242
|
+
N.current_page,
|
|
2243
|
+
P
|
|
2580
2244
|
]), /* @__PURE__ */ e.jsx(
|
|
2581
|
-
|
|
2245
|
+
Xe,
|
|
2582
2246
|
{
|
|
2583
2247
|
maxSnack: 3,
|
|
2584
2248
|
anchorOrigin: {
|
|
@@ -2586,141 +2250,141 @@ const mr = ({ config: h }) => {
|
|
|
2586
2250
|
horizontal: "right"
|
|
2587
2251
|
},
|
|
2588
2252
|
autoHideDuration: 3e3,
|
|
2589
|
-
action: (
|
|
2253
|
+
action: (w) => /* @__PURE__ */ e.jsx(
|
|
2590
2254
|
"button",
|
|
2591
2255
|
{
|
|
2592
2256
|
onClick: () => {
|
|
2593
2257
|
window.dispatchEvent(
|
|
2594
|
-
new CustomEvent("closeSnackbar", { detail:
|
|
2258
|
+
new CustomEvent("closeSnackbar", { detail: w })
|
|
2595
2259
|
);
|
|
2596
2260
|
},
|
|
2597
2261
|
className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
|
|
2598
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2262
|
+
children: /* @__PURE__ */ e.jsx(je, { className: "h-4 w-4" })
|
|
2599
2263
|
}
|
|
2600
2264
|
),
|
|
2601
2265
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2602
2266
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6", children: [
|
|
2603
2267
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2604
|
-
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children:
|
|
2605
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-md text-gray-600 dark:text-gray-400 mt-2", children:
|
|
2268
|
+
/* @__PURE__ */ e.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: d }),
|
|
2269
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-md text-gray-600 dark:text-gray-400 mt-2", children: c == null ? void 0 : c.description })
|
|
2606
2270
|
] }),
|
|
2607
2271
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ e.jsxs(
|
|
2608
|
-
|
|
2272
|
+
he,
|
|
2609
2273
|
{
|
|
2610
|
-
onClick: () =>
|
|
2274
|
+
onClick: () => z(!0),
|
|
2611
2275
|
variant: "contained",
|
|
2612
2276
|
color: "primary",
|
|
2613
2277
|
children: [
|
|
2614
|
-
/* @__PURE__ */ e.jsx(
|
|
2615
|
-
|
|
2278
|
+
/* @__PURE__ */ e.jsx(qe, { className: "w-4 h-4 mr-2" }),
|
|
2279
|
+
c.buttonText || "Add New"
|
|
2616
2280
|
]
|
|
2617
2281
|
}
|
|
2618
2282
|
) })
|
|
2619
2283
|
] }),
|
|
2620
2284
|
/* @__PURE__ */ e.jsx(
|
|
2621
|
-
|
|
2285
|
+
ca,
|
|
2622
2286
|
{
|
|
2623
2287
|
config: {
|
|
2624
|
-
...
|
|
2288
|
+
...l,
|
|
2625
2289
|
pagination: {
|
|
2626
|
-
...
|
|
2627
|
-
...
|
|
2290
|
+
...l.pagination,
|
|
2291
|
+
...v
|
|
2628
2292
|
},
|
|
2629
|
-
data:
|
|
2630
|
-
setServerSidePaginationData:
|
|
2631
|
-
onMenuAction:
|
|
2293
|
+
data: te,
|
|
2294
|
+
setServerSidePaginationData: j,
|
|
2295
|
+
onMenuAction: V,
|
|
2632
2296
|
filterConfig: n,
|
|
2633
|
-
onFilterApply:
|
|
2634
|
-
loading:
|
|
2297
|
+
onFilterApply: L,
|
|
2298
|
+
loading: k
|
|
2635
2299
|
}
|
|
2636
2300
|
}
|
|
2637
2301
|
),
|
|
2638
2302
|
/* @__PURE__ */ e.jsx(
|
|
2639
|
-
|
|
2303
|
+
ye,
|
|
2640
2304
|
{
|
|
2641
|
-
isOpen:
|
|
2642
|
-
onClose: () =>
|
|
2643
|
-
icon: (
|
|
2644
|
-
title: ((
|
|
2645
|
-
size: ((
|
|
2305
|
+
isOpen: Y,
|
|
2306
|
+
onClose: () => z(!1),
|
|
2307
|
+
icon: (ne = r.addModal) == null ? void 0 : ne.icon,
|
|
2308
|
+
title: ((I = r.addModal) == null ? void 0 : I.title) || "Add New",
|
|
2309
|
+
size: ((J = r.addModal) == null ? void 0 : J.size) || "md",
|
|
2646
2310
|
onFormSubmit: () => {
|
|
2647
|
-
var
|
|
2648
|
-
return (
|
|
2311
|
+
var w;
|
|
2312
|
+
return (w = document.querySelector("#addForm")) == null ? void 0 : w.requestSubmit();
|
|
2649
2313
|
},
|
|
2650
|
-
loadingBtn:
|
|
2651
|
-
actionButtons:
|
|
2314
|
+
loadingBtn: x,
|
|
2315
|
+
actionButtons: r.addModal.actionButtons,
|
|
2652
2316
|
children: /* @__PURE__ */ e.jsx(
|
|
2653
|
-
|
|
2317
|
+
Oe,
|
|
2654
2318
|
{
|
|
2655
|
-
config: (
|
|
2656
|
-
onSubmit:
|
|
2319
|
+
config: (r == null ? void 0 : r.addModal) || [],
|
|
2320
|
+
onSubmit: ie,
|
|
2657
2321
|
initialData: {},
|
|
2658
|
-
loading:
|
|
2322
|
+
loading: x
|
|
2659
2323
|
}
|
|
2660
2324
|
)
|
|
2661
2325
|
}
|
|
2662
2326
|
),
|
|
2663
2327
|
/* @__PURE__ */ e.jsx(
|
|
2664
|
-
|
|
2328
|
+
ye,
|
|
2665
2329
|
{
|
|
2666
|
-
isOpen:
|
|
2667
|
-
onClose: () =>
|
|
2668
|
-
icon: (
|
|
2669
|
-
title: ((
|
|
2670
|
-
size: ((
|
|
2330
|
+
isOpen: O,
|
|
2331
|
+
onClose: () => p(!1),
|
|
2332
|
+
icon: (le = r.editModal) == null ? void 0 : le.icon,
|
|
2333
|
+
title: ((ue = r.editModal) == null ? void 0 : ue.title) || "Edit",
|
|
2334
|
+
size: ((me = r.editModal) == null ? void 0 : me.size) || "md",
|
|
2671
2335
|
onFormSubmit: () => {
|
|
2672
|
-
var
|
|
2673
|
-
return (
|
|
2336
|
+
var w;
|
|
2337
|
+
return (w = document.querySelector("#editForm")) == null ? void 0 : w.requestSubmit();
|
|
2674
2338
|
},
|
|
2675
|
-
actionButtons:
|
|
2676
|
-
loadingBtn:
|
|
2339
|
+
actionButtons: r.editModal.actionButtons,
|
|
2340
|
+
loadingBtn: x,
|
|
2677
2341
|
children: /* @__PURE__ */ e.jsx(
|
|
2678
|
-
|
|
2342
|
+
Oe,
|
|
2679
2343
|
{
|
|
2680
|
-
config:
|
|
2681
|
-
onSubmit:
|
|
2682
|
-
initialData:
|
|
2683
|
-
loading:
|
|
2344
|
+
config: r.editModal || [],
|
|
2345
|
+
onSubmit: t,
|
|
2346
|
+
initialData: A,
|
|
2347
|
+
loading: x
|
|
2684
2348
|
}
|
|
2685
2349
|
)
|
|
2686
2350
|
}
|
|
2687
2351
|
),
|
|
2688
|
-
|
|
2689
|
-
|
|
2352
|
+
_ && /* @__PURE__ */ e.jsx(
|
|
2353
|
+
ye,
|
|
2690
2354
|
{
|
|
2691
|
-
isOpen:
|
|
2692
|
-
onClose: (
|
|
2693
|
-
|
|
2355
|
+
isOpen: _,
|
|
2356
|
+
onClose: (w) => {
|
|
2357
|
+
re(w);
|
|
2694
2358
|
},
|
|
2695
|
-
icon: ((
|
|
2696
|
-
title: ((
|
|
2697
|
-
size: ((
|
|
2698
|
-
loading:
|
|
2699
|
-
actionButtons:
|
|
2700
|
-
executeFunction:
|
|
2701
|
-
selectedItem:
|
|
2359
|
+
icon: ((xe = r.deleteModal) == null ? void 0 : xe.icon) || /* @__PURE__ */ e.jsx(Re, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
|
|
2360
|
+
title: ((o = r.deleteModal) == null ? void 0 : o.title) || "Confirm Delete",
|
|
2361
|
+
size: ((g = r.deleteModal) == null ? void 0 : g.size) || "md",
|
|
2362
|
+
loading: x,
|
|
2363
|
+
actionButtons: r.deleteModal.actionButtons,
|
|
2364
|
+
executeFunction: X,
|
|
2365
|
+
selectedItem: A,
|
|
2702
2366
|
children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2703
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-md text-gray-700 dark:text-white", children: ((
|
|
2704
|
-
((H =
|
|
2367
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-md text-gray-700 dark:text-white", children: ((D = r.deleteModal) == null ? void 0 : D.confirmText) || "Are you sure you want to delete this item?" }),
|
|
2368
|
+
((H = r.deleteModal) == null ? void 0 : H.referenceKey) && /* @__PURE__ */ e.jsx("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: A[(K = r.deleteModal) == null ? void 0 : K.referenceKey] })
|
|
2705
2369
|
] }) })
|
|
2706
2370
|
}
|
|
2707
2371
|
),
|
|
2708
|
-
|
|
2709
|
-
|
|
2372
|
+
r.viewModal && /* @__PURE__ */ e.jsx(
|
|
2373
|
+
ye,
|
|
2710
2374
|
{
|
|
2711
|
-
isOpen:
|
|
2375
|
+
isOpen: C,
|
|
2712
2376
|
onClose: () => {
|
|
2713
|
-
|
|
2377
|
+
f(!1), U(null);
|
|
2714
2378
|
},
|
|
2715
|
-
icon: (
|
|
2716
|
-
title: ((
|
|
2717
|
-
size: ((
|
|
2718
|
-
footerConfig:
|
|
2719
|
-
children: (
|
|
2720
|
-
|
|
2379
|
+
icon: (Q = r.viewModal) == null ? void 0 : Q.icon,
|
|
2380
|
+
title: ((Z = r.viewModal) == null ? void 0 : Z.title) || "View Details",
|
|
2381
|
+
size: ((de = r.viewModal) == null ? void 0 : de.size) || "lg",
|
|
2382
|
+
footerConfig: r == null ? void 0 : r.viewModal.footer,
|
|
2383
|
+
children: (be = r.viewModal) != null && be.component ? /* @__PURE__ */ e.jsx(r.viewModal.component, { data: A }) : /* @__PURE__ */ e.jsx(
|
|
2384
|
+
ua,
|
|
2721
2385
|
{
|
|
2722
|
-
data:
|
|
2723
|
-
config:
|
|
2386
|
+
data: A,
|
|
2387
|
+
config: r.viewModal || {}
|
|
2724
2388
|
}
|
|
2725
2389
|
)
|
|
2726
2390
|
}
|
|
@@ -2728,7 +2392,7 @@ const mr = ({ config: h }) => {
|
|
|
2728
2392
|
] })
|
|
2729
2393
|
}
|
|
2730
2394
|
);
|
|
2731
|
-
},
|
|
2395
|
+
}, Te = a.shape({
|
|
2732
2396
|
value: a.oneOfType([
|
|
2733
2397
|
a.string,
|
|
2734
2398
|
a.number,
|
|
@@ -2736,18 +2400,18 @@ const mr = ({ config: h }) => {
|
|
|
2736
2400
|
]).isRequired,
|
|
2737
2401
|
label: a.string.isRequired,
|
|
2738
2402
|
color: a.string
|
|
2739
|
-
}),
|
|
2403
|
+
}), we = a.shape({
|
|
2740
2404
|
type: a.string.isRequired,
|
|
2741
2405
|
label: a.string.isRequired,
|
|
2742
2406
|
color: a.string,
|
|
2743
2407
|
variant: a.string,
|
|
2744
2408
|
onClick: a.func
|
|
2745
|
-
}),
|
|
2409
|
+
}), ha = a.shape({
|
|
2746
2410
|
title: a.string.isRequired,
|
|
2747
2411
|
type: a.string.isRequired,
|
|
2748
2412
|
variant: a.string,
|
|
2749
2413
|
icon: a.node
|
|
2750
|
-
}),
|
|
2414
|
+
}), ba = a.shape({
|
|
2751
2415
|
key: a.string.isRequired,
|
|
2752
2416
|
title: a.string,
|
|
2753
2417
|
type: a.string,
|
|
@@ -2756,12 +2420,12 @@ const mr = ({ config: h }) => {
|
|
|
2756
2420
|
subtitleKey: a.string,
|
|
2757
2421
|
onClickDetails: a.bool,
|
|
2758
2422
|
variant: a.string,
|
|
2759
|
-
chipOptions: a.arrayOf(
|
|
2423
|
+
chipOptions: a.arrayOf(Te),
|
|
2760
2424
|
defaultColor: a.string,
|
|
2761
2425
|
className: a.string,
|
|
2762
2426
|
format: a.string,
|
|
2763
|
-
menuList: a.arrayOf(
|
|
2764
|
-
}),
|
|
2427
|
+
menuList: a.arrayOf(ha)
|
|
2428
|
+
}), Ne = a.shape({
|
|
2765
2429
|
key: a.string.isRequired,
|
|
2766
2430
|
label: a.string,
|
|
2767
2431
|
type: a.string.isRequired,
|
|
@@ -2778,8 +2442,8 @@ const mr = ({ config: h }) => {
|
|
|
2778
2442
|
rows: a.number,
|
|
2779
2443
|
text: a.string,
|
|
2780
2444
|
editorKey: a.string,
|
|
2781
|
-
options: a.arrayOf(
|
|
2782
|
-
}),
|
|
2445
|
+
options: a.arrayOf(Te)
|
|
2446
|
+
}), ga = a.shape({
|
|
2783
2447
|
key: a.string,
|
|
2784
2448
|
label: a.string,
|
|
2785
2449
|
type: a.string,
|
|
@@ -2789,12 +2453,12 @@ const mr = ({ config: h }) => {
|
|
|
2789
2453
|
blockClass: a.string,
|
|
2790
2454
|
icon: a.node,
|
|
2791
2455
|
variant: a.string,
|
|
2792
|
-
chipOptions: a.arrayOf(
|
|
2456
|
+
chipOptions: a.arrayOf(Te),
|
|
2793
2457
|
defaultColor: a.string,
|
|
2794
2458
|
className: a.string,
|
|
2795
2459
|
format: a.string
|
|
2796
2460
|
});
|
|
2797
|
-
|
|
2461
|
+
Ke.propTypes = {
|
|
2798
2462
|
config: a.shape({
|
|
2799
2463
|
title: a.string.isRequired,
|
|
2800
2464
|
description: a.string,
|
|
@@ -2803,7 +2467,7 @@ mr.propTypes = {
|
|
|
2803
2467
|
isStaticData: a.bool,
|
|
2804
2468
|
/* ================= TABLE CONFIG ================= */
|
|
2805
2469
|
tableConfig: a.shape({
|
|
2806
|
-
table_head: a.arrayOf(
|
|
2470
|
+
table_head: a.arrayOf(ba).isRequired,
|
|
2807
2471
|
search: a.shape({
|
|
2808
2472
|
enabled: a.bool,
|
|
2809
2473
|
useServerSideSearch: a.bool,
|
|
@@ -2824,24 +2488,24 @@ mr.propTypes = {
|
|
|
2824
2488
|
title: a.string.isRequired,
|
|
2825
2489
|
size: a.string,
|
|
2826
2490
|
formClass: a.string,
|
|
2827
|
-
formFields: a.arrayOf(
|
|
2491
|
+
formFields: a.arrayOf(Ne),
|
|
2828
2492
|
handleSubmit: a.func.isRequired,
|
|
2829
|
-
actionButtons: a.arrayOf(
|
|
2493
|
+
actionButtons: a.arrayOf(we)
|
|
2830
2494
|
}),
|
|
2831
2495
|
editModal: a.shape({
|
|
2832
2496
|
title: a.string.isRequired,
|
|
2833
2497
|
size: a.string,
|
|
2834
2498
|
formClass: a.string,
|
|
2835
|
-
formFields: a.arrayOf(
|
|
2499
|
+
formFields: a.arrayOf(Ne),
|
|
2836
2500
|
handleSubmit: a.func.isRequired,
|
|
2837
|
-
actionButtons: a.arrayOf(
|
|
2501
|
+
actionButtons: a.arrayOf(we)
|
|
2838
2502
|
}),
|
|
2839
2503
|
deleteModal: a.shape({
|
|
2840
2504
|
title: a.string.isRequired,
|
|
2841
2505
|
size: a.string,
|
|
2842
2506
|
confirmText: a.string,
|
|
2843
2507
|
referenceKey: a.string,
|
|
2844
|
-
actionButtons: a.arrayOf(
|
|
2508
|
+
actionButtons: a.arrayOf(we)
|
|
2845
2509
|
}),
|
|
2846
2510
|
viewModal: a.shape({
|
|
2847
2511
|
title: a.string.isRequired,
|
|
@@ -2849,7 +2513,7 @@ mr.propTypes = {
|
|
|
2849
2513
|
// 👇 This covers your commented code:
|
|
2850
2514
|
component: a.elementType,
|
|
2851
2515
|
// for custom component like TeamMemberDetail
|
|
2852
|
-
fields: a.arrayOf(
|
|
2516
|
+
fields: a.arrayOf(ga),
|
|
2853
2517
|
footer: a.shape({
|
|
2854
2518
|
cancelButton: a.bool,
|
|
2855
2519
|
cancelText: a.string
|
|
@@ -2858,14 +2522,14 @@ mr.propTypes = {
|
|
|
2858
2522
|
}),
|
|
2859
2523
|
/* ================= FILTER CONFIG ================= */
|
|
2860
2524
|
filterConfig: a.shape({
|
|
2861
|
-
fields: a.arrayOf(
|
|
2525
|
+
fields: a.arrayOf(Ne)
|
|
2862
2526
|
})
|
|
2863
2527
|
}).isRequired
|
|
2864
2528
|
};
|
|
2865
|
-
function
|
|
2866
|
-
return console.info(
|
|
2529
|
+
function ka(c) {
|
|
2530
|
+
return console.info(c, "props passed"), /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(Ke, { config: c.config }) });
|
|
2867
2531
|
}
|
|
2868
2532
|
export {
|
|
2869
|
-
|
|
2533
|
+
ka as default
|
|
2870
2534
|
};
|
|
2871
2535
|
//# sourceMappingURL=index.es.js.map
|