@pixpilot/formily-shadcn 0.14.0 → 0.14.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.
- package/dist/components/column.d.ts +2 -2
- package/dist/components/form-grid.d.ts +2 -2
- package/dist/components/form-item/connected-form-item.cjs +2 -0
- package/dist/components/form-item/connected-form-item.d.cts +4 -4
- package/dist/components/form-item/connected-form-item.js +3 -1
- package/dist/components/icon-picker.d.cts +3 -3
- package/dist/components/icon-picker.d.ts +3 -3
- package/dist/components/input.d.cts +2 -2
- package/dist/components/input.d.ts +2 -2
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.cjs +2 -9
- package/dist/components/json-schema-form-renderer/json-schema-form-basic.js +2 -9
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.cjs +2 -9
- package/dist/components/json-schema-form-renderer/json-schema-form-extended.js +2 -9
- package/dist/components/json-schema-form-renderer/json-schema-form-renderer.cjs +2 -24
- package/dist/components/json-schema-form-renderer/json-schema-form-renderer.js +2 -22
- package/dist/components/json-schema-form-renderer/json-schema-form.cjs +2 -9
- package/dist/components/json-schema-form-renderer/json-schema-form.js +2 -9
- package/dist/components/json-schema-form-renderer/types.d.cts +1 -1
- package/dist/components/json-schema-form-renderer/types.d.ts +1 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/row.d.ts +2 -2
- package/dist/components/schema-field/index.d.cts +3 -3
- package/dist/components/schema-field/index.d.ts +3 -3
- package/dist/components/schema-field/index.js +3 -3
- package/dist/components/schema-field/schema-field-basics.cjs +14 -0
- package/dist/components/schema-field/schema-field-basics.d.cts +9 -1
- package/dist/components/schema-field/schema-field-basics.d.ts +9 -1
- package/dist/components/schema-field/schema-field-basics.js +13 -1
- package/dist/components/schema-field/schema-field-extended.cjs +14 -0
- package/dist/components/schema-field/schema-field-extended.d.cts +8 -1
- package/dist/components/schema-field/schema-field-extended.d.ts +8 -1
- package/dist/components/schema-field/schema-field-extended.js +13 -1
- package/dist/components/schema-field/schema-field.cjs +14 -0
- package/dist/components/schema-field/schema-field.d.cts +9 -1
- package/dist/components/schema-field/schema-field.d.ts +9 -1
- package/dist/components/schema-field/schema-field.js +13 -1
- package/dist/components/separator.d.ts +2 -2
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-form-schema.cjs +21 -0
- package/dist/hooks/use-form-schema.js +19 -0
- package/dist/hooks/use-merged-schema-components.cjs +29 -0
- package/dist/hooks/use-merged-schema-components.js +27 -0
- package/dist/hooks/use-schema-field.cjs +29 -0
- package/dist/hooks/use-schema-field.js +25 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/column.d.ts
|
|
5
5
|
interface IColumnProps {
|
|
@@ -36,6 +36,6 @@ interface IColumnProps {
|
|
|
36
36
|
declare function Column({
|
|
37
37
|
className,
|
|
38
38
|
children
|
|
39
|
-
}: IColumnProps):
|
|
39
|
+
}: IColumnProps): react_jsx_runtime0.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Column };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/form-grid.d.ts
|
|
5
5
|
interface IFormGridProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
@@ -7,6 +7,6 @@ declare function FormGrid({
|
|
|
7
7
|
className,
|
|
8
8
|
children,
|
|
9
9
|
...rest
|
|
10
|
-
}: IFormGridProps):
|
|
10
|
+
}: IFormGridProps): react_jsx_runtime1.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { FormGrid };
|
|
@@ -11,6 +11,7 @@ __formily_core = require_rolldown_runtime.__toESM(__formily_core);
|
|
|
11
11
|
* Automatically maps field validation state to component props.
|
|
12
12
|
*/
|
|
13
13
|
const FormItem = (0, __formily_react.connect)(require_base_form_item.BaseFormItem, (0, __formily_react.mapProps)((props, field) => {
|
|
14
|
+
const schema = (0, __formily_react.useFieldSchema)();
|
|
14
15
|
if ((0, __formily_core.isVoidField)(field)) return {
|
|
15
16
|
label: field.title ?? props.label,
|
|
16
17
|
description: props.description ?? field.description,
|
|
@@ -30,6 +31,7 @@ const FormItem = (0, __formily_react.connect)(require_base_form_item.BaseFormIte
|
|
|
30
31
|
if (field.selfSuccesses?.length) return field.selfSuccesses.join(", ");
|
|
31
32
|
};
|
|
32
33
|
const takeAsterisk = () => {
|
|
34
|
+
if (schema.parent && Array.isArray(schema.parent.required) && schema.parent.required.includes(schema.name)) return true;
|
|
33
35
|
if (field.required && field.pattern !== "readPretty") return true;
|
|
34
36
|
if ("asterisk" in props) return Boolean(props.asterisk);
|
|
35
37
|
return false;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FormItemProps } from "./form-item-types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1361 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/form-item/connected-form-item.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* FormItem component connected to Formily field state.
|
|
7
7
|
* Automatically maps field validation state to component props.
|
|
8
8
|
*/
|
|
9
|
-
declare const FormItem:
|
|
10
|
-
children?:
|
|
11
|
-
}>, "ref"> &
|
|
9
|
+
declare const FormItem: react1361.ForwardRefExoticComponent<Omit<Partial<FormItemProps & {
|
|
10
|
+
children?: react1361.ReactNode | undefined;
|
|
11
|
+
}>, "ref"> & react1361.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { FormItem };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseFormItem } from "./base-form-item.js";
|
|
2
|
-
import { connect, mapProps } from "@formily/react";
|
|
2
|
+
import { connect, mapProps, useFieldSchema } from "@formily/react";
|
|
3
3
|
import { isVoidField } from "@formily/core";
|
|
4
4
|
|
|
5
5
|
//#region src/components/form-item/connected-form-item.tsx
|
|
@@ -8,6 +8,7 @@ import { isVoidField } from "@formily/core";
|
|
|
8
8
|
* Automatically maps field validation state to component props.
|
|
9
9
|
*/
|
|
10
10
|
const FormItem = connect(BaseFormItem, mapProps((props, field) => {
|
|
11
|
+
const schema = useFieldSchema();
|
|
11
12
|
if (isVoidField(field)) return {
|
|
12
13
|
label: field.title ?? props.label,
|
|
13
14
|
description: props.description ?? field.description,
|
|
@@ -27,6 +28,7 @@ const FormItem = connect(BaseFormItem, mapProps((props, field) => {
|
|
|
27
28
|
if (field.selfSuccesses?.length) return field.selfSuccesses.join(", ");
|
|
28
29
|
};
|
|
29
30
|
const takeAsterisk = () => {
|
|
31
|
+
if (schema.parent && Array.isArray(schema.parent.required) && schema.parent.required.includes(schema.name)) return true;
|
|
30
32
|
if (field.required && field.pattern !== "readPretty") return true;
|
|
31
33
|
if ("asterisk" in props) return Boolean(props.asterisk);
|
|
32
34
|
return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react8 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.d.ts
|
|
@@ -8,8 +8,8 @@ import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
|
8
8
|
* Automatically connects to Formily field state
|
|
9
9
|
* Supports both static and async icon providers
|
|
10
10
|
*/
|
|
11
|
-
declare const IconPicker:
|
|
11
|
+
declare const IconPicker: react8.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react8.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon-picker.d.ts
|
|
@@ -8,8 +8,8 @@ import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
|
8
8
|
* Automatically connects to Formily field state
|
|
9
9
|
* Supports both static and async icon providers
|
|
10
10
|
*/
|
|
11
|
-
declare const IconPicker$1:
|
|
11
|
+
declare const IconPicker$1: react4.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react4.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker$1 as IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/input.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import * as react6 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react4.ForwardRefExoticComponent<Omit<Partial<react4.ClassAttributes<HTMLInputElement> & react4.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react4.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react6 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/input.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import * as react4 from "react";
|
|
|
6
6
|
* Formily-connected Input component
|
|
7
7
|
* Automatically connects shadcn Input to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Input:
|
|
9
|
+
declare const Input: react6.ForwardRefExoticComponent<Omit<Partial<react6.ClassAttributes<HTMLInputElement> & react6.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react6.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_schema_field_basics = require('../schema-field/schema-field-basics.cjs');
|
|
3
4
|
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
4
5
|
let react = require("react");
|
|
@@ -15,15 +16,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
15
16
|
*/
|
|
16
17
|
const JsonSchemaFormBasic = (props) => {
|
|
17
18
|
const { components,...rest } = props;
|
|
18
|
-
const mergedComponents =
|
|
19
|
-
return {
|
|
20
|
-
fields: {
|
|
21
|
-
...require_schema_field_basics.basicComponentRegistry,
|
|
22
|
-
...components?.fields || {}
|
|
23
|
-
},
|
|
24
|
-
decorators: components?.decorators
|
|
25
|
-
};
|
|
26
|
-
}, [components?.decorators, components?.fields]);
|
|
19
|
+
const mergedComponents = require_use_merged_schema_components.useMergedSchemaComponents(require_schema_field_basics.basicComponentRegistry, components);
|
|
27
20
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_renderer.JsonSchemaFormRenderer, {
|
|
28
21
|
...rest,
|
|
29
22
|
components: mergedComponents
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { basicComponentRegistry } from "../schema-field/schema-field-basics.js";
|
|
2
3
|
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
3
4
|
import React from "react";
|
|
@@ -12,15 +13,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
13
|
*/
|
|
13
14
|
const JsonSchemaFormBasic = (props) => {
|
|
14
15
|
const { components,...rest } = props;
|
|
15
|
-
const mergedComponents =
|
|
16
|
-
return {
|
|
17
|
-
fields: {
|
|
18
|
-
...basicComponentRegistry,
|
|
19
|
-
...components?.fields || {}
|
|
20
|
-
},
|
|
21
|
-
decorators: components?.decorators
|
|
22
|
-
};
|
|
23
|
-
}, [components?.decorators, components?.fields]);
|
|
16
|
+
const mergedComponents = useMergedSchemaComponents(basicComponentRegistry, components);
|
|
24
17
|
return /* @__PURE__ */ jsx(JsonSchemaFormRenderer, {
|
|
25
18
|
...rest,
|
|
26
19
|
components: mergedComponents
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_schema_field_extended = require('../schema-field/schema-field-extended.cjs');
|
|
3
4
|
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
4
5
|
let react = require("react");
|
|
@@ -15,15 +16,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
15
16
|
*/
|
|
16
17
|
const JsonSchemaFormExtended = (props) => {
|
|
17
18
|
const { components,...rest } = props;
|
|
18
|
-
const mergedComponents =
|
|
19
|
-
return {
|
|
20
|
-
fields: {
|
|
21
|
-
...require_schema_field_extended.extendedComponentRegistry,
|
|
22
|
-
...components?.fields || {}
|
|
23
|
-
},
|
|
24
|
-
decorators: components?.decorators
|
|
25
|
-
};
|
|
26
|
-
}, [components?.decorators, components?.fields]);
|
|
19
|
+
const mergedComponents = require_use_merged_schema_components.useMergedSchemaComponents(require_schema_field_extended.extendedComponentRegistry, components);
|
|
27
20
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_renderer.JsonSchemaFormRenderer, {
|
|
28
21
|
...rest,
|
|
29
22
|
components: mergedComponents
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { extendedComponentRegistry } from "../schema-field/schema-field-extended.js";
|
|
2
3
|
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
3
4
|
import React from "react";
|
|
@@ -12,15 +13,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
13
|
*/
|
|
13
14
|
const JsonSchemaFormExtended = (props) => {
|
|
14
15
|
const { components,...rest } = props;
|
|
15
|
-
const mergedComponents =
|
|
16
|
-
return {
|
|
17
|
-
fields: {
|
|
18
|
-
...extendedComponentRegistry,
|
|
19
|
-
...components?.fields || {}
|
|
20
|
-
},
|
|
21
|
-
decorators: components?.decorators
|
|
22
|
-
};
|
|
23
|
-
}, [components?.decorators, components?.fields]);
|
|
16
|
+
const mergedComponents = useMergedSchemaComponents(extendedComponentRegistry, components);
|
|
24
17
|
return /* @__PURE__ */ jsx(JsonSchemaFormRenderer, {
|
|
25
18
|
...rest,
|
|
26
19
|
components: mergedComponents
|
|
@@ -1,37 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_extract_fields_decorators = require('../../utils/extract-fields-decorators.cjs');
|
|
3
|
-
const require_transform_schema = require('../../utils/transform-schema.cjs');
|
|
4
|
-
const require_validate_schema_components = require('../../utils/validate-schema-components.cjs');
|
|
5
|
-
require('../../utils/index.cjs');
|
|
6
2
|
const require_form = require('../form.cjs');
|
|
7
|
-
const
|
|
8
|
-
let __formily_react = require("@formily/react");
|
|
9
|
-
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
3
|
+
const require_use_form_schema = require('../../hooks/use-form-schema.cjs');
|
|
10
4
|
let react = require("react");
|
|
11
5
|
react = require_rolldown_runtime.__toESM(react);
|
|
12
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
7
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
14
|
-
let __pixpilot_env_is_dev = require("@pixpilot/env/is-dev");
|
|
15
|
-
__pixpilot_env_is_dev = require_rolldown_runtime.__toESM(__pixpilot_env_is_dev);
|
|
16
8
|
|
|
17
9
|
//#region src/components/json-schema-form-renderer/json-schema-form-renderer.tsx
|
|
18
10
|
const JsonSchemaFormRenderer = (props) => {
|
|
19
11
|
const { schema, children, settings: configProp, components: componentsProp, form,...rest } = props;
|
|
20
|
-
const formSchema = (
|
|
21
|
-
return require_transform_schema.transformSchema(schema, require_extract_fields_decorators.extractFieldsDecorators(componentsProp?.fields));
|
|
22
|
-
}, [schema, componentsProp]);
|
|
23
|
-
const SchemaField = react.default.useMemo(() => {
|
|
24
|
-
const componentConfigs = { ...componentsProp?.fields };
|
|
25
|
-
if (componentsProp?.decorators) Object.entries(componentsProp.decorators).forEach(([key, decorator]) => {
|
|
26
|
-
componentConfigs[key] = { component: decorator };
|
|
27
|
-
});
|
|
28
|
-
const components = require_extract_components.extractComponents(componentConfigs);
|
|
29
|
-
if ((0, __pixpilot_env_is_dev.isDevelopment)()) require_validate_schema_components.validateSchemaComponents(formSchema, components);
|
|
30
|
-
return (0, __formily_react.createSchemaField)({
|
|
31
|
-
components,
|
|
32
|
-
scope: {}
|
|
33
|
-
});
|
|
34
|
-
}, [formSchema, componentsProp]);
|
|
12
|
+
const { formSchema, SchemaField } = require_use_form_schema.useFormSchema(schema, componentsProp);
|
|
35
13
|
const config = (0, react.useMemo)(() => {
|
|
36
14
|
return {
|
|
37
15
|
...configProp,
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import { extractFieldsDecorators } from "../../utils/extract-fields-decorators.js";
|
|
2
|
-
import { transformSchema } from "../../utils/transform-schema.js";
|
|
3
|
-
import { validateSchemaComponents } from "../../utils/validate-schema-components.js";
|
|
4
|
-
import "../../utils/index.js";
|
|
5
1
|
import { Form } from "../form.js";
|
|
6
|
-
import {
|
|
7
|
-
import { createSchemaField } from "@formily/react";
|
|
2
|
+
import { useFormSchema } from "../../hooks/use-form-schema.js";
|
|
8
3
|
import React, { useMemo } from "react";
|
|
9
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { isDevelopment } from "@pixpilot/env/is-dev";
|
|
11
5
|
|
|
12
6
|
//#region src/components/json-schema-form-renderer/json-schema-form-renderer.tsx
|
|
13
7
|
const JsonSchemaFormRenderer = (props) => {
|
|
14
8
|
const { schema, children, settings: configProp, components: componentsProp, form,...rest } = props;
|
|
15
|
-
const formSchema =
|
|
16
|
-
return transformSchema(schema, extractFieldsDecorators(componentsProp?.fields));
|
|
17
|
-
}, [schema, componentsProp]);
|
|
18
|
-
const SchemaField = React.useMemo(() => {
|
|
19
|
-
const componentConfigs = { ...componentsProp?.fields };
|
|
20
|
-
if (componentsProp?.decorators) Object.entries(componentsProp.decorators).forEach(([key, decorator]) => {
|
|
21
|
-
componentConfigs[key] = { component: decorator };
|
|
22
|
-
});
|
|
23
|
-
const components = extractComponents(componentConfigs);
|
|
24
|
-
if (isDevelopment()) validateSchemaComponents(formSchema, components);
|
|
25
|
-
return createSchemaField({
|
|
26
|
-
components,
|
|
27
|
-
scope: {}
|
|
28
|
-
});
|
|
29
|
-
}, [formSchema, componentsProp]);
|
|
9
|
+
const { formSchema, SchemaField } = useFormSchema(schema, componentsProp);
|
|
30
10
|
const config = useMemo(() => {
|
|
31
11
|
return {
|
|
32
12
|
...configProp,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_schema_field = require('../schema-field/schema-field.cjs');
|
|
3
4
|
require('../schema-field/index.cjs');
|
|
4
5
|
const require_json_schema_form_renderer = require('./json-schema-form-renderer.cjs');
|
|
@@ -16,15 +17,7 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
16
17
|
*/
|
|
17
18
|
const JsonSchemaForm = (props) => {
|
|
18
19
|
const { components,...rest } = props;
|
|
19
|
-
const mergedComponents =
|
|
20
|
-
return {
|
|
21
|
-
fields: {
|
|
22
|
-
...require_schema_field.defaultComponentRegistry,
|
|
23
|
-
...components?.fields || {}
|
|
24
|
-
},
|
|
25
|
-
decorators: components?.decorators
|
|
26
|
-
};
|
|
27
|
-
}, [components?.decorators, components?.fields]);
|
|
20
|
+
const mergedComponents = require_use_merged_schema_components.useMergedSchemaComponents(require_schema_field.defaultComponentRegistry, components);
|
|
28
21
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_json_schema_form_renderer.JsonSchemaFormRenderer, {
|
|
29
22
|
...rest,
|
|
30
23
|
components: mergedComponents
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { defaultComponentRegistry } from "../schema-field/schema-field.js";
|
|
2
3
|
import "../schema-field/index.js";
|
|
3
4
|
import { JsonSchemaFormRenderer } from "./json-schema-form-renderer.js";
|
|
@@ -13,15 +14,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
13
14
|
*/
|
|
14
15
|
const JsonSchemaForm = (props) => {
|
|
15
16
|
const { components,...rest } = props;
|
|
16
|
-
const mergedComponents =
|
|
17
|
-
return {
|
|
18
|
-
fields: {
|
|
19
|
-
...defaultComponentRegistry,
|
|
20
|
-
...components?.fields || {}
|
|
21
|
-
},
|
|
22
|
-
decorators: components?.decorators
|
|
23
|
-
};
|
|
24
|
-
}, [components?.decorators, components?.fields]);
|
|
17
|
+
const mergedComponents = useMergedSchemaComponents(defaultComponentRegistry, components);
|
|
25
18
|
return /* @__PURE__ */ jsx(JsonSchemaFormRenderer, {
|
|
26
19
|
...rest,
|
|
27
20
|
components: mergedComponents
|
|
@@ -13,7 +13,7 @@ interface JsonSchemaFormComponents {
|
|
|
13
13
|
interface JsonSchemaFormRendererProps extends React.ComponentProps<typeof Form> {
|
|
14
14
|
schema: ISchema;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
components
|
|
16
|
+
components?: Partial<JsonSchemaFormComponents>;
|
|
17
17
|
}
|
|
18
18
|
interface JsonSchemaFormProps extends Omit<JsonSchemaFormRendererProps, 'components'> {
|
|
19
19
|
components?: JsonSchemaFormComponents;
|
|
@@ -13,7 +13,7 @@ interface JsonSchemaFormComponents {
|
|
|
13
13
|
interface JsonSchemaFormRendererProps extends React.ComponentProps<typeof Form> {
|
|
14
14
|
schema: ISchema;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
components
|
|
16
|
+
components?: Partial<JsonSchemaFormComponents>;
|
|
17
17
|
}
|
|
18
18
|
interface JsonSchemaFormProps extends Omit<JsonSchemaFormRendererProps, 'components'> {
|
|
19
19
|
components?: JsonSchemaFormComponents;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
import { RadioGroup } from "@pixpilot/shadcn";
|
|
4
4
|
|
|
5
5
|
//#region src/components/radio.d.ts
|
|
@@ -15,7 +15,7 @@ type RadioProps = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Radio component with options rendering
|
|
17
17
|
*/
|
|
18
|
-
declare function Radio(props: RadioProps):
|
|
18
|
+
declare function Radio(props: RadioProps): react_jsx_runtime2.JSX.Element;
|
|
19
19
|
declare namespace Radio {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
package/dist/components/row.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/row.d.ts
|
|
5
5
|
interface IRowProps {
|
|
@@ -36,6 +36,6 @@ interface IRowProps {
|
|
|
36
36
|
declare function Row({
|
|
37
37
|
className,
|
|
38
38
|
children
|
|
39
|
-
}: IRowProps):
|
|
39
|
+
}: IRowProps): react_jsx_runtime3.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Row };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.cjs";
|
|
2
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.cjs";
|
|
3
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.cjs";
|
|
1
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.cjs";
|
|
2
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.cjs";
|
|
3
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.cjs";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.js";
|
|
2
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.js";
|
|
3
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.js";
|
|
1
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.js";
|
|
2
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.js";
|
|
3
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.js";
|
|
2
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.js";
|
|
3
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.js";
|
|
1
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./schema-field-basics.js";
|
|
2
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./schema-field.js";
|
|
3
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./schema-field-extended.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_array_cards = require('../array-cards/array-cards.cjs');
|
|
3
4
|
require('../array-cards/index.cjs');
|
|
4
5
|
const require_array_collapse = require('../array-collapse/array-collapse.cjs');
|
|
@@ -11,6 +12,7 @@ const require_connected_form_item = require('../form-item/connected-form-item.cj
|
|
|
11
12
|
require('../form-item/index.cjs');
|
|
12
13
|
const require_input = require('../input.cjs');
|
|
13
14
|
const require_extract_components = require('../../utils/extract-components.cjs');
|
|
15
|
+
const require_use_form_schema = require('../../hooks/use-form-schema.cjs');
|
|
14
16
|
const require_array_dialog = require('../array-dialog/array-dialog.cjs');
|
|
15
17
|
require('../array-dialog/index.cjs');
|
|
16
18
|
const require_array_popover = require('../array-popover/array-popover.cjs');
|
|
@@ -26,6 +28,8 @@ const require_switch = require('../switch.cjs');
|
|
|
26
28
|
const require_textarea = require('../textarea.cjs');
|
|
27
29
|
let __formily_react = require("@formily/react");
|
|
28
30
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
31
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
29
33
|
|
|
30
34
|
//#region src/components/schema-field/schema-field-basics.tsx
|
|
31
35
|
const basicComponentRegistry = {
|
|
@@ -90,8 +94,18 @@ const basicComponentRegistry = {
|
|
|
90
94
|
};
|
|
91
95
|
const basicComponents = require_extract_components.extractComponents(basicComponentRegistry);
|
|
92
96
|
const SchemaFieldBasics = (0, __formily_react.createSchemaField)({ components: basicComponents });
|
|
97
|
+
const JsonSchemaFieldBasics = (props) => {
|
|
98
|
+
const { components, schema,...rest } = props;
|
|
99
|
+
const { formSchema, SchemaField } = require_use_form_schema.useFormSchema(schema, require_use_merged_schema_components.useMergedSchemaComponents(basicComponentRegistry, components));
|
|
100
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaField, {
|
|
101
|
+
...rest,
|
|
102
|
+
schema: formSchema
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
JsonSchemaFieldBasics.displayName = "JsonSchemaFieldBasics";
|
|
93
106
|
|
|
94
107
|
//#endregion
|
|
108
|
+
exports.JsonSchemaFieldBasics = JsonSchemaFieldBasics;
|
|
95
109
|
exports.SchemaFieldBasics = SchemaFieldBasics;
|
|
96
110
|
exports.basicComponentRegistry = basicComponentRegistry;
|
|
97
111
|
exports.basicComponents = basicComponents;
|
|
@@ -4,9 +4,12 @@ import { Column } from "../column.cjs";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.cjs";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.cjs";
|
|
6
6
|
import "../form-item/index.cjs";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.cjs";
|
|
8
|
+
import "../json-schema-form-renderer/index.cjs";
|
|
7
9
|
import { Row } from "../row.cjs";
|
|
8
10
|
import { ObjectContainerProps } from "../object-container.cjs";
|
|
9
11
|
import * as _formily_react23 from "@formily/react";
|
|
12
|
+
import { ISchema } from "@formily/react";
|
|
10
13
|
import * as react987 from "react";
|
|
11
14
|
import * as _formily_core1 from "@formily/core";
|
|
12
15
|
import * as _pixpilot_shadcn_ui302 from "@pixpilot/shadcn-ui";
|
|
@@ -460,5 +463,10 @@ declare const SchemaFieldBasics: {
|
|
|
460
463
|
displayName: string;
|
|
461
464
|
};
|
|
462
465
|
};
|
|
466
|
+
type SchemaFieldBasicsProps = Omit<React.ComponentProps<typeof SchemaFieldBasics>, 'components'> & {
|
|
467
|
+
components?: JsonSchemaFormComponents;
|
|
468
|
+
schema: ISchema;
|
|
469
|
+
};
|
|
470
|
+
declare const JsonSchemaFieldBasics: React.FC<SchemaFieldBasicsProps>;
|
|
463
471
|
//#endregion
|
|
464
|
-
export { SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
472
|
+
export { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
@@ -4,9 +4,12 @@ import { Column } from "../column.js";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.js";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.js";
|
|
6
6
|
import "../form-item/index.js";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.js";
|
|
8
|
+
import "../json-schema-form-renderer/index.js";
|
|
7
9
|
import { Row } from "../row.js";
|
|
8
10
|
import { ObjectContainerProps } from "../object-container.js";
|
|
9
11
|
import * as _formily_react23 from "@formily/react";
|
|
12
|
+
import { ISchema } from "@formily/react";
|
|
10
13
|
import * as react987 from "react";
|
|
11
14
|
import * as _pixpilot_shadcn_ui302 from "@pixpilot/shadcn-ui";
|
|
12
15
|
import * as _formily_core1 from "@formily/core";
|
|
@@ -460,5 +463,10 @@ declare const SchemaFieldBasics: {
|
|
|
460
463
|
displayName: string;
|
|
461
464
|
};
|
|
462
465
|
};
|
|
466
|
+
type SchemaFieldBasicsProps = Omit<React.ComponentProps<typeof SchemaFieldBasics>, 'components'> & {
|
|
467
|
+
components?: JsonSchemaFormComponents;
|
|
468
|
+
schema: ISchema;
|
|
469
|
+
};
|
|
470
|
+
declare const JsonSchemaFieldBasics: React.FC<SchemaFieldBasicsProps>;
|
|
463
471
|
//#endregion
|
|
464
|
-
export { SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
472
|
+
export { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { ArrayCards } from "../array-cards/array-cards.js";
|
|
2
3
|
import "../array-cards/index.js";
|
|
3
4
|
import { ArrayCollapse } from "../array-collapse/array-collapse.js";
|
|
@@ -10,6 +11,7 @@ import { FormItem } from "../form-item/connected-form-item.js";
|
|
|
10
11
|
import "../form-item/index.js";
|
|
11
12
|
import { Input } from "../input.js";
|
|
12
13
|
import { extractComponents } from "../../utils/extract-components.js";
|
|
14
|
+
import { useFormSchema } from "../../hooks/use-form-schema.js";
|
|
13
15
|
import { ArrayDialog } from "../array-dialog/array-dialog.js";
|
|
14
16
|
import "../array-dialog/index.js";
|
|
15
17
|
import { ArrayPopover } from "../array-popover/array-popover.js";
|
|
@@ -24,6 +26,7 @@ import { Separator } from "../separator.js";
|
|
|
24
26
|
import { Switch } from "../switch.js";
|
|
25
27
|
import { Textarea } from "../textarea.js";
|
|
26
28
|
import { createSchemaField } from "@formily/react";
|
|
29
|
+
import { jsx } from "react/jsx-runtime";
|
|
27
30
|
|
|
28
31
|
//#region src/components/schema-field/schema-field-basics.tsx
|
|
29
32
|
const basicComponentRegistry = {
|
|
@@ -88,6 +91,15 @@ const basicComponentRegistry = {
|
|
|
88
91
|
};
|
|
89
92
|
const basicComponents = extractComponents(basicComponentRegistry);
|
|
90
93
|
const SchemaFieldBasics = createSchemaField({ components: basicComponents });
|
|
94
|
+
const JsonSchemaFieldBasics = (props) => {
|
|
95
|
+
const { components, schema,...rest } = props;
|
|
96
|
+
const { formSchema, SchemaField } = useFormSchema(schema, useMergedSchemaComponents(basicComponentRegistry, components));
|
|
97
|
+
return /* @__PURE__ */ jsx(SchemaField, {
|
|
98
|
+
...rest,
|
|
99
|
+
schema: formSchema
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
JsonSchemaFieldBasics.displayName = "JsonSchemaFieldBasics";
|
|
91
103
|
|
|
92
104
|
//#endregion
|
|
93
|
-
export { SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
105
|
+
export { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents };
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_avatar_upload = require('../file-upload/avatar-upload.cjs');
|
|
3
4
|
const require_file_upload = require('../file-upload/file-upload.cjs');
|
|
4
5
|
const require_file_upload_inline = require('../file-upload/file-upload-inline.cjs');
|
|
5
6
|
require('../file-upload/index.cjs');
|
|
6
7
|
const require_icon_picker = require('../icon-picker.cjs');
|
|
7
8
|
const require_extract_components = require('../../utils/extract-components.cjs');
|
|
9
|
+
const require_use_form_schema = require('../../hooks/use-form-schema.cjs');
|
|
8
10
|
const require_schema_field = require('./schema-field.cjs');
|
|
9
11
|
const require_rich_text_editor = require('../rich-text-editor.cjs');
|
|
10
12
|
require('./index.cjs');
|
|
11
13
|
let __formily_react = require("@formily/react");
|
|
12
14
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
13
17
|
|
|
14
18
|
//#region src/components/schema-field/schema-field-extended.tsx
|
|
15
19
|
const extendedComponentRegistry = {
|
|
@@ -41,8 +45,18 @@ const extendedComponentRegistry = {
|
|
|
41
45
|
*/
|
|
42
46
|
const extendedComponents = require_extract_components.extractComponents(extendedComponentRegistry);
|
|
43
47
|
const SchemaFieldExtended = (0, __formily_react.createSchemaField)({ components: extendedComponents });
|
|
48
|
+
const JsonSchemaFieldExtended = (props) => {
|
|
49
|
+
const { components, schema,...rest } = props;
|
|
50
|
+
const { formSchema, SchemaField } = require_use_form_schema.useFormSchema(schema, require_use_merged_schema_components.useMergedSchemaComponents(extendedComponentRegistry, components));
|
|
51
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaField, {
|
|
52
|
+
...rest,
|
|
53
|
+
schema: formSchema
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
JsonSchemaFieldExtended.displayName = "JsonSchemaFieldExtended";
|
|
44
57
|
|
|
45
58
|
//#endregion
|
|
59
|
+
exports.JsonSchemaFieldExtended = JsonSchemaFieldExtended;
|
|
46
60
|
exports.SchemaFieldExtended = SchemaFieldExtended;
|
|
47
61
|
exports.extendedComponentRegistry = extendedComponentRegistry;
|
|
48
62
|
exports.extendedComponents = extendedComponents;
|
|
@@ -4,9 +4,11 @@ import { Column } from "../column.cjs";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.cjs";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.cjs";
|
|
6
6
|
import "../form-item/index.cjs";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.cjs";
|
|
7
8
|
import { Row } from "../row.cjs";
|
|
8
9
|
import { ObjectContainerProps } from "../object-container.cjs";
|
|
9
10
|
import * as _formily_react0 from "@formily/react";
|
|
11
|
+
import { ISchema } from "@formily/react";
|
|
10
12
|
import * as react30 from "react";
|
|
11
13
|
import * as _formily_core0 from "@formily/core";
|
|
12
14
|
import * as _pixpilot_shadcn_ui16 from "@pixpilot/shadcn-ui";
|
|
@@ -788,5 +790,10 @@ declare const SchemaFieldExtended: {
|
|
|
788
790
|
displayName: string;
|
|
789
791
|
};
|
|
790
792
|
};
|
|
793
|
+
type JsonSchemaFieldExtendedProps = Omit<React.ComponentProps<typeof SchemaFieldExtended>, 'components'> & {
|
|
794
|
+
components?: JsonSchemaFormComponents;
|
|
795
|
+
schema: ISchema;
|
|
796
|
+
};
|
|
797
|
+
declare const JsonSchemaFieldExtended: React.FC<JsonSchemaFieldExtendedProps>;
|
|
791
798
|
//#endregion
|
|
792
|
-
export { SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
799
|
+
export { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
@@ -4,9 +4,11 @@ import { Column } from "../column.js";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.js";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.js";
|
|
6
6
|
import "../form-item/index.js";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.js";
|
|
7
8
|
import { Row } from "../row.js";
|
|
8
9
|
import { ObjectContainerProps } from "../object-container.js";
|
|
9
10
|
import * as _formily_react0 from "@formily/react";
|
|
11
|
+
import { ISchema } from "@formily/react";
|
|
10
12
|
import * as react30 from "react";
|
|
11
13
|
import * as _pixpilot_shadcn_ui16 from "@pixpilot/shadcn-ui";
|
|
12
14
|
import * as _formily_core0 from "@formily/core";
|
|
@@ -788,5 +790,10 @@ declare const SchemaFieldExtended: {
|
|
|
788
790
|
displayName: string;
|
|
789
791
|
};
|
|
790
792
|
};
|
|
793
|
+
type JsonSchemaFieldExtendedProps = Omit<React.ComponentProps<typeof SchemaFieldExtended>, 'components'> & {
|
|
794
|
+
components?: JsonSchemaFormComponents;
|
|
795
|
+
schema: ISchema;
|
|
796
|
+
};
|
|
797
|
+
declare const JsonSchemaFieldExtended: React.FC<JsonSchemaFieldExtendedProps>;
|
|
791
798
|
//#endregion
|
|
792
|
-
export { SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
799
|
+
export { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { AvatarUpload } from "../file-upload/avatar-upload.js";
|
|
2
3
|
import { FileUpload } from "../file-upload/file-upload.js";
|
|
3
4
|
import { FileUploadInline } from "../file-upload/file-upload-inline.js";
|
|
4
5
|
import "../file-upload/index.js";
|
|
5
6
|
import { IconPicker } from "../icon-picker.js";
|
|
6
7
|
import { extractComponents } from "../../utils/extract-components.js";
|
|
8
|
+
import { useFormSchema } from "../../hooks/use-form-schema.js";
|
|
7
9
|
import { defaultComponentRegistry } from "./schema-field.js";
|
|
8
10
|
import { RichTextEditor } from "../rich-text-editor.js";
|
|
9
11
|
import "./index.js";
|
|
10
12
|
import { createSchemaField } from "@formily/react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
14
|
|
|
12
15
|
//#region src/components/schema-field/schema-field-extended.tsx
|
|
13
16
|
const extendedComponentRegistry = {
|
|
@@ -39,6 +42,15 @@ const extendedComponentRegistry = {
|
|
|
39
42
|
*/
|
|
40
43
|
const extendedComponents = extractComponents(extendedComponentRegistry);
|
|
41
44
|
const SchemaFieldExtended = createSchemaField({ components: extendedComponents });
|
|
45
|
+
const JsonSchemaFieldExtended = (props) => {
|
|
46
|
+
const { components, schema,...rest } = props;
|
|
47
|
+
const { formSchema, SchemaField } = useFormSchema(schema, useMergedSchemaComponents(extendedComponentRegistry, components));
|
|
48
|
+
return /* @__PURE__ */ jsx(SchemaField, {
|
|
49
|
+
...rest,
|
|
50
|
+
schema: formSchema
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
JsonSchemaFieldExtended.displayName = "JsonSchemaFieldExtended";
|
|
42
54
|
|
|
43
55
|
//#endregion
|
|
44
|
-
export { SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
56
|
+
export { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_use_merged_schema_components = require('../../hooks/use-merged-schema-components.cjs');
|
|
2
3
|
const require_combobox = require('../combobox.cjs');
|
|
3
4
|
const require_extract_components = require('../../utils/extract-components.cjs');
|
|
5
|
+
const require_use_form_schema = require('../../hooks/use-form-schema.cjs');
|
|
4
6
|
const require_slider = require('../slider.cjs');
|
|
5
7
|
const require_tags_input_inline = require('../tags-input-inline.cjs');
|
|
6
8
|
const require_schema_field_basics = require('./schema-field-basics.cjs');
|
|
@@ -8,6 +10,8 @@ let __formily_react = require("@formily/react");
|
|
|
8
10
|
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
9
11
|
let __pixpilot_shadcn_ui = require("@pixpilot/shadcn-ui");
|
|
10
12
|
__pixpilot_shadcn_ui = require_rolldown_runtime.__toESM(__pixpilot_shadcn_ui);
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
11
15
|
|
|
12
16
|
//#region src/components/schema-field/schema-field.tsx
|
|
13
17
|
const defaultComponentRegistry = {
|
|
@@ -31,8 +35,18 @@ const defaultComponentRegistry = {
|
|
|
31
35
|
};
|
|
32
36
|
const defaultComponents = require_extract_components.extractComponents(defaultComponentRegistry);
|
|
33
37
|
const SchemaField = (0, __formily_react.createSchemaField)({ components: defaultComponents });
|
|
38
|
+
const JsonSchemaField = (props) => {
|
|
39
|
+
const { components, schema,...rest } = props;
|
|
40
|
+
const { formSchema, SchemaField: SchemaFieldComponent } = require_use_form_schema.useFormSchema(schema, require_use_merged_schema_components.useMergedSchemaComponents(defaultComponentRegistry, components));
|
|
41
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SchemaFieldComponent, {
|
|
42
|
+
...rest,
|
|
43
|
+
schema: formSchema
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
JsonSchemaField.displayName = "JsonSchemaField";
|
|
34
47
|
|
|
35
48
|
//#endregion
|
|
49
|
+
exports.JsonSchemaField = JsonSchemaField;
|
|
36
50
|
exports.SchemaField = SchemaField;
|
|
37
51
|
exports.defaultComponentRegistry = defaultComponentRegistry;
|
|
38
52
|
exports.defaultComponents = defaultComponents;
|
|
@@ -4,9 +4,12 @@ import { Column } from "../column.cjs";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.cjs";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.cjs";
|
|
6
6
|
import "../form-item/index.cjs";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.cjs";
|
|
8
|
+
import "../json-schema-form-renderer/index.cjs";
|
|
7
9
|
import { Row } from "../row.cjs";
|
|
8
10
|
import { ObjectContainerProps } from "../object-container.cjs";
|
|
9
11
|
import * as _formily_react11 from "@formily/react";
|
|
12
|
+
import { ISchema } from "@formily/react";
|
|
10
13
|
import * as react558 from "react";
|
|
11
14
|
import * as _formily_core0 from "@formily/core";
|
|
12
15
|
import * as _pixpilot_shadcn_ui269 from "@pixpilot/shadcn-ui";
|
|
@@ -517,5 +520,10 @@ declare const SchemaField: {
|
|
|
517
520
|
displayName: string;
|
|
518
521
|
};
|
|
519
522
|
};
|
|
523
|
+
type SchemaFieldDefaultProps = Omit<React.ComponentProps<typeof SchemaField>, 'components'> & {
|
|
524
|
+
components?: JsonSchemaFormComponents;
|
|
525
|
+
schema: ISchema;
|
|
526
|
+
};
|
|
527
|
+
declare const JsonSchemaField: React.FC<SchemaFieldDefaultProps>;
|
|
520
528
|
//#endregion
|
|
521
|
-
export { SchemaField, defaultComponentRegistry, defaultComponents };
|
|
529
|
+
export { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents };
|
|
@@ -4,9 +4,12 @@ import { Column } from "../column.js";
|
|
|
4
4
|
import { FormGrid } from "../form-grid.js";
|
|
5
5
|
import { FormItemProps } from "../form-item/form-item-types.js";
|
|
6
6
|
import "../form-item/index.js";
|
|
7
|
+
import { JsonSchemaFormComponents } from "../json-schema-form-renderer/types.js";
|
|
8
|
+
import "../json-schema-form-renderer/index.js";
|
|
7
9
|
import { Row } from "../row.js";
|
|
8
10
|
import { ObjectContainerProps } from "../object-container.js";
|
|
9
11
|
import * as _formily_react11 from "@formily/react";
|
|
12
|
+
import { ISchema } from "@formily/react";
|
|
10
13
|
import * as react558 from "react";
|
|
11
14
|
import * as _pixpilot_shadcn_ui269 from "@pixpilot/shadcn-ui";
|
|
12
15
|
import { TagsInput } from "@pixpilot/shadcn-ui";
|
|
@@ -517,5 +520,10 @@ declare const SchemaField: {
|
|
|
517
520
|
displayName: string;
|
|
518
521
|
};
|
|
519
522
|
};
|
|
523
|
+
type SchemaFieldDefaultProps = Omit<React.ComponentProps<typeof SchemaField>, 'components'> & {
|
|
524
|
+
components?: JsonSchemaFormComponents;
|
|
525
|
+
schema: ISchema;
|
|
526
|
+
};
|
|
527
|
+
declare const JsonSchemaField: React.FC<SchemaFieldDefaultProps>;
|
|
520
528
|
//#endregion
|
|
521
|
-
export { SchemaField, defaultComponentRegistry, defaultComponents };
|
|
529
|
+
export { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { useMergedSchemaComponents } from "../../hooks/use-merged-schema-components.js";
|
|
1
2
|
import { Combobox as Combobox$1 } from "../combobox.js";
|
|
2
3
|
import { extractComponents } from "../../utils/extract-components.js";
|
|
4
|
+
import { useFormSchema } from "../../hooks/use-form-schema.js";
|
|
3
5
|
import { Slider as Slider$1 } from "../slider.js";
|
|
4
6
|
import { TagsInputInLine } from "../tags-input-inline.js";
|
|
5
7
|
import { basicComponentRegistry } from "./schema-field-basics.js";
|
|
6
8
|
import { createSchemaField } from "@formily/react";
|
|
7
9
|
import { TagsInput } from "@pixpilot/shadcn-ui";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
11
|
|
|
9
12
|
//#region src/components/schema-field/schema-field.tsx
|
|
10
13
|
const defaultComponentRegistry = {
|
|
@@ -28,6 +31,15 @@ const defaultComponentRegistry = {
|
|
|
28
31
|
};
|
|
29
32
|
const defaultComponents = extractComponents(defaultComponentRegistry);
|
|
30
33
|
const SchemaField = createSchemaField({ components: defaultComponents });
|
|
34
|
+
const JsonSchemaField = (props) => {
|
|
35
|
+
const { components, schema,...rest } = props;
|
|
36
|
+
const { formSchema, SchemaField: SchemaFieldComponent } = useFormSchema(schema, useMergedSchemaComponents(defaultComponentRegistry, components));
|
|
37
|
+
return /* @__PURE__ */ jsx(SchemaFieldComponent, {
|
|
38
|
+
...rest,
|
|
39
|
+
schema: formSchema
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
JsonSchemaField.displayName = "JsonSchemaField";
|
|
31
43
|
|
|
32
44
|
//#endregion
|
|
33
|
-
export { SchemaField, defaultComponentRegistry, defaultComponents };
|
|
45
|
+
export { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react14 from "react";
|
|
2
2
|
import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
|
|
3
3
|
|
|
4
4
|
//#region src/components/separator.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_separator0 from "@radix-ui/react-separator";
|
|
|
6
6
|
* Formily-connected Separator component
|
|
7
7
|
* A visual divider for content sections
|
|
8
8
|
*/
|
|
9
|
-
declare const Separator:
|
|
9
|
+
declare const Separator: react14.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react14.RefAttributes<HTMLDivElement>>, "ref"> & react14.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react17 from "react";
|
|
2
2
|
import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/slider.d.ts
|
|
@@ -7,6 +7,6 @@ import { SliderProps } from "@pixpilot/shadcn-ui";
|
|
|
7
7
|
* Formily-connected Slider component
|
|
8
8
|
* Range input for selecting numeric values
|
|
9
9
|
*/
|
|
10
|
-
declare const Slider$1:
|
|
10
|
+
declare const Slider$1: react17.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react17.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { Slider$1 as Slider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react19 from "react";
|
|
2
2
|
import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
|
|
3
3
|
|
|
4
4
|
//#region src/components/switch.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_switch0 from "@radix-ui/react-switch";
|
|
|
6
6
|
* Formily-connected Switch component
|
|
7
7
|
* Toggle switch for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const Switch:
|
|
9
|
+
declare const Switch: react19.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react19.RefAttributes<HTMLButtonElement>>, "ref"> & react19.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
const require_use_description = require('./use-description.cjs');
|
|
2
2
|
const require_use_form_context = require('./use-form-context.cjs');
|
|
3
3
|
const require_use_label = require('./use-label.cjs');
|
|
4
|
+
const require_use_merged_schema_components = require('./use-merged-schema-components.cjs');
|
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_extract_fields_decorators = require('../utils/extract-fields-decorators.cjs');
|
|
3
|
+
const require_transform_schema = require('../utils/transform-schema.cjs');
|
|
4
|
+
require('../utils/index.cjs');
|
|
5
|
+
const require_use_schema_field = require('./use-schema-field.cjs');
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
|
|
9
|
+
//#region src/hooks/use-form-schema.ts
|
|
10
|
+
function useFormSchema(schema, componentsProp) {
|
|
11
|
+
const formSchema = (0, react.useMemo)(() => {
|
|
12
|
+
return require_transform_schema.transformSchema(schema, require_extract_fields_decorators.extractFieldsDecorators(componentsProp?.fields));
|
|
13
|
+
}, [schema, componentsProp]);
|
|
14
|
+
return {
|
|
15
|
+
formSchema,
|
|
16
|
+
SchemaField: require_use_schema_field.useSchemaField(formSchema, componentsProp)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.useFormSchema = useFormSchema;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { extractFieldsDecorators } from "../utils/extract-fields-decorators.js";
|
|
2
|
+
import { transformSchema } from "../utils/transform-schema.js";
|
|
3
|
+
import "../utils/index.js";
|
|
4
|
+
import { useSchemaField } from "./use-schema-field.js";
|
|
5
|
+
import { useMemo } from "react";
|
|
6
|
+
|
|
7
|
+
//#region src/hooks/use-form-schema.ts
|
|
8
|
+
function useFormSchema(schema, componentsProp) {
|
|
9
|
+
const formSchema = useMemo(() => {
|
|
10
|
+
return transformSchema(schema, extractFieldsDecorators(componentsProp?.fields));
|
|
11
|
+
}, [schema, componentsProp]);
|
|
12
|
+
return {
|
|
13
|
+
formSchema,
|
|
14
|
+
SchemaField: useSchemaField(formSchema, componentsProp)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useFormSchema };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
|
|
5
|
+
//#region src/hooks/use-merged-schema-components.ts
|
|
6
|
+
/**
|
|
7
|
+
* Merges basic component registry with user-provided components.
|
|
8
|
+
* User-provided components will override basic components if the same key exists.
|
|
9
|
+
*
|
|
10
|
+
* @param basicRegistry - The basic component registry (e.g., basicComponentRegistry)
|
|
11
|
+
* @param userComponents - Optional user-provided components to merge/override
|
|
12
|
+
* @returns Merged component configuration
|
|
13
|
+
*/
|
|
14
|
+
function useMergedSchemaComponents(basicRegistry, userComponents) {
|
|
15
|
+
return (0, react.useMemo)(() => ({
|
|
16
|
+
fields: {
|
|
17
|
+
...basicRegistry,
|
|
18
|
+
...userComponents?.fields ?? {}
|
|
19
|
+
},
|
|
20
|
+
decorators: userComponents?.decorators
|
|
21
|
+
}), [
|
|
22
|
+
basicRegistry,
|
|
23
|
+
userComponents?.decorators,
|
|
24
|
+
userComponents?.fields
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.useMergedSchemaComponents = useMergedSchemaComponents;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/use-merged-schema-components.ts
|
|
4
|
+
/**
|
|
5
|
+
* Merges basic component registry with user-provided components.
|
|
6
|
+
* User-provided components will override basic components if the same key exists.
|
|
7
|
+
*
|
|
8
|
+
* @param basicRegistry - The basic component registry (e.g., basicComponentRegistry)
|
|
9
|
+
* @param userComponents - Optional user-provided components to merge/override
|
|
10
|
+
* @returns Merged component configuration
|
|
11
|
+
*/
|
|
12
|
+
function useMergedSchemaComponents(basicRegistry, userComponents) {
|
|
13
|
+
return useMemo(() => ({
|
|
14
|
+
fields: {
|
|
15
|
+
...basicRegistry,
|
|
16
|
+
...userComponents?.fields ?? {}
|
|
17
|
+
},
|
|
18
|
+
decorators: userComponents?.decorators
|
|
19
|
+
}), [
|
|
20
|
+
basicRegistry,
|
|
21
|
+
userComponents?.decorators,
|
|
22
|
+
userComponents?.fields
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { useMergedSchemaComponents };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_validate_schema_components = require('../utils/validate-schema-components.cjs');
|
|
3
|
+
require('../utils/index.cjs');
|
|
4
|
+
const require_extract_components = require('../utils/extract-components.cjs');
|
|
5
|
+
let __formily_react = require("@formily/react");
|
|
6
|
+
__formily_react = require_rolldown_runtime.__toESM(__formily_react);
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
9
|
+
let __pixpilot_env_is_dev = require("@pixpilot/env/is-dev");
|
|
10
|
+
__pixpilot_env_is_dev = require_rolldown_runtime.__toESM(__pixpilot_env_is_dev);
|
|
11
|
+
|
|
12
|
+
//#region src/hooks/use-schema-field.ts
|
|
13
|
+
function useSchemaField(formSchema, componentsProp) {
|
|
14
|
+
return react.default.useMemo(() => {
|
|
15
|
+
const componentConfigs = { ...componentsProp?.fields ?? {} };
|
|
16
|
+
if (componentsProp?.decorators) Object.entries(componentsProp.decorators).forEach(([key, decorator]) => {
|
|
17
|
+
componentConfigs[key] = { component: decorator };
|
|
18
|
+
});
|
|
19
|
+
const components = require_extract_components.extractComponents(componentConfigs);
|
|
20
|
+
if ((0, __pixpilot_env_is_dev.isDevelopment)()) require_validate_schema_components.validateSchemaComponents(formSchema, components);
|
|
21
|
+
return (0, __formily_react.createSchemaField)({
|
|
22
|
+
components,
|
|
23
|
+
scope: {}
|
|
24
|
+
});
|
|
25
|
+
}, [formSchema, componentsProp]);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.useSchemaField = useSchemaField;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { validateSchemaComponents } from "../utils/validate-schema-components.js";
|
|
2
|
+
import "../utils/index.js";
|
|
3
|
+
import { extractComponents } from "../utils/extract-components.js";
|
|
4
|
+
import { createSchemaField } from "@formily/react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { isDevelopment } from "@pixpilot/env/is-dev";
|
|
7
|
+
|
|
8
|
+
//#region src/hooks/use-schema-field.ts
|
|
9
|
+
function useSchemaField(formSchema, componentsProp) {
|
|
10
|
+
return React.useMemo(() => {
|
|
11
|
+
const componentConfigs = { ...componentsProp?.fields ?? {} };
|
|
12
|
+
if (componentsProp?.decorators) Object.entries(componentsProp.decorators).forEach(([key, decorator]) => {
|
|
13
|
+
componentConfigs[key] = { component: decorator };
|
|
14
|
+
});
|
|
15
|
+
const components = extractComponents(componentConfigs);
|
|
16
|
+
if (isDevelopment()) validateSchemaComponents(formSchema, components);
|
|
17
|
+
return createSchemaField({
|
|
18
|
+
components,
|
|
19
|
+
scope: {}
|
|
20
|
+
});
|
|
21
|
+
}, [formSchema, componentsProp]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useSchemaField };
|
package/dist/index.cjs
CHANGED
|
@@ -79,6 +79,9 @@ Object.defineProperty(exports, 'FormProvider', {
|
|
|
79
79
|
});
|
|
80
80
|
exports.IconPicker = require_icon_picker.IconPicker;
|
|
81
81
|
exports.Input = require_input.Input;
|
|
82
|
+
exports.JsonSchemaField = require_schema_field.JsonSchemaField;
|
|
83
|
+
exports.JsonSchemaFieldBasics = require_schema_field_basics.JsonSchemaFieldBasics;
|
|
84
|
+
exports.JsonSchemaFieldExtended = require_schema_field_extended.JsonSchemaFieldExtended;
|
|
82
85
|
exports.JsonSchemaForm = require_json_schema_form.JsonSchemaForm;
|
|
83
86
|
exports.JsonSchemaFormBasic = require_json_schema_form_basic.JsonSchemaFormBasic;
|
|
84
87
|
exports.JsonSchemaFormExtended = require_json_schema_form_extended.JsonSchemaFormExtended;
|
package/dist/index.d.cts
CHANGED
|
@@ -31,9 +31,9 @@ import { NumberInput } from "./components/number-input.cjs";
|
|
|
31
31
|
import { ConnectedRadio, Radio } from "./components/radio.cjs";
|
|
32
32
|
import { RichTextEditor } from "./components/rich-text-editor.cjs";
|
|
33
33
|
import { Row } from "./components/row.cjs";
|
|
34
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.cjs";
|
|
35
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.cjs";
|
|
36
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.cjs";
|
|
34
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.cjs";
|
|
35
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.cjs";
|
|
36
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.cjs";
|
|
37
37
|
import "./components/schema-field/index.cjs";
|
|
38
38
|
import { Select } from "./components/select.cjs";
|
|
39
39
|
import { Separator } from "./components/separator.cjs";
|
|
@@ -45,4 +45,4 @@ import { transformSchema } from "./utils/transform-schema.cjs";
|
|
|
45
45
|
import "./utils/index.cjs";
|
|
46
46
|
import { Field, FormConsumer, FormProvider, ISchema, ObjectField, VoidField } from "@formily/react";
|
|
47
47
|
import { Form as IForm, createForm } from "@formily/core";
|
|
48
|
-
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
48
|
+
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,9 +31,9 @@ import { NumberInput } from "./components/number-input.js";
|
|
|
31
31
|
import { ConnectedRadio, Radio } from "./components/radio.js";
|
|
32
32
|
import { RichTextEditor } from "./components/rich-text-editor.js";
|
|
33
33
|
import { Row } from "./components/row.js";
|
|
34
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.js";
|
|
35
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.js";
|
|
36
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.js";
|
|
34
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.js";
|
|
35
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.js";
|
|
36
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.js";
|
|
37
37
|
import "./components/schema-field/index.js";
|
|
38
38
|
import { Select } from "./components/select.js";
|
|
39
39
|
import { Separator } from "./components/separator.js";
|
|
@@ -45,4 +45,4 @@ import { transformSchema } from "./utils/transform-schema.js";
|
|
|
45
45
|
import "./utils/index.js";
|
|
46
46
|
import { Field, FormConsumer, FormProvider, ISchema, ObjectField, VoidField } from "@formily/react";
|
|
47
47
|
import { Form as IForm, createForm } from "@formily/core";
|
|
48
|
-
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
48
|
+
export { ArrayBase, type ArrayBaseMixins, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, type FormLayoutOptions, FormProvider, type IArrayBaseOperationProps, type IArrayBaseProps, type IForm, type ISchema, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormComponent, JsonSchemaFormComponents, JsonSchemaFormExtended, JsonSchemaFormProps, JsonSchemaFormRenderer, JsonSchemaFormRendererProps, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/dist/index.js
CHANGED
|
@@ -29,10 +29,10 @@ import { Select } from "./components/select.js";
|
|
|
29
29
|
import { Separator } from "./components/separator.js";
|
|
30
30
|
import { Switch } from "./components/switch.js";
|
|
31
31
|
import { Textarea } from "./components/textarea.js";
|
|
32
|
-
import { SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.js";
|
|
33
|
-
import { SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.js";
|
|
32
|
+
import { JsonSchemaFieldBasics, SchemaFieldBasics, basicComponentRegistry, basicComponents } from "./components/schema-field/schema-field-basics.js";
|
|
33
|
+
import { JsonSchemaField, SchemaField, defaultComponentRegistry, defaultComponents } from "./components/schema-field/schema-field.js";
|
|
34
34
|
import { RichTextEditor } from "./components/rich-text-editor.js";
|
|
35
|
-
import { SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.js";
|
|
35
|
+
import { JsonSchemaFieldExtended, SchemaFieldExtended, extendedComponentRegistry, extendedComponents } from "./components/schema-field/schema-field-extended.js";
|
|
36
36
|
import "./components/schema-field/index.js";
|
|
37
37
|
import { JsonSchemaFormRenderer } from "./components/json-schema-form-renderer/json-schema-form-renderer.js";
|
|
38
38
|
import { JsonSchemaForm } from "./components/json-schema-form-renderer/json-schema-form.js";
|
|
@@ -42,4 +42,4 @@ import "./components/json-schema-form-renderer/index.js";
|
|
|
42
42
|
import { Field, FormConsumer, FormProvider, ObjectField, VoidField } from "@formily/react";
|
|
43
43
|
import { createForm } from "@formily/core";
|
|
44
44
|
|
|
45
|
-
export { ArrayBase, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, FormProvider, IconPicker, Input, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormExtended, JsonSchemaFormRenderer, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
|
45
|
+
export { ArrayBase, ArrayCards, ArrayCollapse, AvatarUpload, Checkbox, Column, Combobox, ConnectedRadio, DatePicker, Field, FileUpload, FileUploadInline, Form, FormConsumer, FormGrid, FormItem, FormProvider, IconPicker, Input, JsonSchemaField, JsonSchemaFieldBasics, JsonSchemaFieldExtended, JsonSchemaForm, JsonSchemaFormBasic, JsonSchemaFormExtended, JsonSchemaFormRenderer, NumberInput, ObjectField, Radio, RichTextEditor, Row, SchemaField, SchemaFieldBasics, SchemaFieldExtended, Select, Separator, Slider, Switch, TagsInputInLine, Textarea, VoidField, basicComponentRegistry, basicComponents, createForm, defaultComponentRegistry, defaultComponents, extendedComponentRegistry, extendedComponents, transformSchema };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/formily-shadcn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.2",
|
|
5
5
|
"description": "Formily integration for shadcn/ui components",
|
|
6
6
|
"author": "m.doaie <m.doaie@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"json-schema-traverse": "^1.0.0",
|
|
41
41
|
"lucide-react": "^0.554.0",
|
|
42
42
|
"pretty-bytes": "^7.1.0",
|
|
43
|
-
"@pixpilot/shadcn
|
|
44
|
-
"@pixpilot/shadcn": "0.
|
|
43
|
+
"@pixpilot/shadcn": "0.4.0",
|
|
44
|
+
"@pixpilot/shadcn-ui": "0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@storybook/react": "^10.1.8",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"react-dom": "19.2.0",
|
|
55
55
|
"tsdown": "^0.15.12",
|
|
56
56
|
"typescript": "^5.9.3",
|
|
57
|
-
"@internal/prettier-config": "0.0.1",
|
|
58
57
|
"@internal/eslint-config": "0.3.0",
|
|
58
|
+
"@internal/prettier-config": "0.0.1",
|
|
59
59
|
"@internal/tsconfig": "0.1.0",
|
|
60
60
|
"@internal/tsdown-config": "0.1.0",
|
|
61
61
|
"@internal/vitest-config": "0.1.0"
|