fastapi-rtk 2.3.4 → 2.4.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 (75) 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/index.cjs +2 -0
  10. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineBooleanInput.cjs +6 -1
  11. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineDateInput.cjs +7 -2
  12. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineDateTimeInput.cjs +7 -2
  13. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumInput.cjs +6 -1
  14. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineNumberInput.cjs +7 -2
  15. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.cjs +2 -8
  16. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineTextInput.cjs +6 -1
  17. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineTimeInput.cjs +7 -2
  18. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useNullableErrorProps.cjs +23 -0
  19. package/dist/.bundled/jsonforms/esm/_virtual/index10.mjs +2 -2
  20. package/dist/.bundled/jsonforms/esm/_virtual/index3.mjs +2 -2
  21. package/dist/.bundled/jsonforms/esm/_virtual/index4.mjs +2 -2
  22. package/dist/.bundled/jsonforms/esm/_virtual/index5.mjs +2 -2
  23. package/dist/.bundled/jsonforms/esm/_virtual/index6.mjs +2 -2
  24. package/dist/.bundled/jsonforms/esm/_virtual/index7.mjs +2 -2
  25. package/dist/.bundled/jsonforms/esm/_virtual/index8.mjs +2 -2
  26. package/dist/.bundled/jsonforms/esm/_virtual/index9.mjs +2 -2
  27. package/dist/.bundled/jsonforms/esm/index.mjs +2 -0
  28. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineBooleanInput.mjs +6 -1
  29. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineDateInput.mjs +7 -2
  30. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineDateTimeInput.mjs +7 -2
  31. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumInput.mjs +6 -1
  32. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineNumberInput.mjs +7 -2
  33. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.mjs +2 -8
  34. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineTextInput.mjs +6 -1
  35. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineTimeInput.mjs +7 -2
  36. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useNullableErrorProps.mjs +23 -0
  37. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/index.cjs +1 -1
  38. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/index.cjs +1 -1
  39. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/validate/index.cjs +1 -1
  40. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.cjs +1 -1
  41. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/core/index.cjs +1 -1
  42. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.cjs +1 -1
  43. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/format/index.cjs +1 -1
  44. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/validation/index.cjs +1 -1
  45. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/index.mjs +1 -1
  46. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/index.mjs +1 -1
  47. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/validate/index.mjs +1 -1
  48. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.mjs +1 -1
  49. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/core/index.mjs +1 -1
  50. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/discriminator/index.mjs +1 -1
  51. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/format/index.mjs +1 -1
  52. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/validation/index.mjs +1 -1
  53. package/dist/jsonforms/cjs/MantineInputs/MantineBooleanInput.cjs +6 -1
  54. package/dist/jsonforms/cjs/MantineInputs/MantineDateInput.cjs +7 -2
  55. package/dist/jsonforms/cjs/MantineInputs/MantineDateTimeInput.cjs +7 -2
  56. package/dist/jsonforms/cjs/MantineInputs/MantineEnumInput.cjs +6 -1
  57. package/dist/jsonforms/cjs/MantineInputs/MantineNumberInput.cjs +7 -2
  58. package/dist/jsonforms/cjs/MantineInputs/MantineOneOfEnumInput.cjs +2 -8
  59. package/dist/jsonforms/cjs/MantineInputs/MantineTextInput.cjs +6 -1
  60. package/dist/jsonforms/cjs/MantineInputs/MantineTimeInput.cjs +7 -2
  61. package/dist/jsonforms/cjs/hooks/useNullableErrorProps.cjs +23 -0
  62. package/dist/jsonforms/cjs/index.cjs +2 -0
  63. package/dist/jsonforms/esm/MantineInputs/MantineBooleanInput.mjs +6 -1
  64. package/dist/jsonforms/esm/MantineInputs/MantineDateInput.mjs +7 -2
  65. package/dist/jsonforms/esm/MantineInputs/MantineDateTimeInput.mjs +7 -2
  66. package/dist/jsonforms/esm/MantineInputs/MantineEnumInput.mjs +6 -1
  67. package/dist/jsonforms/esm/MantineInputs/MantineNumberInput.mjs +7 -2
  68. package/dist/jsonforms/esm/MantineInputs/MantineOneOfEnumInput.mjs +2 -8
  69. package/dist/jsonforms/esm/MantineInputs/MantineTextInput.mjs +6 -1
  70. package/dist/jsonforms/esm/MantineInputs/MantineTimeInput.mjs +7 -2
  71. package/dist/jsonforms/esm/hooks/useNullableErrorProps.mjs +23 -0
  72. package/dist/jsonforms/esm/index.mjs +2 -0
  73. package/dist/jsonforms/lib/hooks/useNullableErrorProps.d.ts +17 -0
  74. package/dist/jsonforms/lib/index.d.ts +1 -0
  75. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var compile = {};
