@luminix/mui-cms 0.1.17 → 0.1.18

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
@@ -1,13 +1,13 @@
1
1
  var gr = Object.defineProperty;
2
2
  var br = (e, t, n) => t in e ? gr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var $e = (e, t, n) => br(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { config as oe, collect as W, app as T, model as ye, App as St, Model as Oe, Route as yr, Config as re } from "@luminix/core";
5
- import { jsx as i, jsxs as w, Fragment as L } from "react/jsx-runtime";
4
+ import { config as oe, collect as V, app as T, model as ye, App as St, Model as Oe, Route as yr, Config as re } from "@luminix/core";
5
+ import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
6
6
  import { Outlet as wr, useParams as Sr, useNavigate as At, useSearchParams as K, Link as Re, Form as Ar } from "react-router-dom";
7
7
  import { useCollection as mn, PaginationProvider as xr, usePagination as Se, ModelForm as Cr, useApplyReducers as xt, Forms as Er, LuminixProvider as kr } from "@luminix/react";
8
- import { useMediaQuery as Me, Dialog as Ct, DialogTitle as Et, DialogContent as kt, DialogContentText as Tr, DialogActions as Tt, Button as M, Snackbar as Dr, Alert as Or, IconButton as q, AlertTitle as Rr, Box as V, Unstable_Grid2 as Q, Fab as Pr, SpeedDial as vr, SpeedDialIcon as Fr, SpeedDialAction as Lr, ButtonGroup as Br, Popper as Ir, Grow as Mr, Paper as Dt, ClickAwayListener as Nr, MenuList as jr, MenuItem as se, AppBar as gn, Toolbar as Ur, Typography as $, Drawer as bn, Divider as Pe, Autocomplete as qr, TextField as Ae, CircularProgress as _r, Switch as Hr, Stack as N, FormControl as at, InputLabel as it, Select as ve, Badge as Ot, Popover as zr, Link as lt, Collapse as yn, TableCell as ee, RadioGroup as $t, FormControlLabel as Ke, Radio as Je, TableContainer as Wr, Table as Vr, TableHead as $r, TableRow as fe, Checkbox as Rt, TableSortLabel as Kr, Skeleton as Kt, TableBody as Jr, TableFooter as Yr, Tabs as Gr, Tab as Jt, Breadcrumbs as Zr, List as Xr, ListItem as Qr, ListItemButton as eo, ListItemIcon as wn, ListItemText as Sn, Menu as An, Avatar as to, CssBaseline as no } from "@mui/material";
8
+ import { useMediaQuery as Me, Dialog as Ct, DialogTitle as Et, DialogContent as kt, DialogContentText as Tr, DialogActions as Tt, Button as M, Snackbar as Dr, Alert as Or, IconButton as q, AlertTitle as Rr, Box as H, Unstable_Grid2 as Q, Fab as Pr, SpeedDial as vr, SpeedDialIcon as Fr, SpeedDialAction as Lr, ButtonGroup as Br, Popper as Ir, Grow as Mr, Paper as Dt, ClickAwayListener as Nr, MenuList as jr, MenuItem as se, AppBar as gn, Toolbar as Ur, Typography as $, Drawer as bn, Divider as Pe, Autocomplete as qr, TextField as Ae, CircularProgress as _r, Switch as Hr, Stack as N, FormControl as at, InputLabel as it, Select as ve, Badge as Ot, Popover as zr, Link as lt, Collapse as yn, TableCell as ee, RadioGroup as $t, FormControlLabel as Ke, Radio as Je, TableContainer as Wr, Table as Vr, TableHead as $r, TableRow as fe, Checkbox as Rt, TableSortLabel as Kr, Skeleton as Kt, TableBody as Jr, TableFooter as Yr, Tabs as Gr, Tab as Jt, Breadcrumbs as Zr, List as Xr, ListItem as Qr, ListItemButton as eo, ListItemIcon as wn, ListItemText as Sn, Menu as An, Avatar as to, CssBaseline as no } from "@mui/material";
9
9
  import h, { useContext as xn, useMemo as ro } from "react";
10
- import { useTranslation as B, initReactI18next as oo } from "react-i18next";
10
+ import { useTranslation as L, initReactI18next as oo } from "react-i18next";
11
11
  import { Close as Ne, ArrowDropDown as Cn, ChevronLeft as je, ChevronRight as Ue, HighlightOffOutlined as ct, AddCircleOutline as En, FilterList as kn, Menu as Tn, LastPage as Dn, FirstPage as On, Search as ut, SwapVert as Rn, ArrowUpward as Pn, ArrowDownward as vn, MoreVert as Pt, ExpandLess as Fn, ExpandMore as Ln, Add as so, CategoryOutlined as ao, DashboardOutlined as io, PeopleOutlined as lo } from "@mui/icons-material";
12
12
  import { useTheme as vt, styled as Z, createTheme as co, ThemeProvider as uo } from "@mui/material/styles";
13
13
  import { Str as k, Obj as G, DateTime as Fe, Query as Bn, Func as fo, MakeFacade as Ft, Reducible as In, ServiceProvider as Mn } from "@luminix/support";
@@ -65,7 +65,7 @@ function go({ children: e, ...t }) {
65
65
  current: typeof c == "string" ? { message: c } : c,
66
66
  resolve: p
67
67
  });
