fastapi-rtk 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineFileInput.cjs +13 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineObjectInput.cjs +23 -12
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/DeleteDialog.cjs +38 -7
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.cjs +16 -11
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +117 -23
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.cjs +30 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useContextProps.cjs +5 -7
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useNavigationComponent.cjs +48 -13
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useToolbarComponent.cjs +31 -11
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/labels/MantineLabelRenderer.cjs +9 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ArrayToolbar.cjs +15 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +83 -18
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +76 -43
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineHotizontalLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineVerticalLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineFileInput.mjs +16 -7
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineObjectInput.mjs +23 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/DeleteDialog.mjs +40 -9
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.mjs +17 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +118 -24
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.mjs +31 -5
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useContextProps.mjs +5 -7
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useNavigationComponent.mjs +49 -14
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useToolbarComponent.mjs +32 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/labels/MantineLabelRenderer.mjs +9 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ArrayToolbar.mjs +16 -5
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +85 -20
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +79 -46
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineHotizontalLayoutRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineVerticalLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/cjs/MantineInputs/MantineFileInput.cjs +13 -4
- package/dist/jsonforms/cjs/MantineInputs/MantineObjectInput.cjs +23 -12
- package/dist/jsonforms/cjs/complex/MantineArrayControl/DeleteDialog.cjs +38 -7
- package/dist/jsonforms/cjs/complex/MantineArrayControl/MantineArrayControl.cjs +16 -11
- package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +117 -23
- package/dist/jsonforms/cjs/complex/MantineTableControl/TableToolbar.cjs +30 -4
- package/dist/jsonforms/cjs/hooks/useContextProps.cjs +5 -7
- package/dist/jsonforms/cjs/hooks/useNavigationComponent.cjs +48 -13
- package/dist/jsonforms/cjs/hooks/useToolbarComponent.cjs +31 -11
- package/dist/jsonforms/cjs/labels/MantineLabelRenderer.cjs +9 -1
- package/dist/jsonforms/cjs/layouts/Array/ArrayToolbar.cjs +15 -4
- package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +83 -18
- package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +76 -43
- package/dist/jsonforms/cjs/layouts/MantineHotizontalLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/layouts/MantineVerticalLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/esm/MantineInputs/MantineFileInput.mjs +16 -7
- package/dist/jsonforms/esm/MantineInputs/MantineObjectInput.mjs +23 -12
- package/dist/jsonforms/esm/complex/MantineArrayControl/DeleteDialog.mjs +40 -9
- package/dist/jsonforms/esm/complex/MantineArrayControl/MantineArrayControl.mjs +17 -12
- package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +118 -24
- package/dist/jsonforms/esm/complex/MantineTableControl/TableToolbar.mjs +31 -5
- package/dist/jsonforms/esm/hooks/useContextProps.mjs +5 -7
- package/dist/jsonforms/esm/hooks/useNavigationComponent.mjs +49 -14
- package/dist/jsonforms/esm/hooks/useToolbarComponent.mjs +32 -12
- package/dist/jsonforms/esm/labels/MantineLabelRenderer.mjs +9 -1
- package/dist/jsonforms/esm/layouts/Array/ArrayToolbar.mjs +16 -5
- package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +85 -20
- package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +79 -46
- package/dist/jsonforms/esm/layouts/MantineHotizontalLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/esm/layouts/MantineVerticalLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/lib/MantineInputs/MantineObjectInput.d.ts +1 -1
- package/dist/jsonforms/lib/complex/MantineTableControl/MantineTableControl.customizer.test.d.ts +1 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/types.d.ts +1 -0
- package/dist/jsonforms/lib/hooks/useContextProps.d.ts +3 -1
- package/dist/jsonforms/lib/hooks/useNavigationComponent.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/Array/ExpandPanelRenderer.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/Array/MantineArrayLayout.d.ts +1 -1
- package/dist/utils/cjs/deepMerge/deepMerge.cjs +1 -1
- package/dist/utils/esm/deepMerge/deepMerge.mjs +1 -1
- package/dist/utils/lib/deepMerge/deepMerge.d.ts +2 -0
- package/package.json +1 -1
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useArrayHeaderErrors } from "../../hooks/useArrayHeaderErrors.mjs";
|
|
3
3
|
import { useContextProps } from "../../hooks/useContextProps.mjs";
|
|
4
|
-
import { createDefaultValue,
|
|
5
|
-
import {
|
|
4
|
+
import { createDefaultValue, Paths, computeLabel } from "../../../../../../../../.external/esm/@jsonforms_core@3.7.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
|
|
5
|
+
import { Accordion, Text, Stack } from "@mantine/core";
|
|
6
6
|
import map from "../../../../../_virtual/map.mjs";
|
|
7
7
|
import merge from "../../../../../_virtual/merge.mjs";
|
|
8
8
|
import range from "../../../../../_virtual/range.mjs";
|
|
@@ -33,50 +33,83 @@ const Component = (props) => {
|
|
|
33
33
|
const doDisableAdd = disableAdd || appliedUiSchemaOptions.disableAdd;
|
|
34
34
|
const doDisableRemove = disableRemove || appliedUiSchemaOptions.disableRemove;
|
|
35
35
|
const innerCreateDefaultValue = useCallback(() => createDefaultValue(props.schema, props.rootSchema), [props.schema]);
|
|
36
|
-
const [Component2, _props] = useContextProps("Array.Accordion", `${path}.Accordion`, {}, props, {
|
|
37
|
-
withAllProps: false
|
|
38
|
-
});
|
|
39
36
|
const headerErrors = useArrayHeaderErrors(path, schema);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
37
|
+
const [Component2, _props] = useContextProps(
|
|
38
|
+
"Array.Accordion",
|
|
39
|
+
`${path}.Accordion`,
|
|
40
|
+
{
|
|
41
|
+
variant: "separated",
|
|
42
|
+
children: map(range(data), (index) => {
|
|
43
|
+
const childPath = Paths.compose(path, `${index}`);
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
ExpandPanelRenderer,
|
|
46
|
+
{
|
|
47
|
+
enabled,
|
|
48
|
+
path,
|
|
49
|
+
childPath,
|
|
50
|
+
index,
|
|
51
|
+
rootSchema,
|
|
52
|
+
schema,
|
|
53
|
+
uischema,
|
|
54
|
+
uischemas,
|
|
55
|
+
renderers,
|
|
56
|
+
cells,
|
|
57
|
+
enableUp: index !== 0,
|
|
58
|
+
enableDown: index !== data - 1,
|
|
59
|
+
disableRemove: doDisableRemove,
|
|
60
|
+
config,
|
|
61
|
+
translations
|
|
62
|
+
},
|
|
63
|
+
index
|
|
64
|
+
);
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
props,
|
|
68
|
+
{ withAllProps: false }
|
|
69
|
+
);
|
|
70
|
+
const accordionEl = Component2 === void 0 ? /* @__PURE__ */ jsx(Accordion, { ..._props }) : Component2;
|
|
71
|
+
const [EmptyComponent, _emptyProps] = useContextProps(
|
|
72
|
+
"Array.Empty",
|
|
73
|
+
`${path}.Empty`,
|
|
74
|
+
{ ta: "center", children: translations.noDataMessage },
|
|
75
|
+
props,
|
|
76
|
+
{ withAllProps: false }
|
|
77
|
+
);
|
|
78
|
+
const emptyEl = EmptyComponent === void 0 ? /* @__PURE__ */ jsx(Text, { ..._emptyProps }) : EmptyComponent;
|
|
79
|
+
const [InnerStack, _innerStackProps] = useContextProps(
|
|
80
|
+
"Array.Items",
|
|
81
|
+
`${path}.Items`,
|
|
82
|
+
{ children: data > 0 ? accordionEl : emptyEl },
|
|
83
|
+
props,
|
|
84
|
+
{ withAllProps: false }
|
|
85
|
+
);
|
|
86
|
+
const itemsEl = InnerStack === void 0 ? /* @__PURE__ */ jsx(Stack, { ..._innerStackProps }) : InnerStack;
|
|
87
|
+
const [OuterStack, _outerStackProps] = useContextProps(
|
|
88
|
+
"Array.Stack",
|
|
89
|
+
`${path}.Stack`,
|
|
90
|
+
{
|
|
91
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
ArrayLayoutToolbar,
|
|
94
|
+
{
|
|
95
|
+
translations,
|
|
96
|
+
label: computeLabel(label, required ?? false, appliedUiSchemaOptions.hideRequiredAsterisk),
|
|
97
|
+
description,
|
|
98
|
+
errors: headerErrors,
|
|
99
|
+
path,
|
|
100
|
+
enabled,
|
|
101
|
+
addItem,
|
|
102
|
+
createDefault: innerCreateDefaultValue,
|
|
103
|
+
disableAdd: doDisableAdd
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
itemsEl
|
|
107
|
+
] })
|
|
108
|
+
},
|
|
109
|
+
props,
|
|
110
|
+
{ withAllProps: false }
|
|
111
|
+
);
|
|
112
|
+
return OuterStack === void 0 ? /* @__PURE__ */ jsx(Stack, { ..._outerStackProps }) : OuterStack;
|
|
80
113
|
};
|
|
81
114
|
const MantineArrayLayout = memo(Component);
|
|
82
115
|
export {
|
|
@@ -11,12 +11,12 @@ const Component = (props) => {
|
|
|
11
11
|
const [Component2, _props] = useContextProps(
|
|
12
12
|
"HorizontalLayout",
|
|
13
13
|
`${path}.HorizontalLayout`,
|
|
14
|
-
((_a = uischema.options) == null ? void 0 : _a.props) ?? {},
|
|
14
|
+
{ ...childProps, renderers, cells, ...((_a = uischema.options) == null ? void 0 : _a.props) ?? {} },
|
|
15
15
|
props,
|
|
16
16
|
{ withAllProps: false }
|
|
17
17
|
);
|
|
18
18
|
if (Component2 === void 0) {
|
|
19
|
-
return /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, ..._props
|
|
19
|
+
return /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, ..._props });
|
|
20
20
|
}
|
|
21
21
|
return Component2;
|
|
22
22
|
};
|
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineVerticalLayoutRenderer.mjs
CHANGED
|
@@ -11,12 +11,12 @@ const Component = (props) => {
|
|
|
11
11
|
const [Component2, _props] = useContextProps(
|
|
12
12
|
"VerticalLayout",
|
|
13
13
|
`${path}.VerticalLayout`,
|
|
14
|
-
((_a = uischema.options) == null ? void 0 : _a.props) ?? {},
|
|
14
|
+
{ ...childProps, renderers, cells, ...((_a = uischema.options) == null ? void 0 : _a.props) ?? {} },
|
|
15
15
|
props,
|
|
16
16
|
{ withAllProps: false }
|
|
17
17
|
);
|
|
18
18
|
if (Component2 === void 0) {
|
|
19
|
-
return /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, ..._props
|
|
19
|
+
return /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, ..._props });
|
|
20
20
|
}
|
|
21
21
|
return Component2;
|
|
22
22
|
};
|
|
@@ -19,13 +19,22 @@ const InnerMantineFileInput = (props) => {
|
|
|
19
19
|
const fileProps = useFileProps.useFileProps({ value, onChange: commonProps.onChange, accept, errors });
|
|
20
20
|
const componentProps = React.useMemo(() => ({ ...commonProps, ...fileProps }), [commonProps, fileProps]);
|
|
21
21
|
const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, rest);
|
|
22
|
+
const [BoxComponent, _boxProps] = useContextProps.useContextProps(
|
|
23
|
+
`${contextName}.Box`,
|
|
24
|
+
`${path}.Box`,
|
|
25
|
+
{
|
|
26
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
27
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.FileInput, { ..._props }),
|
|
28
|
+
utils.parseFromValuesOrFunc(children, { componentProps, jsonFormsProps: rest })
|
|
29
|
+
] })
|
|
30
|
+
},
|
|
31
|
+
rest,
|
|
32
|
+
{ withAllProps: false }
|
|
33
|
+
);
|
|
22
34
|
if (!rest.visible) {
|
|
23
35
|
return null;
|
|
24
36
|
}
|
|
25
|
-
return Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(utils.MemoWrapper, { componentName: `${componentName}-${path}`, ..._props, children: /* @__PURE__ */ jsxRuntime.
|
|
26
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.FileInput, { ..._props }),
|
|
27
|
-
utils.parseFromValuesOrFunc(children, { componentProps, jsonFormsProps: rest })
|
|
28
|
-
] }) }) : Component;
|
|
37
|
+
return Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(utils.MemoWrapper, { componentName: `${componentName}-${path}`, ..._props, children: BoxComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Box, { ..._boxProps }) : BoxComponent }) : Component;
|
|
29
38
|
};
|
|
30
39
|
function MantineFileInput(props) {
|
|
31
40
|
return /* @__PURE__ */ jsxRuntime.jsx(InnerMantineFileInput, { ...props, contextName: "File", componentName: "MantineFileInput" });
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const core = require("@jsonforms/core");
|
|
5
5
|
const react = require("@jsonforms/react");
|
|
6
|
+
const core$1 = require("@mantine/core");
|
|
6
7
|
const lodash = require("../_virtual/lodash.cjs");
|
|
7
8
|
const React = require("react");
|
|
9
|
+
const useContextProps = require("../hooks/useContextProps.cjs");
|
|
8
10
|
function MantineObjectInput(props) {
|
|
9
11
|
const { renderers, cells, uischemas, schema, path, visible, enabled, uischema, rootSchema } = props;
|
|
10
12
|
const label = "label" in props ? props.label : void 0;
|
|
@@ -23,20 +25,29 @@ function MantineObjectInput(props) {
|
|
|
23
25
|
),
|
|
24
26
|
[uischemas, schema, path, label, uischema, rootSchema]
|
|
25
27
|
);
|
|
28
|
+
const [Component, _props] = useContextProps.useContextProps(
|
|
29
|
+
"Object",
|
|
30
|
+
`${path}.Object`,
|
|
31
|
+
{
|
|
32
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
react.JsonFormsDispatch,
|
|
34
|
+
{
|
|
35
|
+
visible,
|
|
36
|
+
enabled,
|
|
37
|
+
schema,
|
|
38
|
+
uischema: detailUiSchema,
|
|
39
|
+
path,
|
|
40
|
+
renderers,
|
|
41
|
+
cells
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
},
|
|
45
|
+
props,
|
|
46
|
+
{ withAllProps: false }
|
|
47
|
+
);
|
|
26
48
|
if (!visible) {
|
|
27
49
|
return null;
|
|
28
50
|
}
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
-
react.JsonFormsDispatch,
|
|
31
|
-
{
|
|
32
|
-
visible,
|
|
33
|
-
enabled,
|
|
34
|
-
schema,
|
|
35
|
-
uischema: detailUiSchema,
|
|
36
|
-
path,
|
|
37
|
-
renderers,
|
|
38
|
-
cells
|
|
39
|
-
}
|
|
40
|
-
);
|
|
51
|
+
return Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core$1.Box, { ..._props }) : Component;
|
|
41
52
|
}
|
|
42
53
|
exports.MantineObjectInput = MantineObjectInput;
|
|
@@ -3,14 +3,45 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const core = require("@mantine/core");
|
|
5
5
|
const React = require("react");
|
|
6
|
+
const useContextProps = require("../../hooks/useContextProps.cjs");
|
|
6
7
|
const DeleteDialog = React.memo(function DeleteDialog2(props) {
|
|
7
8
|
const { open, onClose, onConfirm, onCancel, title, message, acceptText, declineText } = props;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
const [FlexComponent, _flexProps] = useContextProps.useContextProps(
|
|
10
|
+
"Array.DeleteDialog.Flex",
|
|
11
|
+
"Array.DeleteDialog.Flex",
|
|
12
|
+
{
|
|
13
|
+
justify: "flex-end",
|
|
14
|
+
align: "center",
|
|
15
|
+
gap: "md",
|
|
16
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Button, { onClick: onCancel, children: declineText }),
|
|
18
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Button, { onClick: onConfirm, children: acceptText })
|
|
19
|
+
] })
|
|
20
|
+
},
|
|
21
|
+
props,
|
|
22
|
+
{ withAllProps: false }
|
|
23
|
+
);
|
|
24
|
+
const flexEl = FlexComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Flex, { ..._flexProps }) : FlexComponent;
|
|
25
|
+
const [StackComponent, _stackProps] = useContextProps.useContextProps(
|
|
26
|
+
"Array.DeleteDialog.Stack",
|
|
27
|
+
"Array.DeleteDialog.Stack",
|
|
28
|
+
{
|
|
29
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Text, { children: message }),
|
|
31
|
+
flexEl
|
|
32
|
+
] })
|
|
33
|
+
},
|
|
34
|
+
props,
|
|
35
|
+
{ withAllProps: false }
|
|
36
|
+
);
|
|
37
|
+
const stackEl = StackComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Stack, { ..._stackProps }) : StackComponent;
|
|
38
|
+
const [ModalComponent, _modalProps] = useContextProps.useContextProps(
|
|
39
|
+
"Array.DeleteDialog",
|
|
40
|
+
"Array.DeleteDialog",
|
|
41
|
+
{ withCloseButton: false, centered: true, title, keepMounted: true, opened: open, onClose, children: stackEl },
|
|
42
|
+
props,
|
|
43
|
+
{ withAllProps: false }
|
|
44
|
+
);
|
|
45
|
+
return ModalComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Modal, { opened: open, onClose, ..._modalProps }) : ModalComponent;
|
|
15
46
|
});
|
|
16
47
|
exports.DeleteDialog = DeleteDialog;
|
|
@@ -5,6 +5,7 @@ const core = require("@jsonforms/core");
|
|
|
5
5
|
const react = require("@jsonforms/react");
|
|
6
6
|
const core$1 = require("@mantine/core");
|
|
7
7
|
const React = require("react");
|
|
8
|
+
const useContextProps = require("../../hooks/useContextProps.cjs");
|
|
8
9
|
const useThemeCustomizer = require("../../hooks/useThemeCustomizer.cjs");
|
|
9
10
|
const isEnumArrayArrayControl = require("../../testers/isEnumArrayArrayControl.cjs");
|
|
10
11
|
const isFilesControl = require("../../testers/isFilesControl.cjs");
|
|
@@ -55,17 +56,21 @@ const Component = (props) => {
|
|
|
55
56
|
)
|
|
56
57
|
] });
|
|
57
58
|
};
|
|
58
|
-
const FileArrayComponent = (props) =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
)
|
|
59
|
+
const FileArrayComponent = (props) => {
|
|
60
|
+
const [HiddenBox, _hiddenBoxProps] = useContextProps.useContextProps(
|
|
61
|
+
"Array.File.HiddenValidation",
|
|
62
|
+
"Array.File.HiddenValidation",
|
|
63
|
+
{ style: { display: "none" } },
|
|
64
|
+
props,
|
|
65
|
+
{ withAllProps: false }
|
|
66
|
+
);
|
|
67
|
+
const theme = useThemeCustomizer.useThemeCustomizer({
|
|
68
|
+
"Table.Header.Validation": {
|
|
69
|
+
component: HiddenBox === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core$1.Box, { ..._hiddenBoxProps }) : HiddenBox
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core$1.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props }) });
|
|
73
|
+
};
|
|
69
74
|
const mantineArrayControlTester = core.rankWith(
|
|
70
75
|
1,
|
|
71
76
|
core.or(core.isObjectArrayControl, core.isPrimitiveArrayControl, isEnumArrayArrayControl.isEnumArrayArrayControl, isJsonArrayControl.isJsonArrayControl)
|
|
@@ -68,8 +68,18 @@ const getValidColumnProps = (scopedSchema) => {
|
|
|
68
68
|
return [""];
|
|
69
69
|
};
|
|
70
70
|
const EmptyTable = (props) => {
|
|
71
|
-
const { numColumns, translations } = props;
|
|
72
|
-
|
|
71
|
+
const { numColumns, translations, path } = props;
|
|
72
|
+
const [EmptyComponent, _emptyProps] = useContextProps.useContextProps(
|
|
73
|
+
"Table.Empty",
|
|
74
|
+
`${path}.Empty`,
|
|
75
|
+
{
|
|
76
|
+
colSpan: numColumns,
|
|
77
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { colSpan: numColumns, children: /* @__PURE__ */ jsxRuntime.jsx(core.Text, { ta: "center", children: translations.noDataMessage }) })
|
|
78
|
+
},
|
|
79
|
+
props,
|
|
80
|
+
{ withAllProps: false }
|
|
81
|
+
);
|
|
82
|
+
return EmptyComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table.Tr, { ..._emptyProps }) : EmptyComponent;
|
|
73
83
|
};
|
|
74
84
|
const TableHeaderCell = React.memo(function TableHeaderCell2(props) {
|
|
75
85
|
const { title, rowPath, propName, index } = props;
|
|
@@ -121,24 +131,57 @@ const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props)
|
|
|
121
131
|
[path, propName]
|
|
122
132
|
);
|
|
123
133
|
const index = React.useMemo(() => path.split(".").slice(-1)[0], [path]);
|
|
134
|
+
const rowIndex = React.useMemo(() => path.split(".")[originalPath.split(".").length], [path, originalPath]);
|
|
124
135
|
const generalRowProps = core.useProps("Table.Row", {}, {});
|
|
125
136
|
const arrayRowProps = core.useProps(originalPath, {}, {});
|
|
126
137
|
const indexedRowProps = core.useProps(`Table.Row.${index}`, {}, {});
|
|
138
|
+
const propRowProps = core.useProps(propName ? `${originalPath}.${propName}` : path, {}, {});
|
|
139
|
+
const numberedRowProps = core.useProps(propName ? `Table.Row.${rowIndex}.${propName}` : `Table.Row.${rowIndex}`, {}, {});
|
|
127
140
|
const specificRowProps = core.useProps(path, {}, {});
|
|
128
141
|
const { component, props: _props } = React.useMemo(
|
|
129
142
|
// #MUSTASSERT user-configured MantineThemeProvider row overrides flow through deepMerge as `{}`; narrow to the RowOverride shape consumed below
|
|
130
|
-
() => utils.deepMerge(
|
|
131
|
-
|
|
143
|
+
() => utils.deepMerge(
|
|
144
|
+
generalRowProps,
|
|
145
|
+
arrayRowProps,
|
|
146
|
+
indexedRowProps,
|
|
147
|
+
propRowProps,
|
|
148
|
+
numberedRowProps,
|
|
149
|
+
specificRowProps
|
|
150
|
+
),
|
|
151
|
+
[generalRowProps, arrayRowProps, indexedRowProps, propRowProps, numberedRowProps, specificRowProps]
|
|
132
152
|
);
|
|
133
153
|
const theme = useThemeCustomizer.useThemeCustomizer({ [path]: { component, props: _props } });
|
|
134
154
|
const [, _tdProps] = useContextProps.useContextProps("Table.Row.Td", `${originalPath}.Td`, { maw: 0 }, props, {
|
|
135
155
|
withAllProps: false
|
|
136
156
|
});
|
|
137
|
-
const [, __tdProps] = useContextProps.useContextProps(
|
|
157
|
+
const [, __tdProps] = useContextProps.useContextProps(
|
|
158
|
+
`Table.Row.${index}.Td`,
|
|
159
|
+
propName ? `${originalPath}.${propName}.Td` : `${path}.Td`,
|
|
160
|
+
{},
|
|
161
|
+
props,
|
|
162
|
+
{
|
|
163
|
+
withAllProps: false,
|
|
164
|
+
withComponentProps: false
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
const [, ___tdProps] = useContextProps.useContextProps(`${path}.Td`, `${path}.Td`, {}, props, {
|
|
138
168
|
withAllProps: false,
|
|
139
169
|
withComponentProps: false
|
|
140
170
|
});
|
|
141
|
-
const
|
|
171
|
+
const [, _numberedTdProps] = useContextProps.useContextProps(
|
|
172
|
+
propName ? `Table.Row.${rowIndex}.${propName}.Td` : `Table.Row.${rowIndex}.Td`,
|
|
173
|
+
propName ? `Table.Row.${rowIndex}.${propName}.Td` : `Table.Row.${rowIndex}.Td`,
|
|
174
|
+
{},
|
|
175
|
+
props,
|
|
176
|
+
{
|
|
177
|
+
withAllProps: false,
|
|
178
|
+
withComponentProps: false
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
const tdProps = React.useMemo(
|
|
182
|
+
() => utils.deepMerge(_tdProps, __tdProps, _numberedTdProps, ___tdProps),
|
|
183
|
+
[_tdProps, __tdProps, _numberedTdProps, ___tdProps]
|
|
184
|
+
);
|
|
142
185
|
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { ...tdProps, children: schema.properties ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
186
|
react.DispatchCell,
|
|
144
187
|
{
|
|
@@ -182,9 +225,19 @@ const NonEmptyRowComponent = (props) => {
|
|
|
182
225
|
withAllProps: false
|
|
183
226
|
});
|
|
184
227
|
const trProps = React.useMemo(() => utils.deepMerge(_trProps, __trProps), [_trProps, __trProps]);
|
|
228
|
+
const [ActionsComponent, _actionsProps] = useContextProps.useContextProps(
|
|
229
|
+
"Table.Row.Actions",
|
|
230
|
+
`${childPath}.Row.Actions`,
|
|
231
|
+
{
|
|
232
|
+
style: showSortButtons ? styles.fixedCell : styles.fixedCellSmall,
|
|
233
|
+
children: NavigationComponent
|
|
234
|
+
},
|
|
235
|
+
props,
|
|
236
|
+
{ withAllProps: false }
|
|
237
|
+
);
|
|
185
238
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Table.Tr, { ...trProps, children: [
|
|
186
239
|
generateCells(NonEmptyCell, schema, childPath, enabled, cells),
|
|
187
|
-
NavigationComponent ? /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, {
|
|
240
|
+
NavigationComponent ? ActionsComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { ..._actionsProps }) : ActionsComponent : null
|
|
188
241
|
] }, childPath);
|
|
189
242
|
};
|
|
190
243
|
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
@@ -205,7 +258,7 @@ const TableRows = (props) => {
|
|
|
205
258
|
} = props;
|
|
206
259
|
const isEmptyTable = data === 0;
|
|
207
260
|
if (isEmptyTable) {
|
|
208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(EmptyTable, { numColumns: getValidColumnProps(schema).length + 1, translations });
|
|
261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EmptyTable, { numColumns: getValidColumnProps(schema).length + 1, translations, path });
|
|
209
262
|
}
|
|
210
263
|
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
211
264
|
return range(data).map((index) => {
|
|
@@ -256,13 +309,32 @@ const MantineTableControl = React.memo(function MantineTableControl2(props) {
|
|
|
256
309
|
const headerCells = isObjectSchema ? generateCells(TableHeaderCell, schema, path, enabled, cells) : void 0;
|
|
257
310
|
const isEnabled = enabled && !doDisableAdd;
|
|
258
311
|
const headerErrors = useArrayHeaderErrors.useArrayHeaderErrors(path, schema);
|
|
259
|
-
const [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
312
|
+
const [HeaderActionsComponent, _headerActionsProps] = useContextProps.useContextProps(
|
|
313
|
+
"Table.Header.Actions",
|
|
314
|
+
`${path}.Header.Actions`,
|
|
315
|
+
{},
|
|
316
|
+
props,
|
|
317
|
+
{ withAllProps: false }
|
|
318
|
+
);
|
|
319
|
+
const headerActionsEl = HeaderActionsComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table.Th, { ..._headerActionsProps }) : HeaderActionsComponent;
|
|
320
|
+
const [HeaderTrComponent, _headerTrProps] = useContextProps.useContextProps(
|
|
321
|
+
"Table.Header.Tr",
|
|
322
|
+
`${path}.Header.Tr`,
|
|
323
|
+
{
|
|
324
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
325
|
+
headerCells,
|
|
326
|
+
isEnabled ? headerActionsEl : null
|
|
327
|
+
] })
|
|
328
|
+
},
|
|
329
|
+
props,
|
|
330
|
+
{ withAllProps: false }
|
|
331
|
+
);
|
|
332
|
+
const headerTrEl = HeaderTrComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table.Tr, { ..._headerTrProps }) : HeaderTrComponent;
|
|
333
|
+
const [TheadComponent, _theadProps] = useContextProps.useContextProps(
|
|
334
|
+
"Table.Thead",
|
|
335
|
+
`${path}.Thead`,
|
|
336
|
+
{
|
|
337
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
266
338
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
267
339
|
TableToolbar.TableToolbar,
|
|
268
340
|
{
|
|
@@ -279,15 +351,37 @@ const MantineTableControl = React.memo(function MantineTableControl2(props) {
|
|
|
279
351
|
translations
|
|
280
352
|
}
|
|
281
353
|
),
|
|
282
|
-
isObjectSchema &&
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
354
|
+
isObjectSchema && headerTrEl
|
|
355
|
+
] })
|
|
356
|
+
},
|
|
357
|
+
props,
|
|
358
|
+
{ withAllProps: false }
|
|
359
|
+
);
|
|
360
|
+
const theadEl = TheadComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table.Thead, { ..._theadProps }) : TheadComponent;
|
|
361
|
+
const [TbodyComponent, _tbodyProps] = useContextProps.useContextProps(
|
|
362
|
+
"Table.Tbody",
|
|
363
|
+
`${path}.Tbody`,
|
|
364
|
+
{ children: /* @__PURE__ */ jsxRuntime.jsx(TableRows, { ...props, disableRemove: doDisableRemove }) },
|
|
365
|
+
props,
|
|
366
|
+
{ withAllProps: false }
|
|
367
|
+
);
|
|
368
|
+
const tbodyEl = TbodyComponent === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table.Tbody, { ..._tbodyProps }) : TbodyComponent;
|
|
369
|
+
const [Component, _props] = useContextProps.useContextProps(
|
|
370
|
+
"Table",
|
|
371
|
+
`${path}.Table`,
|
|
372
|
+
{
|
|
373
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
374
|
+
theadEl,
|
|
375
|
+
tbodyEl
|
|
376
|
+
] })
|
|
377
|
+
},
|
|
378
|
+
props,
|
|
379
|
+
{ withAllProps: false }
|
|
380
|
+
);
|
|
381
|
+
if (!visible) {
|
|
382
|
+
return null;
|
|
289
383
|
}
|
|
290
|
-
return Component;
|
|
384
|
+
return Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Table, { ..._props }) : Component;
|
|
291
385
|
});
|
|
292
386
|
exports.MantineTableControl = MantineTableControl;
|
|
293
387
|
exports.NonEmptyRow = NonEmptyRow;
|
|
@@ -4,6 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const core = require("@jsonforms/core");
|
|
5
5
|
const core$1 = require("@mantine/core");
|
|
6
6
|
const React = require("react");
|
|
7
|
+
const useContextProps = require("../../hooks/useContextProps.cjs");
|
|
7
8
|
const useToolbarComponent = require("../../hooks/useToolbarComponent.cjs");
|
|
8
9
|
const NoBorderTableCell = require("./NoBorderTableCell.cjs");
|
|
9
10
|
const fixedCellSmall = {
|
|
@@ -18,9 +19,34 @@ const TableToolbar = React.memo(function TableToolbar2(props) {
|
|
|
18
19
|
onAdd: addItem(path, core.createDefaultValue(schema, rootSchema)),
|
|
19
20
|
...props
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const [ToolbarCell, _toolbarCellProps] = useContextProps.useContextProps(
|
|
23
|
+
"Table.Header.Toolbar.Cell",
|
|
24
|
+
`${path}.Header.Toolbar.Cell`,
|
|
25
|
+
{ p: 0, colSpan: numColumns, children: ToolbarComponent },
|
|
26
|
+
props,
|
|
27
|
+
{ withAllProps: false }
|
|
28
|
+
);
|
|
29
|
+
const [ToolbarAddCell, _toolbarAddCellProps] = useContextProps.useContextProps(
|
|
30
|
+
"Table.Header.Toolbar.Add",
|
|
31
|
+
`${path}.Header.Toolbar.Add`,
|
|
32
|
+
{ p: 0, align: "right", style: fixedCellSmall, children: ToolbarAdd },
|
|
33
|
+
props,
|
|
34
|
+
{ withAllProps: false }
|
|
35
|
+
);
|
|
36
|
+
const toolbarCellEl = ToolbarCell === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { ..._toolbarCellProps }) : ToolbarCell;
|
|
37
|
+
const toolbarAddCellEl = ToolbarAddCell === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { ..._toolbarAddCellProps }) : ToolbarAddCell;
|
|
38
|
+
const [ToolbarTr, _toolbarTrProps] = useContextProps.useContextProps(
|
|
39
|
+
"Table.Header.Toolbar",
|
|
40
|
+
`${path}.Header.Toolbar`,
|
|
41
|
+
{
|
|
42
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
43
|
+
toolbarCellEl,
|
|
44
|
+
enabled && ToolbarAdd && toolbarAddCellEl
|
|
45
|
+
] })
|
|
46
|
+
},
|
|
47
|
+
props,
|
|
48
|
+
{ withAllProps: false }
|
|
49
|
+
);
|
|
50
|
+
return ToolbarTr === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core$1.Table.Tr, { ..._toolbarTrProps }) : ToolbarTr;
|
|
25
51
|
});
|
|
26
52
|
exports.TableToolbar = TableToolbar;
|
|
@@ -13,12 +13,10 @@ function useContextProps(name, path, componentProps, jsonFormsProps, { withAllPr
|
|
|
13
13
|
() => utils.deepMerge(withAllProps ? allProps : void 0, _componentProps, contextProps),
|
|
14
14
|
[_componentProps, allProps, contextProps, withAllProps]
|
|
15
15
|
);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
];
|
|
16
|
+
const mergedProps = {
|
|
17
|
+
...withComponentProps ? componentProps : {},
|
|
18
|
+
...utils.parseFromValuesOrFunc(props, { componentProps, jsonFormsProps })
|
|
19
|
+
};
|
|
20
|
+
return [utils.parseFromValuesOrFunc(component, { componentProps: mergedProps, jsonFormsProps }), mergedProps];
|
|
23
21
|
}
|
|
24
22
|
exports.useContextProps = useContextProps;
|