@gen-epix/ui-client-common 4.0.2 → 4.2.0
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/_chunks/CrudPage.js +183 -183
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/Table.js +622 -603
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +97 -97
- package/dist/_chunks/chunk-BV7QT456.js +1 -1
- package/dist/_chunks/chunk-BV7QT456.js.map +1 -1
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/react-oidc-context.js +1 -1
- package/dist/_chunks/react-oidc-context.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +2 -2
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +1 -1
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +4 -4
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +23 -23
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/DateFilter.d.ts +2 -2
- package/dist/classes/filters/GeoFilter.d.ts +2 -2
- package/dist/classes/filters/MultiSelectFilter.d.ts +2 -2
- package/dist/classes/filters/NumberRangeFilter.d.ts +2 -2
- package/dist/classes/filters/TextFilter.d.ts +2 -2
- package/dist/components/app/App/index.js +2 -2
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +31 -31
- package/dist/components/ui/UserFeedbackDialog/index.js +35 -35
- package/dist/theme/demoTheme/index.js +1 -1
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/package.json +66 -65
- package/dist/_chunks/index.esm.js +0 -1284
- package/dist/_chunks/index.esm.js.map +0 -1
package/dist/_chunks/CrudPage.js
CHANGED
|
@@ -8,61 +8,61 @@ import { AuthorizationService as s } from "../classes/services/AuthorizationServ
|
|
|
8
8
|
import { RouterService as c } from "../classes/services/RouterService/index.js";
|
|
9
9
|
import { PageContainer as l } from "../components/ui/PageContainer/index.js";
|
|
10
10
|
import { ResponseHandler as u } from "../components/ui/ResponseHandler/index.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { t as _ } from "./yup.js";
|
|
11
|
+
import { c as d, h as f, n as p, s as m, t as ee } from "./Table.js";
|
|
12
|
+
import { t as h } from "./useQueryMemo.js";
|
|
13
|
+
import { t as te } from "./QueryClientService.js";
|
|
14
|
+
import { useCreateMutation as ne } from "../hooks/useCreateMutation/index.js";
|
|
15
|
+
import { useDeleteMutation as g } from "../hooks/useDeleteMutation/index.js";
|
|
16
|
+
import { useEditMutation as _ } from "../hooks/useEditMutation/index.js";
|
|
17
|
+
import { useInitializeTableStore as re } from "../hooks/useInitializeTableStore/index.js";
|
|
18
|
+
import { t as ie } from "./yup.js";
|
|
20
19
|
import { CommonDbPermissionType as v } from "@gen-epix/api-commondb";
|
|
21
|
-
import { Box as y, Button as
|
|
22
|
-
import { useCallback as C, useEffect as w, useId as T, useMemo as E, useRef as
|
|
23
|
-
import { jsx as
|
|
24
|
-
import { useTranslation as
|
|
25
|
-
import { TestIdUtil as
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import {
|
|
20
|
+
import { Box as y, Button as ae, ListItemIcon as b, ListItemText as x, MenuItem as S, useTheme as oe } from "@mui/material";
|
|
21
|
+
import { useCallback as C, useEffect as w, useId as T, useMemo as E, useRef as se, useState as D } from "react";
|
|
22
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
23
|
+
import { useTranslation as ce } from "react-i18next";
|
|
24
|
+
import { TestIdUtil as A } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
25
|
+
import le from "@mui/icons-material/Edit";
|
|
26
|
+
import ue from "@mui/icons-material/DeleteForever";
|
|
27
|
+
import de from "@mui/icons-material/ArrowCircleRight";
|
|
28
|
+
import fe from "@mui/icons-material/ContentCopy";
|
|
29
|
+
import { useForm as j } from "react-hook-form";
|
|
30
|
+
import { withDialog as M } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
31
|
+
import N from "@mui/icons-material/Save";
|
|
32
|
+
import { GenericForm as pe } from "@gen-epix/ui-core-form/components/helpers/GenericForm";
|
|
33
|
+
import { FormUtil as me } from "@gen-epix/ui-core-form/utils/FormUtil";
|
|
34
34
|
//#region src/pages/CrudPage/CrudPageEditDialog.tsx
|
|
35
|
-
var
|
|
36
|
-
let { t:
|
|
35
|
+
var he = /* @__PURE__ */ e(n(), 1), ge = M(({ createItemDialogTitle: e, defaultNewItem: t, formFieldDefinitions: n, getFormValuesFromItem: r, getName: i, onActionsChange: a, onChange: o, onClose: s, onSave: c, onTitleChange: l, openProps: u, schema: d }) => {
|
|
36
|
+
let { t: p } = ce(), m = T(), ee = E(() => typeof n == "function" ? n(u.item) : n, [n, u.item]), [h, te] = D(ee);
|
|
37
37
|
w(() => {
|
|
38
38
|
let e = [];
|
|
39
39
|
u.extraActionsFactory && e.push(...u.extraActionsFactory(u.item)), e.push({
|
|
40
|
-
...
|
|
40
|
+
...A.createAttributes("CrudPageEditDialog-saveButton"),
|
|
41
41
|
autoFocus: !0,
|
|
42
42
|
color: "secondary",
|
|
43
|
-
disabled: !u.canSave ||
|
|
44
|
-
form:
|
|
45
|
-
label:
|
|
46
|
-
startIcon: /* @__PURE__ */
|
|
43
|
+
disabled: !u.canSave || h.some((e) => e.loading),
|
|
44
|
+
form: m,
|
|
45
|
+
label: p`Save`,
|
|
46
|
+
startIcon: /* @__PURE__ */ O(N, {}),
|
|
47
47
|
type: "submit",
|
|
48
48
|
variant: "contained"
|
|
49
49
|
}), a(e);
|
|
50
50
|
}, [
|
|
51
51
|
a,
|
|
52
|
-
p,
|
|
53
|
-
f,
|
|
54
52
|
m,
|
|
53
|
+
p,
|
|
54
|
+
h,
|
|
55
55
|
u
|
|
56
56
|
]);
|
|
57
|
-
let
|
|
57
|
+
let ne = E(() => ({
|
|
58
58
|
...t,
|
|
59
|
-
...
|
|
59
|
+
...me.createFormValues(h, {
|
|
60
60
|
...t,
|
|
61
61
|
...r ? r(u.item) : u.item ?? {}
|
|
62
62
|
})
|
|
63
63
|
}), [
|
|
64
64
|
t,
|
|
65
|
-
|
|
65
|
+
h,
|
|
66
66
|
r,
|
|
67
67
|
u.item
|
|
68
68
|
]);
|
|
@@ -70,21 +70,21 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
70
70
|
u.item?.id ? l(`Edit item: ${i({
|
|
71
71
|
...t,
|
|
72
72
|
...r ? r(u.item) : u.item ?? {}
|
|
73
|
-
})}`) : l(e ??
|
|
73
|
+
})}`) : l(e ?? p`Create new item`);
|
|
74
74
|
}, [
|
|
75
75
|
i,
|
|
76
76
|
l,
|
|
77
77
|
u,
|
|
78
|
-
|
|
78
|
+
p,
|
|
79
79
|
e,
|
|
80
80
|
t,
|
|
81
81
|
r
|
|
82
82
|
]);
|
|
83
|
-
let
|
|
84
|
-
resolver:
|
|
85
|
-
values:
|
|
86
|
-
}), { formState:
|
|
87
|
-
o && o(u.item, e,
|
|
83
|
+
let g = j({
|
|
84
|
+
resolver: ie(d),
|
|
85
|
+
values: ne
|
|
86
|
+
}), { formState: _, handleSubmit: re, subscribe: v } = g, y = f((e) => {
|
|
87
|
+
o && o(u.item, e, g), typeof n == "function" && te(n(u.item, e));
|
|
88
88
|
}, 500, {
|
|
89
89
|
leading: !1,
|
|
90
90
|
trailing: !0
|
|
@@ -101,29 +101,29 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
101
101
|
y,
|
|
102
102
|
n,
|
|
103
103
|
v
|
|
104
|
-
]),
|
|
105
|
-
let
|
|
104
|
+
]), _.errors && Object.keys(_.errors).length > 0 && console.table(_.errors);
|
|
105
|
+
let ae = C((e) => {
|
|
106
106
|
c(e, u.item), s();
|
|
107
107
|
}, [
|
|
108
108
|
s,
|
|
109
109
|
c,
|
|
110
110
|
u.item
|
|
111
111
|
]);
|
|
112
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ O(pe, {
|
|
113
113
|
disableAll: !u.canSave,
|
|
114
|
-
formFieldDefinitions:
|
|
115
|
-
formId:
|
|
116
|
-
formMethods:
|
|
117
|
-
onSubmit: u.canSave ? ae
|
|
118
|
-
schema:
|
|
114
|
+
formFieldDefinitions: h,
|
|
115
|
+
formId: m,
|
|
116
|
+
formMethods: g,
|
|
117
|
+
onSubmit: u.canSave ? re(ae) : void 0,
|
|
118
|
+
schema: d
|
|
119
119
|
});
|
|
120
120
|
}, {
|
|
121
121
|
defaultTitle: "",
|
|
122
122
|
fullWidth: !0,
|
|
123
123
|
maxWidth: "lg",
|
|
124
124
|
testId: "CrudPageEditDialog"
|
|
125
|
-
}),
|
|
126
|
-
let { t: s } =
|
|
125
|
+
}), _e = M(({ createItemDialogTitle: e, getName: t, onActionsChange: n, onClose: r, onConfirm: i, onTitleChange: a, openProps: o }) => {
|
|
126
|
+
let { t: s } = ce(), c = C(() => {
|
|
127
127
|
i(o.item), r();
|
|
128
128
|
}, [
|
|
129
129
|
r,
|
|
@@ -133,18 +133,18 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
133
133
|
return w(() => {
|
|
134
134
|
let e = [];
|
|
135
135
|
e.push({
|
|
136
|
-
...
|
|
136
|
+
...A.createAttributes("CrudPageDeleteDialog-closeButton"),
|
|
137
137
|
autoFocus: !0,
|
|
138
138
|
color: "primary",
|
|
139
139
|
label: s`Cancel`,
|
|
140
140
|
onClick: r,
|
|
141
141
|
variant: "outlined"
|
|
142
142
|
}), e.push({
|
|
143
|
-
...
|
|
143
|
+
...A.createAttributes("CrudPageDeleteDialog-confirmButton"),
|
|
144
144
|
color: "secondary",
|
|
145
145
|
label: s`Confirm`,
|
|
146
146
|
onClick: c,
|
|
147
|
-
startIcon: /* @__PURE__ */
|
|
147
|
+
startIcon: /* @__PURE__ */ O(N, {}),
|
|
148
148
|
variant: "contained"
|
|
149
149
|
}), n(e);
|
|
150
150
|
}, [
|
|
@@ -161,60 +161,60 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
161
161
|
o,
|
|
162
162
|
s,
|
|
163
163
|
e
|
|
164
|
-
]), /* @__PURE__ */
|
|
164
|
+
]), /* @__PURE__ */ O(y, { children: s("Are you sure you want to delete the item \"{{itemName}}\"?", { itemName: t(o.item) }) });
|
|
165
165
|
}, {
|
|
166
166
|
defaultTitle: "",
|
|
167
167
|
fullWidth: !0,
|
|
168
168
|
maxWidth: "lg",
|
|
169
169
|
testId: "CrudPageDeleteDialog"
|
|
170
|
-
}),
|
|
171
|
-
let { t: U } =
|
|
172
|
-
defaultSortByField:
|
|
173
|
-
defaultSortDirection:
|
|
170
|
+
}), ve = ({ associationQueryKeys: e, canEditItem: n, contentActions: f, contentHeader: ie, convertToTableData: T, createItemButtonText: D, createItemDialogTitle: A, createOne: j, crudCommandType: M, customOnRowClick: N, defaultNewItem: pe, defaultSortByField: me, defaultSortDirection: ve, deleteOne: ye, editDialogExtraActionsFactory: be, extraActionsFactory: P, extraCreateOnePermissions: xe, extraDeleteOnePermissions: Se, extraUpdateOnePermissions: Ce, fetchAll: we, fetchAllSelect: Te, formFieldDefinitions: Ee, getFormValuesFromItem: De, getName: F, getOptimisticUpdateIntermediateItem: Oe, itemName: I, loadables: L, onCreateError: ke, onCreateSuccess: Ae, onDeleteError: je, onDeleteSuccess: Me, onEditError: Ne, onEditSuccess: Pe, onFormChange: Fe, onRowsChange: R, onShowItem: z, resourceQueryKeyBase: B, schema: Ie, showIdColumn: Le = !1, subPages: V, tableColumns: Re, tableStoreStorageNamePostFix: ze, tableStoreStorageVersion: Be, testIdAttributes: Ve, title: H, updateOne: He }) => {
|
|
171
|
+
let { t: U } = ce(), Ue = oe(), We = se(null), W = se(null), G = E(() => s.getInstance(), []), K = E(() => [B], [B]), Ge = E(() => a({
|
|
172
|
+
defaultSortByField: me,
|
|
173
|
+
defaultSortDirection: ve,
|
|
174
174
|
idSelectorCallback: (e) => e.id,
|
|
175
175
|
navigatorFunction: c.getInstance().router.navigate,
|
|
176
|
-
storageNamePostFix:
|
|
177
|
-
storageVersion:
|
|
176
|
+
storageNamePostFix: ze ? `CRUDPage-${B}-${ze}` : `CRUDPage-${B}`,
|
|
177
|
+
storageVersion: Be ?? 1
|
|
178
178
|
}), [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
R,
|
|
179
|
+
me,
|
|
180
|
+
ve,
|
|
182
181
|
B,
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
ze,
|
|
183
|
+
Be
|
|
184
|
+
]), Ke = E(() => (0, he.default)(L) ? i.isSomeLoading(L) : !1, [L]), { data: q, error: qe, isLoading: Je } = h({
|
|
185
185
|
enabled: !Ke,
|
|
186
|
-
queryFn: async ({ signal: e }) =>
|
|
186
|
+
queryFn: async ({ signal: e }) => we(e),
|
|
187
187
|
queryKey: K,
|
|
188
|
-
select:
|
|
188
|
+
select: Te
|
|
189
189
|
});
|
|
190
190
|
w(() => {
|
|
191
|
-
|
|
192
|
-
}, [
|
|
193
|
-
let J = E(() => Je ? !0 : Ke, [Je, Ke]), Ye = E(() => qe || ((0,
|
|
194
|
-
command_name:
|
|
191
|
+
R && q && R(q);
|
|
192
|
+
}, [R, q]);
|
|
193
|
+
let J = E(() => Je ? !0 : Ke, [Je, Ke]), Ye = E(() => qe || ((0, he.default)(L) ? L.find((e) => e.error)?.error : null), [qe, L]), Y = C((e) => ({
|
|
194
|
+
command_name: M,
|
|
195
195
|
permission_type: e
|
|
196
|
-
}), [
|
|
196
|
+
}), [M]), Xe = E(() => He ? G.doesUserHavePermission([...M ? [Y(v.UPDATE)] : [], ...Ce ?? []]) : !1, [
|
|
197
197
|
G,
|
|
198
198
|
Y,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
]), Ze = E(() =>
|
|
199
|
+
M,
|
|
200
|
+
Ce,
|
|
201
|
+
He
|
|
202
|
+
]), Ze = E(() => ye ? G.doesUserHavePermission([...M ? [Y(v.DELETE)] : [], ...Se ?? []]) : !1, [
|
|
203
203
|
G,
|
|
204
204
|
Y,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
]), X = E(() => !
|
|
205
|
+
M,
|
|
206
|
+
ye,
|
|
207
|
+
Se
|
|
208
|
+
]), X = E(() => !j || Ye ? !1 : G.doesUserHavePermission([...M ? [Y(v.CREATE)] : [], ...xe ?? []]), [
|
|
209
209
|
G,
|
|
210
|
-
|
|
210
|
+
j,
|
|
211
211
|
Y,
|
|
212
|
-
|
|
212
|
+
M,
|
|
213
213
|
Ye,
|
|
214
|
-
|
|
214
|
+
xe
|
|
215
215
|
]), Qe = C((e) => {
|
|
216
216
|
let t = [];
|
|
217
|
-
return
|
|
217
|
+
return be && t.push(...be(e)), V?.forEach((n) => {
|
|
218
218
|
t.push({
|
|
219
219
|
color: "primary",
|
|
220
220
|
label: n.label,
|
|
@@ -222,7 +222,7 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
222
222
|
variant: "outlined"
|
|
223
223
|
});
|
|
224
224
|
}), t;
|
|
225
|
-
}, [
|
|
225
|
+
}, [be, V]), Z = C((e) => {
|
|
226
226
|
W.current.open({
|
|
227
227
|
canSave: Xe && (!e || n ? n(e) : !0),
|
|
228
228
|
extraActionsFactory: Qe,
|
|
@@ -235,133 +235,133 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
235
235
|
]), Q = C((e) => {
|
|
236
236
|
let t;
|
|
237
237
|
try {
|
|
238
|
-
t =
|
|
238
|
+
t = F(e);
|
|
239
239
|
} catch {
|
|
240
240
|
t = void 0;
|
|
241
241
|
}
|
|
242
242
|
return t;
|
|
243
|
-
}, [
|
|
243
|
+
}, [F]), $e = C((e) => {
|
|
244
244
|
let t = Q(e);
|
|
245
245
|
return t ? U("{{itemName}} \"{{name}}\" is being saved...", {
|
|
246
|
-
itemName:
|
|
246
|
+
itemName: I,
|
|
247
247
|
name: t
|
|
248
|
-
}) : U("{{itemName}} is being saved...", { itemName:
|
|
248
|
+
}) : U("{{itemName}} is being saved...", { itemName: I });
|
|
249
249
|
}, [
|
|
250
250
|
U,
|
|
251
251
|
Q,
|
|
252
|
-
|
|
252
|
+
I
|
|
253
253
|
]), et = C((e) => {
|
|
254
254
|
let t = Q(e);
|
|
255
255
|
return t ? U("{{itemName}} \"{{name}}\" is being saved...", {
|
|
256
|
-
itemName:
|
|
256
|
+
itemName: I,
|
|
257
257
|
name: t
|
|
258
|
-
}) : U("{{itemName}} is being saved...", { itemName:
|
|
258
|
+
}) : U("{{itemName}} is being saved...", { itemName: I });
|
|
259
259
|
}, [
|
|
260
260
|
U,
|
|
261
261
|
Q,
|
|
262
|
-
|
|
262
|
+
I
|
|
263
263
|
]), tt = C((e) => {
|
|
264
264
|
let t = Q(e);
|
|
265
265
|
return t ? U("{{itemName}} \"{{name}}\" is being deleted...", {
|
|
266
|
-
itemName:
|
|
266
|
+
itemName: I,
|
|
267
267
|
name: t
|
|
268
|
-
}) : U("{{itemName}} is being deleted...", { itemName:
|
|
268
|
+
}) : U("{{itemName}} is being deleted...", { itemName: I });
|
|
269
269
|
}, [
|
|
270
270
|
U,
|
|
271
271
|
Q,
|
|
272
|
-
|
|
272
|
+
I
|
|
273
273
|
]), nt = C((e) => {
|
|
274
274
|
let t = Q(e);
|
|
275
275
|
return t ? U("{{itemName}} \"{{name}}\" has been saved.", {
|
|
276
|
-
itemName:
|
|
276
|
+
itemName: I,
|
|
277
277
|
name: t
|
|
278
|
-
}) : U("{{itemName}} has been saved.", { itemName:
|
|
278
|
+
}) : U("{{itemName}} has been saved.", { itemName: I });
|
|
279
279
|
}, [
|
|
280
280
|
U,
|
|
281
281
|
Q,
|
|
282
|
-
|
|
282
|
+
I
|
|
283
283
|
]), rt = C((e) => {
|
|
284
284
|
let t = Q(e);
|
|
285
285
|
return t ? U("{{itemName}} \"{{name}}\" has been created.", {
|
|
286
|
-
itemName:
|
|
286
|
+
itemName: I,
|
|
287
287
|
name: t
|
|
288
|
-
}) : U("{{itemName}} has been created.", { itemName:
|
|
288
|
+
}) : U("{{itemName}} has been created.", { itemName: I });
|
|
289
289
|
}, [
|
|
290
290
|
U,
|
|
291
291
|
Q,
|
|
292
|
-
|
|
292
|
+
I
|
|
293
293
|
]), it = C((e) => {
|
|
294
294
|
let t = Q(e);
|
|
295
295
|
return t ? U("{{itemName}} \"{{name}}\" has been deleted.", {
|
|
296
|
-
itemName:
|
|
296
|
+
itemName: I,
|
|
297
297
|
name: t
|
|
298
|
-
}) : U("{{itemName}} has been deleted.", { itemName:
|
|
298
|
+
}) : U("{{itemName}} has been deleted.", { itemName: I });
|
|
299
299
|
}, [
|
|
300
300
|
U,
|
|
301
301
|
Q,
|
|
302
|
-
|
|
302
|
+
I
|
|
303
303
|
]), at = C((e) => {
|
|
304
304
|
let t = Q(e);
|
|
305
305
|
return t ? U("{{itemName}} \"{{name}}\" could not be saved.", {
|
|
306
|
-
itemName:
|
|
306
|
+
itemName: I,
|
|
307
307
|
name: t
|
|
308
|
-
}) : U("{{itemName}} could not be saved.", { itemName:
|
|
308
|
+
}) : U("{{itemName}} could not be saved.", { itemName: I });
|
|
309
309
|
}, [
|
|
310
310
|
U,
|
|
311
311
|
Q,
|
|
312
|
-
|
|
312
|
+
I
|
|
313
313
|
]), ot = C((e) => {
|
|
314
314
|
let t = Q(e);
|
|
315
315
|
return t ? U("{{itemName}} \"{{name}}\" could not be created.", {
|
|
316
|
-
itemName:
|
|
316
|
+
itemName: I,
|
|
317
317
|
name: t
|
|
318
|
-
}) : U("{{itemName}} could not be created.", { itemName:
|
|
318
|
+
}) : U("{{itemName}} could not be created.", { itemName: I });
|
|
319
319
|
}, [
|
|
320
320
|
U,
|
|
321
321
|
Q,
|
|
322
|
-
|
|
322
|
+
I
|
|
323
323
|
]), st = C((e) => {
|
|
324
324
|
let t = Q(e);
|
|
325
325
|
return t ? U("{{itemName}} \"{{name}}\" could not be deleted.", {
|
|
326
|
-
itemName:
|
|
326
|
+
itemName: I,
|
|
327
327
|
name: t
|
|
328
|
-
}) : U("{{itemName}} could not be deleted.", { itemName:
|
|
328
|
+
}) : U("{{itemName}} could not be deleted.", { itemName: I });
|
|
329
329
|
}, [
|
|
330
330
|
U,
|
|
331
331
|
Q,
|
|
332
|
-
|
|
332
|
+
I
|
|
333
333
|
]), ct = E(() => {
|
|
334
334
|
let t = e ?? [];
|
|
335
|
-
return
|
|
335
|
+
return te.getInstance().getQueryKeyDependencies([B]).forEach((e) => {
|
|
336
336
|
t.push(e);
|
|
337
337
|
}), t;
|
|
338
|
-
}, [e,
|
|
338
|
+
}, [e, B]), { mutate: lt, setPreviousItem: ut } = _({
|
|
339
339
|
associationQueryKeys: ct,
|
|
340
340
|
getErrorNotificationMessage: at,
|
|
341
|
-
getIntermediateItem:
|
|
341
|
+
getIntermediateItem: Oe,
|
|
342
342
|
getProgressNotificationMessage: $e,
|
|
343
343
|
getSuccessNotificationMessage: nt,
|
|
344
|
-
onError:
|
|
345
|
-
onSuccess:
|
|
346
|
-
queryFn:
|
|
344
|
+
onError: Ne,
|
|
345
|
+
onSuccess: Pe,
|
|
346
|
+
queryFn: He,
|
|
347
347
|
resourceQueryKey: K
|
|
348
|
-
}), { isMutating: $, mutate: dt } =
|
|
348
|
+
}), { isMutating: $, mutate: dt } = ne({
|
|
349
349
|
associationQueryKeys: ct,
|
|
350
350
|
getErrorNotificationMessage: ot,
|
|
351
351
|
getProgressNotificationMessage: et,
|
|
352
352
|
getSuccessNotificationMessage: rt,
|
|
353
|
-
onError:
|
|
354
|
-
onSuccess:
|
|
355
|
-
queryFn:
|
|
353
|
+
onError: ke,
|
|
354
|
+
onSuccess: Ae,
|
|
355
|
+
queryFn: j,
|
|
356
356
|
resourceQueryKey: K
|
|
357
|
-
}), { mutate: ft } =
|
|
357
|
+
}), { mutate: ft } = g({
|
|
358
358
|
associationQueryKeys: ct,
|
|
359
359
|
getErrorNotificationMessage: st,
|
|
360
360
|
getProgressNotificationMessage: tt,
|
|
361
361
|
getSuccessNotificationMessage: it,
|
|
362
|
-
onError:
|
|
363
|
-
onSuccess:
|
|
364
|
-
queryFn:
|
|
362
|
+
onError: je,
|
|
363
|
+
onSuccess: Me,
|
|
364
|
+
queryFn: ye,
|
|
365
365
|
resourceQueryKey: K
|
|
366
366
|
}), pt = C((e, t) => {
|
|
367
367
|
t?.id ? (ut(t), lt(e)) : dt(e);
|
|
@@ -372,21 +372,21 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
372
372
|
]), mt = C((e) => {
|
|
373
373
|
Z(e.row);
|
|
374
374
|
}, [Z]), ht = C((e) => {
|
|
375
|
-
|
|
375
|
+
N ? N(e) : z ? z(e) : Z(e.row);
|
|
376
376
|
}, [
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
N,
|
|
378
|
+
z,
|
|
379
379
|
Z
|
|
380
380
|
]), gt = C((e) => {
|
|
381
381
|
ft(e);
|
|
382
382
|
}, [ft]), _t = C((e) => {
|
|
383
|
-
let t = [], n =
|
|
384
|
-
return n?.length > 0 && t.push(...n),
|
|
385
|
-
t.push(/* @__PURE__ */
|
|
383
|
+
let t = [], n = P ? P(e) : [];
|
|
384
|
+
return n?.length > 0 && t.push(...n), V?.forEach((n) => {
|
|
385
|
+
t.push(/* @__PURE__ */ k(S, {
|
|
386
386
|
onClick: async () => await c.getInstance().router.navigate({ pathname: n.getPathName(e.row) }),
|
|
387
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ O(b, { children: n.icon ? n.icon : /* @__PURE__ */ O(de, {}) }), /* @__PURE__ */ O(x, { children: n.label })]
|
|
388
388
|
}, n.label));
|
|
389
|
-
}), X && t.push(/* @__PURE__ */
|
|
389
|
+
}), X && t.push(/* @__PURE__ */ k(S, {
|
|
390
390
|
onClick: () => W.current.open({
|
|
391
391
|
canSave: !0,
|
|
392
392
|
item: {
|
|
@@ -394,33 +394,33 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
394
394
|
id: null
|
|
395
395
|
}
|
|
396
396
|
}),
|
|
397
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ O(fe, {}) }), /* @__PURE__ */ O(x, { children: U`Clone` })]
|
|
398
398
|
}, "clone")), t;
|
|
399
399
|
}, [
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
P,
|
|
401
|
+
V,
|
|
402
402
|
X,
|
|
403
403
|
U
|
|
404
404
|
]), vt = E(() => {
|
|
405
405
|
let e = [t.createReadableIndexColumn()];
|
|
406
|
-
return
|
|
406
|
+
return Le && e.push({
|
|
407
407
|
headerName: U`Id`,
|
|
408
408
|
id: "id",
|
|
409
409
|
isInitiallyVisible: !0,
|
|
410
410
|
type: "text",
|
|
411
411
|
widthPx: 300
|
|
412
|
-
}), e.push(...
|
|
412
|
+
}), e.push(...Re), e.push(t.createActionsColumn({
|
|
413
413
|
getActions: (e) => {
|
|
414
414
|
let t = [];
|
|
415
|
-
|
|
416
|
-
onClick: () =>
|
|
417
|
-
children: [/* @__PURE__ */
|
|
418
|
-
}, "actions1")), t.push(/* @__PURE__ */
|
|
415
|
+
z && t.push(/* @__PURE__ */ k(S, {
|
|
416
|
+
onClick: () => z(e),
|
|
417
|
+
children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ O(de, {}) }), /* @__PURE__ */ O(x, { children: U`Show` })]
|
|
418
|
+
}, "actions1")), t.push(/* @__PURE__ */ k(S, {
|
|
419
419
|
onClick: () => mt(e),
|
|
420
|
-
children: [/* @__PURE__ */
|
|
421
|
-
}, "actions2")), Ze && t.push(/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ O(le, {}) }), /* @__PURE__ */ O(x, { children: U`Edit` })]
|
|
421
|
+
}, "actions2")), Ze && t.push(/* @__PURE__ */ k(S, {
|
|
422
422
|
onClick: () => We.current.open({ item: e.row }),
|
|
423
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ O(ue, {}) }), /* @__PURE__ */ O(x, { children: U`Delete` })]
|
|
424
424
|
}, "actions3"));
|
|
425
425
|
let n = _t(e) ?? [];
|
|
426
426
|
return n?.length > 0 && t.length > 0 && t.push(...n), t;
|
|
@@ -430,13 +430,13 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
430
430
|
}, [
|
|
431
431
|
_t,
|
|
432
432
|
mt,
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
z,
|
|
434
|
+
Le,
|
|
435
435
|
U,
|
|
436
|
-
|
|
436
|
+
Re,
|
|
437
437
|
Ze
|
|
438
|
-
]), yt = E(() =>
|
|
439
|
-
|
|
438
|
+
]), yt = E(() => T ? T(q) : q, [T, q]);
|
|
439
|
+
re({
|
|
440
440
|
columns: vt,
|
|
441
441
|
context: null,
|
|
442
442
|
createFiltersFromColumns: !0,
|
|
@@ -445,83 +445,83 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
445
445
|
});
|
|
446
446
|
let bt = C(() => {
|
|
447
447
|
W.current.open({ canSave: !0 });
|
|
448
|
-
}, []), xt = E(() => !
|
|
448
|
+
}, []), xt = E(() => !f && !X ? /* @__PURE__ */ O(p, {}) : /* @__PURE__ */ k(y, {
|
|
449
449
|
sx: {
|
|
450
450
|
alignItems: "center",
|
|
451
451
|
display: "flex",
|
|
452
452
|
gap: Ue.spacing(1)
|
|
453
453
|
},
|
|
454
454
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
X && /* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ O(p, {}),
|
|
456
|
+
X && /* @__PURE__ */ O(ae, {
|
|
457
457
|
color: "secondary",
|
|
458
458
|
disabled: J || $,
|
|
459
459
|
loading: J || $,
|
|
460
460
|
onClick: bt,
|
|
461
461
|
size: "small",
|
|
462
462
|
variant: "contained",
|
|
463
|
-
children:
|
|
463
|
+
children: D ?? U`Create item`
|
|
464
464
|
}),
|
|
465
|
-
|
|
465
|
+
f
|
|
466
466
|
]
|
|
467
467
|
}), [
|
|
468
|
-
|
|
468
|
+
f,
|
|
469
469
|
X,
|
|
470
470
|
J,
|
|
471
471
|
$,
|
|
472
472
|
bt,
|
|
473
|
-
|
|
473
|
+
D,
|
|
474
474
|
U,
|
|
475
475
|
Ue
|
|
476
|
-
]), St = E(() => (0,
|
|
477
|
-
return /* @__PURE__ */
|
|
476
|
+
]), St = E(() => (0, he.default)(H) ? H.join(" -> ") : H, [H]);
|
|
477
|
+
return /* @__PURE__ */ O(o, {
|
|
478
478
|
store: Ge,
|
|
479
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ k(l, {
|
|
480
480
|
contentActions: xt,
|
|
481
|
-
contentHeader: /* @__PURE__ */
|
|
482
|
-
caption:
|
|
481
|
+
contentHeader: /* @__PURE__ */ O(m, {
|
|
482
|
+
caption: ie ?? St,
|
|
483
483
|
component: "h2",
|
|
484
484
|
variant: "h2"
|
|
485
485
|
}),
|
|
486
486
|
fullWidth: !0,
|
|
487
487
|
showBreadcrumbs: !0,
|
|
488
|
-
testIdAttributes:
|
|
488
|
+
testIdAttributes: Ve,
|
|
489
489
|
title: St,
|
|
490
490
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ O(y, {
|
|
492
492
|
sx: {
|
|
493
493
|
height: "100%",
|
|
494
494
|
position: "relative"
|
|
495
495
|
},
|
|
496
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ k(u, {
|
|
497
497
|
error: Ye,
|
|
498
498
|
isLoading: J,
|
|
499
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ O(ee, {}), /* @__PURE__ */ O(y, {
|
|
500
500
|
sx: {
|
|
501
501
|
height: "100%",
|
|
502
502
|
paddingLeft: Ue.spacing(r.getInstance().config.layout.SIDEBAR_MENU_WIDTH + 1),
|
|
503
503
|
width: "100%"
|
|
504
504
|
},
|
|
505
|
-
children: /* @__PURE__ */
|
|
506
|
-
getRowName:
|
|
505
|
+
children: /* @__PURE__ */ O(d, {
|
|
506
|
+
getRowName: F,
|
|
507
507
|
onRowClick: ht
|
|
508
508
|
})
|
|
509
509
|
})]
|
|
510
510
|
})
|
|
511
511
|
}),
|
|
512
|
-
/* @__PURE__ */
|
|
513
|
-
createItemDialogTitle:
|
|
514
|
-
defaultNewItem:
|
|
515
|
-
formFieldDefinitions:
|
|
516
|
-
getFormValuesFromItem:
|
|
517
|
-
getName:
|
|
518
|
-
onChange:
|
|
512
|
+
/* @__PURE__ */ O(ge, {
|
|
513
|
+
createItemDialogTitle: A,
|
|
514
|
+
defaultNewItem: pe,
|
|
515
|
+
formFieldDefinitions: Ee,
|
|
516
|
+
getFormValuesFromItem: De,
|
|
517
|
+
getName: F,
|
|
518
|
+
onChange: Fe,
|
|
519
519
|
onSave: pt,
|
|
520
520
|
ref: W,
|
|
521
|
-
schema:
|
|
521
|
+
schema: Ie
|
|
522
522
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
getName:
|
|
523
|
+
/* @__PURE__ */ O(_e, {
|
|
524
|
+
getName: F,
|
|
525
525
|
onConfirm: gt,
|
|
526
526
|
ref: We
|
|
527
527
|
})
|
|
@@ -530,6 +530,6 @@ var _e = /* @__PURE__ */ e(n(), 1), ve = A(({ createItemDialogTitle: e, defaultN
|
|
|
530
530
|
});
|
|
531
531
|
};
|
|
532
532
|
//#endregion
|
|
533
|
-
export {
|
|
533
|
+
export { ve as t };
|
|
534
534
|
|
|
535
535
|
//# sourceMappingURL=CrudPage.js.map
|