@pixpilot/formily-shadcn 1.9.1 → 1.10.0
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.d.ts +2 -2
- package/dist/components/FormGrid.d.ts +2 -2
- package/dist/components/IconPicker.d.ts +3 -3
- package/dist/components/IconToggle.d.ts +2 -2
- package/dist/components/Input.d.ts +3 -3
- package/dist/components/Radio.d.ts +2 -2
- package/dist/components/Rating.d.ts +4 -4
- package/dist/components/TagsInputInline.d.ts +3 -3
- package/dist/components/Textarea.d.ts +2 -2
- package/dist/components/ToggleButton.d.ts +3 -3
- package/dist/components/file-upload/AvatarUpload.cjs +1 -1
- package/dist/components/file-upload/AvatarUpload.js +1 -1
- package/dist/components/file-upload/FileUploadInline.cjs +1 -1
- package/dist/components/file-upload/FileUploadInline.js +1 -1
- package/dist/components/file-upload/map-upload-props.cjs +11 -6
- package/dist/components/file-upload/map-upload-props.js +11 -6
- package/dist/components/number/NumberInput.d.ts +3 -3
- package/dist/components/schema-field/schema-field-basics.d.ts +287 -287
- package/dist/components/schema-field/schema-field-extended.d.ts +463 -463
- package/dist/components/schema-field/schema-field.d.ts +397 -397
- package/dist/components/slider/Slider.d.ts +3 -3
- package/dist/components/slider/SliderInput.d.ts +3 -3
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormContextStates } from "./context/form-context.js";
|
|
2
2
|
import "./context/index.js";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
5
5
|
import { Form } from "@formily/core";
|
|
6
6
|
|
|
7
7
|
//#region src/components/Form.d.ts
|
|
@@ -25,6 +25,6 @@ declare function Form$1({
|
|
|
25
25
|
onAutoSubmit,
|
|
26
26
|
layout,
|
|
27
27
|
settings
|
|
28
|
-
}: IFormProps):
|
|
28
|
+
}: IFormProps): react_jsx_runtime1.JSX.Element;
|
|
29
29
|
//#endregion
|
|
30
30
|
export { Form$1 as Form };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/FormGrid.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_runtime2.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { FormGrid };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react7 from "react";
|
|
2
2
|
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/IconPicker.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: react7.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react7.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { IconPicker$1 as IconPicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react9 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/IconToggle.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
|
6
6
|
* Formily-connected IconToggle component
|
|
7
7
|
* Toggle button with customizable icons for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const IconToggle$1:
|
|
9
|
+
declare const IconToggle$1: react9.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react9.RefAttributes<HTMLButtonElement>>, "ref"> & react9.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { IconToggle$1 as IconToggle };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react12 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Input.d.ts
|
|
4
4
|
|
|
@@ -6,12 +6,12 @@ import * as react9 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: react12.ForwardRefExoticComponent<Omit<Partial<react12.ClassAttributes<HTMLInputElement> & react12.InputHTMLAttributes<HTMLInputElement> & {
|
|
10
10
|
prefix?: React.ReactNode;
|
|
11
11
|
suffix?: React.ReactNode;
|
|
12
12
|
groupClassName?: string;
|
|
13
13
|
prefixClassName?: string;
|
|
14
14
|
suffixClassName?: string;
|
|
15
|
-
}>, "ref"> &
|
|
15
|
+
}>, "ref"> & react12.RefAttributes<unknown>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { Input };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 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_runtime0.JSX.Element;
|
|
19
19
|
declare namespace Radio {
|
|
20
20
|
var displayName: string;
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react4 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Rating.d.ts
|
|
@@ -6,8 +6,8 @@ import * as _pixpilot_shadcn_ui0 from "@pixpilot/shadcn-ui";
|
|
|
6
6
|
* Formily-connected Rating component
|
|
7
7
|
* Automatically connects shadcn-ui Rating to Formily field state
|
|
8
8
|
*/
|
|
9
|
-
declare const Rating$1:
|
|
10
|
-
children?:
|
|
11
|
-
}> &
|
|
9
|
+
declare const Rating$1: react4.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.RatingProps & {
|
|
10
|
+
children?: react4.ReactNode | undefined;
|
|
11
|
+
}> & react4.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Rating$1 as Rating };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react29 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TagsInputInline.d.ts
|
|
5
5
|
|
|
@@ -10,6 +10,6 @@ import * as _pixpilot_shadcn_ui1 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: react29.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui2.TagsInputProps> & react29.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react22 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/Textarea.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formily-connected Textarea component
|
|
6
6
|
*/
|
|
7
|
-
declare const Textarea:
|
|
7
|
+
declare const Textarea: react22.ForwardRefExoticComponent<Omit<Partial<react22.ClassAttributes<HTMLTextAreaElement> & react22.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react22.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react26 from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ToggleButton.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Formily-connected IconToggle component
|
|
7
7
|
* Toggle button with customizable icons for boolean values
|
|
8
8
|
*/
|
|
9
|
-
declare const ToggleButton$1:
|
|
9
|
+
declare const ToggleButton$1: react26.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui1.ToggleButtonProps, "ref"> & react26.RefAttributes<HTMLButtonElement>>, "ref"> & react26.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ToggleButton$1 as ToggleButton };
|
|
@@ -26,7 +26,7 @@ const BaseAvatarUpload = (props) => {
|
|
|
26
26
|
* Formily-connected AvatarUpload component
|
|
27
27
|
* Automatically connects shadcn AvatarUpload to Formily field state
|
|
28
28
|
*/
|
|
29
|
-
const AvatarUpload = (0, __formily_react.connect)(BaseAvatarUpload, (0, __formily_react.mapProps)((props, field) => require_map_upload_props.mapUploadProps(props, field)));
|
|
29
|
+
const AvatarUpload = (0, __formily_react.connect)(BaseAvatarUpload, (0, __formily_react.mapProps)((props, field) => require_map_upload_props.mapUploadProps(props, field, { forceSingle: true })));
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
32
|
exports.AvatarUpload = AvatarUpload;
|
|
@@ -21,7 +21,7 @@ const BaseAvatarUpload = (props) => {
|
|
|
21
21
|
* Formily-connected AvatarUpload component
|
|
22
22
|
* Automatically connects shadcn AvatarUpload to Formily field state
|
|
23
23
|
*/
|
|
24
|
-
const AvatarUpload$1 = connect(BaseAvatarUpload, mapProps((props, field) => mapUploadProps(props, field)));
|
|
24
|
+
const AvatarUpload$1 = connect(BaseAvatarUpload, mapProps((props, field) => mapUploadProps(props, field, { forceSingle: true })));
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { AvatarUpload$1 as AvatarUpload };
|
|
@@ -26,7 +26,7 @@ const BaseFileUploadInline = (props) => {
|
|
|
26
26
|
* Formily-connected FileUploadInline component
|
|
27
27
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
28
28
|
*/
|
|
29
|
-
const FileUploadInline = (0, __formily_react.connect)(BaseFileUploadInline, (0, __formily_react.mapProps)((props, field) => require_map_upload_props.mapUploadProps(props, field)));
|
|
29
|
+
const FileUploadInline = (0, __formily_react.connect)(BaseFileUploadInline, (0, __formily_react.mapProps)((props, field) => require_map_upload_props.mapUploadProps(props, field, { forceSingle: props.multiple !== true })));
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
32
32
|
exports.FileUploadInline = FileUploadInline;
|
|
@@ -21,7 +21,7 @@ const BaseFileUploadInline = (props) => {
|
|
|
21
21
|
* Formily-connected FileUploadInline component
|
|
22
22
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
23
23
|
*/
|
|
24
|
-
const FileUploadInline$1 = connect(BaseFileUploadInline, mapProps((props, field) => mapUploadProps(props, field)));
|
|
24
|
+
const FileUploadInline$1 = connect(BaseFileUploadInline, mapProps((props, field) => mapUploadProps(props, field, { forceSingle: props.multiple !== true })));
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
27
|
export { FileUploadInline$1 as FileUploadInline };
|
|
@@ -30,24 +30,29 @@
|
|
|
30
30
|
*/
|
|
31
31
|
function mapUploadProps(props, field, options) {
|
|
32
32
|
const { onFileSuccess, onFileError, mapValue,...restProps } = props;
|
|
33
|
-
const
|
|
33
|
+
const { multiple } = props;
|
|
34
|
+
const isSingle = multiple !== true && (options?.forceSingle === true || multiple === false);
|
|
34
35
|
const baseValue = field.value ?? null;
|
|
35
36
|
const value = mapValue ? mapValue(baseValue) : baseValue;
|
|
37
|
+
const currentMultipleFiles = (() => {
|
|
38
|
+
const currentValue = field.value;
|
|
39
|
+
if (Array.isArray(currentValue)) return currentValue;
|
|
40
|
+
if (currentValue == null) return [];
|
|
41
|
+
return [currentValue];
|
|
42
|
+
})();
|
|
36
43
|
return {
|
|
37
44
|
...restProps,
|
|
38
45
|
value,
|
|
39
46
|
onChange: (newValue) => {
|
|
40
47
|
if (newValue === null) field.setValue(null);
|
|
41
48
|
else if (Array.isArray(newValue)) {
|
|
42
|
-
const currentLen =
|
|
49
|
+
const currentLen = currentMultipleFiles.length;
|
|
43
50
|
if (newValue.length <= currentLen) field.setValue(newValue);
|
|
44
51
|
}
|
|
45
52
|
},
|
|
46
53
|
onFileSuccess: (fileMeta) => {
|
|
47
|
-
if (!isSingle)
|
|
48
|
-
|
|
49
|
-
field.setValue([...current, fileMeta]);
|
|
50
|
-
} else field.setValue(fileMeta);
|
|
54
|
+
if (!isSingle) field.setValue([...currentMultipleFiles, fileMeta]);
|
|
55
|
+
else field.setValue(fileMeta);
|
|
51
56
|
onFileSuccess?.(fileMeta);
|
|
52
57
|
},
|
|
53
58
|
onFileError: (file, error) => {
|
|
@@ -29,24 +29,29 @@
|
|
|
29
29
|
*/
|
|
30
30
|
function mapUploadProps(props, field, options) {
|
|
31
31
|
const { onFileSuccess, onFileError, mapValue,...restProps } = props;
|
|
32
|
-
const
|
|
32
|
+
const { multiple } = props;
|
|
33
|
+
const isSingle = multiple !== true && (options?.forceSingle === true || multiple === false);
|
|
33
34
|
const baseValue = field.value ?? null;
|
|
34
35
|
const value = mapValue ? mapValue(baseValue) : baseValue;
|
|
36
|
+
const currentMultipleFiles = (() => {
|
|
37
|
+
const currentValue = field.value;
|
|
38
|
+
if (Array.isArray(currentValue)) return currentValue;
|
|
39
|
+
if (currentValue == null) return [];
|
|
40
|
+
return [currentValue];
|
|
41
|
+
})();
|
|
35
42
|
return {
|
|
36
43
|
...restProps,
|
|
37
44
|
value,
|
|
38
45
|
onChange: (newValue) => {
|
|
39
46
|
if (newValue === null) field.setValue(null);
|
|
40
47
|
else if (Array.isArray(newValue)) {
|
|
41
|
-
const currentLen =
|
|
48
|
+
const currentLen = currentMultipleFiles.length;
|
|
42
49
|
if (newValue.length <= currentLen) field.setValue(newValue);
|
|
43
50
|
}
|
|
44
51
|
},
|
|
45
52
|
onFileSuccess: (fileMeta) => {
|
|
46
|
-
if (!isSingle)
|
|
47
|
-
|
|
48
|
-
field.setValue([...current, fileMeta]);
|
|
49
|
-
} else field.setValue(fileMeta);
|
|
53
|
+
if (!isSingle) field.setValue([...currentMultipleFiles, fileMeta]);
|
|
54
|
+
else field.setValue(fileMeta);
|
|
50
55
|
onFileSuccess?.(fileMeta);
|
|
51
56
|
},
|
|
52
57
|
onFileError: (file, error) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react1879 from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/number/NumberInput.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Formily-connected Number Input component
|
|
6
6
|
*/
|
|
7
|
-
declare const NumberInput:
|
|
7
|
+
declare const NumberInput: react1879.ForwardRefExoticComponent<Omit<Partial<react1879.ClassAttributes<HTMLInputElement> & react1879.InputHTMLAttributes<HTMLInputElement> & {
|
|
8
8
|
prefix?: React.ReactNode;
|
|
9
9
|
suffix?: React.ReactNode;
|
|
10
10
|
groupClassName?: string;
|
|
11
11
|
prefixClassName?: string;
|
|
12
12
|
suffixClassName?: string;
|
|
13
|
-
}>, "ref"> &
|
|
13
|
+
}>, "ref"> & react1879.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { NumberInput };
|