fastapi-rtk 0.2.55 → 0.2.56
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/index3.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index4.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index5.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.cjs +20 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +22 -25
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/renderers/mantineRenderers.cjs +1 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/testers/isFilesControl.cjs +20 -0
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/testers/isImagesControl.cjs +20 -0
- package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.mjs +23 -3
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +22 -25
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/renderers/mantineRenderers.mjs +2 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/testers/isFilesControl.mjs +20 -0
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/testers/isImagesControl.mjs +20 -0
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/validate/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/validate/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
- package/dist/core/cjs/Dialogs/AddDialog.cjs +1 -1
- package/dist/core/cjs/Dialogs/EditDialog.cjs +1 -1
- package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +1 -1
- package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +1 -1
- package/dist/jsonforms/cjs/complex/MantineArrayControl/MantineArrayControl.cjs +20 -0
- package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +22 -25
- package/dist/jsonforms/cjs/renderers/mantineRenderers.cjs +1 -0
- package/dist/jsonforms/cjs/testers/isFilesControl.cjs +20 -0
- package/dist/jsonforms/cjs/testers/isImagesControl.cjs +20 -0
- package/dist/jsonforms/esm/complex/MantineArrayControl/MantineArrayControl.mjs +23 -3
- package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +22 -25
- package/dist/jsonforms/esm/renderers/mantineRenderers.mjs +2 -1
- package/dist/jsonforms/esm/testers/isFilesControl.mjs +20 -0
- package/dist/jsonforms/esm/testers/isImagesControl.mjs +20 -0
- package/dist/jsonforms/lib/complex/MantineArrayControl/MantineArrayControl.d.ts +2 -0
- package/dist/jsonforms/lib/testers/isFilesControl.d.ts +13 -0
- package/dist/jsonforms/lib/testers/isImagesControl.d.ts +13 -0
- package/package.json +1 -1
- /package/dist/.external/cjs/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.cjs +0 -0
- /package/dist/.external/esm/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.mjs +0 -0
|
@@ -5,7 +5,10 @@ const jsonformsCore_esm = require("../../../../../../../../.external/cjs/@jsonfo
|
|
|
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 core = require("@mantine/core");
|
|
7
7
|
const React = require("react");
|
|
8
|
+
const useThemeCustomizer = require("../../hooks/useThemeCustomizer.cjs");
|
|
8
9
|
const isEnumArrayArrayControl = require("../../testers/isEnumArrayArrayControl.cjs");
|
|
10
|
+
const isFilesControl = require("../../testers/isFilesControl.cjs");
|
|
11
|
+
const isImagesControl = require("../../testers/isImagesControl.cjs");
|
|
9
12
|
const isJsonArrayControl = require("../../testers/isJsonArrayControl.cjs");
|
|
10
13
|
const constants = require("../../utils/constants.cjs");
|
|
11
14
|
const MantineTableControl = require("../MantineTableControl/MantineTableControl.cjs");
|
|
@@ -50,18 +53,35 @@ const Component = (props) => {
|
|
|
50
53
|
)
|
|
51
54
|
] });
|
|
52
55
|
};
|
|
56
|
+
const FileArrayComponent = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
core.MantineThemeProvider,
|
|
58
|
+
{
|
|
59
|
+
theme: useThemeCustomizer.useThemeCustomizer({
|
|
60
|
+
"Table.Header.Validation": {
|
|
61
|
+
component: /* @__PURE__ */ jsxRuntime.jsx(core.Box, { style: { display: "none" } })
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
53
67
|
const mantineArrayControlTester = jsonformsCore_esm.rankWith(
|
|
54
68
|
1,
|
|
55
69
|
jsonformsCore_esm.or(jsonformsCore_esm.isObjectArrayControl, jsonformsCore_esm.isPrimitiveArrayControl, isEnumArrayArrayControl.isEnumArrayArrayControl, isJsonArrayControl.isJsonArrayControl)
|
|
56
70
|
);
|
|
57
71
|
const mantineArrayEnumArrayControlTester = jsonformsCore_esm.rankWith(3, isEnumArrayArrayControl.isEnumArrayArrayControl);
|
|
72
|
+
const mantineArrayFileArrayControlTester = jsonformsCore_esm.rankWith(4, jsonformsCore_esm.or(isFilesControl.isFilesControl, isImagesControl.isImagesControl));
|
|
58
73
|
const MantineArrayControlRenderer = jsonformsReact_esm.withJsonFormsArrayLayoutProps(
|
|
59
74
|
jsonformsReact_esm.withTranslateProps(jsonformsReact_esm.withArrayTranslationProps(Component))
|
|
60
75
|
);
|
|
61
76
|
const MantineArrayEnumArrayControlRenderer = jsonformsReact_esm.withJsonFormsArrayLayoutProps(
|
|
62
77
|
jsonformsReact_esm.withTranslateProps(jsonformsReact_esm.withArrayTranslationProps(Component))
|
|
63
78
|
);
|
|
79
|
+
const MantineArrayFileArrayControlRenderer = jsonformsReact_esm.withJsonFormsArrayLayoutProps(
|
|
80
|
+
jsonformsReact_esm.withTranslateProps(jsonformsReact_esm.withArrayTranslationProps(FileArrayComponent))
|
|
81
|
+
);
|
|
64
82
|
exports.MantineArrayControlRenderer = MantineArrayControlRenderer;
|
|
65
83
|
exports.MantineArrayEnumArrayControlRenderer = MantineArrayEnumArrayControlRenderer;
|
|
84
|
+
exports.MantineArrayFileArrayControlRenderer = MantineArrayFileArrayControlRenderer;
|
|
66
85
|
exports.mantineArrayControlTester = mantineArrayControlTester;
|
|
67
86
|
exports.mantineArrayEnumArrayControlTester = mantineArrayEnumArrayControlTester;
|
|
87
|
+
exports.mantineArrayFileArrayControlTester = mantineArrayFileArrayControlTester;
|
|
@@ -104,7 +104,7 @@ const controlWithoutLabel = (scope) => ({
|
|
|
104
104
|
label: false
|
|
105
105
|
});
|
|
106
106
|
const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props) {
|
|
107
|
-
const { path, propName, schema, rootSchema,
|
|
107
|
+
const { path, propName, schema, rootSchema, enabled, renderers, cells } = props;
|
|
108
108
|
const originalPath = React.useMemo(
|
|
109
109
|
() => path.replace(propName ? `.${propName}` : void 0, "").split(".").slice(0, -1).join("."),
|
|
110
110
|
[path, propName]
|
|
@@ -117,30 +117,27 @@ const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props)
|
|
|
117
117
|
[_contextProps, componentProps, contextProps]
|
|
118
118
|
);
|
|
119
119
|
const theme = useThemeCustomizer.useThemeCustomizer({ [path]: { component, props: _props } });
|
|
120
|
-
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
),
|
|
142
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "xs", children: !isValid ? errors : "" })
|
|
143
|
-
] }) });
|
|
120
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { children: schema.properties ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
jsonformsReact_esm.DispatchCell,
|
|
122
|
+
{
|
|
123
|
+
schema: jsonformsCore_esm.Resolve.schema(schema, `#/properties/${jsonformsCore_esm.encode(propName)}`, rootSchema),
|
|
124
|
+
uischema: controlWithoutLabel(`#/properties/${jsonformsCore_esm.encode(propName)}`),
|
|
125
|
+
path,
|
|
126
|
+
enabled,
|
|
127
|
+
renderers,
|
|
128
|
+
cells
|
|
129
|
+
}
|
|
130
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
131
|
+
jsonformsReact_esm.DispatchCell,
|
|
132
|
+
{
|
|
133
|
+
schema,
|
|
134
|
+
uischema: controlWithoutLabel("#"),
|
|
135
|
+
path,
|
|
136
|
+
enabled,
|
|
137
|
+
renderers,
|
|
138
|
+
cells
|
|
139
|
+
}
|
|
140
|
+
) }) });
|
|
144
141
|
});
|
|
145
142
|
const NonEmptyCell = (ownProps) => {
|
|
146
143
|
const ctx = jsonformsReact_esm.useJsonForms();
|
|
@@ -39,6 +39,7 @@ const mantineRenderers = [
|
|
|
39
39
|
{ tester: MantineObjectControl.mantineObjectControlTester, renderer: MantineObjectControl.MantineObjectControl },
|
|
40
40
|
{ tester: MantineArrayControl.mantineArrayControlTester, renderer: MantineArrayControl.MantineArrayControlRenderer },
|
|
41
41
|
{ tester: MantineArrayControl.mantineArrayEnumArrayControlTester, renderer: MantineArrayControl.MantineArrayEnumArrayControlRenderer },
|
|
42
|
+
{ tester: MantineArrayControl.mantineArrayFileArrayControlTester, renderer: MantineArrayControl.MantineArrayFileArrayControlRenderer },
|
|
42
43
|
{ tester: MantineEnumArrayControl.mantineEnumArrayRendererTester, renderer: MantineEnumArrayControl.MantineEnumArrayRenderer },
|
|
43
44
|
// Layouts
|
|
44
45
|
{ tester: MantineHotizontalLayoutRenderer.mantineHorizontalLayoutTester, renderer: MantineHotizontalLayoutRenderer.MantineHorizontalLayoutRenderer },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsonformsCore_esm = require("../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
|
|
4
|
+
const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
|
|
5
|
+
const isFileControl = require("./isFileControl.cjs");
|
|
6
|
+
function isFilesControl(uischema, schema) {
|
|
7
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const resolvedSchema = jsonformsCore_esm.resolveSchema(schema, uischema.scope);
|
|
11
|
+
try {
|
|
12
|
+
if (isSchemaTypeInclude.isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileControl.isFileSchema(resolvedSchema.items) && !resolvedSchema.items.properties) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.isFilesControl = isFilesControl;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsonformsCore_esm = require("../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
|
|
4
|
+
const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
|
|
5
|
+
const isFileControl = require("./isFileControl.cjs");
|
|
6
|
+
function isImagesControl(uischema, schema) {
|
|
7
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const resolvedSchema = jsonformsCore_esm.resolveSchema(schema, uischema.scope);
|
|
11
|
+
try {
|
|
12
|
+
if (isSchemaTypeInclude.isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileControl.isFileSchema(resolvedSchema.items) && resolvedSchema.items.contentMediaType.startsWith("image/") && !resolvedSchema.items.properties) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.isImagesControl = isImagesControl;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { rankWith, or, isPrimitiveArrayControl, isObjectArrayControl } from "../../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
|
|
3
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 { Box } from "@mantine/core";
|
|
4
|
+
import { Box, MantineThemeProvider } from "@mantine/core";
|
|
5
5
|
import { useState, useCallback } from "react";
|
|
6
|
+
import { useThemeCustomizer } from "../../hooks/useThemeCustomizer.mjs";
|
|
6
7
|
import { isEnumArrayArrayControl } from "../../testers/isEnumArrayArrayControl.mjs";
|
|
8
|
+
import { isFilesControl } from "../../testers/isFilesControl.mjs";
|
|
9
|
+
import { isImagesControl } from "../../testers/isImagesControl.mjs";
|
|
7
10
|
import { isJsonArrayControl } from "../../testers/isJsonArrayControl.mjs";
|
|
8
11
|
import { DEFAULT_MARGIN } from "../../utils/constants.mjs";
|
|
9
12
|
import { MantineTableControl } from "../MantineTableControl/MantineTableControl.mjs";
|
|
@@ -48,20 +51,37 @@ const Component = (props) => {
|
|
|
48
51
|
)
|
|
49
52
|
] });
|
|
50
53
|
};
|
|
54
|
+
const FileArrayComponent = (props) => /* @__PURE__ */ jsx(
|
|
55
|
+
MantineThemeProvider,
|
|
56
|
+
{
|
|
57
|
+
theme: useThemeCustomizer({
|
|
58
|
+
"Table.Header.Validation": {
|
|
59
|
+
component: /* @__PURE__ */ jsx(Box, { style: { display: "none" } })
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
51
65
|
const mantineArrayControlTester = rankWith(
|
|
52
66
|
1,
|
|
53
67
|
or(isObjectArrayControl, isPrimitiveArrayControl, isEnumArrayArrayControl, isJsonArrayControl)
|
|
54
68
|
);
|
|
55
69
|
const mantineArrayEnumArrayControlTester = rankWith(3, isEnumArrayArrayControl);
|
|
70
|
+
const mantineArrayFileArrayControlTester = rankWith(4, or(isFilesControl, isImagesControl));
|
|
56
71
|
const MantineArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
57
72
|
withTranslateProps(withArrayTranslationProps(Component))
|
|
58
73
|
);
|
|
59
74
|
const MantineArrayEnumArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
60
75
|
withTranslateProps(withArrayTranslationProps(Component))
|
|
61
76
|
);
|
|
77
|
+
const MantineArrayFileArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
78
|
+
withTranslateProps(withArrayTranslationProps(FileArrayComponent))
|
|
79
|
+
);
|
|
62
80
|
export {
|
|
63
81
|
MantineArrayControlRenderer,
|
|
64
82
|
MantineArrayEnumArrayControlRenderer,
|
|
83
|
+
MantineArrayFileArrayControlRenderer,
|
|
65
84
|
mantineArrayControlTester,
|
|
66
|
-
mantineArrayEnumArrayControlTester
|
|
85
|
+
mantineArrayEnumArrayControlTester,
|
|
86
|
+
mantineArrayFileArrayControlTester
|
|
67
87
|
};
|
|
@@ -102,7 +102,7 @@ const controlWithoutLabel = (scope) => ({
|
|
|
102
102
|
label: false
|
|
103
103
|
});
|
|
104
104
|
const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props) {
|
|
105
|
-
const { path, propName, schema, rootSchema,
|
|
105
|
+
const { path, propName, schema, rootSchema, enabled, renderers, cells } = props;
|
|
106
106
|
const originalPath = useMemo(
|
|
107
107
|
() => path.replace(propName ? `.${propName}` : void 0, "").split(".").slice(0, -1).join("."),
|
|
108
108
|
[path, propName]
|
|
@@ -115,30 +115,27 @@ const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props)
|
|
|
115
115
|
[_contextProps, componentProps, contextProps]
|
|
116
116
|
);
|
|
117
117
|
const theme = useThemeCustomizer({ [path]: { component, props: _props } });
|
|
118
|
-
return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", children: !isValid ? errors : "" })
|
|
141
|
-
] }) });
|
|
118
|
+
return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */ jsx(NoBorderTableCell, { children: schema.properties ? /* @__PURE__ */ jsx(
|
|
119
|
+
DispatchCell,
|
|
120
|
+
{
|
|
121
|
+
schema: Resolve.schema(schema, `#/properties/${encode(propName)}`, rootSchema),
|
|
122
|
+
uischema: controlWithoutLabel(`#/properties/${encode(propName)}`),
|
|
123
|
+
path,
|
|
124
|
+
enabled,
|
|
125
|
+
renderers,
|
|
126
|
+
cells
|
|
127
|
+
}
|
|
128
|
+
) : /* @__PURE__ */ jsx(
|
|
129
|
+
DispatchCell,
|
|
130
|
+
{
|
|
131
|
+
schema,
|
|
132
|
+
uischema: controlWithoutLabel("#"),
|
|
133
|
+
path,
|
|
134
|
+
enabled,
|
|
135
|
+
renderers,
|
|
136
|
+
cells
|
|
137
|
+
}
|
|
138
|
+
) }) });
|
|
142
139
|
});
|
|
143
140
|
const NonEmptyCell = (ownProps) => {
|
|
144
141
|
const ctx = useJsonForms();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MantineArrayControlRenderer, mantineArrayControlTester, MantineArrayEnumArrayControlRenderer, mantineArrayEnumArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
|
|
1
|
+
import { MantineArrayControlRenderer, mantineArrayControlTester, MantineArrayEnumArrayControlRenderer, mantineArrayEnumArrayControlTester, MantineArrayFileArrayControlRenderer, mantineArrayFileArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
|
|
2
2
|
import { MantineEnumArrayRenderer, mantineEnumArrayRendererTester } from "../complex/MantineEnumArrayControl.mjs";
|
|
3
3
|
import { MantineObjectControl, mantineObjectControlTester } from "../complex/MantineObjectControl.mjs";
|
|
4
4
|
import { MantineBooleanControl, mantineBooleanControlTester } from "../controls/MantineBooleanControl.mjs";
|
|
@@ -37,6 +37,7 @@ const mantineRenderers = [
|
|
|
37
37
|
{ tester: mantineObjectControlTester, renderer: MantineObjectControl },
|
|
38
38
|
{ tester: mantineArrayControlTester, renderer: MantineArrayControlRenderer },
|
|
39
39
|
{ tester: mantineArrayEnumArrayControlTester, renderer: MantineArrayEnumArrayControlRenderer },
|
|
40
|
+
{ tester: mantineArrayFileArrayControlTester, renderer: MantineArrayFileArrayControlRenderer },
|
|
40
41
|
{ tester: mantineEnumArrayRendererTester, renderer: MantineEnumArrayRenderer },
|
|
41
42
|
// Layouts
|
|
42
43
|
{ tester: mantineHorizontalLayoutTester, renderer: MantineHorizontalLayoutRenderer },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveSchema } from "../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
|
|
2
|
+
import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
|
|
3
|
+
import { isFileSchema } from "./isFileControl.mjs";
|
|
4
|
+
function isFilesControl(uischema, schema) {
|
|
5
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const resolvedSchema = resolveSchema(schema, uischema.scope);
|
|
9
|
+
try {
|
|
10
|
+
if (isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileSchema(resolvedSchema.items) && !resolvedSchema.items.properties) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
isFilesControl
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveSchema } from "../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
|
|
2
|
+
import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
|
|
3
|
+
import { isFileSchema } from "./isFileControl.mjs";
|
|
4
|
+
function isImagesControl(uischema, schema) {
|
|
5
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const resolvedSchema = resolveSchema(schema, uischema.scope);
|
|
9
|
+
try {
|
|
10
|
+
if (isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileSchema(resolvedSchema.items) && resolvedSchema.items.contentMediaType.startsWith("image/") && !resolvedSchema.items.properties) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
isImagesControl
|
|
20
|
+
};
|
|
@@ -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/
|
|
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/
|
|
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/
|
|
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");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as codegen } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as codegen } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index3.mjs";
|
|
2
2
|
import { __require as requireCode } from "./code.mjs";
|
|
3
3
|
import { __require as requireScope } from "./scope.mjs";
|
|
4
4
|
var hasRequiredCodegen;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as validate } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as validate } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index5.mjs";
|
|
2
2
|
import { __require as requireBoolSchema } from "./boolSchema.mjs";
|
|
3
3
|
import { __require as requireDataType } from "./dataType.mjs";
|
|
4
4
|
import { __require as requireApplicability } from "./applicability.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as discriminator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as discriminator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index4.mjs";
|
|
2
2
|
import { __require as requireCodegen } from "../../compile/codegen/index.mjs";
|
|
3
3
|
import { __require as requireTypes } from "./types.mjs";
|
|
4
4
|
import { __require as requireCompile } from "../../compile/index.mjs";
|
|
@@ -7,7 +7,7 @@ const utils = require("fastapi-rtk/utils");
|
|
|
7
7
|
const core = require("@mantine/core");
|
|
8
8
|
const form = require("@mantine/form");
|
|
9
9
|
const hooks = require("@mantine/hooks");
|
|
10
|
-
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
10
|
+
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
11
11
|
const React = require("react");
|
|
12
12
|
const useApi = require("../hooks/api/useApi.cjs");
|
|
13
13
|
const useForms = require("../hooks/api/useForms.cjs");
|
|
@@ -8,7 +8,7 @@ const core = require("@mantine/core");
|
|
|
8
8
|
const form = require("@mantine/form");
|
|
9
9
|
const hooks = require("@mantine/hooks");
|
|
10
10
|
const lodash = require("../_virtual/lodash.cjs");
|
|
11
|
-
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
11
|
+
const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
12
12
|
const React = require("react");
|
|
13
13
|
const convertToFormInputs$1 = require("../ActionIcons/utils/convertToFormInputs.cjs");
|
|
14
14
|
const convertToFormInputs = require("../fab-react-toolkit-patch/utils/convertToFormInputs.cjs");
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const core = require("@mantine/core");
|
|
5
5
|
const form = require("@mantine/form");
|
|
6
6
|
const hooks = require("@mantine/hooks");
|
|
7
|
-
const index = require("../../../../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
7
|
+
const index = require("../../../../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
|
|
8
8
|
const React = require("react");
|
|
9
9
|
const index_esm = require("../../../../../../.external/cjs/yup@1.7.1/yup/index.esm.cjs");
|
|
10
10
|
const useApi = require("../../../../hooks/api/useApi.cjs");
|
|
@@ -5,7 +5,7 @@ import { deepMerge } from "fastapi-rtk/utils";
|
|
|
5
5
|
import { useProps, Stack } from "@mantine/core";
|
|
6
6
|
import { useForm } from "@mantine/form";
|
|
7
7
|
import { useDebouncedState } from "@mantine/hooks";
|
|
8
|
-
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
8
|
+
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
|
|
9
9
|
import { useMemo, useCallback, useEffect } from "react";
|
|
10
10
|
import { useApi } from "../hooks/api/useApi.mjs";
|
|
11
11
|
import { useForms } from "../hooks/api/useForms.mjs";
|
|
@@ -6,7 +6,7 @@ import { useProps, Stack } from "@mantine/core";
|
|
|
6
6
|
import { useForm } from "@mantine/form";
|
|
7
7
|
import { useDebouncedState } from "@mantine/hooks";
|
|
8
8
|
import { l as lodashExports } from "../_virtual/lodash.mjs";
|
|
9
|
-
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
9
|
+
import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
|
|
10
10
|
import { useMemo, useRef, useEffect, useCallback } from "react";
|
|
11
11
|
import { convertToFormInputs as convertToFormInputs$1 } from "../ActionIcons/utils/convertToFormInputs.mjs";
|
|
12
12
|
import { convertToFormInputs } from "../fab-react-toolkit-patch/utils/convertToFormInputs.mjs";
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useProps, Box, Flex, ActionIcon, Divider, Text, ScrollArea, Button, Group } from "@mantine/core";
|
|
3
3
|
import { useForm } from "@mantine/form";
|
|
4
4
|
import { randomId } from "@mantine/hooks";
|
|
5
|
-
import { yupResolver } from "../../../../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.
|
|
5
|
+
import { yupResolver } from "../../../../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.5_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
|
|
6
6
|
import { useEffect } from "react";
|
|
7
7
|
import { object as create$3, array as create$2, mixed as create$8, string as create$6 } from "../../../../../../.external/esm/yup@1.7.1/yup/index.esm.mjs";
|
|
8
8
|
import { useApi } from "../../../../hooks/api/useApi.mjs";
|
|
@@ -5,7 +5,10 @@ const core = require("@jsonforms/core");
|
|
|
5
5
|
const react = require("@jsonforms/react");
|
|
6
6
|
const core$1 = require("@mantine/core");
|
|
7
7
|
const React = require("react");
|
|
8
|
+
const useThemeCustomizer = require("../../hooks/useThemeCustomizer.cjs");
|
|
8
9
|
const isEnumArrayArrayControl = require("../../testers/isEnumArrayArrayControl.cjs");
|
|
10
|
+
const isFilesControl = require("../../testers/isFilesControl.cjs");
|
|
11
|
+
const isImagesControl = require("../../testers/isImagesControl.cjs");
|
|
9
12
|
const isJsonArrayControl = require("../../testers/isJsonArrayControl.cjs");
|
|
10
13
|
const constants = require("../../utils/constants.cjs");
|
|
11
14
|
const MantineTableControl = require("../MantineTableControl/MantineTableControl.cjs");
|
|
@@ -50,18 +53,35 @@ const Component = (props) => {
|
|
|
50
53
|
)
|
|
51
54
|
] });
|
|
52
55
|
};
|
|
56
|
+
const FileArrayComponent = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
core$1.MantineThemeProvider,
|
|
58
|
+
{
|
|
59
|
+
theme: useThemeCustomizer.useThemeCustomizer({
|
|
60
|
+
"Table.Header.Validation": {
|
|
61
|
+
component: /* @__PURE__ */ jsxRuntime.jsx(core$1.Box, { style: { display: "none" } })
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
53
67
|
const mantineArrayControlTester = core.rankWith(
|
|
54
68
|
1,
|
|
55
69
|
core.or(core.isObjectArrayControl, core.isPrimitiveArrayControl, isEnumArrayArrayControl.isEnumArrayArrayControl, isJsonArrayControl.isJsonArrayControl)
|
|
56
70
|
);
|
|
57
71
|
const mantineArrayEnumArrayControlTester = core.rankWith(3, isEnumArrayArrayControl.isEnumArrayArrayControl);
|
|
72
|
+
const mantineArrayFileArrayControlTester = core.rankWith(4, core.or(isFilesControl.isFilesControl, isImagesControl.isImagesControl));
|
|
58
73
|
const MantineArrayControlRenderer = react.withJsonFormsArrayLayoutProps(
|
|
59
74
|
react.withTranslateProps(react.withArrayTranslationProps(Component))
|
|
60
75
|
);
|
|
61
76
|
const MantineArrayEnumArrayControlRenderer = react.withJsonFormsArrayLayoutProps(
|
|
62
77
|
react.withTranslateProps(react.withArrayTranslationProps(Component))
|
|
63
78
|
);
|
|
79
|
+
const MantineArrayFileArrayControlRenderer = react.withJsonFormsArrayLayoutProps(
|
|
80
|
+
react.withTranslateProps(react.withArrayTranslationProps(FileArrayComponent))
|
|
81
|
+
);
|
|
64
82
|
exports.MantineArrayControlRenderer = MantineArrayControlRenderer;
|
|
65
83
|
exports.MantineArrayEnumArrayControlRenderer = MantineArrayEnumArrayControlRenderer;
|
|
84
|
+
exports.MantineArrayFileArrayControlRenderer = MantineArrayFileArrayControlRenderer;
|
|
66
85
|
exports.mantineArrayControlTester = mantineArrayControlTester;
|
|
67
86
|
exports.mantineArrayEnumArrayControlTester = mantineArrayEnumArrayControlTester;
|
|
87
|
+
exports.mantineArrayFileArrayControlTester = mantineArrayFileArrayControlTester;
|
|
@@ -104,7 +104,7 @@ const controlWithoutLabel = (scope) => ({
|
|
|
104
104
|
label: false
|
|
105
105
|
});
|
|
106
106
|
const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props) {
|
|
107
|
-
const { path, propName, schema, rootSchema,
|
|
107
|
+
const { path, propName, schema, rootSchema, enabled, renderers, cells } = props;
|
|
108
108
|
const originalPath = React.useMemo(
|
|
109
109
|
() => path.replace(propName ? `.${propName}` : void 0, "").split(".").slice(0, -1).join("."),
|
|
110
110
|
[path, propName]
|
|
@@ -117,30 +117,27 @@ const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props)
|
|
|
117
117
|
[_contextProps, componentProps, contextProps]
|
|
118
118
|
);
|
|
119
119
|
const theme = useThemeCustomizer.useThemeCustomizer({ [path]: { component, props: _props } });
|
|
120
|
-
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
{
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
),
|
|
142
|
-
/* @__PURE__ */ jsxRuntime.jsx(core.Text, { size: "xs", children: !isValid ? errors : "" })
|
|
143
|
-
] }) });
|
|
120
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.MantineThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntime.jsx(NoBorderTableCell.NoBorderTableCell, { children: schema.properties ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
react.DispatchCell,
|
|
122
|
+
{
|
|
123
|
+
schema: core$1.Resolve.schema(schema, `#/properties/${core$1.encode(propName)}`, rootSchema),
|
|
124
|
+
uischema: controlWithoutLabel(`#/properties/${core$1.encode(propName)}`),
|
|
125
|
+
path,
|
|
126
|
+
enabled,
|
|
127
|
+
renderers,
|
|
128
|
+
cells
|
|
129
|
+
}
|
|
130
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
131
|
+
react.DispatchCell,
|
|
132
|
+
{
|
|
133
|
+
schema,
|
|
134
|
+
uischema: controlWithoutLabel("#"),
|
|
135
|
+
path,
|
|
136
|
+
enabled,
|
|
137
|
+
renderers,
|
|
138
|
+
cells
|
|
139
|
+
}
|
|
140
|
+
) }) });
|
|
144
141
|
});
|
|
145
142
|
const NonEmptyCell = (ownProps) => {
|
|
146
143
|
const ctx = react.useJsonForms();
|
|
@@ -39,6 +39,7 @@ const mantineRenderers = [
|
|
|
39
39
|
{ tester: MantineObjectControl.mantineObjectControlTester, renderer: MantineObjectControl.MantineObjectControl },
|
|
40
40
|
{ tester: MantineArrayControl.mantineArrayControlTester, renderer: MantineArrayControl.MantineArrayControlRenderer },
|
|
41
41
|
{ tester: MantineArrayControl.mantineArrayEnumArrayControlTester, renderer: MantineArrayControl.MantineArrayEnumArrayControlRenderer },
|
|
42
|
+
{ tester: MantineArrayControl.mantineArrayFileArrayControlTester, renderer: MantineArrayControl.MantineArrayFileArrayControlRenderer },
|
|
42
43
|
{ tester: MantineEnumArrayControl.mantineEnumArrayRendererTester, renderer: MantineEnumArrayControl.MantineEnumArrayRenderer },
|
|
43
44
|
// Layouts
|
|
44
45
|
{ tester: MantineHotizontalLayoutRenderer.mantineHorizontalLayoutTester, renderer: MantineHotizontalLayoutRenderer.MantineHorizontalLayoutRenderer },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const core = require("@jsonforms/core");
|
|
4
|
+
const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
|
|
5
|
+
const isFileControl = require("./isFileControl.cjs");
|
|
6
|
+
function isFilesControl(uischema, schema) {
|
|
7
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const resolvedSchema = core.resolveSchema(schema, uischema.scope);
|
|
11
|
+
try {
|
|
12
|
+
if (isSchemaTypeInclude.isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileControl.isFileSchema(resolvedSchema.items) && !resolvedSchema.items.properties) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.isFilesControl = isFilesControl;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const core = require("@jsonforms/core");
|
|
4
|
+
const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
|
|
5
|
+
const isFileControl = require("./isFileControl.cjs");
|
|
6
|
+
function isImagesControl(uischema, schema) {
|
|
7
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const resolvedSchema = core.resolveSchema(schema, uischema.scope);
|
|
11
|
+
try {
|
|
12
|
+
if (isSchemaTypeInclude.isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileControl.isFileSchema(resolvedSchema.items) && resolvedSchema.items.contentMediaType.startsWith("image/") && !resolvedSchema.items.properties) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
} catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.isImagesControl = isImagesControl;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsxs, Fragment
|
|
1
|
+
import { jsx, jsxs, Fragment } 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 { Box } from "@mantine/core";
|
|
4
|
+
import { Box, MantineThemeProvider } from "@mantine/core";
|
|
5
5
|
import { useState, useCallback } from "react";
|
|
6
|
+
import { useThemeCustomizer } from "../../hooks/useThemeCustomizer.mjs";
|
|
6
7
|
import { isEnumArrayArrayControl } from "../../testers/isEnumArrayArrayControl.mjs";
|
|
8
|
+
import { isFilesControl } from "../../testers/isFilesControl.mjs";
|
|
9
|
+
import { isImagesControl } from "../../testers/isImagesControl.mjs";
|
|
7
10
|
import { isJsonArrayControl } from "../../testers/isJsonArrayControl.mjs";
|
|
8
11
|
import { DEFAULT_MARGIN } from "../../utils/constants.mjs";
|
|
9
12
|
import { MantineTableControl } from "../MantineTableControl/MantineTableControl.mjs";
|
|
@@ -48,20 +51,37 @@ const Component = (props) => {
|
|
|
48
51
|
)
|
|
49
52
|
] });
|
|
50
53
|
};
|
|
54
|
+
const FileArrayComponent = (props) => /* @__PURE__ */ jsx(
|
|
55
|
+
MantineThemeProvider,
|
|
56
|
+
{
|
|
57
|
+
theme: useThemeCustomizer({
|
|
58
|
+
"Table.Header.Validation": {
|
|
59
|
+
component: /* @__PURE__ */ jsx(Box, { style: { display: "none" } })
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
51
65
|
const mantineArrayControlTester = rankWith(
|
|
52
66
|
1,
|
|
53
67
|
or(isObjectArrayControl, isPrimitiveArrayControl, isEnumArrayArrayControl, isJsonArrayControl)
|
|
54
68
|
);
|
|
55
69
|
const mantineArrayEnumArrayControlTester = rankWith(3, isEnumArrayArrayControl);
|
|
70
|
+
const mantineArrayFileArrayControlTester = rankWith(4, or(isFilesControl, isImagesControl));
|
|
56
71
|
const MantineArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
57
72
|
withTranslateProps(withArrayTranslationProps(Component))
|
|
58
73
|
);
|
|
59
74
|
const MantineArrayEnumArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
60
75
|
withTranslateProps(withArrayTranslationProps(Component))
|
|
61
76
|
);
|
|
77
|
+
const MantineArrayFileArrayControlRenderer = withJsonFormsArrayLayoutProps(
|
|
78
|
+
withTranslateProps(withArrayTranslationProps(FileArrayComponent))
|
|
79
|
+
);
|
|
62
80
|
export {
|
|
63
81
|
MantineArrayControlRenderer,
|
|
64
82
|
MantineArrayEnumArrayControlRenderer,
|
|
83
|
+
MantineArrayFileArrayControlRenderer,
|
|
65
84
|
mantineArrayControlTester,
|
|
66
|
-
mantineArrayEnumArrayControlTester
|
|
85
|
+
mantineArrayEnumArrayControlTester,
|
|
86
|
+
mantineArrayFileArrayControlTester
|
|
67
87
|
};
|
|
@@ -102,7 +102,7 @@ const controlWithoutLabel = (scope) => ({
|
|
|
102
102
|
label: false
|
|
103
103
|
});
|
|
104
104
|
const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props) {
|
|
105
|
-
const { path, propName, schema, rootSchema,
|
|
105
|
+
const { path, propName, schema, rootSchema, enabled, renderers, cells } = props;
|
|
106
106
|
const originalPath = useMemo(
|
|
107
107
|
() => path.replace(propName ? `.${propName}` : void 0, "").split(".").slice(0, -1).join("."),
|
|
108
108
|
[path, propName]
|
|
@@ -115,30 +115,27 @@ const NonEmptyCellComponent = React.memo(function NonEmptyCellComponent2(props)
|
|
|
115
115
|
[_contextProps, componentProps, contextProps]
|
|
116
116
|
);
|
|
117
117
|
const theme = useThemeCustomizer({ [path]: { component, props: _props } });
|
|
118
|
-
return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
),
|
|
140
|
-
/* @__PURE__ */ jsx(Text, { size: "xs", children: !isValid ? errors : "" })
|
|
141
|
-
] }) });
|
|
118
|
+
return /* @__PURE__ */ jsx(MantineThemeProvider, { theme, children: /* @__PURE__ */ jsx(NoBorderTableCell, { children: schema.properties ? /* @__PURE__ */ jsx(
|
|
119
|
+
DispatchCell,
|
|
120
|
+
{
|
|
121
|
+
schema: Resolve.schema(schema, `#/properties/${encode(propName)}`, rootSchema),
|
|
122
|
+
uischema: controlWithoutLabel(`#/properties/${encode(propName)}`),
|
|
123
|
+
path,
|
|
124
|
+
enabled,
|
|
125
|
+
renderers,
|
|
126
|
+
cells
|
|
127
|
+
}
|
|
128
|
+
) : /* @__PURE__ */ jsx(
|
|
129
|
+
DispatchCell,
|
|
130
|
+
{
|
|
131
|
+
schema,
|
|
132
|
+
uischema: controlWithoutLabel("#"),
|
|
133
|
+
path,
|
|
134
|
+
enabled,
|
|
135
|
+
renderers,
|
|
136
|
+
cells
|
|
137
|
+
}
|
|
138
|
+
) }) });
|
|
142
139
|
});
|
|
143
140
|
const NonEmptyCell = (ownProps) => {
|
|
144
141
|
const ctx = useJsonForms();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MantineArrayControlRenderer, mantineArrayControlTester, MantineArrayEnumArrayControlRenderer, mantineArrayEnumArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
|
|
1
|
+
import { MantineArrayControlRenderer, mantineArrayControlTester, MantineArrayEnumArrayControlRenderer, mantineArrayEnumArrayControlTester, MantineArrayFileArrayControlRenderer, mantineArrayFileArrayControlTester } from "../complex/MantineArrayControl/MantineArrayControl.mjs";
|
|
2
2
|
import { MantineEnumArrayRenderer, mantineEnumArrayRendererTester } from "../complex/MantineEnumArrayControl.mjs";
|
|
3
3
|
import { MantineObjectControl, mantineObjectControlTester } from "../complex/MantineObjectControl.mjs";
|
|
4
4
|
import { MantineBooleanControl, mantineBooleanControlTester } from "../controls/MantineBooleanControl.mjs";
|
|
@@ -37,6 +37,7 @@ const mantineRenderers = [
|
|
|
37
37
|
{ tester: mantineObjectControlTester, renderer: MantineObjectControl },
|
|
38
38
|
{ tester: mantineArrayControlTester, renderer: MantineArrayControlRenderer },
|
|
39
39
|
{ tester: mantineArrayEnumArrayControlTester, renderer: MantineArrayEnumArrayControlRenderer },
|
|
40
|
+
{ tester: mantineArrayFileArrayControlTester, renderer: MantineArrayFileArrayControlRenderer },
|
|
40
41
|
{ tester: mantineEnumArrayRendererTester, renderer: MantineEnumArrayRenderer },
|
|
41
42
|
// Layouts
|
|
42
43
|
{ tester: mantineHorizontalLayoutTester, renderer: MantineHorizontalLayoutRenderer },
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveSchema } from "@jsonforms/core";
|
|
2
|
+
import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
|
|
3
|
+
import { isFileSchema } from "./isFileControl.mjs";
|
|
4
|
+
function isFilesControl(uischema, schema) {
|
|
5
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const resolvedSchema = resolveSchema(schema, uischema.scope);
|
|
9
|
+
try {
|
|
10
|
+
if (isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileSchema(resolvedSchema.items) && !resolvedSchema.items.properties) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
isFilesControl
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { resolveSchema } from "@jsonforms/core";
|
|
2
|
+
import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
|
|
3
|
+
import { isFileSchema } from "./isFileControl.mjs";
|
|
4
|
+
function isImagesControl(uischema, schema) {
|
|
5
|
+
if (!uischema.scope || uischema.type !== "Control") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const resolvedSchema = resolveSchema(schema, uischema.scope);
|
|
9
|
+
try {
|
|
10
|
+
if (isSchemaTypeInclude(resolvedSchema.type, "array") && !Array.isArray(resolvedSchema.items) && isFileSchema(resolvedSchema.items) && resolvedSchema.items.contentMediaType.startsWith("image/") && !resolvedSchema.items.properties) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
isImagesControl
|
|
20
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const mantineArrayControlTester: (uischema: import('@jsonforms/core').UISchemaElement, schema: import('@jsonforms/core').JsonSchema, context: import('@jsonforms/core').TesterContext) => number;
|
|
2
2
|
export const mantineArrayEnumArrayControlTester: (uischema: import('@jsonforms/core').UISchemaElement, schema: import('@jsonforms/core').JsonSchema, context: import('@jsonforms/core').TesterContext) => number;
|
|
3
|
+
export const mantineArrayFileArrayControlTester: (uischema: import('@jsonforms/core').UISchemaElement, schema: import('@jsonforms/core').JsonSchema, context: import('@jsonforms/core').TesterContext) => number;
|
|
3
4
|
export const MantineArrayControlRenderer: import('react').ComponentType<import('@jsonforms/core').OwnPropsOfControl>;
|
|
4
5
|
export const MantineArrayEnumArrayControlRenderer: import('react').ComponentType<import('@jsonforms/core').OwnPropsOfControl>;
|
|
6
|
+
export const MantineArrayFileArrayControlRenderer: import('react').ComponentType<import('@jsonforms/core').OwnPropsOfControl>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if the given UI schema control is a files control.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} uischema - The UI schema to evaluate.
|
|
5
|
+
* @param {string} uischema.scope - The scope of the UI schema.
|
|
6
|
+
* @param {string} uischema.type - The type of the UI schema.
|
|
7
|
+
* @param {Object} schema - The JSON schema to resolve against.
|
|
8
|
+
* @returns {boolean} - Returns true if the control is a files control, otherwise false.
|
|
9
|
+
*/
|
|
10
|
+
export function isFilesControl(uischema: {
|
|
11
|
+
scope: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}, schema: any): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if the given UI schema control is an images control.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} uischema - The UI schema to evaluate.
|
|
5
|
+
* @param {string} uischema.scope - The scope of the UI schema.
|
|
6
|
+
* @param {string} uischema.type - The type of the UI schema.
|
|
7
|
+
* @param {Object} schema - The JSON schema to resolve against.
|
|
8
|
+
* @returns {boolean} - Returns true if the control is an images control, otherwise false.
|
|
9
|
+
*/
|
|
10
|
+
export function isImagesControl(uischema: {
|
|
11
|
+
scope: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}, schema: any): boolean;
|
package/package.json
CHANGED
|
File without changes
|