fastapi-rtk 0.2.1 → 0.2.2

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 (19) hide show
  1. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineIntegerInput.cjs +8 -0
  2. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineNumberInput.cjs +7 -3
  3. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/cells/MantineIntegerCell.cjs +2 -2
  4. package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/controls/MantineIntegerControl.cjs +2 -2
  5. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineIntegerInput.mjs +8 -0
  6. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineNumberInput.mjs +7 -3
  7. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/cells/MantineIntegerCell.mjs +2 -2
  8. package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/controls/MantineIntegerControl.mjs +2 -2
  9. package/dist/jsonforms/cjs/MantineInputs/MantineIntegerInput.cjs +8 -0
  10. package/dist/jsonforms/cjs/MantineInputs/MantineNumberInput.cjs +7 -3
  11. package/dist/jsonforms/cjs/cells/MantineIntegerCell.cjs +2 -2
  12. package/dist/jsonforms/cjs/controls/MantineIntegerControl.cjs +2 -2
  13. package/dist/jsonforms/esm/MantineInputs/MantineIntegerInput.mjs +8 -0
  14. package/dist/jsonforms/esm/MantineInputs/MantineNumberInput.mjs +7 -3
  15. package/dist/jsonforms/esm/cells/MantineIntegerCell.mjs +2 -2
  16. package/dist/jsonforms/esm/controls/MantineIntegerControl.mjs +2 -2
  17. package/dist/jsonforms/lib/MantineInputs/MantineIntegerInput.d.ts +4 -0
  18. package/dist/jsonforms/lib/MantineInputs/MantineNumberInput.d.ts +5 -0
  19. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const MantineNumberInput = require("./MantineNumberInput.cjs");
5
+ function MantineIntegerInput({ margin, ...props }) {
6
+ return /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.InnerMantineNumberInput, { ...props, contextName: "Integer", margin });
7
+ }
8
+ exports.MantineIntegerInput = MantineIntegerInput;
@@ -6,15 +6,19 @@ const React = require("react");
6
6
  const useCommonProps = require("../hooks/useCommonProps.cjs");
7
7
  const useContextProps = require("../hooks/useContextProps.cjs");
8
8
  const useNumberProps = require("../hooks/useNumberProps.cjs");
9
- function MantineNumberInput({ margin, ...props }) {
9
+ const InnerMantineNumberInput = ({ contextName, margin, ...props }) => {
10
10
  const commonProps = useCommonProps.useCommonProps(props);
11
11
  const { path, data } = props;
12
- const numberProps = useNumberProps.useNumberProps("number", { data, onChange: commonProps.onChange });
12
+ const numberProps = useNumberProps.useNumberProps(contextName.toLowerCase(), { data, onChange: commonProps.onChange });
13
13
  const componentProps = React.useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
14
- const [Component, _props] = useContextProps.useContextProps("Number", path, componentProps, props);
14
+ const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, props);
15
15
  if (!props.visible) {
16
16
  return null;
17
17
  }
18
18
  return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.NumberInput, { ..._props }) : Component });
19
+ };
20
+ function MantineNumberInput({ margin, ...props }) {
21
+ return /* @__PURE__ */ jsxRuntime.jsx(InnerMantineNumberInput, { ...props, contextName: "Number", margin });
19
22
  }
23
+ exports.InnerMantineNumberInput = InnerMantineNumberInput;
20
24
  exports.MantineNumberInput = MantineNumberInput;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const jsonformsCore_esm = require("../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
5
5
  const jsonformsReact_esm = require("../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
6
- const MantineNumberInput = require("../MantineInputs/MantineNumberInput.cjs");
6
+ const MantineIntegerInput = require("../MantineInputs/MantineIntegerInput.cjs");
7
7
  const mantineIntegerCellTester = jsonformsCore_esm.rankWith(1, jsonformsCore_esm.isIntegerControl);
8
- const MantineIntegerCell = jsonformsReact_esm.withJsonFormsCellProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.MantineNumberInput, { ...props }));
8
+ const MantineIntegerCell = jsonformsReact_esm.withJsonFormsCellProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineIntegerInput.MantineIntegerInput, { ...props }));
9
9
  exports.MantineIntegerCell = MantineIntegerCell;
10
10
  exports.mantineIntegerCellTester = mantineIntegerCellTester;
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const jsonformsCore_esm = require("../../../../../../../.external/cjs/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.cjs");
5
5
  const jsonformsReact_esm = require("../../../../../../../.external/cjs/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.cjs");
