fastapi-rtk 1.0.37 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.bundled/jsonforms/cjs/_virtual/index10.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index11.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index12.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index3.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index4.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index5.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index6.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index7.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index8.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/_virtual/index9.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineFileInput.cjs +5 -6
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useCommonProps.cjs +1 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useFileProps.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useIfProps.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index10.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index11.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index12.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index6.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index7.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index8.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index9.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineFileInput.mjs +5 -6
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useCommonProps.mjs +1 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useFileProps.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useIfProps.mjs +2 -2
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/compile/codegen/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/compile/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/compile/validate/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/applicator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/core/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/format/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.18.0/ajv/dist/vocabularies/validation/index.cjs +1 -1
- package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/index.cjs +1 -1
- package/dist/.external/cjs/json-schema-traverse@1.0.0/json-schema-traverse/index.cjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/compile/codegen/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/compile/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/compile/validate/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/applicator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/core/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/format/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.18.0/ajv/dist/vocabularies/validation/index.mjs +1 -1
- package/dist/.external/esm/fast-uri@3.1.0/fast-uri/index.mjs +1 -1
- package/dist/.external/esm/json-schema-traverse@1.0.0/json-schema-traverse/index.mjs +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineFileInput.cjs +5 -6
- package/dist/jsonforms/cjs/hooks/useCommonProps.cjs +1 -1
- package/dist/jsonforms/cjs/hooks/useFileProps.cjs +2 -2
- package/dist/jsonforms/cjs/hooks/useIfProps.cjs +2 -2
- package/dist/jsonforms/esm/MantineInputs/MantineFileInput.mjs +5 -6
- package/dist/jsonforms/esm/hooks/useCommonProps.mjs +1 -1
- package/dist/jsonforms/esm/hooks/useFileProps.mjs +2 -2
- package/dist/jsonforms/esm/hooks/useIfProps.mjs +2 -2
- package/dist/jsonforms/lib/hooks/useFileProps.d.ts +3 -3
- package/package.json +1 -1
package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineFileInput.cjs
CHANGED
|
@@ -10,12 +10,11 @@ const useFileProps = require("../hooks/useFileProps.cjs");
|
|
|
10
10
|
const InnerMantineFileInput = ({ contextName, children, ...props }) => {
|
|
11
11
|
const { value, ...commonProps } = useCommonProps.useCommonProps(props);
|
|
12
12
|
const { path, schema, errors } = props;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
13
|
+
const accept = React.useMemo(
|
|
14
|
+
() => (/* @__PURE__ */ new Set([...schema.contentMediaType ?? [], ...schema["x-file-types"] ?? []])).values().toArray().join(","),
|
|
15
|
+
[schema.contentMediaType, schema["x-file-types"]]
|
|
16
|
+
);
|
|
17
|
+
const fileProps = useFileProps.useFileProps({ value, onChange: commonProps.onChange, accept, errors });
|
|
19
18
|
const componentProps = React.useMemo(() => ({ ...commonProps, ...fileProps }), [commonProps, fileProps]);
|
|
20
19
|
const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, props);
|
|
21
20
|
if (!props.visible) {
|
|
@@ -36,7 +36,7 @@ function useCommonProps(props = {}) {
|
|
|
36
36
|
setValue(props.data);
|
|
37
37
|
}, [props.data]);
|
|
38
38
|
React.useEffect(() => {
|
|
39
|
-
if (props.data === void 0) {
|
|
39
|
+
if (props.data === void 0 && props.schema.default !== void 0) {
|
|
40
40
|
onChange(props.schema.default);
|
|
41
41
|
}
|
|
42
42
|
}, [props.schema.default]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
function useFileProps({ value, onChange,
|
|
4
|
+
function useFileProps({ value, onChange, accept, errors }) {
|
|
5
5
|
var _a;
|
|
6
6
|
const filteredErrors = (_a = errors == null ? void 0 : errors.split("\n").filter((error) => !error.startsWith("must be string"))) == null ? void 0 : _a.join("\n");
|
|
7
7
|
value = value || null;
|
|
@@ -11,7 +11,7 @@ function useFileProps({ value, onChange, contentMediaType, errors }) {
|
|
|
11
11
|
return {
|
|
12
12
|
value,
|
|
13
13
|
onChange: (value2) => onChange(value2 || void 0),
|
|
14
|
-
accept:
|
|
14
|
+
accept: accept || void 0,
|
|
15
15
|
error: filteredErrors ? filteredErrors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
|
|
16
16
|
clearable: true
|
|
17
17
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const useIfProps = (schema, core, key = "props") => React.useMemo(() => {
|
|
5
|
-
|
|
5
|
+
const { ajv, data } = core;
|
|
6
|
+
if (!schema || data === void 0) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
9
|
const { if: condition, then: thenBranch, else: elseBranch } = schema;
|
|
9
|
-
const { ajv, data } = core;
|
|
10
10
|
return ajv.validate(condition, data) ? thenBranch == null ? void 0 : thenBranch[key] : elseBranch == null ? void 0 : elseBranch[key];
|
|
11
11
|
}, [schema, core, key]);
|
|
12
12
|
exports.useIfProps = useIfProps;
|
package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineFileInput.mjs
CHANGED
|
@@ -8,12 +8,11 @@ import { useFileProps } from "../hooks/useFileProps.mjs";
|
|
|
8
8
|
const InnerMantineFileInput = ({ contextName, children, ...props }) => {
|
|
9
9
|
const { value, ...commonProps } = useCommonProps(props);
|
|
10
10
|
const { path, schema, errors } = props;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
11
|
+
const accept = useMemo(
|
|
12
|
+
() => (/* @__PURE__ */ new Set([...schema.contentMediaType ?? [], ...schema["x-file-types"] ?? []])).values().toArray().join(","),
|
|
13
|
+
[schema.contentMediaType, schema["x-file-types"]]
|
|
14
|
+
);
|
|
15
|
+
const fileProps = useFileProps({ value, onChange: commonProps.onChange, accept, errors });
|
|
17
16
|
const componentProps = useMemo(() => ({ ...commonProps, ...fileProps }), [commonProps, fileProps]);
|
|
18
17
|
const [Component, _props] = useContextProps(contextName, path, componentProps, props);
|
|
19
18
|
if (!props.visible) {
|
|
@@ -34,7 +34,7 @@ function useCommonProps(props = {}) {
|
|
|
34
34
|
setValue(props.data);
|
|
35
35
|
}, [props.data]);
|
|
36
36
|
useEffect(() => {
|
|
37
|
-
if (props.data === void 0) {
|
|
37
|
+
if (props.data === void 0 && props.schema.default !== void 0) {
|
|
38
38
|
onChange(props.schema.default);
|
|
39
39
|
}
|
|
40
40
|
}, [props.schema.default]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
function useFileProps({ value, onChange,
|
|
2
|
+
function useFileProps({ value, onChange, accept, errors }) {
|
|
3
3
|
var _a;
|
|
4
4
|
const filteredErrors = (_a = errors == null ? void 0 : errors.split("\n").filter((error) => !error.startsWith("must be string"))) == null ? void 0 : _a.join("\n");
|
|
5
5
|
value = value || null;
|
|
@@ -9,7 +9,7 @@ function useFileProps({ value, onChange, contentMediaType, errors }) {
|
|
|
9
9
|
return {
|
|
10
10
|
value,
|
|
11
11
|
onChange: (value2) => onChange(value2 || void 0),
|
|
12
|
-
accept:
|
|
12
|
+
accept: accept || void 0,
|
|
13
13
|
error: filteredErrors ? filteredErrors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
|
|
14
14
|
clearable: true
|
|
15
15
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
const useIfProps = (schema, core, key = "props") => useMemo(() => {
|
|
3
|
-
|
|
3
|
+
const { ajv, data } = core;
|
|
4
|
+
if (!schema || data === void 0) {
|
|
4
5
|
return;
|
|
5
6
|
}
|
|
6
7
|
const { if: condition, then: thenBranch, else: elseBranch } = schema;
|
|
7
|
-
const { ajv, data } = core;
|
|
8
8
|
return ajv.validate(condition, data) ? thenBranch == null ? void 0 : thenBranch[key] : elseBranch == null ? void 0 : elseBranch[key];
|
|
9
9
|
}, [schema, core, key]);
|
|
10
10
|
export {
|
|
@@ -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/index6.cjs");
|
|
4
4
|
const index$1 = require("./codegen/index.cjs");
|
|
5
5
|
const validation_error = require("../runtime/validation_error.cjs");
|
|
6
6
|
const names = require("./names.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/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/index9.cjs");
|
|
4
4
|
const additionalItems = require("./additionalItems.cjs");
|
|
5
5
|
const prefixItems = require("./prefixItems.cjs");
|
|
6
6
|
const items = require("./items.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/index7.cjs");
|
|
4
4
|
const id = require("./id.cjs");
|
|
5
5
|
const ref = require("./ref.cjs");
|
|
6
6
|
var hasRequiredCore;
|
|
@@ -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,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/index10.cjs");
|
|
4
4
|
const format = require("./format.cjs");
|
|
5
5
|
var hasRequiredFormat;
|
|
6
6
|
function requireFormat() {
|
|
@@ -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/index8.cjs");
|
|
4
4
|
const limitNumber = require("./limitNumber.cjs");
|
|
5
5
|
const multipleOf = require("./multipleOf.cjs");
|
|
6
6
|
const limitLength = require("./limitLength.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/index11.cjs");
|
|
4
4
|
const utils = require("./lib/utils.cjs");
|
|
5
5
|
const schemes = require("./lib/schemes.cjs");
|
|
6
6
|
var hasRequiredFastUri;
|
|
@@ -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/index12.cjs");
|
|
4
4
|
var hasRequiredJsonSchemaTraverse;
|
|
5
5
|
function requireJsonSchemaTraverse() {
|
|
6
6
|
if (hasRequiredJsonSchemaTraverse) return index.__module.exports;
|
|
@@ -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 compile } from "../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as compile } from "../../../../../../.bundled/jsonforms/esm/_virtual/index6.mjs";
|
|
2
2
|
import { __require as requireCodegen } from "./codegen/index.mjs";
|
|
3
3
|
import { __require as requireValidation_error } from "../runtime/validation_error.mjs";
|
|
4
4
|
import { __require as requireNames } from "./names.mjs";
|
|
@@ -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 applicator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as applicator } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index9.mjs";
|
|
2
2
|
import { __require as requireAdditionalItems } from "./additionalItems.mjs";
|
|
3
3
|
import { __require as requirePrefixItems } from "./prefixItems.mjs";
|
|
4
4
|
import { __require as requireItems } from "./items.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as core } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as core } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index7.mjs";
|
|
2
2
|
import { __require as requireId } from "./id.mjs";
|
|
3
3
|
import { __require as requireRef } from "./ref.mjs";
|
|
4
4
|
var hasRequiredCore;
|
|
@@ -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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as format } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as format } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index10.mjs";
|
|
2
2
|
import { __require as requireFormat$1 } from "./format.mjs";
|
|
3
3
|
var hasRequiredFormat;
|
|
4
4
|
function requireFormat() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as validation } from "../../../../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __exports as validation } from "../../../../../../../.bundled/jsonforms/esm/_virtual/index8.mjs";
|
|
2
2
|
import { __require as requireLimitNumber } from "./limitNumber.mjs";
|
|
3
3
|
import { __require as requireMultipleOf } from "./multipleOf.mjs";
|
|
4
4
|
import { __require as requireLimitLength } from "./limitLength.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/index11.mjs";
|
|
2
2
|
import { __require as requireUtils } from "./lib/utils.mjs";
|
|
3
3
|
import { __require as requireSchemes } from "./lib/schemes.mjs";
|
|
4
4
|
var hasRequiredFastUri;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as jsonSchemaTraverse } from "../../../../.bundled/jsonforms/esm/_virtual/
|
|
1
|
+
import { __module as jsonSchemaTraverse } from "../../../../.bundled/jsonforms/esm/_virtual/index12.mjs";
|
|
2
2
|
var hasRequiredJsonSchemaTraverse;
|
|
3
3
|
function requireJsonSchemaTraverse() {
|
|
4
4
|
if (hasRequiredJsonSchemaTraverse) return jsonSchemaTraverse.exports;
|
|
@@ -10,12 +10,11 @@ const useFileProps = require("../hooks/useFileProps.cjs");
|
|
|
10
10
|
const InnerMantineFileInput = ({ contextName, children, ...props }) => {
|
|
11
11
|
const { value, ...commonProps } = useCommonProps.useCommonProps(props);
|
|
12
12
|
const { path, schema, errors } = props;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
13
|
+
const accept = React.useMemo(
|
|
14
|
+
() => (/* @__PURE__ */ new Set([...schema.contentMediaType ?? [], ...schema["x-file-types"] ?? []])).values().toArray().join(","),
|
|
15
|
+
[schema.contentMediaType, schema["x-file-types"]]
|
|
16
|
+
);
|
|
17
|
+
const fileProps = useFileProps.useFileProps({ value, onChange: commonProps.onChange, accept, errors });
|
|
19
18
|
const componentProps = React.useMemo(() => ({ ...commonProps, ...fileProps }), [commonProps, fileProps]);
|
|
20
19
|
const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, props);
|
|
21
20
|
if (!props.visible) {
|
|
@@ -36,7 +36,7 @@ function useCommonProps(props = {}) {
|
|
|
36
36
|
setValue(props.data);
|
|
37
37
|
}, [props.data]);
|
|
38
38
|
React.useEffect(() => {
|
|
39
|
-
if (props.data === void 0) {
|
|
39
|
+
if (props.data === void 0 && props.schema.default !== void 0) {
|
|
40
40
|
onChange(props.schema.default);
|
|
41
41
|
}
|
|
42
42
|
}, [props.schema.default]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
function useFileProps({ value, onChange,
|
|
4
|
+
function useFileProps({ value, onChange, accept, errors }) {
|
|
5
5
|
var _a;
|
|
6
6
|
const filteredErrors = (_a = errors == null ? void 0 : errors.split("\n").filter((error) => !error.startsWith("must be string"))) == null ? void 0 : _a.join("\n");
|
|
7
7
|
value = value || null;
|
|
@@ -11,7 +11,7 @@ function useFileProps({ value, onChange, contentMediaType, errors }) {
|
|
|
11
11
|
return {
|
|
12
12
|
value,
|
|
13
13
|
onChange: (value2) => onChange(value2 || void 0),
|
|
14
|
-
accept:
|
|
14
|
+
accept: accept || void 0,
|
|
15
15
|
error: filteredErrors ? filteredErrors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
|
|
16
16
|
clearable: true
|
|
17
17
|
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const useIfProps = (schema, core, key = "props") => React.useMemo(() => {
|
|
5
|
-
|
|
5
|
+
const { ajv, data } = core;
|
|
6
|
+
if (!schema || data === void 0) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
9
|
const { if: condition, then: thenBranch, else: elseBranch } = schema;
|
|
9
|
-
const { ajv, data } = core;
|
|
10
10
|
return ajv.validate(condition, data) ? thenBranch == null ? void 0 : thenBranch[key] : elseBranch == null ? void 0 : elseBranch[key];
|
|
11
11
|
}, [schema, core, key]);
|
|
12
12
|
exports.useIfProps = useIfProps;
|
|
@@ -8,12 +8,11 @@ import { useFileProps } from "../hooks/useFileProps.mjs";
|
|
|
8
8
|
const InnerMantineFileInput = ({ contextName, children, ...props }) => {
|
|
9
9
|
const { value, ...commonProps } = useCommonProps(props);
|
|
10
10
|
const { path, schema, errors } = props;
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
11
|
+
const accept = useMemo(
|
|
12
|
+
() => (/* @__PURE__ */ new Set([...schema.contentMediaType ?? [], ...schema["x-file-types"] ?? []])).values().toArray().join(","),
|
|
13
|
+
[schema.contentMediaType, schema["x-file-types"]]
|
|
14
|
+
);
|
|
15
|
+
const fileProps = useFileProps({ value, onChange: commonProps.onChange, accept, errors });
|
|
17
16
|
const componentProps = useMemo(() => ({ ...commonProps, ...fileProps }), [commonProps, fileProps]);
|
|
18
17
|
const [Component, _props] = useContextProps(contextName, path, componentProps, props);
|
|
19
18
|
if (!props.visible) {
|
|
@@ -34,7 +34,7 @@ function useCommonProps(props = {}) {
|
|
|
34
34
|
setValue(props.data);
|
|
35
35
|
}, [props.data]);
|
|
36
36
|
useEffect(() => {
|
|
37
|
-
if (props.data === void 0) {
|
|
37
|
+
if (props.data === void 0 && props.schema.default !== void 0) {
|
|
38
38
|
onChange(props.schema.default);
|
|
39
39
|
}
|
|
40
40
|
}, [props.schema.default]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
function useFileProps({ value, onChange,
|
|
2
|
+
function useFileProps({ value, onChange, accept, errors }) {
|
|
3
3
|
var _a;
|
|
4
4
|
const filteredErrors = (_a = errors == null ? void 0 : errors.split("\n").filter((error) => !error.startsWith("must be string"))) == null ? void 0 : _a.join("\n");
|
|
5
5
|
value = value || null;
|
|
@@ -9,7 +9,7 @@ function useFileProps({ value, onChange, contentMediaType, errors }) {
|
|
|
9
9
|
return {
|
|
10
10
|
value,
|
|
11
11
|
onChange: (value2) => onChange(value2 || void 0),
|
|
12
|
-
accept:
|
|
12
|
+
accept: accept || void 0,
|
|
13
13
|
error: filteredErrors ? filteredErrors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
|
|
14
14
|
clearable: true
|
|
15
15
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
const useIfProps = (schema, core, key = "props") => useMemo(() => {
|
|
3
|
-
|
|
3
|
+
const { ajv, data } = core;
|
|
4
|
+
if (!schema || data === void 0) {
|
|
4
5
|
return;
|
|
5
6
|
}
|
|
6
7
|
const { if: condition, then: thenBranch, else: elseBranch } = schema;
|
|
7
|
-
const { ajv, data } = core;
|
|
8
8
|
return ajv.validate(condition, data) ? thenBranch == null ? void 0 : thenBranch[key] : elseBranch == null ? void 0 : elseBranch[key];
|
|
9
9
|
}, [schema, core, key]);
|
|
10
10
|
export {
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* @param {Object} params - The parameters object.
|
|
5
5
|
* @param {string | File} params.value - The initial value of the file input.
|
|
6
6
|
* @param {Function} params.onChange - The callback function to handle changes in the file input.
|
|
7
|
-
* @param {string} params.
|
|
7
|
+
* @param {string} params.accept - The accepted media type for the file input.
|
|
8
8
|
* @param {string} params.errors - The error messages associated with the file input.
|
|
9
9
|
* @returns - An object containing properties for the file input component.
|
|
10
10
|
*/
|
|
11
|
-
export function useFileProps({ value, onChange,
|
|
11
|
+
export function useFileProps({ value, onChange, accept, errors }: {
|
|
12
12
|
value: string | File;
|
|
13
13
|
onChange: Function;
|
|
14
|
-
|
|
14
|
+
accept: string;
|
|
15
15
|
errors: string;
|
|
16
16
|
}): {
|
|
17
17
|
value: File;
|
package/package.json
CHANGED