fastapi-rtk 1.0.36 → 1.0.38

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.
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var fastUri = { exports: {} };
4
- exports.__module = fastUri;
3
+ var jsonSchemaTraverse = { exports: {} };
4
+ exports.__module = jsonSchemaTraverse;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var jsonSchemaTraverse = { exports: {} };
4
- exports.__module = jsonSchemaTraverse;
3
+ var fastUri = { exports: {} };
4
+ exports.__module = fastUri;
@@ -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]);
@@ -52,8 +52,8 @@ function useCommonProps(props = {}) {
52
52
  onChange,
53
53
  onBlur: () => debouncedCallback.flush(),
54
54
  error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
55
- ...ifProps,
56
- ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props
55
+ ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props,
56
+ ...ifProps
57
57
  };
58
58
  }
59
59
  exports.useCommonProps = useCommonProps;
@@ -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
- if (!schema) {
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;
@@ -1,4 +1,4 @@
1
- var fastUri = { exports: {} };
1
+ var jsonSchemaTraverse = { exports: {} };
2
2
  export {
3
- fastUri as __module
3
+ jsonSchemaTraverse as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var jsonSchemaTraverse = { exports: {} };
1
+ var fastUri = { exports: {} };
2
2
  export {
3
- jsonSchemaTraverse as __module
3
+ fastUri as __module
4
4
  };
@@ -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]);
@@ -50,8 +50,8 @@ function useCommonProps(props = {}) {
50
50
  onChange,
51
51
  onBlur: () => debouncedCallback.flush(),
52
52
  error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
53
- ...ifProps,
54
- ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props
53
+ ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props,
54
+ ...ifProps
55
55
  };
56
56
  }
57
57
  export {
@@ -1,10 +1,10 @@
1
1
  import { useMemo } from "react";
2
2
  const useIfProps = (schema, core, key = "props") => useMemo(() => {
3
- if (!schema) {
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/index11.cjs");
3
+ const index = require("../../../../.bundled/jsonforms/cjs/_virtual/index12.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/index12.cjs");
3
+ const index = require("../../../../.bundled/jsonforms/cjs/_virtual/index11.cjs");
4
4
  var hasRequiredJsonSchemaTraverse;
5
5
  function requireJsonSchemaTraverse() {
6
6
  if (hasRequiredJsonSchemaTraverse) return index.__module.exports;
@@ -1,4 +1,4 @@
1
- import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/index11.mjs";
1
+ import { __module as fastUri } from "../../../../.bundled/jsonforms/esm/_virtual/index12.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/index12.mjs";
1
+ import { __module as jsonSchemaTraverse } from "../../../../.bundled/jsonforms/esm/_virtual/index11.mjs";
2
2
  var hasRequiredJsonSchemaTraverse;
3
3
  function requireJsonSchemaTraverse() {
4
4
  if (hasRequiredJsonSchemaTraverse) return jsonSchemaTraverse.exports;
@@ -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]);
@@ -52,8 +52,8 @@ function useCommonProps(props = {}) {
52
52
  onChange,
53
53
  onBlur: () => debouncedCallback.flush(),
54
54
  error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
55
- ...ifProps,
56
- ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props
55
+ ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props,
56
+ ...ifProps
57
57
  };
58
58
  }
59
59
  exports.useCommonProps = useCommonProps;
@@ -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
- if (!schema) {
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;
@@ -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]);
@@ -50,8 +50,8 @@ function useCommonProps(props = {}) {
50
50
  onChange,
51
51
  onBlur: () => debouncedCallback.flush(),
52
52
  error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
53
- ...ifProps,
54
- ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props
53
+ ...(_d = (_c = props.uischema) == null ? void 0 : _c.options) == null ? void 0 : _d.props,
54
+ ...ifProps
55
55
  };
56
56
  }
57
57
  export {
@@ -1,10 +1,10 @@
1
1
  import { useMemo } from "react";
2
2
  const useIfProps = (schema, core, key = "props") => useMemo(() => {
3
- if (!schema) {
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": false,
5
5
  "description": "A React component library for FastAPI in combination with FastAPI React Toolkit backend, built with Mantine, JsonForms, and Zustand.",
6
6
  "license": "MIT",