6
- const MantineNumberInput = require("../MantineInputs/MantineNumberInput.cjs");
6
+ const MantineIntegerInput = require("../MantineInputs/MantineIntegerInput.cjs");
7
7
  const constants = require("../utils/constants.cjs");
8
8
  const mantineIntegerControlTester = jsonformsCore_esm.rankWith(1, jsonformsCore_esm.isIntegerControl);
9
- const MantineIntegerControl = jsonformsReact_esm.withJsonFormsControlProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.MantineNumberInput, { margin: constants.DEFAULT_MARGIN, ...props }));
9
+ const MantineIntegerControl = jsonformsReact_esm.withJsonFormsControlProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineIntegerInput.MantineIntegerInput, { margin: constants.DEFAULT_MARGIN, ...props }));
10
10
  exports.MantineIntegerControl = MantineIntegerControl;
11
11
  exports.mantineIntegerControlTester = mantineIntegerControlTester;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { InnerMantineNumberInput } from "./MantineNumberInput.mjs";
3
+ function MantineIntegerInput({ margin, ...props }) {
4
+ return /* @__PURE__ */ jsx(InnerMantineNumberInput, { ...props, contextName: "Integer", margin });
5
+ }
6
+ export {
7
+ MantineIntegerInput
8
+ };
@@ -4,17 +4,21 @@ import { useMemo } from "react";
4
4
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
5
5
  import { useContextProps } from "../hooks/useContextProps.mjs";
6
6
  import { useNumberProps } from "../hooks/useNumberProps.mjs";
7
- function MantineNumberInput({ margin, ...props }) {
7
+ const InnerMantineNumberInput = ({ contextName, margin, ...props }) => {
8
8
  const commonProps = useCommonProps(props);
9
9
  const { path, data } = props;
10
- const numberProps = useNumberProps("number", { data, onChange: commonProps.onChange });
10
+ const numberProps = useNumberProps(contextName.toLowerCase(), { data, onChange: commonProps.onChange });
11
11
  const componentProps = useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
12
- const [Component, _props] = useContextProps("Number", path, componentProps, props);
12
+ const [Component, _props] = useContextProps(contextName, path, componentProps, props);
13
13
  if (!props.visible) {
14
14
  return null;
15
15
  }
16
16
  return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? /* @__PURE__ */ jsx(NumberInput, { ..._props }) : Component });
17
+ };
18
+ function MantineNumberInput({ margin, ...props }) {
19
+ return /* @__PURE__ */ jsx(InnerMantineNumberInput, { ...props, contextName: "Number", margin });
17
20
  }
18
21
  export {
22
+ InnerMantineNumberInput,
19
23
  MantineNumberInput
20
24
  };
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { rankWith, isIntegerControl } from "../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
3
3
  import { withJsonFormsCellProps } from "../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
4
- import { MantineNumberInput } from "../MantineInputs/MantineNumberInput.mjs";
4
+ import { MantineIntegerInput } from "../MantineInputs/MantineIntegerInput.mjs";
5
5
  const mantineIntegerCellTester = rankWith(1, isIntegerControl);
