@qsxy/element-plus-react 1.0.0-next.2 → 1.0.0-next.3
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/README.md +31 -0
- package/dist/Badge/typings.d.ts +10 -0
- package/dist/Breadcrumb/typings.d.ts +4 -0
- package/dist/Button/typings.d.ts +28 -0
- package/dist/Calendar/CalendarContext.d.ts +10 -0
- package/dist/Calendar/ShortCuts.d.ts +2 -0
- package/dist/Calendar/typings.d.ts +18 -0
- package/dist/Card/typings.d.ts +4 -0
- package/dist/Cascader/CascaderDropdown.d.ts +1 -0
- package/dist/Cascader/CascaderMenu.d.ts +7 -0
- package/dist/Cascader/typings.d.ts +80 -0
- package/dist/Cascader/useCascader.d.ts +72 -0
- package/dist/Checkbox/typings.d.ts +11 -0
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +4 -0
- package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -0
- package/dist/Col/typings.d.ts +10 -0
- package/dist/Collapse/CollapseContext.d.ts +3 -0
- package/dist/Collapse/typings.d.ts +7 -0
- package/dist/ColorPicker/AlphaSlider.d.ts +7 -0
- package/dist/ColorPicker/HueSlider.d.ts +7 -0
- package/dist/ColorPicker/Predefine.d.ts +7 -0
- package/dist/ColorPicker/SvPanel.d.ts +7 -0
- package/dist/ColorPicker/typings.d.ts +9 -0
- package/dist/ConfigProvider/ConfigProvider.d.ts +5 -0
- package/dist/DatePicker/typings.d.ts +69 -0
- package/dist/DateTimePicker/typings.d.ts +1 -0
- package/dist/Descriptions/DescriptionsContext.d.ts +2 -0
- package/dist/Descriptions/typings.d.ts +13 -0
- package/dist/Dialog/DialogContext.d.ts +8 -0
- package/dist/Dialog/typings.d.ts +36 -0
- package/dist/Divider/Divider.d.ts +4 -0
- package/dist/Drawer/DrawerContext.d.ts +10 -0
- package/dist/Drawer/typings.d.ts +16 -0
- package/dist/Dropdown/DropdownContext.d.ts +2 -0
- package/dist/Dropdown/typings.d.ts +15 -0
- package/dist/Form/FormItem.d.ts +12 -0
- package/dist/Form/typings.d.ts +55 -0
- package/dist/Form/useForm.d.ts +22 -0
- package/dist/Form/utils/NameMap.d.ts +3 -0
- package/dist/Form/utils/validateUtil.d.ts +4 -0
- package/dist/Form/utils/valueUtil.d.ts +17 -0
- package/dist/Icon/typings.d.ts +7 -0
- package/dist/Input/typings.d.ts +61 -0
- package/dist/InputNumber/typings.d.ts +21 -0
- package/dist/Link/typings.d.ts +6 -1
- package/dist/Loading/typings.d.ts +5 -0
- package/dist/Message/Main.d.ts +7 -0
- package/dist/Message/index.d.ts +8 -0
- package/dist/Message/typings.d.ts +11 -0
- package/dist/MessageBox/index.d.ts +14 -0
- package/dist/MessageBox/typings.d.ts +50 -0
- package/dist/Notification/Main.d.ts +7 -0
- package/dist/Notification/index.d.ts +15 -0
- package/dist/Notification/typings.d.ts +13 -0
- package/dist/Pagination/typings.d.ts +28 -0
- package/dist/Popconfirm/typings.d.ts +10 -0
- package/dist/Popover/typings.d.ts +12 -0
- package/dist/Popper/typings.d.ts +7 -1
- package/dist/Progress/typings.d.ts +12 -0
- package/dist/Radio/typings.d.ts +7 -0
- package/dist/RadioGroup/typings.d.ts +1 -0
- package/dist/Row/RowContext.d.ts +1 -0
- package/dist/Row/typings.d.ts +4 -0
- package/dist/Scrollbar/typings.d.ts +20 -0
- package/dist/Select/typings.d.ts +33 -0
- package/dist/Skeleton/PlaceholderGraph.d.ts +4 -0
- package/dist/Skeleton/PlaceholderGrid.d.ts +4 -0
- package/dist/Skeleton/PlaceholderParagraph.d.ts +4 -0
- package/dist/Switch/typings.d.ts +15 -0
- package/dist/Table/Colgroup.d.ts +1 -0
- package/dist/Table/TableContext.d.ts +8 -0
- package/dist/Table/hooks/useSelection.d.ts +17 -0
- package/dist/Table/hooks/useTable.d.ts +7 -0
- package/dist/Table/treeUtil.d.ts +39 -0
- package/dist/Table/typings.d.ts +137 -1
- package/dist/Table/util.d.ts +10 -0
- package/dist/Tabs/typings.d.ts +38 -0
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.js +18 -26
- package/dist/Tag/typings.d.ts +10 -0
- package/dist/TimeLine/typings.d.ts +9 -0
- package/dist/TimePicker/typings.d.ts +13 -0
- package/dist/TimePicker/useTimePicker.d.ts +7 -0
- package/dist/Tooltip/Tooltip.js +8 -19
- package/dist/Tooltip/TooltipContext.d.ts +1 -0
- package/dist/Tooltip/typings.d.ts +14 -1
- package/dist/Transfer/ListItem.d.ts +1 -0
- package/dist/Transfer/typings/index.d.ts +27 -0
- package/dist/Transfer/typings/list.d.ts +25 -0
- package/dist/Transfer/typings/listBody.d.ts +1 -0
- package/dist/Transition/Transition.d.ts +10 -0
- package/dist/Transition/TransitionGroup.d.ts +59 -0
- package/dist/Transition/childMapping.d.ts +23 -0
- package/dist/Tree/NodeList.d.ts +3 -0
- package/dist/Tree/RCTree.d.ts +15 -0
- package/dist/Tree/Tree.d.ts +15 -0
- package/dist/Tree/TreeNode.d.ts +7 -0
- package/dist/Tree/contextTypes.d.ts +4 -0
- package/dist/Tree/typings.d.ts +3 -0
- package/dist/Tree/util.d.ts +17 -0
- package/dist/Tree/utils/KeyCode.d.ts +326 -0
- package/dist/Tree/utils/conductUtil.d.ts +6 -0
- package/dist/Tree/utils/dictUtil.d.ts +1 -0
- package/dist/Tree/utils/pickAttrs.d.ts +5 -0
- package/dist/Tree/utils/treeUtil.d.ts +25 -1
- package/dist/TreeSelect/Utils.d.ts +1 -0
- package/dist/TreeSelect/typings.d.ts +19 -0
- package/dist/Upload/typings.d.ts +34 -0
- package/dist/Upload/use-handlers.d.ts +1 -0
- package/dist/Util/Math.d.ts +34 -0
- package/dist/Util/base.d.ts +21 -0
- package/dist/Util/shallowEqual.d.ts +11 -0
- package/dist/Util/treeUtils.d.ts +8 -0
- package/dist/VirtualList/Filler.d.ts +5 -0
- package/dist/VirtualList/VirtualList.d.ts +3 -0
- package/dist/VirtualList/hooks/useLayoutEffect.d.ts +3 -0
- package/dist/VirtualList/utils/algorithmUtil.d.ts +17 -0
- package/dist/VirtualList/utils/findDOMNode.d.ts +3 -0
- package/dist/hooks/animationPropsUtils.d.ts +12 -0
- package/dist/hooks/htmlPropsUtils.d.ts +8 -0
- package/dist/hooks/popperPropsUtils.d.ts +12 -0
- package/dist/hooks/treePropsUtils.d.ts +12 -0
- package/dist/hooks/useChildrenInstance.d.ts +11 -0
- package/dist/hooks/useClassNames.d.ts +78 -0
- package/dist/hooks/useControlled.d.ts +8 -0
- package/dist/hooks/useForceUpdate.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/theme-chalk/link/index.scss +0 -85
- package/dist/types/common.d.ts +24 -0
- package/dist/types/type.d.ts +5 -0
- package/package.json +1 -1
|
@@ -8,5 +8,12 @@ interface Props {
|
|
|
8
8
|
export interface PredefineRef {
|
|
9
9
|
update: () => void;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @author Parker
|
|
13
|
+
* @CreateTime 2022/5/14 19:24:19
|
|
14
|
+
* @LastEditor Parker
|
|
15
|
+
* @ModifyTime 2025/2/22 19:59:12
|
|
16
|
+
* @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
|
|
17
|
+
*/
|
|
11
18
|
declare const Predefine: React.ForwardRefExoticComponent<Props & React.RefAttributes<PredefineRef>>;
|
|
12
19
|
export default Predefine;
|
|
@@ -7,5 +7,12 @@ interface Props {
|
|
|
7
7
|
export interface SvPanelRef {
|
|
8
8
|
update: () => void;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @author Parker
|
|
12
|
+
* @CreateTime 2022/5/14 16:16:37
|
|
13
|
+
* @LastEditor Parker
|
|
14
|
+
* @ModifyTime 2022/11/20 11:54:52
|
|
15
|
+
* @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
|
|
16
|
+
*/
|
|
10
17
|
declare const SvPanel: React.ForwardRefExoticComponent<Props & React.RefAttributes<SvPanelRef>>;
|
|
11
18
|
export default SvPanel;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { PopperOptions } from '../Popper';
|
|
2
2
|
import { AnimationEventProps, BaseProps, NativeProps, TypeAttributes } from '../types/common';
|
|
3
3
|
export interface ColorPickerProps extends BaseProps, NativeProps, AnimationEventProps, PopperOptions {
|
|
4
|
+
/** 绑定值(可控模式) */
|
|
4
5
|
value?: string;
|
|
6
|
+
/** 默认值 */
|
|
5
7
|
defaultValue?: string;
|
|
8
|
+
/** 是否禁用 */
|
|
6
9
|
disabled?: boolean;
|
|
10
|
+
/** 尺寸 */
|
|
7
11
|
size?: TypeAttributes.Size;
|
|
12
|
+
/** 是否支持透明度选择 */
|
|
8
13
|
showAlpha?: boolean;
|
|
14
|
+
/** 颜色的格式 */
|
|
9
15
|
colorFormat?: 'hsl' | 'hsv' | 'hex' | 'rgb';
|
|
16
|
+
/** 预定义颜色 */
|
|
10
17
|
predefine?: string[];
|
|
18
|
+
/** 当绑定值变化时触发 */
|
|
11
19
|
onChange?: (value?: string) => void;
|
|
20
|
+
/** 面板中当前显示的颜色发生改变时触发 */
|
|
12
21
|
activeChange?: (value?: string) => void;
|
|
13
22
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ConfigProviderProps {
|
|
3
|
+
/** 对按钮进行配置 */
|
|
3
4
|
button?: {
|
|
5
|
+
/** 自动在两个中文字符之间插入空格 */
|
|
4
6
|
autoInsertSpace?: boolean;
|
|
5
7
|
};
|
|
8
|
+
/** 对消息进行配置 */
|
|
9
|
+
/** 对数字输入框进行配置 */
|
|
6
10
|
inputNumber?: {
|
|
11
|
+
/** 控制按钮位置 */
|
|
7
12
|
controlsPositionRight?: boolean;
|
|
8
13
|
max?: number;
|
|
9
14
|
min?: number;
|
|
@@ -12,84 +12,153 @@ export type DatePickerRef = {
|
|
|
12
12
|
setVisible: (value: boolean) => void;
|
|
13
13
|
};
|
|
14
14
|
export interface DatePickerProps extends Omit<FormControlBaseProps, 'name' | 'value' | 'defaultValue' | 'onChange'>, BaseProps, NativeProps, AnimationEventProps, Omit<React.AllHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'size' | 'prefix' | 'type' | 'onInput' | 'onChange' | 'className' | 'style' | 'readOnly' | 'disabled' | 'children'> {
|
|
15
|
+
/** 等价于原生 name 属性 */
|
|
15
16
|
name?: string;
|
|
17
|
+
/** 选中项绑定值 */
|
|
16
18
|
value?: string;
|
|
19
|
+
/** 默认值 */
|
|
17
20
|
defaultValue?: string;
|
|
21
|
+
/** 只读 */
|
|
18
22
|
readonly?: boolean;
|
|
23
|
+
/** 必输项*/
|
|
19
24
|
required?: boolean;
|
|
25
|
+
/** 是否显示清除按钮 */
|
|
20
26
|
clearable?: boolean;
|
|
27
|
+
/** 非范围选择时的占位内容 */
|
|
21
28
|
placeholder?: string;
|
|
29
|
+
/** 是否展示“今天”按钮 */
|
|
22
30
|
showToday?: boolean;
|
|
31
|
+
/** 显示类型 */
|
|
23
32
|
type?: DateType;
|
|
33
|
+
/** 显示在输入框中的格式 */
|
|
24
34
|
format?: string;
|
|
35
|
+
/** 可选,绑定值的格式。 不指定则绑定值为 Date 对象 */
|
|
25
36
|
valueFormat?: string;
|
|
37
|
+
/** 设置ISO周数,其中1为星期一,7为星期日 */
|
|
26
38
|
isoWeek?: boolean;
|
|
39
|
+
/** 表单校验错误提示 */
|
|
27
40
|
error?: boolean;
|
|
41
|
+
/** 表单校验警告提示 */
|
|
28
42
|
warning?: boolean;
|
|
43
|
+
/** 输入框前置内容,只对 type="text" 有效 */
|
|
29
44
|
prepend?: React.ReactElement<any> | string | number;
|
|
45
|
+
/** 输入框后置内容,只对 type="text" 有效 */
|
|
30
46
|
append?: React.ReactElement | string | number;
|
|
47
|
+
/** 是否纯文本模式,即无边框 */
|
|
31
48
|
plain?: boolean;
|
|
32
49
|
size?: TypeAttributes.Size;
|
|
50
|
+
/** 一个用来判断该日期是否被禁用的函数,接受一个 Date 对象作为参数。 应该返回一个 Boolean 值。 */
|
|
33
51
|
disabledDate?: (time: Date) => boolean;
|
|
34
52
|
shortcuts?: Shortcuts[];
|
|
53
|
+
/** 是否追加到body下 */
|
|
35
54
|
appendToBody?: boolean;
|
|
55
|
+
/** 点击确定按钮的回调 */
|
|
36
56
|
onOk?: () => void;
|
|
37
57
|
onChange?: (value: string | Date | number, event?: Event) => void;
|
|
58
|
+
/** 格式化 */
|
|
38
59
|
formatter?: (value: Dayjs, text: number) => React.ReactElement;
|
|
39
60
|
}
|
|
40
61
|
export interface DatePickerRangeProps extends Omit<FormControlBaseProps, 'name' | 'value' | 'defaultValue' | 'onChange'>, BaseProps, AnimationEventProps, NativeProps {
|
|
62
|
+
/** 等价于原生 name 属性 */
|
|
41
63
|
name?: [string, string];
|
|
64
|
+
/** 选中项绑定值 */
|
|
42
65
|
value?: [string, string];
|
|
66
|
+
/** 默认值 */
|
|
43
67
|
defaultValue?: [string, string];
|
|
68
|
+
/** 只读 */
|
|
44
69
|
readOnly?: boolean;
|
|
70
|
+
/** 禁用 */
|
|
45
71
|
disabled?: boolean;
|
|
72
|
+
/** 是否显示清除按钮 */
|
|
46
73
|
clearable?: boolean;
|
|
74
|
+
/** 范围选择时开始日期的占位内容 */
|
|
47
75
|
startPlaceholder?: string;
|
|
76
|
+
/** 范围选择时结束日期的占位内容 */
|
|
48
77
|
endPlaceholder?: string;
|
|
78
|
+
/** 显示类型 */
|
|
49
79
|
type?: DateRangeType;
|
|
80
|
+
/** 显示在输入框中的格式 */
|
|
50
81
|
format?: string;
|
|
82
|
+
/** 可选,绑定值的格式。 不指定则绑定值为 Date 对象 */
|
|
51
83
|
valueFormat?: string;
|
|
84
|
+
/** 选择范围时的分隔符 */
|
|
52
85
|
rangeSeparator?: string;
|
|
86
|
+
/** 在范围选择器里取消两个日期面板之间的联动 */
|
|
53
87
|
unlinkPanels?: boolean;
|
|
88
|
+
/** 设置ISO周数,其中1为星期一,7为星期日 */
|
|
54
89
|
isoWeek?: boolean;
|
|
90
|
+
/** 表单校验错误提示 */
|
|
55
91
|
error?: boolean;
|
|
92
|
+
/** 表单校验警告提示 */
|
|
56
93
|
warning?: boolean;
|
|
94
|
+
/** 输入框前置内容,只对 type="text" 有效 */
|
|
57
95
|
prepend?: React.ReactElement<any> | string | number;
|
|
96
|
+
/** 输入框后置内容,只对 type="text" 有效 */
|
|
58
97
|
append?: React.ReactElement | string | number;
|
|
98
|
+
/** 点击确定按钮的回调 */
|
|
59
99
|
onOk?: () => void;
|
|
100
|
+
/** 一个用来判断该日期是否被禁用的函数,接受一个 Date 对象作为参数。 应该返回一个 Boolean 值。 */
|
|
60
101
|
disabledDate?: (time: Date) => boolean;
|
|
61
102
|
onChange?: (value: [string, string] | [Date, Date] | [number, number], event?: Event) => void;
|
|
103
|
+
/** 格式化 */
|
|
62
104
|
formatter?: (value: Dayjs, text: number) => React.ReactElement;
|
|
63
105
|
}
|
|
64
106
|
export interface AllDatePickerProps extends Omit<FormControlBaseProps, 'name' | 'value' | 'defaultValue' | 'onChange'>, BaseProps, NativeProps, AnimationEventProps, Omit<React.AllHTMLAttributes<HTMLInputElement>, 'name' | 'value' | 'defaultValue' | 'size' | 'prefix' | 'type' | 'onInput' | 'onChange' | 'className' | 'style' | 'readOnly' | 'disabled' | 'children'> {
|
|
107
|
+
/** 等价于原生 name 属性 */
|
|
65
108
|
name?: string | [string, string];
|
|
109
|
+
/** 选中项绑定值 */
|
|
66
110
|
value?: string | Date | number | [string, string] | [Date, Date] | [number, number];
|
|
111
|
+
/** 默认值 */
|
|
67
112
|
defaultValue?: string | Date | number | [string, string] | [Date, Date] | [number, number];
|
|
113
|
+
/** 只读 */
|
|
68
114
|
readonly?: boolean;
|
|
115
|
+
/** 必输项*/
|
|
69
116
|
required?: boolean;
|
|
117
|
+
/** 是否显示清除按钮 */
|
|
70
118
|
clearable?: boolean;
|
|
119
|
+
/** 非范围选择时的占位内容 */
|
|
71
120
|
placeholder?: string;
|
|
121
|
+
/** 是否展示“今天”按钮 */
|
|
72
122
|
showToday?: boolean;
|
|
123
|
+
/** 显示类型 */
|
|
73
124
|
type?: DateType | DateRangeType;
|
|
125
|
+
/** 显示在输入框中的格式 */
|
|
74
126
|
format?: string;
|
|
127
|
+
/** 可选,绑定值的格式。 不指定则绑定值为 Date 对象 */
|
|
75
128
|
valueFormat?: string;
|
|
129
|
+
/** 设置ISO周数,其中1为星期一,7为星期日 */
|
|
76
130
|
isoWeek?: boolean;
|
|
131
|
+
/** 表单校验错误提示 */
|
|
77
132
|
error?: boolean;
|
|
133
|
+
/** 表单校验警告提示 */
|
|
78
134
|
warning?: boolean;
|
|
135
|
+
/** 输入框前置内容,只对 type="text" 有效 */
|
|
79
136
|
prepend?: React.ReactElement<any> | string | number;
|
|
137
|
+
/** 输入框后置内容,只对 type="text" 有效 */
|
|
80
138
|
append?: React.ReactElement | string | number;
|
|
139
|
+
/** 是否纯文本模式,即无边框 */
|
|
81
140
|
plain?: boolean;
|
|
82
141
|
size?: TypeAttributes.Size;
|
|
142
|
+
/** 一个用来判断该日期是否被禁用的函数,接受一个 Date 对象作为参数。 应该返回一个 Boolean 值。 */
|
|
83
143
|
disabledDate?: (time: Date) => boolean;
|
|
84
144
|
shortcuts?: Shortcuts[];
|
|
145
|
+
/** 是否追加到body下 */
|
|
85
146
|
appendToBody?: boolean;
|
|
147
|
+
/** 点击确定按钮的回调 */
|
|
86
148
|
onOk?: () => void;
|
|
87
149
|
onChange?: (value: string | Date | number | [string, string] | [Date, Date] | [number, number], event?: Event) => void;
|
|
150
|
+
/** 格式化 */
|
|
88
151
|
formatter?: (value: Dayjs, text: number) => React.ReactElement;
|
|
152
|
+
/** 只读 */
|
|
89
153
|
readOnly?: boolean;
|
|
154
|
+
/** 禁用 */
|
|
90
155
|
disabled?: boolean;
|
|
156
|
+
/** 范围选择时开始日期的占位内容 */
|
|
91
157
|
startPlaceholder?: string;
|
|
158
|
+
/** 范围选择时结束日期的占位内容 */
|
|
92
159
|
endPlaceholder?: string;
|
|
160
|
+
/** 选择范围时的分隔符 */
|
|
93
161
|
rangeSeparator?: string;
|
|
162
|
+
/** 在范围选择器里取消两个日期面板之间的联动 */
|
|
94
163
|
unlinkPanels?: boolean;
|
|
95
164
|
}
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseProps, NativeProps, TypeAttributes } from '../types/common';
|
|
3
3
|
export interface DescriptionsProps extends BaseProps<React.ReactElement<DescriptionsItemProps> | React.ReactElement<DescriptionsItemProps>[]>, NativeProps<'--el-descriptions-table-border' | '--el-descriptions-item-bordered-label-background'> {
|
|
4
|
+
/** 是否带有边框 */
|
|
4
5
|
border?: boolean;
|
|
6
|
+
/** 一行 Descriptions Item 的数量 */
|
|
5
7
|
column?: number;
|
|
8
|
+
/** 排列的方向 */
|
|
6
9
|
direction?: 'vertical' | 'horizontal';
|
|
10
|
+
/** 列表的尺寸 */
|
|
7
11
|
size?: TypeAttributes.Size;
|
|
12
|
+
/** 标题文本,显示在左上方 */
|
|
8
13
|
title?: string | React.ReactElement<any>;
|
|
14
|
+
/** 操作区文本,显示在右上方 */
|
|
9
15
|
extra?: string | React.ReactElement<any>;
|
|
10
16
|
}
|
|
11
17
|
export interface DescriptionsItemProps extends BaseProps, NativeProps {
|
|
18
|
+
/** 标签文本 */
|
|
12
19
|
label?: string | React.ReactElement<any>;
|
|
20
|
+
/** 列的数量 */
|
|
13
21
|
span?: number;
|
|
22
|
+
/** 列的宽度,不同行相同列的宽度按最大值设定(如无 border ,宽度包含标签与内容) */
|
|
14
23
|
width?: number | string;
|
|
24
|
+
/** 列的最小宽度,与 width 的区别是 width 是固定的,minWidth 会把剩余宽度按比例分配给设置了 minWidth 的列(如无 border,宽度包含标签与内容) */
|
|
15
25
|
minWidth?: number | string;
|
|
26
|
+
/** 列的内容对齐方式(如无 border,对标签和内容均生效) */
|
|
16
27
|
align?: 'left' | 'center' | 'right';
|
|
28
|
+
/** 列的标签对齐方式,若不设置该项,则使用内容的对齐方式(如无 border,请使用 align 参数) */
|
|
17
29
|
labelAlign?: 'left' | 'center' | 'right';
|
|
30
|
+
/** 列标题自定义类名 */
|
|
18
31
|
labelClassName?: string;
|
|
19
32
|
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface DialogContentProps {
|
|
3
|
+
/** 当设置为 true,Dialog 打开时会显示背景,点击背景会关闭 Dialog,如果不想关闭 Dialog,可以设置为 'static' */
|
|
3
4
|
backdrop: boolean | 'static';
|
|
4
5
|
setVisible: (visible: boolean) => void;
|
|
6
|
+
/** 隐藏时的回调函数 */
|
|
5
7
|
doClose: () => void;
|
|
8
|
+
/** 是否可控 */
|
|
6
9
|
isControlled: boolean;
|
|
10
|
+
/** 是否让 Dialog 的 header 和 footer 部分居中排列 */
|
|
7
11
|
center: boolean;
|
|
12
|
+
/** body 内容过长时自动设置高度 */
|
|
8
13
|
overflow: boolean;
|
|
14
|
+
/** 是否加载成功 */
|
|
9
15
|
mounted?: boolean;
|
|
16
|
+
/** 是否有标题 */
|
|
10
17
|
haveTitle: boolean;
|
|
18
|
+
/** 是否有按钮组 */
|
|
11
19
|
haveFooter: boolean;
|
|
12
20
|
}
|
|
13
21
|
export declare const DialogContext: import("react").Context<DialogContentProps>;
|
package/dist/Dialog/typings.d.ts
CHANGED
|
@@ -2,47 +2,83 @@ import React from 'react';
|
|
|
2
2
|
import { TransitionProps } from '../Transition';
|
|
3
3
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
4
4
|
export interface DialogProps extends AnimationEventProps, BaseProps, NativeProps, TransitionProps {
|
|
5
|
+
/** 是否显示模态框(可控) */
|
|
5
6
|
visible?: boolean;
|
|
7
|
+
/** 默认是否显示模态框 */
|
|
6
8
|
defaultVisible?: boolean;
|
|
9
|
+
/** 是否需要遮罩层 */
|
|
7
10
|
modal?: boolean;
|
|
11
|
+
/** 遮罩的自定义类名 */
|
|
8
12
|
className?: string;
|
|
13
|
+
/** 是否可以通过点击 modal 关闭 Dialog */
|
|
9
14
|
closeOnClickModal?: boolean;
|
|
15
|
+
/** 应用于 backdrop DOM 节点的 css class */
|
|
10
16
|
backdropClassName?: string;
|
|
17
|
+
/** 对话框的宽度,默认值为 50% */
|
|
11
18
|
width?: string | number;
|
|
19
|
+
/** header 部分的自定义 class 名 */
|
|
12
20
|
headerClass?: string;
|
|
21
|
+
/** Dialog 对话框 Dialog 的标题, 也可通过ElDialog.header传入 */
|
|
13
22
|
title?: string | React.ReactElement;
|
|
23
|
+
/** 当设置为 true, 显示关闭按钮 */
|
|
14
24
|
showClose?: boolean;
|
|
25
|
+
/** 标题是否有边框 */
|
|
15
26
|
border?: boolean;
|
|
27
|
+
/** dialog CSS 中的 margin-top 值,默认为 15vh */
|
|
16
28
|
top?: string;
|
|
29
|
+
/** 是否让 Dialog 的 header 和 footer 部分居中排列 */
|
|
17
30
|
center?: boolean;
|
|
31
|
+
/** 是否水平垂直对齐对话框 */
|
|
18
32
|
alignCenter?: boolean;
|
|
33
|
+
/** 为 Dialog 启用可拖拽功能 */
|
|
19
34
|
draggable?: boolean;
|
|
35
|
+
/** 拖动范围可以超出可视区 */
|
|
20
36
|
overflow?: boolean;
|
|
37
|
+
/** 是否为全屏 Dialog */
|
|
21
38
|
fullscreen?: boolean;
|
|
39
|
+
/** 是否在 Dialog 出现时将 body 滚动锁定 */
|
|
22
40
|
lockScroll?: boolean;
|
|
41
|
+
/** 是否可以通过按下 ESC 关闭 Dialog */
|
|
42
|
+
/** 和原生的 CSS 的 z-index 相同,改变 z 轴的顺序 */
|
|
23
43
|
zIndex?: number;
|
|
44
|
+
/** Dialog 打开的回调 */
|
|
24
45
|
onOpen?: () => void;
|
|
46
|
+
/** Dialog 打开动画结束时的回调 */
|
|
25
47
|
onOpened?: () => void;
|
|
48
|
+
/** Dialog 关闭的回调 */
|
|
26
49
|
onClose?: () => void;
|
|
50
|
+
/** Dialog 关闭动画结束时的回调 */
|
|
27
51
|
onClosed?: () => void;
|
|
52
|
+
/** 关闭弹窗函数 */
|
|
28
53
|
close?: () => void;
|
|
54
|
+
/** 关闭前的回调,会暂停 Dialog 的关闭. 回调函数内执行 done 参数方法的时候才是真正关闭对话框的时候. */
|
|
29
55
|
beforeClose?: DialogBeforeCloseFn;
|
|
30
56
|
}
|
|
31
57
|
type DoneFn = (cancel?: boolean) => void;
|
|
32
58
|
export type DialogBeforeCloseFn = (done: DoneFn) => void;
|
|
33
59
|
export interface DialogHeaderProps extends BaseProps {
|
|
60
|
+
/** header 部分的自定义 class 名 */
|
|
34
61
|
headerClass?: string;
|
|
62
|
+
/** 当设置为 true, 显示关闭按钮 */
|
|
35
63
|
showClose?: boolean;
|
|
64
|
+
/** 标题是否有边框 */
|
|
36
65
|
border?: boolean;
|
|
66
|
+
/** 组件 CSS 类的前缀 */
|
|
37
67
|
classPrefix?: string;
|
|
68
|
+
/** 隐藏时的回调函数 */
|
|
69
|
+
/** 自定义标题内联样式 */
|
|
38
70
|
titleStyle?: React.CSSProperties;
|
|
39
71
|
}
|
|
40
72
|
export interface DialogBodyProps extends BaseProps, NativeProps {
|
|
73
|
+
/** 组件 CSS 类的前缀 */
|
|
41
74
|
classPrefix?: string;
|
|
75
|
+
/** 内容区域padding */
|
|
42
76
|
padding?: string | number;
|
|
43
77
|
}
|
|
44
78
|
export interface DialogFooterProps extends BaseProps, NativeProps {
|
|
79
|
+
/** 组件 CSS 类的前缀 */
|
|
45
80
|
classPrefix?: string;
|
|
81
|
+
/** 内容位置 */
|
|
46
82
|
position?: 'left' | 'center' | 'right';
|
|
47
83
|
}
|
|
48
84
|
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseProps, NativeProps } from '../types/common';
|
|
3
3
|
export interface DividerProps extends BaseProps, NativeProps<'--el-divider-text-bg-color' | '--el-divider-border-color' | '--el-divider-margin' | '--el-divider-tip-bg-color' | '--el-border-style'> {
|
|
4
|
+
/** 设置分割线方向 */
|
|
4
5
|
direction?: 'horizontal' | 'vertical';
|
|
6
|
+
/** 设置分隔符样式 */
|
|
5
7
|
borderStyle?: string;
|
|
8
|
+
/** 自定义文本样式 */
|
|
6
9
|
textStyle?: React.CSSProperties;
|
|
10
|
+
/** 设置分割线文案的位置 */
|
|
7
11
|
contentPosition?: 'left' | 'right' | 'center';
|
|
8
12
|
}
|
|
9
13
|
declare const _default: React.NamedExoticComponent<DividerProps>;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface DrawerContentProps {
|
|
3
|
+
/** 当设置为 true,Drawer 打开时会显示背景,点击背景会关闭 Drawer,如果不想关闭 Drawer,可以设置为 'static' */
|
|
3
4
|
backdrop: boolean | 'static';
|
|
4
5
|
setVisible: (visible: boolean) => void;
|
|
6
|
+
/** 隐藏时的回调函数 */
|
|
5
7
|
onClose: () => void;
|
|
8
|
+
/** 是否可控 */
|
|
6
9
|
isControlled: boolean;
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @author Parker
|
|
13
|
+
* @CreateTime 2022/3/20下午3:10:40
|
|
14
|
+
* @LastEditor Parker
|
|
15
|
+
* @ModifyTime 2022/5/3 22:55:13
|
|
16
|
+
* @Description 模态框上下文
|
|
17
|
+
*/
|
|
8
18
|
export declare const DrawerContext: import("react").Context<DrawerContentProps>;
|
|
9
19
|
export {};
|
package/dist/Drawer/typings.d.ts
CHANGED
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
3
3
|
export interface DrawerProps extends AnimationEventProps, BaseProps, NativeProps {
|
|
4
|
+
/** 是否显示抽屉(可控) */
|
|
4
5
|
visible?: boolean;
|
|
6
|
+
/** 默认是否显示抽屉 */
|
|
5
7
|
defaultVisible?: boolean;
|
|
8
|
+
/** 当设置为 true,Drawer 打开时会显示背景,点击背景会关闭 Drawer,如果不想关闭 Drawer,可以设置为 'static' */
|
|
6
9
|
backdrop?: boolean | 'static';
|
|
10
|
+
/** 应用于 backdrop DOM 节点的 css class */
|
|
7
11
|
backdropClassName?: string;
|
|
12
|
+
/** 设置 Drawer 尺寸 */
|
|
8
13
|
size?: 'full' | 'large' | 'md' | 'small' | 'xs';
|
|
14
|
+
/** 设置 Drawer 显示的位置 */
|
|
9
15
|
placement?: 'top' | 'bottom' | 'right' | 'left';
|
|
16
|
+
/** 显示时的回调函数 */
|
|
10
17
|
onOpen?: () => void;
|
|
18
|
+
/** 隐藏时的回调函数 */
|
|
11
19
|
onClose?: () => void;
|
|
12
20
|
}
|
|
13
21
|
export interface DrawerHeaderProps extends BaseProps, NativeProps {
|
|
22
|
+
/** 当设置为 true, 显示关闭按钮 */
|
|
14
23
|
closeButton?: boolean;
|
|
24
|
+
/** 标题是否有边框 */
|
|
15
25
|
border?: boolean;
|
|
26
|
+
/** 组件 CSS 类的前缀 */
|
|
16
27
|
classPrefix?: string;
|
|
28
|
+
/** 隐藏时的回调函数 */
|
|
17
29
|
onClose?: () => void;
|
|
30
|
+
/** 自定义标题内联样式 */
|
|
18
31
|
titleStyle?: React.CSSProperties;
|
|
19
32
|
}
|
|
20
33
|
export interface DrawerBodyProps extends BaseProps, NativeProps {
|
|
34
|
+
/** 组件 CSS 类的前缀 */
|
|
21
35
|
classPrefix?: string;
|
|
36
|
+
/** 内容区域padding */
|
|
22
37
|
padding?: string | number;
|
|
23
38
|
}
|
|
24
39
|
export interface DrawerFooterProps extends BaseProps, NativeProps {
|
|
40
|
+
/** 组件 CSS 类的前缀 */
|
|
25
41
|
classPrefix?: string;
|
|
26
42
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface DropdownContextProps {
|
|
3
|
+
/** 是否在点击菜单项后隐藏菜单 */
|
|
3
4
|
hideOnClick: boolean;
|
|
5
|
+
/** 点击菜单项触发的事件回调 */
|
|
4
6
|
onClick: (command: string | number | object) => void;
|
|
5
7
|
}
|
|
6
8
|
export declare const DropdownContext: import("react").Context<DropdownContextProps>;
|
|
@@ -2,26 +2,41 @@ import React from 'react';
|
|
|
2
2
|
import { PopperOptions } from '../Popper';
|
|
3
3
|
import { TransitionProps } from '../Transition';
|
|
4
4
|
import { AnimationEventProps, BaseProps, NativeProps } from '../types/common';
|
|
5
|
+
/** Dropdown 属性 */
|
|
5
6
|
export interface DropdownProps extends BaseProps, NativeProps, PopperOptions, AnimationEventProps, TransitionProps {
|
|
6
7
|
menu: React.ReactElement<DropdownMenuProps>;
|
|
8
|
+
/** 触发下拉的行为 */
|
|
7
9
|
trigger?: 'hover' | 'click' | 'contextmenu';
|
|
10
|
+
/** 是否在点击菜单项后隐藏菜单 */
|
|
8
11
|
hideOnClick?: boolean;
|
|
12
|
+
/** 展开下拉菜单的延时,仅在 trigger 为 hover 时有效 */
|
|
9
13
|
showTimeout?: number;
|
|
14
|
+
/** 收起下拉菜单的延时(仅在 trigger 为 hover 时有效) */
|
|
10
15
|
hideTimeout?: number;
|
|
16
|
+
/** 状态是否可见 */
|
|
11
17
|
visible?: boolean;
|
|
18
|
+
/** 初始值 */
|
|
12
19
|
defaultVisible?: boolean;
|
|
20
|
+
/** 是否禁用 */
|
|
13
21
|
disabled?: boolean;
|
|
14
22
|
onMouseEnter?: (e?: React.MouseEvent<any>) => void;
|
|
15
23
|
onMouseLeave?: (e?: React.MouseEvent<any>) => void;
|
|
24
|
+
/** 点击菜单项触发的事件回调 */
|
|
16
25
|
onClick?: (command: string | number | object) => void;
|
|
26
|
+
/** 下拉框出现/隐藏时触发: 出现则为 true,隐藏则为 false */
|
|
17
27
|
visiblechange?: (visible: boolean) => void;
|
|
18
28
|
}
|
|
19
29
|
export interface DropdownMenuProps extends BaseProps, NativeProps {
|
|
20
30
|
classPrefix?: string;
|
|
21
31
|
}
|
|
32
|
+
/** Dropdown-Item 属性 */
|
|
22
33
|
export interface DropdownItemProps extends BaseProps, NativeProps {
|
|
34
|
+
/** 派发到command回调函数的指令参数 */
|
|
23
35
|
command?: string | number | object;
|
|
36
|
+
/** 是否禁用*/
|
|
24
37
|
disabled?: boolean;
|
|
38
|
+
/** 是否显示分隔符 */
|
|
25
39
|
divided?: boolean;
|
|
40
|
+
/** 是否为激活状态 */
|
|
26
41
|
active?: boolean;
|
|
27
42
|
}
|
package/dist/Form/FormItem.d.ts
CHANGED
|
@@ -9,14 +9,22 @@ interface ChildProps {
|
|
|
9
9
|
}
|
|
10
10
|
export interface InternalFieldProps<Values = any> extends Omit<FormItemProps<Values>, 'children'> {
|
|
11
11
|
children?: ComponentChildren | ((control: ChildProps, meta: Meta, form: FormInstance<Values>) => React.ReactElement);
|
|
12
|
+
/**
|
|
13
|
+
* Set up `dependencies` field.
|
|
14
|
+
* When dependencies field update and current field is touched,
|
|
15
|
+
* will trigger validate rules and render.
|
|
16
|
+
*/
|
|
12
17
|
dependencies?: NamePath[];
|
|
13
18
|
getValueFromEvent?: (...args: EventArgs) => StoreValue;
|
|
19
|
+
/** 字段名,支持数组 */
|
|
14
20
|
name?: InternalNamePath;
|
|
15
21
|
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
22
|
+
/** 校验规则,设置字段的校验逻辑。点击此处查看示例 */
|
|
16
23
|
rules?: Rule[];
|
|
17
24
|
shouldUpdate?: ShouldUpdate<Values>;
|
|
18
25
|
trigger?: string;
|
|
19
26
|
validateTrigger?: string | string[] | false;
|
|
27
|
+
/** 当某一规则校验不通过时,是否停止剩下的规则的校验。设置 parallel 时会并行校验 */
|
|
20
28
|
validateFirst?: boolean | 'parallel';
|
|
21
29
|
valuePropName?: string;
|
|
22
30
|
getValueProps?: (value: StoreValue) => Record<string, unknown>;
|
|
@@ -27,8 +35,12 @@ export interface InternalFieldProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
27
35
|
destroy?: boolean;
|
|
28
36
|
}) => void;
|
|
29
37
|
preserve?: boolean;
|
|
38
|
+
/** @private Passed by Form.List props. Do not use since it will break by path check. */
|
|
30
39
|
isListField?: boolean;
|
|
40
|
+
/** @private Passed by Form.List props. Do not use since it will break by path check. */
|
|
31
41
|
isList?: boolean;
|
|
42
|
+
/** @private Pass context as prop instead of context api
|
|
43
|
+
* since class component can not get context in constructor */
|
|
32
44
|
fieldContext?: InternalFormInstance;
|
|
33
45
|
}
|
|
34
46
|
export interface FieldProps<Values = any> extends Omit<InternalFieldProps<Values>, 'name' | 'fieldContext'> {
|