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