fastapi-rtk 0.2.52 → 0.2.54
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/map.cjs +6 -0
- package/dist/.bundled/jsonforms/cjs/_virtual/reduce.cjs +5 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/toPairs.cjs +5 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.cjs +6 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineObjectControl.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +11 -91
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.cjs +10 -54
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useNavigationComponent.cjs +83 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useToolbarComponent.cjs +88 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/labels/MantineLabelRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ArrayToolbar.cjs +20 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +147 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +81 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayoutRenderer.cjs +21 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineGroupLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/renderers/mantineRenderers.cjs +7 -4
- package/dist/.bundled/jsonforms/esm/_virtual/map.mjs +7 -0
- package/dist/.bundled/jsonforms/esm/_virtual/reduce.mjs +6 -1
- package/dist/.bundled/jsonforms/esm/_virtual/toPairs.mjs +6 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.mjs +7 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineObjectControl.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +13 -93
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.mjs +12 -56
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useNavigationComponent.mjs +83 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useToolbarComponent.mjs +88 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/labels/MantineLabelRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ArrayToolbar.mjs +20 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +147 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +81 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayoutRenderer.mjs +21 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineGroupLayoutRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/renderers/mantineRenderers.mjs +12 -9
- package/dist/.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs +133 -2
- package/dist/.external/cjs/lodash@4.17.21/lodash/_baseMap.cjs +21 -0
- package/dist/.external/cjs/lodash@4.17.21/lodash/map.cjs +20 -0
- package/dist/.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs +133 -2
- package/dist/.external/esm/lodash@4.17.21/lodash/_baseMap.mjs +21 -0
- package/dist/.external/esm/lodash@4.17.21/lodash/map.mjs +20 -0
- package/dist/jsonforms/cjs/_virtual/map.cjs +6 -0
- package/dist/jsonforms/cjs/complex/MantineArrayControl/MantineArrayControl.cjs +6 -0
- package/dist/jsonforms/cjs/complex/MantineObjectControl.cjs +2 -2
- package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +11 -91
- package/dist/jsonforms/cjs/complex/MantineTableControl/TableToolbar.cjs +13 -57
- package/dist/jsonforms/cjs/hooks/useNavigationComponent.cjs +83 -0
- package/dist/jsonforms/cjs/hooks/useToolbarComponent.cjs +88 -0
- package/dist/jsonforms/cjs/labels/MantineLabelRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/layouts/Array/ArrayToolbar.cjs +20 -0
- package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +147 -0
- package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +81 -0
- package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayoutRenderer.cjs +21 -0
- package/dist/jsonforms/cjs/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/layouts/MantineGroupLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/renderers/mantineRenderers.cjs +7 -4
- package/dist/jsonforms/esm/_virtual/map.mjs +7 -0
- package/dist/jsonforms/esm/complex/MantineArrayControl/MantineArrayControl.mjs +7 -1
- package/dist/jsonforms/esm/complex/MantineObjectControl.mjs +2 -2
- package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +13 -93
- package/dist/jsonforms/esm/complex/MantineTableControl/TableToolbar.mjs +12 -56
- package/dist/jsonforms/esm/hooks/useNavigationComponent.mjs +83 -0
- package/dist/jsonforms/esm/hooks/useToolbarComponent.mjs +88 -0
- package/dist/jsonforms/esm/labels/MantineLabelRenderer.mjs +2 -2
- package/dist/jsonforms/esm/layouts/Array/ArrayToolbar.mjs +20 -0
- package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +147 -0
- package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +81 -0
- package/dist/jsonforms/esm/layouts/Array/MantineArrayLayoutRenderer.mjs +21 -0
- package/dist/jsonforms/esm/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/esm/layouts/MantineGroupLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/esm/renderers/mantineRenderers.mjs +12 -9
- package/dist/jsonforms/lib/complex/MantineArrayControl/MantineArrayControl.d.ts +2 -0
- package/dist/jsonforms/lib/complex/MantineObjectControl.d.ts +1 -1
- package/dist/jsonforms/lib/hooks/useNavigationComponent.d.ts +8 -0
- package/dist/jsonforms/lib/hooks/useToolbarComponent.d.ts +6 -0
- package/dist/jsonforms/lib/labels/MantineLabelRenderer.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/Array/ArrayToolbar.d.ts +2 -0
- package/dist/jsonforms/lib/layouts/Array/ExpandPanelRenderer.d.ts +3 -0
- package/dist/jsonforms/lib/layouts/Array/MantineArrayLayout.d.ts +1 -0
- package/dist/jsonforms/lib/layouts/Array/MantineArrayLayoutRenderer.d.ts +2 -0
- package/dist/jsonforms/lib/layouts/Categorization/MantineCategorizationLayoutRenderer.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/MantineGroupLayoutRenderer.d.ts +1 -1
- package/package.json +1 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/ValidationIcon.cjs +0 -19
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/ValidationIcon.mjs +0 -19
- package/dist/jsonforms/cjs/complex/MantineTableControl/ValidationIcon.cjs +0 -19
- package/dist/jsonforms/esm/complex/MantineTableControl/ValidationIcon.mjs +0 -19
- package/dist/jsonforms/lib/complex/MantineTableControl/ValidationIcon.d.ts +0 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const _commonjsHelpers = require("./_commonjsHelpers.cjs");
|
|
3
|
+
const map$1 = require("../../../../.external/cjs/lodash@4.17.21/lodash/map.cjs");
|
|
4
|
+
var mapExports = map$1.__require();
|
|
5
|
+
const map = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(mapExports);
|
|
6
|
+
module.exports = map;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
reduce.
|
|
2
|
+
const _commonjsHelpers = require("./_commonjsHelpers.cjs");
|
|
3
|
+
const reduce$1 = require("../../../../.external/cjs/lodash@4.17.21/lodash/reduce.cjs");
|
|
4
|
+
var reduceExports = reduce$1.__require();
|
|
5
|
+
const reduce = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(reduceExports);
|
|
6
|
+
module.exports = reduce;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
toPairs.
|
|
2
|
+
const _commonjsHelpers = require("./_commonjsHelpers.cjs");
|
|
3
|
+
const toPairs$1 = require("../../../../.external/cjs/lodash@4.17.21/lodash/toPairs.cjs");
|
|
4
|
+
var toPairsExports = toPairs$1.__require();
|
|
5
|
+
const toPairs = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(toPairsExports);
|
|
6
|
+
module.exports = toPairs;
|
|
@@ -54,8 +54,14 @@ const mantineArrayControlTester = jsonformsCore_esm.rankWith(
|
|
|
54
54
|
1,
|
|
55
55
|
jsonformsCore_esm.or(jsonformsCore_esm.isObjectArrayControl, jsonformsCore_esm.isPrimitiveArrayControl, isEnumArrayArrayControl.isEnumArrayArrayControl, isJsonArrayControl.isJsonArrayControl)
|
|
56
56
|
);
|
|
57
|
+
const mantineArrayEnumArrayControlTester = jsonformsCore_esm.rankWith(3, isEnumArrayArrayControl.isEnumArrayArrayControl);
|
|
57
58
|
const MantineArrayControlRenderer = jsonformsReact_esm.withJsonFormsArrayLayoutProps(
|
|
58
59
|
jsonformsReact_esm.withTranslateProps(jsonformsReact_esm.withArrayTranslationProps(Component))
|
|
59
60
|
);
|
|
61
|
+
const MantineArrayEnumArrayControlRenderer = jsonformsReact_esm.withJsonFormsArrayLayoutProps(
|
|
62
|
+
jsonformsReact_esm.withTranslateProps(jsonformsReact_esm.withArrayTranslationProps(Component))
|
|
63
|
+
);
|
|
60
64
|
exports.MantineArrayControlRenderer = MantineArrayControlRenderer;
|
|
65
|
+
exports.MantineArrayEnumArrayControlRenderer = MantineArrayEnumArrayControlRenderer;
|
|
61
66
|
exports.mantineArrayControlTester = mantineArrayControlTester;
|
|
67
|
+
exports.mantineArrayEnumArrayControlTester = mantineArrayEnumArrayControlTester;
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const jsonformsCore_esm = require("../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
|
|
5
5
|
const jsonformsReact_esm = require("../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
|
|
6
6
|
const MantineObjectInput = require("../MantineInputs/MantineObjectInput.cjs");
|
|
7
|
-
const
|
|
7
|
+
const mantineObjectControlTester = jsonformsCore_esm.rankWith(1, jsonformsCore_esm.isObjectControl);
|
|
8
8
|
const MantineObjectControl = jsonformsReact_esm.withJsonFormsDetailProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineObjectInput.MantineObjectInput, { ...props }));
|
|
9
9
|
exports.MantineObjectControl = MantineObjectControl;
|
|
10
|
-
exports.
|
|
10
|
+
exports.mantineObjectControlTester = mantineObjectControlTester;
|
|
@@ -12,12 +12,10 @@ const startCase = require("../../../../../_virtual/startCase.cjs");
|
|
|
12
12
|
const union = require("../../../../../_virtual/union.cjs");
|
|
13
13
|
const React = require("react");
|
|
14
14
|
const useContextProps = require("../../hooks/useContextProps.cjs");
|
|
15
|
+
const useNavigationComponent = require("../../hooks/useNavigationComponent.cjs");
|
|
15
16
|
const useThemeCustomizer = require("../../hooks/useThemeCustomizer.cjs");
|
|
16
17
|
const NoBorderTableCell = require("./NoBorderTableCell.cjs");
|
|
17
18
|
const TableToolbar = require("./TableToolbar.cjs");
|
|
18
|
-
const IconArrowUp = require("../../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconArrowUp.cjs");
|
|
19
|
-
const IconArrowDown = require("../../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconArrowDown.cjs");
|
|
20
|
-
const IconTrash = require("../../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconTrash.cjs");
|
|
21
19
|
const isValidObjectSchema = (schema) => schema.type === "object" && typeof schema.properties === "object";
|
|
22
20
|
const styles = {
|
|
23
21
|
fixedCell: {
|
|
@@ -151,96 +149,18 @@ const NonEmptyCell = (ownProps) => {
|
|
|
151
149
|
return /* @__PURE__ */ jsxRuntime.jsx(NonEmptyCellComponent, { ...emptyCellProps, isValid });
|
|
152
150
|
};
|
|
153
151
|
const NonEmptyRowComponent = (props) => {
|
|
154
|
-
const {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
showSortButtons,
|
|
164
|
-
enabled,
|
|
165
|
-
cells,
|
|
166
|
-
path,
|
|
167
|
-
translations,
|
|
168
|
-
disableRemove
|
|
169
|
-
} = props;
|
|
170
|
-
const defaultProps = { variant: "transparent", size: "sm", mt: "0.35rem" };
|
|
171
|
-
const iconProps = core.useProps("ActionIcon", defaultProps, {});
|
|
172
|
-
const moveUp = React.useMemo(() => moveUpCreator(path, rowIndex), [moveUpCreator, path, rowIndex]);
|
|
173
|
-
const moveDown = React.useMemo(() => moveDownCreator(path, rowIndex), [moveDownCreator, path, rowIndex]);
|
|
174
|
-
const [ComponentUp, _up_props] = useContextProps.useContextProps(
|
|
175
|
-
"Table.Row.Up",
|
|
176
|
-
`${childPath}.Row.Up`,
|
|
177
|
-
{
|
|
178
|
-
title: translations.up,
|
|
179
|
-
["aria-label"]: translations.upAriaLabel,
|
|
180
|
-
onClick: moveUp,
|
|
181
|
-
disabled: !enableUp,
|
|
182
|
-
...iconProps
|
|
183
|
-
},
|
|
184
|
-
props,
|
|
185
|
-
false
|
|
186
|
-
);
|
|
187
|
-
const [ComponentDown, _down_props] = useContextProps.useContextProps(
|
|
188
|
-
"Table.Row.Down",
|
|
189
|
-
`${childPath}.Row.Down`,
|
|
190
|
-
{
|
|
191
|
-
title: translations.down,
|
|
192
|
-
["aria-label"]: translations.downAriaLabel,
|
|
193
|
-
onClick: moveDown,
|
|
194
|
-
disabled: !enableDown,
|
|
195
|
-
...iconProps
|
|
196
|
-
},
|
|
197
|
-
props,
|
|
198
|
-
false
|
|
199
|
-
);
|
|
200
|
-
const [ComponentRemove, _remove_props] = useContextProps.useContextProps(
|
|
201
|
-
"Table.Row.Remove",
|
|
202
|
-
`${childPath}.Row.Remove`,
|
|
203
|
-
{
|
|
204
|
-
id: "tooltip-remove",
|
|
205
|
-
title: translations.removeTooltip,
|
|
206
|
-
["aria-label"]: translations.removeAriaLabel,
|
|
207
|
-
onClick: () => openDeleteDialog(childPath, rowIndex),
|
|
208
|
-
...iconProps
|
|
209
|
-
},
|
|
210
|
-
props,
|
|
211
|
-
false
|
|
212
|
-
);
|
|
213
|
-
const ActionIconUp = React.useMemo(
|
|
214
|
-
() => ComponentUp === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._up_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconArrowUp, {}) }) }) : ComponentUp,
|
|
215
|
-
[ComponentUp, _up_props]
|
|
216
|
-
);
|
|
217
|
-
const ActionIconDown = React.useMemo(
|
|
218
|
-
() => ComponentDown === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._down_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconArrowDown, {}) }) }) : ComponentDown,
|
|
219
|
-
[ComponentDown, _down_props]
|
|
220
|
-
);
|
|
221
|
-
const ActionIconRemove = React.useMemo(
|
|
222
|
-
() => ComponentRemove === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._remove_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconTrash, {}) }) }) : ComponentRemove,
|
|
223
|
-
[ComponentRemove, _remove_props]
|
|
224
|
-
);
|
|
225
|
-
const SortButtons = React.useMemo(
|
|
226
|
-
() => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
227
|
-
ActionIconUp,
|
|
228
|
-
ActionIconDown
|
|
229
|
-
] }),
|
|
230
|
-
[ActionIconDown, ActionIconUp]
|
|
231
|
-
);
|
|
232
|
-
const enableSort = React.useMemo(
|
|
233
|
-
() => !!showSortButtons && !!(ActionIconUp || ActionIconDown),
|
|
234
|
-
[showSortButtons, ActionIconUp, ActionIconDown]
|
|
235
|
-
);
|
|
236
|
-
const enableRemove = React.useMemo(() => !disableRemove && !!ActionIconRemove, [disableRemove, ActionIconRemove]);
|
|
237
|
-
const showCell = React.useMemo(() => enableSort || enableRemove, [enableSort, enableRemove]);
|
|
152
|
+
const { childPath, schema, showSortButtons, enabled, cells } = props;
|
|
153
|
+
const NavigationComponent = useNavigationComponent.useNavigationComponent({
|
|
154
|
+
componentName: "Table",
|
|
155
|
+
componentIdentifier: "Row",
|
|
156
|
+
onUp: props.moveUpCreator(props.path, props.rowIndex),
|
|
157
|
+
onDown: props.moveDownCreator(props.path, props.rowIndex),
|
|
158
|
+
onDelete: () => props.openDeleteDialog(childPath, props.rowIndex),
|
|
159
|
+
...props
|
|
160
|
+
});
|
|
238
161
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Table.Tr, { children: [
|
|
239
162
|
generateCells(NonEmptyCell, schema, childPath, enabled, cells),
|
|
240
|
-
|
|
241
|
-
enableSort && SortButtons,
|
|
242
|
-
enableRemove && ActionIconRemove
|
|
243
|
-
] }) }) : null
|
|
163
|
+
NavigationComponent ? /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { style: showSortButtons ? styles.fixedCell : styles.fixedCellSmall, children: NavigationComponent }) : null
|
|
244
164
|
] }, childPath);
|
|
245
165
|
};
|
|
246
166
|
const NonEmptyRow = React.memo(NonEmptyRowComponent);
|
|
@@ -4,67 +4,23 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const jsonformsCore_esm = require("../../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
|
|
5
5
|
const core = require("@mantine/core");
|
|
6
6
|
const React = require("react");
|
|
7
|
-
const
|
|
7
|
+
const useToolbarComponent = require("../../hooks/useToolbarComponent.cjs");
|
|
8
8
|
const NoBorderTableCell = require("./NoBorderTableCell.cjs");
|
|
9
|
-
const ValidationIcon = require("./ValidationIcon.cjs");
|
|
10
|
-
const IconPlus = require("../../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconPlus.cjs");
|
|
11
9
|
const fixedCellSmall = {
|
|
12
10
|
paddingLeft: 0,
|
|
13
11
|
paddingRight: 0
|
|
14
12
|
};
|
|
15
13
|
const TableToolbar = React.memo(function TableToolbar2(props) {
|
|
16
|
-
const { numColumns,
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
props,
|
|
24
|
-
false
|
|
25
|
-
);
|
|
26
|
-
const [ComponentDescription, _description_props] = useContextProps.useContextProps(
|
|
27
|
-
"Table.Header.Description",
|
|
28
|
-
`${path}.Header.Description`,
|
|
29
|
-
{ value: description },
|
|
30
|
-
props,
|
|
31
|
-
false
|
|
32
|
-
);
|
|
33
|
-
const [ComponentValidation, _validation_props] = useContextProps.useContextProps(
|
|
34
|
-
"Table.Header.Validation",
|
|
35
|
-
`${path}.Header.Validation`,
|
|
36
|
-
{
|
|
37
|
-
id: "tooltip-validation",
|
|
38
|
-
error: errors
|
|
39
|
-
},
|
|
40
|
-
props,
|
|
41
|
-
false
|
|
42
|
-
);
|
|
43
|
-
const [ComponentAdd, _add_props] = useContextProps.useContextProps(
|
|
44
|
-
"Table.Header.Add",
|
|
45
|
-
`${path}.Header.Add`,
|
|
46
|
-
{
|
|
47
|
-
id: "tooltip-add",
|
|
48
|
-
title: translations.addTooltip,
|
|
49
|
-
onClick: addItem(path, jsonformsCore_esm.createDefaultValue(schema, rootSchema)),
|
|
50
|
-
...iconProps
|
|
51
|
-
},
|
|
52
|
-
props,
|
|
53
|
-
false
|
|
54
|
-
);
|
|
55
|
-
const TextLabel = ComponentLabel === void 0 ? (_label_props == null ? void 0 : _label_props.value) ? /* @__PURE__ */ jsxRuntime.jsx(core.Input.Label, { children: _label_props == null ? void 0 : _label_props.value }) : null : ComponentLabel;
|
|
56
|
-
const TextDescription = ComponentDescription === void 0 ? (_description_props == null ? void 0 : _description_props.value) ? /* @__PURE__ */ jsxRuntime.jsx(core.Input.Description, { children: _description_props == null ? void 0 : _description_props.value }) : null : ComponentDescription;
|
|
57
|
-
const IconValidation = ComponentValidation === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(ValidationIcon.ValidationIcon, { ..._validation_props }) : ComponentValidation;
|
|
58
|
-
const ActionIconAdd = ComponentAdd === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._add_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconPlus, {}) }) : ComponentAdd;
|
|
14
|
+
const { numColumns, path, addItem, schema, enabled, rootSchema } = props;
|
|
15
|
+
const [ToolbarComponent, ToolbarAdd] = useToolbarComponent.useToolbarComponent({
|
|
16
|
+
componentName: "Table",
|
|
17
|
+
componentIdentifier: "Header",
|
|
18
|
+
onAdd: addItem(path, jsonformsCore_esm.createDefaultValue(schema, rootSchema)),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
59
21
|
return /* @__PURE__ */ jsxRuntime.jsxs(core.Table.Tr, { children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { colSpan: numColumns, children:
|
|
61
|
-
|
|
62
|
-
TextLabel,
|
|
63
|
-
IconValidation
|
|
64
|
-
] }),
|
|
65
|
-
TextDescription
|
|
66
|
-
] }) }),
|
|
67
|
-
enabled && ActionIconAdd && /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { align: "right", style: fixedCellSmall, children: ActionIconAdd })
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { colSpan: numColumns, children: ToolbarComponent }),
|
|
23
|
+
enabled && ToolbarAdd && /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { align: "right", style: fixedCellSmall, children: ToolbarAdd })
|
|
68
24
|
] });
|
|
69
25
|
});
|
|
70
26
|
exports.TableToolbar = TableToolbar;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const core$1 = require("fastapi-rtk/core");
|
|
5
|
+
const core = require("@mantine/core");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const IconArrowUp = require("../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconArrowUp.cjs");
|
|
8
|
+
const IconArrowDown = require("../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconArrowDown.cjs");
|
|
9
|
+
const IconTrash = require("../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconTrash.cjs");
|
|
10
|
+
const useNavigationComponent = ({ componentName, componentIdentifier, onUp, onDown, onDelete, ...props }) => {
|
|
11
|
+
const { childPath, showSortButtons, enableUp, enableDown, disableRemove, translations } = props;
|
|
12
|
+
const defaultProps = { variant: "transparent", size: "sm", mt: "0.35rem" };
|
|
13
|
+
const iconProps = core.useProps("ActionIcon", defaultProps, {});
|
|
14
|
+
const [ComponentUp, _up_props] = core$1.useContextProps(
|
|
15
|
+
`${componentName}.${componentIdentifier}.Up`,
|
|
16
|
+
`${childPath}.${componentIdentifier}.Up`,
|
|
17
|
+
{
|
|
18
|
+
title: translations.up,
|
|
19
|
+
["aria-label"]: translations.upAriaLabel,
|
|
20
|
+
onClick: onUp,
|
|
21
|
+
disabled: !enableUp,
|
|
22
|
+
...iconProps
|
|
23
|
+
},
|
|
24
|
+
props,
|
|
25
|
+
false
|
|
26
|
+
);
|
|
27
|
+
const [ComponentDown, _down_props] = core$1.useContextProps(
|
|
28
|
+
`${componentName}.${componentIdentifier}.Down`,
|
|
29
|
+
`${childPath}.${componentIdentifier}.Down`,
|
|
30
|
+
{
|
|
31
|
+
title: translations.down,
|
|
32
|
+
["aria-label"]: translations.downAriaLabel,
|
|
33
|
+
onClick: onDown,
|
|
34
|
+
disabled: !enableDown,
|
|
35
|
+
...iconProps
|
|
36
|
+
},
|
|
37
|
+
props,
|
|
38
|
+
false
|
|
39
|
+
);
|
|
40
|
+
const [ComponentRemove, _remove_props] = core$1.useContextProps(
|
|
41
|
+
`${componentName}.${componentIdentifier}.Remove`,
|
|
42
|
+
`${childPath}.${componentIdentifier}.Remove`,
|
|
43
|
+
{
|
|
44
|
+
id: "tooltip-remove",
|
|
45
|
+
title: translations.removeTooltip,
|
|
46
|
+
["aria-label"]: translations.removeAriaLabel,
|
|
47
|
+
onClick: onDelete,
|
|
48
|
+
...iconProps
|
|
49
|
+
},
|
|
50
|
+
props,
|
|
51
|
+
false
|
|
52
|
+
);
|
|
53
|
+
const ActionIconUp = React.useMemo(
|
|
54
|
+
() => ComponentUp === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._up_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconArrowUp, {}) }) }) : ComponentUp,
|
|
55
|
+
[ComponentUp, _up_props]
|
|
56
|
+
);
|
|
57
|
+
const ActionIconDown = React.useMemo(
|
|
58
|
+
() => ComponentDown === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._down_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconArrowDown, {}) }) }) : ComponentDown,
|
|
59
|
+
[ComponentDown, _down_props]
|
|
60
|
+
);
|
|
61
|
+
const ActionIconRemove = React.useMemo(
|
|
62
|
+
() => ComponentRemove === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.Grid.Col, { span: "content", children: /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._remove_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconTrash, {}) }) }) : ComponentRemove,
|
|
63
|
+
[ComponentRemove, _remove_props]
|
|
64
|
+
);
|
|
65
|
+
const SortButtons = React.useMemo(
|
|
66
|
+
() => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
67
|
+
ActionIconUp,
|
|
68
|
+
ActionIconDown
|
|
69
|
+
] }),
|
|
70
|
+
[ActionIconDown, ActionIconUp]
|
|
71
|
+
);
|
|
72
|
+
const enableSort = React.useMemo(
|
|
73
|
+
() => !!showSortButtons && !!(ActionIconUp || ActionIconDown),
|
|
74
|
+
[showSortButtons, ActionIconUp, ActionIconDown]
|
|
75
|
+
);
|
|
76
|
+
const enableRemove = React.useMemo(() => !disableRemove && !!ActionIconRemove, [disableRemove, ActionIconRemove]);
|
|
77
|
+
const showComponent = React.useMemo(() => enableSort || enableRemove, [enableSort, enableRemove]);
|
|
78
|
+
return showComponent ? /* @__PURE__ */ jsxRuntime.jsxs(core.Grid, { justify: "flex-end", align: "center", children: [
|
|
79
|
+
enableSort && SortButtons,
|
|
80
|
+
enableRemove && ActionIconRemove
|
|
81
|
+
] }) : void 0;
|
|
82
|
+
};
|
|
83
|
+
exports.useNavigationComponent = useNavigationComponent;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const core$1 = require("fastapi-rtk/core");
|
|
5
|
+
const core = require("@mantine/core");
|
|
6
|
+
const IconPlus = require("../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconPlus.cjs");
|
|
7
|
+
const IconExclamationCircle = require("../../../../../../../.external/cjs/@tabler_icons-react@3.18.0_react@18.3.1/@tabler/icons-react/dist/esm/icons/IconExclamationCircle.cjs");
|
|
8
|
+
const ValidationIcon = ({ id, error }) => {
|
|
9
|
+
const errorMessageList = (error == null ? void 0 : error.split("\n")) || [];
|
|
10
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
core.Tooltip,
|
|
12
|
+
{
|
|
13
|
+
id,
|
|
14
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs(core.Stack, { gap: "0.25rem", children: [
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Text, { children: `${errorMessageList.length} error(s)` }),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Stack, { gap: 0, children: errorMessageList.map((error2, index) => /* @__PURE__ */ jsxRuntime.jsx(core.Text, { children: error2 }, `${error2}-${index}`)) })
|
|
17
|
+
] }),
|
|
18
|
+
position: "right",
|
|
19
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
|
+
core.Indicator,
|
|
21
|
+
{
|
|
22
|
+
size: "0.85rem",
|
|
23
|
+
label: errorMessageList.length,
|
|
24
|
+
disabled: !error,
|
|
25
|
+
style: { visibility: error ? "visible" : "hidden" },
|
|
26
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(IconExclamationCircle, {})
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
const useToolbarComponent = ({ componentName, componentIdentifier, onAdd, ...props }) => {
|
|
33
|
+
const { errors, label, description, path, translations } = props;
|
|
34
|
+
const defaultProps = { variant: "transparent", size: "sm", mt: "0.35rem" };
|
|
35
|
+
const iconProps = core.useProps("ActionIcon", defaultProps, {});
|
|
36
|
+
const [ComponentLabel, _label_props] = core$1.useContextProps(
|
|
37
|
+
`${componentName}.${componentIdentifier}.Label`,
|
|
38
|
+
`${path}.${componentIdentifier}.Label`,
|
|
39
|
+
{ value: label },
|
|
40
|
+
props,
|
|
41
|
+
false
|
|
42
|
+
);
|
|
43
|
+
const [ComponentDescription, _description_props] = core$1.useContextProps(
|
|
44
|
+
`${componentName}.${componentIdentifier}.Description`,
|
|
45
|
+
`${path}.${componentIdentifier}.Description`,
|
|
46
|
+
{ value: description },
|
|
47
|
+
props,
|
|
48
|
+
false
|
|
49
|
+
);
|
|
50
|
+
const [ComponentValidation, _validation_props] = core$1.useContextProps(
|
|
51
|
+
`${componentName}.${componentIdentifier}.Validation`,
|
|
52
|
+
`${path}.${componentIdentifier}.Validation`,
|
|
53
|
+
{
|
|
54
|
+
id: "tooltip-validation",
|
|
55
|
+
error: errors
|
|
56
|
+
},
|
|
57
|
+
props,
|
|
58
|
+
false
|
|
59
|
+
);
|
|
60
|
+
const [ComponentAdd, _add_props] = core$1.useContextProps(
|
|
61
|
+
`${componentName}.${componentIdentifier}.Add`,
|
|
62
|
+
`${path}.${componentIdentifier}.Add`,
|
|
63
|
+
{
|
|
64
|
+
id: "tooltip-add",
|
|
65
|
+
title: translations.addTooltip,
|
|
66
|
+
onClick: onAdd,
|
|
67
|
+
...iconProps
|
|
68
|
+
},
|
|
69
|
+
props,
|
|
70
|
+
false
|
|
71
|
+
);
|
|
72
|
+
const TextLabel = ComponentLabel === void 0 ? (_label_props == null ? void 0 : _label_props.value) ? /* @__PURE__ */ jsxRuntime.jsx(core.Input.Label, { children: _label_props == null ? void 0 : _label_props.value }) : null : ComponentLabel;
|
|
73
|
+
const TextDescription = ComponentDescription === void 0 ? (_description_props == null ? void 0 : _description_props.value) ? /* @__PURE__ */ jsxRuntime.jsx(core.Input.Description, { children: _description_props == null ? void 0 : _description_props.value }) : null : ComponentDescription;
|
|
74
|
+
const IconValidation = ComponentValidation === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(ValidationIcon, { ..._validation_props }) : ComponentValidation;
|
|
75
|
+
const ActionIconAdd = ComponentAdd === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.ActionIcon, { ..._add_props, children: /* @__PURE__ */ jsxRuntime.jsx(IconPlus, {}) }) : ComponentAdd;
|
|
76
|
+
return [
|
|
77
|
+
// eslint-disable-next-line react/jsx-key
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsxs(core.Input.Wrapper, { children: [
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsxs(core.Flex, { justify: "flex-start", align: "center", gap: "sm", children: [
|
|
80
|
+
TextLabel,
|
|
81
|
+
IconValidation
|
|
82
|
+
] }),
|
|
83
|
+
TextDescription
|
|
84
|
+
] }),
|
|
85
|
+
ActionIconAdd
|
|
86
|
+
];
|
|
87
|
+
};
|
|
88
|
+
exports.useToolbarComponent = useToolbarComponent;
|
|
@@ -11,7 +11,7 @@ const Component = (props) => {
|
|
|
11
11
|
}
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(core.Title, { fw: "bold", size: "xl", children: text });
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const mantineLabelTester = jsonformsCore_esm.rankWith(1, jsonformsCore_esm.isLabelable);
|
|
15
15
|
const MantineLabelRenderer = jsonformsReact_esm.withJsonFormsLabelProps(Component);
|
|
16
16
|
exports.MantineLabelRenderer = MantineLabelRenderer;
|
|
17
|
-
exports.
|
|
17
|
+
exports.mantineLabelTester = mantineLabelTester;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const core = require("@mantine/core");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const useToolbarComponent = require("../../hooks/useToolbarComponent.cjs");
|
|
7
|
+
const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar2(props) {
|
|
8
|
+
const { addItem, path, enabled, createDefault } = props;
|
|
9
|
+
const [ToolbarComponent, ToolbarAdd] = useToolbarComponent.useToolbarComponent({
|
|
10
|
+
componentName: "Array",
|
|
11
|
+
componentIdentifier: "Header",
|
|
12
|
+
onAdd: addItem(path, createDefault()),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(core.Group, { justify: "space-between", children: [
|
|
16
|
+
ToolbarComponent,
|
|
17
|
+
enabled && ToolbarAdd
|
|
18
|
+
] });
|
|
19
|
+
});
|
|
20
|
+
exports.ArrayLayoutToolbar = ArrayLayoutToolbar;
|
package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const jsonformsCore_esm = require("../../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
|
|
5
|
+
const jsonformsReact_esm = require("../../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
|
|
6
|
+
const core = require("@mantine/core");
|
|
7
|
+
const merge = require("../../../../../_virtual/merge.cjs");
|
|
8
|
+
const React = require("react");
|
|
9
|
+
const useNavigationComponent = require("../../hooks/useNavigationComponent.cjs");
|
|
10
|
+
const Component = (props) => {
|
|
11
|
+
const [labelHtmlId] = React.useState(jsonformsCore_esm.createId("expand-panel"));
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
return () => {
|
|
14
|
+
jsonformsCore_esm.removeId(labelHtmlId);
|
|
15
|
+
};
|
|
16
|
+
}, [labelHtmlId]);
|
|
17
|
+
const {
|
|
18
|
+
enabled,
|
|
19
|
+
path,
|
|
20
|
+
childPath,
|
|
21
|
+
childLabel,
|
|
22
|
+
index,
|
|
23
|
+
rootSchema,
|
|
24
|
+
schema,
|
|
25
|
+
uischema,
|
|
26
|
+
uischemas,
|
|
27
|
+
renderers,
|
|
28
|
+
cells,
|
|
29
|
+
moveUp: moveUp2,
|
|
30
|
+
moveDown: moveDown2,
|
|
31
|
+
removeItems,
|
|
32
|
+
config
|
|
33
|
+
} = props;
|
|
34
|
+
const foundUISchema = React.useMemo(
|
|
35
|
+
() => jsonformsCore_esm.findUISchema(uischemas, schema, uischema.scope, path, void 0, uischema, rootSchema),
|
|
36
|
+
[uischemas, schema, path, uischema, rootSchema]
|
|
37
|
+
);
|
|
38
|
+
const appliedUiSchemaOptions = merge({}, config, uischema.options);
|
|
39
|
+
const showSortButtons = appliedUiSchemaOptions.showSortButtons || appliedUiSchemaOptions.showArrayLayoutSortButtons;
|
|
40
|
+
const NavigationComponent = useNavigationComponent.useNavigationComponent({
|
|
41
|
+
componentName: "Array",
|
|
42
|
+
componentIdentifier: "Item",
|
|
43
|
+
onUp: moveUp2(path, index),
|
|
44
|
+
onDown: moveDown2(path, index),
|
|
45
|
+
onDelete: removeItems(path, [index]),
|
|
46
|
+
showSortButtons,
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(core.Accordion.Item, { value: childPath, children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Center, { children: /* @__PURE__ */ jsxRuntime.jsx(core.Accordion.Control, { component: "div", icon: /* @__PURE__ */ jsxRuntime.jsx(core.Avatar, { children: index + 1 }), children: /* @__PURE__ */ jsxRuntime.jsxs(core.Group, { justify: "space-between", pr: "md", children: [
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Stack, { children: childLabel }),
|
|
52
|
+
NavigationComponent
|
|
53
|
+
] }) }) }),
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(core.Accordion.Panel, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
jsonformsReact_esm.JsonFormsDispatch,
|
|
56
|
+
{
|
|
57
|
+
enabled,
|
|
58
|
+
schema,
|
|
59
|
+
uischema: foundUISchema,
|
|
60
|
+
path: childPath,
|
|
61
|
+
renderers,
|
|
62
|
+
cells
|
|
63
|
+
},
|
|
64
|
+
childPath
|
|
65
|
+
) })
|
|
66
|
+
] });
|
|
67
|
+
};
|
|
68
|
+
const MemoComponent = React.memo(Component);
|
|
69
|
+
const useCtxDispatchToExpandPanelProps = (dispatch) => ({
|
|
70
|
+
removeItems: React.useCallback(
|
|
71
|
+
(path, toDelete) => (event) => {
|
|
72
|
+
event.stopPropagation();
|
|
73
|
+
dispatch(
|
|
74
|
+
jsonformsCore_esm.update(
|
|
75
|
+
path,
|
|
76
|
+
(array) => {
|
|
77
|
+
toDelete.sort().reverse().forEach((s) => array.splice(s, 1));
|
|
78
|
+
return array;
|
|
79
|
+
},
|
|
80
|
+
{ type: "REMOVE", indices: toDelete }
|
|
81
|
+
)
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
[dispatch]
|
|
85
|
+
),
|
|
86
|
+
moveUp: React.useCallback(
|
|
87
|
+
(path, toMove) => (event) => {
|
|
88
|
+
event.stopPropagation();
|
|
89
|
+
dispatch(
|
|
90
|
+
jsonformsCore_esm.update(
|
|
91
|
+
path,
|
|
92
|
+
(array) => {
|
|
93
|
+
jsonformsCore_esm.moveUp(array, toMove);
|
|
94
|
+
return array;
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: "MOVE",
|
|
98
|
+
moves: [{ from: toMove, to: toMove - 1 }]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
[dispatch]
|
|
104
|
+
),
|
|
105
|
+
moveDown: React.useCallback(
|
|
106
|
+
(path, toMove) => (event) => {
|
|
107
|
+
event.stopPropagation();
|
|
108
|
+
dispatch(
|
|
109
|
+
jsonformsCore_esm.update(
|
|
110
|
+
path,
|
|
111
|
+
(array) => {
|
|
112
|
+
jsonformsCore_esm.moveDown(array, toMove);
|
|
113
|
+
return array;
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: "MOVE",
|
|
117
|
+
moves: [{ from: toMove, to: toMove + 1 }]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
[dispatch]
|
|
123
|
+
)
|
|
124
|
+
});
|
|
125
|
+
const withContextToExpandPanelProps = (Component2) => {
|
|
126
|
+
return function WithContextToExpandPanelProps({ ctx, props }) {
|
|
127
|
+
const dispatchProps = useCtxDispatchToExpandPanelProps(ctx.dispatch);
|
|
128
|
+
const { childLabelProp, schema, uischema, rootSchema, path, index, uischemas } = props;
|
|
129
|
+
const childPath = jsonformsCore_esm.Paths.compose(path, `${index}`);
|
|
130
|
+
const childLabel = React.useMemo(() => {
|
|
131
|
+
return jsonformsCore_esm.computeChildLabel(
|
|
132
|
+
ctx.core.data,
|
|
133
|
+
childPath,
|
|
134
|
+
childLabelProp,
|
|
135
|
+
schema,
|
|
136
|
+
rootSchema,
|
|
137
|
+
ctx.i18n.translate,
|
|
138
|
+
uischema
|
|
139
|
+
);
|
|
140
|
+
}, [ctx.core.data, childPath, childLabelProp, schema, rootSchema, ctx.i18n.translate, uischema]);
|
|
141
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Component2, { ...props, ...dispatchProps, childLabel, childPath, uischemas });
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
const withJsonFormsExpandPanelProps = (Component2) => jsonformsReact_esm.withJsonFormsContext(withContextToExpandPanelProps(Component2));
|
|
145
|
+
const ExpandPanelRenderer = withJsonFormsExpandPanelProps(MemoComponent);
|
|
146
|
+
exports.ExpandPanelRenderer = ExpandPanelRenderer;
|
|
147
|
+
exports.MemoComponent = MemoComponent;
|