4
- exports.__exports = compile;
3
+ var format = {};
4
+ exports.__exports = format;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var codegen = {};
4
- exports.__exports = codegen;
3
+ var discriminator = {};
4
+ exports.__exports = discriminator;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var discriminator = {};
4
- exports.__exports = discriminator;
3
+ var validate = {};
4
+ exports.__exports = validate;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var validate = {};
4
- exports.__exports = validate;
3
+ var codegen = {};
4
+ exports.__exports = codegen;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var core = {};
4
- exports.__exports = core;
3
+ var compile = {};
4
+ exports.__exports = compile;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var validation = {};
4
- exports.__exports = validation;
3
+ var core = {};
4
+ exports.__exports = core;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var applicator = {};
4
- exports.__exports = applicator;
3
+ var validation = {};
4
+ exports.__exports = validation;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var format = {};
4
- exports.__exports = format;
3
+ var applicator = {};
4
+ exports.__exports = applicator;
@@ -11,6 +11,7 @@ const useFileProps = require("./packages/jsonforms/src/hooks/useFileProps.cjs");
11
11
  const useJsonProps = require("./packages/jsonforms/src/hooks/useJsonProps.cjs");
12
12
  const useMultiSelectProps = require("./packages/jsonforms/src/hooks/useMultiSelectProps.cjs");
13
13
  const useNumberProps = require("./packages/jsonforms/src/hooks/useNumberProps.cjs");
14
+ const useNullableErrorProps = require("./packages/jsonforms/src/hooks/useNullableErrorProps.cjs");
14
15
  const useSelectProps = require("./packages/jsonforms/src/hooks/useSelectProps.cjs");
15
16
  const useTextProps = require("./packages/jsonforms/src/hooks/useTextProps.cjs");
16
17
  const useThemeCustomizer = require("./packages/jsonforms/src/hooks/useThemeCustomizer.cjs");
@@ -37,6 +38,7 @@ exports.useFileProps = useFileProps.useFileProps;
37
38
  exports.useJsonProps = useJsonProps.useJsonProps;
38
39
  exports.useMultiSelectProps = useMultiSelectProps.useMultiSelectProps;
39
40
  exports.useNumberProps = useNumberProps.useNumberProps;
41
+ exports.useNullableErrorProps = useNullableErrorProps.useNullableErrorProps;
40
42
  exports.useSelectProps = useSelectProps.useSelectProps;
41
43
  exports.useTextProps = useTextProps.useTextProps;
42
44
  exports.useThemeCustomizer = useThemeCustomizer.useThemeCustomizer;
@@ -7,13 +7,18 @@ const React = require("react");
7
7
  const useBooleanProps = require("../hooks/useBooleanProps.cjs");
8
8
  const useCommonProps = require("../hooks/useCommonProps.cjs");
9
9
  const useContextProps = require("../hooks/useContextProps.cjs");
