react-admin-crud-manager 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +105 -105
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tailwind.css +27 -16
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Icon as Re } from "@iconify/react";
|
|
|
5
5
|
import { Editor as Ze } from "@tinymce/tinymce-react";
|
|
6
6
|
import { SnackbarProvider as Xe, enqueueSnackbar as ke } from "notistack";
|
|
7
7
|
import a from "prop-types";
|
|
8
|
-
var Me = { exports: {} },
|
|
8
|
+
var Me = { exports: {} }, pe = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.js
|
|
@@ -17,7 +17,7 @@ var Me = { exports: {} }, ge = {};
|
|
|
17
17
|
*/
|
|
18
18
|
var Ee;
|
|
19
19
|
function Qe() {
|
|
20
|
-
if (Ee) return
|
|
20
|
+
if (Ee) return pe;
|
|
21
21
|
Ee = 1;
|
|
22
22
|
var c = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
23
23
|
function s(i, l, r) {
|
|
@@ -35,9 +35,9 @@ function Qe() {
|
|
|
35
35
|
props: r
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return pe.Fragment = d, pe.jsx = s, pe.jsxs = s, pe;
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var ge = {};
|
|
41
41
|
/**
|
|
42
42
|
* @license React
|
|
43
43
|
* react-jsx-runtime.development.js
|
|
@@ -82,7 +82,7 @@ function ea() {
|
|
|
82
82
|
case Y:
|
|
83
83
|
var y = t.render;
|
|
84
84
|
return t = t.displayName, t || (t = y.displayName || y.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
85
|
-
case
|
|
85
|
+
case g:
|
|
86
86
|
return y = t.displayName || null, y !== null ? y : c(t.type) || "Memo";
|
|
87
87
|
case _:
|
|
88
88
|
y = t._payload, t = t._init;
|
|
@@ -243,7 +243,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
243
243
|
function b(t) {
|
|
244
244
|
return typeof t == "object" && t !== null && t.$$typeof === h;
|
|
245
245
|
}
|
|
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"),
|
|
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"), g = 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
247
|
return null;
|
|
248
248
|
};
|
|
249
249
|
v = {
|
|
@@ -255,7 +255,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
255
255
|
v,
|
|
256
256
|
r
|
|
257
257
|
)(), re = V(i(r)), ie = {};
|
|
258
|
-
|
|
258
|
+
ge.Fragment = j, ge.jsx = function(t, y, L) {
|
|
259
259
|
var G = 1e4 > f.recentlyCreatedOwnerStacks++;
|
|
260
260
|
return m(
|
|
261
261
|
t,
|
|
@@ -265,7 +265,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
265
265
|
G ? Error("react-stack-top-frame") : oe,
|
|
266
266
|
G ? V(i(t)) : re
|
|
267
267
|
);
|
|
268
|
-
},
|
|
268
|
+
}, ge.jsxs = function(t, y, L) {
|
|
269
269
|
var G = 1e4 > f.recentlyCreatedOwnerStacks++;
|
|
270
270
|
return m(
|
|
271
271
|
t,
|
|
@@ -276,7 +276,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
276
276
|
G ? V(i(t)) : re
|
|
277
277
|
);
|
|
278
278
|
};
|
|
279
|
-
}()),
|
|
279
|
+
}()), ge;
|
|
280
280
|
}
|
|
281
281
|
process.env.NODE_ENV === "production" ? Me.exports = Qe() : Me.exports = ea();
|
|
282
282
|
var e = Me.exports;
|
|
@@ -335,9 +335,9 @@ const Le = (c, d = "DD MMM YYYY") => {
|
|
|
335
335
|
default: "h-9 px-4 rounded-md text-sm"
|
|
336
336
|
}, m = {
|
|
337
337
|
primary: {
|
|
338
|
-
contained: "bg-
|
|
339
|
-
outlined: "border border-
|
|
340
|
-
text: "bg-transparent text-
|
|
338
|
+
contained: "bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500 shadow-sm",
|
|
339
|
+
outlined: "border border-primary-600 bg-transparent text-primary-600 hover:bg-primary-50 focus:ring-primary-500",
|
|
340
|
+
text: "bg-transparent text-primary-600 hover:bg-primary-50 focus:ring-primary-500"
|
|
341
341
|
},
|
|
342
342
|
success: {
|
|
343
343
|
contained: "bg-green-600 text-white hover:bg-green-700 focus:ring-green-500 shadow-sm",
|
|
@@ -399,7 +399,7 @@ const ra = ({
|
|
|
399
399
|
var C;
|
|
400
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
401
|
(f) => f.label.toLowerCase().includes(N.toLowerCase())
|
|
402
|
-
),
|
|
402
|
+
), g = (f) => {
|
|
403
403
|
const A = Y(f);
|
|
404
404
|
return u ? z.includes(A) : A === z;
|
|
405
405
|
};
|
|
@@ -427,7 +427,7 @@ const ra = ({
|
|
|
427
427
|
} else
|
|
428
428
|
s(A), h(!1);
|
|
429
429
|
j("");
|
|
430
|
-
}, F = u ? c.filter((f) =>
|
|
430
|
+
}, F = u ? c.filter((f) => g(f.value)).map((f) => f.label).join(", ") : (C = c.find((f) => g(f.value))) == null ? void 0 : C.label;
|
|
431
431
|
return /* @__PURE__ */ e.jsxs("div", { className: m || "col-span-12", children: [
|
|
432
432
|
/* @__PURE__ */ e.jsx(ee, { label: k, required: M }),
|
|
433
433
|
/* @__PURE__ */ e.jsxs("div", { className: `relative ${l}`, ref: P, children: [
|
|
@@ -484,10 +484,10 @@ const ra = ({
|
|
|
484
484
|
type: "button",
|
|
485
485
|
onClick: () => _(String(f.value)),
|
|
486
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
|
|
487
|
-
${
|
|
487
|
+
${g(f.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
|
|
488
488
|
children: [
|
|
489
489
|
/* @__PURE__ */ e.jsx("span", { children: f.label }),
|
|
490
|
-
u &&
|
|
490
|
+
u && g(f.value) && /* @__PURE__ */ e.jsx(ze, { className: "w-4 h-4" })
|
|
491
491
|
]
|
|
492
492
|
},
|
|
493
493
|
String(f.value)
|
|
@@ -808,36 +808,36 @@ function na({
|
|
|
808
808
|
countriesList: x = !1,
|
|
809
809
|
defaultCountry: m = ""
|
|
810
810
|
}) {
|
|
811
|
-
const u = (
|
|
811
|
+
const u = (g) => fe.find((_) => _.code == g), [b, v] = T(
|
|
812
812
|
u(m) || fe[0]
|
|
813
813
|
), [h, N] = T(""), [j, S] = T(!1), [R, P] = T(""), B = ce();
|
|
814
814
|
W(() => {
|
|
815
815
|
if (typeof d == "string" && d.startsWith("+")) {
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
v(
|
|
816
|
+
const g = fe.filter((_) => d.startsWith("+" + _.phone)).sort((_, F) => F.phone.length - _.phone.length)[0];
|
|
817
|
+
if (g) {
|
|
818
|
+
v(g), N(d.replace("+" + g.phone, ""));
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
N(d);
|
|
823
823
|
}, [d]);
|
|
824
|
-
const Y = (
|
|
825
|
-
const _ =
|
|
824
|
+
const Y = (g) => {
|
|
825
|
+
const _ = g.target.value.replace(/\D/g, "");
|
|
826
826
|
N(_), b && l && l("+" + b.phone + _);
|
|
827
|
-
}, z = (
|
|
828
|
-
v(
|
|
827
|
+
}, z = (g) => {
|
|
828
|
+
v(g), l && l("+" + g.phone + h), S(!1), P("");
|
|
829
829
|
};
|
|
830
830
|
W(() => {
|
|
831
|
-
const
|
|
831
|
+
const g = (_) => {
|
|
832
832
|
B.current && !B.current.contains(_.target) && S(!1);
|
|
833
833
|
};
|
|
834
|
-
return document.addEventListener("mousedown",
|
|
834
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
835
835
|
}, []);
|
|
836
836
|
const O = fe.filter(
|
|
837
|
-
(
|
|
837
|
+
(g) => g.label.toLowerCase().includes(R.toLowerCase()) || g.phone.includes(R)
|
|
838
838
|
);
|
|
839
839
|
if (!x) {
|
|
840
|
-
const
|
|
840
|
+
const g = (_) => {
|
|
841
841
|
const F = _.target.value.replace(/[^+\d]/g, ""), C = F.startsWith("+") ? "+" + F.replace(/[+]/g, "").slice(0) : F;
|
|
842
842
|
l(C);
|
|
843
843
|
};
|
|
@@ -848,7 +848,7 @@ function na({
|
|
|
848
848
|
{
|
|
849
849
|
type: "text",
|
|
850
850
|
value: d,
|
|
851
|
-
onChange:
|
|
851
|
+
onChange: g,
|
|
852
852
|
placeholder: k,
|
|
853
853
|
disabled: r,
|
|
854
854
|
required: n,
|
|
@@ -934,36 +934,36 @@ function na({
|
|
|
934
934
|
{
|
|
935
935
|
type: "text",
|
|
936
936
|
value: R,
|
|
937
|
-
onChange: (
|
|
937
|
+
onChange: (g) => P(g.target.value),
|
|
938
938
|
placeholder: "Search country...",
|
|
939
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 "
|
|
940
940
|
}
|
|
941
941
|
)
|
|
942
942
|
] }) }),
|
|
943
|
-
O.map((
|
|
943
|
+
O.map((g) => /* @__PURE__ */ e.jsxs(
|
|
944
944
|
"button",
|
|
945
945
|
{
|
|
946
946
|
type: "button",
|
|
947
|
-
onClick: () => z(
|
|
947
|
+
onClick: () => z(g),
|
|
948
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",
|
|
949
949
|
children: [
|
|
950
950
|
/* @__PURE__ */ e.jsx(
|
|
951
951
|
"img",
|
|
952
952
|
{
|
|
953
|
-
src: `https://flagcdn.com/w20/${
|
|
954
|
-
alt:
|
|
953
|
+
src: `https://flagcdn.com/w20/${g.code.toLowerCase()}.png`,
|
|
954
|
+
alt: g.code,
|
|
955
955
|
className: "w-5 h-3 object-cover"
|
|
956
956
|
}
|
|
957
957
|
),
|
|
958
958
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
959
|
-
|
|
959
|
+
g.label,
|
|
960
960
|
" (+",
|
|
961
|
-
|
|
961
|
+
g.phone,
|
|
962
962
|
")"
|
|
963
963
|
] })
|
|
964
964
|
]
|
|
965
965
|
},
|
|
966
|
-
|
|
966
|
+
g.code
|
|
967
967
|
))
|
|
968
968
|
] })
|
|
969
969
|
] })
|
|
@@ -1315,8 +1315,8 @@ const sa = ({
|
|
|
1315
1315
|
fontFamily: z,
|
|
1316
1316
|
disabled: O
|
|
1317
1317
|
} = c;
|
|
1318
|
-
let
|
|
1319
|
-
|
|
1318
|
+
let g = d == null ? void 0 : d[i];
|
|
1319
|
+
g == null && (g = "");
|
|
1320
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
1321
|
switch (r) {
|
|
1322
1322
|
case "select":
|
|
@@ -1324,7 +1324,7 @@ const sa = ({
|
|
|
1324
1324
|
ra,
|
|
1325
1325
|
{
|
|
1326
1326
|
options: n || [],
|
|
1327
|
-
value:
|
|
1327
|
+
value: g,
|
|
1328
1328
|
onChange: (C) => s(i, C),
|
|
1329
1329
|
placeholder: _,
|
|
1330
1330
|
className: x || "",
|
|
@@ -1345,7 +1345,7 @@ const sa = ({
|
|
|
1345
1345
|
name: i,
|
|
1346
1346
|
label: l,
|
|
1347
1347
|
options: n || [],
|
|
1348
|
-
value:
|
|
1348
|
+
value: g,
|
|
1349
1349
|
onChange: (C) => s(i, C),
|
|
1350
1350
|
required: v,
|
|
1351
1351
|
parentClass: j,
|
|
@@ -1358,7 +1358,7 @@ const sa = ({
|
|
|
1358
1358
|
return /* @__PURE__ */ e.jsx(
|
|
1359
1359
|
ta,
|
|
1360
1360
|
{
|
|
1361
|
-
value:
|
|
1361
|
+
value: g,
|
|
1362
1362
|
onChange: (C) => s(i, C),
|
|
1363
1363
|
text: b,
|
|
1364
1364
|
options: n || [],
|
|
@@ -1373,7 +1373,7 @@ const sa = ({
|
|
|
1373
1373
|
return /* @__PURE__ */ e.jsx(
|
|
1374
1374
|
na,
|
|
1375
1375
|
{
|
|
1376
|
-
value:
|
|
1376
|
+
value: g,
|
|
1377
1377
|
onChange: (C) => s(i, C),
|
|
1378
1378
|
countriesList: S,
|
|
1379
1379
|
defaultCountry: R,
|
|
@@ -1390,7 +1390,7 @@ const sa = ({
|
|
|
1390
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1391
1391
|
Ie,
|
|
1392
1392
|
{
|
|
1393
|
-
value:
|
|
1393
|
+
value: g,
|
|
1394
1394
|
onChange: (C) => s(i, C.target.value),
|
|
1395
1395
|
placeholder: _,
|
|
1396
1396
|
rows: M || 3,
|
|
@@ -1406,7 +1406,7 @@ const sa = ({
|
|
|
1406
1406
|
return /* @__PURE__ */ e.jsx(
|
|
1407
1407
|
la,
|
|
1408
1408
|
{
|
|
1409
|
-
value:
|
|
1409
|
+
value: g,
|
|
1410
1410
|
onChange: (C) => s(i, C),
|
|
1411
1411
|
required: v,
|
|
1412
1412
|
accept: u || "image/*",
|
|
@@ -1421,7 +1421,7 @@ const sa = ({
|
|
|
1421
1421
|
return /* @__PURE__ */ e.jsx(
|
|
1422
1422
|
sa,
|
|
1423
1423
|
{
|
|
1424
|
-
value:
|
|
1424
|
+
value: g,
|
|
1425
1425
|
onChange: (C) => s(i, C),
|
|
1426
1426
|
required: v,
|
|
1427
1427
|
placeholder: _,
|
|
@@ -1438,7 +1438,7 @@ const sa = ({
|
|
|
1438
1438
|
Be,
|
|
1439
1439
|
{
|
|
1440
1440
|
type: r || "text",
|
|
1441
|
-
value:
|
|
1441
|
+
value: g,
|
|
1442
1442
|
onChange: (C) => s(i, C.target.value),
|
|
1443
1443
|
placeholder: _,
|
|
1444
1444
|
className: `${F} ${x || ""}`,
|
|
@@ -1653,27 +1653,27 @@ const sa = ({
|
|
|
1653
1653
|
},
|
|
1654
1654
|
onFilterApply: m,
|
|
1655
1655
|
filterConfig: u = null
|
|
1656
|
-
} = c, [b, v] = T(""), [h, N] = T(null), [j, S] = T([]), [R, P] = T({}), [B, Y] = T(!1), [z, O] = T(null), [
|
|
1656
|
+
} = c, [b, v] = T(""), [h, N] = T(null), [j, S] = T([]), [R, P] = T({}), [B, Y] = T(!1), [z, O] = T(null), [g, _] = 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
1657
|
if (n.useServerSidePagination) return F;
|
|
1658
1658
|
const o = (C - 1) * A;
|
|
1659
1659
|
return F.slice(o, o + A);
|
|
1660
1660
|
}, [F, C, A]), re = ce(null), ie = ce({}), t = ce(null), y = (o) => {
|
|
1661
1661
|
v(o), f(1), l.useServerSideSearch && (t.current && clearTimeout(t.current), t.current = setTimeout(async () => {
|
|
1662
1662
|
try {
|
|
1663
|
-
await x((
|
|
1664
|
-
...
|
|
1663
|
+
await x((p) => ({
|
|
1664
|
+
...p,
|
|
1665
1665
|
search: o,
|
|
1666
1666
|
current_page: 1
|
|
1667
1667
|
}));
|
|
1668
|
-
} catch (
|
|
1669
|
-
console.error("Search error:",
|
|
1668
|
+
} catch (p) {
|
|
1669
|
+
console.error("Search error:", p);
|
|
1670
1670
|
}
|
|
1671
1671
|
}, 800));
|
|
1672
|
-
}, L = (o,
|
|
1673
|
-
D.stopPropagation(), N(null), M == null || M(o.type,
|
|
1674
|
-
}, G = (o,
|
|
1675
|
-
|
|
1676
|
-
const H =
|
|
1672
|
+
}, L = (o, p, D) => {
|
|
1673
|
+
D.stopPropagation(), N(null), M == null || M(o.type, p);
|
|
1674
|
+
}, G = (o, p, D) => {
|
|
1675
|
+
p.stopPropagation(), S(D);
|
|
1676
|
+
const H = p.currentTarget;
|
|
1677
1677
|
ie.current[o] = H;
|
|
1678
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
1679
|
P({
|
|
@@ -1682,13 +1682,13 @@ const sa = ({
|
|
|
1682
1682
|
}), N(h === o ? null : o);
|
|
1683
1683
|
}, te = (o) => (C - 1) * A + o + 1, ne = (o) => {
|
|
1684
1684
|
O(o), _(!0);
|
|
1685
|
-
}, I = (o,
|
|
1685
|
+
}, I = (o, p, D, H = null) => /* @__PURE__ */ e.jsx(e.Fragment, { children: o ? /* @__PURE__ */ e.jsx(
|
|
1686
1686
|
"img",
|
|
1687
1687
|
{
|
|
1688
1688
|
src: o,
|
|
1689
|
-
alt:
|
|
1689
|
+
alt: p || "Avatar",
|
|
1690
1690
|
onClick: (K) => {
|
|
1691
|
-
K.stopPropagation(), K.preventDefault(), ne({ src: o, alt:
|
|
1691
|
+
K.stopPropagation(), K.preventDefault(), ne({ src: o, alt: p });
|
|
1692
1692
|
},
|
|
1693
1693
|
className: `w-10 h-10 cursor-pointer rounded-full object-cover border border-gray-200 dark:border-gray-700 ${D || ""}`
|
|
1694
1694
|
}
|
|
@@ -1698,19 +1698,19 @@ const sa = ({
|
|
|
1698
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
1699
|
children: /* @__PURE__ */ e.jsx(De, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
|
|
1700
1700
|
}
|
|
1701
|
-
) }) }), J = (o,
|
|
1702
|
-
|
|
1701
|
+
) }) }), J = (o, p) => /* @__PURE__ */ e.jsxs("div", { className: `flex items-center space-x-4 ${p.className || ""}`, children: [
|
|
1702
|
+
p.imageKey ? I(o[p.imageKey], o[p.titleKey], "group-avatar") : "",
|
|
1703
1703
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1704
|
-
/* @__PURE__ */ e.jsx("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: o[
|
|
1705
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: o[
|
|
1704
|
+
/* @__PURE__ */ e.jsx("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: o[p.titleKey] || "" }),
|
|
1705
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: o[p.subtitleKey] || "" })
|
|
1706
1706
|
] })
|
|
1707
|
-
] }), le = (o,
|
|
1707
|
+
] }), le = (o, p) => {
|
|
1708
1708
|
var Q;
|
|
1709
1709
|
let D = String(o);
|
|
1710
|
-
const H =
|
|
1711
|
-
let K =
|
|
1712
|
-
if (((Q =
|
|
1713
|
-
let Z =
|
|
1710
|
+
const H = p.variant || "contained";
|
|
1711
|
+
let K = p.defaultColor;
|
|
1712
|
+
if (((Q = p == null ? void 0 : p.chipOptions) == null ? void 0 : Q.length) > 0) {
|
|
1713
|
+
let Z = p == null ? void 0 : p.chipOptions.find((de) => de.value == o);
|
|
1714
1714
|
Z && (D = Z.label, K = Z.color);
|
|
1715
1715
|
}
|
|
1716
1716
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -1719,25 +1719,25 @@ const sa = ({
|
|
|
1719
1719
|
label: D,
|
|
1720
1720
|
variant: H,
|
|
1721
1721
|
color: K,
|
|
1722
|
-
className:
|
|
1722
|
+
className: p.className || ""
|
|
1723
1723
|
}
|
|
1724
1724
|
);
|
|
1725
|
-
}, ue = (o,
|
|
1726
|
-
const H =
|
|
1725
|
+
}, ue = (o, p, D) => {
|
|
1726
|
+
const H = p[o.key];
|
|
1727
1727
|
return o.type === "menu_actions" ? /* @__PURE__ */ e.jsx("div", { className: `text-center ${o.className || ""}`, children: /* @__PURE__ */ e.jsx(
|
|
1728
1728
|
"button",
|
|
1729
1729
|
{
|
|
1730
|
-
ref: (K) => ie.current[
|
|
1731
|
-
onClick: (K) => G(
|
|
1730
|
+
ref: (K) => ie.current[p.id] = K,
|
|
1731
|
+
onClick: (K) => G(p.id, K, o.menuList),
|
|
1732
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",
|
|
1733
1733
|
children: /* @__PURE__ */ e.jsx(We, { className: "h-4 w-4" })
|
|
1734
1734
|
}
|
|
1735
|
-
) }) : o.type === "index" ? /* @__PURE__ */ e.jsx("span", { className: o.className || "", children: te(D) }) : o.type === "group" ? J(
|
|
1736
|
-
}, me = (o,
|
|
1735
|
+
) }) : o.type === "index" ? /* @__PURE__ */ e.jsx("span", { className: o.className || "", children: te(D) }) : o.type === "group" ? J(p, 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, p) => {
|
|
1737
1737
|
if (o.onClickDetails)
|
|
1738
|
-
return M == null ? void 0 : M("view",
|
|
1738
|
+
return M == null ? void 0 : M("view", p);
|
|
1739
1739
|
if (typeof o.handleClick == "function")
|
|
1740
|
-
return o.handleClick(
|
|
1740
|
+
return o.handleClick(p);
|
|
1741
1741
|
}, xe = (o) => o.onClickDetails || typeof o.handleClick == "function";
|
|
1742
1742
|
return W(() => {
|
|
1743
1743
|
const o = () => {
|
|
@@ -1747,8 +1747,8 @@ const sa = ({
|
|
|
1747
1747
|
window.removeEventListener("scroll", o, !0);
|
|
1748
1748
|
};
|
|
1749
1749
|
}, [h]), W(() => {
|
|
1750
|
-
const o = (
|
|
1751
|
-
re.current && !re.current.contains(
|
|
1750
|
+
const o = (p) => {
|
|
1751
|
+
re.current && !re.current.contains(p.target) && N(null);
|
|
1752
1752
|
};
|
|
1753
1753
|
return document.addEventListener("click", o), () => document.removeEventListener("click", o);
|
|
1754
1754
|
}, []), W(() => {
|
|
@@ -1766,7 +1766,7 @@ const sa = ({
|
|
|
1766
1766
|
n.total_records,
|
|
1767
1767
|
n == null ? void 0 : n.useServerSidePagination
|
|
1768
1768
|
]), i ? /* @__PURE__ */ e.jsx(da, { rows: 6, columns: 6 }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1769
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end items-center mb-
|
|
1769
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-end items-center mb-4 gap-2", children: [
|
|
1770
1770
|
l.enabled && /* @__PURE__ */ e.jsx("div", { className: "", children: /* @__PURE__ */ e.jsxs("div", { className: "relative min-w-[300px]", children: [
|
|
1771
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" }),
|
|
1772
1772
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1802,7 +1802,7 @@ const sa = ({
|
|
|
1802
1802
|
className: "text-center py-10 text-gray-500 dark:text-gray-400",
|
|
1803
1803
|
children: k
|
|
1804
1804
|
}
|
|
1805
|
-
) }) : oe.map((o,
|
|
1805
|
+
) }) : oe.map((o, p) => /* @__PURE__ */ e.jsx(
|
|
1806
1806
|
"tr",
|
|
1807
1807
|
{
|
|
1808
1808
|
className: "hover:bg-gray-50 dark:hover:bg-blue-800/10 transition",
|
|
@@ -1812,12 +1812,12 @@ const sa = ({
|
|
|
1812
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
1813
|
title: String(o[D.key] ?? ""),
|
|
1814
1814
|
onClick: () => me(D, o),
|
|
1815
|
-
children: D.render ? D.render(o,
|
|
1815
|
+
children: D.render ? D.render(o, p) : ue(D, o, p)
|
|
1816
1816
|
},
|
|
1817
1817
|
D.key
|
|
1818
1818
|
))
|
|
1819
1819
|
},
|
|
1820
|
-
o.id ||
|
|
1820
|
+
o.id || p
|
|
1821
1821
|
)) })
|
|
1822
1822
|
] }) }),
|
|
1823
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: [
|
|
@@ -1840,11 +1840,11 @@ const sa = ({
|
|
|
1840
1840
|
{
|
|
1841
1841
|
value: A,
|
|
1842
1842
|
onChange: (o) => {
|
|
1843
|
-
const
|
|
1844
|
-
U(
|
|
1843
|
+
const p = Number(o.target.value);
|
|
1844
|
+
U(p), f(1), n.useServerSidePagination && x((D) => ({
|
|
1845
1845
|
...D,
|
|
1846
1846
|
current_page: 1,
|
|
1847
|
-
rows_per_page:
|
|
1847
|
+
rows_per_page: p
|
|
1848
1848
|
}));
|
|
1849
1849
|
},
|
|
1850
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",
|
|
@@ -1859,8 +1859,8 @@ const sa = ({
|
|
|
1859
1859
|
onClick: () => {
|
|
1860
1860
|
if (C > 1) {
|
|
1861
1861
|
const o = C - 1;
|
|
1862
|
-
f(o), n.useServerSidePagination && x((
|
|
1863
|
-
...
|
|
1862
|
+
f(o), n.useServerSidePagination && x((p) => ({
|
|
1863
|
+
...p,
|
|
1864
1864
|
current_page: o
|
|
1865
1865
|
}));
|
|
1866
1866
|
}
|
|
@@ -1882,8 +1882,8 @@ const sa = ({
|
|
|
1882
1882
|
onClick: () => {
|
|
1883
1883
|
if (C < ae) {
|
|
1884
1884
|
const o = C + 1;
|
|
1885
|
-
f(o), n.useServerSidePagination && x((
|
|
1886
|
-
...
|
|
1885
|
+
f(o), n.useServerSidePagination && x((p) => ({
|
|
1886
|
+
...p,
|
|
1887
1887
|
current_page: o
|
|
1888
1888
|
}));
|
|
1889
1889
|
}
|
|
@@ -1909,7 +1909,7 @@ const sa = ({
|
|
|
1909
1909
|
zIndex: 9999
|
|
1910
1910
|
},
|
|
1911
1911
|
className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
|
|
1912
|
-
children: j.map((o,
|
|
1912
|
+
children: j.map((o, p) => /* @__PURE__ */ e.jsxs(
|
|
1913
1913
|
"button",
|
|
1914
1914
|
{
|
|
1915
1915
|
onClick: (D) => L(
|
|
@@ -1923,7 +1923,7 @@ const sa = ({
|
|
|
1923
1923
|
o.title
|
|
1924
1924
|
]
|
|
1925
1925
|
},
|
|
1926
|
-
|
|
1926
|
+
p
|
|
1927
1927
|
))
|
|
1928
1928
|
}
|
|
1929
1929
|
),
|
|
@@ -1938,12 +1938,12 @@ const sa = ({
|
|
|
1938
1938
|
onApply: m
|
|
1939
1939
|
}
|
|
1940
1940
|
),
|
|
1941
|
-
|
|
1941
|
+
g && /* @__PURE__ */ e.jsx(
|
|
1942
1942
|
Ye,
|
|
1943
1943
|
{
|
|
1944
1944
|
src: z.src,
|
|
1945
1945
|
alt: z.alt,
|
|
1946
|
-
isOpen:
|
|
1946
|
+
isOpen: g,
|
|
1947
1947
|
setIsOpen: _
|
|
1948
1948
|
}
|
|
1949
1949
|
)
|
|
@@ -2149,7 +2149,7 @@ function ua({ data: c, config: d }) {
|
|
|
2149
2149
|
] });
|
|
2150
2150
|
}
|
|
2151
2151
|
const Ke = ({ config: c }) => {
|
|
2152
|
-
var ne, I, J, le, ue, me, xe, o,
|
|
2152
|
+
var ne, I, J, le, ue, me, xe, o, p, D, H, K, Q, Z, de, be;
|
|
2153
2153
|
const {
|
|
2154
2154
|
title: d,
|
|
2155
2155
|
fetchData: s = async () => {
|
|
@@ -2162,8 +2162,8 @@ const Ke = ({ config: c }) => {
|
|
|
2162
2162
|
search: "",
|
|
2163
2163
|
rows_per_page: 50,
|
|
2164
2164
|
current_page: 1
|
|
2165
|
-
}), [S, R] = T({}), [P, B] = T(!1), [Y, z] = T(!1), [O,
|
|
2166
|
-
w === "edit" ? (U(E),
|
|
2165
|
+
}), [S, R] = T({}), [P, B] = T(!1), [Y, z] = T(!1), [O, g] = T(!1), [_, F] = T(!1), [C, f] = T(!1), [A, U] = T(null), V = (w, E) => {
|
|
2166
|
+
w === "edit" ? (U(E), g(!0)) : w === "view" ? (U(E), f(!0)) : w === "delete" && (U(E), F(!0));
|
|
2167
2167
|
}, X = async (w, E, $ = "", se = "") => {
|
|
2168
2168
|
m(!0);
|
|
2169
2169
|
try {
|
|
@@ -2191,7 +2191,7 @@ const Ke = ({ config: c }) => {
|
|
|
2191
2191
|
(se) => se.map(
|
|
2192
2192
|
(q) => q.id === $.id ? { ...q, ...E } : q
|
|
2193
2193
|
)
|
|
2194
|
-
) : y(),
|
|
2194
|
+
) : y(), g(!1);
|
|
2195
2195
|
}, re = (w) => {
|
|
2196
2196
|
if (!w) {
|
|
2197
2197
|
F(!1), U(null);
|
|
@@ -2263,10 +2263,10 @@ const Ke = ({ config: c }) => {
|
|
|
2263
2263
|
}
|
|
2264
2264
|
),
|
|
2265
2265
|
children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
2266
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-
|
|
2266
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-3", children: [
|
|
2267
2267
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2268
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
|
|
2269
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-md text-gray-600 dark:text-gray-400", children: c == null ? void 0 : c.description })
|
|
2270
2270
|
] }),
|
|
2271
2271
|
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ e.jsxs(
|
|
2272
2272
|
he,
|
|
@@ -2328,7 +2328,7 @@ const Ke = ({ config: c }) => {
|
|
|
2328
2328
|
ye,
|
|
2329
2329
|
{
|
|
2330
2330
|
isOpen: O,
|
|
2331
|
-
onClose: () =>
|
|
2331
|
+
onClose: () => g(!1),
|
|
2332
2332
|
icon: (le = r.editModal) == null ? void 0 : le.icon,
|
|
2333
2333
|
title: ((ue = r.editModal) == null ? void 0 : ue.title) || "Edit",
|
|
2334
2334
|
size: ((me = r.editModal) == null ? void 0 : me.size) || "md",
|
|
@@ -2358,7 +2358,7 @@ const Ke = ({ config: c }) => {
|
|
|
2358
2358
|
},
|
|
2359
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
2360
|
title: ((o = r.deleteModal) == null ? void 0 : o.title) || "Confirm Delete",
|
|
2361
|
-
size: ((
|
|
2361
|
+
size: ((p = r.deleteModal) == null ? void 0 : p.size) || "md",
|
|
2362
2362
|
loading: x,
|
|
2363
2363
|
actionButtons: r.deleteModal.actionButtons,
|
|
2364
2364
|
executeFunction: X,
|
|
@@ -2443,7 +2443,7 @@ const Ke = ({ config: c }) => {
|
|
|
2443
2443
|
text: a.string,
|
|
2444
2444
|
editorKey: a.string,
|
|
2445
2445
|
options: a.arrayOf(Te)
|
|
2446
|
-
}),
|
|
2446
|
+
}), pa = a.shape({
|
|
2447
2447
|
key: a.string,
|
|
2448
2448
|
label: a.string,
|
|
2449
2449
|
type: a.string,
|
|
@@ -2513,7 +2513,7 @@ Ke.propTypes = {
|
|
|
2513
2513
|
// 👇 This covers your commented code:
|
|
2514
2514
|
component: a.elementType,
|
|
2515
2515
|
// for custom component like TeamMemberDetail
|
|
2516
|
-
fields: a.arrayOf(
|
|
2516
|
+
fields: a.arrayOf(pa),
|
|
2517
2517
|
footer: a.shape({
|
|
2518
2518
|
cancelButton: a.bool,
|
|
2519
2519
|
cancelText: a.string
|