@pixpilot/formily-shadcn 0.14.1 → 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/form-grid.d.cts +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/form.d.cts +2 -2
- package/dist/components/icon-picker.d.cts +3 -3
- package/dist/components/input.d.cts +2 -2
- package/dist/components/number-input.d.cts +2 -2
- package/dist/components/separator.d.cts +2 -2
- package/dist/components/slider.d.cts +2 -2
- package/dist/components/switch.d.cts +2 -2
- package/dist/components/tags-input-inline.d.cts +2 -2
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -2,7 +2,7 @@ import { FormContextStates } from "./context/form-context.cjs";
|
|
|
2
2
|
import "./context/index.cjs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Form } from "@formily/core";
|
|
5
|
-
import * as
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/components/form.d.ts
|
|
8
8
|
interface IFormProps extends FormContextStates {
|
|
@@ -25,6 +25,6 @@ declare function Form$1({
|
|
|
25
25
|
onAutoSubmit,
|
|
26
26
|
layout,
|
|
27
27
|
settings
|
|
28
|
-
}: IFormProps):
|
|
28
|
+
}: IFormProps): react_jsx_runtime0.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Form$1 as Form };
|
|
@@ -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
|
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/number-input.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formily-connected Number Input component
|
|
6
6
|
*/
|
|
7
|
-
declare const NumberInput:
|
|
7
|
+
declare const NumberInput: react10.ForwardRefExoticComponent<Omit<Partial<react10.ClassAttributes<HTMLInputElement> & react10.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react10.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { NumberInput };
|
|
@@ -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:
|
|
10
|
+
declare const Slider: react17.ForwardRefExoticComponent<Omit<Partial<SliderProps>, "ref"> & react17.RefAttributes<unknown>>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react22 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/tags-input-inline.d.ts
|
|
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
|
10
10
|
* Based on DiceUI's tags-input for inline tag editing with keyboard navigation
|
|
11
11
|
* and validation support.
|
|
12
12
|
*/
|
|
13
|
-
declare const TagsInputInLine:
|
|
13
|
+
declare const TagsInputInLine: react22.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.TagsInputProps> & react22.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|