@pixpilot/formily-shadcn 1.10.7 → 1.10.8
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/Checkbox.d.ts +2 -2
- package/dist/components/DatePicker.d.ts +3 -3
- package/dist/components/IconPicker.d.cts +3 -3
- package/dist/components/IconPicker.d.ts +3 -3
- package/dist/components/IconToggle.d.cts +2 -2
- package/dist/components/Radio.d.ts +2 -2
- package/dist/components/Rating.d.ts +4 -4
- package/dist/components/Row.d.cts +2 -2
- package/dist/components/Row.d.ts +2 -2
- package/dist/components/Separator.d.ts +2 -2
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/TagsInputInline.d.cts +3 -3
- package/dist/components/TagsInputInline.d.ts +2 -2
- package/dist/components/Textarea.d.cts +2 -2
- package/dist/components/Textarea.d.ts +2 -2
- package/dist/components/ToggleButton.d.cts +3 -3
- package/dist/components/ToggleButton.d.ts +2 -2
- package/dist/components/array-tags/ArrayTags.d.cts +2 -2
- package/dist/components/context/types.d.cts +3 -1
- package/dist/components/context/types.d.ts +3 -1
- package/dist/components/file-upload/index.cjs +2 -0
- package/dist/components/file-upload/index.d.cts +6 -3
- package/dist/components/file-upload/index.d.ts +6 -4
- package/dist/components/file-upload/index.js +2 -0
- package/dist/components/file-upload/map-upload-props.d.cts +43 -2
- package/dist/components/file-upload/map-upload-props.d.ts +43 -2
- package/dist/components/file-upload/types.d.cts +9 -0
- package/dist/components/file-upload/types.d.ts +9 -0
- package/dist/components/file-upload/use-file-upload-feedback.d.cts +14 -0
- package/dist/components/file-upload/use-file-upload-feedback.d.ts +14 -0
- package/dist/components/form-item/ConnectedFormItem.d.cts +4 -4
- package/dist/components/number/NumberInput.d.cts +3 -3
- package/dist/components/schema-field/schema-field-basics.d.cts +303 -303
- package/dist/components/schema-field/schema-field-extended.d.cts +501 -501
- package/dist/components/schema-field/schema-field.d.cts +412 -412
- package/dist/components/slider/Slider.d.cts +3 -3
- package/dist/components/slider/SliderInput.d.cts +3 -3
- package/dist/components/slider/SliderSelect.d.cts +2 -2
- package/dist/index.cjs +5 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +3 -1
- package/dist/utils/resolve-field-options.d.cts +1 -1
- package/dist/utils/resolve-field-options.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 from "react";
|
|
2
2
|
import * as _radix_ui_react_checkbox0 from "@radix-ui/react-checkbox";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Checkbox.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _radix_ui_react_checkbox0 from "@radix-ui/react-checkbox";
|
|
|
6
6
|
* Formily-connected Checkbox component
|
|
7
7
|
* Maps Formily field checked state to shadcn Checkbox
|
|
8
8
|
*/
|
|
9
|
-
declare const Checkbox:
|
|
9
|
+
declare const Checkbox: react0.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_checkbox0.CheckboxProps & react0.RefAttributes<HTMLButtonElement>>, "ref"> & react0.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Checkbox };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import { DatePickerProps } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/DatePicker.d.ts
|
|
5
|
-
declare const DatePicker$1:
|
|
5
|
+
declare const DatePicker$1: react2.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
9
|
-
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> &
|
|
9
|
+
} & Omit<DatePickerProps, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { DatePicker$1 as DatePicker };
|
|
@@ -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/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:
|
|
11
|
+
declare const IconPicker: react4.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
12
|
providers?: IconProviderProps[];
|
|
13
|
-
}> &
|
|
13
|
+
}> & react4.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/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: 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 react6 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:
|
|
9
|
+
declare const IconToggle: react6.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui0.IconToggleProps, "ref"> & react6.RefAttributes<HTMLButtonElement>>, "ref"> & react6.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { IconToggle };
|
|
@@ -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
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react16 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: react16.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui0.RatingProps & {
|
|
10
|
+
children?: react16.ReactNode | undefined;
|
|
11
|
+
}> & react16.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Rating$1 as Rating };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 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_runtime4.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Row };
|
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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react13 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: react13.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react13.RefAttributes<HTMLDivElement>>, "ref"> & react13.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react21 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: react21.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react21.RefAttributes<HTMLButtonElement>>, "ref"> & react21.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react25 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: react25.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui2.TagsInputProps> & react25.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react19 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui1 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/TagsInputInline.d.ts
|
|
@@ -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: react19.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react19.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { TagsInputInLine };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react27 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: react27.ForwardRefExoticComponent<Omit<Partial<react27.ClassAttributes<HTMLTextAreaElement> & react27.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react27.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react27 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: react27.ForwardRefExoticComponent<Omit<Partial<react27.ClassAttributes<HTMLTextAreaElement> & react27.TextareaHTMLAttributes<HTMLTextAreaElement>>, "ref"> & react27.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { Textarea };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react22 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:
|
|
9
|
+
declare const ToggleButton: react22.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui1.ToggleButtonProps, "ref"> & react22.RefAttributes<HTMLButtonElement>>, "ref"> & react22.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ToggleButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react24 from "react";
|
|
2
2
|
import * as _pixpilot_shadcn_ui2 from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ToggleButton.d.ts
|
|
@@ -6,6 +6,6 @@ import * as _pixpilot_shadcn_ui2 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 ToggleButton$1:
|
|
9
|
+
declare const ToggleButton$1: react24.ForwardRefExoticComponent<Omit<Partial<Omit<_pixpilot_shadcn_ui2.ToggleButtonProps, "ref"> & react24.RefAttributes<HTMLButtonElement>>, "ref"> & react24.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ToggleButton$1 as ToggleButton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _formily_react0 from "@formily/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { TagsInputProps } from "@pixpilot/shadcn-ui";
|
|
4
4
|
|
|
@@ -54,6 +54,6 @@ interface ArrayTagsProps extends TagsInputProps {
|
|
|
54
54
|
* };
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
declare const ArrayTags: React.MemoExoticComponent<
|
|
57
|
+
declare const ArrayTags: React.MemoExoticComponent<_formily_react0.ReactFC<ArrayTagsProps>>;
|
|
58
58
|
//#endregion
|
|
59
59
|
export { ArrayTags, ArrayTagsProps };
|
|
@@ -2,7 +2,9 @@ import { ActionItem } from "../array-base/types.cjs";
|
|
|
2
2
|
import "../array-base/index.cjs";
|
|
3
3
|
import { FormSpace } from "../../types/form.cjs";
|
|
4
4
|
import { DescriptionPlacement, LabelPlacement } from "../../types/form-item.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { FormFileUploadOptions } from "../file-upload/types.cjs";
|
|
6
|
+
import "../file-upload/index.cjs";
|
|
7
|
+
import { DialogContentProps, IconProvider, PopoverContentProps, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
6
8
|
|
|
7
9
|
//#region src/components/context/types.d.ts
|
|
8
10
|
interface FomFileUpload {
|
|
@@ -2,7 +2,9 @@ import { ActionItem } from "../array-base/types.js";
|
|
|
2
2
|
import "../array-base/index.js";
|
|
3
3
|
import { FormSpace } from "../../types/form.js";
|
|
4
4
|
import { DescriptionPlacement, LabelPlacement } from "../../types/form-item.js";
|
|
5
|
-
import {
|
|
5
|
+
import { FormFileUploadOptions } from "../file-upload/types.js";
|
|
6
|
+
import "../file-upload/index.js";
|
|
7
|
+
import { DialogContentProps, IconProvider, PopoverContentProps, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
6
8
|
|
|
7
9
|
//#region src/components/context/types.d.ts
|
|
8
10
|
interface FomFileUpload {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const require_map_upload_props = require('./map-upload-props.cjs');
|
|
2
|
+
const require_use_file_upload_feedback = require('./use-file-upload-feedback.cjs');
|
|
1
3
|
const require_AvatarUpload = require('./AvatarUpload.cjs');
|
|
2
4
|
const require_FileUpload = require('./FileUpload.cjs');
|
|
3
5
|
const require_FileUploadInline = require('./FileUploadInline.cjs');
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { FormilyUploadProps, UploadFieldCallbacks, UploadValueMapper, mapUploadProps } from "./map-upload-props.cjs";
|
|
2
|
+
import { AvatarUpload, AvatarUploadProps } from "./AvatarUpload.cjs";
|
|
3
|
+
import { FileUpload, FileUploadProps } from "./FileUpload.cjs";
|
|
4
|
+
import { FileUploadInline, FileUploadInlineProps } from "./FileUploadInline.cjs";
|
|
5
|
+
import { FormFileUploadOptions } from "./types.cjs";
|
|
6
|
+
import { useFileUploadFeedback } from "./use-file-upload-feedback.cjs";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
1
|
+
import { FormilyUploadProps, UploadFieldCallbacks, UploadValueMapper, mapUploadProps } from "./map-upload-props.js";
|
|
2
|
+
import { AvatarUpload, AvatarUploadProps } from "./AvatarUpload.js";
|
|
3
|
+
import { FileUpload, FileUploadProps } from "./FileUpload.js";
|
|
4
|
+
import { FileUploadInline, FileUploadInlineProps } from "./FileUploadInline.js";
|
|
5
|
+
import { FormFileUploadOptions } from "./types.js";
|
|
6
|
+
import { useFileUploadFeedback } from "./use-file-upload-feedback.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { mapUploadProps } from "./map-upload-props.js";
|
|
2
|
+
import { useFileUploadFeedback } from "./use-file-upload-feedback.js";
|
|
1
3
|
import { AvatarUpload } from "./AvatarUpload.js";
|
|
2
4
|
import { FileUpload } from "./FileUpload.js";
|
|
3
5
|
import { FileUploadInline } from "./FileUploadInline.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@formily/core";
|
|
1
|
+
import { Field } from "@formily/core";
|
|
2
2
|
import { FileMetadata } from "@pixpilot/shadcn-ui";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/map-upload-props.d.ts
|
|
@@ -12,5 +12,46 @@ interface UploadValueMapper<TValue$1 extends SingleFileUploadValue = SingleFileU
|
|
|
12
12
|
type FormilyUploadProps<P> = P extends {
|
|
13
13
|
multiple: true;
|
|
14
14
|
} ? P : P & UploadValueMapper<ExtractSingleFileValue<P>>;
|
|
15
|
+
/**
|
|
16
|
+
* Callbacks that the shadcn upload components expose at the single-file level.
|
|
17
|
+
* `FileUploadProps`, `AvatarUploadProps` and `FileUploadInlineProps` all carry
|
|
18
|
+
* these when used in single-file mode.
|
|
19
|
+
*/
|
|
20
|
+
interface UploadFieldCallbacks<TValue$1 extends SingleFileUploadValue = SingleFileUploadValue> extends UploadValueMapper<TValue$1> {
|
|
21
|
+
onFileSuccess?: (fileMeta: FileMetadata) => void;
|
|
22
|
+
onFileError?: (file: File, error: string) => void;
|
|
23
|
+
}
|
|
24
|
+
interface MapUploadPropsOptions {
|
|
25
|
+
forceSingle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shared `mapProps` mapper for all Formily-connected upload components.
|
|
29
|
+
*
|
|
30
|
+
* - Forwards `field.value` (defaulting to `null`) as the `value` prop so the
|
|
31
|
+
* component displays the currently stored file metadata.
|
|
32
|
+
* - Applies `mapValue` to the field value before forwarding it so callers can
|
|
33
|
+
* derive a display-ready file object without mutating the stored form value.
|
|
34
|
+
* - Provides a guarded `onChange` that only writes to the field on deletions
|
|
35
|
+
* (value becomes `null` for single-file, or the array shrinks for
|
|
36
|
+
* multi-file). New-file accepts fire `onChange` before the upload
|
|
37
|
+
* completes with incomplete metadata (no `url`), so those calls are
|
|
38
|
+
* intentionally ignored here — `onFileSuccess` handles the final write
|
|
39
|
+
* once the upload finishes.
|
|
40
|
+
* - Wraps `onFileSuccess` so that `field.setValue(fileMeta)` is called only
|
|
41
|
+
* after a successful upload, followed by the original `onFileSuccess`
|
|
42
|
+
* callback if one was supplied. When the field value is an array (multiple
|
|
43
|
+
* mode), the new file is appended to the existing array rather than
|
|
44
|
+
* replacing it.
|
|
45
|
+
* - Wraps `onFileError` so that `field.setFeedback({ type: 'error', … })` is
|
|
46
|
+
* set on upload failure, followed by the original `onFileError` callback if
|
|
47
|
+
* one was supplied.
|
|
48
|
+
*
|
|
49
|
+
* The generic `P extends object` constraint keeps the return type identical to
|
|
50
|
+
* the input type so that the mapper satisfies Formily's `IStateMapper<T>`.
|
|
51
|
+
* Internally the props are cast to `UploadFieldCallbacks` to access the
|
|
52
|
+
* upload-specific callbacks; both single-file and multiple-file modes share
|
|
53
|
+
* the same `onFileSuccess`/`onFileError` callbacks that fire per file.
|
|
54
|
+
*/
|
|
55
|
+
declare function mapUploadProps<P extends object>(props: P, field: Field, options?: MapUploadPropsOptions): P;
|
|
15
56
|
//#endregion
|
|
16
|
-
export { FormilyUploadProps, UploadValueMapper };
|
|
57
|
+
export { FormilyUploadProps, UploadFieldCallbacks, UploadValueMapper, mapUploadProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileMetadata } from "@pixpilot/shadcn-ui";
|
|
2
|
-
import "@formily/core";
|
|
2
|
+
import { Field } from "@formily/core";
|
|
3
3
|
|
|
4
4
|
//#region src/components/file-upload/map-upload-props.d.ts
|
|
5
5
|
type SingleFileUploadValue = FileMetadata | null;
|
|
@@ -12,5 +12,46 @@ interface UploadValueMapper<TValue$1 extends SingleFileUploadValue = SingleFileU
|
|
|
12
12
|
type FormilyUploadProps<P> = P extends {
|
|
13
13
|
multiple: true;
|
|
14
14
|
} ? P : P & UploadValueMapper<ExtractSingleFileValue<P>>;
|
|
15
|
+
/**
|
|
16
|
+
* Callbacks that the shadcn upload components expose at the single-file level.
|
|
17
|
+
* `FileUploadProps`, `AvatarUploadProps` and `FileUploadInlineProps` all carry
|
|
18
|
+
* these when used in single-file mode.
|
|
19
|
+
*/
|
|
20
|
+
interface UploadFieldCallbacks<TValue$1 extends SingleFileUploadValue = SingleFileUploadValue> extends UploadValueMapper<TValue$1> {
|
|
21
|
+
onFileSuccess?: (fileMeta: FileMetadata) => void;
|
|
22
|
+
onFileError?: (file: File, error: string) => void;
|
|
23
|
+
}
|
|
24
|
+
interface MapUploadPropsOptions {
|
|
25
|
+
forceSingle?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shared `mapProps` mapper for all Formily-connected upload components.
|
|
29
|
+
*
|
|
30
|
+
* - Forwards `field.value` (defaulting to `null`) as the `value` prop so the
|
|
31
|
+
* component displays the currently stored file metadata.
|
|
32
|
+
* - Applies `mapValue` to the field value before forwarding it so callers can
|
|
33
|
+
* derive a display-ready file object without mutating the stored form value.
|
|
34
|
+
* - Provides a guarded `onChange` that only writes to the field on deletions
|
|
35
|
+
* (value becomes `null` for single-file, or the array shrinks for
|
|
36
|
+
* multi-file). New-file accepts fire `onChange` before the upload
|
|
37
|
+
* completes with incomplete metadata (no `url`), so those calls are
|
|
38
|
+
* intentionally ignored here — `onFileSuccess` handles the final write
|
|
39
|
+
* once the upload finishes.
|
|
40
|
+
* - Wraps `onFileSuccess` so that `field.setValue(fileMeta)` is called only
|
|
41
|
+
* after a successful upload, followed by the original `onFileSuccess`
|
|
42
|
+
* callback if one was supplied. When the field value is an array (multiple
|
|
43
|
+
* mode), the new file is appended to the existing array rather than
|
|
44
|
+
* replacing it.
|
|
45
|
+
* - Wraps `onFileError` so that `field.setFeedback({ type: 'error', … })` is
|
|
46
|
+
* set on upload failure, followed by the original `onFileError` callback if
|
|
47
|
+
* one was supplied.
|
|
48
|
+
*
|
|
49
|
+
* The generic `P extends object` constraint keeps the return type identical to
|
|
50
|
+
* the input type so that the mapper satisfies Formily's `IStateMapper<T>`.
|
|
51
|
+
* Internally the props are cast to `UploadFieldCallbacks` to access the
|
|
52
|
+
* upload-specific callbacks; both single-file and multiple-file modes share
|
|
53
|
+
* the same `onFileSuccess`/`onFileError` callbacks that fire per file.
|
|
54
|
+
*/
|
|
55
|
+
declare function mapUploadProps<P extends object>(props: P, field: Field, options?: MapUploadPropsOptions): P;
|
|
15
56
|
//#endregion
|
|
16
|
-
export { FormilyUploadProps, UploadValueMapper };
|
|
57
|
+
export { FormilyUploadProps, UploadFieldCallbacks, UploadValueMapper, mapUploadProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FileUploadProgressCallBacks } from "@pixpilot/shadcn-ui";
|
|
2
|
+
|
|
3
|
+
//#region src/components/file-upload/types.d.ts
|
|
4
|
+
interface FormFileUploadOptions extends FileUploadProgressCallBacks {
|
|
5
|
+
component: string;
|
|
6
|
+
componentProps: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { FormFileUploadOptions };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FileUploadProgressCallBacks } from "@pixpilot/shadcn-ui";
|
|
2
|
+
|
|
3
|
+
//#region src/components/file-upload/types.d.ts
|
|
4
|
+
interface FormFileUploadOptions extends FileUploadProgressCallBacks {
|
|
5
|
+
component: string;
|
|
6
|
+
componentProps: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { FormFileUploadOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileUploadBaseProps } from "@pixpilot/shadcn-ui";
|
|
2
|
+
|
|
3
|
+
//#region src/components/file-upload/use-file-upload-feedback.d.ts
|
|
4
|
+
declare function useFileUploadFeedback(props: FileUploadBaseProps): {
|
|
5
|
+
onUpload: ((...args: any[]) => any) | undefined;
|
|
6
|
+
maxSize: number | undefined;
|
|
7
|
+
handleFilesRejection: (files: Array<{
|
|
8
|
+
file: File;
|
|
9
|
+
message: string;
|
|
10
|
+
}>) => void;
|
|
11
|
+
handleFileValidate: (file: File) => string | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useFileUploadFeedback };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FileUploadBaseProps } from "@pixpilot/shadcn-ui";
|
|
2
|
+
|
|
3
|
+
//#region src/components/file-upload/use-file-upload-feedback.d.ts
|
|
4
|
+
declare function useFileUploadFeedback(props: FileUploadBaseProps): {
|
|
5
|
+
onUpload: ((...args: any[]) => any) | undefined;
|
|
6
|
+
maxSize: number | undefined;
|
|
7
|
+
handleFilesRejection: (files: Array<{
|
|
8
|
+
file: File;
|
|
9
|
+
message: string;
|
|
10
|
+
}>) => void;
|
|
11
|
+
handleFileValidate: (file: File) => string | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useFileUploadFeedback };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FormItemProps } from "./form-item-types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1891 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/form-item/ConnectedFormItem.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: react1891.ForwardRefExoticComponent<Omit<Partial<FormItemProps & {
|
|
10
|
+
children?: react1891.ReactNode | undefined;
|
|
11
|
+
}>, "ref"> & react1891.RefAttributes<unknown>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { FormItem };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react31 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: react31.ForwardRefExoticComponent<Omit<Partial<react31.ClassAttributes<HTMLInputElement> & react31.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"> & react31.RefAttributes<unknown>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { NumberInput };
|