fastapi-rtk 0.2.49 → 0.2.51

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 (26) hide show
  1. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineBooleanInput.cjs +7 -1
  2. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useCommonProps.cjs +3 -1
  3. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineBooleanInput.mjs +7 -1
  4. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useCommonProps.mjs +3 -1
  5. package/dist/core/cjs/Dialogs/AddDialog.cjs +1 -1
  6. package/dist/core/cjs/Dialogs/EditDialog.cjs +1 -1
  7. package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +1 -1
  8. package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideForm.cjs +1 -1
  9. package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
  10. package/dist/core/esm/Dialogs/EditDialog.mjs +1 -1
  11. package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +1 -1
  12. package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideForm.mjs +1 -1
  13. package/dist/jsonforms/cjs/MantineInputs/MantineBooleanInput.cjs +7 -1
  14. package/dist/jsonforms/cjs/hooks/useCommonProps.cjs +3 -1
  15. package/dist/jsonforms/esm/MantineInputs/MantineBooleanInput.mjs +7 -1
  16. package/dist/jsonforms/esm/hooks/useCommonProps.mjs +3 -1
  17. package/dist/jsonforms/lib/hooks/useCommonProps.d.ts +5 -11
  18. package/dist/zustand/cjs/useProxy/useProxy.cjs +1 -1
  19. package/dist/zustand/esm/useProxy/useProxy.mjs +1 -1
  20. package/package.json +1 -1
  21. /package/dist/.external/cjs/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.3_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.cjs +0 -0
  22. /package/dist/.external/cjs/{zustand@5.0.8_@types_react@18.3.25_react@18.3.1 → zustand@5.0.8_@types_react@18.3.26_react@18.3.1}/zustand/esm/react.cjs +0 -0
  23. /package/dist/.external/cjs/{zustand@5.0.8_@types_react@18.3.25_react@18.3.1 → zustand@5.0.8_@types_react@18.3.26_react@18.3.1}/zustand/esm/vanilla.cjs +0 -0
  24. /package/dist/.external/esm/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.3_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.mjs +0 -0
  25. /package/dist/.external/esm/{zustand@5.0.8_@types_react@18.3.25_react@18.3.1 → zustand@5.0.8_@types_react@18.3.26_react@18.3.1}/zustand/esm/react.mjs +0 -0
  26. /package/dist/.external/esm/{zustand@5.0.8_@types_react@18.3.25_react@18.3.1 → zustand@5.0.8_@types_react@18.3.26_react@18.3.1}/zustand/esm/vanilla.mjs +0 -0
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
+ const utils = require("fastapi-rtk/utils");
4
5
  const core = require("@mantine/core");
5
6
  const React = require("react");
6
7
  const useBooleanProps = require("../hooks/useBooleanProps.cjs");
@@ -24,6 +25,11 @@ function MantineBooleanInput({ margin, ...props }) {
24
25
  return null;
25
26
  }
26
27
  const { inputWrapperOrder, ...__props } = _props;
27
- return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsxRuntime.jsx(core.Checkbox, { ...__props }) : /* @__PURE__ */ jsxRuntime.jsx(core.Select, { inputWrapperOrder, ...__props }) : Component });
28
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsxRuntime.jsx(
29
+ core.Checkbox,
30
+ {
31
+ ...utils.deepMerge({ styles: { root: { minHeight: "calc(2.25rem * 1)", alignContent: "center" } } }, __props)
32
+ }
33
+ ) : /* @__PURE__ */ jsxRuntime.jsx(core.Select, { inputWrapperOrder, ...__props }) : Component });
28
34
  }
29
35
  exports.MantineBooleanInput = MantineBooleanInput;
@@ -7,6 +7,7 @@ const hooks = require("@mantine/hooks");
7
7
  const React = require("react");
8
8
  const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
9
9
  function useCommonProps(props = {}) {
10
+ var _a, _b;
10
11
  const __ = core.useProps("__", {}, {});
11
12
  const [value, setValue] = React.useState(props.data);
12
13
  let valueIfNull = null;
@@ -41,7 +42,8 @@ function useCommonProps(props = {}) {
41
42
  value,
42
43
  onChange,
43
44
  onBlur: () => debouncedCallback.flush(),
44
- error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0
45
+ error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
46
+ ...(_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.props
45
47
  };
46
48
  }
47
49
  exports.useCommonProps = useCommonProps;
@@ -1,4 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { deepMerge } from "fastapi-rtk/utils";
2
3
  import { Box, Checkbox, Select } from "@mantine/core";
3
4
  import { useMemo } from "react";
4
5
  import { useBooleanProps } from "../hooks/useBooleanProps.mjs";
@@ -22,7 +23,12 @@ function MantineBooleanInput({ margin, ...props }) {
22
23
  return null;
23
24
  }
24
25
  const { inputWrapperOrder, ...__props } = _props;
25
- return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsx(Checkbox, { ...__props }) : /* @__PURE__ */ jsx(Select, { inputWrapperOrder, ...__props }) : Component });
26
+ return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsx(
27
+ Checkbox,
28
+ {
29
+ ...deepMerge({ styles: { root: { minHeight: "calc(2.25rem * 1)", alignContent: "center" } } }, __props)
30
+ }
31
+ ) : /* @__PURE__ */ jsx(Select, { inputWrapperOrder, ...__props }) : Component });
26
32
  }