6
- const MantineIntegerCell = withJsonFormsCellProps((props) => /* @__PURE__ */ jsx(MantineNumberInput, { ...props }));
6
+ const MantineIntegerCell = withJsonFormsCellProps((props) => /* @__PURE__ */ jsx(MantineIntegerInput, { ...props }));
7
7
  export {
8
8
  MantineIntegerCell,
9
9
  mantineIntegerCellTester
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { rankWith, isIntegerControl } from "../../../../../../../.external/esm/@jsonforms_core@3.6.0/@jsonforms/core/lib/jsonforms-core.esm.mjs";
3
3
  import { withJsonFormsControlProps } from "../../../../../../../.external/esm/@jsonforms_react@3.6.0_@jsonforms_core@3.6.0_react@18.3.1/@jsonforms/react/lib/jsonforms-react.esm.mjs";
4
- import { MantineNumberInput } from "../MantineInputs/MantineNumberInput.mjs";
4
+ import { MantineIntegerInput } from "../MantineInputs/MantineIntegerInput.mjs";
5
5
  import { DEFAULT_MARGIN } from "../utils/constants.mjs";
6
6
  const mantineIntegerControlTester = rankWith(1, isIntegerControl);
7
- const MantineIntegerControl = withJsonFormsControlProps((props) => /* @__PURE__ */ jsx(MantineNumberInput, { margin: DEFAULT_MARGIN, ...props }));
7
+ const MantineIntegerControl = withJsonFormsControlProps((props) => /* @__PURE__ */ jsx(MantineIntegerInput, { margin: DEFAULT_MARGIN, ...props }));
8
8
  export {
9
9
  MantineIntegerControl,
10
10
  mantineIntegerControlTester
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const MantineNumberInput = require("./MantineNumberInput.cjs");
5
+ function MantineIntegerInput({ margin, ...props }) {
6
+ return /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.InnerMantineNumberInput, { ...props, contextName: "Integer", margin });
7
+ }
8
+ exports.MantineIntegerInput = MantineIntegerInput;
@@ -6,15 +6,19 @@ const React = require("react");
6
6
  const useCommonProps = require("../hooks/useCommonProps.cjs");
7
7
  const useContextProps = require("../hooks/useContextProps.cjs");
8
8
  const useNumberProps = require("../hooks/useNumberProps.cjs");
9
- function MantineNumberInput({ margin, ...props }) {
9
+ const InnerMantineNumberInput = ({ contextName, margin, ...props }) => {
10
10
  const commonProps = useCommonProps.useCommonProps(props);
11
11
  const { path, data } = props;
12
- const numberProps = useNumberProps.useNumberProps("number", { data, onChange: commonProps.onChange });
12
+ const numberProps = useNumberProps.useNumberProps(contextName.toLowerCase(), { data, onChange: commonProps.onChange });
13
13
  const componentProps = React.useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
14
- const [Component, _props] = useContextProps.useContextProps("Number", path, componentProps, props);
14
+ const [Component, _props] = useContextProps.useContextProps(contextName, path, componentProps, props);
15
15
  if (!props.visible) {
16
16
  return null;
17
17
  }
18
18
  return /* @__PURE__ */ jsxRuntime.jsx(core.Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(core.NumberInput, { ..._props }) : Component });
19
+ };
20
+ function MantineNumberInput({ margin, ...props }) {
21
+ return /* @__PURE__ */ jsxRuntime.jsx(InnerMantineNumberInput, { ...props, contextName: "Number", margin });
19
22
  }
23
+ exports.InnerMantineNumberInput = InnerMantineNumberInput;
20
24
  exports.MantineNumberInput = MantineNumberInput;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const core = require("@jsonforms/core");
5
5
  const react = require("@jsonforms/react");
6
- const MantineNumberInput = require("../MantineInputs/MantineNumberInput.cjs");
6
+ const MantineIntegerInput = require("../MantineInputs/MantineIntegerInput.cjs");
7
7
  const mantineIntegerCellTester = core.rankWith(1, core.isIntegerControl);
8
- const MantineIntegerCell = react.withJsonFormsCellProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.MantineNumberInput, { ...props }));
8
+ const MantineIntegerCell = react.withJsonFormsCellProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineIntegerInput.MantineIntegerInput, { ...props }));
9
9
  exports.MantineIntegerCell = MantineIntegerCell;
10
10
  exports.mantineIntegerCellTester = mantineIntegerCellTester;
@@ -3,9 +3,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const core = require("@jsonforms/core");
5
5
  const react = require("@jsonforms/react");
6
- const MantineNumberInput = require("../MantineInputs/MantineNumberInput.cjs");
6
+ const MantineIntegerInput = require("../MantineInputs/MantineIntegerInput.cjs");
7
7
  const constants = require("../utils/constants.cjs");
8
8
  const mantineIntegerControlTester = core.rankWith(1, core.isIntegerControl);
9
- const MantineIntegerControl = react.withJsonFormsControlProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineNumberInput.MantineNumberInput, { margin: constants.DEFAULT_MARGIN, ...props }));
9
+ const MantineIntegerControl = react.withJsonFormsControlProps((props) => /* @__PURE__ */ jsxRuntime.jsx(MantineIntegerInput.MantineIntegerInput, { margin: constants.DEFAULT_MARGIN, ...props }));
10
10
  exports.MantineIntegerControl = MantineIntegerControl;
