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