10
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
10
11
  function MantineBooleanInput(props) {
11
12
  var _a;
12
13
  const { value, ...commonProps } = useCommonProps.useCommonProps(props);
13
14
  const { path, schema, uischema } = props;
14
15
  const format = ((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format ?? "select";
15
16
  const booleanProps = useBooleanProps.useBooleanProps(format, { value, onChange: commonProps.onChange });
16
- const componentProps = React.useMemo(() => ({ ...commonProps, ...booleanProps }), [booleanProps, commonProps]);
17
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
18
+ const componentProps = React.useMemo(
19
+ () => ({ ...commonProps, ...booleanProps, ...errorProps }),
20
+ [booleanProps, commonProps, errorProps]
21
+ );
17
22
  const [Component, _props] = useContextProps.useContextProps("Boolean", path, componentProps, props);
18
23
  if (!props.visible) {
19
24
  return null;
@@ -7,11 +7,16 @@ const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
9
  const useDateProps = require("../hooks/useDateProps.cjs");
10
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
10
11
  function MantineDateInput(props) {
11
12
  const { value, ...commonProps } = useCommonProps.useCommonProps(props);
12
- const { path } = props;
13
+ const { path, schema } = props;
13
14
  const dateProps = useDateProps.useDateProps("date", true, { value, toggle: () => null, onChange: commonProps.onChange });
14
- const componentProps = React.useMemo(() => ({ ...commonProps, ...dateProps }), [commonProps, dateProps]);
15
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
16
+ const componentProps = React.useMemo(
17
+ () => ({ ...commonProps, ...dateProps, ...errorProps }),
18
+ [commonProps, dateProps, errorProps]
19
+ );
15
20
  const [Component, _props] = useContextProps.useContextProps("Date", path, componentProps, props);
16
21
  if (!props.visible) {
17
22
  return null;
@@ -8,9 +8,10 @@ const React = require("react");
8
8
  const useCommonProps = require("../hooks/useCommonProps.cjs");
9
9
  const useContextProps = require("../hooks/useContextProps.cjs");
10
10
  const useDateProps = require("../hooks/useDateProps.cjs");
11
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
11
12
  function MantineDateTimeInput(props) {
12
13
  const { value, ...commonProps } = useCommonProps.useCommonProps(props);
13
- const { path, uischema } = props;
14
+ const { path, schema, uischema } = props;
14
15
  const { initialUTC: __initialUTC } = uischema.options || {};
15
16
  const _dateProps = useDateProps.useDateProps("date-time", false, { value, toggle: () => null, onChange: commonProps.onChange });
16
17
  const [, { initialUTC }] = useContextProps.useContextProps("DateTime", path, { ...commonProps, ..._dateProps }, props);
@@ -29,7 +30,11 @@ function MantineDateTimeInput(props) {
29
30
  }
30
31
  }
31
32
  }, [value, setToLocal, setToUTC]);
32
- const componentProps = React.useMemo(() => ({ ...commonProps, ...dateProps }), [commonProps, dateProps]);
33
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
34
+ const componentProps = React.useMemo(
35
+ () => ({ ...commonProps, ...dateProps, ...errorProps }),
36
+ [commonProps, dateProps, errorProps]
37
+ );
33
38
  const [Component, { initialUTC: _, ..._props }] = useContextProps.useContextProps("DateTime", path, componentProps, props);
34
39
  if (!props.visible) {
35
40
  return null;
@@ -6,6 +6,7 @@ const core = require("@mantine/core");
6
6
  const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
9
10
  const useSelectProps = require("../hooks/useSelectProps.cjs");
10
11
  function MantineEnumInput(props) {
11
12
  var _a;
@@ -13,7 +14,11 @@ function MantineEnumInput(props) {
13
14
  const { path, schema, uischema } = props;
14
15
  const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
15
16
  const selectProps = useSelectProps.useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
16
- const componentProps = React.useMemo(() => ({ ...commonProps, ...selectProps }), [commonProps, selectProps]);
17
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
18
+ const componentProps = React.useMemo(
19
+ () => ({ ...commonProps, ...selectProps, ...errorProps }),
20
+ [commonProps, errorProps, selectProps]
21
+ );
17
22
  const [Component, _props] = useContextProps.useContextProps("Enum", path, componentProps, props);
18
23
  if (!props.visible) {
19
24
  return null;
@@ -6,16 +6,21 @@ const core = require("@mantine/core");
6
6
  const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
9
10
  const useNumberProps = require("../hooks/useNumberProps.cjs");
10
11
  const InnerMantineNumberInput = (props) => {
11
12
  const { contextName, componentName, ...rest } = props;
12
13
  const { value, ...commonProps } = useCommonProps.useCommonProps(rest);
13
- const { path } = rest;
14
+ const { path, schema } = rest;
14
15
  const numberProps = useNumberProps.useNumberProps(contextName.toLowerCase(), {
15
16
  value,
16
17
  onChange: commonProps.onChange
17
18
  });
18
- const componentProps = React.useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
19
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
20
+ const componentProps = React.useMemo(
21
+ () => ({ ...commonProps, ...numberProps, ...errorProps }),
22
+ [commonProps, numberProps, errorProps]
23
+ );
19
24
  const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, rest);
20
25
  if (!rest.visible) {
21
26
  return null;
@@ -6,6 +6,7 @@ const core = require("@mantine/core");
6
6
  const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
9
10
  const useSelectProps = require("../hooks/useSelectProps.cjs");
10
11
  function MantineOneOfEnumInput(props) {
11
12
  var _a;
@@ -13,14 +14,7 @@ function MantineOneOfEnumInput(props) {
13
14
  const { path, schema, uischema } = props;
14
15
  const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
15
16
  const selectProps = useSelectProps.useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
16
- const errorProps = React.useMemo(() => {
17
- var _a2;
18
- const isNull = value === null;
19
- const error = (_a2 = commonProps.error) == null ? void 0 : _a2.filter(
20
- (error2) => error2.key === "is a required property" || !isNull ? error2 : false
21
- );
22
- return (error == null ? void 0 : error.length) ? { error } : { error: isNull && commonProps.required ? "is a required property" : void 0 };
23
- }, [commonProps.error, commonProps.required, value]);
17
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
24
18
  const componentProps = React.useMemo(
25
19
  () => ({ ...commonProps, ...selectProps, ...errorProps }),
26
20
  [commonProps, errorProps, selectProps]
@@ -6,12 +6,17 @@ const core = require("@mantine/core");
6
6
  const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
9
10
  const useTextProps = require("../hooks/useTextProps.cjs");
10
11
  function MantineTextInput(props) {
11
12
  const { value, ...commonProps } = useCommonProps.useCommonProps(props);
12
13
  const { path, schema } = props;
13
14
  const textProps = useTextProps.useTextProps({ value, onChange: commonProps.onChange });
14
- const componentProps = React.useMemo(() => ({ ...commonProps, ...textProps }), [commonProps, textProps]);
15
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
16
+ const componentProps = React.useMemo(
17
+ () => ({ ...commonProps, ...textProps, ...errorProps }),
18
+ [commonProps, textProps, errorProps]
19
+ );
15
20
  const [Component, _props] = useContextProps.useContextProps("Text", path, componentProps, props);
16
21
  if (!props.visible) {
17
22
  return null;
@@ -6,11 +6,12 @@ const utils = require("fastapi-rtk/utils");
6
6
  const React = require("react");
7
7
  const useCommonProps = require("../hooks/useCommonProps.cjs");
8
8
  const useContextProps = require("../hooks/useContextProps.cjs");
9
+ const useNullableErrorProps = require("../hooks/useNullableErrorProps.cjs");
9
10
  const useTimeProps = require("../hooks/useTimeProps.cjs");
10
11
  function MantineTimeInput(props) {
11
12
  var _a, _b;
12
13
  const { value, ...commonProps } = useCommonProps.useCommonProps(props);
13
- const { path } = props;
14
+ const { path, schema } = props;
14
15
  const _timeProps = useTimeProps.useTimeProps({ value, onChange: commonProps.onChange, withSeconds: void 0 });
15
16
  const [, { withSeconds }] = useContextProps.useContextProps("Time", path, { ...commonProps, ..._timeProps }, props);
16
17
  const timeProps = useTimeProps.useTimeProps({
@@ -18,7 +19,11 @@ function MantineTimeInput(props) {
18
19
  onChange: commonProps.onChange,
19
20
  withSeconds: withSeconds ?? ((_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.withSeconds)
20
21
  });
21
- const componentProps = React.useMemo(() => ({ ...commonProps, ...timeProps }), [commonProps, timeProps]);
22
+ const errorProps = useNullableErrorProps.useNullableErrorProps(value, commonProps.error, schema);
23
+ const componentProps = React.useMemo(
24
+ () => ({ ...commonProps, ...timeProps, ...errorProps }),
25
+ [commonProps, timeProps, errorProps]
26
+ );
22
27
  const [Component, _props] = useContextProps.useContextProps("Time", path, componentProps, props);
23
28
  if (!props.visible) {
24
29
  return null;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const React = require("react");
4
+ const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
5
+ const NULL_OPTION_ERRORS = /* @__PURE__ */ new Set([
6
+ "must be equal to one of the allowed values",
7
+ "must be equal to constant",
8
+ "must match exactly one schema in oneOf"
9
+ ]);
10
+ const REQUIRED_ERROR = "is a required property";
11
+ function useNullableErrorProps(value, error, schema) {
12
+ return React.useMemo(() => {
13
+ if (value !== null && value !== "") {
14
+ return { error };
15
+ }
16
+ if (isSchemaTypeInclude.isSchemaTypeInclude(schema.type ?? "", "null")) {
17
+ const kept = error == null ? void 0 : error.filter((e) => !NULL_OPTION_ERRORS.has(e.key ?? ""));
18
+ return { error: (kept == null ? void 0 : kept.length) ? kept : void 0 };
19
+ }
20
+ return { error: REQUIRED_ERROR };
21
+ }, [error, schema.type, value]);
22
+ }
23
+ exports.useNullableErrorProps = useNullableErrorProps;
@@ -1,4 +1,4 @@
1
- var compile = {};
1
+ var format = {};
2
2
  export {
3
- compile as __exports
3
+ format as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var codegen = {};
1
+ var discriminator = {};
2
2
  export {
3
- codegen as __exports
3
+ discriminator as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var discriminator = {};
1
+ var validate = {};
2
2
  export {
3
- discriminator as __exports
3
+ validate as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var validate = {};
1
+ var codegen = {};
2
2
  export {
3
- validate as __exports
3
+ codegen as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var core = {};
1
+ var compile = {};
2
2
  export {
3
- core as __exports
3
+ compile as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var validation = {};
1
+ var core = {};
2
2
  export {
3
- validation as __exports
3
+ core as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var applicator = {};
1
+ var validation = {};
2
2
  export {
3
- applicator as __exports
3
+ validation as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var format = {};
1
+ var applicator = {};
2
2
  export {
3
- format as __exports
3
+ applicator as __exports
4
4
  };
@@ -9,6 +9,7 @@ import { useFileProps } from "./packages/jsonforms/src/hooks/useFileProps.mjs";
9
9
  import { useJsonProps } from "./packages/jsonforms/src/hooks/useJsonProps.mjs";
10
10
  import { useMultiSelectProps } from "./packages/jsonforms/src/hooks/useMultiSelectProps.mjs";
11
11
  import { useNumberProps } from "./packages/jsonforms/src/hooks/useNumberProps.mjs";
12
+ import { useNullableErrorProps } from "./packages/jsonforms/src/hooks/useNullableErrorProps.mjs";
12
13
  import { useSelectProps } from "./packages/jsonforms/src/hooks/useSelectProps.mjs";
13
14
  import { useTextProps } from "./packages/jsonforms/src/hooks/useTextProps.mjs";
14
15
  import { useThemeCustomizer } from "./packages/jsonforms/src/hooks/useThemeCustomizer.mjs";
@@ -46,6 +47,7 @@ export {
46
47
  useFileProps,
47
48
  useJsonProps,
48
49
  useMultiSelectProps,
50
+ useNullableErrorProps,
49
51
  useNumberProps,
50
52
  useSelectProps,
51
53
  useTextProps,
@@ -5,13 +5,18 @@ import { useMemo } from "react";
5
5
  import { useBooleanProps } from "../hooks/useBooleanProps.mjs";
6
6
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
7
7
  import { useContextProps } from "../hooks/useContextProps.mjs";
8
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
8
9
  function MantineBooleanInput(props) {
9
10
  var _a;
10
11
  const { value, ...commonProps } = useCommonProps(props);
11
12
  const { path, schema, uischema } = props;
12
13
  const format = ((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format ?? "select";
13
14
  const booleanProps = useBooleanProps(format, { value, onChange: commonProps.onChange });
14
- const componentProps = useMemo(() => ({ ...commonProps, ...booleanProps }), [booleanProps, commonProps]);
15
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
16
+ const componentProps = useMemo(
17
+ () => ({ ...commonProps, ...booleanProps, ...errorProps }),
18
+ [booleanProps, commonProps, errorProps]
19
+ );
15
20
  const [Component, _props] = useContextProps("Boolean", path, componentProps, props);
16
21
  if (!props.visible) {
17
22
  return null;
@@ -5,11 +5,16 @@ import { useMemo } from "react";
5
5
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
6
6
  import { useContextProps } from "../hooks/useContextProps.mjs";
7
7
  import { useDateProps } from "../hooks/useDateProps.mjs";
8
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
8
9
  function MantineDateInput(props) {
9
10
  const { value, ...commonProps } = useCommonProps(props);
10
- const { path } = props;
11
+ const { path, schema } = props;
11
12
  const dateProps = useDateProps("date", true, { value, toggle: () => null, onChange: commonProps.onChange });
12
- const componentProps = useMemo(() => ({ ...commonProps, ...dateProps }), [commonProps, dateProps]);
13
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
14
+ const componentProps = useMemo(
15
+ () => ({ ...commonProps, ...dateProps, ...errorProps }),
16
+ [commonProps, dateProps, errorProps]
17
+ );
13
18
  const [Component, _props] = useContextProps("Date", path, componentProps, props);
14
19
  if (!props.visible) {
15
20
  return null;
@@ -6,9 +6,10 @@ import { useEffect, useMemo } from "react";
6
6
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
7
7
  import { useContextProps } from "../hooks/useContextProps.mjs";
8
8
  import { useDateProps } from "../hooks/useDateProps.mjs";
9
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
9
10
  function MantineDateTimeInput(props) {
10
11
  const { value, ...commonProps } = useCommonProps(props);
11
- const { path, uischema } = props;
12
+ const { path, schema, uischema } = props;
12
13
  const { initialUTC: __initialUTC } = uischema.options || {};
13
14
  const _dateProps = useDateProps("date-time", false, { value, toggle: () => null, onChange: commonProps.onChange });
14
15
  const [, { initialUTC }] = useContextProps("DateTime", path, { ...commonProps, ..._dateProps }, props);
@@ -27,7 +28,11 @@ function MantineDateTimeInput(props) {
27
28
  }
28
29
  }
29
30
  }, [value, setToLocal, setToUTC]);
30
- const componentProps = useMemo(() => ({ ...commonProps, ...dateProps }), [commonProps, dateProps]);
31
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
32
+ const componentProps = useMemo(
33
+ () => ({ ...commonProps, ...dateProps, ...errorProps }),
34
+ [commonProps, dateProps, errorProps]
35
+ );
31
36
  const [Component, { initialUTC: _, ..._props }] = useContextProps("DateTime", path, componentProps, props);
32
37
  if (!props.visible) {
33
38
  return null;
@@ -4,6 +4,7 @@ import { NativeSelect, Select } 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";
7
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
7
8
  import { useSelectProps } from "../hooks/useSelectProps.mjs";
8
9
  function MantineEnumInput(props) {
9
10
  var _a;
@@ -11,7 +12,11 @@ function MantineEnumInput(props) {
11
12
  const { path, schema, uischema } = props;
12
13
  const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
13
14
  const selectProps = useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
14
- const componentProps = useMemo(() => ({ ...commonProps, ...selectProps }), [commonProps, selectProps]);
15
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
16
+ const componentProps = useMemo(
17
+ () => ({ ...commonProps, ...selectProps, ...errorProps }),
18
+ [commonProps, errorProps, selectProps]
19
+ );
15
20
  const [Component, _props] = useContextProps("Enum", path, componentProps, props);
16
21
  if (!props.visible) {
17
22
  return null;
@@ -4,16 +4,21 @@ import { NumberInput } 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";
7
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
7
8
  import { useNumberProps } from "../hooks/useNumberProps.mjs";
8
9
  const InnerMantineNumberInput = (props) => {
9
10
  const { contextName, componentName, ...rest } = props;
10
11
  const { value, ...commonProps } = useCommonProps(rest);
11
- const { path } = rest;
12
+ const { path, schema } = rest;
12
13
  const numberProps = useNumberProps(contextName.toLowerCase(), {
13
14
  value,
14
15
  onChange: commonProps.onChange
15
16
  });
16
- const componentProps = useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
17
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
18
+ const componentProps = useMemo(
19
+ () => ({ ...commonProps, ...numberProps, ...errorProps }),
20
+ [commonProps, numberProps, errorProps]
21
+ );
17
22
  const [Component, _props] = useContextProps(contextName, path, componentProps, rest);
18
23
  if (!rest.visible) {
19
24
  return null;
@@ -4,6 +4,7 @@ import { NativeSelect, Select } 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";
7
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
7
8
  import { useSelectProps } from "../hooks/useSelectProps.mjs";
8
9
  function MantineOneOfEnumInput(props) {
9
10
  var _a;
@@ -11,14 +12,7 @@ function MantineOneOfEnumInput(props) {
11
12
  const { path, schema, uischema } = props;
12
13
  const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
13
14
  const selectProps = useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
14
- const errorProps = useMemo(() => {
15
- var _a2;
16
- const isNull = value === null;
17
- const error = (_a2 = commonProps.error) == null ? void 0 : _a2.filter(
18
- (error2) => error2.key === "is a required property" || !isNull ? error2 : false
19
- );
20
- return (error == null ? void 0 : error.length) ? { error } : { error: isNull && commonProps.required ? "is a required property" : void 0 };
21
- }, [commonProps.error, commonProps.required, value]);
15
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
22
16
  const componentProps = useMemo(
23
17
  () => ({ ...commonProps, ...selectProps, ...errorProps }),
24
18
  [commonProps, errorProps, selectProps]
@@ -4,12 +4,17 @@ import { PasswordInput, TextInput } 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";
7
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
7
8
  import { useTextProps } from "../hooks/useTextProps.mjs";
8
9
  function MantineTextInput(props) {
9
10
  const { value, ...commonProps } = useCommonProps(props);
10
11
  const { path, schema } = props;
11
12
  const textProps = useTextProps({ value, onChange: commonProps.onChange });
12
- const componentProps = useMemo(() => ({ ...commonProps, ...textProps }), [commonProps, textProps]);
13
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
14
+ const componentProps = useMemo(
15
+ () => ({ ...commonProps, ...textProps, ...errorProps }),
16
+ [commonProps, textProps, errorProps]
17
+ );
13
18
  const [Component, _props] = useContextProps("Text", path, componentProps, props);
14
19
  if (!props.visible) {
15
20
  return null;
@@ -4,11 +4,12 @@ import { MemoWrapper } from "fastapi-rtk/utils";
4
4
  import { useMemo } from "react";
5
5
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
6
6
  import { useContextProps } from "../hooks/useContextProps.mjs";
7
+ import { useNullableErrorProps } from "../hooks/useNullableErrorProps.mjs";
7
8
  import { useTimeProps } from "../hooks/useTimeProps.mjs";
8
9
  function MantineTimeInput(props) {
9
10
  var _a, _b;
10
11
  const { value, ...commonProps } = useCommonProps(props);
11
- const { path } = props;
12
+ const { path, schema } = props;
12
13
  const _timeProps = useTimeProps({ value, onChange: commonProps.onChange, withSeconds: void 0 });
13
14
  const [, { withSeconds }] = useContextProps("Time", path, { ...commonProps, ..._timeProps }, props);
14
15
  const timeProps = useTimeProps({
@@ -16,7 +17,11 @@ function MantineTimeInput(props) {
16
17
  onChange: commonProps.onChange,
17
18
  withSeconds: withSeconds ?? ((_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.withSeconds)
18
19
  });
19
- const componentProps = useMemo(() => ({ ...commonProps, ...timeProps }), [commonProps, timeProps]);
20
+ const errorProps = useNullableErrorProps(value, commonProps.error, schema);
21
+ const componentProps = useMemo(
22
+ () => ({ ...commonProps, ...timeProps, ...errorProps }),
23
+ [commonProps, timeProps, errorProps]
24
+ );
20
25
  const [Component, _props] = useContextProps("Time", path, componentProps, props);
21
26
  if (!props.visible) {
22
27
  return null;
@@ -0,0 +1,23 @@
1
+ import { useMemo } from "react";
2
+ import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
3
+ const NULL_OPTION_ERRORS = /* @__PURE__ */ new Set([
4
+ "must be equal to one of the allowed values",
5
+ "must be equal to constant",
6
+ "must match exactly one schema in oneOf"
7
+ ]);
8
+ const REQUIRED_ERROR = "is a required property";
9
+ function useNullableErrorProps(value, error, schema) {
10
+ return useMemo(() => {
11
+ if (value !== null && value !== "") {
12
+ return { error };
13
+ }
14
+ if (isSchemaTypeInclude(schema.type ?? "", "null")) {
15
+ const kept = error == null ? void 0 : error.filter((e) => !NULL_OPTION_ERRORS.has(e.key ?? ""));
16
+ return { error: (kept == null ? void 0 : kept.length) ? kept : void 0 };
17
+ }
18
+ return { error: REQUIRED_ERROR };
19
+ }, [error, schema.type, value]);
20
+ }
21
+ export {
22
+ useNullableErrorProps
23
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index3.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index5.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/index10.cjs");
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/index5.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index4.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/index8.cjs");
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");