fastapi-rtk 0.2.52 → 0.2.53

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.
Files changed (99) hide show
  1. package/dist/.bundled/jsonforms/cjs/_virtual/index3.cjs +2 -2
  2. package/dist/.bundled/jsonforms/cjs/_virtual/index4.cjs +2 -2
  3. package/dist/.bundled/jsonforms/cjs/_virtual/index5.cjs +2 -2
  4. package/dist/.bundled/jsonforms/cjs/_virtual/map.cjs +6 -0
  5. package/dist/.bundled/jsonforms/cjs/_virtual/reduce.cjs +5 -2
  6. package/dist/.bundled/jsonforms/cjs/_virtual/toPairs.cjs +5 -2
  7. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.cjs +6 -0
  8. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineObjectControl.cjs +2 -2
  9. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +11 -91
  10. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.cjs +10 -54
  11. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useNavigationComponent.cjs +83 -0
  12. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useToolbarComponent.cjs +88 -0
  13. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/labels/MantineLabelRenderer.cjs +2 -2
  14. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ArrayToolbar.cjs +20 -0
  15. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +147 -0
  16. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +81 -0
  17. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayoutRenderer.cjs +21 -0
  18. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +2 -2
  19. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineGroupLayoutRenderer.cjs +2 -2
  20. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/renderers/mantineRenderers.cjs +7 -4
  21. package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
  22. package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
  23. package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
  24. package/dist/.bundled/jsonforms/esm/_virtual/map.mjs +7 -0
  25. package/dist/.bundled/jsonforms/esm/_virtual/reduce.mjs +6 -1
  26. package/dist/.bundled/jsonforms/esm/_virtual/toPairs.mjs +6 -1
  27. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.mjs +7 -1
  28. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineObjectControl.mjs +2 -2
  29. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +13 -93
  30. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.mjs +12 -56
  31. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useNavigationComponent.mjs +83 -0
  32. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useToolbarComponent.mjs +88 -0
  33. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/labels/MantineLabelRenderer.mjs +2 -2
  34. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ArrayToolbar.mjs +20 -0
  35. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +147 -0
  36. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +81 -0
  37. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayoutRenderer.mjs +21 -0
  38. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +2 -2
  39. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineGroupLayoutRenderer.mjs +2 -2
  40. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/renderers/mantineRenderers.mjs +12 -9
  41. package/dist/.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs +133 -2
  42. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/index.cjs +1 -1
  43. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/validate/index.cjs +1 -1
  44. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
  45. package/dist/.external/cjs/lodash@4.17.21/lodash/_baseMap.cjs +21 -0
  46. package/dist/.external/cjs/lodash@4.17.21/lodash/map.cjs +20 -0
  47. package/dist/.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs +133 -2
  48. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/index.mjs +1 -1
  49. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/validate/index.mjs +1 -1
  50. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
  51. package/dist/.external/esm/lodash@4.17.21/lodash/_baseMap.mjs +21 -0
  52. package/dist/.external/esm/lodash@4.17.21/lodash/map.mjs +20 -0
  53. package/dist/jsonforms/cjs/_virtual/map.cjs +6 -0
  54. package/dist/jsonforms/cjs/complex/MantineArrayControl/MantineArrayControl.cjs +6 -0
  55. package/dist/jsonforms/cjs/complex/MantineObjectControl.cjs +2 -2
  56. package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +11 -91
  57. package/dist/jsonforms/cjs/complex/MantineTableControl/TableToolbar.cjs +13 -57
  58. package/dist/jsonforms/cjs/hooks/useNavigationComponent.cjs +83 -0
  59. package/dist/jsonforms/cjs/hooks/useToolbarComponent.cjs +88 -0
  60. package/dist/jsonforms/cjs/labels/MantineLabelRenderer.cjs +2 -2
  61. package/dist/jsonforms/cjs/layouts/Array/ArrayToolbar.cjs +20 -0
  62. package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +147 -0
  63. package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +81 -0
  64. package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayoutRenderer.cjs +21 -0
  65. package/dist/jsonforms/cjs/layouts/Categorization/MantineCategorizationLayoutRenderer.cjs +2 -2
  66. package/dist/jsonforms/cjs/layouts/MantineGroupLayoutRenderer.cjs +2 -2
  67. package/dist/jsonforms/cjs/renderers/mantineRenderers.cjs +7 -4
  68. package/dist/jsonforms/esm/_virtual/map.mjs +7 -0
  69. package/dist/jsonforms/esm/complex/MantineArrayControl/MantineArrayControl.mjs +7 -1
  70. package/dist/jsonforms/esm/complex/MantineObjectControl.mjs +2 -2
  71. package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +13 -93
  72. package/dist/jsonforms/esm/complex/MantineTableControl/TableToolbar.mjs +12 -56
  73. package/dist/jsonforms/esm/hooks/useNavigationComponent.mjs +83 -0
  74. package/dist/jsonforms/esm/hooks/useToolbarComponent.mjs +88 -0
  75. package/dist/jsonforms/esm/labels/MantineLabelRenderer.mjs +2 -2
  76. package/dist/jsonforms/esm/layouts/Array/ArrayToolbar.mjs +20 -0
  77. package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +147 -0
  78. package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +81 -0
  79. package/dist/jsonforms/esm/layouts/Array/MantineArrayLayoutRenderer.mjs +21 -0
  80. package/dist/jsonforms/esm/layouts/Categorization/MantineCategorizationLayoutRenderer.mjs +2 -2
  81. package/dist/jsonforms/esm/layouts/MantineGroupLayoutRenderer.mjs +2 -2
  82. package/dist/jsonforms/esm/renderers/mantineRenderers.mjs +12 -9
  83. package/dist/jsonforms/lib/complex/MantineArrayControl/MantineArrayControl.d.ts +2 -0
  84. package/dist/jsonforms/lib/complex/MantineObjectControl.d.ts +1 -1
  85. package/dist/jsonforms/lib/hooks/useNavigationComponent.d.ts +8 -0
  86. package/dist/jsonforms/lib/hooks/useToolbarComponent.d.ts +6 -0
  87. package/dist/jsonforms/lib/labels/MantineLabelRenderer.d.ts +1 -1
  88. package/dist/jsonforms/lib/layouts/Array/ArrayToolbar.d.ts +2 -0
  89. package/dist/jsonforms/lib/layouts/Array/ExpandPanelRenderer.d.ts +3 -0
  90. package/dist/jsonforms/lib/layouts/Array/MantineArrayLayout.d.ts +1 -0
  91. package/dist/jsonforms/lib/layouts/Array/MantineArrayLayoutRenderer.d.ts +2 -0
  92. package/dist/jsonforms/lib/layouts/Categorization/MantineCategorizationLayoutRenderer.d.ts +1 -1
  93. package/dist/jsonforms/lib/layouts/MantineGroupLayoutRenderer.d.ts +1 -1
  94. package/package.json +1 -1
  95. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/ValidationIcon.cjs +0 -19
  96. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/ValidationIcon.mjs +0 -19
  97. package/dist/jsonforms/cjs/complex/MantineTableControl/ValidationIcon.cjs +0 -19
  98. package/dist/jsonforms/esm/complex/MantineTableControl/ValidationIcon.mjs +0 -19
  99. package/dist/jsonforms/lib/complex/MantineTableControl/ValidationIcon.d.ts +0 -4