27
33
  export {
28
34
  MantineBooleanInput
@@ -5,6 +5,7 @@ import { useDebouncedCallback } from "@mantine/hooks";
5
5
  import { useState, useEffect } from "react";
6
6
  import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
7
7
  function useCommonProps(props = {}) {
8
+ var _a, _b;
8
9
  const __ = useProps("__", {}, {});
9
10
  const [value, setValue] = useState(props.data);
10
11
  let valueIfNull = null;
@@ -39,7 +40,8 @@ function useCommonProps(props = {}) {
39
40
  value,
40
41
  onChange,
41
42
  onBlur: () => debouncedCallback.flush(),
42
- error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0
43
+ error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
44
+ ...(_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.props
43
45
  };
44
46
  }
45
47
  export {
@@ -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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
10
+ const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
11
+ const index = require("../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.cjs");
7
+ const index = require("../../../../../../.external/cjs/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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");
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const constants = require("fastapi-rtk/constants");
4
4
  const React = require("react");
5
- const react = require("../../../../../.external/cjs/zustand@5.0.8_@types_react@18.3.25_react@18.3.1/zustand/esm/react.cjs");
5
+ const react = require("../../../../../.external/cjs/zustand@5.0.8_@types_react@18.3.26_react@18.3.1/zustand/esm/react.cjs");
6
6
  const useProvideForm = () => {
7
7
  const [storeAdd] = React.useState(
8
8
  () => react.create((set, get) => ({
@@ -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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
8
+ import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
9
+ import { yupResolver } from "../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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.3_yup@1.7.1/mantine-form-yup-resolver/dist/esm/index.mjs";
5
+ import { yupResolver } from "../../../../../../.external/esm/mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.4_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";
@@ -1,6 +1,6 @@
1
1
  import { initialState, VIEW_MODE } from "fastapi-rtk/constants";
2
2
  import { useState } from "react";
3
- import { create } from "../../../../../.external/esm/zustand@5.0.8_@types_react@18.3.25_react@18.3.1/zustand/esm/react.mjs";
3
+ import { create } from "../../../../../.external/esm/zustand@5.0.8_@types_react@18.3.26_react@18.3.1/zustand/esm/react.mjs";
4
4
  const useProvideForm = () => {
5
5
  const [storeAdd] = useState(
6
6
  () => create((set, get) => ({
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
+ const utils = require("fastapi-rtk/utils");
4
5
  const core = require("@mantine/core");
5
6
  const React = require("react");
6
7
  const useBooleanProps = require("../hooks/useBooleanProps.cjs");
@@ -24,6 +25,11 @@ function MantineBooleanInput({ margin, ...props }) {
24
25
  return null;
25
26
  }
26
27
  const { inputWrapperOrder, ...__props } = _props;
27
- return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsxRuntime.jsx(core.Checkbox, { ...__props }) : /* @__PURE__ */ jsxRuntime.jsx(core.Select, { inputWrapperOrder, ...__props }) : Component });
28
+ return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsxRuntime.jsx(
29
+ core.Checkbox,
30
+ {
31
+ ...utils.deepMerge({ styles: { root: { minHeight: "calc(2.25rem * 1)", alignContent: "center" } } }, __props)
32
+ }
33
+ ) : /* @__PURE__ */ jsxRuntime.jsx(core.Select, { inputWrapperOrder, ...__props }) : Component });
28
34
  }
29
35
  exports.MantineBooleanInput = MantineBooleanInput;
@@ -7,6 +7,7 @@ const hooks = require("@mantine/hooks");
7
7
  const React = require("react");
8
8
  const isSchemaTypeInclude = require("../utils/isSchemaTypeInclude.cjs");
9
9
  function useCommonProps(props = {}) {
10
+ var _a, _b;
10
11
  const __ = core.useProps("__", {}, {});
11
12
  const [value, setValue] = React.useState(props.data);
12
13
  let valueIfNull = null;
@@ -41,7 +42,8 @@ function useCommonProps(props = {}) {
41
42
  value,
42
43
  onChange,
43
44
  onBlur: () => debouncedCallback.flush(),
44
- error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0
45
+ error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
46
+ ...(_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.props
45
47
  };
46
48
  }
47
49
  exports.useCommonProps = useCommonProps;
@@ -1,4 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { deepMerge } from "fastapi-rtk/utils";
2
3
  import { Box, Checkbox, Select } from "@mantine/core";
3
4
  import { useMemo } from "react";
4
5
  import { useBooleanProps } from "../hooks/useBooleanProps.mjs";
@@ -22,7 +23,12 @@ function MantineBooleanInput({ margin, ...props }) {
22
23
  return null;
23
24
  }
24
25
  const { inputWrapperOrder, ...__props } = _props;
25
- return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsx(Checkbox, { ...__props }) : /* @__PURE__ */ jsx(Select, { inputWrapperOrder, ...__props }) : Component });
26
+ return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? isCheckbox ? /* @__PURE__ */ jsx(
27
+ Checkbox,
28
+ {
29
+ ...deepMerge({ styles: { root: { minHeight: "calc(2.25rem * 1)", alignContent: "center" } } }, __props)
30
+ }
31
+ ) : /* @__PURE__ */ jsx(Select, { inputWrapperOrder, ...__props }) : Component });
26
32
  }
27
33
  export {
28
34
  MantineBooleanInput
@@ -5,6 +5,7 @@ import { useDebouncedCallback } from "@mantine/hooks";
5
5
  import { useState, useEffect } from "react";
6
6
  import { isSchemaTypeInclude } from "../utils/isSchemaTypeInclude.mjs";
7
7
  function useCommonProps(props = {}) {
8
+ var _a, _b;
8
9
  const __ = useProps("__", {}, {});
9
10
  const [value, setValue] = useState(props.data);
10
11
  let valueIfNull = null;
@@ -39,7 +40,8 @@ function useCommonProps(props = {}) {
39
40
  value,
40
41
  onChange,
41
42
  onBlur: () => debouncedCallback.flush(),
42
- error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0
43
+ error: props.errors ? props.errors.split("\n").map((error) => /* @__PURE__ */ jsx("span", { style: { display: "block" }, children: error }, error)) : void 0,
44
+ ...(_b = (_a = props.uischema) == null ? void 0 : _a.options) == null ? void 0 : _b.props
43
45
  };
44
46
  }
45
47
  export {
@@ -10,6 +10,8 @@
10
10
  * @param {Function} [props.handleChange] - The function to handle changes.
11
11
  * @param {string} [props.path] - The path for the change handler.
12
12
  * @param {string} [props.errors] - The error messages, separated by new lines.
13
+ * @param {Record<string, any>} [props.schema] - The JSON schema for the component.
14
+ * @param {Record<string, any>} [props.uischema] - The UI schema for the component.
13
15
  * @returns The common properties for the component.
14
16
  */
15
17
  export function useCommonProps(props?: {
@@ -21,14 +23,6 @@ export function useCommonProps(props?: {
21
23
  handleChange?: Function;
22
24
  path?: string;
23
25
  errors?: string;
24
- }): {
25
- inputWrapperOrder: string[];
26
- label: string;
27
- description: string;
28
- required: boolean;
29
- disabled: boolean;
30
- value: any;
31
- onChange: (value: any) => void;
32
- onBlur: () => void;
33
- error: import("react").JSX.Element[];
34
- };
26
+ schema?: Record<string, any>;
27
+ uischema?: Record<string, any>;
28
+ }): any;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const compareStateWithStore = require("../utils/compareStateWithStore.cjs");
5
5
  const createProxy = require("../utils/createProxy.cjs");
6
- const react = require("../../../.external/cjs/zustand@5.0.8_@types_react@18.3.25_react@18.3.1/zustand/esm/react.cjs");
6
+ const react = require("../../../.external/cjs/zustand@5.0.8_@types_react@18.3.26_react@18.3.1/zustand/esm/react.cjs");
7
7
  function useProxy(obj) {
8
8
  const [store] = React.useState(() => react.create(() => ({ ...obj })));
9
9
  const [proxy] = React.useState(() => createProxy.createProxy(store, ["getState", "setState"]));
@@ -1,7 +1,7 @@
1
1
  import { useState, useEffect } from "react";
2
2
  import { compareStateWithStore } from "../utils/compareStateWithStore.mjs";
3
3
  import { createProxy } from "../utils/createProxy.mjs";
4
- import { create } from "../../../.external/esm/zustand@5.0.8_@types_react@18.3.25_react@18.3.1/zustand/esm/react.mjs";
4
+ import { create } from "../../../.external/esm/zustand@5.0.8_@types_react@18.3.26_react@18.3.1/zustand/esm/react.mjs";
5
5
  function useProxy(obj) {
6
6
  const [store] = useState(() => create(() => ({ ...obj })));
7
7
  const [proxy] = useState(() => createProxy(store, ["getState", "setState"]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
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",