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