fastapi-rtk 0.2.36 → 0.2.38
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/.external/esm/@tanstack_query-core@5.87.1/@tanstack/query-core/build/modern/query.mjs +1 -1
- package/dist/core/cjs/ActionIcons/View/View.cjs +5 -9
- package/dist/core/cjs/{ActionIcons/Add → Dialogs}/AddDialog.cjs +7 -7
- package/dist/core/cjs/{ActionIcons/Delete → Dialogs}/DeleteDialog.cjs +4 -4
- package/dist/core/cjs/{ActionIcons/Edit → Dialogs}/EditDialog.cjs +10 -10
- package/dist/core/cjs/Dialogs/ViewDialog.cjs +50 -0
- package/dist/core/cjs/{ActionIcons/Modals → Modals}/CommonModal.cjs +4 -4
- package/dist/core/cjs/Tables/DataGrid/DataGrid.cjs +7 -3
- package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +9 -7
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +3 -1
- package/dist/core/cjs/Wrappers/ApiProvider/Contexts/FormContext.cjs +5 -0
- package/dist/core/cjs/hooks/api/useForms.cjs +3 -1
- package/dist/core/cjs/index.cjs +16 -8
- package/dist/core/esm/ActionIcons/View/View.mjs +7 -11
- package/dist/core/esm/{ActionIcons/Add → Dialogs}/AddDialog.mjs +7 -7
- package/dist/core/esm/{ActionIcons/Delete → Dialogs}/DeleteDialog.mjs +4 -4
- package/dist/core/esm/{ActionIcons/Edit → Dialogs}/EditDialog.mjs +10 -10
- package/dist/core/esm/Dialogs/ViewDialog.mjs +50 -0
- package/dist/core/esm/{ActionIcons/Modals → Modals}/CommonModal.mjs +4 -4
- package/dist/core/esm/Tables/DataGrid/DataGrid.mjs +7 -3
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +9 -7
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +4 -2
- package/dist/core/esm/Wrappers/ApiProvider/Contexts/FormContext.mjs +6 -1
- package/dist/core/esm/hooks/api/useForms.mjs +4 -2
- package/dist/core/esm/index.mjs +13 -5
- package/dist/core/lib/ActionIcons/View/{ViewDialog.d.ts → Unused.d.ts} +1 -1
- package/dist/core/lib/{ActionIcons/Add → Dialogs}/AddDialog.d.ts +12 -2
- package/dist/core/lib/{ActionIcons/Delete → Dialogs}/DeleteDialog.d.ts +3 -1
- package/dist/core/lib/{ActionIcons/Edit → Dialogs}/EditDialog.d.ts +17 -9
- package/dist/core/lib/Dialogs/ViewDialog.d.ts +169 -0
- package/dist/core/lib/Dialogs/index.d.ts +4 -0
- package/dist/core/lib/{ActionIcons/Modals → Modals}/CommonModal.d.ts +4 -4
- package/dist/core/lib/Modals/index.d.ts +3 -0
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/FormContext.d.ts +5 -0
- package/dist/core/lib/hooks/api/useForms.d.ts +1 -1
- package/dist/core/lib/index.d.ts +4 -6
- package/dist/core/styles.css +19 -19
- package/package.json +1 -1
- package/dist/core/cjs/ActionIcons/View/RelationPanel.cjs +0 -17
- package/dist/core/cjs/ActionIcons/View/ViewDialog.cjs +0 -54
- package/dist/core/esm/ActionIcons/View/RelationPanel.mjs +0 -18
- package/dist/core/esm/ActionIcons/View/ViewDialog.mjs +0 -54
- /package/dist/core/cjs/{ActionIcons/Modals → Modals}/normalProps.cjs +0 -0
- /package/dist/core/cjs/{ActionIcons/Modals → Modals}/overlayProps.cjs +0 -0
- /package/dist/core/esm/{ActionIcons/Modals → Modals}/normalProps.mjs +0 -0
- /package/dist/core/esm/{ActionIcons/Modals → Modals}/overlayProps.mjs +0 -0
- /package/dist/core/lib/{ActionIcons/Modals → Modals}/normalProps.d.ts +0 -0
- /package/dist/core/lib/{ActionIcons/Modals → Modals}/overlayProps.d.ts +0 -0
package/dist/.external/esm/@tanstack_query-core@5.87.1/@tanstack/query-core/build/modern/query.mjs
CHANGED
|
@@ -9,7 +9,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
9
9
|
var _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _a;
|
|
10
10
|
import { replaceData, noop, resolveEnabled, skipToken, resolveStaleTime, timeUntilStale, ensureQueryFn } from "./utils.mjs";
|
|
11
11
|
import { notifyManager } from "./notifyManager.mjs";
|
|
12
|
-
import {
|
|
12
|
+
import { createRetryer, CancelledError, canFetch } from "./retryer.mjs";
|
|
13
13
|
import { Removable } from "./removable.mjs";
|
|
14
14
|
var Query = (_a = class extends Removable {
|
|
15
15
|
constructor(config) {
|
|
@@ -7,23 +7,22 @@ const core = require("@mantine/core");
|
|
|
7
7
|
const hooks = require("@mantine/hooks");
|
|
8
8
|
const React = require("react");
|
|
9
9
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
10
|
+
const useForms = require("../../hooks/api/useForms.cjs");
|
|
10
11
|
require("../../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
11
|
-
const ViewDialog = require("./ViewDialog.cjs");
|
|
12
12
|
const useTranslation = require("../../../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
13
13
|
const IconEye = require("../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconEye.cjs");
|
|
14
14
|
const View = React.memo(({ id, ...props }) => {
|
|
15
|
-
const {
|
|
15
|
+
const { getEntry } = useApi.useApi();
|
|
16
16
|
const { t } = useTranslation.useTranslation();
|
|
17
|
-
const
|
|
17
|
+
const { setOpened, setItem } = useForms.useForms("view");
|
|
18
18
|
const [loading, setLoading] = hooks.useDebouncedState(false, constants.DEBOUNCE_LOADING_DELAY);
|
|
19
|
-
const [dialogOpen, setDialogOpen] = React.useState(false);
|
|
20
19
|
const actionIconProps = hooks$1.useActionIcon({
|
|
21
20
|
onClick: () => {
|
|
22
21
|
setLoading(true);
|
|
23
22
|
getEntry(id).then((entry) => {
|
|
24
23
|
if (entry) {
|
|
25
24
|
setItem(entry);
|
|
26
|
-
|
|
25
|
+
setOpened(true);
|
|
27
26
|
}
|
|
28
27
|
}).catch(() => {
|
|
29
28
|
}).finally(() => setLoading(false));
|
|
@@ -32,10 +31,7 @@ const View = React.memo(({ id, ...props }) => {
|
|
|
32
31
|
loading,
|
|
33
32
|
...props
|
|
34
33
|
});
|
|
35
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Tooltip, { label: t("View"), children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ...actionIconProps, children: /* @__PURE__ */ jsxRuntime.jsx(IconEye, {}) }) }),
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx(ViewDialog.ViewDialog, { item, info, opened: dialogOpen, onClose: () => setDialogOpen(false) })
|
|
38
|
-
] });
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(core.Tooltip, { label: t("View"), children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ...actionIconProps, children: /* @__PURE__ */ jsxRuntime.jsx(IconEye, {}) }) }) });
|
|
39
35
|
});
|
|
40
36
|
View.displayName = "View";
|
|
41
37
|
exports.View = View;
|
|
@@ -7,17 +7,17 @@ const utils = require("fastapi-rtk/utils");
|
|
|
7
7
|
const core = require("@mantine/core");
|
|
8
8
|
const form = require("@mantine/form");
|
|
9
9
|
const hooks = require("@mantine/hooks");
|
|
10
|
-
const index = require("
|
|
10
|
+
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.8_yup@1.7.0/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
11
11
|
const React = require("react");
|
|
12
|
-
const useApi = require("
|
|
13
|
-
const useForms = require("
|
|
14
|
-
const useInfo = require("
|
|
15
|
-
require("
|
|
16
|
-
const FormField = require("../../Tables/DataGrid/FormField/FormField.cjs");
|
|
12
|
+
const useApi = require("../hooks/api/useApi.cjs");
|
|
13
|
+
const useForms = require("../hooks/api/useForms.cjs");
|
|
14
|
+
const useInfo = require("../hooks/auth/useInfo.cjs");
|
|
15
|
+
require("../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
17
16
|
const CommonModal = require("../Modals/CommonModal.cjs");
|
|
18
17
|
const normalProps = require("../Modals/normalProps.cjs");
|
|
19
18
|
const overlayProps = require("../Modals/overlayProps.cjs");
|
|
20
|
-
const
|
|
19
|
+
const FormField = require("../Tables/DataGrid/FormField/FormField.cjs");
|
|
20
|
+
const useTranslation = require("../../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
21
21
|
function AddDialog({ jsonForms: __jsonForms, onSuccess, onError, ...props }) {
|
|
22
22
|
var _a;
|
|
23
23
|
const { info, refetch, refetchInfo, addEntry } = useApi.useApi();
|
|
@@ -5,12 +5,12 @@ const constants = require("fastapi-rtk/constants");
|
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
6
|
const hooks = require("@mantine/hooks");
|
|
7
7
|
const React = require("react");
|
|
8
|
-
const useApi = require("../../hooks/api/useApi.cjs");
|
|
9
|
-
const useForms = require("../../hooks/api/useForms.cjs");
|
|
10
|
-
require("../../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
11
8
|
const CommonModal = require("../Modals/CommonModal.cjs");
|
|
12
9
|
const overlayProps = require("../Modals/overlayProps.cjs");
|
|
13
|
-
const
|
|
10
|
+
const useApi = require("../hooks/api/useApi.cjs");
|
|
11
|
+
const useForms = require("../hooks/api/useForms.cjs");
|
|
12
|
+
require("../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
13
|
+
const useTranslation = require("../../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
14
14
|
const DeleteDialog = ({ onSuccess, onError, ...props }) => {
|
|
15
15
|
const { refetch, refetchInfo, deleteEntry } = useApi.useApi();
|
|
16
16
|
const { t } = useTranslation.useTranslation();
|
|
@@ -7,20 +7,20 @@ const utils = require("fastapi-rtk/utils");
|
|
|
7
7
|
const core = require("@mantine/core");
|
|
8
8
|
const form = require("@mantine/form");
|
|
9
9
|
const hooks = require("@mantine/hooks");
|
|
10
|
-
const lodash = require("
|
|
11
|
-
const index = require("
|
|
10
|
+
const lodash = require("../_virtual/lodash.cjs");
|
|
11
|
+
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.8_yup@1.7.0/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
12
12
|
const React = require("react");
|
|
13
|
-
const convertToFormInputs = require("
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
require("
|
|
18
|
-
|
|
13
|
+
const convertToFormInputs$1 = require("../ActionIcons/utils/convertToFormInputs.cjs");
|
|
14
|
+
const convertToFormInputs = require("../fab-react-toolkit-patch/utils/convertToFormInputs.cjs");
|
|
15
|
+
const useApi = require("../hooks/api/useApi.cjs");
|
|
16
|
+
const useForms = require("../hooks/api/useForms.cjs");
|
|
17
|
+
const useInfo = require("../hooks/auth/useInfo.cjs");
|
|
18
|
+
require("../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
19
19
|
const CommonModal = require("../Modals/CommonModal.cjs");
|
|
20
20
|
const normalProps = require("../Modals/normalProps.cjs");
|
|
21
21
|
const overlayProps = require("../Modals/overlayProps.cjs");
|
|
22
|
-
const
|
|
23
|
-
const useTranslation = require("
|
|
22
|
+
const FormField = require("../Tables/DataGrid/FormField/FormField.cjs");
|
|
23
|
+
const useTranslation = require("../../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
24
24
|
function EditDialog({ jsonForms: __jsonForms, onSuccess, onError, ...props }) {
|
|
25
25
|
var _a;
|
|
26
26
|
const { info, refetch, refetchInfo, updateEntry } = useApi.useApi();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const constants = require("fastapi-rtk/constants");
|
|
5
|
+
const utils = require("fastapi-rtk/utils");
|
|
6
|
+
const core = require("@mantine/core");
|
|
7
|
+
const React = require("react");
|
|
8
|
+
const useForms = require("../hooks/api/useForms.cjs");
|
|
9
|
+
const CommonModal = require("../Modals/CommonModal.cjs");
|
|
10
|
+
const normalProps = require("../Modals/normalProps.cjs");
|
|
11
|
+
const overlayProps = require("../Modals/overlayProps.cjs");
|
|
12
|
+
function ViewDialog({ ...props }) {
|
|
13
|
+
const { opened, setOpened, item, reset, view, setView } = useForms.useForms("view");
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
CommonModal.CommonModal,
|
|
16
|
+
{
|
|
17
|
+
view,
|
|
18
|
+
setView,
|
|
19
|
+
withButtons: false,
|
|
20
|
+
opened,
|
|
21
|
+
onClose: () => setOpened(false),
|
|
22
|
+
onExitTransitionEnd: reset,
|
|
23
|
+
...view === constants.VIEW_MODE.OVERLAY ? overlayProps.overlayProps : {},
|
|
24
|
+
...view === constants.VIEW_MODE.NORMAL ? normalProps.normalProps : {},
|
|
25
|
+
...props,
|
|
26
|
+
title: props.title ?? `${item == null ? void 0 : item.show_title} (#${utils.convertId(utils.getItemId(item))})`,
|
|
27
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(core.Tabs, { defaultValue: "details", children: [
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Tabs.List, { children: /* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Tab, { value: "details", children: "Details" }) }),
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Panel, { value: "details", children: item && /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
TabsDisplay,
|
|
31
|
+
{
|
|
32
|
+
columns: item.show_columns,
|
|
33
|
+
data: item.result,
|
|
34
|
+
label_columns: item.label_columns,
|
|
35
|
+
gridProps: { pt: "md" }
|
|
36
|
+
}
|
|
37
|
+
) })
|
|
38
|
+
] })
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const TabsDisplay = ({ columns, data, label_columns, gridProps }) => {
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.Grid, { ...gridProps, children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 3, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "md", children: label_columns[column] }) }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 1, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "xs", children: ":" }) }),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 8, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "md", children: utils.getValue(data, column) }) })
|
|
47
|
+
] }, column)) });
|
|
48
|
+
};
|
|
49
|
+
exports.TabsDisplay = TabsDisplay;
|
|
50
|
+
exports.ViewDialog = ViewDialog;
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const constants = require("fastapi-rtk/constants");
|
|
5
5
|
const utils = require("fastapi-rtk/utils");
|
|
6
|
-
const iconify = require("
|
|
6
|
+
const iconify = require("../../../.external/cjs/@iconify_react@6.0.1_react@18.3.1/@iconify/react/dist/iconify.cjs");
|
|
7
7
|
const core = require("@mantine/core");
|
|
8
|
-
const useInfo = require("
|
|
9
|
-
require("
|
|
10
|
-
const useTranslation = require("
|
|
8
|
+
const useInfo = require("../hooks/auth/useInfo.cjs");
|
|
9
|
+
require("../Wrappers/Provider/Contexts/LangContext.cjs");
|
|
10
|
+
const useTranslation = require("../../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
11
11
|
function CommonModal({
|
|
12
12
|
children,
|
|
13
13
|
view,
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
|
-
const AddDialog = require("../../
|
|
7
|
-
const
|
|
6
|
+
const AddDialog = require("../../Dialogs/AddDialog.cjs");
|
|
7
|
+
const DeleteDialog = require("../../Dialogs/DeleteDialog.cjs");
|
|
8
|
+
const EditDialog = require("../../Dialogs/EditDialog.cjs");
|
|
9
|
+
const ViewDialog = require("../../Dialogs/ViewDialog.cjs");
|
|
8
10
|
const LazyLoadWrapper = require("../../Wrappers/LazyLoadWrapper/LazyLoadWrapper.cjs");
|
|
9
11
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
10
12
|
const useForms = require("../../hooks/api/useForms.cjs");
|
|
@@ -58,8 +60,10 @@ const DataGrid = React.forwardRef((props, ref) => {
|
|
|
58
60
|
const hideCheckbox = bulkActions === null;
|
|
59
61
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Paper, { ref, h: "100%", display: "flex", pos: "relative", style: { flexDirection: "column", ...styles }, children: [
|
|
60
62
|
/* @__PURE__ */ jsxRuntime.jsxs(LazyLoadWrapper.LazyLoadWrapper, { cond: !!info, children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(ViewDialog.ViewDialog, {}),
|
|
61
64
|
/* @__PURE__ */ jsxRuntime.jsx(AddDialog.AddDialog, { jsonForms: form == null ? void 0 : form.add }),
|
|
62
|
-
/* @__PURE__ */ jsxRuntime.jsx(EditDialog.EditDialog, { jsonForms: form == null ? void 0 : form.edit })
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(EditDialog.EditDialog, { jsonForms: form == null ? void 0 : form.edit }),
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeleteDialog.DeleteDialog, {})
|
|
63
67
|
] }),
|
|
64
68
|
!hideToolbar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
69
|
Toolbar.Toolbar,
|
|
@@ -7,9 +7,10 @@ const utils = require("fastapi-rtk/utils");
|
|
|
7
7
|
const core = require("@mantine/core");
|
|
8
8
|
const index_esm = require("../../../../.external/cjs/mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa/mantine-react-table/dist/index.esm.cjs");
|
|
9
9
|
const React = require("react");
|
|
10
|
-
const AddDialog = require("../../
|
|
11
|
-
const DeleteDialog = require("../../
|
|
12
|
-
const EditDialog = require("../../
|
|
10
|
+
const AddDialog = require("../../Dialogs/AddDialog.cjs");
|
|
11
|
+
const DeleteDialog = require("../../Dialogs/DeleteDialog.cjs");
|
|
12
|
+
const EditDialog = require("../../Dialogs/EditDialog.cjs");
|
|
13
|
+
const ViewDialog = require("../../Dialogs/ViewDialog.cjs");
|
|
13
14
|
const LazyLoadWrapper = require("../../Wrappers/LazyLoadWrapper/LazyLoadWrapper.cjs");
|
|
14
15
|
const useApi = require("../../hooks/api/useApi.cjs");
|
|
15
16
|
const useForms = require("../../hooks/api/useForms.cjs");
|
|
@@ -29,7 +30,7 @@ const useToolbar = require("./hooks/useToolbar/useToolbar.cjs");
|
|
|
29
30
|
const useToolbarAlertBanner = require("./hooks/useToolbarAlertBanner/useToolbarAlertBanner.cjs");
|
|
30
31
|
const baseProps = { enableStickyHeader: true, enableColumnPinning: true };
|
|
31
32
|
const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
32
|
-
var _a, _b, _c, _d;
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
33
34
|
const { info, data, queryParams, setQueryParams, refetch, specialKey } = useApi.useApi();
|
|
34
35
|
const propsFromMantineTheme = core.useProps("NextGenDataGrid", {}, {});
|
|
35
36
|
const {
|
|
@@ -223,9 +224,10 @@ const NextGenDataGrid = React.forwardRef((props, ref) => {
|
|
|
223
224
|
}, []);
|
|
224
225
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Box, { pos: "relative", h: "100%", w: "100%", mih: 0, flex: 1, ...wrapperProps, children: [
|
|
225
226
|
/* @__PURE__ */ jsxRuntime.jsxs(LazyLoadWrapper.LazyLoadWrapper, { cond: !!info, children: [
|
|
226
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
227
|
+
/* @__PURE__ */ jsxRuntime.jsx(ViewDialog.ViewDialog, { ...(_b = form == null ? void 0 : form.view) == null ? void 0 : _b.dialogProps }),
|
|
228
|
+
/* @__PURE__ */ jsxRuntime.jsx(AddDialog.AddDialog, { jsonForms: form == null ? void 0 : form.add, ...(_c = form == null ? void 0 : form.add) == null ? void 0 : _c.dialogProps }),
|
|
229
|
+
/* @__PURE__ */ jsxRuntime.jsx(EditDialog.EditDialog, { jsonForms: form == null ? void 0 : form.edit, ...(_d = form == null ? void 0 : form.edit) == null ? void 0 : _d.dialogProps }),
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx(DeleteDialog.DeleteDialog, { ...(_e = form == null ? void 0 : form.delete) == null ? void 0 : _e.dialogProps })
|
|
229
231
|
] }),
|
|
230
232
|
/* @__PURE__ */ jsxRuntime.jsx(index_esm.MantineReactTable, { table: mrtTable, ...rest }),
|
|
231
233
|
children == null ? void 0 : children({ table: mrtTable }),
|
|
@@ -48,12 +48,14 @@ function ApiProvider({
|
|
|
48
48
|
const apiProxy = zustand.useProxy(api);
|
|
49
49
|
const bulkActions = useProvideBulk$1.useProvideBulk(apiProxy, bulkParams);
|
|
50
50
|
const bulkActionsProxy = zustand.useProxy(bulkActions);
|
|
51
|
+
const formView = useProvideForm.useProvideForm();
|
|
52
|
+
const [formViewProxy] = React.useState(() => zustand.createProxy(formView));
|
|
51
53
|
const formAdd = useProvideForm.useProvideForm();
|
|
52
54
|
const [formAddProxy] = React.useState(() => zustand.createProxy(formAdd));
|
|
53
55
|
const formEdit = useProvideForm.useProvideForm();
|
|
54
56
|
const [formEditProxy] = React.useState(() => zustand.createProxy(formEdit));
|
|
55
57
|
const formDelete = useProvideForm.useProvideForm();
|
|
56
58
|
const [formDeleteProxy] = React.useState(() => zustand.createProxy(formDelete));
|
|
57
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ApiContext.ApiContextProvider, { value: apiProxy, children: /* @__PURE__ */ jsxRuntime.jsx(BulkActionsContext.BulkActionsContextProvider, { value: bulkActionsProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextAddProvider, { value: formAddProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextEditProvider, { value: formEditProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextDeleteProvider, { value: formDeleteProxy, children }) }) }) }) });
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ApiContext.ApiContextProvider, { value: apiProxy, children: /* @__PURE__ */ jsxRuntime.jsx(BulkActionsContext.BulkActionsContextProvider, { value: bulkActionsProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextViewProvider, { value: formViewProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextAddProvider, { value: formAddProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextEditProvider, { value: formEditProxy, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.FormContextDeleteProvider, { value: formDeleteProxy, children }) }) }) }) }) });
|
|
58
60
|
}
|
|
59
61
|
exports.ApiProvider = ApiProvider;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const utils = require("fastapi-rtk/utils");
|
|
4
|
+
const [FormContextViewProvider, useFormViewProvider] = utils.createSafeContext(
|
|
5
|
+
"useForms('view') must be used within an ApiProvider"
|
|
6
|
+
);
|
|
4
7
|
const [FormContextAddProvider, useFormAddProvider] = utils.createSafeContext(
|
|
5
8
|
"useForms('add') must be used within an ApiProvider"
|
|
6
9
|
);
|
|
@@ -13,6 +16,8 @@ const [FormContextDeleteProvider, useFormDeleteProvider] = utils.createSafeConte
|
|
|
13
16
|
exports.FormContextAddProvider = FormContextAddProvider;
|
|
14
17
|
exports.FormContextDeleteProvider = FormContextDeleteProvider;
|
|
15
18
|
exports.FormContextEditProvider = FormContextEditProvider;
|
|
19
|
+
exports.FormContextViewProvider = FormContextViewProvider;
|
|
16
20
|
exports.useFormAddProvider = useFormAddProvider;
|
|
17
21
|
exports.useFormDeleteProvider = useFormDeleteProvider;
|
|
18
22
|
exports.useFormEditProvider = useFormEditProvider;
|
|
23
|
+
exports.useFormViewProvider = useFormViewProvider;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const FormContext = require("../../Wrappers/ApiProvider/Contexts/FormContext.cjs");
|
|
4
4
|
const useForms = (type, options) => {
|
|
5
5
|
switch (type) {
|
|
6
|
+
case "view":
|
|
7
|
+
return FormContext.useFormViewProvider(options);
|
|
6
8
|
case "add":
|
|
7
9
|
return FormContext.useFormAddProvider(options);
|
|
8
10
|
case "edit":
|
|
@@ -10,7 +12,7 @@ const useForms = (type, options) => {
|
|
|
10
12
|
case "delete":
|
|
11
13
|
return FormContext.useFormDeleteProvider(options);
|
|
12
14
|
default:
|
|
13
|
-
throw new Error(`useForms: Unknown form type '${type}'. Expected 'add', 'edit', or 'delete'.`);
|
|
15
|
+
throw new Error(`useForms: Unknown form type '${type}'. Expected 'view', 'add', 'edit', or 'delete'.`);
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
18
|
exports.useForms = useForms;
|
package/dist/core/cjs/index.cjs
CHANGED
|
@@ -8,17 +8,21 @@ const Edit = require("./ActionIcons/Edit/Edit.cjs");
|
|
|
8
8
|
const Refresh = require("./ActionIcons/Refresh/Refresh.cjs");
|
|
9
9
|
const Upload = require("./ActionIcons/Upload/Upload.cjs");
|
|
10
10
|
const View = require("./ActionIcons/View/View.cjs");
|
|
11
|
+
const AddDialog = require("./Dialogs/AddDialog.cjs");
|
|
12
|
+
const DeleteDialog = require("./Dialogs/DeleteDialog.cjs");
|
|
13
|
+
const EditDialog = require("./Dialogs/EditDialog.cjs");
|
|
14
|
+
const ViewDialog = require("./Dialogs/ViewDialog.cjs");
|
|
11
15
|
const useApi = require("./hooks/api/useApi.cjs");
|
|
12
16
|
const useBulkActions = require("./hooks/api/useBulkActions.cjs");
|
|
13
17
|
const useForms = require("./hooks/api/useForms.cjs");
|
|
14
18
|
const useAuth = require("./hooks/auth/useAuth.cjs");
|
|
15
19
|
const useInfo = require("./hooks/auth/useInfo.cjs");
|
|
20
|
+
const useLang = require("./hooks/lang/useLang.cjs");
|
|
16
21
|
const UserMenu = require("./Menu/UserMenu/UserMenu.cjs");
|
|
17
22
|
const LanguageSelector = require("./Selectors/LanguageSelector.cjs");
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const ViewDialog = require("./ActionIcons/View/ViewDialog.cjs");
|
|
23
|
+
const CommonModal = require("./Modals/CommonModal.cjs");
|
|
24
|
+
const normalProps = require("./Modals/normalProps.cjs");
|
|
25
|
+
const overlayProps = require("./Modals/overlayProps.cjs");
|
|
22
26
|
const DataGrid = require("./Tables/DataGrid/DataGrid.cjs");
|
|
23
27
|
const NextGenDataGrid = require("./Tables/NextGenDataGrid/NextGenDataGrid.cjs");
|
|
24
28
|
const ApiProvider = require("./Wrappers/ApiProvider/ApiProvider.cjs");
|
|
@@ -30,7 +34,6 @@ const constants = require("fastapi-rtk/constants");
|
|
|
30
34
|
const hooks = require("fastapi-rtk/hooks");
|
|
31
35
|
const utils = require("fastapi-rtk/utils");
|
|
32
36
|
const zustand = require("fastapi-rtk/zustand");
|
|
33
|
-
require("./Wrappers/Provider/Contexts/LangContext.cjs");
|
|
34
37
|
const Filter = require("./Tables/DataGrid/Toolbar/Filter/Filter.cjs");
|
|
35
38
|
const useTranslation = require("../../.external/cjs/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.cjs");
|
|
36
39
|
exports.Actions = Actions.Actions;
|
|
@@ -41,17 +44,22 @@ exports.Edit = Edit.Edit;
|
|
|
41
44
|
exports.Refresh = Refresh.Refresh;
|
|
42
45
|
exports.Upload = Upload.Upload;
|
|
43
46
|
exports.View = View.View;
|
|
47
|
+
exports.AddDialog = AddDialog.AddDialog;
|
|
48
|
+
exports.DeleteDialog = DeleteDialog.DeleteDialog;
|
|
49
|
+
exports.EditDialog = EditDialog.EditDialog;
|
|
50
|
+
exports.TabsDisplay = ViewDialog.TabsDisplay;
|
|
51
|
+
exports.ViewDialog = ViewDialog.ViewDialog;
|
|
44
52
|
exports.useApi = useApi.useApi;
|
|
45
53
|
exports.useBulkActions = useBulkActions.useBulkActions;
|
|
46
54
|
exports.useForms = useForms.useForms;
|
|
47
55
|
exports.useAuth = useAuth.useAuth;
|
|
48
56
|
exports.useInfo = useInfo.useInfo;
|
|
57
|
+
exports.useLang = useLang.useLang;
|
|
49
58
|
exports.UserMenu = UserMenu.UserMenu;
|
|
50
59
|
exports.LanguageSelector = LanguageSelector.LanguageSelector;
|
|
51
|
-
exports.AddDialog = AddDialog.AddDialog;
|
|
52
|
-
exports.EditDialog = EditDialog.EditDialog;
|
|
53
60
|
exports.CommonModal = CommonModal.CommonModal;
|
|
54
|
-
exports.
|
|
61
|
+
exports.normalProps = normalProps.normalProps;
|
|
62
|
+
exports.overlayProps = overlayProps.overlayProps;
|
|
55
63
|
exports.DataGrid = DataGrid.DataGrid;
|
|
56
64
|
exports.Datagrid = DataGrid.DataGrid;
|
|
57
65
|
exports.NextGenDataGrid = NextGenDataGrid.NextGenDataGrid;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { DEBOUNCE_LOADING_DELAY } from "fastapi-rtk/constants";
|
|
3
3
|
import { useActionIcon } from "fastapi-rtk/hooks";
|
|
4
4
|
import { Tooltip, ActionIcon } from "@mantine/core";
|
|
5
5
|
import { useDebouncedState } from "@mantine/hooks";
|
|
6
|
-
import { memo
|
|
6
|
+
import { memo } from "react";
|
|
7
7
|
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
8
|
+
import { useForms } from "../../hooks/api/useForms.mjs";
|
|
8
9
|
import "../../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
9
|
-
import { ViewDialog } from "./ViewDialog.mjs";
|
|
10
10
|
import { useTranslation } from "../../../../.external/esm/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.mjs";
|
|
11
11
|
import IconEye from "../../../../.external/esm/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconEye.mjs";
|
|
12
12
|
const View = memo(({ id, ...props }) => {
|
|
13
|
-
const {
|
|
13
|
+
const { getEntry } = useApi();
|
|
14
14
|
const { t } = useTranslation();
|
|
15
|
-
const
|
|
15
|
+
const { setOpened, setItem } = useForms("view");
|
|
16
16
|
const [loading, setLoading] = useDebouncedState(false, DEBOUNCE_LOADING_DELAY);
|
|
17
|
-
const [dialogOpen, setDialogOpen] = useState(false);
|
|
18
17
|
const actionIconProps = useActionIcon({
|
|
19
18
|
onClick: () => {
|
|
20
19
|
setLoading(true);
|
|
21
20
|
getEntry(id).then((entry) => {
|
|
22
21
|
if (entry) {
|
|
23
22
|
setItem(entry);
|
|
24
|
-
|
|
23
|
+
setOpened(true);
|
|
25
24
|
}
|
|
26
25
|
}).catch(() => {
|
|
27
26
|
}).finally(() => setLoading(false));
|
|
@@ -30,10 +29,7 @@ const View = memo(({ id, ...props }) => {
|
|
|
30
29
|
loading,
|
|
31
30
|
...props
|
|
32
31
|
});
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ jsx(Tooltip, { label: t("View"), children: /* @__PURE__ */ jsx(ActionIcon, { ...actionIconProps, children: /* @__PURE__ */ jsx(IconEye, {}) }) }),
|
|
35
|
-
/* @__PURE__ */ jsx(ViewDialog, { item, info, opened: dialogOpen, onClose: () => setDialogOpen(false) })
|
|
36
|
-
] });
|
|
32
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Tooltip, { label: t("View"), children: /* @__PURE__ */ jsx(ActionIcon, { ...actionIconProps, children: /* @__PURE__ */ jsx(IconEye, {}) }) }) });
|
|
37
33
|
});
|
|
38
34
|
View.displayName = "View";
|
|
39
35
|
export {
|
|
@@ -5,17 +5,17 @@ import { deepMerge } from "fastapi-rtk/utils";
|
|
|
5
5
|
import { useProps, Stack } from "@mantine/core";
|
|
6
6
|
import { useForm } from "@mantine/form";
|
|
7
7
|
import { useDebouncedState } from "@mantine/hooks";
|
|
8
|
-
import { yupResolver } from "
|
|
8
|
+
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.8_yup@1.7.0/mantine-form-yup-resolver/dist/esm/index.mjs";
|
|
9
9
|
import { useMemo, useCallback, useEffect } from "react";
|
|
10
|
-
import { useApi } from "
|
|
11
|
-
import { useForms } from "
|
|
12
|
-
import { useInfo } from "
|
|
13
|
-
import "
|
|
14
|
-
import { FormField } from "../../Tables/DataGrid/FormField/FormField.mjs";
|
|
10
|
+
import { useApi } from "../hooks/api/useApi.mjs";
|
|
11
|
+
import { useForms } from "../hooks/api/useForms.mjs";
|
|
12
|
+
import { useInfo } from "../hooks/auth/useInfo.mjs";
|
|
13
|
+
import "../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
15
14
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
16
15
|
import { normalProps } from "../Modals/normalProps.mjs";
|
|
17
16
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
18
|
-
import {
|
|
17
|
+
import { FormField } from "../Tables/DataGrid/FormField/FormField.mjs";
|
|
18
|
+
import { useTranslation } from "../../../.external/esm/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.mjs";
|
|
19
19
|
function AddDialog({ jsonForms: __jsonForms, onSuccess, onError, ...props }) {
|
|
20
20
|
var _a;
|
|
21
21
|
const { info, refetch, refetchInfo, addEntry } = useApi();
|
|
@@ -3,12 +3,12 @@ import { DEBOUNCE_LOADING_DELAY, VIEW_MODE } from "fastapi-rtk/constants";
|
|
|
3
3
|
import { Text } from "@mantine/core";
|
|
4
4
|
import { useDebouncedState } from "@mantine/hooks";
|
|
5
5
|
import { useCallback } from "react";
|
|
6
|
-
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
7
|
-
import { useForms } from "../../hooks/api/useForms.mjs";
|
|
8
|
-
import "../../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
9
6
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
10
7
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
11
|
-
import {
|
|
8
|
+
import { useApi } from "../hooks/api/useApi.mjs";
|
|
9
|
+
import { useForms } from "../hooks/api/useForms.mjs";
|
|
10
|
+
import "../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
11
|
+
import { useTranslation } from "../../../.external/esm/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.mjs";
|
|
12
12
|
const DeleteDialog = ({ onSuccess, onError, ...props }) => {
|
|
13
13
|
const { refetch, refetchInfo, deleteEntry } = useApi();
|
|
14
14
|
const { t } = useTranslation();
|
|
@@ -5,20 +5,20 @@ import { deepMerge, getItemId } from "fastapi-rtk/utils";
|
|
|
5
5
|
import { useProps, Stack } from "@mantine/core";
|
|
6
6
|
import { useForm } from "@mantine/form";
|
|
7
7
|
import { useDebouncedState } from "@mantine/hooks";
|
|
8
|
-
import { l as lodashExports } from "
|
|
9
|
-
import { yupResolver } from "
|
|
8
|
+
import { l as lodashExports } from "../_virtual/lodash.mjs";
|
|
9
|
+
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.2.8_yup@1.7.0/mantine-form-yup-resolver/dist/esm/index.mjs";
|
|
10
10
|
import { useMemo, useRef, useEffect, useCallback } from "react";
|
|
11
|
-
import { convertToFormInputs } from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "
|
|
16
|
-
import
|
|
11
|
+
import { convertToFormInputs as convertToFormInputs$1 } from "../ActionIcons/utils/convertToFormInputs.mjs";
|
|
12
|
+
import { convertToFormInputs } from "../fab-react-toolkit-patch/utils/convertToFormInputs.mjs";
|
|
13
|
+
import { useApi } from "../hooks/api/useApi.mjs";
|
|
14
|
+
import { useForms } from "../hooks/api/useForms.mjs";
|
|
15
|
+
import { useInfo } from "../hooks/auth/useInfo.mjs";
|
|
16
|
+
import "../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
17
17
|
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
18
18
|
import { normalProps } from "../Modals/normalProps.mjs";
|
|
19
19
|
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
20
|
-
import {
|
|
21
|
-
import { useTranslation } from "
|
|
20
|
+
import { FormField } from "../Tables/DataGrid/FormField/FormField.mjs";
|
|
21
|
+
import { useTranslation } from "../../../.external/esm/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.mjs";
|
|
22
22
|
function EditDialog({ jsonForms: __jsonForms, onSuccess, onError, ...props }) {
|
|
23
23
|
var _a;
|
|
24
24
|
const { info, refetch, refetchInfo, updateEntry } = useApi();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { VIEW_MODE } from "fastapi-rtk/constants";
|
|
3
|
+
import { convertId, getItemId, getValue } from "fastapi-rtk/utils";
|
|
4
|
+
import { Tabs, Grid, Text } from "@mantine/core";
|
|
5
|
+
import { Fragment } from "react";
|
|
6
|
+
import { useForms } from "../hooks/api/useForms.mjs";
|
|
7
|
+
import { CommonModal } from "../Modals/CommonModal.mjs";
|
|
8
|
+
import { normalProps } from "../Modals/normalProps.mjs";
|
|
9
|
+
import { overlayProps } from "../Modals/overlayProps.mjs";
|
|
10
|
+
function ViewDialog({ ...props }) {
|
|
11
|
+
const { opened, setOpened, item, reset, view, setView } = useForms("view");
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
CommonModal,
|
|
14
|
+
{
|
|
15
|
+
view,
|
|
16
|
+
setView,
|
|
17
|
+
withButtons: false,
|
|
18
|
+
opened,
|
|
19
|
+
onClose: () => setOpened(false),
|
|
20
|
+
onExitTransitionEnd: reset,
|
|
21
|
+
...view === VIEW_MODE.OVERLAY ? overlayProps : {},
|
|
22
|
+
...view === VIEW_MODE.NORMAL ? normalProps : {},
|
|
23
|
+
...props,
|
|
24
|
+
title: props.title ?? `${item == null ? void 0 : item.show_title} (#${convertId(getItemId(item))})`,
|
|
25
|
+
children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "details", children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Tabs.List, { children: /* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }) }),
|
|
27
|
+
/* @__PURE__ */ jsx(Tabs.Panel, { value: "details", children: item && /* @__PURE__ */ jsx(
|
|
28
|
+
TabsDisplay,
|
|
29
|
+
{
|
|
30
|
+
columns: item.show_columns,
|
|
31
|
+
data: item.result,
|
|
32
|
+
label_columns: item.label_columns,
|
|
33
|
+
gridProps: { pt: "md" }
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] })
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
const TabsDisplay = ({ columns, data, label_columns, gridProps }) => {
|
|
41
|
+
return /* @__PURE__ */ jsx(Grid, { ...gridProps, children: columns.map((column) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx(Grid.Col, { span: 3, children: /* @__PURE__ */ jsx(Text, { size: "md", children: label_columns[column] }) }),
|
|
43
|
+
/* @__PURE__ */ jsx(Grid.Col, { span: 1, children: /* @__PURE__ */ jsx(Text, { size: "xs", children: ":" }) }),
|
|
44
|
+
/* @__PURE__ */ jsx(Grid.Col, { span: 8, children: /* @__PURE__ */ jsx(Text, { size: "md", children: getValue(data, column) }) })
|
|
45
|
+
] }, column)) });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
TabsDisplay,
|
|
49
|
+
ViewDialog
|
|
50
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { VIEW_MODE } from "fastapi-rtk/constants";
|
|
3
3
|
import { deepMerge, parseFromValuesOrFunc } from "fastapi-rtk/utils";
|
|
4
|
-
import { Icon } from "
|
|
4
|
+
import { Icon } from "../../../.external/esm/@iconify_react@6.0.1_react@18.3.1/@iconify/react/dist/iconify.mjs";
|
|
5
5
|
import { Modal, Box, Group, Button, CloseButton } from "@mantine/core";
|
|
6
|
-
import { useInfo } from "
|
|
7
|
-
import "
|
|
8
|
-
import { useTranslation } from "
|
|
6
|
+
import { useInfo } from "../hooks/auth/useInfo.mjs";
|
|
7
|
+
import "../Wrappers/Provider/Contexts/LangContext.mjs";
|
|
8
|
+
import { useTranslation } from "../../../.external/esm/react-i18next@15.7.3_i18next@25.5.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.2/react-i18next/dist/es/useTranslation.mjs";
|
|
9
9
|
function CommonModal({
|
|
10
10
|
children,
|
|
11
11
|
view,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useEffect } from "react";
|
|
3
3
|
import { Paper } from "@mantine/core";
|
|
4
|
-
import { AddDialog } from "../../
|
|
5
|
-
import {
|
|
4
|
+
import { AddDialog } from "../../Dialogs/AddDialog.mjs";
|
|
5
|
+
import { DeleteDialog } from "../../Dialogs/DeleteDialog.mjs";
|
|
6
|
+
import { EditDialog } from "../../Dialogs/EditDialog.mjs";
|
|
7
|
+
import { ViewDialog } from "../../Dialogs/ViewDialog.mjs";
|
|
6
8
|
import { LazyLoadWrapper } from "../../Wrappers/LazyLoadWrapper/LazyLoadWrapper.mjs";
|
|
7
9
|
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
8
10
|
import { useForms } from "../../hooks/api/useForms.mjs";
|
|
@@ -56,8 +58,10 @@ const DataGrid = forwardRef((props, ref) => {
|
|
|
56
58
|
const hideCheckbox = bulkActions === null;
|
|
57
59
|
return /* @__PURE__ */ jsxs(Paper, { ref, h: "100%", display: "flex", pos: "relative", style: { flexDirection: "column", ...styles }, children: [
|
|
58
60
|
/* @__PURE__ */ jsxs(LazyLoadWrapper, { cond: !!info, children: [
|
|
61
|
+
/* @__PURE__ */ jsx(ViewDialog, {}),
|
|
59
62
|
/* @__PURE__ */ jsx(AddDialog, { jsonForms: form == null ? void 0 : form.add }),
|
|
60
|
-
/* @__PURE__ */ jsx(EditDialog, { jsonForms: form == null ? void 0 : form.edit })
|
|
63
|
+
/* @__PURE__ */ jsx(EditDialog, { jsonForms: form == null ? void 0 : form.edit }),
|
|
64
|
+
/* @__PURE__ */ jsx(DeleteDialog, {})
|
|
61
65
|
] }),
|
|
62
66
|
!hideToolbar ? /* @__PURE__ */ jsx(
|
|
63
67
|
Toolbar,
|