@@ -0,0 +1,20 @@
1
+ import { jsxs } from "react/jsx-runtime";
2
+ import { Group } from "@mantine/core";
3
+ import React from "react";
4
+ import { useToolbarComponent } from "../../hooks/useToolbarComponent.mjs";
5
+ const ArrayLayoutToolbar = React.memo(function ArrayLayoutToolbar2(props) {
6
+ const { addItem, path, enabled, createDefault } = props;
7
+ const [ToolbarComponent, ToolbarAdd] = useToolbarComponent({
8
+ componentName: "Array",
9
+ componentIdentifier: "Header",
10
+ onAdd: addItem(path, createDefault()),
11
+ ...props
12
+ });
13
+ return /* @__PURE__ */ jsxs(Group, { justify: "space-between", children: [
14
+ ToolbarComponent,
15
+ enabled && ToolbarAdd
16
+ ] });
17
+ });
18
+ export {
19
+ ArrayLayoutToolbar
20
+ };
@@ -0,0 +1,147 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { createId, removeId, findUISchema, Paths, computeChildLabel, update, moveDown, moveUp } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
3
+ import { JsonFormsDispatch, withJsonFormsContext } from "../../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
4
+ import { Accordion, Center, Group, Stack, Avatar } from "@mantine/core";
5
+ import merge from "../../../../../_virtual/merge.mjs";
6
+ import React, { useState, useEffect, useMemo, useCallback } from "react";
7
+ import { useNavigationComponent } from "../../hooks/useNavigationComponent.mjs";
8
+ const Component = (props) => {
9
+ const [labelHtmlId] = useState(createId("expand-panel"));
10
+ useEffect(() => {
11
+ return () => {
12
+ removeId(labelHtmlId);
13
+ };
14
+ }, [labelHtmlId]);
15
+ const {
16
+ enabled,
17
+ path,
18
+ childPath,
19
+ childLabel,
20
+ index,
21
+ rootSchema,
22
+ schema,
23
+ uischema,
24
+ uischemas,
25
+ renderers,
26
+ cells,
27
+ moveUp: moveUp2,
28
+ moveDown: moveDown2,
29
+ removeItems,
30
+ config
31
+ } = props;
32
+ const foundUISchema = useMemo(
33
+ () => findUISchema(uischemas, schema, uischema.scope, path, void 0, uischema, rootSchema),
34
+ [uischemas, schema, path, uischema, rootSchema]
35
+ );
36
+ const appliedUiSchemaOptions = merge({}, config, uischema.options);
37
+ const showSortButtons = appliedUiSchemaOptions.showSortButtons || appliedUiSchemaOptions.showArrayLayoutSortButtons;
38
+ const NavigationComponent = useNavigationComponent({
39
+ componentName: "Array",
40
+ componentIdentifier: "Item",
41
+ onUp: moveUp2(path, index),
42
+ onDown: moveDown2(path, index),
43
+ onDelete: removeItems(path, [index]),
44
+ showSortButtons,
45
+ ...props
46
+ });
47
+ return /* @__PURE__ */ jsxs(Accordion.Item, { value: childPath, children: [
48
+ /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx(Accordion.Control, { component: "div", icon: /* @__PURE__ */ jsx(Avatar, { children: index + 1 }), children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", pr: "md", children: [
49
+ /* @__PURE__ */ jsx(Stack, { children: childLabel }),
50
+ NavigationComponent
51
+ ] }) }) }),
52
+ /* @__PURE__ */ jsx(Accordion.Panel, { children: /* @__PURE__ */ jsx(
53
+ JsonFormsDispatch,
54
+ {
55
+ enabled,
56
+ schema,
57
+ uischema: foundUISchema,
58
+ path: childPath,
59
+ renderers,
60
+ cells
61
+ },
62
+ childPath
63
+ ) })
64
+ ] });
65
+ };
66
+ const MemoComponent = React.memo(Component);
67
+ const useCtxDispatchToExpandPanelProps = (dispatch) => ({
68
+ removeItems: useCallback(
69
+ (path, toDelete) => (event) => {
70
+ event.stopPropagation();
71
+ dispatch(
72
+ update(
73
+ path,
74
+ (array) => {
75
+ toDelete.sort().reverse().forEach((s) => array.splice(s, 1));
76
+ return array;
77
+ },
78
+ { type: "REMOVE", indices: toDelete }
79
+ )
80
+ );
81
+ },
82
+ [dispatch]
83
+ ),
84
+ moveUp: useCallback(
85
+ (path, toMove) => (event) => {
86
+ event.stopPropagation();
87
+ dispatch(
88
+ update(
89
+ path,
90
+ (array) => {
91
+ moveUp(array, toMove);
92
+ return array;
93
+ },
94
+ {
95
+ type: "MOVE",
96
+ moves: [{ from: toMove, to: toMove - 1 }]
97
+ }
98
+ )
99
+ );
100
+ },
101
+ [dispatch]
102
+ ),
103
+ moveDown: useCallback(
104
+ (path, toMove) => (event) => {
105
+ event.stopPropagation();
106
+ dispatch(
107
+ update(
108
+ path,
109
+ (array) => {
110
+ moveDown(array, toMove);
111
+ return array;
112
+ },
113
+ {
114
+ type: "MOVE",
115
+ moves: [{ from: toMove, to: toMove + 1 }]
116
+ }
117
+ )
118
+ );
119
+ },
120
+ [dispatch]
121
+ )
122
+ });
123
+ const withContextToExpandPanelProps = (Component2) => {
124
+ return function WithContextToExpandPanelProps({ ctx, props }) {
125
+ const dispatchProps = useCtxDispatchToExpandPanelProps(ctx.dispatch);
126
+ const { childLabelProp, schema, uischema, rootSchema, path, index, uischemas } = props;
127
+ const childPath = Paths.compose(path, `${index}`);
128
+ const childLabel = useMemo(() => {
129
+ return computeChildLabel(
130
+ ctx.core.data,
131
+ childPath,
132
+ childLabelProp,
133
+ schema,
134
+ rootSchema,
135
+ ctx.i18n.translate,
136
+ uischema
137
+ );
138
+ }, [ctx.core.data, childPath, childLabelProp, schema, rootSchema, ctx.i18n.translate, uischema]);
139
+ return /* @__PURE__ */ jsx(Component2, { ...props, ...dispatchProps, childLabel, childPath, uischemas });
140
+ };
141
+ };
142
+ const withJsonFormsExpandPanelProps = (Component2) => withJsonFormsContext(withContextToExpandPanelProps(Component2));
143
+ const ExpandPanelRenderer = withJsonFormsExpandPanelProps(MemoComponent);
144
+ export {
145
+ ExpandPanelRenderer,
146
+ MemoComponent
147
+ };
@@ -0,0 +1,81 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useContextProps } from "fastapi-rtk/core";
3
+ import { createDefaultValue, computeLabel, Paths } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
4
+ import { Stack, Accordion, Text } from "@mantine/core";
5
+ import map from "../../../../../_virtual/map.mjs";
6
+ import merge from "../../../../../_virtual/merge.mjs";
7
+ import range from "../../../../../_virtual/range.mjs";
8
+ import { memo, useCallback } from "react";
9
+ import { ArrayLayoutToolbar } from "./ArrayToolbar.mjs";
10
+ import { ExpandPanelRenderer } from "./ExpandPanelRenderer.mjs";
11
+ const Component = (props) => {
12
+ const {
13
+ enabled,
14
+ data,
15
+ path,
16
+ schema,
17
+ uischema,
18
+ errors,
19
+ addItem,
20
+ renderers,
21
+ cells,
22
+ label,
23
+ required,
24
+ rootSchema,
25
+ config,
26
+ uischemas,
27
+ description,
28
+ disableAdd,
29
+ disableRemove,
30
+ translations
31
+ } = props;
32
+ const appliedUiSchemaOptions = merge({}, config, props.uischema.options);
33
+ const doDisableAdd = disableAdd || appliedUiSchemaOptions.disableAdd;
34
+ const doDisableRemove = disableRemove || appliedUiSchemaOptions.disableRemove;
35
+ const innerCreateDefaultValue = useCallback(() => createDefaultValue(props.schema, props.rootSchema), [props.schema]);
36
+ const [Component2, _props] = useContextProps("Array.Accordion", `${path}.Accordion`, {}, props, false);
37
+ return /* @__PURE__ */ jsxs(Stack, { children: [
38
+ /* @__PURE__ */ jsx(
39
+ ArrayLayoutToolbar,
40
+ {
41
+ translations,
42
+ label: computeLabel(label, required, appliedUiSchemaOptions.hideRequiredAsterisk),
43
+ description,
44
+ errors,
45
+ path,
46
+ enabled,
47
+ addItem,
48
+ createDefault: innerCreateDefaultValue,
49
+ disableAdd: doDisableAdd
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsx(Stack, { children: data > 0 ? Component2 === void 0 ? /* @__PURE__ */ jsx(Accordion, { variant: "separated", ..._props, children: map(range(data), (index) => {
53
+ const childPath = Paths.compose(path, `${index}`);
54
+ return /* @__PURE__ */ jsx(
55
+ ExpandPanelRenderer,
56
+ {
57
+ enabled,
58
+ path,
59
+ childPath,
60
+ index,
61
+ rootSchema,
62
+ schema,
63
+ uischema,
64
+ uischemas,
65
+ renderers,
66
+ cells,
67
+ enableUp: index !== 0,
68
+ enableDown: index !== data - 1,
69
+ disableRemove: doDisableRemove,
70
+ config,
71
+ translations
72
+ },
73
+ index
74
+ );
75
+ }) }) : Component2 : /* @__PURE__ */ jsx(Text, { ta: "center", children: translations.noDataMessage }) })
76
+ ] });
77
+ };
78
+ const MantineArrayLayout = memo(Component);
79
+ export {
80
+ MantineArrayLayout
81
+ };
@@ -0,0 +1,21 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { rankWith, isObjectArrayWithNesting } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
3
+ import { withJsonFormsArrayLayoutProps, withTranslateProps, withArrayTranslationProps } from "../../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
4
+ import { Stack } from "@mantine/core";
5
+ import { useCallback } from "react";
6
+ import { MantineArrayLayout } from "./MantineArrayLayout.mjs";
7
+ const Component = ({ visible, addItem, translations, ...props }) => {
8
+ const addItemCb = useCallback((p, value) => addItem(p, value), [addItem]);
9
+ if (!visible) {
10
+ return null;
11
+ }
12
+ return /* @__PURE__ */ jsx(Stack, { m: "0.5rem", mx: "calc(0.5rem + 2px)", children: /* @__PURE__ */ jsx(MantineArrayLayout, { translations, visible, addItem: addItemCb, ...props }) });
13
+ };
14
+ const mantineArrayLayoutTester = rankWith(2, isObjectArrayWithNesting);
15
+ const MantineArrayLayoutRenderer = withJsonFormsArrayLayoutProps(
16
+ withTranslateProps(withArrayTranslationProps(Component))
17
+ );
18
+ export {
19
+ MantineArrayLayoutRenderer,
20
+ mantineArrayLayoutTester
21
+ };
@@ -65,11 +65,11 @@ const Component = (props) => {
65
65
  }
66
66
  );
67
67
  };
