@qsxy/element-plus-react 1.0.0-next.2 → 1.0.0-next.4

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.
Files changed (144) hide show
  1. package/README.md +29 -0
  2. package/dist/Badge/Badge.js +1 -1
  3. package/dist/Badge/typings.d.ts +10 -0
  4. package/dist/Breadcrumb/typings.d.ts +4 -0
  5. package/dist/Button/typings.d.ts +28 -0
  6. package/dist/Calendar/CalendarContext.d.ts +10 -0
  7. package/dist/Calendar/ShortCuts.d.ts +2 -0
  8. package/dist/Calendar/typings.d.ts +18 -0
  9. package/dist/Card/typings.d.ts +4 -0
  10. package/dist/Cascader/CascaderDropdown.d.ts +1 -0
  11. package/dist/Cascader/CascaderMenu.d.ts +7 -0
  12. package/dist/Cascader/typings.d.ts +80 -0
  13. package/dist/Cascader/useCascader.d.ts +72 -0
  14. package/dist/Checkbox/typings.d.ts +11 -0
  15. package/dist/CheckboxGroup/CheckboxGroup.d.ts +4 -0
  16. package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -0
  17. package/dist/Col/typings.d.ts +10 -0
  18. package/dist/Collapse/CollapseContext.d.ts +3 -0
  19. package/dist/Collapse/CollapseItem.js +1 -1
  20. package/dist/Collapse/typings.d.ts +7 -0
  21. package/dist/ColorPicker/AlphaSlider.d.ts +7 -0
  22. package/dist/ColorPicker/HueSlider.d.ts +7 -0
  23. package/dist/ColorPicker/Predefine.d.ts +7 -0
  24. package/dist/ColorPicker/SvPanel.d.ts +7 -0
  25. package/dist/ColorPicker/typings.d.ts +9 -0
  26. package/dist/ConfigProvider/ConfigProvider.d.ts +5 -0
  27. package/dist/DatePicker/typings.d.ts +69 -0
  28. package/dist/DateTimePicker/DateTimePicker.d.ts +1 -1
  29. package/dist/DateTimePicker/DateTimePicker.js +3 -3
  30. package/dist/DateTimePicker/typings.d.ts +1 -0
  31. package/dist/Descriptions/DescriptionsContext.d.ts +2 -0
  32. package/dist/Descriptions/typings.d.ts +13 -0
  33. package/dist/Dialog/DialogContext.d.ts +8 -0
  34. package/dist/Dialog/typings.d.ts +38 -2
  35. package/dist/Divider/Divider.d.ts +4 -0
  36. package/dist/Drawer/Drawer.js +18 -9
  37. package/dist/Drawer/DrawerContext.d.ts +10 -0
  38. package/dist/Drawer/typings.d.ts +16 -0
  39. package/dist/Dropdown/Dropdown.js +1 -1
  40. package/dist/Dropdown/DropdownContext.d.ts +2 -0
  41. package/dist/Dropdown/typings.d.ts +16 -1
  42. package/dist/Form/FormItem.d.ts +12 -0
  43. package/dist/Form/typings.d.ts +55 -0
  44. package/dist/Form/useForm.d.ts +22 -0
  45. package/dist/Form/utils/NameMap.d.ts +3 -0
  46. package/dist/Form/utils/validateUtil.d.ts +4 -0
  47. package/dist/Form/utils/valueUtil.d.ts +17 -0
  48. package/dist/Icon/typings.d.ts +7 -0
  49. package/dist/Input/Input.js +2 -1
  50. package/dist/Input/typings.d.ts +61 -0
  51. package/dist/InputNumber/typings.d.ts +21 -0
  52. package/dist/Link/typings.d.ts +6 -1
  53. package/dist/Loading/typings.d.ts +5 -0
  54. package/dist/Message/Main.d.ts +7 -0
  55. package/dist/Message/index.d.ts +8 -0
  56. package/dist/Message/typings.d.ts +11 -0
  57. package/dist/MessageBox/index.d.ts +14 -0
  58. package/dist/MessageBox/typings.d.ts +50 -0
  59. package/dist/Notification/Main.d.ts +7 -0
  60. package/dist/Notification/index.d.ts +15 -0
  61. package/dist/Notification/typings.d.ts +13 -0
  62. package/dist/Pagination/typings.d.ts +28 -0
  63. package/dist/Popconfirm/Popconfirm.js +1 -1
  64. package/dist/Popconfirm/typings.d.ts +12 -1
  65. package/dist/Popover/Popover.js +1 -1
  66. package/dist/Popover/typings.d.ts +13 -1
  67. package/dist/Popper/typings.d.ts +7 -1
  68. package/dist/Progress/typings.d.ts +12 -0
  69. package/dist/Radio/typings.d.ts +7 -0
  70. package/dist/RadioGroup/typings.d.ts +1 -0
  71. package/dist/Row/RowContext.d.ts +1 -0
  72. package/dist/Row/typings.d.ts +4 -0
  73. package/dist/Scrollbar/typings.d.ts +20 -0
  74. package/dist/Select/typings.d.ts +33 -0
  75. package/dist/Skeleton/PlaceholderGraph.d.ts +4 -0
  76. package/dist/Skeleton/PlaceholderGrid.d.ts +4 -0
  77. package/dist/Skeleton/PlaceholderParagraph.d.ts +4 -0
  78. package/dist/Switch/typings.d.ts +15 -0
  79. package/dist/Table/Colgroup.d.ts +1 -0
  80. package/dist/Table/TableContext.d.ts +8 -0
  81. package/dist/Table/hooks/useSelection.d.ts +18 -1
  82. package/dist/Table/hooks/useTable.d.ts +7 -0
  83. package/dist/Table/treeUtil.d.ts +39 -0
  84. package/dist/Table/typings.d.ts +137 -1
  85. package/dist/Table/util.d.ts +10 -0
  86. package/dist/Table/util.js +1 -1
  87. package/dist/Tabs/Tabs.js +1 -1
  88. package/dist/Tabs/typings.d.ts +38 -0
  89. package/dist/Tag/Tag.d.ts +1 -1
  90. package/dist/Tag/Tag.js +18 -26
  91. package/dist/Tag/typings.d.ts +10 -0
  92. package/dist/TimeLine/typings.d.ts +9 -0
  93. package/dist/TimePicker/TimePicker.js +1 -0
  94. package/dist/TimePicker/TimeSpinnerPanel.js +2 -1
  95. package/dist/TimePicker/typings.d.ts +13 -0
  96. package/dist/TimePicker/useTimePicker.d.ts +7 -0
  97. package/dist/Tooltip/Tooltip.js +8 -19
  98. package/dist/Tooltip/TooltipContext.d.ts +1 -0
  99. package/dist/Tooltip/typings.d.ts +14 -1
  100. package/dist/Transfer/ListItem.d.ts +1 -0
  101. package/dist/Transfer/typings/index.d.ts +27 -0
  102. package/dist/Transfer/typings/list.d.ts +25 -0
  103. package/dist/Transfer/typings/listBody.d.ts +1 -0
  104. package/dist/Transition/Transition.d.ts +10 -0
  105. package/dist/Transition/TransitionGroup.d.ts +59 -0
  106. package/dist/Transition/childMapping.d.ts +23 -0
  107. package/dist/Tree/NodeList.d.ts +3 -0
  108. package/dist/Tree/RCTree.d.ts +15 -0
  109. package/dist/Tree/Tree.d.ts +15 -0
  110. package/dist/Tree/TreeNode.d.ts +7 -0
  111. package/dist/Tree/contextTypes.d.ts +4 -0
  112. package/dist/Tree/typings.d.ts +3 -0
  113. package/dist/Tree/util.d.ts +17 -0
  114. package/dist/Tree/utils/KeyCode.d.ts +326 -0
  115. package/dist/Tree/utils/conductUtil.d.ts +6 -0
  116. package/dist/Tree/utils/dictUtil.d.ts +1 -0
  117. package/dist/Tree/utils/pickAttrs.d.ts +5 -0
  118. package/dist/Tree/utils/treeUtil.d.ts +25 -1
  119. package/dist/TreeSelect/Utils.d.ts +1 -0
  120. package/dist/TreeSelect/typings.d.ts +19 -0
  121. package/dist/Upload/typings.d.ts +34 -0
  122. package/dist/Upload/use-handlers.d.ts +1 -0
  123. package/dist/Util/Math.d.ts +34 -0
  124. package/dist/Util/base.d.ts +21 -0
  125. package/dist/Util/shallowEqual.d.ts +11 -0
  126. package/dist/Util/treeUtils.d.ts +8 -0
  127. package/dist/VirtualList/Filler.d.ts +5 -0
  128. package/dist/VirtualList/VirtualList.d.ts +3 -0
  129. package/dist/VirtualList/hooks/useLayoutEffect.d.ts +3 -0
  130. package/dist/VirtualList/utils/algorithmUtil.d.ts +17 -0
  131. package/dist/VirtualList/utils/findDOMNode.d.ts +3 -0
  132. package/dist/hooks/animationPropsUtils.d.ts +12 -0
  133. package/dist/hooks/htmlPropsUtils.d.ts +8 -0
  134. package/dist/hooks/popperPropsUtils.d.ts +12 -0
  135. package/dist/hooks/treePropsUtils.d.ts +12 -0
  136. package/dist/hooks/useChildrenInstance.d.ts +11 -0
  137. package/dist/hooks/useClassNames.d.ts +78 -0
  138. package/dist/hooks/useControlled.d.ts +8 -0
  139. package/dist/hooks/useForceUpdate.d.ts +1 -0
  140. package/dist/index.d.ts +1 -0
  141. package/dist/theme-chalk/link/index.scss +0 -85
  142. package/dist/types/common.d.ts +24 -0
  143. package/dist/types/type.d.ts +5 -0
  144. package/package.json +1 -1
