fastapi-rtk 2.7.0 → 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/_virtual/index10.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index3.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index4.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index5.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index6.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index7.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index8.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index9.cjs +2 -2
- 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/_virtual/index10.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index6.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index7.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index8.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index9.mjs +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/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/validate/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/core/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/format/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/validation/index.cjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/validate/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/core/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/format/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/validation/index.mjs +1 -1
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useContextProps } from "./useContextProps.mjs";
|
|
3
|
-
import { useProps,
|
|
3
|
+
import { useProps, ActionIcon, Grid } from "@mantine/core";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import ForwardRef$1 from "../_virtual/arrow-down.mjs";
|
|
6
6
|
import ForwardRef from "../_virtual/arrow-up.mjs";
|
|
@@ -18,7 +18,8 @@ const useNavigationComponent = (props) => {
|
|
|
18
18
|
["aria-label"]: translations == null ? void 0 : translations.upAriaLabel,
|
|
19
19
|
onClick: onUp,
|
|
20
20
|
disabled: !enableUp,
|
|
21
|
-
...iconProps
|
|
21
|
+
...iconProps,
|
|
22
|
+
children: /* @__PURE__ */ jsx(ForwardRef, {})
|
|
22
23
|
},
|
|
23
24
|
rest,
|
|
24
25
|
{ withAllProps: false }
|
|
@@ -31,7 +32,8 @@ const useNavigationComponent = (props) => {
|
|
|
31
32
|
["aria-label"]: translations == null ? void 0 : translations.downAriaLabel,
|
|
32
33
|
onClick: onDown,
|
|
33
34
|
disabled: !enableDown,
|
|
34
|
-
...iconProps
|
|
35
|
+
...iconProps,
|
|
36
|
+
children: /* @__PURE__ */ jsx(ForwardRef$1, {})
|
|
35
37
|
},
|
|
36
38
|
rest,
|
|
37
39
|
{ withAllProps: false }
|
|
@@ -44,22 +46,44 @@ const useNavigationComponent = (props) => {
|
|
|
44
46
|
title: translations == null ? void 0 : translations.removeTooltip,
|
|
45
47
|
["aria-label"]: translations == null ? void 0 : translations.removeAriaLabel,
|
|
46
48
|
onClick: onDelete,
|
|
47
|
-
...iconProps
|
|
49
|
+
...iconProps,
|
|
50
|
+
children: /* @__PURE__ */ jsx(ForwardRef$2, {})
|
|
48
51
|
},
|
|
49
52
|
rest,
|
|
50
53
|
{ withAllProps: false }
|
|
51
54
|
);
|
|
55
|
+
const [ComponentUpCol, _up_col_props] = useContextProps(
|
|
56
|
+
`${componentName}.${componentIdentifier}.Up.Col`,
|
|
57
|
+
`${childPath}.${componentIdentifier}.Up.Col`,
|
|
58
|
+
{ span: "content", children: /* @__PURE__ */ jsx(ActionIcon, { ..._up_props }) },
|
|
59
|
+
rest,
|
|
60
|
+
{ withAllProps: false }
|
|
61
|
+
);
|
|
62
|
+
const [ComponentDownCol, _down_col_props] = useContextProps(
|
|
63
|
+
`${componentName}.${componentIdentifier}.Down.Col`,
|
|
64
|
+
`${childPath}.${componentIdentifier}.Down.Col`,
|
|
65
|
+
{ span: "content", children: /* @__PURE__ */ jsx(ActionIcon, { ..._down_props }) },
|
|
66
|
+
rest,
|
|
67
|
+
{ withAllProps: false }
|
|
68
|
+
);
|
|
69
|
+
const [ComponentRemoveCol, _remove_col_props] = useContextProps(
|
|
70
|
+
`${componentName}.${componentIdentifier}.Remove.Col`,
|
|
71
|
+
`${childPath}.${componentIdentifier}.Remove.Col`,
|
|
72
|
+
{ span: "content", children: /* @__PURE__ */ jsx(ActionIcon, { ..._remove_props }) },
|
|
73
|
+
rest,
|
|
74
|
+
{ withAllProps: false }
|
|
75
|
+
);
|
|
52
76
|
const ActionIconUp = useMemo(
|
|
53
|
-
() => ComponentUp === void 0 ?
|
|
54
|
-
[ComponentUp,
|
|
77
|
+
() => ComponentUp === void 0 ? ComponentUpCol === void 0 ? /* @__PURE__ */ jsx(Grid.Col, { ..._up_col_props }) : ComponentUpCol : ComponentUp,
|
|
78
|
+
[ComponentUp, ComponentUpCol, _up_col_props]
|
|
55
79
|
);
|
|
56
80
|
const ActionIconDown = useMemo(
|
|
57
|
-
() => ComponentDown === void 0 ?
|
|
58
|
-
[ComponentDown,
|
|
81
|
+
() => ComponentDown === void 0 ? ComponentDownCol === void 0 ? /* @__PURE__ */ jsx(Grid.Col, { ..._down_col_props }) : ComponentDownCol : ComponentDown,
|
|
82
|
+
[ComponentDown, ComponentDownCol, _down_col_props]
|
|
59
83
|
);
|
|
60
84
|
const ActionIconRemove = useMemo(
|
|
61
|
-
() => ComponentRemove === void 0 ?
|
|
62
|
-
[ComponentRemove,
|
|
85
|
+
() => ComponentRemove === void 0 ? ComponentRemoveCol === void 0 ? /* @__PURE__ */ jsx(Grid.Col, { ..._remove_col_props }) : ComponentRemoveCol : ComponentRemove,
|
|
86
|
+
[ComponentRemove, ComponentRemoveCol, _remove_col_props]
|
|
63
87
|
);
|
|
64
88
|
const SortButtons = useMemo(
|
|
65
89
|
() => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -74,10 +98,21 @@ const useNavigationComponent = (props) => {
|
|
|
74
98
|
);
|
|
75
99
|
const enableRemove = useMemo(() => !disableRemove && !!ActionIconRemove, [disableRemove, ActionIconRemove]);
|
|
76
100
|
const showComponent = useMemo(() => enableSort || enableRemove, [enableSort, enableRemove]);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
101
|
+
const [ComponentGrid, _grid_props] = useContextProps(
|
|
102
|
+
`${componentName}.${componentIdentifier}.Grid`,
|
|
103
|
+
`${childPath}.${componentIdentifier}.Grid`,
|
|
104
|
+
{
|
|
105
|
+
justify: "flex-end",
|
|
106
|
+
align: "center",
|
|
107
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
108
|
+
enableSort && SortButtons,
|
|
109
|
+
enableRemove && ActionIconRemove
|
|
110
|
+
] })
|
|
111
|
+
},
|
|
112
|
+
rest,
|
|
113
|
+
{ withAllProps: false }
|
|
114
|
+
);
|
|
115
|
+
return showComponent ? ComponentGrid === void 0 ? /* @__PURE__ */ jsx(Grid, { ..._grid_props }) : ComponentGrid : void 0;
|
|
81
116
|
};
|
|
82
117
|
export {
|
|
83
118
|
useNavigationComponent
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useContextProps } from "./useContextProps.mjs";
|
|
3
3
|
import { useProps, Input, ActionIcon, Flex, Tooltip, Indicator, Stack, Text } from "@mantine/core";
|
|
4
4
|
import ForwardRef$1 from "../_virtual/exclamation-circle.mjs";
|
|
@@ -64,7 +64,8 @@ const useToolbarComponent = (props) => {
|
|
|
64
64
|
id: "tooltip-add",
|
|
65
65
|
title: translations == null ? void 0 : translations.addTooltip,
|
|
66
66
|
onClick: onAdd,
|
|
67
|
-
...iconProps
|
|
67
|
+
...iconProps,
|
|
68
|
+
children: /* @__PURE__ */ jsx(ForwardRef, {})
|
|
68
69
|
},
|
|
69
70
|
rest,
|
|
70
71
|
{}
|
|
@@ -72,18 +73,37 @@ const useToolbarComponent = (props) => {
|
|
|
72
73
|
const TextLabel = ComponentLabel === void 0 ? (_label_props == null ? void 0 : _label_props.value) ? /* @__PURE__ */ jsx(Input.Label, { children: _label_props == null ? void 0 : _label_props.value }) : null : ComponentLabel;
|
|
73
74
|
const TextDescription = ComponentDescription === void 0 ? (_description_props == null ? void 0 : _description_props.value) ? /* @__PURE__ */ jsx(Input.Description, { children: _description_props == null ? void 0 : _description_props.value }) : null : ComponentDescription;
|
|
74
75
|
const IconValidation = ComponentValidation === void 0 ? /* @__PURE__ */ jsx(ValidationIcon, { ..._validation_props }) : ComponentValidation;
|
|
75
|
-
const ActionIconAdd = ComponentAdd === void 0 ? /* @__PURE__ */ jsx(ActionIcon, { ..._add_props
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const ActionIconAdd = ComponentAdd === void 0 ? /* @__PURE__ */ jsx(ActionIcon, { ..._add_props }) : ComponentAdd;
|
|
77
|
+
const [ComponentFlex, _flex_props] = useContextProps(
|
|
78
|
+
`${componentName}.${componentIdentifier}.Flex`,
|
|
79
|
+
`${path}.${componentIdentifier}.Flex`,
|
|
80
|
+
{
|
|
81
|
+
justify: "flex-start",
|
|
82
|
+
align: "center",
|
|
83
|
+
gap: "sm",
|
|
84
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
85
|
TextLabel,
|
|
81
86
|
IconValidation
|
|
82
|
-
] })
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
] })
|
|
88
|
+
},
|
|
89
|
+
rest,
|
|
90
|
+
{ withAllProps: false }
|
|
91
|
+
);
|
|
92
|
+
const flexEl = ComponentFlex === void 0 ? /* @__PURE__ */ jsx(Flex, { ..._flex_props }) : ComponentFlex;
|
|
93
|
+
const [ComponentWrapper, _wrapper_props] = useContextProps(
|
|
94
|
+
`${componentName}.${componentIdentifier}.Wrapper`,
|
|
95
|
+
`${path}.${componentIdentifier}.Wrapper`,
|
|
96
|
+
{
|
|
97
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
98
|
+
flexEl,
|
|
99
|
+
TextDescription
|
|
100
|
+
] })
|
|
101
|
+
},
|
|
102
|
+
rest,
|
|
103
|
+
{ withAllProps: false }
|
|
104
|
+
);
|
|
105
|
+
const wrapperEl = ComponentWrapper === void 0 ? /* @__PURE__ */ jsx(Input.Wrapper, { ..._wrapper_props }) : ComponentWrapper;
|
|
106
|
+
return [wrapperEl, ActionIconAdd];
|
|
87
107
|
};
|
|
88
108
|
export {
|
|
89
109
|
useToolbarComponent
|
|
@@ -2,12 +2,20 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { rankWith, isLabelable } from "@jsonforms/core";
|
|
3
3
|
import { withJsonFormsLabelProps } from "@jsonforms/react";
|
|
4
4
|
import { Title } from "@mantine/core";
|
|
5
|
+
import { useContextProps } from "../hooks/useContextProps.mjs";
|
|
5
6
|
const Component = (props) => {
|
|
6
7
|
const { text, visible } = props;
|
|
8
|
+
const [CustomComponent, _props] = useContextProps(
|
|
9
|
+
"Label",
|
|
10
|
+
`Label.${text}`,
|
|
11
|
+
{ fw: "bold", size: "xl", children: text },
|
|
12
|
+
props,
|
|
13
|
+
{ withAllProps: false }
|
|
14
|
+
);
|
|
7
15
|
if (!visible) {
|
|
8
16
|
return null;
|
|
9
17
|
}
|
|
10
|
-
return /* @__PURE__ */ jsx(Title, {
|
|
18
|
+
return CustomComponent === void 0 ? /* @__PURE__ */ jsx(Title, { ..._props }) : CustomComponent;
|
|
11
19
|
};
|
|
12
20
|
const mantineLabelTester = rankWith(1, isLabelable);
|
|
13
21
|
const MantineLabelRenderer = withJsonFormsLabelProps(Component);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Group } from "@mantine/core";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { useContextProps } from "../../hooks/useContextProps.mjs";
|
|
4
5
|
import { useToolbarComponent } from "../../hooks/useToolbarComponent.mjs";
|
|
5
6
|
const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar2(props) {
|
|
6
7
|
const { addItem, path, enabled, createDefault } = props;
|
|
@@ -10,10 +11,20 @@ const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar2(props) {
|
|
|
10
11
|
onAdd: addItem(path, createDefault()),
|
|
11
12
|
...props
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const [ToolbarGroup, _toolbarGroupProps] = useContextProps(
|
|
15
|
+
"Array.Header.Group",
|
|
16
|
+
`${path}.Header.Group`,
|
|
17
|
+
{
|
|
18
|
+
justify: "space-between",
|
|
19
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
ToolbarComponent,
|
|
21
|
+
enabled && ToolbarAdd
|
|
22
|
+
] })
|
|
23
|
+
},
|
|
24
|
+
props,
|
|
25
|
+
{ withAllProps: false }
|
|
26
|
+
);
|
|
27
|
+
return ToolbarGroup === void 0 ? /* @__PURE__ */ jsx(Group, { ..._toolbarGroupProps }) : ToolbarGroup;
|
|
17
28
|
});
|
|
18
29
|
export {
|
|
19
30
|
ArrayLayoutToolbar
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createId, removeId, findUISchema, Paths, computeChildLabel, update, moveDown, moveUp } from "@jsonforms/core";
|
|
3
3
|
import { JsonFormsDispatch, withJsonFormsContext } from "@jsonforms/react";
|
|
4
|
-
import {
|
|
4
|
+
import { Avatar, Stack, Group, Accordion, Center } from "@mantine/core";
|
|
5
5
|
import merge from "../../_virtual/merge.mjs";
|
|
6
6
|
import React, { useState, useEffect, useMemo, useCallback } from "react";
|
|
7
|
+
import { useContextProps } from "../../hooks/useContextProps.mjs";
|
|
7
8
|
import { useNavigationComponent } from "../../hooks/useNavigationComponent.mjs";
|
|
8
9
|
const Component = (props) => {
|
|
9
10
|
const [labelHtmlId] = useState(createId("expand-panel"));
|
|
@@ -45,24 +46,88 @@ const Component = (props) => {
|
|
|
45
46
|
showSortButtons,
|
|
46
47
|
...props
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
49
|
+
const [AvatarComp, _avatarProps] = useContextProps(
|
|
50
|
+
"Array.Item.Avatar",
|
|
51
|
+
`${childPath}.Item.Avatar`,
|
|
52
|
+
{ children: index + 1 },
|
|
53
|
+
props,
|
|
54
|
+
{ withAllProps: false }
|
|
55
|
+
);
|
|
56
|
+
const avatarEl = AvatarComp === void 0 ? /* @__PURE__ */ jsx(Avatar, { ..._avatarProps }) : AvatarComp;
|
|
57
|
+
const [StackComp, _stackProps] = useContextProps(
|
|
58
|
+
"Array.Item.Stack",
|
|
59
|
+
`${childPath}.Item.Stack`,
|
|
60
|
+
{ children: childLabel },
|
|
61
|
+
props,
|
|
62
|
+
{ withAllProps: false }
|
|
63
|
+
);
|
|
64
|
+
const stackEl = StackComp === void 0 ? /* @__PURE__ */ jsx(Stack, { ..._stackProps }) : StackComp;
|
|
65
|
+
const [GroupComp, _groupProps] = useContextProps(
|
|
66
|
+
"Array.Item.Group",
|
|
67
|
+
`${childPath}.Item.Group`,
|
|
68
|
+
{
|
|
69
|
+
justify: "space-between",
|
|
70
|
+
pr: "md",
|
|
71
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
+
stackEl,
|
|
73
|
+
NavigationComponent
|
|
74
|
+
] })
|
|
75
|
+
},
|
|
76
|
+
props,
|
|
77
|
+
{ withAllProps: false }
|
|
78
|
+
);
|
|
79
|
+
const groupEl = GroupComp === void 0 ? /* @__PURE__ */ jsx(Group, { ..._groupProps }) : GroupComp;
|
|
80
|
+
const [ControlComp, _controlProps] = useContextProps(
|
|
81
|
+
"Array.Item.Control",
|
|
82
|
+
`${childPath}.Item.Control`,
|
|
83
|
+
{ component: "div", icon: avatarEl, children: groupEl },
|
|
84
|
+
props,
|
|
85
|
+
{ withAllProps: false }
|
|
86
|
+
);
|
|
87
|
+
const controlEl = ControlComp === void 0 ? /* @__PURE__ */ jsx(Accordion.Control, { ..._controlProps }) : ControlComp;
|
|
88
|
+
const [CenterComp, _centerProps] = useContextProps(
|
|
89
|
+
"Array.Item.Center",
|
|
90
|
+
`${childPath}.Item.Center`,
|
|
91
|
+
{ children: controlEl },
|
|
92
|
+
props,
|
|
93
|
+
{ withAllProps: false }
|
|
94
|
+
);
|
|
95
|
+
const centerEl = CenterComp === void 0 ? /* @__PURE__ */ jsx(Center, { ..._centerProps }) : CenterComp;
|
|
96
|
+
const [PanelComp, _panelProps] = useContextProps(
|
|
97
|
+
"Array.Item.Panel",
|
|
98
|
+
`${childPath}.Item.Panel`,
|
|
99
|
+
{
|
|
100
|
+
children: /* @__PURE__ */ jsx(
|
|
101
|
+
JsonFormsDispatch,
|
|
102
|
+
{
|
|
103
|
+
enabled,
|
|
104
|
+
schema,
|
|
105
|
+
uischema: foundUISchema,
|
|
106
|
+
path: childPath,
|
|
107
|
+
renderers,
|
|
108
|
+
cells
|
|
109
|
+
},
|
|
110
|
+
childPath
|
|
111
|
+
)
|
|
112
|
+
},
|
|
113
|
+
props,
|
|
114
|
+
{ withAllProps: false }
|
|
115
|
+
);
|
|
116
|
+
const panelEl = PanelComp === void 0 ? /* @__PURE__ */ jsx(Accordion.Panel, { ..._panelProps }) : PanelComp;
|
|
117
|
+
const [ItemComp, _itemProps] = useContextProps(
|
|
118
|
+
"Array.Item.Accordion",
|
|
119
|
+
`${childPath}.Item.Accordion`,
|
|
120
|
+
{
|
|
121
|
+
value: childPath,
|
|
122
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
123
|
+
centerEl,
|
|
124
|
+
panelEl
|
|
125
|
+
] })
|
|
126
|
+
},
|
|
127
|
+
props,
|
|
128
|
+
{ withAllProps: false }
|
|
129
|
+
);
|
|
130
|
+
return ItemComp === void 0 ? /* @__PURE__ */ jsx(Accordion.Item, { value: childPath, ..._itemProps }) : ItemComp;
|
|
66
131
|
};
|
|
67
132
|
const MemoComponent = React.memo(Component);
|
|
68
133
|
const useCtxDispatchToExpandPanelProps = (dispatch) => ({
|
|
@@ -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 "@jsonforms/core";
|
|
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
|
};
|
|
@@ -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
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MantineObjectInputProps } from './types';
|
|
2
|
-
export declare function MantineObjectInput(props: MantineObjectInputProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare function MantineObjectInput(props: MantineObjectInputProps): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
package/dist/jsonforms/lib/complex/MantineTableControl/MantineTableControl.customizer.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,9 @@ import { ReactNode } from 'react';
|
|
|
5
5
|
* `name` selects the component's general properties, `path` selects the path-specific ones,
|
|
6
6
|
* `componentProps` and `jsonFormsProps` are the component / JSON forms properties, and the options
|
|
7
7
|
* toggle whether to include `all` properties and `componentProps`. Returns the optional custom
|
|
8
|
-
* component and the props merged from `componentProps` and `MantineThemeProvider`.
|
|
8
|
+
* component and the props merged from `componentProps` and `MantineThemeProvider`. A `component`
|
|
9
|
+
* customizer supplied as a function receives the fully-merged props (the same object spread onto
|
|
10
|
+
* the default element) as its `componentProps`, so it can re-render everything the default renders.
|
|
9
11
|
*/
|
|
10
12
|
export declare function useContextProps<TJsonForms>(name: string, path: string, componentProps: Record<string, any>, // #MUSTRECORD open-shape prop bag callers supply with arbitrary keys (`{ value, children }`, `{ legend, ...rest }`); typed-intersection signature breaks the spread call sites
|
|
11
13
|
jsonFormsProps: TJsonForms, { withAllProps, withComponentProps }?: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UseNavigationComponentProps } from './types';
|
|
2
|
-
export declare const useNavigationComponent: (props: UseNavigationComponentProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
2
|
+
export declare const useNavigationComponent: (props: UseNavigationComponentProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ComponentType, default as React } from 'react';
|
|
2
2
|
import { ExpandPanelRendererProps } from './types';
|
|
3
|
-
export declare const MemoComponent: React.MemoExoticComponent<(props: ExpandPanelRendererProps) => import("react/jsx-runtime").JSX.Element>;
|
|
3
|
+
export declare const MemoComponent: React.MemoExoticComponent<(props: ExpandPanelRendererProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null>;
|
|
4
4
|
export declare const ExpandPanelRenderer: ComponentType<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MantineArrayLayoutProps } from './types';
|
|
2
|
-
export declare const MantineArrayLayout: import('react').MemoExoticComponent<(props: MantineArrayLayoutProps) => import("react/jsx-runtime").JSX.Element>;
|
|
2
|
+
export declare const MantineArrayLayout: import('react').MemoExoticComponent<(props: MantineArrayLayoutProps) => string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -5,6 +5,8 @@ import { DeepMerged } from './types';
|
|
|
5
5
|
* @param objects - The objects to be merged.
|
|
6
6
|
* @returns The merged result object.
|
|
7
7
|
*
|
|
8
|
+
* A source value of `undefined` is skipped and never overrides an existing value; pass `null` to explicitly clear a key.
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
11
|
* const obj1 = { a: 1, b: { c: 2 } };
|
|
10
12
|
* const obj2 = { b: { d: 3 }, e: 4 };
|
package/package.json
CHANGED