fastapi-rtk 1.0.24 → 1.0.26
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/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/MantineBooleanInput.cjs +5 -15
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineEnumInput.cjs +6 -3
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.cjs +8 -5
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useBooleanProps.cjs +40 -18
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useSelectProps.cjs +10 -2
- package/dist/.bundled/jsonforms/esm/_virtual/index10.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/MantineBooleanInput.mjs +6 -16
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineEnumInput.mjs +7 -4
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineOneOfEnumInput.mjs +9 -6
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useBooleanProps.mjs +40 -18
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useSelectProps.mjs +10 -2
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/core/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/format/index.cjs +1 -1
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/validation/index.cjs +1 -1
- package/dist/.external/cjs/{i18next@25.8.1_typescript@5.9.3 → i18next@25.8.4_typescript@5.9.3}/i18next/dist/esm/i18next.cjs +14 -2
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/core/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/format/index.mjs +1 -1
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/validation/index.mjs +1 -1
- package/dist/.external/esm/{i18next@25.8.1_typescript@5.9.3 → i18next@25.8.4_typescript@5.9.3}/i18next/dist/esm/i18next.mjs +14 -2
- package/dist/core/cjs/ActionIcons/Add/Add.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Delete/Delete.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Download/Download.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Edit/Edit.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Refresh/Refresh.cjs +1 -1
- package/dist/core/cjs/ActionIcons/View/View.cjs +1 -1
- package/dist/core/cjs/Dialogs/AddDialog.cjs +1 -1
- package/dist/core/cjs/Dialogs/DeleteDialog.cjs +1 -1
- package/dist/core/cjs/Dialogs/EditDialog.cjs +1 -1
- package/dist/core/cjs/Modals/CommonModal.cjs +1 -1
- package/dist/core/cjs/Tables/DataGrid/ErrorDialog.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.cjs +1 -1
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideForm.cjs +1 -1
- package/dist/core/cjs/Wrappers/Provider/Contexts/LangContext.cjs +3 -3
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideLang.cjs +1 -1
- package/dist/core/cjs/index.cjs +1 -1
- package/dist/core/esm/ActionIcons/Add/Add.mjs +1 -1
- package/dist/core/esm/ActionIcons/Delete/Delete.mjs +1 -1
- package/dist/core/esm/ActionIcons/Download/Download.mjs +1 -1
- package/dist/core/esm/ActionIcons/Edit/Edit.mjs +1 -1
- package/dist/core/esm/ActionIcons/Refresh/Refresh.mjs +1 -1
- package/dist/core/esm/ActionIcons/View/View.mjs +1 -1
- package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/DeleteDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +1 -1
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/ErrorDialog.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.mjs +1 -1
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideForm.mjs +1 -1
- package/dist/core/esm/Wrappers/Provider/Contexts/LangContext.mjs +3 -3
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideLang.mjs +1 -1
- package/dist/core/esm/index.mjs +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineBooleanInput.cjs +5 -15
- package/dist/jsonforms/cjs/MantineInputs/MantineEnumInput.cjs +6 -3
- package/dist/jsonforms/cjs/MantineInputs/MantineOneOfEnumInput.cjs +8 -5
- package/dist/jsonforms/cjs/hooks/useBooleanProps.cjs +40 -18
- package/dist/jsonforms/cjs/hooks/useSelectProps.cjs +10 -2
- package/dist/jsonforms/esm/MantineInputs/MantineBooleanInput.mjs +6 -16
- package/dist/jsonforms/esm/MantineInputs/MantineEnumInput.mjs +7 -4
- package/dist/jsonforms/esm/MantineInputs/MantineOneOfEnumInput.mjs +9 -6
- package/dist/jsonforms/esm/hooks/useBooleanProps.mjs +40 -18
- package/dist/jsonforms/esm/hooks/useSelectProps.mjs +10 -2
- package/dist/jsonforms/lib/hooks/useBooleanProps.d.ts +6 -6
- package/dist/jsonforms/lib/hooks/useMultiSelectProps.d.ts +8 -0
- package/dist/jsonforms/lib/hooks/useSelectProps.d.ts +15 -1
- package/dist/zustand/cjs/useProxy/useProxy.cjs +1 -1
- package/dist/zustand/esm/useProxy/useProxy.mjs +1 -1
- package/package.json +1 -1
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/I18nextProvider.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/context.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/defaults.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/i18nInstance.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/initReactI18next.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/unescape.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/useTranslation.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/utils.cjs +0 -0
- /package/dist/.external/cjs/{zustand@5.0.11_@types_react@19.2.10_react@19.2.4 → zustand@5.0.11_@types_react@19.2.13_react@19.2.4}/zustand/esm/react.cjs +0 -0
- /package/dist/.external/cjs/{zustand@5.0.11_@types_react@19.2.10_react@19.2.4 → zustand@5.0.11_@types_react@19.2.13_react@19.2.4}/zustand/esm/vanilla.cjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/I18nextProvider.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/context.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/defaults.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/i18nInstance.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/initReactI18next.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/unescape.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/useTranslation.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.8.1_react-dom@19.2.4_react@19.2.4_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.8.4_react-dom@19.2.4_react@19.2.4_typescript@5.9.3}/react-i18next/dist/es/utils.mjs +0 -0
- /package/dist/.external/esm/{zustand@5.0.11_@types_react@19.2.10_react@19.2.4 → zustand@5.0.11_@types_react@19.2.13_react@19.2.4}/zustand/esm/react.mjs +0 -0
- /package/dist/.external/esm/{zustand@5.0.11_@types_react@19.2.10_react@19.2.4 → zustand@5.0.11_@types_react@19.2.13_react@19.2.4}/zustand/esm/vanilla.mjs +0 -0
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Select } from "@mantine/core";
|
|
2
|
+
import { NativeSelect, Select } from "@mantine/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useCommonProps } from "../hooks/useCommonProps.mjs";
|
|
5
5
|
import { useContextProps } from "../hooks/useContextProps.mjs";
|
|
6
6
|
import { useSelectProps } from "../hooks/useSelectProps.mjs";
|
|
7
7
|
function MantineEnumInput(props) {
|
|
8
|
+
var _a;
|
|
8
9
|
const { value, ...commonProps } = useCommonProps(props);
|
|
9
|
-
const { path } = props;
|
|
10
|
-
const
|
|
10
|
+
const { path, schema, uischema } = props;
|
|
11
|
+
const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
|
|
12
|
+
const selectProps = useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
|
|
11
13
|
const componentProps = useMemo(() => ({ ...commonProps, ...selectProps }), [commonProps, selectProps]);
|
|
12
14
|
const [Component, _props] = useContextProps("Enum", path, componentProps, props);
|
|
13
15
|
if (!props.visible) {
|
|
14
16
|
return null;
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
const InnerComponent = isNative ? NativeSelect : Select;
|
|
19
|
+
return Component === void 0 ? /* @__PURE__ */ jsx(InnerComponent, { ..._props }) : Component;
|
|
17
20
|
}
|
|
18
21
|
export {
|
|
19
22
|
MantineEnumInput
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Select } from "@mantine/core";
|
|
2
|
+
import { NativeSelect, Select } from "@mantine/core";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { useCommonProps } from "../hooks/useCommonProps.mjs";
|
|
5
5
|
import { useContextProps } from "../hooks/useContextProps.mjs";
|
|
6
6
|
import { useSelectProps } from "../hooks/useSelectProps.mjs";
|
|
7
7
|
function MantineOneOfEnumInput(props) {
|
|
8
|
+
var _a;
|
|
8
9
|
const { value, ...commonProps } = useCommonProps(props);
|
|
9
|
-
const { path } = props;
|
|
10
|
-
const
|
|
10
|
+
const { path, schema, uischema } = props;
|
|
11
|
+
const isNative = (((_a = uischema.options) == null ? void 0 : _a.variant) ?? schema.format) === "native";
|
|
12
|
+
const selectProps = useSelectProps(value, props.options, isNative, { onChange: commonProps.onChange });
|
|
11
13
|
const errorProps = useMemo(() => {
|
|
12
|
-
var
|
|
14
|
+
var _a2;
|
|
13
15
|
const isNull = value === null;
|
|
14
|
-
const error = (
|
|
16
|
+
const error = (_a2 = commonProps.error) == null ? void 0 : _a2.filter(
|
|
15
17
|
(error2) => error2.key === "is a required property" || !isNull ? error2 : false
|
|
16
18
|
);
|
|
17
19
|
return (error == null ? void 0 : error.length) ? { error } : { error: isNull && commonProps.required ? "is a required property" : void 0 };
|
|
@@ -24,7 +26,8 @@ function MantineOneOfEnumInput(props) {
|
|
|
24
26
|
if (!props.visible) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
const InnerComponent = isNative ? NativeSelect : Select;
|
|
30
|
+
return Component === void 0 ? /* @__PURE__ */ jsx(InnerComponent, { ..._props }) : Component;
|
|
28
31
|
}
|
|
29
32
|
export {
|
|
30
33
|
MantineOneOfEnumInput
|
|
@@ -1,22 +1,44 @@
|
|
|
1
1
|
import { isTruthy } from "fastapi-rtk/utils";
|
|
2
|
-
function useBooleanProps(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
function useBooleanProps(type, { value, onChange }) {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case "checkbox":
|
|
5
|
+
return {
|
|
6
|
+
checked: value || false,
|
|
7
|
+
onChange: (event) => onChange(event.target.checked)
|
|
8
|
+
};
|
|
9
|
+
case "native":
|
|
10
|
+
return {
|
|
11
|
+
data: [
|
|
12
|
+
{
|
|
13
|
+
value: String(true),
|
|
14
|
+
label: "True"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: String(false),
|
|
18
|
+
label: "False"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
value: isTruthy(value) ? String(value) : "",
|
|
22
|
+
onChange: (event) => onChange(isTruthy(event.currentTarget.value) ? event.currentTarget.value === String(true) : void 0)
|
|
23
|
+
};
|
|
24
|
+
case "select":
|
|
25
|
+
return {
|
|
26
|
+
data: [
|
|
27
|
+
{
|
|
28
|
+
value: String(true),
|
|
29
|
+
label: "True"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: String(false),
|
|
33
|
+
label: "False"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
value: isTruthy(value) ? String(value) : null,
|
|
37
|
+
onChange: (value2) => onChange(isTruthy(value2) ? value2 === String(true) : void 0)
|
|
38
|
+
};
|
|
39
|
+
default:
|
|
40
|
+
throw new Error(`Unknown boolean type: ${type}`);
|
|
41
|
+
}
|
|
20
42
|
}
|
|
21
43
|
export {
|
|
22
44
|
useBooleanProps
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
function useSelectProps(value, options) {
|
|
2
|
-
|
|
1
|
+
function useSelectProps(value, options, isNative = false, { onChange } = {}) {
|
|
2
|
+
if (isNative) {
|
|
3
|
+
return {
|
|
4
|
+
data: [{ value: "", label: "" }, ...options],
|
|
5
|
+
value: value || "",
|
|
6
|
+
onChange: (event) => onChange(event.currentTarget.value || void 0)
|
|
7
|
+
};
|
|
8
|
+
} else {
|
|
9
|
+
return { data: options, value: value || null, searchable: true };
|
|
10
|
+
}
|
|
3
11
|
}
|
|
4
12
|
export {
|
|
5
13
|
useSelectProps
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Custom hook to handle boolean properties for checkbox and non-checkbox components.
|
|
3
3
|
*
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {'checkbox' | 'native' | 'select'} type - The type of the component ('checkbox', 'native', etc.).
|
|
5
5
|
* @param {Object} props - The properties object.
|
|
6
6
|
* @param {any} props.value - The current value of the component.
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {((value) => void)} props.onChange - The function to call when the value changes.
|
|
8
8
|
* @returns The properties for the boolean component.
|
|
9
9
|
*/
|
|
10
|
-
export function useBooleanProps(
|
|
10
|
+
export function useBooleanProps(type: "checkbox" | "native" | "select", { value, onChange }: {
|
|
11
11
|
value: any;
|
|
12
|
-
onChange:
|
|
12
|
+
onChange: ((value: any) => void);
|
|
13
13
|
}): {
|
|
14
14
|
checked: any;
|
|
15
|
-
onChange: (event: any) =>
|
|
15
|
+
onChange: (event: any) => void;
|
|
16
16
|
data?: undefined;
|
|
17
17
|
value?: undefined;
|
|
18
18
|
} | {
|
|
@@ -21,6 +21,6 @@ export function useBooleanProps(isCheckbox: boolean, { value, onChange }: {
|
|
|
21
21
|
label: string;
|
|
22
22
|
}[];
|
|
23
23
|
value: string;
|
|
24
|
-
onChange: (
|
|
24
|
+
onChange: (event: any) => void;
|
|
25
25
|
checked?: undefined;
|
|
26
26
|
};
|
|
@@ -13,6 +13,14 @@ export function useMultiSelectProps(value: string[], options: {
|
|
|
13
13
|
}[], { onChange }: {
|
|
14
14
|
onChange: (value?: string[]) => void;
|
|
15
15
|
}): {
|
|
16
|
+
value: string | any[];
|
|
17
|
+
onChange: (value: any) => void;
|
|
18
|
+
data: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
searchable?: undefined;
|
|
23
|
+
} | {
|
|
16
24
|
value: string | any[];
|
|
17
25
|
onChange: (value: any) => void;
|
|
18
26
|
data: {
|
|
@@ -3,16 +3,30 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {string | undefined | null} value - The value.
|
|
5
5
|
* @param {{label: string, value: string}[]} options - List of options for the select component.
|
|
6
|
+
* @param {boolean} [isNative=false] - Whether to use native select or not.
|
|
7
|
+
* @param {Object} [nativeProps={}] - Additional properties for native select.
|
|
8
|
+
* @param {((value) => void)} nativeProps.onChange - The function to call when the value changes.
|
|
6
9
|
* @returns An object containing the value array with value and label for each option.
|
|
7
10
|
*/
|
|
8
11
|
export function useSelectProps(value: string | undefined | null, options: {
|
|
9
12
|
label: string;
|
|
10
13
|
value: string;
|
|
11
|
-
}[]
|
|
14
|
+
}[], isNative?: boolean, { onChange }?: {
|
|
15
|
+
onChange: ((value: any) => void);
|
|
16
|
+
}): {
|
|
17
|
+
data: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
value: string;
|
|
22
|
+
onChange: (event: any) => void;
|
|
23
|
+
searchable?: undefined;
|
|
24
|
+
} | {
|
|
12
25
|
data: {
|
|
13
26
|
label: string;
|
|
14
27
|
value: string;
|
|
15
28
|
}[];
|
|
16
29
|
value: string;
|
|
17
30
|
searchable: boolean;
|
|
31
|
+
onChange?: undefined;
|
|
18
32
|
};
|
|
@@ -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.11_@types_react@19.2.
|
|
6
|
+
const react = require("../../../.external/cjs/zustand@5.0.11_@types_react@19.2.13_react@19.2.4/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.11_@types_react@19.2.
|
|
4
|
+
import { create } from "../../../.external/esm/zustand@5.0.11_@types_react@19.2.13_react@19.2.4/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
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|