@@ -8,5 +8,12 @@ interface Props {
8
8
  export interface AlphaSliderRef {
9
9
  update: () => void;
10
10
  }
11
+ /**
12
+ * @author Parker
13
+ * @CreateTime 2022/5/14 18:16:52
14
+ * @LastEditor Parker
15
+ * @ModifyTime 2022/5/14 22:17:13
16
+ * @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
17
+ */
11
18
  declare const AlphaSlider: React.ForwardRefExoticComponent<Props & React.RefAttributes<AlphaSliderRef>>;
12
19
  export default AlphaSlider;
@@ -8,5 +8,12 @@ interface Props {
8
8
  export interface HueSliderRef {
9
9
  update: () => void;
10
10
  }
11
+ /**
12
+ * @author Parker
13
+ * @CreateTime 2022/5/14 16:16:37
14
+ * @LastEditor Parker
15
+ * @ModifyTime 2022/11/20 11:55:00
16
+ * @Description Element Plus 颜色选择器组件魔改过来的,源代码见:https://github.com/element-plus/element-plus
17
+ */
11
18
  declare const HueSlider: React.ForwardRefExoticComponent<Props & React.RefAttributes<HueSliderRef>>;
12
19
  export default HueSlider;
@@ -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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DateTimePickerRef } from './typings';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<import("..").DatePickerProps, "name" | "value" | "type" | "defaultValue" | "onChange"> & {
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<import("..").DatePickerProps, "value" | "defaultValue" | "type" | "onChange" | "name"> & {
4
4
  name?: string;
5
5
  value?: string;
6
6
  defaultValue?: string;
@@ -71,7 +71,7 @@ var DateTimePicker = (0, import_react.forwardRef)((props, ref) => {
71
71
  formatter,
72
72
  ...rest
73
73
  } = props;
74
- const { e, is } = (0, import_hooks.useClassNames)(classPrefix);
74
+ const { b, e, is } = (0, import_hooks.useClassNames)(classPrefix);
75
75
  const [value, setValue] = (0, import_hooks.useControlled)(props.value, props.defaultValue);
76
76
  const [visible, setVisible] = (0, import_react.useState)(false);
77
77
  const [showTime, setShowTime] = (0, import_react.useState)(false);
@@ -129,7 +129,7 @@ var DateTimePicker = (0, import_react.forwardRef)((props, ref) => {
129
129
  onClick: onActive,
130
130
  value,
131
131
  onClear: () => handleChange(null, {}),
132
- className: (0, import_classnames.default)({ "r-date": readonly }, is({ active: visible })),
132
+ className: (0, import_classnames.default)({ [b("date", false)]: readonly }, is({ active: visible })),
133
133
  style: props.style,
134
134
  error,
135
135
  warning,
@@ -192,7 +192,7 @@ var DateTimePicker = (0, import_react.forwardRef)((props, ref) => {
192
192
  {
193
193
  nodeRef: () => ({ current: timePanelRef.current.ref }),
194
194
  visible: showTime,
195
- name: "r-slide-up",
195
+ name: b("slide-up", false),
196
196
  transitionAppear: true,
197
197
  unmountOnExit: true,
198
198
  display: "",
@@ -4,6 +4,7 @@ import { PopperOptionRef } from '../Popper';
4
4
  export type DateTimePickerRef = {
5
5
  inputInstance?: InputRef;
6
6
  popperInstRef: PopperOptionRef;
7
+ /** �Ƿ�׷�ӵ�body�� */
7
8
  appendToBody?: boolean;
8
9
  getValue: () => string;
9
10
  setValue: (value: string) => void;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  interface DescriptionsContextProps {
3
+ /** 排列的方向 */
3
4
  direction?: 'vertical' | 'horizontal';
5
+ /** 是否带有边框 */
4
6
  border?: boolean;
5
7
  }
6
8
  export declare const DescriptionsContext: import("react").Context<DescriptionsContextProps>;
@@ -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>;
@@ -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
- visible?: boolean;
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;
28
- close?: () => void;
52
+ /** 关闭弹窗函数 */
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>;
@@ -39,6 +39,7 @@ var import_react_dom = require("react-dom");
39
39
  var import_Transition = require("../Transition");
40
40
  var import_Util = require("../Util");
41
41
  var import_hooks = require("../hooks");
42
+ var import_prefix = require("../hooks/prefix");
42
43
  var import_DrawerBody = __toESM(require("./DrawerBody"));
43
44
  var import_DrawerContext = require("./DrawerContext");
44
45
  var import_DrawerFooter = __toESM(require("./DrawerFooter"));
@@ -76,14 +77,14 @@ function InternalComp(props, ref) {
76
77
  setVisible(false);
77
78
  onClose == null ? void 0 : onClose();
78
79
  } else if (backdrop === "static") {
79
- (0, import_dom_lib.addClass)(drawerRef.current, "r-drawer-shake");
80
+ (0, import_dom_lib.addClass)(drawerRef.current, `${import_prefix.globalKey}-drawer-shake`);
80
81
  setTimeout(() => {
81
- (0, import_dom_lib.removeClass)(drawerRef.current, "r-drawer-shake");
82
+ (0, import_dom_lib.removeClass)(drawerRef.current, `${import_prefix.globalKey}-drawer-shake`);
82
83
  }, 300);
83
84
  }
84
85
  });
85
86
  }
86
- }, [backdrop, onClose, ref, setVisible, visible]);
87
+ }, [b, backdrop, onClose, ref, setVisible, visible]);
87
88
  return /* @__PURE__ */ import_react.default.createElement(import_DrawerContext.DrawerContext.Provider, { value: { backdrop, setVisible, isControlled, onClose } }, backdrop && (0, import_react_dom.createPortal)(
88
89
  /* @__PURE__ */ import_react.default.createElement(
89
90
  import_Transition.Transition,
@@ -95,12 +96,12 @@ function InternalComp(props, ref) {
95
96
  duration: 300,
96
97
  onEnter: () => {
97
98
  setTimeout(() => {
98
- (0, import_dom_lib.addClass)(backdropRef.current, "r-anim-in");
99
+ (0, import_dom_lib.addClass)(backdropRef.current, `${import_prefix.globalKey}-anim-in`);
99
100
  }, 10);
100
101
  },
101
- beforeLeave: () => (0, import_dom_lib.removeClass)(backdropRef.current, "r-anim-in")
102
+ beforeLeave: () => (0, import_dom_lib.removeClass)(backdropRef.current, `${import_prefix.globalKey}-anim-in`)
102
103
  },
103
- /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(b`backdrop`, "r-anim-fade"), style: { zIndex: import_Util.PopupManager.nextZIndex() }, ref: backdropRef })
104
+ /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(b`backdrop`, `${import_prefix.globalKey}-anim-fade`), style: { zIndex: import_Util.PopupManager.nextZIndex() }, ref: backdropRef })
104
105
  ),
105
106
  document.body
106
107
  ), (0, import_react_dom.createPortal)(
@@ -119,15 +120,23 @@ function InternalComp(props, ref) {
119
120
  },
120
121
  beforeLeave: () => {
121
122
  var _a;
122
- (0, import_dom_lib.removeClass)(drawerRef.current, "r-anim-slide-in");
123
- (0, import_dom_lib.addClass)(drawerRef.current, "r-anim-slide-out");
123
+ (0, import_dom_lib.removeClass)(drawerRef.current, `${import_prefix.globalKey}-anim-slide-in`);
124
+ (0, import_dom_lib.addClass)(drawerRef.current, `${import_prefix.globalKey}-anim-slide-out`);
124
125
  (_a = props.beforeLeave) == null ? void 0 : _a.call(props);
125
126
  },
126
127
  onLeave: props.onLeave,
127
128
  afterLeave: props.afterLeave,
128
129
  duration: 300
129
130
  },
