@pixpilot/formily-shadcn 0.5.0 → 0.8.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/checkbox.d.cts +2 -2
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/context/form-context.d.cts +21 -1
- package/dist/components/context/form-context.d.ts +21 -1
- package/dist/components/context/index.d.cts +1 -1
- package/dist/components/context/index.d.ts +1 -1
- package/dist/components/date-picker.d.cts +3 -3
- package/dist/components/date-picker.d.ts +3 -3
- package/dist/components/file-upload/file-upload-inline.cjs +1 -0
- package/dist/components/file-upload/file-upload-inline.d.cts +20 -0
- package/dist/components/file-upload/file-upload-inline.d.ts +20 -0
- package/dist/components/file-upload/file-upload-inline.js +1 -0
- package/dist/components/file-upload/file-upload.cjs +1 -0
- package/dist/components/file-upload/file-upload.d.cts +20 -0
- package/dist/components/file-upload/file-upload.d.ts +20 -0
- package/dist/components/file-upload/file-upload.js +1 -0
- package/dist/components/file-upload/index.cjs +1 -0
- package/dist/components/file-upload/index.d.cts +2 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/file-upload/index.js +1 -0
- package/dist/components/file-upload/use-file-upload-feedback.cjs +3 -0
- package/dist/components/file-upload/use-file-upload-feedback.js +3 -0
- package/dist/components/form.cjs +1 -1
- package/dist/components/form.d.cts +2 -1
- package/dist/components/form.d.ts +2 -1
- package/dist/components/form.js +1 -1
- package/dist/components/icon-picker.cjs +1 -0
- package/dist/components/icon-picker.d.cts +15 -0
- package/dist/components/icon-picker.d.ts +15 -0
- package/dist/components/icon-picker.js +1 -0
- package/dist/components/input.d.cts +2 -2
- package/dist/components/input.d.ts +2 -2
- package/dist/components/json-schema-form-renderer.cjs +1 -1
- package/dist/components/json-schema-form-renderer.d.cts +3 -0
- package/dist/components/json-schema-form-renderer.d.ts +3 -0
- package/dist/components/json-schema-form-renderer.js +1 -1
- package/dist/components/number-input.d.cts +2 -2
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/radio.d.cts +2 -2
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/rich-text-editor.cjs +1 -0
- package/dist/components/rich-text-editor.d.cts +6 -0
- package/dist/components/rich-text-editor.d.ts +6 -0
- package/dist/components/rich-text-editor.js +1 -0
- package/dist/components/row.d.cts +2 -2
- package/dist/components/row.d.ts +2 -2
- package/dist/components/schema-field-extended.cjs +1 -0
- package/dist/components/schema-field-extended.d.cts +630 -0
- package/dist/components/schema-field-extended.d.ts +630 -0
- package/dist/components/schema-field-extended.js +1 -0
- package/dist/components/schema-field.cjs +1 -1
- package/dist/components/schema-field.d.cts +134 -105
- package/dist/components/schema-field.d.ts +288 -259
- package/dist/components/schema-field.js +1 -1
- package/dist/components/separator.d.cts +3 -3
- package/dist/components/separator.d.ts +3 -3
- package/dist/components/slider.d.cts +2 -2
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/switch.d.cts +3 -3
- package/dist/components/switch.d.ts +3 -3
- package/dist/components/tags-input-inline.d.cts +3 -3
- package/dist/components/tags-input-inline.d.ts +3 -3
- package/dist/components/textarea.d.cts +2 -2
- package/dist/components/textarea.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1 -1
- package/package.json +7 -4
- package/dist/components/file-upload-inline.cjs +0 -3
- package/dist/components/file-upload-inline.d.cts +0 -12
- package/dist/components/file-upload-inline.d.ts +0 -12
- package/dist/components/file-upload-inline.js +0 -3
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react3 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: react3.ForwardRefExoticComponent<Omit<Partial<_radix_ui_react_checkbox0.CheckboxProps & react3.RefAttributes<HTMLButtonElement>>, "ref"> & react3.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Checkbox };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { FormSpace } from "../../types/form.cjs";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/context/form-context.d.ts
|
|
6
|
+
interface FomFileUpload {
|
|
7
|
+
onUpload?: (files: File[], options: FileUploadProgressCallBacks) => void;
|
|
8
|
+
maxSize?: number;
|
|
9
|
+
}
|
|
5
10
|
interface FormContextStates extends FormSpace {
|
|
6
11
|
itemProps?: {
|
|
7
12
|
className?: string;
|
|
@@ -9,6 +14,21 @@ interface FormContextStates extends FormSpace {
|
|
|
9
14
|
objectContainerProps?: {
|
|
10
15
|
className?: string;
|
|
11
16
|
};
|
|
17
|
+
config?: {
|
|
18
|
+
iconPicker?: {
|
|
19
|
+
/**
|
|
20
|
+
* Icon providers - can be static providers or async loader functions
|
|
21
|
+
* Users can provide either IconProvider[] or AsyncIconProvider[]
|
|
22
|
+
*/
|
|
23
|
+
providers: IconProvider[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional callback when providers are loaded
|
|
26
|
+
*/
|
|
27
|
+
onProvidersLoaded?: (providers: IconProvider[]) => void;
|
|
28
|
+
};
|
|
29
|
+
fileUpload?: FomFileUpload;
|
|
30
|
+
richTextEditor?: RichTextEditorProps;
|
|
31
|
+
};
|
|
12
32
|
}
|
|
13
33
|
//#endregion
|
|
14
|
-
export { FormContextStates };
|
|
34
|
+
export { FomFileUpload, FormContextStates };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { FormSpace } from "../../types/form.js";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import { FileUploadProgressCallBacks, IconProvider, RichTextEditorProps } from "@pixpilot/shadcn-ui";
|
|
3
4
|
|
|
4
5
|
//#region src/components/context/form-context.d.ts
|
|
6
|
+
interface FomFileUpload {
|
|
7
|
+
onUpload?: (files: File[], options: FileUploadProgressCallBacks) => void;
|
|
8
|
+
maxSize?: number;
|
|
9
|
+
}
|
|
5
10
|
interface FormContextStates extends FormSpace {
|
|
6
11
|
itemProps?: {
|
|
7
12
|
className?: string;
|
|
@@ -9,6 +14,21 @@ interface FormContextStates extends FormSpace {
|
|
|
9
14
|
objectContainerProps?: {
|
|
10
15
|
className?: string;
|
|
11
16
|
};
|
|
17
|
+
config?: {
|
|
18
|
+
iconPicker?: {
|
|
19
|
+
/**
|
|
20
|
+
* Icon providers - can be static providers or async loader functions
|
|
21
|
+
* Users can provide either IconProvider[] or AsyncIconProvider[]
|
|
22
|
+
*/
|
|
23
|
+
providers: IconProvider[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional callback when providers are loaded
|
|
26
|
+
*/
|
|
27
|
+
onProvidersLoaded?: (providers: IconProvider[]) => void;
|
|
28
|
+
};
|
|
29
|
+
fileUpload?: FomFileUpload;
|
|
30
|
+
richTextEditor?: RichTextEditorProps;
|
|
31
|
+
};
|
|
12
32
|
}
|
|
13
33
|
//#endregion
|
|
14
|
-
export { FormContextStates };
|
|
34
|
+
export { FomFileUpload, FormContextStates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FormContextStates } from "./form-context.cjs";
|
|
1
|
+
import { FomFileUpload, FormContextStates } from "./form-context.cjs";
|
|
2
2
|
import "./context.cjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FormContextStates } from "./form-context.js";
|
|
1
|
+
import { FomFileUpload, FormContextStates } from "./form-context.js";
|
|
2
2
|
import "./context.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react2 from "react";
|
|
2
2
|
import * as react_day_picker0 from "react-day-picker";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react2.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
@@ -12,6 +12,6 @@ declare const DatePicker: react0.ForwardRefExoticComponent<Partial<{
|
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
} & Omit<react_day_picker0.DayPickerProps & {
|
|
14
14
|
buttonVariant?: React.ComponentProps<typeof void 0>["variant"];
|
|
15
|
-
}, "onSelect" | "selected" | "mode">, "onSelect" | "selected" | "mode">> &
|
|
15
|
+
}, "onSelect" | "selected" | "mode">, "onSelect" | "selected" | "mode">> & react2.RefAttributes<unknown>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { DatePicker };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react6 from "react";
|
|
2
2
|
import * as react_day_picker0 from "react-day-picker";
|
|
3
3
|
|
|
4
4
|
//#region src/components/date-picker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react6.ForwardRefExoticComponent<Partial<{
|
|
6
6
|
value?: Date;
|
|
7
7
|
onChange?: (date: Date | undefined) => void;
|
|
8
8
|
placeholder?: string;
|
|
@@ -12,6 +12,6 @@ declare const DatePicker: react2.ForwardRefExoticComponent<Partial<{
|
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
} & Omit<react_day_picker0.DayPickerProps & {
|
|
14
14
|
buttonVariant?: React.ComponentProps<typeof void 0>["variant"];
|
|
15
|
-
}, "onSelect" | "selected" | "mode">, "onSelect" | "selected" | "mode">> &
|
|
15
|
+
}, "onSelect" | "selected" | "mode">, "onSelect" | "selected" | "mode">> & react6.RefAttributes<unknown>>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { DatePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./use-file-upload-feedback.cjs`);let n=require(`@formily/react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`@pixpilot/shadcn-ui`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);const o=e=>{let{onUpload:n,maxSize:r,handleFilesRejection:o,handleFileValidate:s}=t.useFileUploadFeedback(e);return(0,a.jsx)(i.FileUploadInline,{...e,maxSize:r,onFilesReject:o,onFileValidate:s,onUpload:n})},s=(0,n.connect)(o,(0,n.mapProps)((e,t)=>({...e,value:t.value??null})));exports.FileUploadInline=s;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui190 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/file-upload-inline.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected FileUploadInline component
|
|
8
|
+
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
|
+
*/
|
|
10
|
+
declare const FileUploadInline: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
|
|
11
|
+
multiple: true;
|
|
12
|
+
value?: _pixpilot_shadcn_ui190.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui190.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
|
|
15
|
+
multiple?: false;
|
|
16
|
+
value?: _pixpilot_shadcn_ui190.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui190.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FileUploadInline };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui190 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/file-upload-inline.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected FileUploadInline component
|
|
8
|
+
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
|
+
*/
|
|
10
|
+
declare const FileUploadInline$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
|
|
11
|
+
multiple: true;
|
|
12
|
+
value?: _pixpilot_shadcn_ui190.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui190.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui190.FileUploadInlineBaseProps & {
|
|
15
|
+
multiple?: false;
|
|
16
|
+
value?: _pixpilot_shadcn_ui190.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui190.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui190.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FileUploadInline$1 as FileUploadInline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFileUploadFeedback as e}from"./use-file-upload-feedback.js";import{connect as t,mapProps as n}from"@formily/react";import r from"react";import{FileUploadInline as i}from"@pixpilot/shadcn-ui";import{jsx as a}from"react/jsx-runtime";const o=t(t=>{let{onUpload:n,maxSize:r,handleFilesRejection:o,handleFileValidate:s}=e(t);return a(i,{...t,maxSize:r,onFilesReject:o,onFileValidate:s,onUpload:n})},n((e,t)=>({...e,value:t.value??null})));export{o as FileUploadInline};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./use-file-upload-feedback.cjs`);let n=require(`@formily/react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`@pixpilot/shadcn-ui`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);const o=e=>{let{onUpload:n,maxSize:r,handleFilesRejection:o,handleFileValidate:s}=t.useFileUploadFeedback(e);return(0,a.jsx)(i.FileUpload,{...e,maxSize:r,onFilesReject:o,onFileValidate:s,onUpload:n})},s=(0,n.connect)(o,(0,n.mapProps)((e,t)=>({...e,value:t.value??null})));exports.FileUpload=s;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui198 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/file-upload.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected FileUploadInline component
|
|
8
|
+
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
|
+
*/
|
|
10
|
+
declare const FileUpload: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui198.FileUploadInlineBaseProps & {
|
|
11
|
+
multiple: true;
|
|
12
|
+
value?: _pixpilot_shadcn_ui198.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui198.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui198.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui198.FileUploadInlineBaseProps & {
|
|
15
|
+
multiple?: false;
|
|
16
|
+
value?: _pixpilot_shadcn_ui198.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui198.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui198.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FileUpload };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as _pixpilot_shadcn_ui198 from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/file-upload/file-upload.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected FileUploadInline component
|
|
8
|
+
* Automatically connects shadcn FileUploadInline to Formily field state
|
|
9
|
+
*/
|
|
10
|
+
declare const FileUpload$1: React.ForwardRefExoticComponent<(Omit<Partial<_pixpilot_shadcn_ui198.FileUploadInlineBaseProps & {
|
|
11
|
+
multiple: true;
|
|
12
|
+
value?: _pixpilot_shadcn_ui198.FileMetadata[];
|
|
13
|
+
onChange?: _pixpilot_shadcn_ui198.OnChangeMultipleFiles;
|
|
14
|
+
} & _pixpilot_shadcn_ui198.FileUploadBaseProps>, "ref"> | Omit<Partial<_pixpilot_shadcn_ui198.FileUploadInlineBaseProps & {
|
|
15
|
+
multiple?: false;
|
|
16
|
+
value?: _pixpilot_shadcn_ui198.FileMetadata | null;
|
|
17
|
+
onChange?: _pixpilot_shadcn_ui198.OnChangeSingleFile;
|
|
18
|
+
} & _pixpilot_shadcn_ui198.FileUploadBaseProps>, "ref">) & React.RefAttributes<unknown>>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { FileUpload$1 as FileUpload };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFileUploadFeedback as e}from"./use-file-upload-feedback.js";import{connect as t,mapProps as n}from"@formily/react";import r from"react";import{FileUpload as i}from"@pixpilot/shadcn-ui";import{jsx as a}from"react/jsx-runtime";const o=t(t=>{let{onUpload:n,maxSize:r,handleFilesRejection:o,handleFileValidate:s}=e(t);return a(i,{...t,maxSize:r,onFilesReject:o,onFileValidate:s,onUpload:n})},n((e,t)=>({...e,value:t.value??null})));export{o as FileUpload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./file-upload.cjs`),t=require(`./file-upload-inline.cjs`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FileUpload as e}from"./file-upload.js";import{FileUploadInline as t}from"./file-upload-inline.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`../../hooks/use-form-context.cjs`);require(`../../hooks/index.cjs`);let n=require(`@formily/react`);n=e.__toESM(n);let r=require(`react`);r=e.__toESM(r);let i=require(`pretty-bytes`);i=e.__toESM(i);function a(e){let{onUpload:a,maxSize:o,onFilesReject:s,onFileValidate:c}=e,{config:l}=t.useFormContext(),u=(0,n.useField)(),{fileUpload:d}=l||{},f=a??d?.onUpload,p=o??d?.maxSize;if(f==null&&process.env.NODE_ENV!==`production`)throw Error(`onUpload prop required for FileUploadInline. Provide handler on form or field props.`);return{onUpload:f,maxSize:p,handleFilesRejection:r.default.useCallback(e=>{s?.(e);let t=e.filter(e=>e.message.startsWith(`Maximum`)),n=e.filter(e=>e.message.startsWith(`File too large`)),r=e.filter(e=>!n.includes(e)&&!t.includes(e)),a=[];if(t.length>0&&a.push(t[0].message),p!=null&&n.length>0){let e=n.map(e=>`${e.file.name} (${(0,i.default)(e.file.size)})`).join(`
|
|
2
|
+
`);a.push(`Files exceed ${(0,i.default)(p)} limit:\n${e}`)}r.length>0&&r.forEach(e=>{a.push(`${e.message}: ${e.file.name}`)}),u.setFeedback({type:`warning`,messages:[a.join(`
|
|
3
|
+
`)]})},[u,p,s]),handleFileValidate:r.default.useCallback(e=>(u.setFeedback({type:`warning`,messages:[]}),c?.(e)),[u,c])}}exports.useFileUploadFeedback=a;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{useFormContext as e}from"../../hooks/use-form-context.js";import"../../hooks/index.js";import{useField as t}from"@formily/react";import n from"react";import r from"pretty-bytes";function i(i){let{onUpload:a,maxSize:o,onFilesReject:s,onFileValidate:c}=i,{config:l}=e(),u=t(),{fileUpload:d}=l||{},f=a??d?.onUpload,p=o??d?.maxSize;return{onUpload:f,maxSize:p,handleFilesRejection:n.useCallback(e=>{s?.(e);let t=e.filter(e=>e.message.startsWith(`Maximum`)),n=e.filter(e=>e.message.startsWith(`File too large`)),i=e.filter(e=>!n.includes(e)&&!t.includes(e)),a=[];if(t.length>0&&a.push(t[0].message),p!=null&&n.length>0){let e=n.map(e=>`${e.file.name} (${r(e.file.size)})`).join(`
|
|
2
|
+
`);a.push(`Files exceed ${r(p)} limit:\n${e}`)}i.length>0&&i.forEach(e=>{a.push(`${e.message}: ${e.file.name}`)}),u.setFeedback({type:`warning`,messages:[a.join(`
|
|
3
|
+
`)]})},[u,p,s]),handleFileValidate:n.useCallback(e=>(u.setFeedback({type:`warning`,messages:[]}),c?.(e)),[u,c])}}export{i as useFileUploadFeedback};
|
package/dist/components/form.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./context/context.cjs`);require(`./context/index.cjs`);const n=require(`./form-items-container.cjs`);let r=require(`@formily/react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`@pixpilot/shadcn`);o=e.__toESM(o);function s({form:e,className:s,style:c,children:l,onSubmit:u,onAutoSubmit:d,itemProps:f,objectContainerProps:p,density:m,responsive:h}){return(0,a.jsx)(t.Provider,{value:i.default.useMemo(()=>({itemProps:f,objectContainerProps:p,density:m,responsive:h}),[f,p,m,h]),children:(0,a.jsx)(r.FormProvider,{form:e,children:(0,a.jsx)(n.FormItemContainer,{as:`form`,className:(0,o.cn)(`space-y-6`,s),style:c,onSubmit:t=>{t.preventDefault(),e.submit(e=>{u?.(e),d?.(e)}).catch(()=>{})},children:l})})})}exports.Form=s;
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./context/context.cjs`);require(`./context/index.cjs`);const n=require(`./form-items-container.cjs`);let r=require(`@formily/react`);r=e.__toESM(r);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`@pixpilot/shadcn`);o=e.__toESM(o);function s({form:e,className:s,style:c,children:l,onSubmit:u,onAutoSubmit:d,itemProps:f,objectContainerProps:p,density:m,responsive:h,config:g}){return(0,a.jsx)(t.Provider,{value:i.default.useMemo(()=>({itemProps:f,objectContainerProps:p,density:m,responsive:h,config:g}),[f,p,m,h,g]),children:(0,a.jsx)(r.FormProvider,{form:e,children:(0,a.jsx)(n.FormItemContainer,{as:`form`,className:(0,o.cn)(`space-y-6`,s),style:c,onSubmit:t=>{t.preventDefault(),e.submit(e=>{u?.(e),d?.(e)}).catch(()=>{})},children:l})})})}exports.Form=s;
|
package/dist/components/form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Provider as e}from"./context/context.js";import"./context/index.js";import{FormItemContainer as t}from"./form-items-container.js";import{FormProvider as n}from"@formily/react";import r from"react";import{jsx as i}from"react/jsx-runtime";import{cn as a}from"@pixpilot/shadcn";function o({form:o,className:s,style:c,children:l,onSubmit:u,onAutoSubmit:d,itemProps:f,objectContainerProps:p,density:m,responsive:h}){return i(e,{value:r.useMemo(()=>({itemProps:f,objectContainerProps:p,density:m,responsive:h}),[f,p,m,h]),children:i(n,{form:o,children:i(t,{as:`form`,className:a(`space-y-6`,s),style:c,onSubmit:e=>{e.preventDefault(),o.submit(e=>{u?.(e),d?.(e)}).catch(()=>{})},children:l})})})}export{o as Form};
|
|
1
|
+
import{Provider as e}from"./context/context.js";import"./context/index.js";import{FormItemContainer as t}from"./form-items-container.js";import{FormProvider as n}from"@formily/react";import r from"react";import{jsx as i}from"react/jsx-runtime";import{cn as a}from"@pixpilot/shadcn";function o({form:o,className:s,style:c,children:l,onSubmit:u,onAutoSubmit:d,itemProps:f,objectContainerProps:p,density:m,responsive:h,config:g}){return i(e,{value:r.useMemo(()=>({itemProps:f,objectContainerProps:p,density:m,responsive:h,config:g}),[f,p,m,h,g]),children:i(n,{form:o,children:i(t,{as:`form`,className:a(`space-y-6`,s),style:c,onSubmit:e=>{e.preventDefault(),o.submit(e=>{u?.(e),d?.(e)}).catch(()=>{})},children:l})})})}export{o as Form};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../hooks/use-form-context.cjs`);require(`../hooks/index.cjs`);let n=require(`@formily/react`);n=e.__toESM(n);let r=require(`@pixpilot/shadcn-ui`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=e=>{let{providers:n,...a}=e,{config:o}=t.useFormContext(),{iconPicker:s}=o||{},{providers:c=[]}=s||{},l=n===void 0?c:n;return(0,i.jsx)(r.IconPicker,{...a,providers:l})},o=(0,n.connect)(a,(0,n.mapProps)((e,t)=>{let n=t;return{...e,value:n.value??``}}));exports.IconPicker=o;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react4 from "react";
|
|
2
|
+
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/icon-picker.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected IconPicker component
|
|
8
|
+
* Automatically connects to Formily field state
|
|
9
|
+
* Supports both static and async icon providers
|
|
10
|
+
*/
|
|
11
|
+
declare const IconPicker: react4.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
|
+
providers?: IconProviderProps[];
|
|
13
|
+
}> & react4.RefAttributes<unknown>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { IconPicker };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as react8 from "react";
|
|
2
|
+
import { IconPickerProps, IconProviderProps } from "@pixpilot/shadcn-ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/icon-picker.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formily-connected IconPicker component
|
|
8
|
+
* Automatically connects to Formily field state
|
|
9
|
+
* Supports both static and async icon providers
|
|
10
|
+
*/
|
|
11
|
+
declare const IconPicker$1: react8.ForwardRefExoticComponent<Partial<Omit<IconPickerProps, "providers"> & {
|
|
12
|
+
providers?: IconProviderProps[];
|
|
13
|
+
}> & react8.RefAttributes<unknown>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { IconPicker$1 as IconPicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFormContext as e}from"../hooks/use-form-context.js";import"../hooks/index.js";import{connect as t,mapProps as n}from"@formily/react";import{IconPicker as r}from"@pixpilot/shadcn-ui";import{jsx as i}from"react/jsx-runtime";const a=t(t=>{let{providers:n,...a}=t,{config:o}=e(),{iconPicker:s}=o||{},{providers:c=[]}=s||{},l=n===void 0?c:n;return i(r,{...a,providers:l})},n((e,t)=>{let n=t;return{...e,value:n.value??``}}));export{a as IconPicker};
|
|
@@ -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,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react10 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: react10.ForwardRefExoticComponent<Omit<Partial<react10.ClassAttributes<HTMLInputElement> & react10.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react10.RefAttributes<unknown>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Input };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../utils/transform-schema.cjs`);require(`../utils/index.cjs`);const n=require(`./form.cjs`),r=require(`./schema-field.cjs`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`@formily/core`);o=e.__toESM(o);const s=e=>{let{schema:s,children:c,...
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../utils/transform-schema.cjs`);require(`../utils/index.cjs`);const n=require(`./form.cjs`),r=require(`./schema-field.cjs`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);a=e.__toESM(a);let o=require(`@formily/core`);o=e.__toESM(o);const s=e=>{let{schema:s,children:c,schemaField:l,...u}=e,d=(0,i.useMemo)(()=>(0,o.createForm)(),[]),f=(0,i.useMemo)(()=>t.transformSchema(s),[s]),p=l||r.SchemaField;return(0,a.jsxs)(n.Form,{...u,form:d,children:[(0,a.jsx)(p,{schema:f}),c]})};s.displayName=`JsonSchemaFormRenderer`,exports.JsonSchemaFormRenderer=s;
|
|
@@ -6,6 +6,9 @@ import React from "react";
|
|
|
6
6
|
interface JsonSchemaFormRendererProps extends Omit<React.ComponentProps<typeof Form>, 'form'> {
|
|
7
7
|
schema: ISchema;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
schemaField?: React.FC<{
|
|
10
|
+
schema: ISchema;
|
|
11
|
+
}>;
|
|
9
12
|
}
|
|
10
13
|
declare const JsonSchemaFormRenderer: React.FC<JsonSchemaFormRendererProps>;
|
|
11
14
|
//#endregion
|
|
@@ -6,6 +6,9 @@ import React from "react";
|
|
|
6
6
|
interface JsonSchemaFormRendererProps extends Omit<React.ComponentProps<typeof Form>, 'form'> {
|
|
7
7
|
schema: ISchema;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
schemaField?: React.FC<{
|
|
10
|
+
schema: ISchema;
|
|
11
|
+
}>;
|
|
9
12
|
}
|
|
10
13
|
declare const JsonSchemaFormRenderer: React.FC<JsonSchemaFormRendererProps>;
|
|
11
14
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{transformSchema as e}from"../utils/transform-schema.js";import"../utils/index.js";import{Form as t}from"./form.js";import n
|
|
1
|
+
import{transformSchema as e}from"../utils/transform-schema.js";import"../utils/index.js";import{Form as t}from"./form.js";import{SchemaField as n}from"./schema-field.js";import r,{useMemo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{createForm as s}from"@formily/core";const c=r=>{let{schema:c,children:l,schemaField:u,...d}=r,f=i(()=>s(),[]),p=i(()=>e(c),[c]),m=u||n;return o(t,{...d,form:f,children:[a(m,{schema:p}),l]})};c.displayName=`JsonSchemaFormRenderer`;export{c as JsonSchemaFormRenderer};
|
|
@@ -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,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react785 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: react785.ForwardRefExoticComponent<Omit<Partial<react785.ClassAttributes<HTMLInputElement> & react785.InputHTMLAttributes<HTMLInputElement>>, "ref"> & react785.RefAttributes<unknown>>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { NumberInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, 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,5 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, 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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`../hooks/use-form-context.cjs`);require(`../hooks/index.cjs`);let n=require(`@formily/react`);n=e.__toESM(n);let r=require(`@pixpilot/shadcn-ui`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);i=e.__toESM(i);const a=e=>(0,i.jsx)(r.RichTextEditor,{...t.useFormContext()?.config?.richTextEditor,...e,children:`RichTextEditor`}),o=(0,n.connect)(a,(0,n.mapProps)((e,t)=>({...e,value:t.value??``})));exports.RichTextEditor=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useFormContext as e}from"../hooks/use-form-context.js";import"../hooks/index.js";import{connect as t,mapProps as n}from"@formily/react";import{RichTextEditor as r}from"@pixpilot/shadcn-ui";import{jsx as i}from"react/jsx-runtime";const a=t(t=>i(r,{...e()?.config?.richTextEditor,...t,children:`RichTextEditor`}),n((e,t)=>({...e,value:t.value??``})));export{a as RichTextEditor};
|
|
@@ -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 };
|
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../_virtual/rolldown_runtime.cjs`),t=require(`./file-upload/file-upload.cjs`),n=require(`./file-upload/file-upload-inline.cjs`);require(`./file-upload/index.cjs`);const r=require(`./icon-picker.cjs`),i=require(`./schema-field.cjs`),a=require(`./rich-text-editor.cjs`);let o=require(`@formily/react`);o=e.__toESM(o);const s=(0,o.createSchemaField)({components:{FileUploadInline:n.FileUploadInline,IconPicker:r.IconPicker,FileUpload:t.FileUpload,RichTextEditor:a.RichTextEditor,...i.basicComponents}});exports.SchemaFieldExtended=s;
|