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
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const utils = require("fastapi-rtk/utils");
|
|
5
|
-
const core = require("@mantine/core");
|
|
6
|
-
const RelationPanel = require("./RelationPanel.cjs");
|
|
7
|
-
function ViewDialog({ item, info, opened, onClose, ...props }) {
|
|
8
|
-
const defaultProps = {
|
|
9
|
-
modal: {},
|
|
10
|
-
tabs: {},
|
|
11
|
-
tabsList: {},
|
|
12
|
-
tabsPanel: {}
|
|
13
|
-
};
|
|
14
|
-
const { modal, tabs, tabsList, tabsPanel } = core.useProps("ViewDialog", defaultProps, props);
|
|
15
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
-
core.Modal,
|
|
17
|
-
{
|
|
18
|
-
opened,
|
|
19
|
-
onClose,
|
|
20
|
-
title: `${item == null ? void 0 : item.show_title} (#${utils.convertId(utils.getItemId(item))})`,
|
|
21
|
-
size: "lg",
|
|
22
|
-
centered: true,
|
|
23
|
-
zIndex: 1e3,
|
|
24
|
-
...modal,
|
|
25
|
-
children: item && /* @__PURE__ */ jsxRuntime.jsxs(core.Tabs, { defaultValue: "details", ...tabs, children: [
|
|
26
|
-
/* @__PURE__ */ jsxRuntime.jsxs(core.Tabs.List, { ...tabsList, children: [
|
|
27
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Tab, { value: "details", children: "Details" }),
|
|
28
|
-
info.relations.map((relation, index) => {
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Tab, { value: relation.name, children: relation.name }, index);
|
|
30
|
-
})
|
|
31
|
-
] }),
|
|
32
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Panel, { pt: "xs", value: "details", ...tabsPanel, children: /* @__PURE__ */ jsxRuntime.jsx(core.Paper, { p: "xs", withBorder: true, children: /* @__PURE__ */ jsxRuntime.jsx(core.Stack, { spacing: "md", children: /* @__PURE__ */ jsxRuntime.jsx(core.ScrollArea, { h: 450, type: "auto", children: item.show_columns.map((column, index) => {
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(core.Grid, { maw: 500, children: [
|
|
34
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 4, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "md", children: item.label_columns[column] }) }),
|
|
35
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 1, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "xs", children: ":" }) }),
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: 6, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "md", children: utils.getValue(item.result, column) }) })
|
|
37
|
-
] }, index);
|
|
38
|
-
}) }) }) }) }),
|
|
39
|
-
info.relations.map((relation, index) => {
|
|
40
|
-
return /* @__PURE__ */ jsxRuntime.jsx(core.Tabs.Panel, { pt: "xs", value: relation.name, children: /* @__PURE__ */ jsxRuntime.jsx(core.Paper, { withBorder: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
-
RelationPanel,
|
|
42
|
-
{
|
|
43
|
-
relatedPath: relation.path,
|
|
44
|
-
id: utils.convertId(utils.getItemId(item)),
|
|
45
|
-
foreign_key: relation.foreign_key,
|
|
46
|
-
type: relation.type
|
|
47
|
-
}
|
|
48
|
-
) }) }, index);
|
|
49
|
-
})
|
|
50
|
-
] })
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
exports.ViewDialog = ViewDialog;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { urlJoin } from "fastapi-rtk/utils";
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import { DataGrid } from "../../Tables/DataGrid/DataGrid.mjs";
|
|
5
|
-
import { ApiProvider } from "../../Wrappers/ApiProvider/ApiProvider.mjs";
|
|
6
|
-
import { useApi } from "../../hooks/api/useApi.mjs";
|
|
7
|
-
function RelationPanel({ relatedPath, ...relation }) {
|
|
8
|
-
const { path } = useApi();
|
|
9
|
-
urlJoin(
|
|
10
|
-
path ? path.substring(0, path.lastIndexOf("/")) : "",
|
|
11
|
-
relatedPath.substring(0, relatedPath.lastIndexOf("/"))
|
|
12
|
-
);
|
|
13
|
-
return /* @__PURE__ */ jsx(ApiProvider, { resource_name: relatedPath.replace("/", ""), relation, children: /* @__PURE__ */ jsx(DataGrid, { hideToolbar: true, hideDownload: false }) });
|
|
14
|
-
}
|
|
15
|
-
const RelationPanel$1 = memo(RelationPanel);
|
|
16
|
-
export {
|
|
17
|
-
RelationPanel$1 as default
|
|
18
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { convertId, getValue, getItemId } from "fastapi-rtk/utils";
|
|
3
|
-
import { useProps, Modal, Tabs, Paper, Stack, ScrollArea, Grid, Text } from "@mantine/core";
|
|
4
|
-
import RelationPanel from "./RelationPanel.mjs";
|
|
5
|
-
function ViewDialog({ item, info, opened, onClose, ...props }) {
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
modal: {},
|
|
8
|
-
tabs: {},
|
|
9
|
-
tabsList: {},
|
|
10
|
-
tabsPanel: {}
|
|
11
|
-
};
|
|
12
|
-
const { modal, tabs, tabsList, tabsPanel } = useProps("ViewDialog", defaultProps, props);
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
Modal,
|
|
15
|
-
{
|
|
16
|
-
opened,
|
|
17
|
-
onClose,
|
|
18
|
-
title: `${item == null ? void 0 : item.show_title} (#${convertId(getItemId(item))})`,
|
|
19
|
-
size: "lg",
|
|
20
|
-
centered: true,
|
|
21
|
-
zIndex: 1e3,
|
|
22
|
-
...modal,
|
|
23
|
-
children: item && /* @__PURE__ */ jsxs(Tabs, { defaultValue: "details", ...tabs, children: [
|
|
24
|
-
/* @__PURE__ */ jsxs(Tabs.List, { ...tabsList, children: [
|
|
25
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }),
|
|
26
|
-
info.relations.map((relation, index) => {
|
|
27
|
-
return /* @__PURE__ */ jsx(Tabs.Tab, { value: relation.name, children: relation.name }, index);
|
|
28
|
-
})
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ jsx(Tabs.Panel, { pt: "xs", value: "details", ...tabsPanel, children: /* @__PURE__ */ jsx(Paper, { p: "xs", withBorder: true, children: /* @__PURE__ */ jsx(Stack, { spacing: "md", children: /* @__PURE__ */ jsx(ScrollArea, { h: 450, type: "auto", children: item.show_columns.map((column, index) => {
|
|
31
|
-
return /* @__PURE__ */ jsxs(Grid, { maw: 500, children: [
|
|
32
|
-
/* @__PURE__ */ jsx(Grid.Col, { span: 4, children: /* @__PURE__ */ jsx(Text, { size: "md", children: item.label_columns[column] }) }),
|
|
33
|
-
/* @__PURE__ */ jsx(Grid.Col, { span: 1, children: /* @__PURE__ */ jsx(Text, { size: "xs", children: ":" }) }),
|
|
34
|
-
/* @__PURE__ */ jsx(Grid.Col, { span: 6, children: /* @__PURE__ */ jsx(Text, { size: "md", children: getValue(item.result, column) }) })
|
|
35
|
-
] }, index);
|
|
36
|
-
}) }) }) }) }),
|
|
37
|
-
info.relations.map((relation, index) => {
|
|
38
|
-
return /* @__PURE__ */ jsx(Tabs.Panel, { pt: "xs", value: relation.name, children: /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(
|
|
39
|
-
RelationPanel,
|
|
40
|
-
{
|
|
41
|
-
relatedPath: relation.path,
|
|
42
|
-
id: convertId(getItemId(item)),
|
|
43
|
-
foreign_key: relation.foreign_key,
|
|
44
|
-
type: relation.type
|
|
45
|
-
}
|
|
46
|
-
) }) }, index);
|
|
47
|
-
})
|
|
48
|
-
] })
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
ViewDialog
|
|
54
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|