130
- /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(b`wrapper`, props.className), style: { ...props.style, zIndex: import_Util.PopupManager.nextZIndex() }, ref: ref || wrapperRef }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(wb(size, placement), "r-anim-slide-in", `r-anim-${placement}`), style: { display: "block" }, ref: drawerRef }, /* @__PURE__ */ import_react.default.createElement("div", { className: b`dialog` }, /* @__PURE__ */ import_react.default.createElement("div", { className: b`content` }, children))))
131
+ /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(b`wrapper`, props.className), style: { ...props.style, zIndex: import_Util.PopupManager.nextZIndex() }, ref: ref || wrapperRef }, /* @__PURE__ */ import_react.default.createElement(
132
+ "div",
133
+ {
134
+ className: (0, import_classnames.default)(wb(size, placement), `${import_prefix.globalKey}-anim-slide-in`, `${import_prefix.globalKey}-anim-${placement}`),
135
+ style: { display: "block" },
136
+ ref: drawerRef
137
+ },
138
+ /* @__PURE__ */ import_react.default.createElement("div", { className: b`dialog` }, /* @__PURE__ */ import_react.default.createElement("div", { className: b`content` }, children))
139
+ ))
131
140
  ),
132
141
  document.body
133
142
  ));
@@ -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 {};
@@ -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
  }
@@ -86,7 +86,7 @@ var Dropdown = (props) => {
86
86
  import_Tooltip.default,
87
87
  {
88
88
  classPrefix,
89
- triggerRef: /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, props.children),
89
+ triggerRef: props.children,
90
90
  popperClass: e`popper`,
91
91
  disabled,
92
92
  enterable: true,
@@ -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>;