68
- const MantineCategorizationLayoutTester = rankWith(1, uiTypeIs("Categorization"));
68
+ const mantineCategorizationLayoutTester = rankWith(1, uiTypeIs("Categorization"));
69
69
  const MantineCategorizationLayoutRenderer = withAjvProps(
70
70
  withTranslateProps(withJsonFormsLayoutProps(withDebounce(Component)))
71
71
  );
72
72
  export {
73
73
  MantineCategorizationLayoutRenderer,
74
- MantineCategorizationLayoutTester
74
+ mantineCategorizationLayoutTester
75
75
  };
@@ -8,9 +8,9 @@ const Component = ({ schema, uischema, path, enabled, visible, renderers, cells,
8
8
  const childProps = { schema, path, enabled, visible, elements: layout.elements, direction: "column" };
9
9
  return /* @__PURE__ */ jsx(Fieldset, { legend: label, m: "0.5rem", mx: "calc(0.5rem + 2px)", children: /* @__PURE__ */ jsx(MantineLayoutRenderer, { ...childProps, renderers, cells }) });
10
10
  };
11
- const MantineGroupLayoutTester = rankWith(1, uiTypeIs("Group"));
11
+ const mantineGroupLayoutTester = rankWith(1, uiTypeIs("Group"));
12
12
  const MantineGroupLayoutRenderer = withJsonFormsLayoutProps(Component);
13
13
  export {
14
14
  MantineGroupLayoutRenderer,
15
- MantineGroupLayoutTester
15
+ mantineGroupLayoutTester
16
16
  };
@@ -1,6 +1,6 @@
1
- import { MantineArrayControlRenderer, mantineArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
1
+ import { MantineArrayControlRenderer, mantineArrayControlTester, MantineArrayEnumArrayControlRenderer, mantineArrayEnumArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
2
2
  import { MantineEnumArrayRenderer, mantineEnumArrayRendererTester } from "../complex/MantineEnumArrayControl.mjs";
3
- import { MantineObjectControl, MantineObjectControlTester } from "../complex/MantineObjectControl.mjs";
3
+ import { MantineObjectControl, mantineObjectControlTester } from "../complex/MantineObjectControl.mjs";
4
4
  import { MantineBooleanControl, mantineBooleanControlTester } from "../controls/MantineBooleanControl.mjs";
5
5
  import { MantineDateControl, mantineDateControlTester } from "../controls/MantineDateControl.mjs";
6
6
  import { MantineDateTimeControl, mantineDateTimeControlTester } from "../controls/MantineDateTimeControl.mjs";
@@ -13,9 +13,10 @@ import { MantineNumberControl, mantineNumberControlTester } from "../controls/Ma
13
13
  import { MantineOneOfEnumControl, mantineOneOfEnumControlTester } from "../controls/MantineOneOfEnumControl.mjs";
14
14
  import { MantineTextControl, mantineTextControlTester } from "../controls/MantineTextControl.mjs";
15
15
  import { MantineTimeControl, mantineTimeControlTester } from "../controls/MantineTimeControl.mjs";
16
- import { MantineLabelRenderer, MantineLabelTester } from "../labels/MantineLabelRenderer.mjs";
17
- import { MantineCategorizationLayoutRenderer, MantineCategorizationLayoutTester } from "../layouts/Categorization/MantineCategorizationLayoutRenderer.mjs";
18
- import { MantineGroupLayoutRenderer, MantineGroupLayoutTester } from "../layouts/MantineGroupLayoutRenderer.mjs";
16
+ import { MantineLabelRenderer, mantineLabelTester } from "../labels/MantineLabelRenderer.mjs";
17
+ import { MantineArrayLayoutRenderer, mantineArrayLayoutTester } from "../layouts/Array/MantineArrayLayoutRenderer.mjs";
18
+ import { MantineCategorizationLayoutRenderer, mantineCategorizationLayoutTester } from "../layouts/Categorization/MantineCategorizationLayoutRenderer.mjs";
19
+ import { MantineGroupLayoutRenderer, mantineGroupLayoutTester } from "../layouts/MantineGroupLayoutRenderer.mjs";
19
20
  import { MantineHorizontalLayoutRenderer, mantineHorizontalLayoutTester } from "../layouts/MantineHotizontalLayoutRenderer.mjs";
20
21
  import { MantineVerticalLayoutRenderer, mantineVerticalLayoutTester } from "../layouts/MantineVerticalLayoutRenderer.mjs";
21
22
  const mantineRenderers = [
@@ -33,16 +34,18 @@ const mantineRenderers = [
33
34
  { tester: mantineIntegerControlTester, renderer: MantineIntegerControl },
34
35
  { tester: mantineBooleanControlTester, renderer: MantineBooleanControl },
35
36
  // Complex
36
- { tester: MantineObjectControlTester, renderer: MantineObjectControl },
37
+ { tester: mantineObjectControlTester, renderer: MantineObjectControl },
37
38
  { tester: mantineArrayControlTester, renderer: MantineArrayControlRenderer },
39
+ { tester: mantineArrayEnumArrayControlTester, renderer: MantineArrayEnumArrayControlRenderer },
38
40
  { tester: mantineEnumArrayRendererTester, renderer: MantineEnumArrayRenderer },
39
41
  // Layouts
40
42
  { tester: mantineHorizontalLayoutTester, renderer: MantineHorizontalLayoutRenderer },
41
43
  { tester: mantineVerticalLayoutTester, renderer: MantineVerticalLayoutRenderer },
42
- { tester: MantineGroupLayoutTester, renderer: MantineGroupLayoutRenderer },
43
- { tester: MantineCategorizationLayoutTester, renderer: MantineCategorizationLayoutRenderer },
44
+ { tester: mantineGroupLayoutTester, renderer: MantineGroupLayoutRenderer },
45
+ { tester: mantineCategorizationLayoutTester, renderer: MantineCategorizationLayoutRenderer },
46
+ { tester: mantineArrayLayoutTester, renderer: MantineArrayLayoutRenderer },
44
47
  // Labels
45
- { tester: MantineLabelTester, renderer: MantineLabelRenderer }
48
+ { tester: mantineLabelTester, renderer: MantineLabelRenderer }
46
49
  ];
47
50
  export {
48
51
  mantineRenderers
@@ -22,8 +22,8 @@ const maxBy = require("../../../../../../.bundled/jsonforms/cjs/_virtual/maxBy.c
22
22
  require("../../../../../../.bundled/jsonforms/cjs/_virtual/remove.cjs");
23
23
  require("../../../../../../.bundled/jsonforms/cjs/_virtual/endsWith.cjs");
24
24
  require("../../../../../../.bundled/jsonforms/cjs/_virtual/last.cjs");
25
- require("../../../../../../.bundled/jsonforms/cjs/_virtual/reduce.cjs");
26
- require("../../../../../../.bundled/jsonforms/cjs/_virtual/toPairs.cjs");
25
+ const reduce = require("../../../../../../.bundled/jsonforms/cjs/_virtual/reduce.cjs");
26
+ const toPairs = require("../../../../../../.bundled/jsonforms/cjs/_virtual/toPairs.cjs");
27
27
  const ADDITIONAL_PROPERTIES = "additionalProperties";
28
28
  const REQUIRED_PROPERTIES = "required";
29
29
  const distinct = (properties, discriminator) => {
@@ -176,6 +176,9 @@ const toDataPathSegments = (schemaPath) => {
176
176
  };
177
177
  const encode = (segment) => segment == null ? void 0 : segment.replace(/~/g, "~0").replace(/\//g, "~1");
178
178
  const decode = (pointerSegment) => pointerSegment == null ? void 0 : pointerSegment.replace(/~1/g, "/").replace(/~0/, "~");
179
+ const getPropPath = (path) => {
180
+ return `/properties/${path.split(".").map((p) => encode(p)).join("/properties/")}`;
181
+ };
179
182
  const deriveLabel = (controlElement, schemaElement) => {
180
183
  if (schemaElement && typeof schemaElement.title === "string") {
181
184
  return schemaElement.title;
@@ -262,6 +265,24 @@ exports.RuleEffect = void 0;
262
265
  RuleEffect["ENABLE"] = "ENABLE";
263
266
  RuleEffect["DISABLE"] = "DISABLE";
264
267
  })(exports.RuleEffect || (exports.RuleEffect = {}));
268
+ const findUiControl = (uiSchema, path) => {
269
+ var _a;
270
+ if (isControlElement(uiSchema)) {
271
+ if (isScoped(uiSchema) && uiSchema.scope.endsWith(getPropPath(path))) {
272
+ return uiSchema;
273
+ } else if ((_a = uiSchema.options) == null ? void 0 : _a.detail) {
274
+ return findUiControl(uiSchema.options.detail, path);
275
+ }
276
+ }
277
+ if (isLayout(uiSchema)) {
278
+ for (const elem of uiSchema.elements) {
279
+ const result = findUiControl(elem, path);
280
+ if (result !== void 0)
281
+ return result;
282
+ }
283
+ }
284
+ return void 0;
285
+ };
265
286
  const composeWithUi = (scopableUi, path) => {
266
287
  if (!isScoped(scopableUi)) {
267
288
  return path ?? "";
@@ -278,6 +299,7 @@ const isLayout = (uischema) => uischema.elements !== void 0;
278
299
  const isScopable = (obj) => !!obj && typeof obj === "object";
279
300
  const isScoped = (obj) => isScopable(obj) && typeof obj.scope === "string";
280
301
  const isLabelable = (obj) => !!obj && typeof obj === "object";
302
+ const isControlElement = (uiSchema) => uiSchema.type === "Control";
281
303
  const isOrCondition = (condition) => condition.type === "OR";
282
304
  const isAndCondition = (condition) => condition.type === "AND";
283
305
  const isLeafCondition = (condition) => condition.type === "LEAF";
@@ -363,6 +385,15 @@ const isEnabled = (uischema, data, path = void 0, ajv2) => {
363
385
  }
364
386
  return true;
365
387
  };
388
+ const getFirstPrimitiveProp = (schema) => {
389
+ if (schema && typeof schema === "object" && "properties" in schema && schema.properties) {
390
+ return find(Object.keys(schema.properties), (propName) => {
391
+ const prop = schema.properties[propName];
392
+ return prop && typeof prop === "object" && "type" in prop && (prop.type === "string" || prop.type === "number" || prop.type === "integer");
393
+ });
394
+ }
395
+ return void 0;
396
+ };
366
397
  const isOneOfEnumSchema = (schema) => !!schema && Object.prototype.hasOwnProperty.call(schema, "oneOf") && schema.oneOf && schema.oneOf.every((s) => s.const !== void 0);
367
398
  const isEnumSchema = (schema) => !!schema && typeof schema === "object" && (Object.prototype.hasOwnProperty.call(schema, "enum") || Object.prototype.hasOwnProperty.call(schema, "const"));
368
399
  const convertDateToString = (date, format) => {
@@ -1246,6 +1277,71 @@ const isObjectArray = and(schemaMatches(
1246
1277
  return hasType(resolvedSchema, "object");
1247
1278
  }));
1248
1279
  const isObjectArrayControl = and(uiTypeIs("Control"), isObjectArray);
1280
+ const traverse = (any, pred, rootSchema) => {
1281
+ if (isArray(any)) {
1282
+ return reduce(any, (acc, el) => acc || traverse(el, pred, rootSchema), false);
1283
+ }
1284
+ if (pred(any)) {
1285
+ return true;
1286
+ }
1287
+ if (any.$ref) {
1288
+ const toTraverse = resolveSchema(rootSchema, any.$ref, rootSchema);
1289
+ if (toTraverse && !toTraverse.$ref) {
1290
+ return traverse(toTraverse, pred, rootSchema);
1291
+ }
1292
+ }
1293
+ if (any.items) {
1294
+ return traverse(any.items, pred, rootSchema);
1295
+ }
1296
+ if (any.properties) {
1297
+ return reduce(toPairs(any.properties), (acc, [_key, val]) => acc || traverse(val, pred, rootSchema), false);
1298
+ }
1299
+ return false;
1300
+ };
1301
+ const isObjectArrayWithNesting = (uischema, schema, context) => {
1302
+ if (!uiTypeIs("Control")(uischema, schema, context)) {
1303
+ return false;
1304
+ }
1305
+ const schemaPath = uischema.scope;
1306
+ const resolvedSchema = resolveSchema(schema, schemaPath, (context == null ? void 0 : context.rootSchema) ?? schema);
1307
+ let objectDepth = 0;
1308
+ if (resolvedSchema !== void 0 && resolvedSchema.items !== void 0) {
1309
+ if (traverse(resolvedSchema.items, (val) => {
1310
+ if (val === schema) {
1311
+ return false;
1312
+ }
1313
+ if (val.$ref !== void 0) {
1314
+ return false;
1315
+ }
1316
+ if (val.anyOf || val.allOf) {
1317
+ return true;
1318
+ }
1319
+ if (val.oneOf && !isOneOfEnumSchema(val)) {
1320
+ return true;
1321
+ }
1322
+ if (hasType(val, "object")) {
1323
+ objectDepth++;
1324
+ if (objectDepth === 2) {
1325
+ return true;
1326
+ }
1327
+ }
1328
+ if (hasType(val, "array")) {
1329
+ return true;
1330
+ }
1331
+ return false;
1332
+ }, context == null ? void 0 : context.rootSchema)) {
1333
+ return true;
1334
+ }
1335
+ if (uischema.options && uischema.options.detail) {
1336
+ if (typeof uischema.options.detail === "string") {
1337
+ return uischema.options.detail.toUpperCase() !== "DEFAULT";
1338
+ } else if (typeof uischema.options.detail === "object" && uischema.options.detail.type) {
1339
+ return true;
1340
+ }
1341
+ }
1342
+ }
1343
+ return false;
1344
+ };
1249
1345
  const isPrimitiveArrayControl = and(uiTypeIs("Control"), schemaMatches(
1250
1346
  (schema, rootSchema) => deriveTypes(schema).length !== 0 && !Array.isArray(resolveSchema(schema, "items", rootSchema))
1251
1347
  ), schemaSubPathMatches("items", (schema, rootSchema) => {
@@ -1359,6 +1455,9 @@ const isRequired = (schema, schemaPath, rootSchema) => {
1359
1455
  const nextHigherSchema = Resolve.schema(schema, nextHigherSchemaPath, rootSchema);
1360
1456
  return nextHigherSchema !== void 0 && nextHigherSchema.required !== void 0 && nextHigherSchema.required.indexOf(lastSegment) !== -1;
1361
1457
  };
1458
+ const computeLabel = (label, required, hideRequiredAsterisk) => {
1459
+ return `${label ?? ""}${required && !hideRequiredAsterisk ? "*" : ""}`;
1460
+ };
1362
1461
  const createDefaultValue = (schema, rootSchema) => {
1363
1462
  const defaultValue = doCreateDefaultValue(schema, rootSchema);
1364
1463
  return defaultValue === void 0 ? {} : defaultValue;
@@ -1707,6 +1806,31 @@ const mapStateToLabelProps = (state, props) => {
1707
1806
  uischema
1708
1807
  };
1709
1808
  };
1809
+ const computeChildLabel = (data, childPath, childLabelProp, schema, rootSchema, translateFct, uiSchema) => {
1810
+ const childData = Resolve.data(data, childPath);
1811
+ if (!childLabelProp) {
1812
+ childLabelProp = getFirstPrimitiveProp(schema);
1813
+ }
1814
+ if (!childLabelProp) {
1815
+ return "";
1816
+ }
1817
+ const currentValue = get(childData, childLabelProp);
1818
+ if (currentValue === void 0) {
1819
+ return "";
1820
+ }
1821
+ const childSchema = Resolve.schema(schema, "#" + getPropPath(childLabelProp), rootSchema);
1822
+ let enumOption = void 0;
1823
+ if (isEnumSchema(childSchema)) {
1824
+ enumOption = enumToEnumOptionMapper(currentValue, translateFct, getI18nKeyPrefix(childSchema, findUiControl(uiSchema, childLabelProp), childPath + "." + childLabelProp));
1825
+ } else if (isOneOfEnumSchema(childSchema)) {
1826
+ const oneOfArray = childSchema.oneOf;
1827
+ const oneOfSchema = oneOfArray.find((e) => isEqual(e.const, currentValue));
1828
+ if (oneOfSchema) {
1829
+ enumOption = oneOfToEnumOptionMapper(oneOfSchema, translateFct, getI18nKeyPrefix(oneOfSchema, void 0, childPath + "." + childLabelProp));
1830
+ }
1831
+ }
1832
+ return enumOption ? enumOption.label : currentValue;
1833
+ };
1710
1834
  const mapStateToCellProps = (state, ownProps) => {
1711
1835
  const { id, schema, path, uischema, renderers, cells } = ownProps;
1712
1836
  const rootData = getData(state);
@@ -1802,6 +1926,8 @@ exports.arrayDefaultTranslations = arrayDefaultTranslations;
1802
1926
  exports.compose = compose;
1803
1927
  exports.composePaths = compose;
1804
1928
  exports.composeWithUi = composeWithUi;
1929
+ exports.computeChildLabel = computeChildLabel;
1930
+ exports.computeLabel = computeLabel;
1805
1931
  exports.configReducer = configReducer;
1806
1932
  exports.convertDateToString = convertDateToString;
1807
1933
  exports.coreReducer = coreReducer;
@@ -1834,6 +1960,7 @@ exports.fetchErrorTranslator = fetchErrorTranslator;
1834
1960
  exports.fetchTranslator = fetchTranslator;
1835
1961
  exports.findMatchingUISchema = findMatchingUISchema;
1836
1962
  exports.findUISchema = findUISchema;
1963
+ exports.findUiControl = findUiControl;
1837
1964
  exports.formatErrorMessage = formatErrorMessage;
1838
1965
  exports.formatIs = formatIs;
1839
1966
  exports.generateDefaultUISchema = generateDefaultUISchema;
@@ -1848,10 +1975,12 @@ exports.getControlPath = getControlPath;
1848
1975
  exports.getData = getData;
1849
1976
  exports.getErrorAt = getErrorAt;
1850
1977
  exports.getErrorTranslator = getErrorTranslator;
1978
+ exports.getFirstPrimitiveProp = getFirstPrimitiveProp;
1851
1979
  exports.getI18nKey = getI18nKey;
1852
1980
  exports.getI18nKeyPrefix = getI18nKeyPrefix;
1853
1981
  exports.getI18nKeyPrefixBySchema = getI18nKeyPrefixBySchema;
1854
1982
  exports.getOrCreateAjv = getOrCreateAjv;
1983
+ exports.getPropPath = getPropPath;
1855
1984
  exports.getRenderers = getRenderers;
1856
1985
  exports.getSchema = getSchema;
1857
1986
  exports.getSubErrorsAt = getSubErrorsAt;
@@ -1866,6 +1995,7 @@ exports.init = init;
1866
1995
  exports.initState = initState;
1867
1996
  exports.isBooleanControl = isBooleanControl;
1868
1997
  exports.isControl = isControl;
1998
+ exports.isControlElement = isControlElement;
1869
1999
  exports.isDateControl = isDateControl;
1870
2000
  exports.isDateTimeControl = isDateTimeControl;
1871
2001
  exports.isEnabled = isEnabled;
@@ -1880,6 +2010,7 @@ exports.isLayout = isLayout;
1880
2010
  exports.isNumberControl = isNumberControl;
1881
2011
  exports.isObjectArray = isObjectArray;
1882
2012
  exports.isObjectArrayControl = isObjectArrayControl;
2013
+ exports.isObjectArrayWithNesting = isObjectArrayWithNesting;
1883
2014
  exports.isObjectControl = isObjectControl;
1884
2015
  exports.isOneOfControl = isOneOfControl;
1885
2016
  exports.isOneOfEnumSchema = isOneOfEnumSchema;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index5.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index3.cjs");
4
4
  const code = require("./code.cjs");
5
5
  const scope = require("./scope.cjs");
6
6
  var hasRequiredCodegen;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index4.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index5.cjs");
4
4
  const boolSchema = require("./boolSchema.cjs");
5
5
  const dataType = require("./dataType.cjs");
6
6
  const applicability = require("./applicability.cjs");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index3.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index4.cjs");
4
4
  const index$1 = require("../../compile/codegen/index.cjs");
5
5
  const types = require("./types.cjs");
6
6
  const index$2 = require("../../compile/index.cjs");
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _baseEach = require("./_baseEach.cjs");
4
+ const isArrayLike = require("./isArrayLike.cjs");
5
+ var _baseMap;
6
+ var hasRequired_baseMap;
7
+ function require_baseMap() {
8
+ if (hasRequired_baseMap) return _baseMap;
9
+ hasRequired_baseMap = 1;
10
+ var baseEach = _baseEach.__require(), isArrayLike$1 = isArrayLike.__require();
11
+ function baseMap(collection, iteratee) {
12
+ var index = -1, result = isArrayLike$1(collection) ? Array(collection.length) : [];
13
+ baseEach(collection, function(value, key, collection2) {
14
+ result[++index] = iteratee(value, key, collection2);
15
+ });
16
+ return result;
17
+ }
18
+ _baseMap = baseMap;
19
+ return _baseMap;
20
+ }
21
+ exports.__require = require_baseMap;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const _arrayMap = require("./_arrayMap.cjs");
4
+ const _baseIteratee = require("./_baseIteratee.cjs");
5
+ const _baseMap = require("./_baseMap.cjs");
6
+ const isArray = require("./isArray.cjs");
7
+ var map_1;
8
+ var hasRequiredMap;
9
+ function requireMap() {
10
+ if (hasRequiredMap) return map_1;
11
+ hasRequiredMap = 1;
12
+ var arrayMap = _arrayMap.__require(), baseIteratee = _baseIteratee.__require(), baseMap = _baseMap.__require(), isArray$1 = isArray.__require();
13
+ function map(collection, iteratee) {
14
+ var func = isArray$1(collection) ? arrayMap : baseMap;
15
+ return func(collection, baseIteratee(iteratee, 3));
16
+ }
17
+ map_1 = map;
18
+ return map_1;
19
+ }
20
+ exports.__require = requireMap;