@luminix/mui-cms 0.2.9 → 0.2.11

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
@@ -6,7 +6,7 @@ import { config as oe, collect as W, app as T, model as we, App as xt, Model as
6
6
  import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
7
7
  import { Outlet as Sr, useParams as xr, useNavigate as At, useSearchParams as G, Link as Pe, Form as Ar } from "react-router-dom";
8
8
  import { useCollection as yn, PaginationProvider as Cr, usePagination as xe, ModelForm as Er, useApplyReducers as Ct, Forms as kr, LuminixProvider as Tr } from "@luminix/react";
9
- import { useMediaQuery as Me, Dialog as Et, DialogTitle as kt, DialogContent as Tt, DialogContentText as Dr, TextField as fe, DialogActions as Dt, Button as M, Snackbar as Or, Alert as Rr, IconButton as q, AlertTitle as Pr, Box as H, Unstable_Grid2 as Q, Fab as vr, SpeedDial as Fr, SpeedDialIcon as Lr, SpeedDialAction as Br, ButtonGroup as Ir, Popper as Mr, Grow as Nr, Paper as Ot, ClickAwayListener as jr, MenuList as Ur, MenuItem as se, AppBar as wn, Toolbar as qr, Typography as $, Drawer as Sn, Divider as ve, Autocomplete as _r, CircularProgress as Hr, Switch as zr, Stack as N, FormControl as at, InputLabel as it, Select as Fe, Badge as Rt, Popover as Vr, Link as lt, Collapse as xn, TableCell as ee, RadioGroup as $t, FormControlLabel as Ke, Radio as Ye, TableContainer as Wr, Table as $r, TableHead as Kr, TableRow as he, Checkbox as Pt, TableSortLabel as Yr, Skeleton as Kt, TableBody as Jr, TableFooter as Gr, Tabs as Zr, Tab as Yt, Breadcrumbs as Xr, List as Qr, ListItem as eo, ListItemButton as to, ListItemIcon as An, ListItemText as Cn, Menu as En, Avatar as no, CssBaseline as ro } from "@mui/material";
9
+ import { useMediaQuery as Me, Dialog as Et, DialogTitle as kt, DialogContent as Tt, DialogContentText as Dr, TextField as fe, DialogActions as Dt, Button as M, Snackbar as Or, Alert as Rr, IconButton as q, AlertTitle as Pr, Box as z, Unstable_Grid2 as Q, Fab as vr, SpeedDial as Fr, SpeedDialIcon as Lr, SpeedDialAction as Br, ButtonGroup as Ir, Popper as Mr, Grow as Nr, Paper as Ot, ClickAwayListener as jr, MenuList as Ur, MenuItem as se, AppBar as wn, Toolbar as qr, Typography as $, Drawer as Sn, Divider as ve, Autocomplete as _r, CircularProgress as Hr, Switch as zr, Stack as N, FormControl as at, InputLabel as it, Select as Fe, Badge as Rt, Popover as Vr, Link as lt, Collapse as xn, TableCell as ee, RadioGroup as $t, FormControlLabel as Ke, Radio as Ye, TableContainer as Wr, Table as $r, TableHead as Kr, TableRow as he, Checkbox as Pt, TableSortLabel as Yr, Skeleton as Kt, TableBody as Jr, TableFooter as Gr, Tabs as Zr, Tab as Yt, Breadcrumbs as Xr, List as Qr, ListItem as eo, ListItemButton as to, ListItemIcon as An, ListItemText as Cn, Menu as En, Avatar as no, CssBaseline as ro } from "@mui/material";
10
10
  import m, { useContext as kn, useMemo as oo } from "react";
11
11
  import { useTranslation as L, initReactI18next as so } from "react-i18next";
12
12
  import { Close as Ne, ArrowDropDown as Tn, ChevronLeft as je, ChevronRight as Ue, HighlightOffOutlined as ct, AddCircleOutline as Dn, FilterList as On, Menu as Rn, LastPage as Pn, FirstPage as vn, Search as ut, SwapVert as Fn, ArrowUpward as Ln, ArrowDownward as Bn, MoreVert as vt, ExpandLess as In, ExpandMore as Mn, Add as ao, CategoryOutlined as io, DashboardOutlined as lo, PeopleOutlined as co } from "@mui/icons-material";
@@ -266,7 +266,7 @@ function Bt(e) {
266
266
  }
267
267
  const xo = () => {
268
268
  const { t: e } = L();
269
- return Bt(e("Dashboard")), /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: "Dashboard" });
269
+ return Bt(e("Dashboard")), /* @__PURE__ */ i(z, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: "Dashboard" });
270
270
  }, Ao = ({ error: e }) => /* @__PURE__ */ w("div", { children: [
271
271
  /* @__PURE__ */ i("h1", { children: "Ops..." }),
272
272
  /* @__PURE__ */ i("p", { children: "Something went wrong" }),
@@ -276,7 +276,7 @@ const xo = () => {
276
276
  e.stack
277
277
  ] }) })
