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