11
11
  exports.mantineIntegerControlTester = mantineIntegerControlTester;
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { InnerMantineNumberInput } from "./MantineNumberInput.mjs";
3
+ function MantineIntegerInput({ margin, ...props }) {
4
+ return /* @__PURE__ */ jsx(InnerMantineNumberInput, { ...props, contextName: "Integer", margin });
5
+ }
6
+ export {
7
+ MantineIntegerInput
8
+ };
@@ -4,17 +4,21 @@ import { useMemo } from "react";
4
4
  import { useCommonProps } from "../hooks/useCommonProps.mjs";
5
5
  import { useContextProps } from "../hooks/useContextProps.mjs";
6
6
  import { useNumberProps } from "../hooks/useNumberProps.mjs";
7
- function MantineNumberInput({ margin, ...props }) {
7
+ const InnerMantineNumberInput = ({ contextName, margin, ...props }) => {
8
8
  const commonProps = useCommonProps(props);
9
9
  const { path, data } = props;
10
- const numberProps = useNumberProps("number", { data, onChange: commonProps.onChange });
10
+ const numberProps = useNumberProps(contextName.toLowerCase(), { data, onChange: commonProps.onChange });
11
11
  const componentProps = useMemo(() => ({ ...commonProps, ...numberProps }), [commonProps, numberProps]);
12
- const [Component, _props] = useContextProps("Number", path, componentProps, props);
12
+ const [Component, _props] = useContextProps(contextName, path, componentProps, props);
13
13
  if (!props.visible) {
14
14
  return null;
15
15
  }
16
16
  return /* @__PURE__ */ jsx(Box, { m: Component === null ? void 0 : margin, children: Component === void 0 ? /* @__PURE__ */ jsx(NumberInput, { ..._props }) : Component });
17
+ };
18
+ function MantineNumberInput({ margin, ...props }) {
19
+ return /* @__PURE__ */ jsx(InnerMantineNumberInput, { ...props, contextName: "Number", margin });
17
20
  }
18
21
  export {
22
+ InnerMantineNumberInput,
19
23
  MantineNumberInput
20
24
  };
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { rankWith, isIntegerControl } from "@jsonforms/core";
3
3
  import { withJsonFormsCellProps } from "@jsonforms/react";
4
- import { MantineNumberInput } from "../MantineInputs/MantineNumberInput.mjs";
4
+ import { MantineIntegerInput } from "../MantineInputs/MantineIntegerInput.mjs";
5
5
  const mantineIntegerCellTester = rankWith(1, isIntegerControl);
6
- const MantineIntegerCell = withJsonFormsCellProps((props) => /* @__PURE__ */ jsx(MantineNumberInput, { ...props }));
6
+ const MantineIntegerCell = withJsonFormsCellProps((props) => /* @__PURE__ */ jsx(MantineIntegerInput, { ...props }));
7
7
  export {
8
8
  MantineIntegerCell,
9
9
  mantineIntegerCellTester
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { rankWith, isIntegerControl } from "@jsonforms/core";
3
3
  import { withJsonFormsControlProps } from "@jsonforms/react";
4
- import { MantineNumberInput } from "../MantineInputs/MantineNumberInput.mjs";
4
+ import { MantineIntegerInput } from "../MantineInputs/MantineIntegerInput.mjs";
5
5
  import { DEFAULT_MARGIN } from "../utils/constants.mjs";
6
6
  const mantineIntegerControlTester = rankWith(1, isIntegerControl);
7
- const MantineIntegerControl = withJsonFormsControlProps((props) => /* @__PURE__ */ jsx(MantineNumberInput, { margin: DEFAULT_MARGIN, ...props }));
7
+ const MantineIntegerControl = withJsonFormsControlProps((props) => /* @__PURE__ */ jsx(MantineIntegerInput, { margin: DEFAULT_MARGIN, ...props }));
8
8
  export {
9
9
  MantineIntegerControl,
10
10
  mantineIntegerControlTester
@@ -0,0 +1,4 @@
1
+ export function MantineIntegerInput({ margin, ...props }: {
2
+ [x: string]: any;
3
+ margin: any;
4
+ }): import("react").JSX.Element;
@@ -2,3 +2,8 @@ export function MantineNumberInput({ margin, ...props }: {
2
2
  [x: string]: any;
3
3
  margin: any;
4
4
  }): import("react").JSX.Element;
5
+ export function InnerMantineNumberInput({ contextName, margin, ...props }: {
6
+ [x: string]: any;
7
+ contextName: any;
8
+ margin: any;
9
+ }): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastapi-rtk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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",