68
- }), []), { t: l } = B(), d = () => {
68
+ }), []), { t: l } = L(), d = () => {
69
69
  r && r(!1), o({});
70
70
  }, u = () => {
71
71
  r && r(!0), o({});
@@ -89,7 +89,7 @@ function go({ children: e, ...t }) {
89
89
  (s == null ? void 0 : s.title) && /* @__PURE__ */ i(Et, { id: "alert-dialog-title", children: s.title }),
90
90
  /* @__PURE__ */ i(kt, { children: /* @__PURE__ */ i(Tr, { id: "alert-dialog-description", children: s == null ? void 0 : s.message }) }),
91
91
  /* @__PURE__ */ w(Tt, { children: [
92
- (s == null ? void 0 : s.type) === "confirm" && /* @__PURE__ */ w(L, { children: [
92
+ (s == null ? void 0 : s.type) === "confirm" && /* @__PURE__ */ w(B, { children: [
93
93
  /* @__PURE__ */ i(M, { onClick: d, children: (s == null ? void 0 : s.cancelText) ?? l("No") }),
94
94
  /* @__PURE__ */ i(M, { onClick: u, autoFocus: !0, children: (s == null ? void 0 : s.confirmText) ?? l("Yes") })
95
95
  ] }),
@@ -115,7 +115,7 @@ const Lt = h.createContext({
115
115
  displacement: "8px",
116
116
  setDisplacement: () => {
117
117
  }
118
- }), dt = W([]), bo = (e) => {
118
+ }), dt = V([]), bo = (e) => {
119
119
  dt.push(
120
120
  typeof e == "string" ? { message: e } : e
121
121
  );
@@ -243,18 +243,18 @@ function Bt(e) {
243
243
  }), [e, t]);
244
244
  }
245
245
  const Ao = () => {
246
- const { t: e } = B();
247
- return Bt(e("Dashboard")), /* @__PURE__ */ i(L, { children: "Dashboard" });
246
+ const { t: e } = L();
247
+ return Bt(e("Dashboard")), /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: "Dashboard" });
248
248
  }, xo = ({ error: e }) => /* @__PURE__ */ w("div", { children: [
249
249
  /* @__PURE__ */ i("h1", { children: "Ops..." }),
250
250
  /* @__PURE__ */ i("p", { children: "Something went wrong" }),
251
- T().hasDebugModeEnabled() && e && /* @__PURE__ */ i(L, { children: /* @__PURE__ */ w("pre", { style: { whiteSpace: "pre-wrap" }, children: [
251
+ T().hasDebugModeEnabled() && e && /* @__PURE__ */ i(B, { children: /* @__PURE__ */ w("pre", { style: { whiteSpace: "pre-wrap" }, children: [
252
252
  e.message,
253
253
  /* @__PURE__ */ i("br", {}),
254
254
  e.stack
255
255
  ] }) })
256
256
  ] });
257
- function H(e, t) {
257
+ function z(e, t) {
258
258
  const { layout: n } = xn(X);
259
259
  return ro(() => G.get(n, e, t), [n, e, t]);
260
260
  }
@@ -267,12 +267,12 @@ const Co = Z("div")(({ theme: e }) => ({
267
267
  DesktopPageTitle: r,
268
268
  ["Layout.AppBar"]: o,
269
269
  ["Layout.Drawer"]: s
270
- } = T("cms").getComponents(), a = H("appBar.height"), {
270
+ } = T("cms").getComponents(), a = z("appBar.height"), {
271
271
  AppBar: l,
272
272
  Drawer: d,
273
273
  main: u
274
274
  } = t || {};
275
- return /* @__PURE__ */ w(V, { sx: { display: "flex" }, ...n, children: [
275
+ return /* @__PURE__ */ w(H, { sx: { display: "flex" }, ...n, children: [
276
276
  /* @__PURE__ */ i(
277
277
  o,
278
278
  {
@@ -282,7 +282,7 @@ const Co = Z("div")(({ theme: e }) => ({
282
282
  ),
283
283
  /* @__PURE__ */ i(s, { ...d }),
284
284
  /* @__PURE__ */ w(
285
- V,
285
+ H,
286
286
  {
287
287
  component: "main",
288
288
  sx: {
@@ -293,7 +293,7 @@ const Co = Z("div")(({ theme: e }) => ({
293
293
  children: [
294
294
  /* @__PURE__ */ i(Co, { style: { height: a } }),
295
295
  /* @__PURE__ */ i(r, {}),
296
- /* @__PURE__ */ i(V, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: e })
296
+ e
297
297
  ]
298
298
  }
299
299
  )
@@ -328,7 +328,7 @@ const To = () => {
328
328
  ["ModelIndex.Table.TableBody.TableRow"]: S,
329
329
  ["ModelIndex.Tabs"]: b
330
330
  } = T("cms").getComponents();
331
- return /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
331
+ return /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
332
332
  /* @__PURE__ */ w(
333
333
  Q,
334
334
  {
@@ -364,7 +364,7 @@ const To = () => {
364
364
  ]
365
365
  }
366
366
  ) })
367
- ] });
367
+ ] }) });
368
368
  };
369
369
  function Do() {
370
370
  const { setShowBackButton: e } = h.useContext(X);
@@ -1608,11 +1608,11 @@ const Gs = async (e) => {
1608
1608
  duplex: "half"
1609
1609
  }), R;
1610
1610
  if (f.isFormData(r) && (R = O.headers.get("content-type")) && c.setContentType(R), O.body) {
1611
- const [D, z] = nn(
1611
+ const [D, W] = nn(
1612
1612
  g,
1613
1613
  Le(rn(d))
1614
1614
  );
1615
- r = sn(O.body, an, D, z);
1615
+ r = sn(O.body, an, D, W);
1616
1616
  }
1617
1617
  }
1618
1618
  f.isString(p) || (p = p ? "include" : "omit");
@@ -1633,13 +1633,13 @@ const Gs = async (e) => {
1633
1633
  ["status", "statusText", "headers"].forEach((Ee) => {
1634
1634
  O[Ee] = A[Ee];
1635
1635
  });
1636
- const R = f.toFiniteNumber(A.headers.get("content-length")), [D, z] = l && nn(
1636
+ const R = f.toFiniteNumber(A.headers.get("content-length")), [D, W] = l && nn(
1637
1637
  R,
1638
1638
  Le(rn(l), !0)
1639
1639
  ) || [];
1640
1640
  A = new Response(
1641
1641
  sn(A.body, an, D, () => {
1642
- z && z(), m && m();
1642
+ W && W(), m && m();
1643
1643
  }),
1644
1644
  O
1645
1645
  );
@@ -2112,7 +2112,7 @@ function sa() {
2112
2112
  }, [e]);
2113
2113
  }
2114
2114
  const aa = ({ create: e = !1 }) => {
2115
- const [t, n] = h.useState(), { id: r } = Sr(), { t: o } = B(), s = Ut(), a = At(), l = te(), d = H("breakpoint", "md");
2115
+ const [t, n] = h.useState(), { id: r } = Sr(), { t: o } = L(), s = Ut(), a = At(), l = te(), d = z("breakpoint", "md");
2116
2116
  Bt(
2117
2117
  t != null && t.exists ? o("Edit :model “:label“", { model: l.singular(), label: (t == null ? void 0 : t.getLabel()) || "..." }) : o("Create :model", { model: l.singular() })
2118
2118
  ), Do();
@@ -2123,7 +2123,7 @@ const aa = ({ create: e = !1 }) => {
2123
2123
  const c = h.useCallback(() => {
2124
2124
  s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${k.kebab(l.plural())}/${t.getKey()}`);
2125
2125
  }, [s, a, l, t, o]), p = sa(), y = h.useMemo(() => T("cms").getModelFormProps(t), [t]);
2126
- return t ? /* @__PURE__ */ w(Q, { container: !0, children: [
2126
+ return t ? /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, children: [
2127
2127
  /* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(
2128
2128
  u,
2129
2129
  {
@@ -2150,7 +2150,7 @@ const aa = ({ create: e = !1 }) => {
2150
2150
  )
2151
2151
  }
2152
2152
  )
2153
- ] }) : null;
2153
+ ] }) }) : null;
2154
2154
  };
2155
2155
  function ia(e) {
2156
2156
  const {
@@ -2164,7 +2164,7 @@ function la() {
2164
2164
  return h.useContext(jn).dialog;
2165
2165
  }
2166
2166
  function qt() {
2167
- const e = At(), t = Ut(), n = la(), { t: r } = B(), { refresh: o } = Se();
2167
+ const e = At(), t = Ut(), n = la(), { t: r } = L(), { refresh: o } = Se();
2168
2168
  return { navigate: e, notify: t, dialog: n, t: r, refresh: o };
2169
2169
  }
2170
2170
  const ca = Z(Pr)(({ theme: e }) => ({
@@ -2220,7 +2220,7 @@ const ca = Z(Pr)(({ theme: e }) => ({
2220
2220
  }
2221
2221
  ),
2222
2222
  document.body
2223
- ) : /* @__PURE__ */ w(L, { children: [
2223
+ ) : /* @__PURE__ */ w(B, { children: [
2224
2224
  /* @__PURE__ */ w(
2225
2225
  Br,
2226
2226
  {
@@ -2328,7 +2328,7 @@ const fa = Z(
2328
2328
  ["Layout.SearchBar"]: s,
2329
2329
  ["Layout.BackButton"]: a,
2330
2330
  ["Layout.AppLogo"]: l
2331
- } = T("cms").getComponents(), { open: d } = _t(), u = dr(), c = fr(), p = H("appBar.height"), y = H("drawer.width", 280), {
2331
+ } = T("cms").getComponents(), { open: d } = _t(), u = dr(), c = fr(), p = z("appBar.height"), y = z("drawer.width", 280), {
2332
2332
  start: S = null,
2333
2333
  //: title = config('app.name', document.title),
2334
2334
  end: b = null
@@ -2354,9 +2354,9 @@ const fa = Z(
2354
2354
  children: !n && m || oe("app.name", document.title)
2355
2355
  }
2356
2356
  ),
2357
- /* @__PURE__ */ i(V, { sx: { flexGrow: 1 } }),
2357
+ /* @__PURE__ */ i(H, { sx: { flexGrow: 1 } }),
2358
2358
  /* @__PURE__ */ w(
2359
- V,
2359
+ H,
2360
2360
  {
2361
2361
  display: "flex",
2362
2362
  alignItems: "center",
@@ -2425,7 +2425,7 @@ const dn = (e, t) => ({
2425
2425
  // necessary for content to be below app bar
2426
2426
  ...e.mixins.toolbar
2427
2427
  })), wa = (e) => {
2428
- const t = vt(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = H("drawer.width", 280), l = H("appBar.height"), d = T("cms").getComponent("RecursiveList"), u = T("cms").getMenuItems();
2428
+ const t = vt(), 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"), u = T("cms").getMenuItems();
2429
2429
  return /* @__PURE__ */ w(
2430
2430
  s,
2431
2431
  {
@@ -2444,7 +2444,7 @@ const dn = (e, t) => ({
2444
2444
  children: [
2445
2445
  /* @__PURE__ */ i(ya, { style: { height: l }, children: /* @__PURE__ */ i(q, { onClick: o, children: t.direction === "ltr" ? /* @__PURE__ */ i(je, {}) : /* @__PURE__ */ i(Ue, {}) }) }),
2446
2446
  /* @__PURE__ */ i(Pe, {}),
2447
- /* @__PURE__ */ i(V, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children: /* @__PURE__ */ i(
2447
+ /* @__PURE__ */ i(H, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children: /* @__PURE__ */ i(
2448
2448
  d,
2449
2449
  {
2450
2450
  collapsed: !r && n,
@@ -2456,7 +2456,7 @@ const dn = (e, t) => ({
2456
2456
  }
2457
2457
  );
2458
2458
  }, Sa = () => {
2459
- const e = ur(), t = H("breakpoint", "md"), n = fr(), {
2459
+ const e = ur(), t = z("breakpoint", "md"), n = fr(), {
2460
2460
  ["Layout.BackButton"]: r
2461
2461
  } = T("cms").getComponents();
2462
2462
  return /* @__PURE__ */ w(
@@ -2530,13 +2530,13 @@ const dn = (e, t) => ({
2530
2530
  };
2531
2531
  function Ea(e, t) {
2532
2532
  const n = T("filter"), { Model: r, setColumnsFilter: o } = h.useContext(Ht), [s, a] = h.useState(t.key), [l, d] = h.useState(t.operator), [u, c] = h.useState(t.type), [p, y] = h.useState(t.value), [S, b] = h.useState(t.nullable), [m, g] = h.useState(t.is_relation), x = h.useMemo(() => n.getFilterableColumns(r), [r]), A = (O) => () => {
2533
- o((R) => R.filter((D, z) => z !== O));
2533
+ o((R) => R.filter((D, W) => W !== O));
2534
2534
  }, E = async (O) => {
2535
- const R = O.target.value, D = x.find((mr) => mr.key === R), z = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Vt = (D == null ? void 0 : D.is_relation) ?? !1;
2536
- Vt ? (d("relation"), y([])) : m && d("equals"), g(Vt), b(Ee), z !== u && (d("equals"), y(() => {
2535
+ const R = O.target.value, D = x.find((mr) => mr.key === R), W = (D == null ? void 0 : D.type) ?? "text", Ee = (D == null ? void 0 : D.nullable) ?? !1, Vt = (D == null ? void 0 : D.is_relation) ?? !1;
2536
+ Vt ? (d("relation"), y([])) : m && d("equals"), g(Vt), b(Ee), W !== u && (d("equals"), y(() => {
2537
2537
  if (["between", "notBetween"].includes(l))
2538
2538
  return [];
2539
- switch (n.getInputType(z)) {
2539
+ switch (n.getInputType(W)) {
2540
2540
  case "number":
2541
2541
  return 0;
2542
2542
  case "boolean":
@@ -2544,7 +2544,7 @@ function Ea(e, t) {
2544
2544
  default:
2545
2545
  return "";
2546
2546
  }
2547
- })), a(R), c(z);
2547
+ })), a(R), c(W);
2548
2548
  }, P = async (O) => {
2549
2549
  const R = O.target.value;
2550
2550
  l !== R && y((D) => {
@@ -2561,7 +2561,7 @@ function Ea(e, t) {
2561
2561
  }), d(R);
2562
2562
  };
2563
2563
  return h.useEffect(() => {
2564
- o((O) => O.map((D, z) => e === z ? {
2564
+ o((O) => O.map((D, W) => e === W ? {
2565
2565
  ...D,
2566
2566
  key: s,
2567
2567
  operator: l,
@@ -2591,20 +2591,20 @@ function Ea(e, t) {
2591
2591
  }
2592
2592
  const pn = async (e, t, n) => {
2593
2593
  const r = e.getSchema().relations[t].model, { data: o } = await ye().make(r).get(), s = o.all().filter((u) => !n.find((c) => c.getKey() === u.getKey())), a = s.length, l = n.length, d = 15;
2594
- return a + l > d ? W([...n, ...s.slice(0, d - l)]) : W([...n, ...s]);
2594
+ return a + l > d ? V([...n, ...s.slice(0, d - l)]) : V([...n, ...s]);
2595
2595
  }, ka = async (e, t, n = "", r) => {
2596
2596
  const o = e.getSchema().relations[t], s = ye().make(o.model), a = s.getSchema().primaryKey, { data: l } = await s.searchBy(n).get();
2597
- return W([...r, ...l]).unique(a);
2597
+ return V([...r, ...l]).unique(a);
2598
2598
  }, Ta = () => {
2599
2599
  const e = v(), t = te(), {
2600
2600
  key: n,
2601
2601
  value: r,
2602
2602
  setValue: o
2603
- } = h.useContext(me), [s, a] = h.useState(!1), [l, d] = h.useState(""), [u, c] = h.useState(W([])), [p, y] = h.useState([]), S = h.useMemo(
2603
+ } = h.useContext(me), [s, a] = h.useState(!1), [l, d] = h.useState(""), [u, c] = h.useState(V([])), [p, y] = h.useState([]), S = h.useMemo(
2604
2604
  () => s && u.count() === 0,
2605
2605
  [s, u]
2606
2606
  ), b = async (m, g) => {
2607
- d(g), G.isEmpty(g) || c(await ka(t, n, g, W(p)));
2607
+ d(g), G.isEmpty(g) || c(await ka(t, n, g, V(p)));
2608
2608
  };
2609
2609
  return h.useEffect(() => {
2610
2610
  r.length > 0 && (async () => y(await Ca(t, n, r)))();
@@ -2615,7 +2615,7 @@ const pn = async (e, t, n) => {
2615
2615
  m = !1;
2616
2616
  };
2617
2617
  }, [S]), h.useEffect(() => {
2618
- o(p.map((m) => m.getKey())), G.isEmpty(l) ? (async () => c(await pn(t, n, p)))() : c(W([]));
2618
+ o(p.map((m) => m.getKey())), G.isEmpty(l) ? (async () => c(await pn(t, n, p)))() : c(V([]));
2619
2619
  }, [p]), /* @__PURE__ */ i(
2620
2620
  qr,
2621
2621
  {
@@ -2652,7 +2652,7 @@ const pn = async (e, t, n) => {
2652
2652
  }
2653
2653
  );
2654
2654
  }, Da = ({ params: e, loading: t }) => {
2655
- const { t: n } = B();
2655
+ const { t: n } = L();
2656
2656
  return /* @__PURE__ */ i(
2657
2657
  Ae,
2658
2658
  {
@@ -2668,7 +2668,7 @@ const pn = async (e, t, n) => {
2668
2668
  }
2669
2669
  );
2670
2670
  }, tt = ({ index: e = null }) => {
2671
- const { t } = B(), n = v(), r = T("filter"), {
2671
+ const { t } = L(), n = v(), r = T("filter"), {
2672
2672
  type: o,
2673
2673
  value: s,
2674
2674
  setValue: a
@@ -2694,7 +2694,7 @@ const pn = async (e, t, n) => {
2694
2694
  );
2695
2695
  }, Oa = () => {
2696
2696
  const e = v(), { value: t, setValue: n } = h.useContext(me);
2697
- return /* @__PURE__ */ w(L, { children: [
2697
+ return /* @__PURE__ */ w(B, { children: [
2698
2698
  /* @__PURE__ */ i(
2699
2699
  Hr,
2700
2700
  {
@@ -2707,10 +2707,10 @@ const pn = async (e, t, n) => {
2707
2707
  size: "small"
2708
2708
  }
2709
2709
  ),
2710
- e && /* @__PURE__ */ i(V, { width: 325 })
2710
+ e && /* @__PURE__ */ i(H, { width: 325 })
2711
2711
  ] });
2712
2712
  }, nt = ({ index: e = null }) => {
2713
- const { t } = B(), n = v(), r = T("filter"), {
2713
+ const { t } = L(), n = v(), r = T("filter"), {
2714
2714
  type: o,
2715
2715
  value: s,
2716
2716
  setValue: a
@@ -2740,17 +2740,17 @@ const pn = async (e, t, n) => {
2740
2740
  [r]
2741
2741
  );
2742
2742
  if (["null", "notNull"].includes(r))
2743
- return e ? /* @__PURE__ */ i(V, { width: 230 }) : null;
2743
+ return e ? /* @__PURE__ */ i(H, { width: 230 }) : null;
2744
2744
  if (o)
2745
2745
  switch (t.getInputType(n)) {
2746
2746
  case "date":
2747
2747
  case "datetime-local":
2748
- return /* @__PURE__ */ w(L, { children: [
2748
+ return /* @__PURE__ */ w(B, { children: [
2749
2749
  /* @__PURE__ */ i(tt, { index: 0 }),
2750
2750
  /* @__PURE__ */ i(tt, { index: 1 })
2751
2751
  ] });
2752
2752
  default:
2753
- return /* @__PURE__ */ w(L, { children: [
2753
+ return /* @__PURE__ */ w(B, { children: [
2754
2754
  /* @__PURE__ */ i(nt, { index: 0 }),
2755
2755
  /* @__PURE__ */ i(nt, { index: 1 })
2756
2756
  ] });
@@ -2767,7 +2767,7 @@ const pn = async (e, t, n) => {
2767
2767
  return /* @__PURE__ */ i(nt, {});
2768
2768
  }
2769
2769
  }, Ra = ({ index: e, column: t }) => {
2770
- const { t: n } = B(), r = v(), o = H("breakpoint", "md"), s = T("filter"), a = h.useMemo(() => s.getMatchingOperators(t), [t]), {
2770
+ const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s = T("filter"), a = h.useMemo(() => s.getMatchingOperators(t), [t]), {
2771
2771
  columns: l,
2772
2772
  key: d,
2773
2773
  setKey: u,
@@ -2938,7 +2938,7 @@ const pn = async (e, t, n) => {
2938
2938
  }
2939
2939
  );
2940
2940
  }, hn = ({ dialog: e = !1 }) => {
2941
- const { t } = B(), n = v(), r = H("breakpoint", "md"), o = T("filter"), {
2941
+ const { t } = L(), n = v(), r = z("breakpoint", "md"), o = T("filter"), {
2942
2942
  columnsFilter: s,
2943
2943
  setColumnsFilter: a,
2944
2944
  handleApplyFilters: l,
@@ -2958,7 +2958,7 @@ const pn = async (e, t, n) => {
2958
2958
  ]);
2959
2959
  };
2960
2960
  return /* @__PURE__ */ w(
2961
- V,
2961
+ H,
2962
2962
  {
2963
2963
  sx: {
2964
2964
  minWidth: { [r]: 567.5 },
@@ -2967,7 +2967,7 @@ const pn = async (e, t, n) => {
2967
2967
  children: [
2968
2968
  /* @__PURE__ */ i(N, { children: s.map((c, p, y) => {
2969
2969
  const S = p == y.length - 1;
2970
- return /* @__PURE__ */ w(L, { children: [
2970
+ return /* @__PURE__ */ w(B, { children: [
2971
2971
  /* @__PURE__ */ i(
2972
2972
  Ra,
2973
2973
  {
@@ -3096,7 +3096,7 @@ const va = (e) => {
3096
3096
  }
3097
3097
  }), n;
3098
3098
  }, Fa = () => {
3099
- const { t: e } = B(), t = T("filter"), n = v(), r = te(), [o, s] = K(), a = h.useMemo(() => "where" in Bn.toObject(o), [o]), [l, d] = h.useState(null), [u, c] = h.useState([]), p = !!l, y = h.useMemo(() => t.getFilterableColumns(r), [r]), S = (A) => {
3099
+ const { t: e } = L(), t = T("filter"), n = v(), r = te(), [o, s] = K(), a = h.useMemo(() => "where" in Bn.toObject(o), [o]), [l, d] = h.useState(null), [u, c] = h.useState([]), p = !!l, y = h.useMemo(() => t.getFilterableColumns(r), [r]), S = (A) => {
3100
3100
  d(A.currentTarget);
3101
3101
  }, b = () => {
3102
3102
  d(null), setTimeout(() => {
@@ -3214,9 +3214,9 @@ const va = (e) => {
3214
3214
  }, zt = h.createContext({
3215
3215
  columns: [],
3216
3216
  columnCount: 0,
3217
- selected: W([]),
3217
+ selected: V([]),
3218
3218
  massActions: [],
3219
- items: W([]),
3219
+ items: V([]),
3220
3220
  error: new Error("Trying to access TableContext outside of TableProvider"),
3221
3221
  Model: null
3222
3222
  });
@@ -3256,7 +3256,7 @@ function ae() {
3256
3256
  return h.useContext(zt);
3257
3257
  }
3258
3258
  function La(e) {
3259
- const [t, n] = h.useState(""), { selected: r } = Wt(), { t: o } = B(), s = qt(), { massActions: a } = ae(), l = (u) => {
3259
+ const [t, n] = h.useState(""), { selected: r } = Wt(), { t: o } = L(), s = qt(), { massActions: a } = ae(), l = (u) => {
3260
3260
  n(u.target.value);
3261
3261
  };
3262
3262
  if (h.useEffect(() => {
@@ -3347,12 +3347,12 @@ const Ba = () => {
3347
3347
  }
3348
3348
  ));
3349
3349
  Ve.displayName = "Link";
3350
- const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */ i(L, { children: {
3350
+ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */ i(B, { children: {
3351
3351
  "« Previous": /* @__PURE__ */ i(je, {}),
3352
3352
  "Next »": /* @__PURE__ */ i(Ue, {}),
3353
3353
  "Last »": /* @__PURE__ */ i(Dn, {}),
3354
3354
  "« First": /* @__PURE__ */ i(On, {})
3355
- }[e] || e }) : /* @__PURE__ */ i(L, { children: e }), Ma = ({ variant: e = "default", ...t }) => {
3355
+ }[e] || e }) : /* @__PURE__ */ i(B, { children: e }), Ma = ({ variant: e = "default", ...t }) => {
3356
3356
  const n = e === "default", [r, o] = K(), [s, a] = h.useState(r.get("page") || "1"), {
3357
3357
  links: l,
3358
3358
  meta: {
@@ -3444,7 +3444,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3444
3444
  }
3445
3445
  );
3446
3446
  }, Na = () => {
3447
- const { t: e } = B(), {
3447
+ const { t: e } = L(), {
3448
3448
  meta: {
3449
3449
  total: t = 0,
3450
3450
  from: n = 0,
@@ -3457,7 +3457,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
3457
3457
  total: t
3458
3458
  }) });
3459
3459
  }, ja = () => {
3460
- const { t: e } = B(), {
3460
+ const { t: e } = L(), {
3461
3461
  meta: {
3462
3462
  per_page: t = 15
3463
3463
  } = {}
@@ -3539,7 +3539,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3539
3539
  return e ? r.set("q", e) : r.delete("q"), r;
3540
3540
  });
3541
3541
  }, 500), Ha = () => {
3542
- const [e, t] = K(), n = e.get("q") || "", [r, o] = h.useState(n), [s, a] = h.useState(!1), l = h.useRef(null), { t: d } = B();
3542
+ const [e, t] = K(), n = e.get("q") || "", [r, o] = h.useState(n), [s, a] = h.useState(!1), l = h.useRef(null), { t: d } = L();
3543
3543
  h.useEffect(() => {
3544
3544
  o(n);
3545
3545
  }, [n]);
@@ -3550,7 +3550,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3550
3550
  l.current.focus();
3551
3551
  });
3552
3552
  const p = c ? 300 : "calc(100vw - 58px)";
3553
- return /* @__PURE__ */ w(L, { children: [
3553
+ return /* @__PURE__ */ w(B, { children: [
3554
3554
  !c && !s && /* @__PURE__ */ i(q, { color: "inherit", onClick: () => a(!0), children: /* @__PURE__ */ i(
3555
3555
  Ot,
3556
3556
  {
@@ -3603,7 +3603,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3603
3603
  children: e
3604
3604
  }
3605
3605
  ), Wa = () => {
3606
- const { t: e } = B(), [t, n] = K(), {
3606
+ const { t: e } = L(), [t, n] = K(), {
3607
3607
  columns: r,
3608
3608
  Model: o
3609
3609
  } = ae(), s = t.get("order_by") || "", [a = "", l = ""] = s.split(":"), [d, u] = h.useState(a), [c, p] = h.useState(l), [y, S] = h.useState(!1), b = () => {
@@ -3625,7 +3625,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3625
3625
  return E.delete("order_by"), E;
3626
3626
  }), S(!1), u(""), p("");
3627
3627
  };
3628
- return /* @__PURE__ */ w(L, { children: [
3628
+ return /* @__PURE__ */ w(B, { children: [
3629
3629
  /* @__PURE__ */ i(q, { onClick: b, children: /* @__PURE__ */ i(
3630
3630
  Ot,
3631
3631
  {
@@ -3658,7 +3658,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3658
3658
  children: [
3659
3659
  /* @__PURE__ */ i($, { variant: "caption", children: e("Column") }),
3660
3660
  /* @__PURE__ */ i(Pe, {}),
3661
- W(r).whereStrict("sortable", "!=", !1).map(({ key: A, label: E }) => /* @__PURE__ */ i(
3661
+ V(r).whereStrict("sortable", "!=", !1).map(({ key: A, label: E }) => /* @__PURE__ */ i(
3662
3662
  Ke,
3663
3663
  {
3664
3664
  value: A,
@@ -3683,7 +3683,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3683
3683
  {
3684
3684
  value: "asc",
3685
3685
  control: /* @__PURE__ */ i(Je, {}),
3686
- label: /* @__PURE__ */ w(L, { children: [
3686
+ label: /* @__PURE__ */ w(B, { children: [
3687
3687
  e("Ascending"),
3688
3688
  /* @__PURE__ */ i(Pn, {})
3689
3689
  ] })
@@ -3694,7 +3694,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3694
3694
  {
3695
3695
  value: "desc",
3696
3696
  control: /* @__PURE__ */ i(Je, {}),
3697
- label: /* @__PURE__ */ w(L, { children: [
3697
+ label: /* @__PURE__ */ w(B, { children: [
3698
3698
  e("Descending"),
3699
3699
  /* @__PURE__ */ i(vn, {})
3700
3700
  ] })
@@ -3711,7 +3711,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3711
3711
  ] })
3712
3712
  ] });
3713
3713
  }, Va = ({ items: e, loading: t, children: n, error: r }) => {
3714
- const o = te(), s = h.useMemo(() => W([]), [o, e]), [a] = K(), l = a.get("tab") ?? "all", d = h.useMemo(() => [
3714
+ const o = te(), s = h.useMemo(() => V([]), [o, e]), [a] = K(), l = a.get("tab") ?? "all", d = h.useMemo(() => [
3715
3715
  {
3716
3716
  key: o.getSchema().labeledBy,
3717
3717
  label: k.human(o.getSchema().labeledBy)
@@ -3790,7 +3790,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3790
3790
  onClick: m(g),
3791
3791
  children: [
3792
3792
  x,
3793
- A && S === g ? /* @__PURE__ */ i(V, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
3793
+ A && S === g ? /* @__PURE__ */ i(H, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
3794
3794
  ]
3795
3795
  }
3796
3796
  )
@@ -3807,7 +3807,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
3807
3807
  } = ae(), n = v(), {
3808
3808
  ["ModelIndex.Table.ShrinkedCell"]: r
3809
3809
  } = T("cms").getComponents(), [o] = K(), s = parseInt(o.get("per_page") || "15");
3810
- return /* @__PURE__ */ i(L, { children: Array.from({ length: s }).map((a, l) => /* @__PURE__ */ w(fe, { children: [
3810
+ return /* @__PURE__ */ i(B, { children: Array.from({ length: s }).map((a, l) => /* @__PURE__ */ w(fe, { children: [
3811
3811
  e.length > 0 && /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(Rt, {}) }),
3812
3812
  n && t.map(({ key: d, label: u, sortable: c, ...p }, y) => /* @__PURE__ */ i(ee, { ...p, children: /* @__PURE__ */ i(
3813
3813
  Kt,
@@ -3828,13 +3828,13 @@ const qa = Z(Ae)(({ theme: e }) => ({
3828
3828
  /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(q, { children: /* @__PURE__ */ i(Pt, {}) }) })
3829
3829
  ] }, l)) });
3830
3830
  }, Ya = ({ children: e, ...t }) => {
3831
- const n = te(), { t: r } = B(), {
3831
+ const n = te(), { t: r } = L(), {
3832
3832
  items: o,
3833
3833
  loading: s,
3834
3834
  columnCount: a
3835
3835
  } = ae(), {
3836
3836
  ["ModelIndex.StaticActions"]: l
3837
- } = T("cms").getComponents(), d = h.isValidElement(e) ? e : (o || W([])).map(e);
3837
+ } = T("cms").getComponents(), d = h.isValidElement(e) ? e : (o || V([])).map(e);
3838
3838
  return /* @__PURE__ */ w(Jr, { ...t, children: [
3839
3839
  s && /* @__PURE__ */ i(Ja, {}),
3840
3840
  d,
@@ -3947,7 +3947,7 @@ const I = Ft(Ga, St), de = Z($)(() => ({
3947
3947
  }, ei = ({ children: e, ...t }) => {
3948
3948
  const {
3949
3949
  columnCount: n
3950
- } = ae(), r = v(), o = H("breakpoint", "md"), {
3950
+ } = ae(), r = v(), o = z("breakpoint", "md"), {
3951
3951
  ["ModelIndex.Pagination"]: s,
3952
3952
  ["ModelIndex.PaginationDetails"]: a,
3953
3953
  ["ModelIndex.PerPageSwitch"]: l
@@ -3996,7 +3996,7 @@ const I = Ft(Ga, St), de = Z($)(() => ({
3996
3996
  ["ModelIndex.Sort"]: r,
3997
3997
  ["ModelIndex.Pagination"]: o
3998
3998
  // ['ModelIndex.PaginationDetails']: PaginationDetails,
3999
- } = T("cms").getComponents(), s = v(), a = H("breakpoint", "md");
3999
+ } = T("cms").getComponents(), s = v(), a = z("breakpoint", "md");
4000
4000
  return /* @__PURE__ */ i(fe, { children: /* @__PURE__ */ i(ee, { colSpan: e, sx: { p: 1 }, children: /* @__PURE__ */ w(
4001
4001
  N,
4002
4002
  {
@@ -4038,7 +4038,7 @@ const I = Ft(Ga, St), de = Z($)(() => ({
4038
4038
  ) }) });
4039
4039
  };
4040
4040
  function ni() {
4041
- const e = te(), { t } = B(), [n, r] = K(), o = n.get("tab") || "all", s = (d, u) => {
4041
+ const e = te(), { t } = L(), [n, r] = K(), o = n.get("tab") || "all", s = (d, u) => {
4042
4042
  r(() => {
4043
4043
  const c = new URLSearchParams();
4044
4044
  return u !== "all" && c.set("tab", u), c;
@@ -4048,7 +4048,7 @@ function ni() {
4048
4048
  `model${k.studly(e.getSchemaName())}Tabs`,
4049
4049
  a
4050
4050
  );
4051
- return l.length === 0 ? null : /* @__PURE__ */ i(V, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
4051
+ return l.length === 0 ? null : /* @__PURE__ */ i(H, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
4052
4052
  Gr,
4053
4053
  {
4054
4054
  value: o,
@@ -4126,7 +4126,7 @@ const pr = ({
4126
4126
  onClick: n,
4127
4127
  ...r
4128
4128
  }) => {
4129
- const [o, s] = h.useState(null), [a, l] = h.useState(null), [d, u] = h.useState({}), c = H("drawer.width", 280), p = T("cms").getComponent("RecursiveMenu");
4129
+ const [o, s] = h.useState(null), [a, l] = h.useState(null), [d, u] = h.useState({}), c = z("drawer.width", 280), p = T("cms").getComponent("RecursiveMenu");
4130
4130
  return /* @__PURE__ */ w(Xr, { ...r, children: [
4131
4131
  t.map((y) => {
4132
4132
  const {
@@ -4242,8 +4242,8 @@ const pr = ({
4242
4242
  onClick: n,
4243
4243
  ...r
4244
4244
  }) => {
4245
- const [o, s] = h.useState({}), a = H("drawer.width", 280);
4246
- return /* @__PURE__ */ w(L, { children: [
4245
+ const [o, s] = h.useState({}), a = z("drawer.width", 280);
4246
+ return /* @__PURE__ */ w(B, { children: [
4247
4247
  /* @__PURE__ */ i(An, { ...r, children: t.map((l) => {
4248
4248
  const {
4249
4249
  text: d,
@@ -4433,7 +4433,7 @@ const pr = ({
4433
4433
  }, u = () => {
4434
4434
  a(null);
4435
4435
  };
4436
- return /* @__PURE__ */ w(L, { children: [
4436
+ return /* @__PURE__ */ w(B, { children: [
4437
4437
  /* @__PURE__ */ i(
4438
4438
  q,
4439
4439
  {
@@ -5038,7 +5038,7 @@ export {
5038
5038
  sa as useHandleError,
5039
5039
  dr as useHasSearch,
5040
5040
  v as useIsDesktopMode,
5041
- H as useLayoutConfig,
5041
+ z as useLayoutConfig,
5042
5042
  _t as useMenu,
5043
5043
  Ut as useNotify,
5044
5044
  ur as usePageTitle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/mui-cms",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "main": "bundle/mui-cms.js",
6
6
  "module": "dist/mui-cms.js",