278
278
  ] });
279
- function z(e, t) {
279
+ function V(e, t) {
280
280
  const { layout: n } = kn(X);
281
281
  return oo(() => J.get(n, e, t), [n, e, t]);
282
282
  }
@@ -289,12 +289,12 @@ const Co = Z("div")(({ theme: e }) => ({
289
289
  DesktopPageTitle: r,
290
290
  ["Layout.AppBar"]: o,
291
291
  ["Layout.Drawer"]: s
292
- } = T("cms").getComponents(), a = z("appBar.height"), {
292
+ } = T("cms").getComponents(), a = V("appBar.height"), {
293
293
  AppBar: l,
294
294
  Drawer: d,
295
295
  main: c
296
296
  } = t || {};
297
- return /* @__PURE__ */ w(H, { sx: { display: "flex" }, ...n, children: [
297
+ return /* @__PURE__ */ w(z, { sx: { display: "flex" }, ...n, children: [
298
298
  /* @__PURE__ */ i(
299
299
  o,
300
300
  {
@@ -304,7 +304,7 @@ const Co = Z("div")(({ theme: e }) => ({
304
304
  ),
305
305
  /* @__PURE__ */ i(s, { ...d }),
306
306
  /* @__PURE__ */ w(
307
- H,
307
+ z,
308
308
  {
309
309
  component: "main",
310
310
  sx: {
@@ -350,7 +350,7 @@ const To = () => {
350
350
  ["ModelIndex.Table.TableBody.TableRow"]: S,
351
351
  ["ModelIndex.Tabs"]: b
352
352
  } = T("cms").getComponents();
353
- return /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
353
+ return /* @__PURE__ */ i(z, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
354
354
  /* @__PURE__ */ w(
355
355
  Q,
356
356
  {
@@ -404,22 +404,22 @@ const { toString: Oo } = Object.prototype, { getPrototypeOf: It } = Object, qe =
404
404
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
405
405
  })(/* @__PURE__ */ Object.create(null)), K = (e) => (e = e.toLowerCase(), (t) => qe(t) === e), _e = (e) => (t) => typeof t === e, { isArray: pe } = Array, Se = _e("undefined");
406
406
  function Ro(e) {
407
- return e !== null && !Se(e) && e.constructor !== null && !Se(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
407
+ return e !== null && !Se(e) && e.constructor !== null && !Se(e.constructor) && H(e.constructor.isBuffer) && e.constructor.isBuffer(e);
408
408
  }
409
409
  const qn = K("ArrayBuffer");
410
410
  function Po(e) {
411
411
  let t;
412
412
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qn(e.buffer), t;
413
413
  }
414
- const vo = _e("string"), _ = _e("function"), _n = _e("number"), He = (e) => e !== null && typeof e == "object", Fo = (e) => e === !0 || e === !1, Te = (e) => {
414
+ const vo = _e("string"), H = _e("function"), _n = _e("number"), He = (e) => e !== null && typeof e == "object", Fo = (e) => e === !0 || e === !1, Te = (e) => {
415
415
  if (qe(e) !== "object")
416
416
  return !1;
417
417
  const t = It(e);
418
418
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
419
- }, Lo = K("Date"), Bo = K("File"), Io = K("Blob"), Mo = K("FileList"), No = (e) => He(e) && _(e.pipe), jo = (e) => {
419
+ }, Lo = K("Date"), Bo = K("File"), Io = K("Blob"), Mo = K("FileList"), No = (e) => He(e) && H(e.pipe), jo = (e) => {
420
420
  let t;
421
- return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = qe(e)) === "formdata" || // detect form-data instance
422
- t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
421
+ return e && (typeof FormData == "function" && e instanceof FormData || H(e.append) && ((t = qe(e)) === "formdata" || // detect form-data instance
422
+ t === "object" && H(e.toString) && e.toString() === "[object FormData]"));
423
423
  }, Uo = K("URLSearchParams"), [qo, _o, Ho, zo] = ["ReadableStream", "Request", "Response", "Headers"].map(K), Vo = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
424
424
  function Ae(e, t, { allOwnKeys: n = !1 } = {}) {
425
425
  if (e === null || typeof e > "u")
@@ -455,7 +455,7 @@ function ft() {
455
455
  return t;
456
456
  }
457
457
  const Wo = (e, t, n, { allOwnKeys: r } = {}) => (Ae(t, (o, s) => {
458
- n && _(o) ? e[s] = Un(o, n) : e[s] = o;
458
+ n && H(o) ? e[s] = Un(o, n) : e[s] = o;
459
459
  }, { allOwnKeys: r }), e), $o = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ko = (e, t, n, r) => {
460
460
  e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
461
461
  value: t.prototype
@@ -509,10 +509,10 @@ const Wo = (e, t, n, { allOwnKeys: r } = {}) => (Ae(t, (o, s) => {
509
509
  }), Object.defineProperties(e, r);
510
510
  }, rs = (e) => {
511
511
  Vn(e, (t, n) => {
512
- if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
512
+ if (H(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
513
513
  return !1;
514
514
  const r = e[n];
515
- if (_(r)) {
515
+ if (H(r)) {
516
516
  if (t.enumerable = !1, "writable" in t) {
517
517
  t.writable = !1;
518
518
  return;
@@ -542,7 +542,7 @@ const Wo = (e, t, n, { allOwnKeys: r } = {}) => (Ae(t, (o, s) => {
542
542
  return n;
543
543
  };
544
544
  function ls(e) {
545
- return !!(e && _(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
545
+ return !!(e && H(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
546
546
  }
547
547
  const cs = (e) => {
548
548
  const t = new Array(10), n = (r, o) => {
@@ -561,13 +561,13 @@ const cs = (e) => {
561
561
  return r;
562
562
  };
563
563
  return n(e, 0);
564
- }, us = K("AsyncFunction"), ds = (e) => e && (He(e) || _(e)) && _(e.then) && _(e.catch), $n = ((e, t) => e ? setImmediate : t ? ((n, r) => (ie.addEventListener("message", ({ source: o, data: s }) => {
564
+ }, us = K("AsyncFunction"), ds = (e) => e && (He(e) || H(e)) && H(e.then) && H(e.catch), $n = ((e, t) => e ? setImmediate : t ? ((n, r) => (ie.addEventListener("message", ({ source: o, data: s }) => {
565
565
  o === ie && s === n && r.length && r.shift()();
566
566
  }, !1), (o) => {
567
567
  r.push(o), ie.postMessage(n, "*");
568
568
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
569
569
  typeof setImmediate == "function",
570
- _(ie.postMessage)
570
+ H(ie.postMessage)
571
571
  ), fs = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n, f = {
572
572
  isArray: pe,
573
573
  isArrayBuffer: qn,
@@ -588,7 +588,7 @@ const cs = (e) => {
588
588
  isFile: Bo,
589
589
  isBlob: Io,
590
590
  isRegExp: ns,
591
- isFunction: _,
591
+ isFunction: H,
592
592
  isStream: No,
593
593
  isURLSearchParams: Uo,
594
594
  isTypedArray: Zo,
@@ -1630,11 +1630,11 @@ const Gs = async (e) => {
1630
1630
  duplex: "half"
1631
1631
  }), R;
1632
1632
  if (f.isFormData(r) && (R = O.headers.get("content-type")) && u.setContentType(R), O.body) {
1633
- const [D, V] = nn(
1633
+ const [D, _] = nn(
1634
1634
  g,
1635
1635
  Le(rn(d))
1636
1636
  );
1637
- r = sn(O.body, an, D, V);
1637
+ r = sn(O.body, an, D, _);
1638
1638
  }
1639
1639
  }
1640
1640
  f.isString(h) || (h = h ? "include" : "omit");
@@ -1655,13 +1655,13 @@ const Gs = async (e) => {
1655
1655
  ["status", "statusText", "headers"].forEach((Ee) => {
1656
1656
  O[Ee] = x[Ee];
1657
1657
  });
1658
- const R = f.toFiniteNumber(x.headers.get("content-length")), [D, V] = l && nn(
1658
+ const R = f.toFiniteNumber(x.headers.get("content-length")), [D, _] = l && nn(
1659
1659
  R,
1660
1660
  Le(rn(l), !0)
1661
1661
  ) || [];
1662
1662
  x = new Response(
1663
1663
  sn(x.body, an, D, () => {
1664
- V && V(), p && p();
1664
+ _ && _(), p && p();
1665
1665
  }),
1666
1666
  O
1667
1667
  );
@@ -2134,7 +2134,7 @@ function sa() {
2134
2134
  }, [e]);
2135
2135
  }
2136
2136
  const aa = ({ create: e = !1 }) => {
2137
- const [t, n] = m.useState(), { id: r } = xr(), { t: o } = L(), s = Ut(), a = At(), l = te(), d = z("breakpoint", "md");
2137
+ const [t, n] = m.useState(), { id: r } = xr(), { t: o } = L(), s = Ut(), a = At(), l = te(), d = V("breakpoint", "md");
2138
2138
  Bt(
2139
2139
  t != null && t.exists ? o("Edit :model “:label“", { model: l.singular(), label: (t == null ? void 0 : t.getLabel()) || "..." }) : o("Create :model", { model: l.singular() })
2140
2140
  ), Do();
@@ -2145,7 +2145,7 @@ const aa = ({ create: e = !1 }) => {
2145
2145
  const u = m.useCallback(() => {
2146
2146
  s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${k.kebab(l.plural())}/${t.getKey()}`);
2147
2147
  }, [s, a, l, t, o]), h = sa(), y = m.useMemo(() => T("cms").getModelFormProps(t), [t]);
2148
- return t ? /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, children: [
2148
+ return t ? /* @__PURE__ */ i(z, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, children: [
2149
2149
  /* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(
2150
2150
  c,
2151
2151
  {
@@ -2350,7 +2350,7 @@ const fa = Z(
2350
2350
  ["Layout.SearchBar"]: s,
2351
2351
  ["Layout.BackButton"]: a,
2352
2352
  ["Layout.AppLogo"]: l
2353
- } = T("cms").getComponents(), { open: d } = _t(), c = dr(), u = fr(), h = z("appBar.height"), y = z("drawer.width", 280), {
2353
+ } = T("cms").getComponents(), { open: d } = _t(), c = dr(), u = fr(), h = V("appBar.height"), y = V("drawer.width", 280), {
2354
2354
  start: S = null,
2355
2355
  //: title = config('app.name', document.title),
2356
2356
  end: b = null
@@ -2376,9 +2376,9 @@ const fa = Z(
2376
2376
  children: !n && p || oe("app.name", document.title)
2377
2377
  }
2378
2378
  ),
2379
- /* @__PURE__ */ i(H, { sx: { flexGrow: 1 } }),
2379
+ /* @__PURE__ */ i(z, { sx: { flexGrow: 1 } }),
2380
2380
  /* @__PURE__ */ w(
2381
- H,
2381
+ z,
2382
2382
  {
2383
2383
  display: "flex",
2384
2384
  alignItems: "center",
@@ -2447,7 +2447,7 @@ const dn = (e, t) => ({
2447
2447
  // necessary for content to be below app bar
2448
2448
  ...e.mixins.toolbar
2449
2449
  })), wa = (e) => {
2450
- const t = Ft(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = z("drawer.width", 280), l = z("appBar.height"), d = T("cms").getComponent("RecursiveList"), c = T("cms").getMenuItems();
2450
+ const t = Ft(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = V("drawer.width", 280), l = V("appBar.height"), d = T("cms").getComponent("RecursiveList"), c = T("cms").getMenuItems();
2451
2451
  return /* @__PURE__ */ w(
2452
2452
  s,
2453
2453
  {
@@ -2466,7 +2466,7 @@ const dn = (e, t) => ({
2466
2466
  children: [
2467
2467
  /* @__PURE__ */ i(ya, { style: { height: l }, children: /* @__PURE__ */ i(q, { onClick: o, children: t.direction === "ltr" ? /* @__PURE__ */ i(je, {}) : /* @__PURE__ */ i(Ue, {}) }) }),
2468
2468
  /* @__PURE__ */ i(ve, {}),
2469
- /* @__PURE__ */ i(H, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children: /* @__PURE__ */ i(
2469
+ /* @__PURE__ */ i(z, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children: /* @__PURE__ */ i(
2470
2470
  d,
2471
2471
  {
2472
2472
  collapsed: !r && n,
@@ -2478,7 +2478,7 @@ const dn = (e, t) => ({
2478
2478
  }
2479
2479
  );
2480
2480
  }, Sa = () => {
2481
- const e = ur(), t = z("breakpoint", "md"), n = fr(), {
2481
+ const e = ur(), t = V("breakpoint", "md"), n = fr(), {
2482
2482
  ["Layout.BackButton"]: r
2483
2483
  } = T("cms").getComponents();
2484
2484
  return /* @__PURE__ */ w(
@@ -2552,13 +2552,15 @@ const dn = (e, t) => ({
2552
2552
  };
2553
2553
  function Ea(e, t) {
2554
2554
  const n = T("filter"), { Model: r, setColumnsFilter: o } = m.useContext(Ht), [s, a] = m.useState(t.key), [l, d] = m.useState(t.operator), [c, u] = m.useState(t.type), [h, y] = m.useState(t.value), [S, b] = m.useState(t.nullable), [p, g] = m.useState(t.is_relation), A = m.useMemo(() => n.getFilterableColumns(r), [r]), x = (O) => () => {
2555
- o((R) => R.filter((D, V) => V !== O));
2555
+ o((R) => R.filter((D, _) => _ !== O));
2556
2556
  }, E = async (O) => {
2557
- const R = O.target.value, D = A.find((mr) => mr.key === R), V = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Wt = (D == null ? void 0 : D.is_relation) ?? !1;
2558
- Wt ? (d("relation"), y([])) : p && d("equals"), g(Wt), b(Ee), V !== c && (d("equals"), y(() => {
2557
+ const R = O.target.value, D = A.find((mr) => mr.key === R), _ = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Wt = (D == null ? void 0 : D.is_relation) ?? !1;
2558
+ Wt ? (d("relation"), y([])) : p && d("equals"), g(Wt), b(Ee), _ !== c && (d(
2559
+ _ === "text" ? "contains" : "equals"
2560
+ ), y(() => {
2559
2561
  if (["between", "notBetween"].includes(l))
2560
2562
  return [];
2561
- switch (n.getInputType(V)) {
2563
+ switch (n.getInputType(_)) {
2562
2564
  case "number":
2563
2565
  return 0;
2564
2566
  case "boolean":
@@ -2566,7 +2568,7 @@ function Ea(e, t) {
2566
2568
  default:
2567
2569
  return "";
2568
2570
  }
2569
- })), a(R), u(V);
2571
+ })), a(R), u(_);
2570
2572
  }, P = async (O) => {
2571
2573
  const R = O.target.value;
2572
2574
  l !== R && y((D) => {
@@ -2583,7 +2585,7 @@ function Ea(e, t) {
2583
2585
  }), d(R);
2584
2586
  };
2585
2587
  return m.useEffect(() => {
2586
- o((O) => O.map((D, V) => e === V ? {
2588
+ o((O) => O.map((D, _) => e === _ ? {
2587
2589
  ...D,
2588
2590
  key: s,
2589
2591
  operator: l,
@@ -2729,7 +2731,7 @@ const hn = async (e, t, n) => {
2729
2731
  size: "small"
2730
2732
  }
2731
2733
  ),
2732
- e && /* @__PURE__ */ i(H, { width: 325 })
2734
+ e && /* @__PURE__ */ i(z, { width: 325 })
2733
2735
  ] });
2734
2736
  }, nt = ({ index: e = null }) => {
2735
2737
  const { t } = L(), n = v(), r = T("filter"), {
@@ -2762,7 +2764,7 @@ const hn = async (e, t, n) => {
2762
2764
  [r]
2763
2765
  );
2764
2766
  if (["null", "notNull"].includes(r))
2765
- return e ? /* @__PURE__ */ i(H, { width: 230 }) : null;
2767
+ return e ? /* @__PURE__ */ i(z, { width: 230 }) : null;
2766
2768
  if (o)
2767
2769
  switch (t.getInputType(n)) {
2768
2770
  case "date":
@@ -2789,7 +2791,7 @@ const hn = async (e, t, n) => {
2789
2791
  return /* @__PURE__ */ i(nt, {});
2790
2792
  }
2791
2793
  }, Ra = ({ index: e, column: t }) => {
2792
- const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s = T("filter"), a = m.useMemo(() => s.getMatchingOperators(t), [t]), {
2794
+ const { t: n } = L(), r = v(), o = V("breakpoint", "md"), s = T("filter"), a = m.useMemo(() => s.getMatchingOperators(t), [t]), {
2793
2795
  columns: l,
2794
2796
  key: d,
2795
2797
  setKey: c,
@@ -2960,7 +2962,7 @@ const hn = async (e, t, n) => {
2960
2962
  }
2961
2963
  );
2962
2964
  }, pn = ({ dialog: e = !1 }) => {
2963
- const { t } = L(), n = v(), r = z("breakpoint", "md"), o = T("filter"), {
2965
+ const { t } = L(), n = v(), r = V("breakpoint", "md"), o = T("filter"), {
2964
2966
  columnsFilter: s,
2965
2967
  setColumnsFilter: a,
2966
2968
  handleApplyFilters: l,
@@ -2970,7 +2972,7 @@ const hn = async (e, t, n) => {
2970
2972
  ...u,
2971
2973
  {
2972
2974
  key: "",
2973
- operator: "equals",
2975
+ operator: "contains",
2974
2976
  type: "text",
2975
2977
  value: "",
2976
2978
  appended: !1,
@@ -2980,7 +2982,7 @@ const hn = async (e, t, n) => {
2980
2982
  ]);
2981
2983
  };
2982
2984
  return /* @__PURE__ */ w(
2983
- H,
2985
+ z,
2984
2986
  {
2985
2987
  sx: {
2986
2988
  minWidth: { [r]: 567.5 },
@@ -3812,7 +3814,7 @@ const qa = Z(fe)(({ theme: e }) => ({
3812
3814
  onClick: p(g),
3813
3815
  children: [
3814
3816
  A,
3815
- x && S === g ? /* @__PURE__ */ i(H, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
3817
+ x && S === g ? /* @__PURE__ */ i(z, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
3816
3818
  ]
3817
3819
  }
3818
3820
  )
@@ -3966,7 +3968,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
3966
3968
  }, ei = ({ children: e, ...t }) => {
3967
3969
  const {
3968
3970
  columnCount: n
3969
- } = ae(), r = v(), o = z("breakpoint", "md"), {
3971
+ } = ae(), r = v(), o = V("breakpoint", "md"), {
3970
3972
  ["ModelIndex.Pagination"]: s,
3971
3973
  ["ModelIndex.PaginationDetails"]: a,
3972
3974
  ["ModelIndex.PerPageSwitch"]: l
@@ -4015,7 +4017,7 @@ const I = St(Ga, xt), de = Z($)(() => ({
4015
4017
  ["ModelIndex.Sort"]: r,
4016
4018
  ["ModelIndex.Pagination"]: o
4017
4019
  // ['ModelIndex.PaginationDetails']: PaginationDetails,
4018
- } = T("cms").getComponents(), s = v(), a = z("breakpoint", "md");
4020
+ } = T("cms").getComponents(), s = v(), a = V("breakpoint", "md");
4019
4021
  return /* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(ee, { colSpan: e, sx: { p: 1 }, children: /* @__PURE__ */ w(
4020
4022
  N,
4021
4023
  {
@@ -4067,7 +4069,7 @@ function ni() {
4067
4069
  `model${k.studly(e.getSchemaName())}Tabs`,
4068
4070
  a
4069
4071
  );
4070
- return l.length === 0 ? null : /* @__PURE__ */ i(H, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
4072
+ return l.length === 0 ? null : /* @__PURE__ */ i(z, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
4071
4073
  Zr,
4072
4074
  {
4073
4075
  value: o,
@@ -4145,7 +4147,7 @@ const hr = ({
4145
4147
  onClick: n,
4146
4148
  ...r
4147
4149
  }) => {
4148
- const [o, s] = m.useState(null), [a, l] = m.useState(null), [d, c] = m.useState({}), u = z("drawer.width", 280), h = T("cms").getComponent("RecursiveMenu");
4150
+ const [o, s] = m.useState(null), [a, l] = m.useState(null), [d, c] = m.useState({}), u = V("drawer.width", 280), h = T("cms").getComponent("RecursiveMenu");
4149
4151
  return /* @__PURE__ */ w(Qr, { ...r, children: [
4150
4152
  t.map((y) => {
4151
4153
  const {
@@ -4261,7 +4263,7 @@ const hr = ({
4261
4263
  onClick: n,
4262
4264
  ...r
4263
4265
  }) => {
4264
- const [o, s] = m.useState({}), a = z("drawer.width", 280);
4266
+ const [o, s] = m.useState({}), a = V("drawer.width", 280);
4265
4267
  return /* @__PURE__ */ w(B, { children: [
4266
4268
  /* @__PURE__ */ i(En, { ...r, children: t.map((l) => {
4267
4269
  const {
@@ -4559,7 +4561,7 @@ class li {
4559
4561
  }
4560
4562
  getFilterableColumns(t) {
4561
4563
  const { attributes: n = [], relations: r = {} } = t.getSchema(), o = [
4562
- ...n.filter((s) => !s.hidden && !s.appended).map((s) => {
4564
+ ...n.filter((s) => !s.hidden && !s.appended && !s.virtual).map((s) => {
4563
4565
  let a = s.phpType ?? "string";
4564
4566
  return s.cast !== null && !J.isEmpty(s.cast) && (a = s.cast), {
4565
4567
  key: s.name,
@@ -5064,7 +5066,7 @@ export {
5064
5066
  sa as useHandleError,
5065
5067
  dr as useHasSearch,
5066
5068
  v as useIsDesktopMode,
5067
- z as useLayoutConfig,
5069
+ V as useLayoutConfig,
5068
5070
  _t as useMenu,
5069
5071
  Ut as useNotify,
5070
5072
  ur as usePageTitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/mui-cms",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "type": "module",
5
5
  "main": "bundle/mui-cms.js",
6
6
  "module": "dist/mui-cms.js",
package/types/dist.d.ts CHANGED
@@ -28,3 +28,4 @@ import { default as Icon } from './facades/Icon';
28
28
  import { default as Filter } from './facades/Filter';
29
29
  export { CmsServiceProvider, i18NextServiceProvider, LuminixCms, Link, Cms, Filter, Icon, useActionEvent, useBackButton, useCurrentModel, useDialog, useDisplaceNotifications, useHandleError, useHasSearch, useIsDesktopMode, useLayoutConfig, useMenu, useNotify, usePageTitle, useSearch, useSelection, useSetPageTitle, useTable, DialogProvider, LayoutProvider, ModelProvider, NotificationProvider, TableProvider, };
30
30
  export type { RouteObject, } from './types/Reducers';
31
+ export type { InstanceAction, StaticAction, MassAction, ActionCallbackEvent, InstanceActionCallbackEvent, MassActionCallbackEvent, Column, } from './types/Table';