@pixpilot/formily-shadcn 1.8.0 → 1.9.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.cts +3 -3
- package/dist/components/IconToggle.d.cts +2 -2
- package/dist/components/Radio.d.ts +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.ts +2 -2
- package/dist/components/Textarea.d.ts +2 -2
- package/dist/components/file-upload/AvatarUpload.cjs +3 -2
- package/dist/components/file-upload/AvatarUpload.d.cts +4 -3
- package/dist/components/file-upload/AvatarUpload.d.ts +4 -3
- package/dist/components/file-upload/AvatarUpload.js +3 -2
- package/dist/components/file-upload/FileUpload.cjs +3 -2
- package/dist/components/file-upload/FileUpload.d.cts +5 -12
- package/dist/components/file-upload/FileUpload.d.ts +5 -12
- package/dist/components/file-upload/FileUpload.js +3 -2
- package/dist/components/file-upload/FileUploadInline.cjs +3 -2
- package/dist/components/file-upload/FileUploadInline.d.cts +5 -12
- package/dist/components/file-upload/FileUploadInline.d.ts +5 -12
- package/dist/components/file-upload/FileUploadInline.js +3 -2
- package/dist/components/file-upload/index.d.cts +3 -3
- package/dist/components/file-upload/index.d.ts +3 -3
- package/dist/components/file-upload/map-upload-props.cjs +7 -3
- package/dist/components/file-upload/map-upload-props.d.cts +16 -0
- package/dist/components/file-upload/map-upload-props.d.ts +16 -0
- package/dist/components/file-upload/map-upload-props.js +7 -3
- package/dist/components/form-item/ConnectedFormItem.d.cts +4 -4
- package/dist/components/form-item/ConnectedFormItem.d.ts +4 -4
- package/dist/components/schema-field/schema-field-basics.d.cts +303 -303
- package/dist/components/schema-field/schema-field-basics.d.ts +303 -303
- package/dist/components/schema-field/schema-field-extended.d.cts +179 -351
- package/dist/components/schema-field/schema-field-extended.d.ts +505 -677
- package/dist/components/schema-field/schema-field.d.cts +413 -413
- package/dist/components/schema-field/schema-field.d.ts +412 -412
- package/dist/components/slider/Slider.d.cts +3 -3
- package/dist/components/slider/Slider.d.ts +3 -3
- package/dist/components/slider/SliderInput.d.cts +3 -3
- package/dist/components/slider/SliderInput.d.ts +3 -3
- package/dist/components/slider/SliderSelect.d.cts +3 -3
- package/dist/components/slider/SliderSelect.d.ts +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/package.json +3 -3
|
@@ -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_runtime0 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_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { FormGrid };
|
|
@@ -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 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_runtime3 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_runtime3.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_runtime2 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_runtime2.JSX.Element;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { Row };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react19 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: react19.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_separator0.SeparatorProps & react19.RefAttributes<HTMLDivElement>>, "ref"> & react19.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Separator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react16 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: react16.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_switch0.SwitchProps & react16.RefAttributes<HTMLButtonElement>>, "ref"> & react16.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Switch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react26 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: react26.ForwardRefExoticComponent<Partial<_pixpilot_shadcn_ui1.TagsInputProps> & react26.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 };
|
|
@@ -12,9 +12,10 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
12
12
|
|
|
13
13
|
//#region src/components/file-upload/AvatarUpload.tsx
|
|
14
14
|
const BaseAvatarUpload = (props) => {
|
|
15
|
-
const {
|
|
15
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
16
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = require_use_file_upload_feedback.useFileUploadFeedback(uploadProps);
|
|
16
17
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.AvatarUpload, {
|
|
17
|
-
...
|
|
18
|
+
...uploadProps,
|
|
18
19
|
maxSize,
|
|
19
20
|
onFilesReject: handleFilesRejection,
|
|
20
21
|
onFileValidate: handleFileValidate,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.cjs";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { AvatarUploadProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/AvatarUpload.d.ts
|
|
5
|
-
|
|
6
|
+
type AvatarUploadProps$1 = FormilyUploadProps<AvatarUploadProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected AvatarUpload component
|
|
8
9
|
* Automatically connects shadcn AvatarUpload to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const AvatarUpload: React.
|
|
11
|
+
declare const AvatarUpload: React.FC<AvatarUploadProps$1>;
|
|
11
12
|
//#endregion
|
|
12
|
-
export { AvatarUpload };
|
|
13
|
+
export { AvatarUpload, AvatarUploadProps$1 as AvatarUploadProps };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.js";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { AvatarUploadProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/AvatarUpload.d.ts
|
|
5
|
-
|
|
6
|
+
type AvatarUploadProps$1 = FormilyUploadProps<AvatarUploadProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected AvatarUpload component
|
|
8
9
|
* Automatically connects shadcn AvatarUpload to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const AvatarUpload$1: React.
|
|
11
|
+
declare const AvatarUpload$1: React.FC<AvatarUploadProps$1>;
|
|
11
12
|
//#endregion
|
|
12
|
-
export { AvatarUpload$1 as AvatarUpload };
|
|
13
|
+
export { AvatarUpload$1 as AvatarUpload, AvatarUploadProps$1 as AvatarUploadProps };
|
|
@@ -7,9 +7,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/components/file-upload/AvatarUpload.tsx
|
|
9
9
|
const BaseAvatarUpload = (props) => {
|
|
10
|
-
const {
|
|
10
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
11
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = useFileUploadFeedback(uploadProps);
|
|
11
12
|
return /* @__PURE__ */ jsx(AvatarUpload, {
|
|
12
|
-
...
|
|
13
|
+
...uploadProps,
|
|
13
14
|
maxSize,
|
|
14
15
|
onFilesReject: handleFilesRejection,
|
|
15
16
|
onFileValidate: handleFileValidate,
|
|
@@ -12,9 +12,10 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
12
12
|
|
|
13
13
|
//#region src/components/file-upload/FileUpload.tsx
|
|
14
14
|
const BaseFileUpload = (props) => {
|
|
15
|
-
const {
|
|
15
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
16
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = require_use_file_upload_feedback.useFileUploadFeedback(uploadProps);
|
|
16
17
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.FileUpload, {
|
|
17
|
-
...
|
|
18
|
+
...uploadProps,
|
|
18
19
|
maxSize,
|
|
19
20
|
onFilesReject: handleFilesRejection,
|
|
20
21
|
onFileValidate: handleFileValidate,
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.cjs";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
+
import { FileUploadProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/FileUpload.d.ts
|
|
5
|
-
|
|
6
|
+
type FileUploadProps$1 = FormilyUploadProps<FileUploadProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected FileUpload component
|
|
8
9
|
* Automatically connects shadcn FileUpload to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const FileUpload: React.
|
|
11
|
-
multiple: true;
|
|
12
|
-
value?: _pixpilot_shadcn_ui15.FileMetadata[];
|
|
13
|
-
onChange?: _pixpilot_shadcn_ui15.OnChangeMultipleFiles;
|
|
14
|
-
} & _pixpilot_shadcn_ui15.FileUploadBaseProps & _pixpilot_shadcn_ui15.MultiFileCallbacks>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui15.FileUploadInlineBaseProps & _pixpilot_shadcn_ui15.FileUploadRootPropsBaseProps & {
|
|
15
|
-
multiple?: false;
|
|
16
|
-
value?: _pixpilot_shadcn_ui15.FileMetadata | null;
|
|
17
|
-
onChange?: _pixpilot_shadcn_ui15.OnChangeSingleFile;
|
|
18
|
-
} & _pixpilot_shadcn_ui15.FileUploadBaseProps & _pixpilot_shadcn_ui15.UseFileCallbacks>, "ref">) & React.RefAttributes<unknown>>;
|
|
11
|
+
declare const FileUpload: React.FC<FileUploadProps$1>;
|
|
19
12
|
//#endregion
|
|
20
|
-
export { FileUpload };
|
|
13
|
+
export { FileUpload, FileUploadProps$1 as FileUploadProps };
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.js";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
+
import { FileUploadProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/FileUpload.d.ts
|
|
5
|
-
|
|
6
|
+
type FileUploadProps$1 = FormilyUploadProps<FileUploadProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected FileUpload component
|
|
8
9
|
* Automatically connects shadcn FileUpload to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const FileUpload$1: React.
|
|
11
|
-
multiple: true;
|
|
12
|
-
value?: _pixpilot_shadcn_ui15.FileMetadata[];
|
|
13
|
-
onChange?: _pixpilot_shadcn_ui15.OnChangeMultipleFiles;
|
|
14
|
-
} & _pixpilot_shadcn_ui15.FileUploadBaseProps & _pixpilot_shadcn_ui15.MultiFileCallbacks>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui15.FileUploadInlineBaseProps & _pixpilot_shadcn_ui15.FileUploadRootPropsBaseProps & {
|
|
15
|
-
multiple?: false;
|
|
16
|
-
value?: _pixpilot_shadcn_ui15.FileMetadata | null;
|
|
17
|
-
onChange?: _pixpilot_shadcn_ui15.OnChangeSingleFile;
|
|
18
|
-
} & _pixpilot_shadcn_ui15.FileUploadBaseProps & _pixpilot_shadcn_ui15.UseFileCallbacks>, "ref">) & React.RefAttributes<unknown>>;
|
|
11
|
+
declare const FileUpload$1: React.FC<FileUploadProps$1>;
|
|
19
12
|
//#endregion
|
|
20
|
-
export { FileUpload$1 as FileUpload };
|
|
13
|
+
export { FileUpload$1 as FileUpload, FileUploadProps$1 as FileUploadProps };
|
|
@@ -7,9 +7,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/components/file-upload/FileUpload.tsx
|
|
9
9
|
const BaseFileUpload = (props) => {
|
|
10
|
-
const {
|
|
10
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
11
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = useFileUploadFeedback(uploadProps);
|
|
11
12
|
return /* @__PURE__ */ jsx(FileUpload, {
|
|
12
|
-
...
|
|
13
|
+
...uploadProps,
|
|
13
14
|
maxSize,
|
|
14
15
|
onFilesReject: handleFilesRejection,
|
|
15
16
|
onFileValidate: handleFileValidate,
|
|
@@ -12,9 +12,10 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
|
12
12
|
|
|
13
13
|
//#region src/components/file-upload/FileUploadInline.tsx
|
|
14
14
|
const BaseFileUploadInline = (props) => {
|
|
15
|
-
const {
|
|
15
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
16
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = require_use_file_upload_feedback.useFileUploadFeedback(uploadProps);
|
|
16
17
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn_ui.FileUploadInline, {
|
|
17
|
-
...
|
|
18
|
+
...uploadProps,
|
|
18
19
|
maxSize,
|
|
19
20
|
onFilesReject: handleFilesRejection,
|
|
20
21
|
onFileValidate: handleFileValidate,
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.cjs";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
+
import { FileUploadInlineProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/FileUploadInline.d.ts
|
|
5
|
-
|
|
6
|
+
type FileUploadInlineProps$1 = FormilyUploadProps<FileUploadInlineProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected FileUploadInline component
|
|
8
9
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const FileUploadInline: React.
|
|
11
|
-
multiple: true;
|
|
12
|
-
value?: _pixpilot_shadcn_ui3.FileMetadata[];
|
|
13
|
-
onChange?: _pixpilot_shadcn_ui3.OnChangeMultipleFiles;
|
|
14
|
-
} & _pixpilot_shadcn_ui3.FileUploadBaseProps & _pixpilot_shadcn_ui3.MultiFileCallbacks>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui3.FileUploadInlineBaseProps & _pixpilot_shadcn_ui3.FileUploadRootPropsBaseProps & {
|
|
15
|
-
multiple?: false;
|
|
16
|
-
value?: _pixpilot_shadcn_ui3.FileMetadata | null;
|
|
17
|
-
onChange?: _pixpilot_shadcn_ui3.OnChangeSingleFile;
|
|
18
|
-
} & _pixpilot_shadcn_ui3.FileUploadBaseProps & _pixpilot_shadcn_ui3.UseFileCallbacks>, "ref">) & React.RefAttributes<unknown>>;
|
|
11
|
+
declare const FileUploadInline: React.FC<FileUploadInlineProps$1>;
|
|
19
12
|
//#endregion
|
|
20
|
-
export { FileUploadInline };
|
|
13
|
+
export { FileUploadInline, FileUploadInlineProps$1 as FileUploadInlineProps };
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { FormilyUploadProps } from "./map-upload-props.js";
|
|
1
2
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
+
import { FileUploadInlineProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/file-upload/FileUploadInline.d.ts
|
|
5
|
-
|
|
6
|
+
type FileUploadInlineProps$1 = FormilyUploadProps<FileUploadInlineProps>;
|
|
6
7
|
/**
|
|
7
8
|
* Formily-connected FileUploadInline component
|
|
8
9
|
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
10
|
*/
|
|
10
|
-
declare const FileUploadInline$1: React.
|
|
11
|
-
multiple: true;
|
|
12
|
-
value?: _pixpilot_shadcn_ui3.FileMetadata[];
|
|
13
|
-
onChange?: _pixpilot_shadcn_ui3.OnChangeMultipleFiles;
|
|
14
|
-
} & _pixpilot_shadcn_ui3.FileUploadBaseProps & _pixpilot_shadcn_ui3.MultiFileCallbacks>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui3.FileUploadInlineBaseProps & _pixpilot_shadcn_ui3.FileUploadRootPropsBaseProps & {
|
|
15
|
-
multiple?: false;
|
|
16
|
-
value?: _pixpilot_shadcn_ui3.FileMetadata | null;
|
|
17
|
-
onChange?: _pixpilot_shadcn_ui3.OnChangeSingleFile;
|
|
18
|
-
} & _pixpilot_shadcn_ui3.FileUploadBaseProps & _pixpilot_shadcn_ui3.UseFileCallbacks>, "ref">) & React.RefAttributes<unknown>>;
|
|
11
|
+
declare const FileUploadInline$1: React.FC<FileUploadInlineProps$1>;
|
|
19
12
|
//#endregion
|
|
20
|
-
export { FileUploadInline$1 as FileUploadInline };
|
|
13
|
+
export { FileUploadInline$1 as FileUploadInline, FileUploadInlineProps$1 as FileUploadInlineProps };
|
|
@@ -7,9 +7,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
|
|
8
8
|
//#region src/components/file-upload/FileUploadInline.tsx
|
|
9
9
|
const BaseFileUploadInline = (props) => {
|
|
10
|
-
const {
|
|
10
|
+
const { mapValue: _mapValue,...uploadProps } = props;
|
|
11
|
+
const { onUpload, maxSize, handleFilesRejection, handleFileValidate } = useFileUploadFeedback(uploadProps);
|
|
11
12
|
return /* @__PURE__ */ jsx(FileUploadInline, {
|
|
12
|
-
...
|
|
13
|
+
...uploadProps,
|
|
13
14
|
maxSize,
|
|
14
15
|
onFilesReject: handleFilesRejection,
|
|
15
16
|
onFileValidate: handleFileValidate,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AvatarUpload } from "./AvatarUpload.cjs";
|
|
2
|
-
import { FileUpload } from "./FileUpload.cjs";
|
|
3
|
-
import { FileUploadInline } from "./FileUploadInline.cjs";
|
|
1
|
+
import { AvatarUpload, AvatarUploadProps as AvatarUploadProps$1 } from "./AvatarUpload.cjs";
|
|
2
|
+
import { FileUpload, FileUploadProps as FileUploadProps$1 } from "./FileUpload.cjs";
|
|
3
|
+
import { FileUploadInline, FileUploadInlineProps as FileUploadInlineProps$1 } from "./FileUploadInline.cjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AvatarUpload as AvatarUpload$1 } from "./AvatarUpload.js";
|
|
2
|
-
import { FileUpload as FileUpload$1 } from "./FileUpload.js";
|
|
3
|
-
import { FileUploadInline as FileUploadInline$1 } from "./FileUploadInline.js";
|
|
1
|
+
import { AvatarUpload as AvatarUpload$1, AvatarUploadProps as AvatarUploadProps$1 } from "./AvatarUpload.js";
|
|
2
|
+
import { FileUpload as FileUpload$1, FileUploadProps as FileUploadProps$1 } from "./FileUpload.js";
|
|
3
|
+
import { FileUploadInline as FileUploadInline$1, FileUploadInlineProps as FileUploadInlineProps$1 } from "./FileUploadInline.js";
|
|
4
4
|
import "@pixpilot/shadcn-ui";
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* - Forwards `field.value` (defaulting to `null`) as the `value` prop so the
|
|
7
7
|
* component displays the currently stored file metadata.
|
|
8
|
+
* - Applies `mapValue` to the field value before forwarding it so callers can
|
|
9
|
+
* derive a display-ready file object without mutating the stored form value.
|
|
8
10
|
* - Sets `onChange` to `undefined` to prevent Formily's default wiring from
|
|
9
11
|
* calling `field.setValue()` the moment a file is selected (i.e. before the
|
|
10
12
|
* upload completes).
|
|
@@ -23,10 +25,12 @@
|
|
|
23
25
|
* because this function only overrides `onSuccess` and `onError`.
|
|
24
26
|
*/
|
|
25
27
|
function mapUploadProps(props, field) {
|
|
26
|
-
const { onSuccess, onError } = props;
|
|
28
|
+
const { onSuccess, onError, mapValue,...restProps } = props;
|
|
29
|
+
const baseValue = field.value ?? null;
|
|
30
|
+
const value = mapValue ? mapValue(baseValue) : baseValue;
|
|
27
31
|
return {
|
|
28
|
-
...
|
|
29
|
-
value
|
|
32
|
+
...restProps,
|
|
33
|
+
value,
|
|
30
34
|
onChange: void 0,
|
|
31
35
|
onSuccess: (fileMeta) => {
|
|
32
36
|
field.setValue(fileMeta);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "@formily/core";
|
|
2
|
+
import { FileMetadata } from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/map-upload-props.d.ts
|
|
5
|
+
type SingleFileUploadValue = FileMetadata | null;
|
|
6
|
+
type ExtractSingleFileValue<P> = P extends {
|
|
7
|
+
value?: infer TValue;
|
|
8
|
+
} ? Extract<TValue, SingleFileUploadValue> extends never ? SingleFileUploadValue : Extract<TValue, SingleFileUploadValue> : SingleFileUploadValue;
|
|
9
|
+
interface UploadValueMapper<TValue$1 extends SingleFileUploadValue = SingleFileUploadValue> {
|
|
10
|
+
mapValue?: (value: TValue$1) => TValue$1;
|
|
11
|
+
}
|
|
12
|
+
type FormilyUploadProps<P> = P extends {
|
|
13
|
+
multiple: true;
|
|
14
|
+
} ? P : P & UploadValueMapper<ExtractSingleFileValue<P>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { FormilyUploadProps, UploadValueMapper };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileMetadata } from "@pixpilot/shadcn-ui";
|
|
2
|
+
import "@formily/core";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/map-upload-props.d.ts
|
|
5
|
+
type SingleFileUploadValue = FileMetadata | null;
|
|
6
|
+
type ExtractSingleFileValue<P> = P extends {
|
|
7
|
+
value?: infer TValue;
|
|
8
|
+
} ? Extract<TValue, SingleFileUploadValue> extends never ? SingleFileUploadValue : Extract<TValue, SingleFileUploadValue> : SingleFileUploadValue;
|
|
9
|
+
interface UploadValueMapper<TValue$1 extends SingleFileUploadValue = SingleFileUploadValue> {
|
|
10
|
+
mapValue?: (value: TValue$1) => TValue$1;
|
|
11
|
+
}
|
|
12
|
+
type FormilyUploadProps<P> = P extends {
|
|
13
|
+
multiple: true;
|
|
14
|
+
} ? P : P & UploadValueMapper<ExtractSingleFileValue<P>>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { FormilyUploadProps, UploadValueMapper };
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* - Forwards `field.value` (defaulting to `null`) as the `value` prop so the
|
|
6
6
|
* component displays the currently stored file metadata.
|
|
7
|
+
* - Applies `mapValue` to the field value before forwarding it so callers can
|
|
8
|
+
* derive a display-ready file object without mutating the stored form value.
|
|
7
9
|
* - Sets `onChange` to `undefined` to prevent Formily's default wiring from
|
|
8
10
|
* calling `field.setValue()` the moment a file is selected (i.e. before the
|
|
9
11
|
* upload completes).
|
|
@@ -22,10 +24,12 @@
|
|
|
22
24
|
* because this function only overrides `onSuccess` and `onError`.
|
|
23
25
|
*/
|
|
24
26
|
function mapUploadProps(props, field) {
|
|
25
|
-
const { onSuccess, onError } = props;
|
|
27
|
+
const { onSuccess, onError, mapValue,...restProps } = props;
|
|
28
|
+
const baseValue = field.value ?? null;
|
|
29
|
+
const value = mapValue ? mapValue(baseValue) : baseValue;
|
|
26
30
|
return {
|
|
27
|
-
...
|
|
28
|
-
value
|
|
31
|
+
...restProps,
|
|
32
|
+
value,
|
|
29
33
|
onChange: void 0,
|
|
30
34
|
onSuccess: (fileMeta) => {
|
|
31
35
|
field.setValue(fileMeta);
|
|
@@ -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,13 +1,13 @@
|
|
|
1
1
|
import { FormItemProps } from "./form-item-types.js";
|
|
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 };
|