@luminix/mui-cms 0.1.2 → 0.1.4

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/mui-cms.js CHANGED
@@ -3,16 +3,16 @@ var nr = (e, t, n) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var jt = (e, t, n) => nr(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
5
5
  import { config as se, collect as W, app as T, model as ye, App as rr, Model as Qe, Route as sr, Config as re } from "@luminix/core";
6
- import { Outlet as or, useParams as ar, useNavigate as ft, useSearchParams as Y, Link as De, Form as ir } from "react-router-dom";
6
+ import { Outlet as or, useParams as ar, useNavigate as ft, useSearchParams as $, Link as De, Form as ir } from "react-router-dom";
7
7
  import { useCollection as dn, PaginationProvider as lr, usePagination as Se, ModelForm as cr, useApplyReducers as pt, Forms as ur, LuminixProvider as dr } from "@luminix/react";
8
- import { useMediaQuery as Be, Dialog as ht, DialogTitle as mt, DialogContent as gt, DialogContentText as fr, DialogActions as bt, Button as N, Snackbar as pr, Alert as hr, IconButton as q, AlertTitle as mr, Box as V, Unstable_Grid2 as Q, Fab as gr, SpeedDial as br, SpeedDialIcon as yr, SpeedDialAction as wr, ButtonGroup as Sr, Popper as xr, Grow as Ar, Paper as yt, ClickAwayListener as Cr, MenuList as Er, MenuItem as oe, AppBar as fn, Toolbar as kr, Typography as $, Avatar as Tr, Drawer as pn, Divider as Re, Autocomplete as Dr, TextField as xe, CircularProgress as Rr, Switch as Or, Stack as M, FormControl as et, InputLabel as tt, Select as Oe, Badge as wt, Popover as Pr, Link as nt, Collapse as hn, TableCell as ee, RadioGroup as Ut, FormControlLabel as qe, Radio as _e, TableContainer as vr, Table as Fr, TableHead as Br, TableRow as fe, Checkbox as St, TableSortLabel as Lr, Skeleton as qt, TableBody as Ir, TableFooter as Nr, Tabs as Mr, Tab as _t, Breadcrumbs as jr, List as Ur, ListItem as qr, ListItemButton as _r, ListItemIcon as mn, ListItemText as gn, Menu as bn, CssBaseline as Hr } from "@mui/material";
8
+ import { useMediaQuery as Be, Dialog as ht, DialogTitle as mt, DialogContent as gt, DialogContentText as fr, DialogActions as bt, Button as N, Snackbar as pr, Alert as hr, IconButton as q, AlertTitle as mr, Box as V, Unstable_Grid2 as Q, Fab as gr, SpeedDial as br, SpeedDialIcon as yr, SpeedDialAction as wr, ButtonGroup as Sr, Popper as xr, Grow as Ar, Paper as yt, ClickAwayListener as Cr, MenuList as Er, MenuItem as oe, AppBar as fn, Toolbar as kr, Typography as K, Avatar as Tr, Drawer as pn, Divider as Re, Autocomplete as Dr, TextField as xe, CircularProgress as Rr, Switch as Or, Stack as M, FormControl as et, InputLabel as tt, Select as Oe, Badge as wt, Popover as Pr, Link as nt, Collapse as hn, TableCell as ee, RadioGroup as Ut, FormControlLabel as qe, Radio as _e, TableContainer as vr, Table as Fr, TableHead as Br, TableRow as fe, Checkbox as St, TableSortLabel as Lr, Skeleton as qt, TableBody as Ir, TableFooter as Nr, Tabs as Mr, Tab as _t, Breadcrumbs as jr, List as Ur, ListItem as qr, ListItemButton as _r, ListItemIcon as mn, ListItemText as gn, Menu as bn, CssBaseline as Hr } from "@mui/material";
9
9
  import h, { useContext as yn, useMemo as zr } from "react";
10
10
  import { useTranslation as L, initReactI18next as Wr } from "react-i18next";
11
11
  import { Close as xt, ArrowDropDown as Vr, ChevronLeft as At, ChevronRight as Ct, HighlightOffOutlined as Ht, AddCircleOutline as Kr, FilterList as $r, Menu as Yr, LastPage as Jr, FirstPage as Gr, Search as zt, SwapVert as Zr, ArrowUpward as Xr, ArrowDownward as Qr, MoreVert as wn, ExpandLess as es, ExpandMore as ts, PeopleOutlined as ns, CategoryOutlined as rs, DashboardOutlined as ss, Add as os } from "@mui/icons-material";
12
12
  import { useTheme as Et, styled as Z, createTheme as as, ThemeProvider as is } from "@mui/material/styles";
13
- import { Str as k, Obj as K, Query as Sn, DateTime as Wt, Func as ls, MakeFacade as cs, Reducible as xn, ServiceProvider as An } from "@luminix/support";
13
+ import { Str as k, Obj as G, Query as Sn, DateTime as Wt, Func as ls, MakeFacade as cs, Reducible as xn, ServiceProvider as An } from "@luminix/support";
14
14
  import Vt from "react-dom";
15
- import G from "i18next";
15
+ import J from "i18next";
16
16
  const us = {
17
17
  open: !1,
18
18
  setOpen: () => {
@@ -256,7 +256,7 @@ const ys = () => {
256
256
  ] });
257
257
  function H(e, t) {
258
258
  const { layout: n } = yn(X);
259
- return zr(() => K.get(n, e, t), [n, e, t]);
259
+ return zr(() => G.get(n, e, t), [n, e, t]);
260
260
  }
261
261
  const Ss = Z("div")(({ theme: e }) => ({
262
262
  padding: e.spacing(0, 1),
@@ -380,11 +380,11 @@ function kn(e, t) {
380
380
  const { toString: ks } = Object.prototype, { getPrototypeOf: Dt } = Object, Le = /* @__PURE__ */ ((e) => (t) => {
381
381
  const n = ks.call(t);
382
382
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
383
- })(/* @__PURE__ */ Object.create(null)), J = (e) => (e = e.toLowerCase(), (t) => Le(t) === e), Ie = (e) => (t) => typeof t === e, { isArray: pe } = Array, we = Ie("undefined");
383
+ })(/* @__PURE__ */ Object.create(null)), Y = (e) => (e = e.toLowerCase(), (t) => Le(t) === e), Ie = (e) => (t) => typeof t === e, { isArray: pe } = Array, we = Ie("undefined");
384
384
  function Ts(e) {
385
385
  return e !== null && !we(e) && e.constructor !== null && !we(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
386
386
  }
387
- const Tn = J("ArrayBuffer");
387
+ const Tn = Y("ArrayBuffer");
388
388
  function Ds(e) {
389
389
  let t;
390
390
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Tn(e.buffer), t;
@@ -394,11 +394,11 @@ const Rs = Ie("string"), _ = Ie("function"), Dn = Ie("number"), Ne = (e) => e !=
394
394
  return !1;
395
395
  const t = Dt(e);
396
396
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
397
- }, Ps = J("Date"), vs = J("File"), Fs = J("Blob"), Bs = J("FileList"), Ls = (e) => Ne(e) && _(e.pipe), Is = (e) => {
397
+ }, Ps = Y("Date"), vs = Y("File"), Fs = Y("Blob"), Bs = Y("FileList"), Ls = (e) => Ne(e) && _(e.pipe), Is = (e) => {
398
398
  let t;
399
399
  return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = Le(e)) === "formdata" || // detect form-data instance
400
400
  t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
401
- }, Ns = J("URLSearchParams"), [Ms, js, Us, qs] = ["ReadableStream", "Request", "Response", "Headers"].map(J), _s = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
401
+ }, Ns = Y("URLSearchParams"), [Ms, js, Us, qs] = ["ReadableStream", "Request", "Response", "Headers"].map(Y), _s = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
402
402
  function Ae(e, t, { allOwnKeys: n = !1 } = {}) {
403
403
  if (e === null || typeof e > "u")
404
404
  return;
@@ -474,12 +474,12 @@ const Hs = (e, t, n, { allOwnKeys: r } = {}) => (Ae(t, (s, o) => {
474
474
  for (; (n = e.exec(t)) !== null; )
475
475
  r.push(n);
476
476
  return r;
477
- }, Zs = J("HTMLFormElement"), Xs = (e) => e.toLowerCase().replace(
477
+ }, Zs = Y("HTMLFormElement"), Xs = (e) => e.toLowerCase().replace(
478
478
  /[-_\s]([a-z\d])(\w*)/g,
479
479
  function(n, r, s) {
480
480
  return r.toUpperCase() + s;
481
481
  }
482
- ), Kt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Qs = J("RegExp"), Pn = (e, t) => {
482
+ ), Kt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Qs = Y("RegExp"), Pn = (e, t) => {
483
483
  const n = Object.getOwnPropertyDescriptors(e), r = {};
484
484
  Ae(n, (s, o) => {
485
485
  let a;
@@ -539,7 +539,7 @@ const ao = (e) => {
539
539
  return r;
540
540
  };
541
541
  return n(e, 0);
542
- }, io = J("AsyncFunction"), lo = (e) => e && (Ne(e) || _(e)) && _(e.then) && _(e.catch), Fn = ((e, t) => e ? setImmediate : t ? ((n, r) => (ie.addEventListener("message", ({ source: s, data: o }) => {
542
+ }, io = Y("AsyncFunction"), lo = (e) => e && (Ne(e) || _(e)) && _(e.then) && _(e.catch), Fn = ((e, t) => e ? setImmediate : t ? ((n, r) => (ie.addEventListener("message", ({ source: s, data: o }) => {
543
543
  s === ie && o === n && r.length && r.shift()();
544
544
  }, !1), (s) => {
545
545
  r.push(s), ie.postMessage(n, "*");
@@ -579,7 +579,7 @@ const ao = (e) => {
579
579
  inherits: Ws,
580
580
  toFlatObject: Vs,
581
581
  kindOf: Le,
582
- kindOfTest: J,
582
+ kindOfTest: Y,
583
583
  endsWith: Ks,
584
584
  toArray: $s,
585
585
  forEachEntry: Js,
@@ -2176,7 +2176,7 @@ const ia = Z(gr)(({ theme: e }) => ({
2176
2176
  bottom: e.spacing(2),
2177
2177
  right: e.spacing(2)
2178
2178
  })), ca = ({ variant: e = "default" }) => {
2179
- const t = te(), n = v(), [r] = Y(), s = r.get("tab") ?? "all", [o, a] = h.useState(!1), l = h.useRef(null), [d, u] = h.useState(0), c = Ft(), f = h.useMemo(() => T("cms").getStaticActions(t, s), [t, s]);
2179
+ const t = te(), n = v(), [r] = $(), s = r.get("tab") ?? "all", [o, a] = h.useState(!1), l = h.useRef(null), [d, u] = h.useState(0), c = Ft(), f = h.useMemo(() => T("cms").getStaticActions(t, s), [t, s]);
2180
2180
  if (oa(
2181
2181
  e === "fab" && f.length > 0 ? n ? 12 : 10 : !1
2182
2182
  ), f.length === 0)
@@ -2345,7 +2345,7 @@ const pa = Z(
2345
2345
  !n && c && /* @__PURE__ */ i(l, {}),
2346
2346
  n ? null : S,
2347
2347
  /* @__PURE__ */ i(
2348
- $,
2348
+ K,
2349
2349
  {
2350
2350
  width: "100%",
2351
2351
  variant: "h6",
@@ -2484,7 +2484,7 @@ const an = (e, t) => ({
2484
2484
  },
2485
2485
  children: [
2486
2486
  n && /* @__PURE__ */ i(r, {}),
2487
- /* @__PURE__ */ i($, { variant: "h5", noWrap: !0, children: e })
2487
+ /* @__PURE__ */ i(K, { variant: "h5", noWrap: !0, children: e })
2488
2488
  ]
2489
2489
  }
2490
2490
  );
@@ -2526,12 +2526,12 @@ const an = (e, t) => ({
2526
2526
  if (!Array.isArray(e))
2527
2527
  return e;
2528
2528
  let t;
2529
- return K.isEmpty(e) ? t = "" : t = e[0], t;
2529
+ return G.isEmpty(e) ? t = "" : t = e[0], t;
2530
2530
  }, Ca = (e) => {
2531
2531
  if (Array.isArray(e))
2532
2532
  return e;
2533
2533
  let t;
2534
- return K.isEmpty(e) ? t = [] : t = [e, ""], t;
2534
+ return G.isEmpty(e) ? t = [] : t = [e, ""], t;
2535
2535
  }, Ea = async (e, t, n) => {
2536
2536
  const r = e.getSchema().relations[t], s = ye().make(r.model), o = s.getSchema().primaryKey, a = [];
2537
2537
  for (const l of n) {
@@ -2616,7 +2616,7 @@ const cn = async (e, t, n) => {
2616
2616
  () => o && u.count() === 0,
2617
2617
  [o, u]
2618
2618
  ), b = async (m, g) => {
2619
- d(g), K.isEmpty(g) || c(await Ta(t, n, g, W(f)));
2619
+ d(g), G.isEmpty(g) || c(await Ta(t, n, g, W(f)));
2620
2620
  };
2621
2621
  return h.useEffect(() => {
2622
2622
  r.length > 0 && (async () => y(await Ea(t, n, r)))();
@@ -2627,7 +2627,7 @@ const cn = async (e, t, n) => {
2627
2627
  m = !1;
2628
2628
  };
2629
2629
  }, [S]), h.useEffect(() => {
2630
- s(f.map((m) => m.getKey())), K.isEmpty(l) ? (async () => c(await cn(t, n, f)))() : c(W([]));
2630
+ s(f.map((m) => m.getKey())), G.isEmpty(l) ? (async () => c(await cn(t, n, f)))() : c(W([]));
2631
2631
  }, [f]), /* @__PURE__ */ i(
2632
2632
  Dr,
2633
2633
  {
@@ -3053,7 +3053,7 @@ const cn = async (e, t, n) => {
3053
3053
  e.filter((u) => {
3054
3054
  const c = (() => {
3055
3055
  const y = k.camel(l.split(k.camel(u.key))[1]);
3056
- return K.isEmpty(y) ? "equals" : y;
3056
+ return G.isEmpty(y) ? "equals" : y;
3057
3057
  })();
3058
3058
  if (!n.getOperators().includes(c))
3059
3059
  return !1;
@@ -3061,7 +3061,7 @@ const cn = async (e, t, n) => {
3061
3061
  return u.key === f;
3062
3062
  }).forEach((u) => {
3063
3063
  let c = k.camel(l.split(k.camel(u.key))[1]);
3064
- (typeof c > "u" || c === null || K.isEmpty(c)) && (c = "equals");
3064
+ (typeof c > "u" || c === null || G.isEmpty(c)) && (c = "equals");
3065
3065
  let f = d;
3066
3066
  switch (n.getInputType(u.type)) {
3067
3067
  case "text": {
@@ -3116,7 +3116,7 @@ const cn = async (e, t, n) => {
3116
3116
  }
3117
3117
  }), n;
3118
3118
  }, Ba = () => {
3119
- const { t: e } = L(), t = T("filter"), n = v(), r = te(), [s, o] = Y(), a = h.useMemo(() => "where" in Sn.toObject(s), [s]), [l, d] = h.useState(null), [u, c] = h.useState([]), f = !!l, y = h.useMemo(() => t.getFilterableColumns(r), [r]), S = (x) => {
3119
+ const { t: e } = L(), t = T("filter"), n = v(), r = te(), [s, o] = $(), a = h.useMemo(() => "where" in Sn.toObject(s), [s]), [l, d] = h.useState(null), [u, c] = h.useState([]), f = !!l, y = h.useMemo(() => t.getFilterableColumns(r), [r]), S = (x) => {
3120
3120
  d(x.currentTarget);
3121
3121
  }, b = () => {
3122
3122
  d(null), setTimeout(() => {
@@ -3373,7 +3373,7 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3373
3373
  "Last &raquo;": /* @__PURE__ */ i(Jr, {}),
3374
3374
  "&laquo; First": /* @__PURE__ */ i(Gr, {})
3375
3375
  }[e] || e }) : /* @__PURE__ */ i(B, { children: e }), Ma = ({ variant: e = "default", ...t }) => {
3376
- const n = e === "default", [r, s] = Y(), [o, a] = h.useState(r.get("page") || "1"), {
3376
+ const n = e === "default", [r, s] = $(), [o, a] = h.useState(r.get("page") || "1"), {
3377
3377
  links: l,
3378
3378
  meta: {
3379
3379
  current_page: d = 1,
@@ -3471,7 +3471,7 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3471
3471
  to: r = 0
3472
3472
  } = {}
3473
3473
  } = Se();
3474
- return /* @__PURE__ */ i($, { variant: "caption", noWrap: !0, children: e(":from–:to of :total", {
3474
+ return /* @__PURE__ */ i(K, { variant: "caption", noWrap: !0, children: e(":from–:to of :total", {
3475
3475
  from: n,
3476
3476
  to: r,
3477
3477
  total: t
@@ -3481,7 +3481,7 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3481
3481
  meta: {
3482
3482
  per_page: t = 15
3483
3483
  } = {}
3484
- } = Se(), [, n] = Y(), r = (o) => {
3484
+ } = Se(), [, n] = $(), r = (o) => {
3485
3485
  n((a) => {
3486
3486
  const l = new URLSearchParams(a);
3487
3487
  return l.set("per_page", o.target.value.toString()), l;
@@ -3498,7 +3498,7 @@ const Na = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3498
3498
  alignItems: "center",
3499
3499
  gap: 1,
3500
3500
  children: [
3501
- /* @__PURE__ */ w($, { variant: "caption", children: [
3501
+ /* @__PURE__ */ w(K, { variant: "caption", children: [
3502
3502
  e("Rows per page"),
3503
3503
  ":"
3504
3504
  ] }),
@@ -3559,7 +3559,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3559
3559
  return e ? r.set("q", e) : r.delete("q"), r;
3560
3560
  });
3561
3561
  }, 500), za = () => {
3562
- const [e, t] = Y(), n = e.get("q") || "", [r, s] = h.useState(n), [o, a] = h.useState(!1), l = h.useRef(null), { t: d } = L();
3562
+ const [e, t] = $(), n = e.get("q") || "", [r, s] = h.useState(n), [o, a] = h.useState(!1), l = h.useRef(null), { t: d } = L();
3563
3563
  h.useEffect(() => {
3564
3564
  s(n);
3565
3565
  }, [n]);
@@ -3623,7 +3623,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3623
3623
  children: e
3624
3624
  }
3625
3625
  ), Va = () => {
3626
- const { t: e } = L(), [t, n] = Y(), {
3626
+ const { t: e } = L(), [t, n] = $(), {
3627
3627
  columns: r,
3628
3628
  Model: s
3629
3629
  } = ae(), o = t.get("order_by") || "", [a = "", l = ""] = o.split(":"), [d, u] = h.useState(a), [c, f] = h.useState(l), [y, S] = h.useState(!1), b = () => {
@@ -3676,7 +3676,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3676
3676
  u(x.target.value), c || f("asc");
3677
3677
  },
3678
3678
  children: [
3679
- /* @__PURE__ */ i($, { variant: "caption", children: e("Column") }),
3679
+ /* @__PURE__ */ i(K, { variant: "caption", children: e("Column") }),
3680
3680
  /* @__PURE__ */ i(Re, {}),
3681
3681
  W(r).whereStrict("sortable", "!=", !1).map(({ key: x, label: E }) => /* @__PURE__ */ i(
3682
3682
  qe,
@@ -3690,7 +3690,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3690
3690
  ]
3691
3691
  }
3692
3692
  ),
3693
- /* @__PURE__ */ i($, { variant: "caption", children: e("Direction") }),
3693
+ /* @__PURE__ */ i(K, { variant: "caption", children: e("Direction") }),
3694
3694
  /* @__PURE__ */ i(Re, {}),
3695
3695
  /* @__PURE__ */ w(
3696
3696
  Ut,
@@ -3731,7 +3731,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3731
3731
  ] })
3732
3732
  ] });
3733
3733
  }, Ka = ({ items: e, loading: t, children: n, error: r }) => {
3734
- const s = te(), o = h.useMemo(() => W([]), [s, e]), [a] = Y(), l = a.get("tab") ?? "all", d = h.useMemo(() => [
3734
+ const s = te(), o = h.useMemo(() => W([]), [s, e]), [a] = $(), l = a.get("tab") ?? "all", d = h.useMemo(() => [
3735
3735
  {
3736
3736
  key: s.getSchema().labeledBy,
3737
3737
  label: k.human(s.getSchema().labeledBy)
@@ -3770,7 +3770,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3770
3770
  massActions: n,
3771
3771
  columns: r,
3772
3772
  items: s
3773
- } = ae(), o = v(), [a, l] = Y(), {
3773
+ } = ae(), o = v(), [a, l] = $(), {
3774
3774
  indeterminate: d,
3775
3775
  allSelected: u,
3776
3776
  handleSelectToggleAll: c
@@ -3826,7 +3826,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3826
3826
  columns: t
3827
3827
  } = ae(), n = v(), {
3828
3828
  ["ModelIndex.Table.ShrinkedCell"]: r
3829
- } = T("cms").getComponents(), [s] = Y(), o = parseInt(s.get("per_page") || "15");
3829
+ } = T("cms").getComponents(), [s] = $(), o = parseInt(s.get("per_page") || "15");
3830
3830
  return /* @__PURE__ */ i(B, { children: Array.from({ length: o }).map((a, l) => /* @__PURE__ */ w(fe, { children: [
3831
3831
  e.length > 0 && /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(St, {}) }),
3832
3832
  n && t.map(({ key: d, label: u, sortable: c, ...f }, y) => /* @__PURE__ */ i(ee, { ...f, children: /* @__PURE__ */ i(
@@ -3859,7 +3859,7 @@ const _a = Z(xe)(({ theme: e }) => ({
3859
3859
  o && /* @__PURE__ */ i(Ja, {}),
3860
3860
  d,
3861
3861
  s && !s.count() && /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ w(ee, { colSpan: a, sx: { textAlign: "center", py: 10 }, children: [
3862
- /* @__PURE__ */ i($, { children: r("No :model found", {
3862
+ /* @__PURE__ */ i(K, { children: r("No :model found", {
3863
3863
  model: n.plural().toLocaleLowerCase()
3864
3864
  }) }),
3865
3865
  /* @__PURE__ */ i("br", {}),
@@ -3872,7 +3872,7 @@ class Za {
3872
3872
  return "cms";
3873
3873
  }
3874
3874
  }
3875
- const I = cs(Za, rr), de = Z($)(() => ({
3875
+ const I = cs(Za, rr), de = Z(K)(() => ({
3876
3876
  whiteSpace: "nowrap",
3877
3877
  overflow: "hidden",
3878
3878
  textOverflow: "ellipsis",
@@ -3900,7 +3900,7 @@ const I = cs(Za, rr), de = Z($)(() => ({
3900
3900
  " ",
3901
3901
  JSON.stringify(t)
3902
3902
  ] }) : /* @__PURE__ */ w(h.Fragment, { children: [
3903
- /* @__PURE__ */ i($, { sx: { display: "inline" }, children: /* @__PURE__ */ w("b", { children: [
3903
+ /* @__PURE__ */ i(K, { sx: { display: "inline" }, children: /* @__PURE__ */ w("b", { children: [
3904
3904
  e,
3905
3905
  ":"
3906
3906
  ] }) }),
@@ -4057,7 +4057,7 @@ const I = cs(Za, rr), de = Z($)(() => ({
4057
4057
  ) }) });
4058
4058
  };
4059
4059
  function ri() {
4060
- const e = te(), { t } = L(), [n, r] = Y(), s = n.get("tab") || "all", o = (d, u) => {
4060
+ const e = te(), { t } = L(), [n, r] = $(), s = n.get("tab") || "all", o = (d, u) => {
4061
4061
  r(() => {
4062
4062
  const c = new URLSearchParams();
4063
4063
  return u !== "all" && c.set("tab", u), c;
@@ -4128,7 +4128,7 @@ function si(e) {
4128
4128
  },
4129
4129
  o
4130
4130
  ) : /* @__PURE__ */ i(
4131
- $,
4131
+ K,
4132
4132
  {
4133
4133
  color: "text.primary",
4134
4134
  children: r
@@ -4201,7 +4201,7 @@ const Xn = ({
4201
4201
  children: [
4202
4202
  b,
4203
4203
  e && /* @__PURE__ */ i(
4204
- $,
4204
+ K,
4205
4205
  {
4206
4206
  fontSize: 10,
4207
4207
  sx: { mt: 0.5 },
@@ -4447,7 +4447,7 @@ const Xn = ({
4447
4447
  t(`/${k.kebab(e.plural())}/create`);
4448
4448
  }
4449
4449
  }, ai = ({ item: e }) => {
4450
- const t = Ft(), [n] = Y(), r = n.get("tab") ?? "all", s = h.useMemo(() => T("cms").getInstanceActions(e.constructor, r), [e, r]), [o, a] = h.useState(null), l = !!o, d = (c) => {
4450
+ const t = Ft(), [n] = $(), r = n.get("tab") ?? "all", s = h.useMemo(() => T("cms").getInstanceActions(e.constructor, r), [e, r]), [o, a] = h.useState(null), l = !!o, d = (c) => {
4451
4451
  a(c.currentTarget);
4452
4452
  }, u = () => {
4453
4453
  a(null);
@@ -4533,7 +4533,7 @@ class ii {
4533
4533
  );
4534
4534
  }
4535
4535
  }
4536
- const li = xn(ii), be = (e) => !(typeof e > "u" || e === null || K.isEmpty(e));
4536
+ const li = xn(ii), be = (e) => !(typeof e > "u" || e === null || G.isEmpty(e));
4537
4537
  class ci {
4538
4538
  getInputType(t) {
4539
4539
  switch (t) {
@@ -4602,7 +4602,7 @@ class ci {
4602
4602
  return [
4603
4603
  ...n.filter((s) => !s.hidden && !s.appended).map((s) => {
4604
4604
  let o = s.phpType ?? "string";
4605
- return !K.isNull(s.cast) && !K.isEmpty(s.cast) && (o = s.cast), {
4605
+ return s.cast !== null && !G.isEmpty(s.cast) && (o = s.cast), {
4606
4606
  key: s.name,
4607
4607
  label: k.human(s.name),
4608
4608
  type: o,
@@ -4628,7 +4628,7 @@ class ci {
4628
4628
  if (!be(r.key) || !be(r.operator))
4629
4629
  return !0;
4630
4630
  if (["boolean"].includes(this.getInputType(r.type))) {
4631
- if (typeof r.value > "u" || K.isNull(r.value))
4631
+ if (typeof r.value > "u" || G.isNull(r.value))
4632
4632
  return !0;
4633
4633
  } else if (!be(r.value))
4634
4634
  return !0;
@@ -4802,7 +4802,7 @@ class di extends An {
4802
4802
  this.translateModelColumns(), this.translateMenuEntries(), this.translateInstanceActions(), this.translateMassActions(), this.translateFormLabels(), this.translateStaticActions();
4803
4803
  }
4804
4804
  initI18Next() {
4805
- G.use(Wr).init({
4805
+ J.use(Wr).init({
4806
4806
  lng: re.get("app.locale", "en"),
4807
4807
  fallbackLng: re.get("app.fallback_locale", "en"),
4808
4808
  resources: {
@@ -4828,10 +4828,10 @@ class di extends An {
4828
4828
  "model",
4829
4829
  (t) => class extends t {
4830
4830
  static singular() {
4831
- return G.t(t.singular());
4831
+ return J.t(t.singular());
4832
4832
  }
4833
4833
  static plural() {
4834
- return G.t(t.plural());
4834
+ return J.t(t.plural());
4835
4835
  }
4836
4836
  },
4837
4837
  0
@@ -4843,7 +4843,7 @@ class di extends An {
4843
4843
  `model${k.studly(t)}Columns`,
4844
4844
  (n) => n.map((r) => ({
4845
4845
  ...r,
4846
- label: G.t(r.label)
4846
+ label: J.t(r.label)
4847
4847
  })),
4848
4848
  99
4849
4849
  );
@@ -4853,7 +4853,7 @@ class di extends An {
4853
4853
  "menuItems",
4854
4854
  (t) => {
4855
4855
  const n = t.find((r) => r.key === "dashboard");
4856
- return n && (n.text = G.t(n.text)), t;
4856
+ return n && (n.text = J.t(n.text)), t;
4857
4857
  },
4858
4858
  5
4859
4859
  );
@@ -4863,7 +4863,7 @@ class di extends An {
4863
4863
  "massActions",
4864
4864
  (t) => t.map((n) => ({
4865
4865
  ...n,
4866
- label: G.t(n.label)
4866
+ label: J.t(n.label)
4867
4867
  })),
4868
4868
  99
4869
4869
  );
@@ -4873,7 +4873,7 @@ class di extends An {
4873
4873
  "instanceActions",
4874
4874
  (t) => t.map((n) => ({
4875
4875
  ...n,
4876
- label: G.t(n.label)
4876
+ label: J.t(n.label)
4877
4877
  })),
4878
4878
  99
4879
4879
  );
@@ -4883,7 +4883,7 @@ class di extends An {
4883
4883
  "staticActions",
4884
4884
  (t, n) => {
4885
4885
  const r = t.find(({ key: s }) => s === "create");
4886
- return r && (r.label = G.t("Create :model", {
4886
+ return r && (r.label = J.t("Create :model", {
4887
4887
  model: n.singular()
4888
4888
  })), t;
4889
4889
  }
@@ -4893,8 +4893,8 @@ class di extends An {
4893
4893
  ur.reducer(
4894
4894
  "getDefaultInputProps",
4895
4895
  (t) => (Array.isArray(t) ? t.map((n) => {
4896
- n != null && n.label && (n.label = G.t(n.label));
4897
- }) : t != null && t.label && (t.label = G.t(t.label)), t),
4896
+ n != null && n.label && (n.label = J.t(n.label));
4897
+ }) : t != null && t.label && (t.label = J.t(t.label)), t),
4898
4898
  99
4899
4899
  );
4900
4900
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/mui-cms",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "bundle/mui-cms.js",
6
6
  "module": "dist/mui-cms.js",
@@ -18,9 +18,9 @@
18
18
  "@emotion/react": "^11.13.0",
19
19
  "@emotion/styled": "^11.13.0",
20
20
  "@fontsource/roboto": "^5.0.12",
21
- "@luminix/core": "^0.2.2",
22
- "@luminix/react": "^0.2.0",
23
- "@luminix/support": "^0.4.0",
21
+ "@luminix/core": "^0.3.0",
22
+ "@luminix/react": "^0.2.1",
23
+ "@luminix/support": "^0.4.2",
24
24
  "@mui/icons-material": "^5.16.5",
25
25
  "@mui/material": "^5.16.5",
26
26
  "i18next": "^23.12.2",