@next-bricks/form 0.21.2 → 0.23.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/bricks.json +2 -1
- package/dist/chunks/{2108.a87ff3a1.js → 2108.cb69ad5c.js} +2 -2
- package/dist/chunks/{2108.a87ff3a1.js.map → 2108.cb69ad5c.js.map} +1 -1
- package/dist/chunks/{3669.ca91bd61.js → 3669.1b525a51.js} +2 -2
- package/dist/chunks/3669.1b525a51.js.map +1 -0
- package/dist/chunks/{5381.0d64e137.js → 5381.6d07e197.js} +2 -2
- package/dist/chunks/{5381.0d64e137.js.map → 5381.6d07e197.js.map} +1 -1
- package/dist/chunks/5716.810c3a88.js +2 -0
- package/dist/chunks/5716.810c3a88.js.map +1 -0
- package/dist/chunks/{5789.d59ac23c.js → 5789.aa34d165.js} +3 -3
- package/dist/chunks/{5789.d59ac23c.js.map → 5789.aa34d165.js.map} +1 -1
- package/dist/chunks/631.552c4aa6.js +2 -0
- package/dist/chunks/631.552c4aa6.js.map +1 -0
- package/dist/chunks/{6660.a6dc1b14.js → 6660.570b466b.js} +2 -2
- package/dist/chunks/{6660.a6dc1b14.js.map → 6660.570b466b.js.map} +1 -1
- package/dist/chunks/{9431.95901c72.js → 9431.671db050.js} +2 -2
- package/dist/chunks/{9431.95901c72.js.map → 9431.671db050.js.map} +1 -1
- package/dist/chunks/{eo-auto-complete.6755dd52.js → eo-auto-complete.97bd590a.js} +3 -3
- package/dist/chunks/eo-auto-complete.97bd590a.js.map +1 -0
- package/dist/chunks/{eo-checkbox.fa4ba425.js → eo-checkbox.6ec537aa.js} +2 -2
- package/dist/chunks/eo-checkbox.6ec537aa.js.map +1 -0
- package/dist/chunks/{eo-date-picker.68507a30.js → eo-date-picker.06ae816e.js} +2 -2
- package/dist/chunks/eo-date-picker.06ae816e.js.map +1 -0
- package/dist/chunks/eo-dynamic-form-item.8b1efb9c.js +3 -0
- package/dist/chunks/eo-dynamic-form-item.8b1efb9c.js.map +1 -0
- package/dist/chunks/eo-form-item.1a1aaa2e.js +3 -0
- package/dist/chunks/eo-form-item.1a1aaa2e.js.map +1 -0
- package/dist/chunks/eo-form.ab288dca.js +2 -0
- package/dist/chunks/eo-form.ab288dca.js.map +1 -0
- package/dist/chunks/{eo-icon-select.3fd963d3.js → eo-icon-select.8181e65d.js} +3 -3
- package/dist/chunks/eo-icon-select.8181e65d.js.map +1 -0
- package/dist/chunks/eo-input.dd93b28f.js +3 -0
- package/dist/chunks/eo-input.dd93b28f.js.map +1 -0
- package/dist/chunks/eo-radio.14a11c0d.js +3 -0
- package/dist/chunks/eo-radio.14a11c0d.js.map +1 -0
- package/dist/chunks/eo-search.f6ef814c.js +2 -0
- package/dist/chunks/{eo-search.a8b8191a.js.map → eo-search.f6ef814c.js.map} +1 -1
- package/dist/chunks/{eo-select.8f3336c3.js → eo-select.71443114.js} +3 -3
- package/dist/chunks/eo-select.71443114.js.map +1 -0
- package/dist/chunks/eo-submit-buttons.33292cc5.js +2 -0
- package/dist/chunks/eo-submit-buttons.33292cc5.js.map +1 -0
- package/dist/chunks/{eo-switch.a268bd46.js → eo-switch.705a763d.js} +3 -3
- package/dist/chunks/eo-switch.705a763d.js.map +1 -0
- package/dist/chunks/eo-textarea.2effdb28.js +3 -0
- package/dist/chunks/eo-textarea.2effdb28.js.map +1 -0
- package/dist/chunks/eo-time-picker.91c93658.js +2 -0
- package/dist/chunks/eo-time-picker.91c93658.js.map +1 -0
- package/dist/chunks/eo-time-range-picker.0d53f1af.js +2 -0
- package/dist/chunks/eo-time-range-picker.0d53f1af.js.map +1 -0
- package/dist/chunks/eo-upload-file.4c4003ec.js +3 -0
- package/dist/chunks/eo-upload-file.4c4003ec.js.map +1 -0
- package/dist/chunks/eo-upload-image.a0bbceeb.js +3 -0
- package/dist/chunks/eo-upload-image.a0bbceeb.js.map +1 -0
- package/dist/chunks/main.8c3217da.js +2 -0
- package/dist/chunks/main.8c3217da.js.map +1 -0
- package/dist/{index.2beffd3c.js → index.710badbf.js} +2 -2
- package/dist/index.710badbf.js.map +1 -0
- package/dist/manifest.json +39 -11
- package/dist/types.json +1187 -1140
- package/dist-types/form/index.d.ts +14 -3
- package/dist-types/form-item/convertToItemColName.d.ts +5 -0
- package/dist-types/form-item/convertToItemColName.spec.d.ts +1 -0
- package/dist-types/form-item/index.d.ts +3 -13
- package/dist-types/submit-buttons/index.d.ts +2 -1
- package/dist-types/upload/Upload.d.ts +1 -0
- package/dist-types/upload/upload-file/i18n.d.ts +2 -1
- package/dist-types/upload/upload-file/index.d.ts +23 -0
- package/dist-types/upload/utils.d.ts +6 -1
- package/package.json +3 -3
- package/dist/chunks/3669.ca91bd61.js.map +0 -1
- package/dist/chunks/4669.1e1fa9e8.js +0 -2
- package/dist/chunks/4669.1e1fa9e8.js.map +0 -1
- package/dist/chunks/eo-auto-complete.6755dd52.js.map +0 -1
- package/dist/chunks/eo-checkbox.fa4ba425.js.map +0 -1
- package/dist/chunks/eo-date-picker.68507a30.js.map +0 -1
- package/dist/chunks/eo-dynamic-form-item.180e1294.js +0 -3
- package/dist/chunks/eo-dynamic-form-item.180e1294.js.map +0 -1
- package/dist/chunks/eo-form-item.f07d780c.js +0 -3
- package/dist/chunks/eo-form-item.f07d780c.js.map +0 -1
- package/dist/chunks/eo-form.d80c1a20.js +0 -2
- package/dist/chunks/eo-form.d80c1a20.js.map +0 -1
- package/dist/chunks/eo-icon-select.3fd963d3.js.map +0 -1
- package/dist/chunks/eo-input.e187ee39.js +0 -3
- package/dist/chunks/eo-input.e187ee39.js.map +0 -1
- package/dist/chunks/eo-radio.138abeac.js +0 -3
- package/dist/chunks/eo-radio.138abeac.js.map +0 -1
- package/dist/chunks/eo-search.a8b8191a.js +0 -2
- package/dist/chunks/eo-select.8f3336c3.js.map +0 -1
- package/dist/chunks/eo-submit-buttons.b1efaef0.js +0 -2
- package/dist/chunks/eo-submit-buttons.b1efaef0.js.map +0 -1
- package/dist/chunks/eo-switch.a268bd46.js.map +0 -1
- package/dist/chunks/eo-textarea.94e5e73f.js +0 -3
- package/dist/chunks/eo-textarea.94e5e73f.js.map +0 -1
- package/dist/chunks/eo-time-picker.aaaf13fc.js +0 -2
- package/dist/chunks/eo-time-picker.aaaf13fc.js.map +0 -1
- package/dist/chunks/eo-time-range-picker.bb7cadbc.js +0 -2
- package/dist/chunks/eo-time-range-picker.bb7cadbc.js.map +0 -1
- package/dist/chunks/eo-upload-file.673971b0.js +0 -3
- package/dist/chunks/eo-upload-file.673971b0.js.map +0 -1
- package/dist/chunks/eo-upload-image.6acad592.js +0 -3
- package/dist/chunks/eo-upload-image.6acad592.js.map +0 -1
- package/dist/chunks/main.4c4af774.js +0 -2
- package/dist/chunks/main.4c4af774.js.map +0 -1
- package/dist/index.2beffd3c.js.map +0 -1
- /package/dist/chunks/{5789.d59ac23c.js.LICENSE.txt → 5789.aa34d165.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-auto-complete.6755dd52.js.LICENSE.txt → eo-auto-complete.97bd590a.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-dynamic-form-item.180e1294.js.LICENSE.txt → eo-dynamic-form-item.8b1efb9c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-form-item.f07d780c.js.LICENSE.txt → eo-form-item.1a1aaa2e.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-icon-select.3fd963d3.js.LICENSE.txt → eo-icon-select.8181e65d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-input.e187ee39.js.LICENSE.txt → eo-input.dd93b28f.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-radio.138abeac.js.LICENSE.txt → eo-radio.14a11c0d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-select.8f3336c3.js.LICENSE.txt → eo-select.71443114.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-switch.a268bd46.js.LICENSE.txt → eo-switch.705a763d.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-textarea.94e5e73f.js.LICENSE.txt → eo-textarea.2effdb28.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-upload-file.673971b0.js.LICENSE.txt → eo-upload-file.4c4003ec.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{eo-upload-image.6acad592.js.LICENSE.txt → eo-upload-image.a0bbceeb.js.LICENSE.txt} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ReactNextElement } from "@next-core/react-element";
|
|
3
|
-
import { AbstractForm, FormStore } from "@next-shared/form";
|
|
3
|
+
import { AbstractForm, FormStore, ColProps } from "@next-shared/form";
|
|
4
4
|
import { ComponentSize, Layout } from "../interface.js";
|
|
5
5
|
interface FormProps {
|
|
6
6
|
values?: Record<string, any>;
|
|
@@ -31,13 +31,22 @@ declare class Form extends ReactNextElement implements FormProps, AbstractForm {
|
|
|
31
31
|
set values(value: Record<string, unknown>);
|
|
32
32
|
get values(): Record<string, unknown>;
|
|
33
33
|
/**
|
|
34
|
-
* 布局方式
|
|
34
|
+
* 布局方式(默认 vertical 布局)
|
|
35
|
+
* @default vertical
|
|
35
36
|
*/
|
|
36
|
-
accessor layout: Layout
|
|
37
|
+
accessor layout: Layout;
|
|
37
38
|
/**
|
|
38
39
|
* 表单组件尺寸
|
|
39
40
|
*/
|
|
40
41
|
accessor size: ComponentSize | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* 标签列布局样式(仅当 layout="horizontal" 时有效)
|
|
44
|
+
*/
|
|
45
|
+
accessor labelCol: ColProps;
|
|
46
|
+
/**
|
|
47
|
+
* 输入控件列布局样式(仅当 layout="horizontal" 时有效)
|
|
48
|
+
*/
|
|
49
|
+
accessor wrapperCol: ColProps;
|
|
41
50
|
handleValuesChange: (values: Record<string, unknown>) => void;
|
|
42
51
|
/**
|
|
43
52
|
* 表单校验方法
|
|
@@ -68,6 +77,8 @@ declare class Form extends ReactNextElement implements FormProps, AbstractForm {
|
|
|
68
77
|
}
|
|
69
78
|
interface FormComponentProps extends FormProps {
|
|
70
79
|
formStyle?: React.CSSProperties;
|
|
80
|
+
labelCol?: ColProps;
|
|
81
|
+
wrapperCol?: ColProps;
|
|
71
82
|
onValuesChange?: (value: Record<string, any>) => void;
|
|
72
83
|
onValidateSuccess?: () => void;
|
|
73
84
|
onValidateError?: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ColProps, ColSize } from "@next-shared/form";
|
|
2
|
+
import type { Layout } from "../interface.js";
|
|
3
|
+
export declare function convertToItemColName(colConf: ColProps | undefined, layout: Layout): string;
|
|
4
|
+
export declare function addLabelSizeToWrapperOffset(labelCol: number | string | ColSize, wrapperCol: number | string | ColSize): ColSize;
|
|
5
|
+
export declare function calcWrapperColOffsetWithoutLabel(labelCol: ColProps, wrapperCol: ColProps): ColProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AbstractForm, FormItemElementBase, MessageBody } from "@next-shared/form";
|
|
2
|
+
import { AbstractForm, FormItemElementBase, MessageBody, ColProps } from "@next-shared/form";
|
|
3
3
|
import type { Form } from "../form/index.jsx";
|
|
4
4
|
import type { ComponentSize, Layout } from "../interface.js";
|
|
5
5
|
import "@next-core/theme";
|
|
@@ -19,8 +19,8 @@ export interface FormItemProps {
|
|
|
19
19
|
pattern?: string;
|
|
20
20
|
min?: number;
|
|
21
21
|
max?: number;
|
|
22
|
-
labelCol?:
|
|
23
|
-
wrapperCol?:
|
|
22
|
+
labelCol?: ColProps;
|
|
23
|
+
wrapperCol?: ColProps;
|
|
24
24
|
message?: Record<string, string>;
|
|
25
25
|
layout?: Layout;
|
|
26
26
|
size?: ComponentSize;
|
|
@@ -61,16 +61,6 @@ declare class FormItem extends FormItemElementBase implements FormItemProps {
|
|
|
61
61
|
* 初始值
|
|
62
62
|
*/
|
|
63
63
|
accessor value: string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* 表单项 label 标签布局
|
|
66
|
-
* @group ui
|
|
67
|
-
*/
|
|
68
|
-
accessor labelCol: string | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* 表单项控件布局
|
|
71
|
-
* @group ui
|
|
72
|
-
*/
|
|
73
|
-
accessor wrapperCol: string | undefined;
|
|
74
64
|
accessor valuePropsName: string | undefined;
|
|
75
65
|
accessor layout: Layout | undefined;
|
|
76
66
|
accessor size: ComponentSize | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormItemElementBase } from "@next-shared/form";
|
|
3
|
+
import type { FormItemProps } from "../form-item/index.js";
|
|
3
4
|
import type { ButtonType } from "../interface.js";
|
|
4
|
-
interface SubmitButtonsProps {
|
|
5
|
+
interface SubmitButtonsProps extends FormItemProps {
|
|
5
6
|
curElement: HTMLElement;
|
|
6
7
|
submitText?: string;
|
|
7
8
|
submitType?: ButtonType;
|
|
@@ -19,6 +19,7 @@ export interface UploadProps {
|
|
|
19
19
|
accept?: string;
|
|
20
20
|
multiple?: boolean;
|
|
21
21
|
maxCount?: number;
|
|
22
|
+
limitSize?: number;
|
|
22
23
|
overMaxCountMode?: "ignore" | "replace";
|
|
23
24
|
beforeUploadValidators?: ((file: File, files: File[]) => Promise<unknown>)[];
|
|
24
25
|
beforeUploadUserDataProcessor?: (file: File, fileDataList: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare enum K {
|
|
2
2
|
UPLOAD = "UPLOAD",
|
|
3
3
|
FILE_UPLOADING = "FILE_UPLOADING",
|
|
4
|
-
DRAG_UPLOAD_TEXT = "DRAG_UPLOAD_TEXT"
|
|
4
|
+
DRAG_UPLOAD_TEXT = "DRAG_UPLOAD_TEXT",
|
|
5
|
+
EXCEEDED_FILE_SIZE_LIMIT = "EXCEEDED_FILE_SIZE_LIMIT"
|
|
5
6
|
}
|
|
6
7
|
export declare const NS = "bricks/form/eo-upload-file";
|
|
7
8
|
export declare const locales: {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { ButtonProps } from "@next-bricks/basic/button";
|
|
3
|
+
import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
|
|
2
4
|
import { FormItemElementBase } from "@next-shared/form";
|
|
3
5
|
import type { FormItemProps } from "../../form-item/index.js";
|
|
4
6
|
import "@next-core/theme";
|
|
@@ -12,6 +14,7 @@ export interface UploadFileProps {
|
|
|
12
14
|
multiple?: boolean;
|
|
13
15
|
accept?: string;
|
|
14
16
|
maxCount?: number;
|
|
17
|
+
limitSize?: number;
|
|
15
18
|
overMaxCountMode?: "ignore" | "replace";
|
|
16
19
|
uploadDraggable?: boolean;
|
|
17
20
|
draggableUploadTip?: string;
|
|
@@ -19,6 +22,9 @@ export interface UploadFileProps {
|
|
|
19
22
|
url?: string;
|
|
20
23
|
method?: string;
|
|
21
24
|
uploadName?: string;
|
|
25
|
+
buttonText?: string;
|
|
26
|
+
buttonType?: ButtonProps["type"];
|
|
27
|
+
buttonIcon?: GeneralIconProps;
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
30
|
* 上传文件
|
|
@@ -57,6 +63,23 @@ export declare class EoUploadFile extends FormItemElementBase implements UploadF
|
|
|
57
63
|
* 最大上传数量
|
|
58
64
|
*/
|
|
59
65
|
accessor maxCount: number | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* 上传大小限制(单位为 MB)
|
|
68
|
+
*/
|
|
69
|
+
accessor limitSize: number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* 上传按钮文本
|
|
72
|
+
* @default 上传
|
|
73
|
+
*/
|
|
74
|
+
accessor buttonText: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* 上传按钮类型
|
|
77
|
+
*/
|
|
78
|
+
accessor buttonType: ButtonProps["type"] | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* 上传按钮类型
|
|
81
|
+
*/
|
|
82
|
+
accessor buttonIcon: GeneralIconProps;
|
|
60
83
|
/**
|
|
61
84
|
* 超出最大上传数量时文件的保留方式
|
|
62
85
|
*/
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export declare const symbolForAbortController: unique symbol;
|
|
2
2
|
export declare const LIST_IGNORE: unique symbol;
|
|
3
3
|
export declare const getUid: () => string;
|
|
4
|
+
export declare enum FileSizeUnit {
|
|
5
|
+
KB = "KB",
|
|
6
|
+
MB = "MB",
|
|
7
|
+
GB = "GB"
|
|
8
|
+
}
|
|
4
9
|
export declare const acceptValidator: (file: File, accepts?: string | string[]) => boolean;
|
|
5
|
-
export declare const sizeValidator: (file: File, limitSize?: number) => Promise<unknown>;
|
|
10
|
+
export declare const sizeValidator: (file: File, limitSize?: number, unit?: FileSizeUnit) => Promise<unknown>;
|
|
6
11
|
export type UploadStatus = "uploading" | "done" | "error";
|
|
7
12
|
export interface FileData {
|
|
8
13
|
uid: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-bricks/form",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/form",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"postpublish": "mv package.json.bak package.json"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@next-core/build-next-bricks": "^1.14.
|
|
37
|
+
"@next-core/build-next-bricks": "^1.14.5",
|
|
38
38
|
"@next-core/test-next": "^1.0.11"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "06ec2b39535218af195bfcd77af9f7d498a06b09"
|
|
41
41
|
}
|