@luminix/mui-cms 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mui-cms.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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 { Str as
|
|
5
|
-
import { config as oe, collect as
|
|
4
|
+
import { Str as k, Obj as J, DateTime as Oe, Query as mn, Func as yr, MakeFacade as St, Reducible as gn, ServiceProvider as bn } from "@luminix/support";
|
|
5
|
+
import { config as oe, collect as W, app as T, model as we, App as xt, Model as Re, Route as wr, Config as re } from "@luminix/core";
|
|
6
6
|
import { jsx as i, jsxs as w, Fragment as B } from "react/jsx-runtime";
|
|
7
|
-
import { Outlet as Sr, useParams as
|
|
8
|
-
import { useCollection as yn, PaginationProvider as Cr, usePagination as
|
|
9
|
-
import { useMediaQuery as Me, Dialog as Et, DialogTitle as
|
|
10
|
-
import
|
|
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
|
+
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";
|
|
10
|
+
import m, { useContext as kn, useMemo as oo } from "react";
|
|
11
11
|
import { useTranslation as L, initReactI18next as so } from "react-i18next";
|
|
12
|
-
import { Close as Ne, ArrowDropDown as
|
|
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";
|
|
13
13
|
import { useTheme as Ft, styled as Z, createTheme as uo, ThemeProvider as fo } from "@mui/material/styles";
|
|
14
14
|
import Jt from "react-dom";
|
|
15
15
|
import Y from "i18next";
|
|
@@ -28,8 +28,8 @@ const ho = {
|
|
|
28
28
|
showBackButton: !1,
|
|
29
29
|
setShowBackButton: () => {
|
|
30
30
|
}
|
|
31
|
-
}, X =
|
|
32
|
-
const [t, n] =
|
|
31
|
+
}, X = m.createContext(ho), Je = document.title, po = ({ children: e }) => {
|
|
32
|
+
const [t, n] = m.useState(!1), [r, o] = m.useState(""), [s, a] = m.useState(!1), [l, d] = m.useState(!1), c = oe("luminix.cms.layout", {}), u = Me((y) => y.breakpoints.up((c == null ? void 0 : c.breakpoint) || "md")), h = {
|
|
33
33
|
open: t,
|
|
34
34
|
setOpen: n,
|
|
35
35
|
layout: c,
|
|
@@ -41,12 +41,12 @@ const ho = {
|
|
|
41
41
|
showBackButton: l,
|
|
42
42
|
setShowBackButton: d
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return m.useEffect(() => (document.title = r ? `${r} | ${oe("app.name", Je)}` : oe("app.name", Je), () => {
|
|
45
45
|
document.title = Je;
|
|
46
46
|
}), [r]), /* @__PURE__ */ i(X.Provider, { value: h, children: e });
|
|
47
|
-
}, Nn =
|
|
47
|
+
}, Nn = m.createContext({
|
|
48
48
|
Model: null
|
|
49
|
-
}), Ge = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn =
|
|
49
|
+
}), Ge = ({ Model: e, children: t }) => /* @__PURE__ */ i(Nn.Provider, { value: { Model: e }, children: t }), jn = m.createContext({
|
|
50
50
|
isOpen: !1,
|
|
51
51
|
dialog: () => Promise.reject(new Error("Trying to access DialogContext outside of DialogProvider")),
|
|
52
52
|
dismissDialog: () => {
|
|
@@ -54,27 +54,33 @@ const ho = {
|
|
|
54
54
|
current: void 0
|
|
55
55
|
});
|
|
56
56
|
function mo(e) {
|
|
57
|
-
const [t, n] =
|
|
58
|
-
return
|
|
57
|
+
const [t, n] = m.useState(e);
|
|
58
|
+
return m.useEffect(() => {
|
|
59
59
|
e && n(e);
|
|
60
60
|
}, [e]), e || t;
|
|
61
61
|
}
|
|
62
62
|
function go({ children: e, ...t }) {
|
|
63
|
-
const [{ current: n, resolve: r }, o] =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const [{ current: n, resolve: r }, o] = m.useState({}), [s, a] = m.useState(""), l = mo(n), {
|
|
64
|
+
type: d = "alert",
|
|
65
|
+
dialogProps: c = {},
|
|
66
|
+
textFieldProps: u = {}
|
|
67
|
+
} = l ?? {}, h = m.useCallback((p) => new Promise((g) => {
|
|
68
|
+
typeof p != "string" && p.type === "prompt" && a(p.defaultValue ?? ""), o({
|
|
69
|
+
current: typeof p == "string" ? { message: p } : p,
|
|
70
|
+
resolve: g
|
|
67
71
|
});
|
|
68
|
-
}), []), { t:
|
|
72
|
+
}), []), { t: y } = L(), S = () => {
|
|
69
73
|
r && r(!1), o({});
|
|
70
|
-
},
|
|
71
|
-
r && r(
|
|
74
|
+
}, b = () => {
|
|
75
|
+
r && r(
|
|
76
|
+
d === "prompt" ? s : !0
|
|
77
|
+
), o({});
|
|
72
78
|
};
|
|
73
79
|
return /* @__PURE__ */ w(jn.Provider, { value: {
|
|
74
80
|
isOpen: !!n,
|
|
75
81
|
current: n,
|
|
76
|
-
dialog:
|
|
77
|
-
dismissDialog:
|
|
82
|
+
dialog: h,
|
|
83
|
+
dismissDialog: S
|
|
78
84
|
}, children: [
|
|
79
85
|
e,
|
|
80
86
|
/* @__PURE__ */ w(
|
|
@@ -83,17 +89,33 @@ function go({ children: e, ...t }) {
|
|
|
83
89
|
open: !!n,
|
|
84
90
|
"aria-labelledby": "alert-dialog-title",
|
|
85
91
|
"aria-describedby": "alert-dialog-description",
|
|
86
|
-
...(n == null ? void 0 : n.dismissable) ?? !0 ? { onClose:
|
|
92
|
+
...(n == null ? void 0 : n.dismissable) ?? !0 ? { onClose: S } : {},
|
|
87
93
|
...t,
|
|
94
|
+
...c,
|
|
88
95
|
children: [
|
|
89
|
-
(
|
|
90
|
-
/* @__PURE__ */
|
|
96
|
+
(l == null ? void 0 : l.title) && /* @__PURE__ */ i(kt, { id: "alert-dialog-title", children: l.title }),
|
|
97
|
+
/* @__PURE__ */ w(Tt, { children: [
|
|
98
|
+
/* @__PURE__ */ i(Dr, { id: "alert-dialog-description", children: l == null ? void 0 : l.message }),
|
|
99
|
+
d === "prompt" && /* @__PURE__ */ i(
|
|
100
|
+
fe,
|
|
101
|
+
{
|
|
102
|
+
autoFocus: !0,
|
|
103
|
+
margin: "dense",
|
|
104
|
+
id: "name",
|
|
105
|
+
type: "text",
|
|
106
|
+
fullWidth: !0,
|
|
107
|
+
...u,
|
|
108
|
+
value: s,
|
|
109
|
+
onChange: (p) => a(p.target.value)
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }),
|
|
91
113
|
/* @__PURE__ */ w(Dt, { children: [
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
94
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
114
|
+
d !== "alert" && /* @__PURE__ */ w(B, { children: [
|
|
115
|
+
/* @__PURE__ */ i(M, { onClick: S, children: (l == null ? void 0 : l.cancelText) ?? y(d === "confirm" ? "No" : "Cancel") }),
|
|
116
|
+
/* @__PURE__ */ i(M, { onClick: b, autoFocus: d !== "prompt", children: (l == null ? void 0 : l.confirmText) ?? y(d === "confirm" ? "Yes" : "Ok") })
|
|
95
117
|
] }),
|
|
96
|
-
|
|
118
|
+
d === "alert" && /* @__PURE__ */ i(M, { onClick: S, autoFocus: !0, children: (l == null ? void 0 : l.confirmText) ?? y("Ok") })
|
|
97
119
|
] })
|
|
98
120
|
]
|
|
99
121
|
}
|
|
@@ -101,10 +123,10 @@ function go({ children: e, ...t }) {
|
|
|
101
123
|
] });
|
|
102
124
|
}
|
|
103
125
|
function v() {
|
|
104
|
-
const { isBreakpointUp: e } =
|
|
126
|
+
const { isBreakpointUp: e } = kn(X);
|
|
105
127
|
return e;
|
|
106
128
|
}
|
|
107
|
-
const Lt =
|
|
129
|
+
const Lt = m.createContext({
|
|
108
130
|
isOpen: !1,
|
|
109
131
|
notify: () => {
|
|
110
132
|
},
|
|
@@ -115,7 +137,7 @@ const Lt = p.createContext({
|
|
|
115
137
|
displacement: "8px",
|
|
116
138
|
setDisplacement: () => {
|
|
117
139
|
}
|
|
118
|
-
}), dt =
|
|
140
|
+
}), dt = W([]), bo = (e) => {
|
|
119
141
|
dt.push(
|
|
120
142
|
typeof e == "string" ? { message: e } : e
|
|
121
143
|
);
|
|
@@ -127,10 +149,10 @@ const Lt = p.createContext({
|
|
|
127
149
|
sx: o,
|
|
128
150
|
...s
|
|
129
151
|
}) => {
|
|
130
|
-
const a = yn(dt), l = v(), c = Ft().spacing(l ? 3 : 1), [u, h] =
|
|
131
|
-
|
|
152
|
+
const a = yn(dt), l = v(), c = Ft().spacing(l ? 3 : 1), [u, h] = m.useState(), [y, S] = m.useState(c), { vertical: b = "bottom" } = r || {}, p = (g, A) => {
|
|
153
|
+
A !== "clickaway" && h(void 0);
|
|
132
154
|
};
|
|
133
|
-
return
|
|
155
|
+
return m.useEffect(() => {
|
|
134
156
|
if (!u && a.isNotEmpty()) {
|
|
135
157
|
const g = setTimeout(() => {
|
|
136
158
|
h(dt.pull(0) ?? void 0);
|
|
@@ -140,7 +162,7 @@ const Lt = p.createContext({
|
|
|
140
162
|
}, [u, a]), /* @__PURE__ */ w(Lt.Provider, { value: {
|
|
141
163
|
isOpen: !!u,
|
|
142
164
|
notify: bo,
|
|
143
|
-
dismissNotification:
|
|
165
|
+
dismissNotification: p,
|
|
144
166
|
notifications: a.all(),
|
|
145
167
|
current: u,
|
|
146
168
|
displacement: y,
|
|
@@ -153,7 +175,7 @@ const Lt = p.createContext({
|
|
|
153
175
|
open: !!u,
|
|
154
176
|
autoHideDuration: t,
|
|
155
177
|
anchorOrigin: r,
|
|
156
|
-
onClose:
|
|
178
|
+
onClose: p,
|
|
157
179
|
sx: {
|
|
158
180
|
...o,
|
|
159
181
|
[b]: `${y} !important`
|
|
@@ -162,22 +184,22 @@ const Lt = p.createContext({
|
|
|
162
184
|
children: u && /* @__PURE__ */ w(
|
|
163
185
|
Rr,
|
|
164
186
|
{
|
|
165
|
-
onClose:
|
|
187
|
+
onClose: p,
|
|
166
188
|
severity: u.severity,
|
|
167
189
|
variant: n,
|
|
168
190
|
sx: { width: "100%" },
|
|
169
191
|
action: u.actions && [
|
|
170
|
-
...u.actions.map(({ label: g, callback:
|
|
192
|
+
...u.actions.map(({ label: g, callback: A }, x) => /* @__PURE__ */ i(
|
|
171
193
|
M,
|
|
172
194
|
{
|
|
173
195
|
color: "inherit",
|
|
174
196
|
size: "small",
|
|
175
|
-
onClick:
|
|
197
|
+
onClick: A,
|
|
176
198
|
children: g
|
|
177
199
|
},
|
|
178
|
-
|
|
200
|
+
x
|
|
179
201
|
)),
|
|
180
|
-
/* @__PURE__ */ i(q, { "aria-label": "close", color: "inherit", size: "small", onClick:
|
|
202
|
+
/* @__PURE__ */ i(q, { "aria-label": "close", color: "inherit", size: "small", onClick: p, children: /* @__PURE__ */ i(Ne, {}) }, "close")
|
|
181
203
|
],
|
|
182
204
|
children: [
|
|
183
205
|
u.title && /* @__PURE__ */ i(Pr, { children: u.title }),
|
|
@@ -218,17 +240,17 @@ const Lt = p.createContext({
|
|
|
218
240
|
},
|
|
219
241
|
...Object.entries(s).flatMap(([a, l]) => [
|
|
220
242
|
{
|
|
221
|
-
path: "/" +
|
|
243
|
+
path: "/" + k.kebab(l.plural()),
|
|
222
244
|
name: `luminix.cms.${a}.index`,
|
|
223
245
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(Cr, { factory: l.query, children: /* @__PURE__ */ i(r, {}) }) })
|
|
224
246
|
},
|
|
225
247
|
{
|
|
226
|
-
path: "/" +
|
|
248
|
+
path: "/" + k.kebab(l.plural()) + "/create",
|
|
227
249
|
name: `luminix.cms.${a}.create`,
|
|
228
250
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(o, { create: !0 }) })
|
|
229
251
|
},
|
|
230
252
|
{
|
|
231
|
-
path: "/" +
|
|
253
|
+
path: "/" + k.kebab(l.plural()) + "/:id",
|
|
232
254
|
name: `luminix.cms.${a}.show`,
|
|
233
255
|
element: /* @__PURE__ */ i(Ge, { Model: l, children: /* @__PURE__ */ i(o, {}) })
|
|
234
256
|
}
|
|
@@ -237,25 +259,25 @@ const Lt = p.createContext({
|
|
|
237
259
|
}
|
|
238
260
|
];
|
|
239
261
|
function Bt(e) {
|
|
240
|
-
const { setCurrentPage: t } =
|
|
241
|
-
|
|
262
|
+
const { setCurrentPage: t } = m.useContext(X);
|
|
263
|
+
m.useEffect(() => (t(e), () => {
|
|
242
264
|
t("");
|
|
243
265
|
}), [e, t]);
|
|
244
266
|
}
|
|
245
|
-
const
|
|
267
|
+
const xo = () => {
|
|
246
268
|
const { t: e } = L();
|
|
247
269
|
return Bt(e("Dashboard")), /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: "Dashboard" });
|
|
248
|
-
},
|
|
270
|
+
}, Ao = ({ error: e }) => /* @__PURE__ */ w("div", { children: [
|
|
249
271
|
/* @__PURE__ */ i("h1", { children: "Ops..." }),
|
|
250
272
|
/* @__PURE__ */ i("p", { children: "Something went wrong" }),
|
|
251
|
-
|
|
273
|
+
T().hasDebugModeEnabled() && e && /* @__PURE__ */ i(B, { children: /* @__PURE__ */ w("pre", { style: { whiteSpace: "pre-wrap" }, children: [
|
|
252
274
|
e.message,
|
|
253
275
|
/* @__PURE__ */ i("br", {}),
|
|
254
276
|
e.stack
|
|
255
277
|
] }) })
|
|
256
278
|
] });
|
|
257
279
|
function z(e, t) {
|
|
258
|
-
const { layout: n } =
|
|
280
|
+
const { layout: n } = kn(X);
|
|
259
281
|
return oo(() => J.get(n, e, t), [n, e, t]);
|
|
260
282
|
}
|
|
261
283
|
const Co = Z("div")(({ theme: e }) => ({
|
|
@@ -267,7 +289,7 @@ const Co = Z("div")(({ theme: e }) => ({
|
|
|
267
289
|
DesktopPageTitle: r,
|
|
268
290
|
["Layout.AppBar"]: o,
|
|
269
291
|
["Layout.Drawer"]: s
|
|
270
|
-
} =
|
|
292
|
+
} = T("cms").getComponents(), a = z("appBar.height"), {
|
|
271
293
|
AppBar: l,
|
|
272
294
|
Drawer: d,
|
|
273
295
|
main: c
|
|
@@ -299,23 +321,23 @@ const Co = Z("div")(({ theme: e }) => ({
|
|
|
299
321
|
)
|
|
300
322
|
] });
|
|
301
323
|
};
|
|
302
|
-
function
|
|
303
|
-
const { setShowSearch: e } =
|
|
304
|
-
|
|
324
|
+
function ko() {
|
|
325
|
+
const { setShowSearch: e } = m.useContext(X);
|
|
326
|
+
m.useEffect(() => (e(!0), () => {
|
|
305
327
|
e(!1);
|
|
306
328
|
}), [e]);
|
|
307
329
|
}
|
|
308
330
|
function te() {
|
|
309
|
-
const { Model: e } =
|
|
331
|
+
const { Model: e } = m.useContext(Nn);
|
|
310
332
|
return e;
|
|
311
333
|
}
|
|
312
|
-
const
|
|
334
|
+
const To = () => {
|
|
313
335
|
const e = te(), {
|
|
314
336
|
data: t,
|
|
315
337
|
error: n,
|
|
316
338
|
loading: r
|
|
317
|
-
} =
|
|
318
|
-
Bt(e.plural()),
|
|
339
|
+
} = xe();
|
|
340
|
+
Bt(e.plural()), ko();
|
|
319
341
|
const o = v(), {
|
|
320
342
|
Breadcrumbs: s,
|
|
321
343
|
["ModelIndex.Pagination"]: a,
|
|
@@ -327,7 +349,7 @@ const ko = () => {
|
|
|
327
349
|
["ModelIndex.Table.TableToolbar"]: y,
|
|
328
350
|
["ModelIndex.Table.TableBody.TableRow"]: S,
|
|
329
351
|
["ModelIndex.Tabs"]: b
|
|
330
|
-
} =
|
|
352
|
+
} = T("cms").getComponents();
|
|
331
353
|
return /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, spacing: 2, children: [
|
|
332
354
|
/* @__PURE__ */ w(
|
|
333
355
|
Q,
|
|
@@ -359,7 +381,7 @@ const ko = () => {
|
|
|
359
381
|
error: n,
|
|
360
382
|
children: [
|
|
361
383
|
/* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(y, {}) }),
|
|
362
|
-
/* @__PURE__ */ i(c, { children: (
|
|
384
|
+
/* @__PURE__ */ i(c, { children: (p) => /* @__PURE__ */ i(S, { item: p }, p.getKey()) }),
|
|
363
385
|
/* @__PURE__ */ i(h, {})
|
|
364
386
|
]
|
|
365
387
|
}
|
|
@@ -367,8 +389,8 @@ const ko = () => {
|
|
|
367
389
|
] }) });
|
|
368
390
|
};
|
|
369
391
|
function Do() {
|
|
370
|
-
const { setShowBackButton: e } =
|
|
371
|
-
|
|
392
|
+
const { setShowBackButton: e } = m.useContext(X);
|
|
393
|
+
m.useEffect(() => (e(!0), () => {
|
|
372
394
|
e(!1);
|
|
373
395
|
}), [e]);
|
|
374
396
|
}
|
|
@@ -380,16 +402,16 @@ function Un(e, t) {
|
|
|
380
402
|
const { toString: Oo } = Object.prototype, { getPrototypeOf: It } = Object, qe = /* @__PURE__ */ ((e) => (t) => {
|
|
381
403
|
const n = Oo.call(t);
|
|
382
404
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
383
|
-
})(/* @__PURE__ */ Object.create(null)), K = (e) => (e = e.toLowerCase(), (t) => qe(t) === e), _e = (e) => (t) => typeof t === e, { isArray:
|
|
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");
|
|
384
406
|
function Ro(e) {
|
|
385
|
-
return e !== null && !
|
|
407
|
+
return e !== null && !Se(e) && e.constructor !== null && !Se(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
386
408
|
}
|
|
387
409
|
const qn = K("ArrayBuffer");
|
|
388
410
|
function Po(e) {
|
|
389
411
|
let t;
|
|
390
412
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && qn(e.buffer), t;
|
|
391
413
|
}
|
|
392
|
-
const vo = _e("string"), _ = _e("function"), _n = _e("number"), He = (e) => e !== null && typeof e == "object", Fo = (e) => e === !0 || e === !1,
|
|
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) => {
|
|
393
415
|
if (qe(e) !== "object")
|
|
394
416
|
return !1;
|
|
395
417
|
const t = It(e);
|
|
@@ -398,12 +420,12 @@ const vo = _e("string"), _ = _e("function"), _n = _e("number"), He = (e) => e !=
|
|
|
398
420
|
let t;
|
|
399
421
|
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = qe(e)) === "formdata" || // detect form-data instance
|
|
400
422
|
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
|
|
401
|
-
}, Uo = K("URLSearchParams"), [qo, _o, Ho, zo] = ["ReadableStream", "Request", "Response", "Headers"].map(K),
|
|
402
|
-
function
|
|
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
|
+
function Ae(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
403
425
|
if (e === null || typeof e > "u")
|
|
404
426
|
return;
|
|
405
427
|
let r, o;
|
|
406
|
-
if (typeof e != "object" && (e = [e]),
|
|
428
|
+
if (typeof e != "object" && (e = [e]), pe(e))
|
|
407
429
|
for (r = 0, o = e.length; r < o; r++)
|
|
408
430
|
t.call(null, e[r], r, e);
|
|
409
431
|
else {
|
|
@@ -422,17 +444,17 @@ function Hn(e, t) {
|
|
|
422
444
|
return o;
|
|
423
445
|
return null;
|
|
424
446
|
}
|
|
425
|
-
const ie = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, zn = (e) => !
|
|
447
|
+
const ie = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, zn = (e) => !Se(e) && e !== ie;
|
|
426
448
|
function ft() {
|
|
427
449
|
const { caseless: e } = zn(this) && this || {}, t = {}, n = (r, o) => {
|
|
428
450
|
const s = e && Hn(t, o) || o;
|
|
429
|
-
|
|
451
|
+
Te(t[s]) && Te(r) ? t[s] = ft(t[s], r) : Te(r) ? t[s] = ft({}, r) : pe(r) ? t[s] = r.slice() : t[s] = r;
|
|
430
452
|
};
|
|
431
453
|
for (let r = 0, o = arguments.length; r < o; r++)
|
|
432
|
-
arguments[r] &&
|
|
454
|
+
arguments[r] && Ae(arguments[r], n);
|
|
433
455
|
return t;
|
|
434
456
|
}
|
|
435
|
-
const
|
|
457
|
+
const Wo = (e, t, n, { allOwnKeys: r } = {}) => (Ae(t, (o, s) => {
|
|
436
458
|
n && _(o) ? e[s] = Un(o, n) : e[s] = o;
|
|
437
459
|
}, { allOwnKeys: r }), e), $o = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ko = (e, t, n, r) => {
|
|
438
460
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
@@ -454,7 +476,7 @@ const Vo = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (o, s) => {
|
|
|
454
476
|
return r !== -1 && r === n;
|
|
455
477
|
}, Go = (e) => {
|
|
456
478
|
if (!e) return null;
|
|
457
|
-
if (
|
|
479
|
+
if (pe(e)) return e;
|
|
458
480
|
let t = e.length;
|
|
459
481
|
if (!_n(t)) return null;
|
|
460
482
|
const n = new Array(t);
|
|
@@ -479,14 +501,14 @@ const Vo = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (o, s) => {
|
|
|
479
501
|
function(n, r, o) {
|
|
480
502
|
return r.toUpperCase() + o;
|
|
481
503
|
}
|
|
482
|
-
), Gt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ns = K("RegExp"),
|
|
504
|
+
), Gt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ns = K("RegExp"), Vn = (e, t) => {
|
|
483
505
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
484
|
-
|
|
506
|
+
Ae(n, (o, s) => {
|
|
485
507
|
let a;
|
|
486
508
|
(a = t(o, s, e)) !== !1 && (r[s] = a || o);
|
|
487
509
|
}), Object.defineProperties(e, r);
|
|
488
510
|
}, rs = (e) => {
|
|
489
|
-
|
|
511
|
+
Vn(e, (t, n) => {
|
|
490
512
|
if (_(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
491
513
|
return !1;
|
|
492
514
|
const r = e[n];
|
|
@@ -506,13 +528,13 @@ const Vo = (e, t, n, { allOwnKeys: r } = {}) => (xe(t, (o, s) => {
|
|
|
506
528
|
n[s] = !0;
|
|
507
529
|
});
|
|
508
530
|
};
|
|
509
|
-
return
|
|
531
|
+
return pe(e) ? r(e) : r(String(e).split(t)), n;
|
|
510
532
|
}, ss = () => {
|
|
511
|
-
}, as = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Ze = "abcdefghijklmnopqrstuvwxyz", Zt = "0123456789",
|
|
533
|
+
}, as = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, Ze = "abcdefghijklmnopqrstuvwxyz", Zt = "0123456789", Wn = {
|
|
512
534
|
DIGIT: Zt,
|
|
513
535
|
ALPHA: Ze,
|
|
514
536
|
ALPHA_DIGIT: Ze + Ze.toUpperCase() + Zt
|
|
515
|
-
}, is = (e = 16, t =
|
|
537
|
+
}, is = (e = 16, t = Wn.ALPHA_DIGIT) => {
|
|
516
538
|
let n = "";
|
|
517
539
|
const { length: r } = t;
|
|
518
540
|
for (; e--; )
|
|
@@ -529,10 +551,10 @@ const cs = (e) => {
|
|
|
529
551
|
return;
|
|
530
552
|
if (!("toJSON" in r)) {
|
|
531
553
|
t[o] = r;
|
|
532
|
-
const s =
|
|
533
|
-
return
|
|
554
|
+
const s = pe(r) ? [] : {};
|
|
555
|
+
return Ae(r, (a, l) => {
|
|
534
556
|
const d = n(a, o + 1);
|
|
535
|
-
!
|
|
557
|
+
!Se(d) && (s[l] = d);
|
|
536
558
|
}), t[o] = void 0, s;
|
|
537
559
|
}
|
|
538
560
|
}
|
|
@@ -547,7 +569,7 @@ const cs = (e) => {
|
|
|
547
569
|
typeof setImmediate == "function",
|
|
548
570
|
_(ie.postMessage)
|
|
549
571
|
), fs = typeof queueMicrotask < "u" ? queueMicrotask.bind(ie) : typeof process < "u" && process.nextTick || $n, f = {
|
|
550
|
-
isArray:
|
|
572
|
+
isArray: pe,
|
|
551
573
|
isArrayBuffer: qn,
|
|
552
574
|
isBuffer: Ro,
|
|
553
575
|
isFormData: jo,
|
|
@@ -556,12 +578,12 @@ const cs = (e) => {
|
|
|
556
578
|
isNumber: _n,
|
|
557
579
|
isBoolean: Fo,
|
|
558
580
|
isObject: He,
|
|
559
|
-
isPlainObject:
|
|
581
|
+
isPlainObject: Te,
|
|
560
582
|
isReadableStream: qo,
|
|
561
583
|
isRequest: _o,
|
|
562
584
|
isResponse: Ho,
|
|
563
585
|
isHeaders: zo,
|
|
564
|
-
isUndefined:
|
|
586
|
+
isUndefined: Se,
|
|
565
587
|
isDate: Lo,
|
|
566
588
|
isFile: Bo,
|
|
567
589
|
isBlob: Io,
|
|
@@ -571,10 +593,10 @@ const cs = (e) => {
|
|
|
571
593
|
isURLSearchParams: Uo,
|
|
572
594
|
isTypedArray: Zo,
|
|
573
595
|
isFileList: Mo,
|
|
574
|
-
forEach:
|
|
596
|
+
forEach: Ae,
|
|
575
597
|
merge: ft,
|
|
576
|
-
extend:
|
|
577
|
-
trim:
|
|
598
|
+
extend: Wo,
|
|
599
|
+
trim: Vo,
|
|
578
600
|
stripBOM: $o,
|
|
579
601
|
inherits: Ko,
|
|
580
602
|
toFlatObject: Yo,
|
|
@@ -588,7 +610,7 @@ const cs = (e) => {
|
|
|
588
610
|
hasOwnProperty: Gt,
|
|
589
611
|
hasOwnProp: Gt,
|
|
590
612
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
591
|
-
reduceDescriptors:
|
|
613
|
+
reduceDescriptors: Vn,
|
|
592
614
|
freezeMethods: rs,
|
|
593
615
|
toObjectSet: os,
|
|
594
616
|
toCamelCase: ts,
|
|
@@ -597,7 +619,7 @@ const cs = (e) => {
|
|
|
597
619
|
findKey: Hn,
|
|
598
620
|
global: ie,
|
|
599
621
|
isContextDefined: zn,
|
|
600
|
-
ALPHABET:
|
|
622
|
+
ALPHABET: Wn,
|
|
601
623
|
generateString: is,
|
|
602
624
|
isSpecCompliantForm: ls,
|
|
603
625
|
toJSONObject: cs,
|
|
@@ -681,8 +703,8 @@ function ze(e, t, n) {
|
|
|
681
703
|
metaTokens: !0,
|
|
682
704
|
dots: !1,
|
|
683
705
|
indexes: !1
|
|
684
|
-
}, !1, function(
|
|
685
|
-
return !f.isUndefined(g[
|
|
706
|
+
}, !1, function(p, g) {
|
|
707
|
+
return !f.isUndefined(g[p]);
|
|
686
708
|
});
|
|
687
709
|
const r = n.metaTokens, o = n.visitor || u, s = n.dots, a = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(t);
|
|
688
710
|
if (!f.isFunction(o))
|
|
@@ -695,39 +717,39 @@ function ze(e, t, n) {
|
|
|
695
717
|
throw new C("Blob is not supported. Use a Buffer instead.");
|
|
696
718
|
return f.isArrayBuffer(b) || f.isTypedArray(b) ? d && typeof Blob == "function" ? new Blob([b]) : Buffer.from(b) : b;
|
|
697
719
|
}
|
|
698
|
-
function u(b,
|
|
699
|
-
let
|
|
720
|
+
function u(b, p, g) {
|
|
721
|
+
let A = b;
|
|
700
722
|
if (b && !g && typeof b == "object") {
|
|
701
|
-
if (f.endsWith(
|
|
702
|
-
|
|
703
|
-
else if (f.isArray(b) && ps(b) || (f.isFileList(b) || f.endsWith(
|
|
704
|
-
return
|
|
723
|
+
if (f.endsWith(p, "{}"))
|
|
724
|
+
p = r ? p : p.slice(0, -2), b = JSON.stringify(b);
|
|
725
|
+
else if (f.isArray(b) && ps(b) || (f.isFileList(b) || f.endsWith(p, "[]")) && (A = f.toArray(b)))
|
|
726
|
+
return p = Jn(p), A.forEach(function(E, P) {
|
|
705
727
|
!(f.isUndefined(E) || E === null) && t.append(
|
|
706
728
|
// eslint-disable-next-line no-nested-ternary
|
|
707
|
-
a === !0 ? Xt([
|
|
729
|
+
a === !0 ? Xt([p], P, s) : a === null ? p : p + "[]",
|
|
708
730
|
c(E)
|
|
709
731
|
);
|
|
710
732
|
}), !1;
|
|
711
733
|
}
|
|
712
|
-
return ht(b) ? !0 : (t.append(Xt(g,
|
|
734
|
+
return ht(b) ? !0 : (t.append(Xt(g, p, s), c(b)), !1);
|
|
713
735
|
}
|
|
714
736
|
const h = [], y = Object.assign(ms, {
|
|
715
737
|
defaultVisitor: u,
|
|
716
738
|
convertValue: c,
|
|
717
739
|
isVisitable: ht
|
|
718
740
|
});
|
|
719
|
-
function S(b,
|
|
741
|
+
function S(b, p) {
|
|
720
742
|
if (!f.isUndefined(b)) {
|
|
721
743
|
if (h.indexOf(b) !== -1)
|
|
722
|
-
throw Error("Circular reference detected in " +
|
|
723
|
-
h.push(b), f.forEach(b, function(
|
|
724
|
-
(!(f.isUndefined(
|
|
744
|
+
throw Error("Circular reference detected in " + p.join("."));
|
|
745
|
+
h.push(b), f.forEach(b, function(A, x) {
|
|
746
|
+
(!(f.isUndefined(A) || A === null) && o.call(
|
|
725
747
|
t,
|
|
726
|
-
|
|
727
|
-
f.isString(
|
|
728
|
-
|
|
748
|
+
A,
|
|
749
|
+
f.isString(x) ? x.trim() : x,
|
|
750
|
+
p,
|
|
729
751
|
y
|
|
730
|
-
)) === !0 && S(
|
|
752
|
+
)) === !0 && S(A, p ? p.concat(x) : [x]);
|
|
731
753
|
}), h.pop();
|
|
732
754
|
}
|
|
733
755
|
}
|
|
@@ -844,26 +866,26 @@ const Xn = {
|
|
|
844
866
|
Blob: ws
|
|
845
867
|
},
|
|
846
868
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
847
|
-
}, Nt = typeof window < "u" && typeof document < "u", pt = typeof navigator == "object" && navigator || void 0,
|
|
869
|
+
}, Nt = typeof window < "u" && typeof document < "u", pt = typeof navigator == "object" && navigator || void 0, xs = Nt && (!pt || ["ReactNative", "NativeScript", "NS"].indexOf(pt.product) < 0), As = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
848
870
|
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cs = Nt && window.location.href || "http://localhost", Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
849
871
|
__proto__: null,
|
|
850
872
|
hasBrowserEnv: Nt,
|
|
851
|
-
hasStandardBrowserEnv:
|
|
852
|
-
hasStandardBrowserWebWorkerEnv:
|
|
873
|
+
hasStandardBrowserEnv: xs,
|
|
874
|
+
hasStandardBrowserWebWorkerEnv: As,
|
|
853
875
|
navigator: pt,
|
|
854
876
|
origin: Cs
|
|
855
877
|
}, Symbol.toStringTag, { value: "Module" })), j = {
|
|
856
878
|
...Es,
|
|
857
879
|
...Ss
|
|
858
880
|
};
|
|
859
|
-
function
|
|
881
|
+
function ks(e, t) {
|
|
860
882
|
return ze(e, new j.classes.URLSearchParams(), Object.assign({
|
|
861
883
|
visitor: function(n, r, o, s) {
|
|
862
884
|
return j.isNode && f.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
|
|
863
885
|
}
|
|
864
886
|
}, t));
|
|
865
887
|
}
|
|
866
|
-
function
|
|
888
|
+
function Ts(e) {
|
|
867
889
|
return f.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
868
890
|
}
|
|
869
891
|
function Ds(e) {
|
|
@@ -885,7 +907,7 @@ function Qn(e) {
|
|
|
885
907
|
if (f.isFormData(e) && f.isFunction(e.entries)) {
|
|
886
908
|
const n = {};
|
|
887
909
|
return f.forEachEntry(e, (r, o) => {
|
|
888
|
-
t(
|
|
910
|
+
t(Ts(r), o, n, 0);
|
|
889
911
|
}), n;
|
|
890
912
|
}
|
|
891
913
|
return null;
|
|
@@ -916,7 +938,7 @@ const Ce = {
|
|
|
916
938
|
let l;
|
|
917
939
|
if (s) {
|
|
918
940
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
919
|
-
return
|
|
941
|
+
return ks(t, this.formSerializer).toString();
|
|
920
942
|
if ((l = f.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
921
943
|
const d = this.env && this.env.FormData;
|
|
922
944
|
return ze(
|
|
@@ -995,7 +1017,7 @@ const Rs = f.toObjectSet([
|
|
|
995
1017
|
o = a.indexOf(":"), n = a.substring(0, o).trim().toLowerCase(), r = a.substring(o + 1).trim(), !(!n || t[n] && Rs[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
996
1018
|
}), t;
|
|
997
1019
|
}, tn = Symbol("internals");
|
|
998
|
-
function
|
|
1020
|
+
function be(e) {
|
|
999
1021
|
return e && String(e).trim().toLowerCase();
|
|
1000
1022
|
}
|
|
1001
1023
|
function De(e) {
|
|
@@ -1040,7 +1062,7 @@ let U = class {
|
|
|
1040
1062
|
set(t, n, r) {
|
|
1041
1063
|
const o = this;
|
|
1042
1064
|
function s(l, d, c) {
|
|
1043
|
-
const u =
|
|
1065
|
+
const u = be(d);
|
|
1044
1066
|
if (!u)
|
|
1045
1067
|
throw new Error("header name must be a non-empty string");
|
|
1046
1068
|
const h = f.findKey(o, u);
|
|
@@ -1059,7 +1081,7 @@ let U = class {
|
|
|
1059
1081
|
return this;
|
|
1060
1082
|
}
|
|
1061
1083
|
get(t, n) {
|
|
1062
|
-
if (t =
|
|
1084
|
+
if (t = be(t), t) {
|
|
1063
1085
|
const r = f.findKey(this, t);
|
|
1064
1086
|
if (r) {
|
|
1065
1087
|
const o = this[r];
|
|
@@ -1076,7 +1098,7 @@ let U = class {
|
|
|
1076
1098
|
}
|
|
1077
1099
|
}
|
|
1078
1100
|
has(t, n) {
|
|
1079
|
-
if (t =
|
|
1101
|
+
if (t = be(t), t) {
|
|
1080
1102
|
const r = f.findKey(this, t);
|
|
1081
1103
|
return !!(r && this[r] !== void 0 && (!n || Xe(this, this[r], r, n)));
|
|
1082
1104
|
}
|
|
@@ -1086,7 +1108,7 @@ let U = class {
|
|
|
1086
1108
|
const r = this;
|
|
1087
1109
|
let o = !1;
|
|
1088
1110
|
function s(a) {
|
|
1089
|
-
if (a =
|
|
1111
|
+
if (a = be(a), a) {
|
|
1090
1112
|
const l = f.findKey(r, a);
|
|
1091
1113
|
l && (!n || Xe(r, r[l], l, n)) && (delete r[l], o = !0);
|
|
1092
1114
|
}
|
|
@@ -1145,7 +1167,7 @@ let U = class {
|
|
|
1145
1167
|
accessors: {}
|
|
1146
1168
|
}).accessors, o = this.prototype;
|
|
1147
1169
|
function s(a) {
|
|
1148
|
-
const l =
|
|
1170
|
+
const l = be(a);
|
|
1149
1171
|
r[l] || (Bs(o, a), r[l] = !0);
|
|
1150
1172
|
}
|
|
1151
1173
|
return f.isArray(t) ? t.forEach(s) : s(t), this;
|
|
@@ -1172,10 +1194,10 @@ function Qe(e, t) {
|
|
|
1172
1194
|
function er(e) {
|
|
1173
1195
|
return !!(e && e.__CANCEL__);
|
|
1174
1196
|
}
|
|
1175
|
-
function
|
|
1197
|
+
function me(e, t, n) {
|
|
1176
1198
|
C.call(this, e ?? "canceled", C.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1177
1199
|
}
|
|
1178
|
-
f.inherits(
|
|
1200
|
+
f.inherits(me, C, {
|
|
1179
1201
|
__CANCEL__: !0
|
|
1180
1202
|
});
|
|
1181
1203
|
function tr(e, t, n) {
|
|
@@ -1405,12 +1427,12 @@ const rr = (e) => {
|
|
|
1405
1427
|
let s = o.data;
|
|
1406
1428
|
const a = U.from(o.headers).normalize();
|
|
1407
1429
|
let { responseType: l, onUploadProgress: d, onDownloadProgress: c } = o, u, h, y, S, b;
|
|
1408
|
-
function
|
|
1430
|
+
function p() {
|
|
1409
1431
|
S && S(), b && b(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1410
1432
|
}
|
|
1411
1433
|
let g = new XMLHttpRequest();
|
|
1412
1434
|
g.open(o.method.toUpperCase(), o.url, !0), g.timeout = o.timeout;
|
|
1413
|
-
function
|
|
1435
|
+
function A() {
|
|
1414
1436
|
if (!g)
|
|
1415
1437
|
return;
|
|
1416
1438
|
const E = U.from(
|
|
@@ -1424,13 +1446,13 @@ const rr = (e) => {
|
|
|
1424
1446
|
request: g
|
|
1425
1447
|
};
|
|
1426
1448
|
tr(function(D) {
|
|
1427
|
-
n(D),
|
|
1449
|
+
n(D), p();
|
|
1428
1450
|
}, function(D) {
|
|
1429
|
-
r(D),
|
|
1451
|
+
r(D), p();
|
|
1430
1452
|
}, O), g = null;
|
|
1431
1453
|
}
|
|
1432
|
-
"onloadend" in g ? g.onloadend =
|
|
1433
|
-
!g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1454
|
+
"onloadend" in g ? g.onloadend = A : g.onreadystatechange = function() {
|
|
1455
|
+
!g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(A);
|
|
1434
1456
|
}, g.onabort = function() {
|
|
1435
1457
|
g && (r(new C("Request aborted", C.ECONNABORTED, e, g)), g = null);
|
|
1436
1458
|
}, g.onerror = function() {
|
|
@@ -1447,16 +1469,16 @@ const rr = (e) => {
|
|
|
1447
1469
|
}, s === void 0 && a.setContentType(null), "setRequestHeader" in g && f.forEach(a.toJSON(), function(P, O) {
|
|
1448
1470
|
g.setRequestHeader(O, P);
|
|
1449
1471
|
}), f.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([y, b] = Le(c, !0), g.addEventListener("progress", y)), d && g.upload && ([h, S] = Le(d), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1450
|
-
g && (r(!E || E.type ? new
|
|
1472
|
+
g && (r(!E || E.type ? new me(null, e, g) : E), g.abort(), g = null);
|
|
1451
1473
|
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1454
|
-
r(new C("Unsupported protocol " +
|
|
1474
|
+
const x = Is(o.url);
|
|
1475
|
+
if (x && j.protocols.indexOf(x) === -1) {
|
|
1476
|
+
r(new C("Unsupported protocol " + x + ":", C.ERR_BAD_REQUEST, e));
|
|
1455
1477
|
return;
|
|
1456
1478
|
}
|
|
1457
1479
|
g.send(s || null);
|
|
1458
1480
|
});
|
|
1459
|
-
},
|
|
1481
|
+
}, Vs = (e, t) => {
|
|
1460
1482
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1461
1483
|
if (t || n) {
|
|
1462
1484
|
let r = new AbortController(), o;
|
|
@@ -1464,7 +1486,7 @@ const rr = (e) => {
|
|
|
1464
1486
|
if (!o) {
|
|
1465
1487
|
o = !0, l();
|
|
1466
1488
|
const u = c instanceof Error ? c : this.reason;
|
|
1467
|
-
r.abort(u instanceof C ? u : new
|
|
1489
|
+
r.abort(u instanceof C ? u : new me(u instanceof Error ? u.message : u));
|
|
1468
1490
|
}
|
|
1469
1491
|
};
|
|
1470
1492
|
let a = t && setTimeout(() => {
|
|
@@ -1479,7 +1501,7 @@ const rr = (e) => {
|
|
|
1479
1501
|
const { signal: d } = r;
|
|
1480
1502
|
return d.unsubscribe = () => f.asap(l), d;
|
|
1481
1503
|
}
|
|
1482
|
-
},
|
|
1504
|
+
}, Ws = function* (e, t) {
|
|
1483
1505
|
let n = e.byteLength;
|
|
1484
1506
|
if (n < t) {
|
|
1485
1507
|
yield e;
|
|
@@ -1490,7 +1512,7 @@ const rr = (e) => {
|
|
|
1490
1512
|
o = r + t, yield e.slice(r, o), r = o;
|
|
1491
1513
|
}, $s = async function* (e, t) {
|
|
1492
1514
|
for await (const n of Ks(e))
|
|
1493
|
-
yield*
|
|
1515
|
+
yield* Ws(n, t);
|
|
1494
1516
|
}, Ks = async function* (e) {
|
|
1495
1517
|
if (e[Symbol.asyncIterator]) {
|
|
1496
1518
|
yield* e;
|
|
@@ -1536,7 +1558,7 @@ const rr = (e) => {
|
|
|
1536
1558
|
}, {
|
|
1537
1559
|
highWaterMark: 2
|
|
1538
1560
|
});
|
|
1539
|
-
},
|
|
1561
|
+
}, Ve = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", or = Ve && typeof ReadableStream == "function", Ys = Ve && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), sr = (e, ...t) => {
|
|
1540
1562
|
try {
|
|
1541
1563
|
return !!e(...t);
|
|
1542
1564
|
} catch {
|
|
@@ -1555,7 +1577,7 @@ const rr = (e) => {
|
|
|
1555
1577
|
}), an = 64 * 1024, mt = or && sr(() => f.isReadableStream(new Response("").body)), Be = {
|
|
1556
1578
|
stream: mt && ((e) => e.body)
|
|
1557
1579
|
};
|
|
1558
|
-
|
|
1580
|
+
Ve && ((e) => {
|
|
1559
1581
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
|
|
1560
1582
|
!Be[t] && (Be[t] = f.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
|
|
1561
1583
|
throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, r);
|
|
@@ -1579,7 +1601,7 @@ const Gs = async (e) => {
|
|
|
1579
1601
|
}, Zs = async (e, t) => {
|
|
1580
1602
|
const n = f.toFiniteNumber(e.getContentLength());
|
|
1581
1603
|
return n ?? Gs(t);
|
|
1582
|
-
}, Xs =
|
|
1604
|
+
}, Xs = Ve && (async (e) => {
|
|
1583
1605
|
let {
|
|
1584
1606
|
url: t,
|
|
1585
1607
|
method: n,
|
|
@@ -1595,8 +1617,8 @@ const Gs = async (e) => {
|
|
|
1595
1617
|
fetchOptions: y
|
|
1596
1618
|
} = rr(e);
|
|
1597
1619
|
c = c ? (c + "").toLowerCase() : "text";
|
|
1598
|
-
let S =
|
|
1599
|
-
const
|
|
1620
|
+
let S = Vs([o, s && s.toAbortSignal()], a), b;
|
|
1621
|
+
const p = S && S.unsubscribe && (() => {
|
|
1600
1622
|
S.unsubscribe();
|
|
1601
1623
|
});
|
|
1602
1624
|
let g;
|
|
@@ -1608,15 +1630,15 @@ const Gs = async (e) => {
|
|
|
1608
1630
|
duplex: "half"
|
|
1609
1631
|
}), R;
|
|
1610
1632
|
if (f.isFormData(r) && (R = O.headers.get("content-type")) && u.setContentType(R), O.body) {
|
|
1611
|
-
const [D,
|
|
1633
|
+
const [D, V] = nn(
|
|
1612
1634
|
g,
|
|
1613
1635
|
Le(rn(d))
|
|
1614
1636
|
);
|
|
1615
|
-
r = sn(O.body, an, D,
|
|
1637
|
+
r = sn(O.body, an, D, V);
|
|
1616
1638
|
}
|
|
1617
1639
|
}
|
|
1618
1640
|
f.isString(h) || (h = h ? "include" : "omit");
|
|
1619
|
-
const
|
|
1641
|
+
const A = "credentials" in Request.prototype;
|
|
1620
1642
|
b = new Request(t, {
|
|
1621
1643
|
...y,
|
|
1622
1644
|
signal: S,
|
|
@@ -1624,45 +1646,45 @@ const Gs = async (e) => {
|
|
|
1624
1646
|
headers: u.normalize().toJSON(),
|
|
1625
1647
|
body: r,
|
|
1626
1648
|
duplex: "half",
|
|
1627
|
-
credentials:
|
|
1649
|
+
credentials: A ? h : void 0
|
|
1628
1650
|
});
|
|
1629
|
-
let
|
|
1651
|
+
let x = await fetch(b);
|
|
1630
1652
|
const E = mt && (c === "stream" || c === "response");
|
|
1631
|
-
if (mt && (l || E &&
|
|
1653
|
+
if (mt && (l || E && p)) {
|
|
1632
1654
|
const O = {};
|
|
1633
1655
|
["status", "statusText", "headers"].forEach((Ee) => {
|
|
1634
|
-
O[Ee] =
|
|
1656
|
+
O[Ee] = x[Ee];
|
|
1635
1657
|
});
|
|
1636
|
-
const R = f.toFiniteNumber(
|
|
1658
|
+
const R = f.toFiniteNumber(x.headers.get("content-length")), [D, V] = l && nn(
|
|
1637
1659
|
R,
|
|
1638
1660
|
Le(rn(l), !0)
|
|
1639
1661
|
) || [];
|
|
1640
|
-
|
|
1641
|
-
sn(
|
|
1642
|
-
|
|
1662
|
+
x = new Response(
|
|
1663
|
+
sn(x.body, an, D, () => {
|
|
1664
|
+
V && V(), p && p();
|
|
1643
1665
|
}),
|
|
1644
1666
|
O
|
|
1645
1667
|
);
|
|
1646
1668
|
}
|
|
1647
1669
|
c = c || "text";
|
|
1648
|
-
let P = await Be[f.findKey(Be, c) || "text"](
|
|
1649
|
-
return !E &&
|
|
1670
|
+
let P = await Be[f.findKey(Be, c) || "text"](x, e);
|
|
1671
|
+
return !E && p && p(), await new Promise((O, R) => {
|
|
1650
1672
|
tr(O, R, {
|
|
1651
1673
|
data: P,
|
|
1652
|
-
headers: U.from(
|
|
1653
|
-
status:
|
|
1654
|
-
statusText:
|
|
1674
|
+
headers: U.from(x.headers),
|
|
1675
|
+
status: x.status,
|
|
1676
|
+
statusText: x.statusText,
|
|
1655
1677
|
config: e,
|
|
1656
1678
|
request: b
|
|
1657
1679
|
});
|
|
1658
1680
|
});
|
|
1659
|
-
} catch (
|
|
1660
|
-
throw
|
|
1681
|
+
} catch (A) {
|
|
1682
|
+
throw p && p(), A && A.name === "TypeError" && /fetch/i.test(A.message) ? Object.assign(
|
|
1661
1683
|
new C("Network Error", C.ERR_NETWORK, e, b),
|
|
1662
1684
|
{
|
|
1663
|
-
cause:
|
|
1685
|
+
cause: A.cause || A
|
|
1664
1686
|
}
|
|
1665
|
-
) : C.from(
|
|
1687
|
+
) : C.from(A, A && A.code, e, b);
|
|
1666
1688
|
}
|
|
1667
1689
|
}), gt = {
|
|
1668
1690
|
http: hs,
|
|
@@ -1711,7 +1733,7 @@ const ln = (e) => `- ${e}`, Qs = (e) => f.isFunction(e) || e === null || e === !
|
|
|
1711
1733
|
};
|
|
1712
1734
|
function et(e) {
|
|
1713
1735
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1714
|
-
throw new
|
|
1736
|
+
throw new me(null, e);
|
|
1715
1737
|
}
|
|
1716
1738
|
function cn(e) {
|
|
1717
1739
|
return et(e), e.headers = U.from(e.headers), e.data = Qe.call(
|
|
@@ -1834,12 +1856,12 @@ let le = class {
|
|
|
1834
1856
|
), n.headers = U.concat(a, s);
|
|
1835
1857
|
const l = [];
|
|
1836
1858
|
let d = !0;
|
|
1837
|
-
this.interceptors.request.forEach(function(
|
|
1838
|
-
typeof
|
|
1859
|
+
this.interceptors.request.forEach(function(p) {
|
|
1860
|
+
typeof p.runWhen == "function" && p.runWhen(n) === !1 || (d = d && p.synchronous, l.unshift(p.fulfilled, p.rejected));
|
|
1839
1861
|
});
|
|
1840
1862
|
const c = [];
|
|
1841
|
-
this.interceptors.response.forEach(function(
|
|
1842
|
-
c.push(
|
|
1863
|
+
this.interceptors.response.forEach(function(p) {
|
|
1864
|
+
c.push(p.fulfilled, p.rejected);
|
|
1843
1865
|
});
|
|
1844
1866
|
let u, h = 0, y;
|
|
1845
1867
|
if (!d) {
|
|
@@ -1851,11 +1873,11 @@ let le = class {
|
|
|
1851
1873
|
y = l.length;
|
|
1852
1874
|
let S = n;
|
|
1853
1875
|
for (h = 0; h < y; ) {
|
|
1854
|
-
const b = l[h++],
|
|
1876
|
+
const b = l[h++], p = l[h++];
|
|
1855
1877
|
try {
|
|
1856
1878
|
S = b(S);
|
|
1857
1879
|
} catch (g) {
|
|
1858
|
-
|
|
1880
|
+
p.call(this, g);
|
|
1859
1881
|
break;
|
|
1860
1882
|
}
|
|
1861
1883
|
}
|
|
@@ -1922,7 +1944,7 @@ let ta = class lr {
|
|
|
1922
1944
|
r.unsubscribe(s);
|
|
1923
1945
|
}, a;
|
|
1924
1946
|
}, t(function(s, a, l) {
|
|
1925
|
-
r.reason || (r.reason = new
|
|
1947
|
+
r.reason || (r.reason = new me(s, a, l), n(r.reason));
|
|
1926
1948
|
});
|
|
1927
1949
|
}
|
|
1928
1950
|
/**
|
|
@@ -2055,7 +2077,7 @@ function cr(e) {
|
|
|
2055
2077
|
}
|
|
2056
2078
|
const F = cr(Ce);
|
|
2057
2079
|
F.Axios = le;
|
|
2058
|
-
F.CanceledError =
|
|
2080
|
+
F.CanceledError = me;
|
|
2059
2081
|
F.CancelToken = ta;
|
|
2060
2082
|
F.isCancel = er;
|
|
2061
2083
|
F.VERSION = ir;
|
|
@@ -2085,8 +2107,8 @@ const {
|
|
|
2085
2107
|
isAxiosError: oa,
|
|
2086
2108
|
spread: Hi,
|
|
2087
2109
|
toFormData: zi,
|
|
2088
|
-
AxiosHeaders:
|
|
2089
|
-
HttpStatusCode:
|
|
2110
|
+
AxiosHeaders: Vi,
|
|
2111
|
+
HttpStatusCode: Wi,
|
|
2090
2112
|
formToJSON: $i,
|
|
2091
2113
|
getAdapter: Ki,
|
|
2092
2114
|
mergeConfig: Yi
|
|
@@ -2103,32 +2125,32 @@ function ce(e) {
|
|
|
2103
2125
|
};
|
|
2104
2126
|
}
|
|
2105
2127
|
function Ut() {
|
|
2106
|
-
return
|
|
2128
|
+
return m.useContext(Lt).notify;
|
|
2107
2129
|
}
|
|
2108
2130
|
function sa() {
|
|
2109
2131
|
const e = Ut();
|
|
2110
|
-
return
|
|
2132
|
+
return m.useCallback((t) => {
|
|
2111
2133
|
ce(e)(t);
|
|
2112
2134
|
}, [e]);
|
|
2113
2135
|
}
|
|
2114
2136
|
const aa = ({ create: e = !1 }) => {
|
|
2115
|
-
const [t, n] =
|
|
2137
|
+
const [t, n] = m.useState(), { id: r } = xr(), { t: o } = L(), s = Ut(), a = At(), l = te(), d = z("breakpoint", "md");
|
|
2116
2138
|
Bt(
|
|
2117
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() })
|
|
2118
2140
|
), Do();
|
|
2119
|
-
const c =
|
|
2120
|
-
|
|
2141
|
+
const c = T("cms").getComponent("Breadcrumbs");
|
|
2142
|
+
m.useEffect(() => {
|
|
2121
2143
|
e ? n(new l()) : l.find(r).then((S) => n(S ?? void 0));
|
|
2122
2144
|
}, [r, l, e]);
|
|
2123
|
-
const u =
|
|
2124
|
-
s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${
|
|
2125
|
-
}, [s, a, l, t, o]), h = sa(), y =
|
|
2145
|
+
const u = m.useCallback(() => {
|
|
2146
|
+
s(o(":model saved successfully", { model: l.singular() })), t != null && t.wasRecentlyCreated && a(`/${k.kebab(l.plural())}/${t.getKey()}`);
|
|
2147
|
+
}, [s, a, l, t, o]), h = sa(), y = m.useMemo(() => T("cms").getModelFormProps(t), [t]);
|
|
2126
2148
|
return t ? /* @__PURE__ */ i(H, { sx: { p: { xs: 1, sm: 2, md: 3 } }, children: /* @__PURE__ */ w(Q, { container: !0, children: [
|
|
2127
2149
|
/* @__PURE__ */ i(Q, { xs: 12, children: /* @__PURE__ */ i(
|
|
2128
2150
|
c,
|
|
2129
2151
|
{
|
|
2130
2152
|
parts: [
|
|
2131
|
-
{ name: l.plural(), href: "/" +
|
|
2153
|
+
{ name: l.plural(), href: "/" + k.kebab(l.plural()) },
|
|
2132
2154
|
{ name: t.exists ? t.getLabel() : o("New") }
|
|
2133
2155
|
]
|
|
2134
2156
|
}
|
|
@@ -2155,16 +2177,16 @@ const aa = ({ create: e = !1 }) => {
|
|
|
2155
2177
|
function ia(e) {
|
|
2156
2178
|
const {
|
|
2157
2179
|
setDisplacement: t
|
|
2158
|
-
} =
|
|
2159
|
-
|
|
2180
|
+
} = m.useContext(Lt), n = Ft(), r = v(), o = n.spacing(r ? 3 : 1), s = e === !1 ? o : n.spacing(e);
|
|
2181
|
+
m.useEffect(() => (t(s), () => {
|
|
2160
2182
|
t(o);
|
|
2161
2183
|
}), [s, o, t]);
|
|
2162
2184
|
}
|
|
2163
2185
|
function la() {
|
|
2164
|
-
return
|
|
2186
|
+
return m.useContext(jn).dialog;
|
|
2165
2187
|
}
|
|
2166
2188
|
function qt() {
|
|
2167
|
-
const e =
|
|
2189
|
+
const e = At(), t = Ut(), n = la(), { t: r } = L(), { refresh: o } = xe();
|
|
2168
2190
|
return { navigate: e, notify: t, dialog: n, t: r, refresh: o };
|
|
2169
2191
|
}
|
|
2170
2192
|
const ca = Z(vr)(({ theme: e }) => ({
|
|
@@ -2176,17 +2198,17 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2176
2198
|
bottom: e.spacing(2),
|
|
2177
2199
|
right: e.spacing(2)
|
|
2178
2200
|
})), da = ({ variant: e = "default" }) => {
|
|
2179
|
-
const t = te(), n = v(), [r] = G(), o = r.get("tab") ?? "all", [s, a] =
|
|
2201
|
+
const t = te(), n = v(), [r] = G(), o = r.get("tab") ?? "all", [s, a] = m.useState(!1), l = m.useRef(null), [d, c] = m.useState(0), u = qt(), h = m.useMemo(() => T("cms").getStaticActions(t, o), [t, o]);
|
|
2180
2202
|
if (ia(
|
|
2181
2203
|
e === "fab" && h.length > 0 ? n ? 12 : 10 : !1
|
|
2182
2204
|
), h.length === 0)
|
|
2183
2205
|
return null;
|
|
2184
|
-
const y = (
|
|
2206
|
+
const y = (p, g) => {
|
|
2185
2207
|
c(g), a(!1);
|
|
2186
2208
|
}, S = () => {
|
|
2187
|
-
a((
|
|
2188
|
-
}, b = (
|
|
2189
|
-
l.current && l.current.contains(
|
|
2209
|
+
a((p) => !p);
|
|
2210
|
+
}, b = (p) => {
|
|
2211
|
+
l.current && l.current.contains(p.target) || a(!1);
|
|
2190
2212
|
};
|
|
2191
2213
|
return e === "fab" ? h.length === 1 ? Jt.createPortal(
|
|
2192
2214
|
/* @__PURE__ */ i(
|
|
@@ -2208,14 +2230,14 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2208
2230
|
onClose: () => a(!1),
|
|
2209
2231
|
onOpen: () => a(!0),
|
|
2210
2232
|
open: s,
|
|
2211
|
-
children: h.map((
|
|
2233
|
+
children: h.map((p) => /* @__PURE__ */ i(
|
|
2212
2234
|
Br,
|
|
2213
2235
|
{
|
|
2214
|
-
icon:
|
|
2215
|
-
tooltipTitle:
|
|
2216
|
-
onClick: () =>
|
|
2236
|
+
icon: p.icon || p.label.charAt(0).toUpperCase(),
|
|
2237
|
+
tooltipTitle: p.label,
|
|
2238
|
+
onClick: () => p.callback(u)
|
|
2217
2239
|
},
|
|
2218
|
-
|
|
2240
|
+
p.label
|
|
2219
2241
|
))
|
|
2220
2242
|
}
|
|
2221
2243
|
),
|
|
@@ -2239,7 +2261,7 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2239
2261
|
"aria-label": `select ${t.singular()} actions`,
|
|
2240
2262
|
"aria-haspopup": "menu",
|
|
2241
2263
|
onClick: S,
|
|
2242
|
-
children: /* @__PURE__ */ i(
|
|
2264
|
+
children: /* @__PURE__ */ i(Tn, {})
|
|
2243
2265
|
}
|
|
2244
2266
|
)
|
|
2245
2267
|
]
|
|
@@ -2252,21 +2274,21 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2252
2274
|
anchorEl: l.current,
|
|
2253
2275
|
role: void 0,
|
|
2254
2276
|
transition: !0,
|
|
2255
|
-
children: ({ TransitionProps:
|
|
2277
|
+
children: ({ TransitionProps: p, placement: g }) => /* @__PURE__ */ i(
|
|
2256
2278
|
Nr,
|
|
2257
2279
|
{
|
|
2258
|
-
...
|
|
2280
|
+
...p,
|
|
2259
2281
|
style: {
|
|
2260
2282
|
transformOrigin: g === "bottom" ? "center top" : "center bottom"
|
|
2261
2283
|
},
|
|
2262
|
-
children: /* @__PURE__ */ i(Ot, { children: /* @__PURE__ */ i(jr, { onClickAway: b, children: /* @__PURE__ */ i(Ur, { id: "split-button-menu", children: h.map((
|
|
2284
|
+
children: /* @__PURE__ */ i(Ot, { children: /* @__PURE__ */ i(jr, { onClickAway: b, children: /* @__PURE__ */ i(Ur, { id: "split-button-menu", children: h.map((A, x) => /* @__PURE__ */ i(
|
|
2263
2285
|
se,
|
|
2264
2286
|
{
|
|
2265
|
-
selected:
|
|
2266
|
-
onClick: (E) => y(E,
|
|
2267
|
-
children:
|
|
2287
|
+
selected: x === d,
|
|
2288
|
+
onClick: (E) => y(E, x),
|
|
2289
|
+
children: A.label
|
|
2268
2290
|
},
|
|
2269
|
-
|
|
2291
|
+
A.label
|
|
2270
2292
|
)) }) }) })
|
|
2271
2293
|
}
|
|
2272
2294
|
)
|
|
@@ -2275,7 +2297,7 @@ const ca = Z(vr)(({ theme: e }) => ({
|
|
|
2275
2297
|
] });
|
|
2276
2298
|
};
|
|
2277
2299
|
function _t() {
|
|
2278
|
-
const { open: e, setOpen: t } =
|
|
2300
|
+
const { open: e, setOpen: t } = m.useContext(X);
|
|
2279
2301
|
return {
|
|
2280
2302
|
open: e,
|
|
2281
2303
|
handleDrawerOpen: () => {
|
|
@@ -2290,15 +2312,15 @@ function _t() {
|
|
|
2290
2312
|
};
|
|
2291
2313
|
}
|
|
2292
2314
|
function ur() {
|
|
2293
|
-
const { currentPage: e } =
|
|
2315
|
+
const { currentPage: e } = m.useContext(X);
|
|
2294
2316
|
return e;
|
|
2295
2317
|
}
|
|
2296
2318
|
function dr() {
|
|
2297
|
-
const { showSearch: e } =
|
|
2319
|
+
const { showSearch: e } = m.useContext(X);
|
|
2298
2320
|
return e;
|
|
2299
2321
|
}
|
|
2300
2322
|
function fr() {
|
|
2301
|
-
const { showBackButton: e } =
|
|
2323
|
+
const { showBackButton: e } = m.useContext(X);
|
|
2302
2324
|
return e;
|
|
2303
2325
|
}
|
|
2304
2326
|
const fa = Z(
|
|
@@ -2328,11 +2350,11 @@ const fa = Z(
|
|
|
2328
2350
|
["Layout.SearchBar"]: s,
|
|
2329
2351
|
["Layout.BackButton"]: a,
|
|
2330
2352
|
["Layout.AppLogo"]: l
|
|
2331
|
-
} =
|
|
2353
|
+
} = T("cms").getComponents(), { open: d } = _t(), c = dr(), u = fr(), h = z("appBar.height"), y = z("drawer.width", 280), {
|
|
2332
2354
|
start: S = null,
|
|
2333
2355
|
//: title = config('app.name', document.title),
|
|
2334
2356
|
end: b = null
|
|
2335
|
-
} = e,
|
|
2357
|
+
} = e, p = ur();
|
|
2336
2358
|
return /* @__PURE__ */ i(
|
|
2337
2359
|
r,
|
|
2338
2360
|
{
|
|
@@ -2351,7 +2373,7 @@ const fa = Z(
|
|
|
2351
2373
|
variant: "h6",
|
|
2352
2374
|
noWrap: !0,
|
|
2353
2375
|
component: "div",
|
|
2354
|
-
children: !n &&
|
|
2376
|
+
children: !n && p || oe("app.name", document.title)
|
|
2355
2377
|
}
|
|
2356
2378
|
),
|
|
2357
2379
|
/* @__PURE__ */ i(H, { sx: { flexGrow: 1 } }),
|
|
@@ -2425,7 +2447,7 @@ const dn = (e, t) => ({
|
|
|
2425
2447
|
// necessary for content to be below app bar
|
|
2426
2448
|
...e.mixins.toolbar
|
|
2427
2449
|
})), wa = (e) => {
|
|
2428
|
-
const t = Ft(), n = v(), { open: r, handleDrawerClose: o } = _t(), s = n ? ga : ba, a = z("drawer.width", 280), l = z("appBar.height"), d =
|
|
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();
|
|
2429
2451
|
return /* @__PURE__ */ w(
|
|
2430
2452
|
s,
|
|
2431
2453
|
{
|
|
@@ -2458,7 +2480,7 @@ const dn = (e, t) => ({
|
|
|
2458
2480
|
}, Sa = () => {
|
|
2459
2481
|
const e = ur(), t = z("breakpoint", "md"), n = fr(), {
|
|
2460
2482
|
["Layout.BackButton"]: r
|
|
2461
|
-
} =
|
|
2483
|
+
} = T("cms").getComponents();
|
|
2462
2484
|
return /* @__PURE__ */ w(
|
|
2463
2485
|
Ot,
|
|
2464
2486
|
{
|
|
@@ -2476,7 +2498,7 @@ const dn = (e, t) => ({
|
|
|
2476
2498
|
]
|
|
2477
2499
|
}
|
|
2478
2500
|
);
|
|
2479
|
-
}, Ht =
|
|
2501
|
+
}, Ht = m.createContext({
|
|
2480
2502
|
Model: null,
|
|
2481
2503
|
anchorEl: null,
|
|
2482
2504
|
setAnchorEl: () => {
|
|
@@ -2493,7 +2515,7 @@ const dn = (e, t) => ({
|
|
|
2493
2515
|
},
|
|
2494
2516
|
clearFilters: () => {
|
|
2495
2517
|
}
|
|
2496
|
-
}),
|
|
2518
|
+
}), ge = m.createContext({
|
|
2497
2519
|
key: "",
|
|
2498
2520
|
type: "",
|
|
2499
2521
|
operator: "",
|
|
@@ -2510,18 +2532,18 @@ const dn = (e, t) => ({
|
|
|
2510
2532
|
},
|
|
2511
2533
|
setIsRelation: () => {
|
|
2512
2534
|
}
|
|
2513
|
-
}),
|
|
2535
|
+
}), xa = (e) => {
|
|
2514
2536
|
if (!Array.isArray(e))
|
|
2515
2537
|
return e;
|
|
2516
2538
|
let t;
|
|
2517
2539
|
return J.isEmpty(e) ? t = "" : t = e[0], t;
|
|
2518
|
-
},
|
|
2540
|
+
}, Aa = (e) => {
|
|
2519
2541
|
if (Array.isArray(e))
|
|
2520
2542
|
return e;
|
|
2521
2543
|
let t;
|
|
2522
2544
|
return J.isEmpty(e) ? t = [] : t = [e, ""], t;
|
|
2523
2545
|
}, Ca = async (e, t, n) => {
|
|
2524
|
-
const r = e.getSchema().relations[t], o =
|
|
2546
|
+
const r = e.getSchema().relations[t], o = we().make(r.model), s = o.getSchema().primaryKey, a = [];
|
|
2525
2547
|
for (const l of n) {
|
|
2526
2548
|
const d = await o.where(s, l).first();
|
|
2527
2549
|
a.push(d);
|
|
@@ -2529,14 +2551,14 @@ const dn = (e, t) => ({
|
|
|
2529
2551
|
return a;
|
|
2530
2552
|
};
|
|
2531
2553
|
function Ea(e, t) {
|
|
2532
|
-
const n =
|
|
2533
|
-
o((R) => R.filter((D,
|
|
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));
|
|
2534
2556
|
}, E = async (O) => {
|
|
2535
|
-
const R = O.target.value, D =
|
|
2536
|
-
|
|
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(() => {
|
|
2537
2559
|
if (["between", "notBetween"].includes(l))
|
|
2538
2560
|
return [];
|
|
2539
|
-
switch (n.getInputType(
|
|
2561
|
+
switch (n.getInputType(V)) {
|
|
2540
2562
|
case "number":
|
|
2541
2563
|
return 0;
|
|
2542
2564
|
case "boolean":
|
|
@@ -2544,34 +2566,34 @@ function Ea(e, t) {
|
|
|
2544
2566
|
default:
|
|
2545
2567
|
return "";
|
|
2546
2568
|
}
|
|
2547
|
-
})), a(R), u(
|
|
2569
|
+
})), a(R), u(V);
|
|
2548
2570
|
}, P = async (O) => {
|
|
2549
2571
|
const R = O.target.value;
|
|
2550
2572
|
l !== R && y((D) => {
|
|
2551
2573
|
switch (R) {
|
|
2552
2574
|
case "between":
|
|
2553
2575
|
case "notBetween":
|
|
2554
|
-
return
|
|
2576
|
+
return Aa(D);
|
|
2555
2577
|
case "null":
|
|
2556
2578
|
case "notNull":
|
|
2557
2579
|
return "1";
|
|
2558
2580
|
default:
|
|
2559
|
-
return
|
|
2581
|
+
return xa(D);
|
|
2560
2582
|
}
|
|
2561
2583
|
}), d(R);
|
|
2562
2584
|
};
|
|
2563
|
-
return
|
|
2564
|
-
o((O) => O.map((D,
|
|
2585
|
+
return m.useEffect(() => {
|
|
2586
|
+
o((O) => O.map((D, V) => e === V ? {
|
|
2565
2587
|
...D,
|
|
2566
2588
|
key: s,
|
|
2567
2589
|
operator: l,
|
|
2568
2590
|
type: c,
|
|
2569
2591
|
value: h,
|
|
2570
2592
|
nullable: S,
|
|
2571
|
-
is_relation:
|
|
2593
|
+
is_relation: p
|
|
2572
2594
|
} : D));
|
|
2573
|
-
}, [s, l, c, h, S,
|
|
2574
|
-
columns:
|
|
2595
|
+
}, [s, l, c, h, S, p]), {
|
|
2596
|
+
columns: A,
|
|
2575
2597
|
key: s,
|
|
2576
2598
|
setKey: a,
|
|
2577
2599
|
operator: l,
|
|
@@ -2582,40 +2604,40 @@ function Ea(e, t) {
|
|
|
2582
2604
|
setValue: y,
|
|
2583
2605
|
nullable: S,
|
|
2584
2606
|
setNullable: b,
|
|
2585
|
-
isRelation:
|
|
2607
|
+
isRelation: p,
|
|
2586
2608
|
setIsRelation: g,
|
|
2587
2609
|
handleKey: E,
|
|
2588
2610
|
handleOperator: P,
|
|
2589
|
-
handleRemoveColumn:
|
|
2611
|
+
handleRemoveColumn: x
|
|
2590
2612
|
};
|
|
2591
2613
|
}
|
|
2592
2614
|
const hn = async (e, t, n) => {
|
|
2593
|
-
const r = e.getSchema().relations[t].model, { data: o } = await
|
|
2594
|
-
return a + l > d ?
|
|
2595
|
-
},
|
|
2596
|
-
const o = e.getSchema().relations[t], s =
|
|
2597
|
-
return
|
|
2598
|
-
},
|
|
2615
|
+
const r = e.getSchema().relations[t].model, { data: o } = await we().make(r).get(), s = o.all().filter((c) => !n.find((u) => u.getKey() === c.getKey())), a = s.length, l = n.length, d = 15;
|
|
2616
|
+
return a + l > d ? W([...n, ...s.slice(0, d - l)]) : W([...n, ...s]);
|
|
2617
|
+
}, ka = async (e, t, n = "", r) => {
|
|
2618
|
+
const o = e.getSchema().relations[t], s = we().make(o.model), a = s.getSchema().primaryKey, { data: l } = await s.searchBy(n).get();
|
|
2619
|
+
return W([...r, ...l]).unique(a);
|
|
2620
|
+
}, Ta = () => {
|
|
2599
2621
|
const e = v(), t = te(), {
|
|
2600
2622
|
key: n,
|
|
2601
2623
|
value: r,
|
|
2602
2624
|
setValue: o
|
|
2603
|
-
} =
|
|
2625
|
+
} = m.useContext(ge), [s, a] = m.useState(!1), [l, d] = m.useState(""), [c, u] = m.useState(W([])), [h, y] = m.useState([]), S = m.useMemo(
|
|
2604
2626
|
() => s && c.count() === 0,
|
|
2605
2627
|
[s, c]
|
|
2606
|
-
), b = async (
|
|
2607
|
-
d(g), J.isEmpty(g) || u(await
|
|
2628
|
+
), b = async (p, g) => {
|
|
2629
|
+
d(g), J.isEmpty(g) || u(await ka(t, n, g, W(h)));
|
|
2608
2630
|
};
|
|
2609
|
-
return
|
|
2631
|
+
return m.useEffect(() => {
|
|
2610
2632
|
r.length > 0 && (async () => y(await Ca(t, n, r)))();
|
|
2611
|
-
}, []),
|
|
2612
|
-
let
|
|
2633
|
+
}, []), m.useEffect(() => {
|
|
2634
|
+
let p = !0;
|
|
2613
2635
|
if (S)
|
|
2614
|
-
return (async () =>
|
|
2615
|
-
|
|
2636
|
+
return (async () => p && u(await hn(t, n, h)))(), () => {
|
|
2637
|
+
p = !1;
|
|
2616
2638
|
};
|
|
2617
|
-
}, [S]),
|
|
2618
|
-
o(h.map((
|
|
2639
|
+
}, [S]), m.useEffect(() => {
|
|
2640
|
+
o(h.map((p) => p.getKey())), J.isEmpty(l) ? (async () => u(await hn(t, n, h)))() : u(W([]));
|
|
2619
2641
|
}, [h]), /* @__PURE__ */ i(
|
|
2620
2642
|
_r,
|
|
2621
2643
|
{
|
|
@@ -2628,19 +2650,19 @@ const hn = async (e, t, n) => {
|
|
|
2628
2650
|
a(!1);
|
|
2629
2651
|
},
|
|
2630
2652
|
value: h,
|
|
2631
|
-
onChange: (
|
|
2653
|
+
onChange: (p, g) => {
|
|
2632
2654
|
y(g);
|
|
2633
2655
|
},
|
|
2634
2656
|
inputValue: l,
|
|
2635
2657
|
onInputChange: b,
|
|
2636
2658
|
options: c.all() || [],
|
|
2637
|
-
getOptionLabel: (
|
|
2638
|
-
isOptionEqualToValue: (
|
|
2639
|
-
filterOptions: (
|
|
2640
|
-
renderInput: (
|
|
2659
|
+
getOptionLabel: (p) => p.getLabel(),
|
|
2660
|
+
isOptionEqualToValue: (p, g) => p.getKey() === g.getKey(),
|
|
2661
|
+
filterOptions: (p) => p,
|
|
2662
|
+
renderInput: (p) => /* @__PURE__ */ i(
|
|
2641
2663
|
Da,
|
|
2642
2664
|
{
|
|
2643
|
-
params:
|
|
2665
|
+
params: p,
|
|
2644
2666
|
loading: S
|
|
2645
2667
|
}
|
|
2646
2668
|
),
|
|
@@ -2654,13 +2676,13 @@ const hn = async (e, t, n) => {
|
|
|
2654
2676
|
}, Da = ({ params: e, loading: t }) => {
|
|
2655
2677
|
const { t: n } = L();
|
|
2656
2678
|
return /* @__PURE__ */ i(
|
|
2657
|
-
|
|
2679
|
+
fe,
|
|
2658
2680
|
{
|
|
2659
2681
|
...e,
|
|
2660
2682
|
label: n("Value"),
|
|
2661
2683
|
InputProps: {
|
|
2662
2684
|
...e.InputProps,
|
|
2663
|
-
endAdornment: /* @__PURE__ */ w(
|
|
2685
|
+
endAdornment: /* @__PURE__ */ w(m.Fragment, { children: [
|
|
2664
2686
|
t ? /* @__PURE__ */ i(Hr, { color: "inherit", size: 20 }) : null,
|
|
2665
2687
|
e.InputProps.endAdornment
|
|
2666
2688
|
] })
|
|
@@ -2668,11 +2690,11 @@ const hn = async (e, t, n) => {
|
|
|
2668
2690
|
}
|
|
2669
2691
|
);
|
|
2670
2692
|
}, tt = ({ index: e = null }) => {
|
|
2671
|
-
const { t } = L(), n = v(), r =
|
|
2693
|
+
const { t } = L(), n = v(), r = T("filter"), {
|
|
2672
2694
|
type: o,
|
|
2673
2695
|
value: s,
|
|
2674
2696
|
setValue: a
|
|
2675
|
-
} =
|
|
2697
|
+
} = m.useContext(ge), d = r.getInputType(o) === "datetime-local" ? 230 : 167.5, c = e !== null ? `${t("Date")} ${e + 1}` : `${t("Date")}`, u = m.useMemo(
|
|
2676
2698
|
() => e !== null ? s[e] : s,
|
|
2677
2699
|
[s]
|
|
2678
2700
|
), h = (y) => {
|
|
@@ -2682,7 +2704,7 @@ const hn = async (e, t, n) => {
|
|
|
2682
2704
|
} : y.target.value);
|
|
2683
2705
|
};
|
|
2684
2706
|
return /* @__PURE__ */ i(
|
|
2685
|
-
|
|
2707
|
+
fe,
|
|
2686
2708
|
{
|
|
2687
2709
|
type: r.getInputType(o),
|
|
2688
2710
|
label: c,
|
|
@@ -2693,7 +2715,7 @@ const hn = async (e, t, n) => {
|
|
|
2693
2715
|
}
|
|
2694
2716
|
);
|
|
2695
2717
|
}, Oa = () => {
|
|
2696
|
-
const e = v(), { value: t, setValue: n } =
|
|
2718
|
+
const e = v(), { value: t, setValue: n } = m.useContext(ge);
|
|
2697
2719
|
return /* @__PURE__ */ w(B, { children: [
|
|
2698
2720
|
/* @__PURE__ */ i(
|
|
2699
2721
|
zr,
|
|
@@ -2710,11 +2732,11 @@ const hn = async (e, t, n) => {
|
|
|
2710
2732
|
e && /* @__PURE__ */ i(H, { width: 325 })
|
|
2711
2733
|
] });
|
|
2712
2734
|
}, nt = ({ index: e = null }) => {
|
|
2713
|
-
const { t } = L(), n = v(), r =
|
|
2735
|
+
const { t } = L(), n = v(), r = T("filter"), {
|
|
2714
2736
|
type: o,
|
|
2715
2737
|
value: s,
|
|
2716
2738
|
setValue: a
|
|
2717
|
-
} =
|
|
2739
|
+
} = m.useContext(ge), l = e !== null ? `${t("Value")} ${e + 1}` : `${t("Value")}`, d = m.useMemo(
|
|
2718
2740
|
() => e !== null ? s[e] : s,
|
|
2719
2741
|
[s]
|
|
2720
2742
|
), c = (u) => {
|
|
@@ -2724,7 +2746,7 @@ const hn = async (e, t, n) => {
|
|
|
2724
2746
|
} : u.target.value);
|
|
2725
2747
|
};
|
|
2726
2748
|
return /* @__PURE__ */ i(
|
|
2727
|
-
|
|
2749
|
+
fe,
|
|
2728
2750
|
{
|
|
2729
2751
|
type: r.getInputType(o),
|
|
2730
2752
|
label: l,
|
|
@@ -2735,7 +2757,7 @@ const hn = async (e, t, n) => {
|
|
|
2735
2757
|
}
|
|
2736
2758
|
);
|
|
2737
2759
|
}, rt = () => {
|
|
2738
|
-
const e = v(), t =
|
|
2760
|
+
const e = v(), t = T("filter"), { type: n, operator: r } = m.useContext(ge), o = m.useMemo(
|
|
2739
2761
|
() => ["between", "notBetween"].includes(r),
|
|
2740
2762
|
[r]
|
|
2741
2763
|
);
|
|
@@ -2760,14 +2782,14 @@ const hn = async (e, t, n) => {
|
|
|
2760
2782
|
case "datetime-local":
|
|
2761
2783
|
return /* @__PURE__ */ i(tt, {});
|
|
2762
2784
|
case "autocomplete":
|
|
2763
|
-
return /* @__PURE__ */ i(
|
|
2785
|
+
return /* @__PURE__ */ i(Ta, {});
|
|
2764
2786
|
case "boolean":
|
|
2765
2787
|
return /* @__PURE__ */ i(Oa, {});
|
|
2766
2788
|
default:
|
|
2767
2789
|
return /* @__PURE__ */ i(nt, {});
|
|
2768
2790
|
}
|
|
2769
2791
|
}, Ra = ({ index: e, column: t }) => {
|
|
2770
|
-
const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s =
|
|
2792
|
+
const { t: n } = L(), r = v(), o = z("breakpoint", "md"), s = T("filter"), a = m.useMemo(() => s.getMatchingOperators(t), [t]), {
|
|
2771
2793
|
columns: l,
|
|
2772
2794
|
key: d,
|
|
2773
2795
|
setKey: c,
|
|
@@ -2776,15 +2798,15 @@ const hn = async (e, t, n) => {
|
|
|
2776
2798
|
type: y,
|
|
2777
2799
|
setType: S,
|
|
2778
2800
|
value: b,
|
|
2779
|
-
setValue:
|
|
2801
|
+
setValue: p,
|
|
2780
2802
|
isRelation: g,
|
|
2781
|
-
setIsRelation:
|
|
2782
|
-
handleKey:
|
|
2803
|
+
setIsRelation: A,
|
|
2804
|
+
handleKey: x,
|
|
2783
2805
|
handleOperator: E,
|
|
2784
2806
|
handleRemoveColumn: P
|
|
2785
2807
|
} = Ea(e, t), O = ["boolean"].includes(s.getInputType(y));
|
|
2786
2808
|
return /* @__PURE__ */ i(
|
|
2787
|
-
|
|
2809
|
+
ge.Provider,
|
|
2788
2810
|
{
|
|
2789
2811
|
value: {
|
|
2790
2812
|
key: d,
|
|
@@ -2794,9 +2816,9 @@ const hn = async (e, t, n) => {
|
|
|
2794
2816
|
operator: u,
|
|
2795
2817
|
setOperator: h,
|
|
2796
2818
|
value: b,
|
|
2797
|
-
setValue:
|
|
2819
|
+
setValue: p,
|
|
2798
2820
|
isRelation: g,
|
|
2799
|
-
setIsRelation:
|
|
2821
|
+
setIsRelation: A
|
|
2800
2822
|
},
|
|
2801
2823
|
children: /* @__PURE__ */ w(
|
|
2802
2824
|
Q,
|
|
@@ -2854,7 +2876,7 @@ const hn = async (e, t, n) => {
|
|
|
2854
2876
|
id: "filter-column-select",
|
|
2855
2877
|
value: d,
|
|
2856
2878
|
label: n("Column"),
|
|
2857
|
-
onChange:
|
|
2879
|
+
onChange: x,
|
|
2858
2880
|
size: "small",
|
|
2859
2881
|
children: l.map(({ key: R, label: D }) => /* @__PURE__ */ i(
|
|
2860
2882
|
se,
|
|
@@ -2938,12 +2960,12 @@ const hn = async (e, t, n) => {
|
|
|
2938
2960
|
}
|
|
2939
2961
|
);
|
|
2940
2962
|
}, pn = ({ dialog: e = !1 }) => {
|
|
2941
|
-
const { t } = L(), n = v(), r = z("breakpoint", "md"), o =
|
|
2963
|
+
const { t } = L(), n = v(), r = z("breakpoint", "md"), o = T("filter"), {
|
|
2942
2964
|
columnsFilter: s,
|
|
2943
2965
|
setColumnsFilter: a,
|
|
2944
2966
|
handleApplyFilters: l,
|
|
2945
2967
|
clearFilters: d
|
|
2946
|
-
} =
|
|
2968
|
+
} = m.useContext(Ht), c = () => {
|
|
2947
2969
|
a((u) => [
|
|
2948
2970
|
...u,
|
|
2949
2971
|
{
|
|
@@ -3069,7 +3091,7 @@ function Pa(e, t) {
|
|
|
3069
3091
|
}), n);
|
|
3070
3092
|
}
|
|
3071
3093
|
const va = (e) => {
|
|
3072
|
-
const t =
|
|
3094
|
+
const t = T("filter"), n = new URLSearchParams();
|
|
3073
3095
|
return e.forEach((r) => {
|
|
3074
3096
|
const { key: o, operator: s, value: a, type: l } = r;
|
|
3075
3097
|
let d = `:${s}`;
|
|
@@ -3096,31 +3118,31 @@ const va = (e) => {
|
|
|
3096
3118
|
}
|
|
3097
3119
|
}), n;
|
|
3098
3120
|
}, Fa = () => {
|
|
3099
|
-
const { t: e } = L(), t =
|
|
3100
|
-
d(
|
|
3121
|
+
const { t: e } = L(), t = T("filter"), n = v(), r = te(), [o, s] = G(), a = m.useMemo(() => "where" in mn.toObject(o), [o]), [l, d] = m.useState(null), [c, u] = m.useState([]), h = !!l, y = m.useMemo(() => t.getFilterableColumns(r), [r]), S = (x) => {
|
|
3122
|
+
d(x.currentTarget);
|
|
3101
3123
|
}, b = () => {
|
|
3102
3124
|
d(null), setTimeout(() => {
|
|
3103
3125
|
u([]);
|
|
3104
3126
|
}, 300);
|
|
3105
|
-
},
|
|
3127
|
+
}, p = () => {
|
|
3106
3128
|
g();
|
|
3107
|
-
const
|
|
3108
|
-
s(
|
|
3129
|
+
const x = va(c);
|
|
3130
|
+
s(x, { replace: !0 }), b();
|
|
3109
3131
|
}, g = () => {
|
|
3110
|
-
s((
|
|
3111
|
-
const E = new URLSearchParams(
|
|
3112
|
-
for (const [P] of
|
|
3132
|
+
s((x) => {
|
|
3133
|
+
const E = new URLSearchParams(x);
|
|
3134
|
+
for (const [P] of x.entries())
|
|
3113
3135
|
P.startsWith("where[") && E.delete(P);
|
|
3114
3136
|
return E;
|
|
3115
3137
|
});
|
|
3116
|
-
},
|
|
3138
|
+
}, A = () => {
|
|
3117
3139
|
g(), b(), setTimeout(() => {
|
|
3118
3140
|
u([]);
|
|
3119
3141
|
}, 300);
|
|
3120
3142
|
};
|
|
3121
|
-
return
|
|
3122
|
-
const
|
|
3123
|
-
u(
|
|
3143
|
+
return m.useEffect(() => {
|
|
3144
|
+
const x = Pa(y, o);
|
|
3145
|
+
u(x);
|
|
3124
3146
|
}, [y, o, l]), /* @__PURE__ */ w(
|
|
3125
3147
|
Ht.Provider,
|
|
3126
3148
|
{
|
|
@@ -3132,9 +3154,9 @@ const va = (e) => {
|
|
|
3132
3154
|
setColumnsFilter: u,
|
|
3133
3155
|
searchParams: o,
|
|
3134
3156
|
setSearchParams: s,
|
|
3135
|
-
handleApplyFilters:
|
|
3157
|
+
handleApplyFilters: p,
|
|
3136
3158
|
clearSearchParams: g,
|
|
3137
|
-
clearFilters:
|
|
3159
|
+
clearFilters: A
|
|
3138
3160
|
},
|
|
3139
3161
|
children: [
|
|
3140
3162
|
/* @__PURE__ */ i(
|
|
@@ -3155,7 +3177,7 @@ const va = (e) => {
|
|
|
3155
3177
|
}
|
|
3156
3178
|
),
|
|
3157
3179
|
n ? /* @__PURE__ */ i(
|
|
3158
|
-
|
|
3180
|
+
Vr,
|
|
3159
3181
|
{
|
|
3160
3182
|
id: "model-filter-popover",
|
|
3161
3183
|
open: h,
|
|
@@ -3174,7 +3196,7 @@ const va = (e) => {
|
|
|
3174
3196
|
onClose: b,
|
|
3175
3197
|
fullWidth: !0,
|
|
3176
3198
|
children: [
|
|
3177
|
-
/* @__PURE__ */ w(
|
|
3199
|
+
/* @__PURE__ */ w(kt, { children: [
|
|
3178
3200
|
e("Filter :model", { model: r.plural() }),
|
|
3179
3201
|
/* @__PURE__ */ i(
|
|
3180
3202
|
q,
|
|
@@ -3185,12 +3207,12 @@ const va = (e) => {
|
|
|
3185
3207
|
}
|
|
3186
3208
|
)
|
|
3187
3209
|
] }),
|
|
3188
|
-
/* @__PURE__ */ i(
|
|
3210
|
+
/* @__PURE__ */ i(Tt, { dividers: !0, children: /* @__PURE__ */ i(pn, { dialog: !0 }) }),
|
|
3189
3211
|
/* @__PURE__ */ w(Dt, { children: [
|
|
3190
3212
|
/* @__PURE__ */ i(
|
|
3191
3213
|
M,
|
|
3192
3214
|
{
|
|
3193
|
-
onClick:
|
|
3215
|
+
onClick: A,
|
|
3194
3216
|
sx: { mr: "auto" },
|
|
3195
3217
|
children: e("Clear")
|
|
3196
3218
|
}
|
|
@@ -3199,7 +3221,7 @@ const va = (e) => {
|
|
|
3199
3221
|
M,
|
|
3200
3222
|
{
|
|
3201
3223
|
variant: "contained",
|
|
3202
|
-
onClick:
|
|
3224
|
+
onClick: p,
|
|
3203
3225
|
disabled: t.checkIfCanApplyFilters(c),
|
|
3204
3226
|
children: e("Apply")
|
|
3205
3227
|
}
|
|
@@ -3211,20 +3233,20 @@ const va = (e) => {
|
|
|
3211
3233
|
]
|
|
3212
3234
|
}
|
|
3213
3235
|
);
|
|
3214
|
-
}, zt =
|
|
3236
|
+
}, zt = m.createContext({
|
|
3215
3237
|
columns: [],
|
|
3216
3238
|
columnCount: 0,
|
|
3217
|
-
selected:
|
|
3239
|
+
selected: W([]),
|
|
3218
3240
|
massActions: [],
|
|
3219
|
-
items:
|
|
3241
|
+
items: W([]),
|
|
3220
3242
|
error: new Error("Trying to access TableContext outside of TableProvider"),
|
|
3221
3243
|
Model: null
|
|
3222
3244
|
});
|
|
3223
|
-
function
|
|
3245
|
+
function Vt() {
|
|
3224
3246
|
const {
|
|
3225
3247
|
selected: e,
|
|
3226
3248
|
items: t
|
|
3227
|
-
} =
|
|
3249
|
+
} = m.useContext(zt), n = yn(e), r = () => {
|
|
3228
3250
|
e.splice(0, e.count());
|
|
3229
3251
|
}, o = (c) => {
|
|
3230
3252
|
const u = e.search(c);
|
|
@@ -3253,13 +3275,13 @@ function Wt() {
|
|
|
3253
3275
|
};
|
|
3254
3276
|
}
|
|
3255
3277
|
function ae() {
|
|
3256
|
-
return
|
|
3278
|
+
return m.useContext(zt);
|
|
3257
3279
|
}
|
|
3258
3280
|
function La(e) {
|
|
3259
|
-
const [t, n] =
|
|
3281
|
+
const [t, n] = m.useState(""), { selected: r } = Vt(), { t: o } = L(), s = qt(), { massActions: a } = ae(), l = (c) => {
|
|
3260
3282
|
n(c.target.value);
|
|
3261
3283
|
};
|
|
3262
|
-
if (
|
|
3284
|
+
if (m.useEffect(() => {
|
|
3263
3285
|
r.isEmpty() && n("");
|
|
3264
3286
|
}, [r]), a.length === 0)
|
|
3265
3287
|
return null;
|
|
@@ -3335,7 +3357,7 @@ const Ba = () => {
|
|
|
3335
3357
|
children: /* @__PURE__ */ i(Rn, {})
|
|
3336
3358
|
}
|
|
3337
3359
|
);
|
|
3338
|
-
},
|
|
3360
|
+
}, We = m.forwardRef(({ to: e, children: t, ...n }, r) => /* @__PURE__ */ i(
|
|
3339
3361
|
lt,
|
|
3340
3362
|
{
|
|
3341
3363
|
component: Pe,
|
|
@@ -3346,38 +3368,38 @@ const Ba = () => {
|
|
|
3346
3368
|
children: t
|
|
3347
3369
|
}
|
|
3348
3370
|
));
|
|
3349
|
-
|
|
3371
|
+
We.displayName = "Link";
|
|
3350
3372
|
const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */ i(B, { children: {
|
|
3351
3373
|
"« Previous": /* @__PURE__ */ i(je, {}),
|
|
3352
3374
|
"Next »": /* @__PURE__ */ i(Ue, {}),
|
|
3353
3375
|
"Last »": /* @__PURE__ */ i(Pn, {}),
|
|
3354
3376
|
"« First": /* @__PURE__ */ i(vn, {})
|
|
3355
3377
|
}[e] || e }) : /* @__PURE__ */ i(B, { children: e }), Ma = ({ variant: e = "default", ...t }) => {
|
|
3356
|
-
const n = e === "default", [r, o] = G(), [s, a] =
|
|
3378
|
+
const n = e === "default", [r, o] = G(), [s, a] = m.useState(r.get("page") || "1"), {
|
|
3357
3379
|
links: l,
|
|
3358
3380
|
meta: {
|
|
3359
3381
|
current_page: d = 1,
|
|
3360
3382
|
links: c = [],
|
|
3361
3383
|
last_page: u = 1
|
|
3362
3384
|
} = {}
|
|
3363
|
-
} =
|
|
3385
|
+
} = xe(), {
|
|
3364
3386
|
first: h,
|
|
3365
3387
|
prev: y,
|
|
3366
3388
|
next: S,
|
|
3367
3389
|
last: b
|
|
3368
|
-
} = l || {},
|
|
3369
|
-
|
|
3390
|
+
} = l || {}, p = (A) => {
|
|
3391
|
+
A.preventDefault(), o((x) => (x.set("page", s || "1"), x));
|
|
3370
3392
|
}, g = [
|
|
3371
3393
|
{ url: d > 1 ? h : null, label: "« First", active: !1 },
|
|
3372
3394
|
{ url: y, label: "« Previous", active: !1 },
|
|
3373
3395
|
{
|
|
3374
3396
|
element: /* @__PURE__ */ i(
|
|
3375
|
-
|
|
3397
|
+
Ar,
|
|
3376
3398
|
{
|
|
3377
|
-
onSubmit:
|
|
3399
|
+
onSubmit: p,
|
|
3378
3400
|
preventScrollReset: !0,
|
|
3379
3401
|
children: /* @__PURE__ */ i(
|
|
3380
|
-
|
|
3402
|
+
fe,
|
|
3381
3403
|
{
|
|
3382
3404
|
size: "small",
|
|
3383
3405
|
type: "number",
|
|
@@ -3395,11 +3417,11 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3395
3417
|
value: s,
|
|
3396
3418
|
error: Number(s) > u,
|
|
3397
3419
|
helperText: Number(s) > u ? `Max ${u}` : void 0,
|
|
3398
|
-
onChange: (
|
|
3399
|
-
!Number.isNaN(Number(
|
|
3420
|
+
onChange: (A) => {
|
|
3421
|
+
!Number.isNaN(Number(A.target.value)) && Number(A.target.value) > 0 && a(A.target.value), A.target.value === "" && a("");
|
|
3400
3422
|
},
|
|
3401
|
-
onBlur: (
|
|
3402
|
-
o((
|
|
3423
|
+
onBlur: (A) => {
|
|
3424
|
+
o((x) => (x.set("page", A.target.value || "1"), x), { replace: !0 });
|
|
3403
3425
|
},
|
|
3404
3426
|
disabled: u === 1,
|
|
3405
3427
|
"aria-label": "Page number"
|
|
@@ -3412,7 +3434,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3412
3434
|
{ url: S, label: "Next »", active: !1 },
|
|
3413
3435
|
{ url: d < u ? b : null, label: "Last »", active: !1 }
|
|
3414
3436
|
];
|
|
3415
|
-
return
|
|
3437
|
+
return m.useEffect(() => {
|
|
3416
3438
|
d && a(String(d));
|
|
3417
3439
|
}, [d]), /* @__PURE__ */ i(
|
|
3418
3440
|
N,
|
|
@@ -3422,10 +3444,10 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3422
3444
|
justifyContent: "center",
|
|
3423
3445
|
alignItems: "center",
|
|
3424
3446
|
...t,
|
|
3425
|
-
children: (n ? c : g).map((
|
|
3447
|
+
children: (n ? c : g).map((A, x) => A.element || /* @__PURE__ */ i(
|
|
3426
3448
|
M,
|
|
3427
3449
|
{
|
|
3428
|
-
variant:
|
|
3450
|
+
variant: A.active ? "contained" : "text",
|
|
3429
3451
|
color: "primary",
|
|
3430
3452
|
size: "small",
|
|
3431
3453
|
sx: {
|
|
@@ -3434,12 +3456,12 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3434
3456
|
height: 32,
|
|
3435
3457
|
borderRadius: "50%"
|
|
3436
3458
|
},
|
|
3437
|
-
disabled: !
|
|
3438
|
-
component:
|
|
3439
|
-
to:
|
|
3440
|
-
children: /* @__PURE__ */ i(Ia, { label:
|
|
3459
|
+
disabled: !A.url,
|
|
3460
|
+
component: We,
|
|
3461
|
+
to: A.url,
|
|
3462
|
+
children: /* @__PURE__ */ i(Ia, { label: A.label })
|
|
3441
3463
|
},
|
|
3442
|
-
|
|
3464
|
+
x
|
|
3443
3465
|
))
|
|
3444
3466
|
}
|
|
3445
3467
|
);
|
|
@@ -3450,7 +3472,7 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3450
3472
|
from: n = 0,
|
|
3451
3473
|
to: r = 0
|
|
3452
3474
|
} = {}
|
|
3453
|
-
} =
|
|
3475
|
+
} = xe();
|
|
3454
3476
|
return /* @__PURE__ */ i($, { variant: "caption", noWrap: !0, children: e(":from–:to of :total", {
|
|
3455
3477
|
from: n,
|
|
3456
3478
|
to: r,
|
|
@@ -3461,13 +3483,13 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3461
3483
|
meta: {
|
|
3462
3484
|
per_page: t = 15
|
|
3463
3485
|
} = {}
|
|
3464
|
-
} =
|
|
3486
|
+
} = xe(), [, n] = G(), r = (s) => {
|
|
3465
3487
|
n((a) => {
|
|
3466
3488
|
const l = new URLSearchParams(a);
|
|
3467
3489
|
return l.set("per_page", s.target.value.toString()), l;
|
|
3468
3490
|
});
|
|
3469
3491
|
}, o = Ct(
|
|
3470
|
-
|
|
3492
|
+
T("cms"),
|
|
3471
3493
|
"perPageOptions",
|
|
3472
3494
|
[15, 30, 75, 150]
|
|
3473
3495
|
);
|
|
@@ -3516,8 +3538,8 @@ const Ia = ({ label: e }) => isNaN(e) || isNaN(parseFloat(e)) ? /* @__PURE__ */
|
|
|
3516
3538
|
);
|
|
3517
3539
|
};
|
|
3518
3540
|
function Ua(e, t) {
|
|
3519
|
-
const [n, r] =
|
|
3520
|
-
return
|
|
3541
|
+
const [n, r] = m.useState(!1);
|
|
3542
|
+
return m.useEffect(() => {
|
|
3521
3543
|
const o = /* @__PURE__ */ new Set(), s = (l) => {
|
|
3522
3544
|
o.add(l.key), e.every((d) => o.has(d)) && (r(!0), t && t());
|
|
3523
3545
|
}, a = (l) => {
|
|
@@ -3528,7 +3550,7 @@ function Ua(e, t) {
|
|
|
3528
3550
|
};
|
|
3529
3551
|
}, [e, t]), n;
|
|
3530
3552
|
}
|
|
3531
|
-
const qa = Z(
|
|
3553
|
+
const qa = Z(fe)(({ theme: e }) => ({
|
|
3532
3554
|
"& .MuiInputBase-root": {
|
|
3533
3555
|
backgroundColor: e.palette.background.paper
|
|
3534
3556
|
}
|
|
@@ -3539,8 +3561,8 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3539
3561
|
return e ? r.set("q", e) : r.delete("q"), r;
|
|
3540
3562
|
});
|
|
3541
3563
|
}, 500), Ha = () => {
|
|
3542
|
-
const [e, t] = G(), n = e.get("q") || "", [r, o] =
|
|
3543
|
-
|
|
3564
|
+
const [e, t] = G(), n = e.get("q") || "", [r, o] = m.useState(n), [s, a] = m.useState(!1), l = m.useRef(null), { t: d } = L();
|
|
3565
|
+
m.useEffect(() => {
|
|
3544
3566
|
o(n);
|
|
3545
3567
|
}, [n]);
|
|
3546
3568
|
const c = (y) => {
|
|
@@ -3565,7 +3587,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3565
3587
|
}
|
|
3566
3588
|
) }),
|
|
3567
3589
|
/* @__PURE__ */ i(
|
|
3568
|
-
|
|
3590
|
+
xn,
|
|
3569
3591
|
{
|
|
3570
3592
|
orientation: "horizontal",
|
|
3571
3593
|
in: u || s,
|
|
@@ -3602,26 +3624,26 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3602
3624
|
...t,
|
|
3603
3625
|
children: e
|
|
3604
3626
|
}
|
|
3605
|
-
),
|
|
3627
|
+
), Va = () => {
|
|
3606
3628
|
const { t: e } = L(), [t, n] = G(), {
|
|
3607
3629
|
columns: r,
|
|
3608
3630
|
Model: o
|
|
3609
|
-
} = ae(), s = t.get("order_by") || "", [a = "", l = ""] = s.split(":"), [d, c] =
|
|
3631
|
+
} = ae(), s = t.get("order_by") || "", [a = "", l = ""] = s.split(":"), [d, c] = m.useState(a), [u, h] = m.useState(l), [y, S] = m.useState(!1), b = () => {
|
|
3610
3632
|
S(!0);
|
|
3611
|
-
},
|
|
3633
|
+
}, p = () => {
|
|
3612
3634
|
S(!1), c(a), h(l);
|
|
3613
3635
|
}, g = () => {
|
|
3614
3636
|
if (!d || !u) {
|
|
3615
3637
|
S(!1);
|
|
3616
3638
|
return;
|
|
3617
3639
|
}
|
|
3618
|
-
n((
|
|
3619
|
-
const E = new URLSearchParams(
|
|
3640
|
+
n((x) => {
|
|
3641
|
+
const E = new URLSearchParams(x);
|
|
3620
3642
|
return E.set("order_by", `${d}:${u}`), E;
|
|
3621
3643
|
}), S(!1);
|
|
3622
|
-
},
|
|
3623
|
-
n((
|
|
3624
|
-
const E = new URLSearchParams(
|
|
3644
|
+
}, A = () => {
|
|
3645
|
+
n((x) => {
|
|
3646
|
+
const E = new URLSearchParams(x);
|
|
3625
3647
|
return E.delete("order_by"), E;
|
|
3626
3648
|
}), S(!1), c(""), h("");
|
|
3627
3649
|
};
|
|
@@ -3635,37 +3657,37 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3635
3657
|
children: /* @__PURE__ */ i(Fn, {})
|
|
3636
3658
|
}
|
|
3637
3659
|
) }),
|
|
3638
|
-
/* @__PURE__ */ w(Et, { open: y, onClose:
|
|
3639
|
-
/* @__PURE__ */ w(
|
|
3660
|
+
/* @__PURE__ */ w(Et, { open: y, onClose: p, fullWidth: !0, children: [
|
|
3661
|
+
/* @__PURE__ */ w(kt, { children: [
|
|
3640
3662
|
e("Sort :model", { model: o.plural() }),
|
|
3641
3663
|
/* @__PURE__ */ i(
|
|
3642
3664
|
q,
|
|
3643
3665
|
{
|
|
3644
|
-
onClick:
|
|
3666
|
+
onClick: p,
|
|
3645
3667
|
sx: { position: "absolute", right: 8, top: 8 },
|
|
3646
3668
|
children: /* @__PURE__ */ i(Ne, {})
|
|
3647
3669
|
}
|
|
3648
3670
|
)
|
|
3649
3671
|
] }),
|
|
3650
|
-
/* @__PURE__ */ w(
|
|
3672
|
+
/* @__PURE__ */ w(Tt, { dividers: !0, children: [
|
|
3651
3673
|
/* @__PURE__ */ w(
|
|
3652
3674
|
$t,
|
|
3653
3675
|
{
|
|
3654
3676
|
value: d,
|
|
3655
|
-
onChange: (
|
|
3656
|
-
c(
|
|
3677
|
+
onChange: (x) => {
|
|
3678
|
+
c(x.target.value), u || h("asc");
|
|
3657
3679
|
},
|
|
3658
3680
|
children: [
|
|
3659
3681
|
/* @__PURE__ */ i($, { variant: "caption", children: e("Column") }),
|
|
3660
3682
|
/* @__PURE__ */ i(ve, {}),
|
|
3661
|
-
|
|
3683
|
+
W(r).whereStrict("sortable", "!=", !1).map(({ key: x, label: E }) => /* @__PURE__ */ i(
|
|
3662
3684
|
Ke,
|
|
3663
3685
|
{
|
|
3664
|
-
value:
|
|
3686
|
+
value: x,
|
|
3665
3687
|
control: /* @__PURE__ */ i(Ye, {}),
|
|
3666
3688
|
label: E
|
|
3667
3689
|
},
|
|
3668
|
-
|
|
3690
|
+
x
|
|
3669
3691
|
))
|
|
3670
3692
|
]
|
|
3671
3693
|
}
|
|
@@ -3676,7 +3698,7 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3676
3698
|
$t,
|
|
3677
3699
|
{
|
|
3678
3700
|
value: u,
|
|
3679
|
-
onChange: (
|
|
3701
|
+
onChange: (x) => h(x.target.value),
|
|
3680
3702
|
children: [
|
|
3681
3703
|
/* @__PURE__ */ i(
|
|
3682
3704
|
Ke,
|
|
@@ -3705,20 +3727,20 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3705
3727
|
)
|
|
3706
3728
|
] }),
|
|
3707
3729
|
/* @__PURE__ */ w(Dt, { children: [
|
|
3708
|
-
/* @__PURE__ */ i(M, { onClick:
|
|
3730
|
+
/* @__PURE__ */ i(M, { onClick: A, sx: { mr: "auto" }, children: e("Clear") }),
|
|
3709
3731
|
/* @__PURE__ */ i(M, { onClick: g, variant: "contained", children: e("Apply") })
|
|
3710
3732
|
] })
|
|
3711
3733
|
] })
|
|
3712
3734
|
] });
|
|
3713
|
-
},
|
|
3714
|
-
const o = te(), s =
|
|
3735
|
+
}, Wa = ({ items: e, loading: t, children: n, error: r }) => {
|
|
3736
|
+
const o = te(), s = m.useMemo(() => W([]), [o, e]), [a] = G(), l = a.get("tab") ?? "all", d = m.useMemo(() => [
|
|
3715
3737
|
{
|
|
3716
3738
|
key: o.getSchema().labeledBy,
|
|
3717
|
-
label:
|
|
3739
|
+
label: k.human(o.getSchema().labeledBy)
|
|
3718
3740
|
}
|
|
3719
|
-
], [o]), c = v(), u =
|
|
3720
|
-
|
|
3721
|
-
`model${
|
|
3741
|
+
], [o]), c = v(), u = m.useMemo(() => T("cms").getMassActions(o, l), [o, l]), h = Ct(
|
|
3742
|
+
T("cms"),
|
|
3743
|
+
`model${k.studly(o.getSchemaName())}Columns`,
|
|
3722
3744
|
d
|
|
3723
3745
|
), S = (c ? h.length : 1) + (u.length > 0 ? 2 : 1), b = {
|
|
3724
3746
|
columns: h,
|
|
@@ -3738,12 +3760,12 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3738
3760
|
children: r,
|
|
3739
3761
|
...o
|
|
3740
3762
|
}) => /* @__PURE__ */ i(
|
|
3741
|
-
|
|
3763
|
+
Wa,
|
|
3742
3764
|
{
|
|
3743
3765
|
items: e,
|
|
3744
3766
|
loading: t,
|
|
3745
3767
|
error: n,
|
|
3746
|
-
children: /* @__PURE__ */ i(
|
|
3768
|
+
children: /* @__PURE__ */ i(Wr, { component: Ot, children: /* @__PURE__ */ i($r, { ...o, children: r }) })
|
|
3747
3769
|
}
|
|
3748
3770
|
), Ka = ({ children: e, ...t }) => {
|
|
3749
3771
|
const {
|
|
@@ -3754,20 +3776,20 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3754
3776
|
indeterminate: d,
|
|
3755
3777
|
allSelected: c,
|
|
3756
3778
|
handleSelectToggleAll: u
|
|
3757
|
-
} =
|
|
3779
|
+
} = Vt(), {
|
|
3758
3780
|
["ModelIndex.Table.ShrinkedCell"]: h
|
|
3759
|
-
} =
|
|
3760
|
-
l(S === g ? (
|
|
3761
|
-
const
|
|
3762
|
-
return b ? b === "desc" ? (
|
|
3763
|
-
} : (
|
|
3764
|
-
const
|
|
3765
|
-
return
|
|
3781
|
+
} = T("cms").getComponents(), y = a.get("order_by") || "", [S, b] = y.split(":"), p = (g) => () => {
|
|
3782
|
+
l(S === g ? (A) => {
|
|
3783
|
+
const x = new URLSearchParams(A);
|
|
3784
|
+
return b ? b === "desc" ? (x.delete("order_by"), x) : (x.set("order_by", `${g}:desc`), x) : (x.set("order_by", `${g}:asc`), x);
|
|
3785
|
+
} : (A) => {
|
|
3786
|
+
const x = new URLSearchParams(A);
|
|
3787
|
+
return x.set("order_by", `${g}:asc`), x;
|
|
3766
3788
|
});
|
|
3767
3789
|
};
|
|
3768
3790
|
return /* @__PURE__ */ w(Kr, { ...t, children: [
|
|
3769
3791
|
e,
|
|
3770
|
-
s && /* @__PURE__ */ w(
|
|
3792
|
+
s && /* @__PURE__ */ w(he, { children: [
|
|
3771
3793
|
n.length > 0 && /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
3772
3794
|
Pt,
|
|
3773
3795
|
{
|
|
@@ -3777,20 +3799,20 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3777
3799
|
disabled: o && o.count() === 0
|
|
3778
3800
|
}
|
|
3779
3801
|
) }),
|
|
3780
|
-
r.map(({ key: g, label:
|
|
3802
|
+
r.map(({ key: g, label: A, sortable: x = !0, ...E }) => /* @__PURE__ */ i(
|
|
3781
3803
|
ee,
|
|
3782
3804
|
{
|
|
3783
|
-
sortDirection:
|
|
3805
|
+
sortDirection: x && S === g && b || !1,
|
|
3784
3806
|
...E,
|
|
3785
3807
|
children: /* @__PURE__ */ w(
|
|
3786
3808
|
Yr,
|
|
3787
3809
|
{
|
|
3788
|
-
active:
|
|
3810
|
+
active: x && S === g,
|
|
3789
3811
|
direction: b,
|
|
3790
|
-
onClick:
|
|
3812
|
+
onClick: p(g),
|
|
3791
3813
|
children: [
|
|
3792
|
-
|
|
3793
|
-
|
|
3814
|
+
A,
|
|
3815
|
+
x && S === g ? /* @__PURE__ */ i(H, { component: "span", sx: { visibility: "hidden", display: "none" }, children: b === "desc" ? "sorted descending" : "sorted ascending" }) : null
|
|
3794
3816
|
]
|
|
3795
3817
|
}
|
|
3796
3818
|
)
|
|
@@ -3807,8 +3829,8 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3807
3829
|
items: n
|
|
3808
3830
|
} = ae(), r = v(), {
|
|
3809
3831
|
["ModelIndex.Table.ShrinkedCell"]: o
|
|
3810
|
-
} =
|
|
3811
|
-
return /* @__PURE__ */ i(B, { children: Array.from({ length: s }).map((a, l) => /* @__PURE__ */ w(
|
|
3832
|
+
} = T("cms").getComponents(), s = (n == null ? void 0 : n.count()) || 15;
|
|
3833
|
+
return /* @__PURE__ */ i(B, { children: Array.from({ length: s }).map((a, l) => /* @__PURE__ */ w(he, { children: [
|
|
3812
3834
|
e.length > 0 && /* @__PURE__ */ i(o, { children: /* @__PURE__ */ i(Pt, {}) }),
|
|
3813
3835
|
r && t.map(({ key: d, label: c, sortable: u, ...h }, y) => /* @__PURE__ */ i(ee, { ...h, children: /* @__PURE__ */ i(
|
|
3814
3836
|
Kt,
|
|
@@ -3835,8 +3857,8 @@ const qa = Z(Ae)(({ theme: e }) => ({
|
|
|
3835
3857
|
columnCount: a
|
|
3836
3858
|
} = ae(), {
|
|
3837
3859
|
["ModelIndex.StaticActions"]: l
|
|
3838
|
-
} =
|
|
3839
|
-
return /* @__PURE__ */ i(Jr, { ...t, children: s || !(o != null && o.every((c) => c.getType() === n.getSchemaName())) ? /* @__PURE__ */ i(Ya, {}) : o && o.count() ? d : /* @__PURE__ */ i(
|
|
3860
|
+
} = T("cms").getComponents(), d = m.isValidElement(e) ? e : (o || W([])).map(e);
|
|
3861
|
+
return /* @__PURE__ */ i(Jr, { ...t, children: s || !(o != null && o.every((c) => c.getType() === n.getSchemaName())) ? /* @__PURE__ */ i(Ya, {}) : o && o.count() ? d : /* @__PURE__ */ i(he, { children: /* @__PURE__ */ w(ee, { colSpan: a, sx: { textAlign: "center", py: 10 }, children: [
|
|
3840
3862
|
/* @__PURE__ */ i($, { children: r("No :model found", {
|
|
3841
3863
|
model: n.plural().toLocaleLowerCase()
|
|
3842
3864
|
}) }),
|
|
@@ -3849,14 +3871,14 @@ class Ga {
|
|
|
3849
3871
|
return "cms";
|
|
3850
3872
|
}
|
|
3851
3873
|
}
|
|
3852
|
-
const I = St(Ga,
|
|
3874
|
+
const I = St(Ga, xt), de = Z($)(() => ({
|
|
3853
3875
|
whiteSpace: "nowrap",
|
|
3854
3876
|
overflow: "hidden",
|
|
3855
3877
|
textOverflow: "ellipsis",
|
|
3856
3878
|
"& label": {
|
|
3857
3879
|
fontWeight: "bold"
|
|
3858
3880
|
}
|
|
3859
|
-
})), Za = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(oe("app.locale", "en")) }) : typeof e == "object" && !
|
|
3881
|
+
})), Za = ({ content: e }) => ["string", "number"].includes(typeof e) ? /* @__PURE__ */ i(de, { children: e }) : e instanceof Date ? /* @__PURE__ */ i(de, { children: e.toLocaleString(oe("app.locale", "en")) }) : typeof e == "object" && !m.isValidElement(e) ? /* @__PURE__ */ i(de, { children: JSON.stringify(e) }) : /* @__PURE__ */ i(m.Fragment, { children: e }), Xa = ({ label: e, content: t }) => ["string", "number"].includes(typeof t) ? /* @__PURE__ */ w(de, { children: [
|
|
3860
3882
|
/* @__PURE__ */ w("label", { children: [
|
|
3861
3883
|
e,
|
|
3862
3884
|
":"
|
|
@@ -3869,14 +3891,14 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3869
3891
|
":"
|
|
3870
3892
|
] }),
|
|
3871
3893
|
t.toLocaleString(oe("app.locale", "en"))
|
|
3872
|
-
] }) : typeof t == "object" && !
|
|
3894
|
+
] }) : typeof t == "object" && !m.isValidElement(t) ? /* @__PURE__ */ w(de, { children: [
|
|
3873
3895
|
/* @__PURE__ */ w("label", { children: [
|
|
3874
3896
|
e,
|
|
3875
3897
|
":"
|
|
3876
3898
|
] }),
|
|
3877
3899
|
" ",
|
|
3878
3900
|
JSON.stringify(t)
|
|
3879
|
-
] }) : /* @__PURE__ */ w(
|
|
3901
|
+
] }) : /* @__PURE__ */ w(m.Fragment, { children: [
|
|
3880
3902
|
/* @__PURE__ */ i($, { sx: { display: "inline" }, children: /* @__PURE__ */ w("b", { children: [
|
|
3881
3903
|
e,
|
|
3882
3904
|
":"
|
|
@@ -3884,9 +3906,9 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3884
3906
|
" ",
|
|
3885
3907
|
t
|
|
3886
3908
|
] }), Qa = ({ item: e, ...t }) => {
|
|
3887
|
-
const n = v(), r =
|
|
3909
|
+
const n = v(), r = At(), o = te(), { massActions: s, columns: a } = ae(), l = m.useMemo(() => a.map((y) => ({
|
|
3888
3910
|
...y,
|
|
3889
|
-
content: I[`model${
|
|
3911
|
+
content: I[`model${k.studly(e.getType())}Get${k.studly(y.key)}Content`](J.get(e, y.key), e)
|
|
3890
3912
|
//
|
|
3891
3913
|
})), [a, e]), {
|
|
3892
3914
|
["ModelIndex.Table.ShrinkedCell"]: d,
|
|
@@ -3894,9 +3916,9 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3894
3916
|
} = I.getComponents(), {
|
|
3895
3917
|
isSelected: u,
|
|
3896
3918
|
handleSelectToggle: h
|
|
3897
|
-
} =
|
|
3919
|
+
} = Vt();
|
|
3898
3920
|
return /* @__PURE__ */ w(
|
|
3899
|
-
|
|
3921
|
+
he,
|
|
3900
3922
|
{
|
|
3901
3923
|
...t,
|
|
3902
3924
|
sx: { cursor: e.deletedAt ? "default" : "pointer" },
|
|
@@ -3910,18 +3932,18 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3910
3932
|
onChange: () => h(e)
|
|
3911
3933
|
}
|
|
3912
3934
|
) }),
|
|
3913
|
-
n && l.map(({ key: y, label: S, sortable: b, content:
|
|
3935
|
+
n && l.map(({ key: y, label: S, sortable: b, content: p, ...g }) => /* @__PURE__ */ i(
|
|
3914
3936
|
ee,
|
|
3915
3937
|
{
|
|
3916
3938
|
...g,
|
|
3917
3939
|
onClick: () => {
|
|
3918
|
-
e.deletedAt || r(`/${
|
|
3940
|
+
e.deletedAt || r(`/${k.kebab(o.plural())}/${e.getKey()}`);
|
|
3919
3941
|
},
|
|
3920
3942
|
children: /* @__PURE__ */ i(
|
|
3921
3943
|
Za,
|
|
3922
3944
|
{
|
|
3923
3945
|
label: S,
|
|
3924
|
-
content:
|
|
3946
|
+
content: p
|
|
3925
3947
|
}
|
|
3926
3948
|
)
|
|
3927
3949
|
},
|
|
@@ -3932,7 +3954,7 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3932
3954
|
{
|
|
3933
3955
|
sx: { maxWidth: 0, px: 0 },
|
|
3934
3956
|
onClick: () => {
|
|
3935
|
-
e.deletedAt || r(`/${
|
|
3957
|
+
e.deletedAt || r(`/${k.kebab(o.plural())}/${e.getKey()}`);
|
|
3936
3958
|
},
|
|
3937
3959
|
children: l.map(({ key: y, ...S }) => /* @__PURE__ */ i(Xa, { ...S }, y))
|
|
3938
3960
|
}
|
|
@@ -3948,9 +3970,9 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3948
3970
|
["ModelIndex.Pagination"]: s,
|
|
3949
3971
|
["ModelIndex.PaginationDetails"]: a,
|
|
3950
3972
|
["ModelIndex.PerPageSwitch"]: l
|
|
3951
|
-
} =
|
|
3973
|
+
} = T("cms").getComponents();
|
|
3952
3974
|
return /* @__PURE__ */ w(Gr, { ...t, children: [
|
|
3953
|
-
/* @__PURE__ */ i(
|
|
3975
|
+
/* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(ee, { colSpan: n, children: /* @__PURE__ */ w(
|
|
3954
3976
|
N,
|
|
3955
3977
|
{
|
|
3956
3978
|
direction: r ? "row" : "column-reverse",
|
|
@@ -3993,8 +4015,8 @@ const I = St(Ga, At), de = Z($)(() => ({
|
|
|
3993
4015
|
["ModelIndex.Sort"]: r,
|
|
3994
4016
|
["ModelIndex.Pagination"]: o
|
|
3995
4017
|
// ['ModelIndex.PaginationDetails']: PaginationDetails,
|
|
3996
|
-
} =
|
|
3997
|
-
return /* @__PURE__ */ i(
|
|
4018
|
+
} = T("cms").getComponents(), s = v(), a = z("breakpoint", "md");
|
|
4019
|
+
return /* @__PURE__ */ i(he, { children: /* @__PURE__ */ i(ee, { colSpan: e, sx: { p: 1 }, children: /* @__PURE__ */ w(
|
|
3998
4020
|
N,
|
|
3999
4021
|
{
|
|
4000
4022
|
direction: { xs: "column", [a]: "row" },
|
|
@@ -4040,9 +4062,9 @@ function ni() {
|
|
|
4040
4062
|
const u = new URLSearchParams();
|
|
4041
4063
|
return c !== "all" && u.set("tab", c), u;
|
|
4042
4064
|
});
|
|
4043
|
-
}, a =
|
|
4044
|
-
|
|
4045
|
-
`model${
|
|
4065
|
+
}, a = m.useMemo(() => e.getSchema().softDeletes ? [{ label: t("Trashed"), value: "trashed" }] : [], [e, t]), l = Ct(
|
|
4066
|
+
T("cms"),
|
|
4067
|
+
`model${k.studly(e.getSchemaName())}Tabs`,
|
|
4046
4068
|
a
|
|
4047
4069
|
);
|
|
4048
4070
|
return l.length === 0 ? null : /* @__PURE__ */ i(H, { sx: { maxWidth: { xs: 320, sm: 480 }, bgcolor: "background.paper" }, children: /* @__PURE__ */ w(
|
|
@@ -4123,19 +4145,19 @@ const hr = ({
|
|
|
4123
4145
|
onClick: n,
|
|
4124
4146
|
...r
|
|
4125
4147
|
}) => {
|
|
4126
|
-
const [o, s] =
|
|
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");
|
|
4127
4149
|
return /* @__PURE__ */ w(Qr, { ...r, children: [
|
|
4128
4150
|
t.map((y) => {
|
|
4129
4151
|
const {
|
|
4130
4152
|
text: S,
|
|
4131
4153
|
icon: b,
|
|
4132
|
-
element:
|
|
4154
|
+
element: p = null,
|
|
4133
4155
|
key: g,
|
|
4134
|
-
children:
|
|
4135
|
-
to:
|
|
4156
|
+
children: A,
|
|
4157
|
+
to: x,
|
|
4136
4158
|
onClick: E
|
|
4137
4159
|
} = y;
|
|
4138
|
-
return
|
|
4160
|
+
return p || /* @__PURE__ */ w(
|
|
4139
4161
|
eo,
|
|
4140
4162
|
{
|
|
4141
4163
|
disablePadding: !0,
|
|
@@ -4150,9 +4172,9 @@ const hr = ({
|
|
|
4150
4172
|
px: 2.5
|
|
4151
4173
|
},
|
|
4152
4174
|
onClick: (P) => {
|
|
4153
|
-
if (E && E(P),
|
|
4175
|
+
if (E && E(P), A) {
|
|
4154
4176
|
if (e) {
|
|
4155
|
-
l(() => (s(P.currentTarget),
|
|
4177
|
+
l(() => (s(P.currentTarget), A));
|
|
4156
4178
|
return;
|
|
4157
4179
|
}
|
|
4158
4180
|
c({
|
|
@@ -4163,10 +4185,10 @@ const hr = ({
|
|
|
4163
4185
|
}
|
|
4164
4186
|
n && n(P);
|
|
4165
4187
|
},
|
|
4166
|
-
...
|
|
4188
|
+
...x ? { to: x, component: We } : {},
|
|
4167
4189
|
children: [
|
|
4168
4190
|
/* @__PURE__ */ w(
|
|
4169
|
-
|
|
4191
|
+
An,
|
|
4170
4192
|
{
|
|
4171
4193
|
sx: {
|
|
4172
4194
|
minWidth: 0,
|
|
@@ -4190,12 +4212,12 @@ const hr = ({
|
|
|
4190
4212
|
}
|
|
4191
4213
|
),
|
|
4192
4214
|
!e && /* @__PURE__ */ i(Cn, { primary: S }),
|
|
4193
|
-
!e &&
|
|
4215
|
+
!e && A && (d[g] ? /* @__PURE__ */ i(In, {}) : /* @__PURE__ */ i(Mn, {}))
|
|
4194
4216
|
]
|
|
4195
4217
|
}
|
|
4196
4218
|
),
|
|
4197
|
-
|
|
4198
|
-
|
|
4219
|
+
A && !e && /* @__PURE__ */ i(
|
|
4220
|
+
xn,
|
|
4199
4221
|
{
|
|
4200
4222
|
in: d[g],
|
|
4201
4223
|
timeout: "auto",
|
|
@@ -4203,7 +4225,7 @@ const hr = ({
|
|
|
4203
4225
|
children: /* @__PURE__ */ i(
|
|
4204
4226
|
hr,
|
|
4205
4227
|
{
|
|
4206
|
-
items:
|
|
4228
|
+
items: A,
|
|
4207
4229
|
onClick: n,
|
|
4208
4230
|
collapsed: e,
|
|
4209
4231
|
sx: { pl: e ? 0 : 2, pb: 0 }
|
|
@@ -4239,7 +4261,7 @@ const hr = ({
|
|
|
4239
4261
|
onClick: n,
|
|
4240
4262
|
...r
|
|
4241
4263
|
}) => {
|
|
4242
|
-
const [o, s] =
|
|
4264
|
+
const [o, s] = m.useState({}), a = z("drawer.width", 280);
|
|
4243
4265
|
return /* @__PURE__ */ w(B, { children: [
|
|
4244
4266
|
/* @__PURE__ */ i(En, { ...r, children: t.map((l) => {
|
|
4245
4267
|
const {
|
|
@@ -4254,24 +4276,24 @@ const hr = ({
|
|
|
4254
4276
|
return u || /* @__PURE__ */ w(
|
|
4255
4277
|
se,
|
|
4256
4278
|
{
|
|
4257
|
-
onClick: (
|
|
4258
|
-
if (S && S(
|
|
4279
|
+
onClick: (p) => {
|
|
4280
|
+
if (S && S(p), y) {
|
|
4259
4281
|
s({
|
|
4260
4282
|
...o,
|
|
4261
|
-
[h]: o[h] ? null :
|
|
4283
|
+
[h]: o[h] ? null : p.currentTarget
|
|
4262
4284
|
});
|
|
4263
4285
|
return;
|
|
4264
4286
|
}
|
|
4265
|
-
n && n(
|
|
4287
|
+
n && n(p);
|
|
4266
4288
|
},
|
|
4267
4289
|
...b ? {
|
|
4268
|
-
component:
|
|
4290
|
+
component: We,
|
|
4269
4291
|
to: b
|
|
4270
4292
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4271
4293
|
} : {},
|
|
4272
4294
|
children: [
|
|
4273
4295
|
c && /* @__PURE__ */ i(
|
|
4274
|
-
|
|
4296
|
+
An,
|
|
4275
4297
|
{
|
|
4276
4298
|
sx: {
|
|
4277
4299
|
minWidth: 0,
|
|
@@ -4315,14 +4337,14 @@ const hr = ({
|
|
|
4315
4337
|
title: e.getSchema().softDeletes ? s("Confirm send to trash") : s("Confirm delete permanently"),
|
|
4316
4338
|
message: s(`Are you sure you want to ${a} :count :model?`, {
|
|
4317
4339
|
count: t.count(),
|
|
4318
|
-
model:
|
|
4340
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4319
4341
|
}),
|
|
4320
4342
|
type: "confirm"
|
|
4321
4343
|
}))
|
|
4322
4344
|
try {
|
|
4323
4345
|
await e.delete(t.pluck(e.getSchema().primaryKey).all()), n(s(`Successfully ${l} :count :model`, {
|
|
4324
4346
|
count: t.count(),
|
|
4325
|
-
model:
|
|
4347
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4326
4348
|
})), o();
|
|
4327
4349
|
} catch (c) {
|
|
4328
4350
|
ce(n)(c);
|
|
@@ -4333,14 +4355,14 @@ const hr = ({
|
|
|
4333
4355
|
title: s("Confirm restore"),
|
|
4334
4356
|
message: s("Are you sure you want to restore :count :model?", {
|
|
4335
4357
|
count: t.count(),
|
|
4336
|
-
model:
|
|
4358
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4337
4359
|
}),
|
|
4338
4360
|
type: "confirm"
|
|
4339
4361
|
}))
|
|
4340
4362
|
try {
|
|
4341
4363
|
await e.restore(t.pluck(e.getSchema().primaryKey).all()), n(s("Successfully restored :count :model", {
|
|
4342
4364
|
count: t.count(),
|
|
4343
|
-
model:
|
|
4365
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4344
4366
|
})), o();
|
|
4345
4367
|
} catch (l) {
|
|
4346
4368
|
ce(n)(l);
|
|
@@ -4351,14 +4373,14 @@ const hr = ({
|
|
|
4351
4373
|
title: s("Confirm permanent deletion"),
|
|
4352
4374
|
message: s("Are you sure you want to delete permanently :count :model?", {
|
|
4353
4375
|
count: t.count(),
|
|
4354
|
-
model:
|
|
4376
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4355
4377
|
}),
|
|
4356
4378
|
type: "confirm"
|
|
4357
4379
|
}))
|
|
4358
4380
|
try {
|
|
4359
4381
|
await e.forceDelete(t.pluck(e.getSchema().primaryKey).all()), n(s("Successfully deleted :count :model", {
|
|
4360
4382
|
count: t.count(),
|
|
4361
|
-
model:
|
|
4383
|
+
model: k.lcfirst(t.count() === 1 ? e.singular() : e.plural())
|
|
4362
4384
|
})), o();
|
|
4363
4385
|
} catch (l) {
|
|
4364
4386
|
ce(n)(l);
|
|
@@ -4370,7 +4392,7 @@ const hr = ({
|
|
|
4370
4392
|
if (await r({
|
|
4371
4393
|
title: e.getSchema().softDeletes ? s("Confirm send to trash") : s("Confirm permanent deletion"),
|
|
4372
4394
|
message: s(`Are you sure you want to ${a}?`, {
|
|
4373
|
-
model:
|
|
4395
|
+
model: k.lcfirst(e.singular()),
|
|
4374
4396
|
label: t.getLabel()
|
|
4375
4397
|
}),
|
|
4376
4398
|
type: "confirm"
|
|
@@ -4388,7 +4410,7 @@ const hr = ({
|
|
|
4388
4410
|
if (await r({
|
|
4389
4411
|
title: s("Confirm restore"),
|
|
4390
4412
|
message: s("Are you sure you want to restore :model “:label”?", {
|
|
4391
|
-
model:
|
|
4413
|
+
model: k.lcfirst(e.singular()),
|
|
4392
4414
|
label: t.getLabel()
|
|
4393
4415
|
}),
|
|
4394
4416
|
type: "confirm"
|
|
@@ -4406,7 +4428,7 @@ const hr = ({
|
|
|
4406
4428
|
if (await r({
|
|
4407
4429
|
title: s("Confirm permanent deletion"),
|
|
4408
4430
|
message: s("Are you sure you want to delete :model “:label” permanently?", {
|
|
4409
|
-
model:
|
|
4431
|
+
model: k.lcfirst(e.singular()),
|
|
4410
4432
|
label: t.getLabel()
|
|
4411
4433
|
}),
|
|
4412
4434
|
type: "confirm"
|
|
@@ -4422,7 +4444,7 @@ const hr = ({
|
|
|
4422
4444
|
}
|
|
4423
4445
|
}, oi = {
|
|
4424
4446
|
create: (e) => ({ navigate: t }) => {
|
|
4425
|
-
t(`/${
|
|
4447
|
+
t(`/${k.kebab(e.plural())}/create`);
|
|
4426
4448
|
}
|
|
4427
4449
|
};
|
|
4428
4450
|
class si {
|
|
@@ -4430,7 +4452,7 @@ class si {
|
|
|
4430
4452
|
return "icon";
|
|
4431
4453
|
}
|
|
4432
4454
|
}
|
|
4433
|
-
const
|
|
4455
|
+
const ke = St(si, xt);
|
|
4434
4456
|
class ai {
|
|
4435
4457
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4436
4458
|
getComponents() {
|
|
@@ -4441,37 +4463,37 @@ class ai {
|
|
|
4441
4463
|
return this.getComponents()[t];
|
|
4442
4464
|
}
|
|
4443
4465
|
getRoutes() {
|
|
4444
|
-
return this.cmsRoutes([], this.getComponents(),
|
|
4466
|
+
return this.cmsRoutes([], this.getComponents(), we().make());
|
|
4445
4467
|
}
|
|
4446
4468
|
getMenuItems() {
|
|
4447
|
-
return this.menuItems([],
|
|
4469
|
+
return this.menuItems([], we().make());
|
|
4448
4470
|
}
|
|
4449
4471
|
getModelFormProps(t) {
|
|
4450
4472
|
return this.wireModelFormProps({}, t);
|
|
4451
4473
|
}
|
|
4452
4474
|
getMassActions(t, n) {
|
|
4453
|
-
return this[`mass${
|
|
4475
|
+
return this[`mass${k.studly(t.getSchemaName())}Actions`](
|
|
4454
4476
|
this.massActions([], t, n),
|
|
4455
4477
|
t,
|
|
4456
4478
|
n
|
|
4457
4479
|
);
|
|
4458
4480
|
}
|
|
4459
4481
|
getInstanceActions(t, n) {
|
|
4460
|
-
return this[`instance${
|
|
4482
|
+
return this[`instance${k.studly(t.getSchemaName())}Actions`](
|
|
4461
4483
|
this.instanceActions([], t, n),
|
|
4462
4484
|
t,
|
|
4463
4485
|
n
|
|
4464
4486
|
);
|
|
4465
4487
|
}
|
|
4466
4488
|
getStaticActions(t, n) {
|
|
4467
|
-
return this[`static${
|
|
4489
|
+
return this[`static${k.studly(t.getSchemaName())}Actions`](
|
|
4468
4490
|
this.staticActions([], t, n),
|
|
4469
4491
|
t,
|
|
4470
4492
|
n
|
|
4471
4493
|
);
|
|
4472
4494
|
}
|
|
4473
4495
|
}
|
|
4474
|
-
const ii = gn(ai),
|
|
4496
|
+
const ii = gn(ai), ye = (e) => !(typeof e > "u" || e === null || J.isEmpty(e));
|
|
4475
4497
|
class li {
|
|
4476
4498
|
getInputType(t) {
|
|
4477
4499
|
switch (t) {
|
|
@@ -4526,7 +4548,7 @@ class li {
|
|
|
4526
4548
|
r = "<=";
|
|
4527
4549
|
break;
|
|
4528
4550
|
default:
|
|
4529
|
-
r =
|
|
4551
|
+
r = k.human(r);
|
|
4530
4552
|
break;
|
|
4531
4553
|
}
|
|
4532
4554
|
return {
|
|
@@ -4541,7 +4563,7 @@ class li {
|
|
|
4541
4563
|
let a = s.phpType ?? "string";
|
|
4542
4564
|
return s.cast !== null && !J.isEmpty(s.cast) && (a = s.cast), {
|
|
4543
4565
|
key: s.name,
|
|
4544
|
-
label:
|
|
4566
|
+
label: k.human(s.name),
|
|
4545
4567
|
type: a,
|
|
4546
4568
|
nullable: s.nullable,
|
|
4547
4569
|
is_relation: !1
|
|
@@ -4552,7 +4574,7 @@ class li {
|
|
|
4552
4574
|
...s,
|
|
4553
4575
|
{
|
|
4554
4576
|
key: a,
|
|
4555
|
-
label:
|
|
4577
|
+
label: k.human(a),
|
|
4556
4578
|
type: "autocomplete",
|
|
4557
4579
|
nullable: !1,
|
|
4558
4580
|
is_relation: !0
|
|
@@ -4563,14 +4585,14 @@ class li {
|
|
|
4563
4585
|
}
|
|
4564
4586
|
checkIfCanApplyFilters(t) {
|
|
4565
4587
|
return !!(t.length === 0 || t.map((r) => {
|
|
4566
|
-
if (!
|
|
4588
|
+
if (!ye(r.key) || !ye(r.operator))
|
|
4567
4589
|
return !0;
|
|
4568
4590
|
if (["boolean"].includes(this.getInputType(r.type))) {
|
|
4569
4591
|
if (typeof r.value > "u" || J.isNull(r.value))
|
|
4570
4592
|
return !0;
|
|
4571
|
-
} else if (!
|
|
4593
|
+
} else if (!ye(r.value))
|
|
4572
4594
|
return !0;
|
|
4573
|
-
return !!(Array.isArray(r.value) && ["between", "notBetween"].includes(r.operator) && (!
|
|
4595
|
+
return !!(Array.isArray(r.value) && ["between", "notBetween"].includes(r.operator) && (!ye(r.value[0]) || !ye(r.value[1])));
|
|
4574
4596
|
}).includes(!0));
|
|
4575
4597
|
}
|
|
4576
4598
|
}
|
|
@@ -4592,7 +4614,7 @@ class ui {
|
|
|
4592
4614
|
);
|
|
4593
4615
|
}
|
|
4594
4616
|
forModel(t, n) {
|
|
4595
|
-
Re.reducer(`model${
|
|
4617
|
+
Re.reducer(`model${k.studly(t)}`, (r) => {
|
|
4596
4618
|
const o = this;
|
|
4597
4619
|
return class extends r {
|
|
4598
4620
|
static icon() {
|
|
@@ -4618,7 +4640,7 @@ class ui {
|
|
|
4618
4640
|
}
|
|
4619
4641
|
}
|
|
4620
4642
|
const di = ({ item: e }) => {
|
|
4621
|
-
const t = qt(), [n] = G(), r = n.get("tab") ?? "all", o =
|
|
4643
|
+
const t = qt(), [n] = G(), r = n.get("tab") ?? "all", o = m.useMemo(() => T("cms").getInstanceActions(e.constructor, r), [e, r]), [s, a] = m.useState(null), l = !!s, d = (u) => {
|
|
4622
4644
|
a(u.currentTarget);
|
|
4623
4645
|
}, c = () => {
|
|
4624
4646
|
a(null);
|
|
@@ -4704,11 +4726,11 @@ const Ie = class Ie extends bn {
|
|
|
4704
4726
|
// );
|
|
4705
4727
|
// }
|
|
4706
4728
|
registerIcons() {
|
|
4707
|
-
|
|
4729
|
+
ke.registerIcon({
|
|
4708
4730
|
Add: ao,
|
|
4709
4731
|
AddCircleOutline: Dn,
|
|
4710
4732
|
ArrowDownward: Bn,
|
|
4711
|
-
ArrowDropDown:
|
|
4733
|
+
ArrowDropDown: Tn,
|
|
4712
4734
|
ArrowUpward: Ln,
|
|
4713
4735
|
CategoryOutlined: io,
|
|
4714
4736
|
ChevronLeft: je,
|
|
@@ -4726,7 +4748,7 @@ const Ie = class Ie extends bn {
|
|
|
4726
4748
|
PeopleOutlined: co,
|
|
4727
4749
|
Search: ut,
|
|
4728
4750
|
SwapVert: Fn
|
|
4729
|
-
}),
|
|
4751
|
+
}), ke.forModel("user", "PeopleOutlined");
|
|
4730
4752
|
}
|
|
4731
4753
|
bootRoutes() {
|
|
4732
4754
|
I.reducer("cmsRoutes", So, 0), wr.reducer("domRouterOptions", (t) => ({
|
|
@@ -4737,10 +4759,10 @@ const Ie = class Ie extends bn {
|
|
|
4737
4759
|
bootComponents() {
|
|
4738
4760
|
I.reducer("componentMap", () => ({
|
|
4739
4761
|
Layout: Eo,
|
|
4740
|
-
Dashboard:
|
|
4741
|
-
ModelIndex:
|
|
4762
|
+
Dashboard: xo,
|
|
4763
|
+
ModelIndex: To,
|
|
4742
4764
|
ModelItem: aa,
|
|
4743
|
-
Error:
|
|
4765
|
+
Error: Ao,
|
|
4744
4766
|
DesktopPageTitle: Sa,
|
|
4745
4767
|
RecursiveList: hr,
|
|
4746
4768
|
RecursiveMenu: pr,
|
|
@@ -4757,7 +4779,7 @@ const Ie = class Ie extends bn {
|
|
|
4757
4779
|
"ModelIndex.Pagination": Ma,
|
|
4758
4780
|
"ModelIndex.PaginationDetails": Na,
|
|
4759
4781
|
"ModelIndex.PerPageSwitch": ja,
|
|
4760
|
-
"ModelIndex.Sort":
|
|
4782
|
+
"ModelIndex.Sort": Va,
|
|
4761
4783
|
"ModelIndex.StaticActions": da,
|
|
4762
4784
|
"ModelIndex.Table": $a,
|
|
4763
4785
|
"ModelIndex.Table.TableHead": Ka,
|
|
@@ -4776,12 +4798,12 @@ const Ie = class Ie extends bn {
|
|
|
4776
4798
|
key: "dashboard",
|
|
4777
4799
|
text: "Dashboard",
|
|
4778
4800
|
to: "/",
|
|
4779
|
-
icon:
|
|
4801
|
+
icon: ke.render("DashboardOutlined")
|
|
4780
4802
|
},
|
|
4781
4803
|
...Object.entries(n).sort(([r], [o]) => r.localeCompare(o)).map(([r, o]) => ({
|
|
4782
4804
|
key: r,
|
|
4783
4805
|
text: o.plural(),
|
|
4784
|
-
to: "/" +
|
|
4806
|
+
to: "/" + k.kebab(o.plural()),
|
|
4785
4807
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4786
4808
|
icon: o.icon()
|
|
4787
4809
|
}))
|
|
@@ -4858,7 +4880,7 @@ const Ie = class Ie extends bn {
|
|
|
4858
4880
|
key: "create",
|
|
4859
4881
|
label: `Create ${n.singular()}`,
|
|
4860
4882
|
callback: oi.create(n),
|
|
4861
|
-
icon:
|
|
4883
|
+
icon: ke.render("Add")
|
|
4862
4884
|
}
|
|
4863
4885
|
], 0);
|
|
4864
4886
|
}
|
|
@@ -4913,7 +4935,7 @@ class mi extends bn {
|
|
|
4913
4935
|
translateModelColumns() {
|
|
4914
4936
|
for (const t of Object.keys(Re.make()))
|
|
4915
4937
|
I.reducer(
|
|
4916
|
-
`model${
|
|
4938
|
+
`model${k.studly(t)}Columns`,
|
|
4917
4939
|
(n) => n.map((r) => ({
|
|
4918
4940
|
...r,
|
|
4919
4941
|
label: Y.t(r.label)
|
|
@@ -4963,7 +4985,7 @@ class mi extends bn {
|
|
|
4963
4985
|
);
|
|
4964
4986
|
}
|
|
4965
4987
|
translateFormLabels() {
|
|
4966
|
-
|
|
4988
|
+
kr.reducer(
|
|
4967
4989
|
"getDefaultInputProps",
|
|
4968
4990
|
(t) => Array.isArray(t) ? t.map((n) => ({
|
|
4969
4991
|
...n,
|
|
@@ -4992,13 +5014,13 @@ const gi = {
|
|
|
4992
5014
|
providers: n,
|
|
4993
5015
|
...r
|
|
4994
5016
|
}) => {
|
|
4995
|
-
const o = Me("(prefers-color-scheme: dark)"), s =
|
|
5017
|
+
const o = Me("(prefers-color-scheme: dark)"), s = m.useMemo(() => uo({
|
|
4996
5018
|
...e,
|
|
4997
5019
|
palette: {
|
|
4998
5020
|
...e.palette,
|
|
4999
5021
|
mode: o ? "dark" : "light"
|
|
5000
5022
|
}
|
|
5001
|
-
}, ...t ?? []), [e, o, t]), a =
|
|
5023
|
+
}, ...t ?? []), [e, o, t]), a = m.useMemo(() => [
|
|
5002
5024
|
wt,
|
|
5003
5025
|
mi,
|
|
5004
5026
|
...n || []
|
|
@@ -5006,7 +5028,7 @@ const gi = {
|
|
|
5006
5028
|
return /* @__PURE__ */ w(fo, { theme: s, children: [
|
|
5007
5029
|
/* @__PURE__ */ i(ro, {}),
|
|
5008
5030
|
/* @__PURE__ */ i(
|
|
5009
|
-
|
|
5031
|
+
Tr,
|
|
5010
5032
|
{
|
|
5011
5033
|
routes: bi,
|
|
5012
5034
|
providers: a,
|
|
@@ -5020,19 +5042,19 @@ class yi {
|
|
|
5020
5042
|
return "filter";
|
|
5021
5043
|
}
|
|
5022
5044
|
}
|
|
5023
|
-
const Gi = St(yi,
|
|
5045
|
+
const Gi = St(yi, xt);
|
|
5024
5046
|
export {
|
|
5025
5047
|
I as Cms,
|
|
5026
5048
|
wt as CmsServiceProvider,
|
|
5027
5049
|
go as DialogProvider,
|
|
5028
5050
|
Gi as Filter,
|
|
5029
|
-
|
|
5051
|
+
ke as Icon,
|
|
5030
5052
|
po as LayoutProvider,
|
|
5031
|
-
|
|
5053
|
+
We as Link,
|
|
5032
5054
|
Ji as LuminixCms,
|
|
5033
5055
|
Ge as ModelProvider,
|
|
5034
5056
|
yo as NotificationProvider,
|
|
5035
|
-
|
|
5057
|
+
Wa as TableProvider,
|
|
5036
5058
|
mi as i18NextServiceProvider,
|
|
5037
5059
|
qt as useActionEvent,
|
|
5038
5060
|
Do as useBackButton,
|
|
@@ -5046,8 +5068,8 @@ export {
|
|
|
5046
5068
|
_t as useMenu,
|
|
5047
5069
|
Ut as useNotify,
|
|
5048
5070
|
ur as usePageTitle,
|
|
5049
|
-
|
|
5050
|
-
|
|
5071
|
+
ko as useSearch,
|
|
5072
|
+
Vt as useSelection,
|
|
5051
5073
|
Bt as useSetPageTitle,
|
|
5052
5074
|
ae as useTable
|
|
5053
5075
|
};
|