@para-ui/core 4.0.0-rc → 4.0.0-rc.1
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/AutoBox/index.d.ts +1 -1
- package/AutoBox/index.js +12 -12
- package/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/AutoTips/index.d.ts +2 -2
- package/AutoTips/index.js +12 -12
- package/Badge/index.d.ts +23 -0
- package/Badge/index.js +54 -0
- package/Breadcrumbs/index.js +8 -8
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +3 -3
- package/Carousel/index.d.ts +6 -6
- package/Carousel/index.js +5 -5
- package/Cascader/Cascader.d.ts +10 -10
- package/Cascader/OptionList/Column.d.ts +3 -3
- package/Cascader/OptionList/index.d.ts +2 -2
- package/Cascader/index.d.ts +1 -1
- package/Cascader/index.js +4 -2
- package/Cascader/lang/en_US.d.ts +5 -0
- package/Cascader/lang/index.d.ts +11 -0
- package/Cascader/lang/zh_CN.d.ts +5 -0
- package/Cascader/utils/treeUtil.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/Checkbox/index.js +4 -4
- package/CheckboxGroup/index.d.ts +2 -2
- package/CheckboxGroup/index.js +3 -3
- package/Collapse/index.js +4 -4
- package/CollapseBox/index.js +12 -20
- package/CollapseLayout/index.js +20 -20
- package/ColorPicker/index.js +2 -2
- package/ComboSelect/index.js +43 -52
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.d.ts +3 -3
- package/Container/index.js +56 -56
- package/CopyText/index.d.ts +2 -2
- package/DatePicker/generatePicker/index.d.ts +22 -22
- package/DatePicker/index.js +8 -7
- package/DatePicker/util.d.ts +1 -1
- package/Desktop/index.d.ts +1 -1
- package/Desktop/index.js +18 -13
- package/DragVerify/index.d.ts +1 -1
- package/DragVerify/index.js +13 -13
- package/Drawer/index.js +29 -33
- package/Drawer/interface.d.ts +2 -2
- package/Dropdown/index.d.ts +1 -1
- package/DynamicMultiBox/formItem.d.ts +1 -1
- package/DynamicMultiBox/index.d.ts +1 -1
- package/DynamicMultiBox/index.js +38 -35
- package/DynamicMultiBox/interface.d.ts +8 -8
- package/DynamicMultiBox/rowForm.d.ts +3 -1
- package/Empty/index.d.ts +1 -1
- package/Empty/index.js +2 -2
- package/Form/index.d.ts +12 -13
- package/Form/index.js +10 -8
- package/FormItem/compoments/defaultCompoments/index.d.ts +4 -4
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +1 -1
- package/FormItem/compoments/formFile/index.d.ts +2 -2
- package/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/FormItem/compoments/formSelect/index.d.ts +7 -7
- package/FormItem/errorTips.d.ts +3 -3
- package/FormItem/index.d.ts +5 -5
- package/FormItem/index.js +3 -2
- package/FormItem/lang/en_US.d.ts +10 -0
- package/FormItem/lang/index.d.ts +21 -0
- package/FormItem/lang/zh_CN.d.ts +10 -0
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/dialog.d.ts +26 -26
- package/FunctionModal/index.d.ts +6 -6
- package/FunctionModal/index.js +6 -6
- package/FunctionModal/modalContext.d.ts +3 -3
- package/GlobalContext/componentsProps.d.ts +7 -7
- package/GlobalContext/index.d.ts +2 -2
- package/GlobalContext/useFormatMessage.d.ts +1 -1
- package/Help/index.js +1 -1
- package/HelperText/index.js +1 -1
- package/InputLang/index.d.ts +2 -2
- package/InputLang/index.js +8 -8
- package/InputNumber/index.d.ts +2 -2
- package/InputNumber/index.js +3 -3
- package/Label/index.js +2 -2
- package/Loading/index.js +1 -1
- package/Menu/index.js +14 -14
- package/Menu/interface.d.ts +1 -1
- package/Message/index.js +12 -12
- package/Modal/Confirm/index.d.ts +3 -3
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +5 -5
- package/MultiBox/index.d.ts +2 -2
- package/MultiBox/index.js +3 -3
- package/Notification/index.js +1 -1
- package/OperateBtn/index.d.ts +2 -2
- package/OperateBtn/index.js +40 -36
- package/PageHeader/index.js +30 -30
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +1 -1
- package/Pagination/index.js +17 -17
- package/PasswordRules/index.js +7 -7
- package/PopConfirm/index.js +3 -3
- package/Progress/Line.d.ts +10 -10
- package/Progress/Steps.d.ts +2 -2
- package/Progress/index.d.ts +12 -12
- package/Progress/index.js +40 -40
- package/Progress/utils.d.ts +4 -4
- package/Querying/index.d.ts +1 -1
- package/Querying/index.js +2 -2
- package/README.md +3 -0
- package/Radio/index.d.ts +1 -1
- package/Radio/index.js +4 -4
- package/RadioGroup/index.d.ts +2 -2
- package/RadioGroup/index.js +3 -3
- package/Search/index.js +1 -1
- package/Select/index.d.ts +3 -3
- package/Select/index.js +42 -42
- package/SelectInput/index.js +2 -2
- package/Selector/index.js +15 -15
- package/Selector/interface.d.ts +6 -6
- package/SelectorPicker/index.d.ts +4 -4
- package/SelectorPicker/index.js +9 -9
- package/SingleBox/index.d.ts +2 -2
- package/SingleBox/index.js +3 -3
- package/Slider/interface.d.ts +1 -1
- package/Status/index.d.ts +4 -4
- package/Status/index.js +4 -4
- package/Stepper/index.d.ts +5 -5
- package/Stepper/index.js +23 -23
- package/Switch/index.d.ts +7 -7
- package/Switch/index.js +23 -5
- package/Switch/lang/en_US.d.ts +4 -0
- package/Switch/lang/index.d.ts +9 -0
- package/Switch/lang/zh_CN.d.ts +4 -0
- package/Table/index.js +34 -34
- package/Table/interface.d.ts +4 -4
- package/Table/tableBodyElement/index.d.ts +1 -1
- package/Table/tableBodyInterface.d.ts +2 -2
- package/Table/tableContainer/index.d.ts +1 -1
- package/Table/tableElement/index.d.ts +1 -1
- package/Table/tableHeadElement/index.d.ts +1 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +6 -6
- package/Table/tdElement/index.d.ts +1 -1
- package/Table/thElement/index.d.ts +2 -2
- package/Table/trElement/index.d.ts +1 -1
- package/Table/util.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +25 -17
- package/Tag/TagGroup.d.ts +5 -5
- package/Tag/index.d.ts +7 -7
- package/Tag/index.js +25 -25
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +45 -27
- package/TextEditor/lang/en_US.d.ts +4 -0
- package/TextEditor/lang/index.d.ts +9 -0
- package/TextEditor/lang/zh_CN.d.ts +4 -0
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +13 -13
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +1 -1
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +14 -14
- package/Title/index.d.ts +4 -4
- package/Title/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.d.ts +5 -1
- package/ToggleButton/index.js +17 -10
- package/Transfer/box.d.ts +6 -6
- package/Transfer/index.js +21 -21
- package/Tree/OperateBar/index.d.ts +4 -4
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +2 -2
- package/Tree/interface.d.ts +4 -4
- package/Tree/utils/tools.d.ts +1 -1
- package/Upload/Dragger/index.d.ts +2 -2
- package/Upload/ErroTip/index.d.ts +1 -1
- package/Upload/index.d.ts +2 -2
- package/Upload/index.js +7 -7
- package/Upload/interface.d.ts +1 -1
- package/_verture/{index-8469865e.js → index-0f315bca.js} +2 -2
- package/_verture/{index-e1b800aa.js → index-92e406f4.js} +48 -24
- package/_verture/{index-47297a40.js → index-bc461491.js} +45 -45
- package/_verture/{index-1c8d3e94.js → index-d251967e.js} +101 -47
- package/_verture/{modalContext-670eab09.js → modalContext-9299acc9.js} +25 -25
- package/index.d.ts +2 -0
- package/index.js +8 -7
- package/locale/en-US.d.ts +19 -0
- package/locale/index.d.ts +38 -0
- package/locale/index.js +39 -1
- package/locale/zh-CN.d.ts +19 -0
- package/package.json +3 -1
- package/umd/AutoBox.js +1 -1
- package/umd/AutoTips.js +1 -1
- package/umd/Badge.js +1 -0
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +2 -2
- package/umd/ButtonGroup.js +2 -2
- package/umd/Cascader.js +5 -5
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/Collapse.js +1 -1
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ComboSelect.js +4 -4
- package/umd/CopyText.js +1 -1
- package/umd/DatePicker.js +2 -2
- package/umd/Desktop.js +2 -2
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +2 -2
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Form.js +4 -4
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +2 -2
- package/umd/Help.js +1 -1
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/Loading.js +1 -1
- package/umd/Menu.js +2 -2
- package/umd/Message.js +1 -1
- package/umd/Modal.js +2 -2
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +1 -1
- package/umd/OperateBtn.js +2 -2
- package/umd/PageHeader.js +2 -2
- package/umd/Pagination.js +4 -4
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +2 -2
- package/umd/Progress.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/Search.js +7 -7
- package/umd/Select.js +1 -1
- package/umd/SelectInput.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/SingleBox.js +1 -1
- package/umd/Stepper.js +1 -1
- package/umd/Switch.js +4 -4
- package/umd/Table.js +2 -2
- package/umd/Tabs.js +4 -4
- package/umd/Tag.js +1 -1
- package/umd/TextEditor.js +2 -2
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +2 -2
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +4 -4
- package/umd/Transfer.js +2 -2
- package/umd/Tree.js +1 -1
- package/umd/Upload.js +2 -2
- package/umd/locale.js +1 -1
package/Container/index.js
CHANGED
|
@@ -10,7 +10,7 @@ styleInject(css_248z);
|
|
|
10
10
|
var Container = function Container() {
|
|
11
11
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
12
12
|
var _props$className = props.className,
|
|
13
|
-
className = _props$className === void 0 ?
|
|
13
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
14
14
|
top = props.top,
|
|
15
15
|
_props$topStyle = props.topStyle,
|
|
16
16
|
topStyle = _props$topStyle === void 0 ? {} : _props$topStyle,
|
|
@@ -24,58 +24,58 @@ var Container = function Container() {
|
|
|
24
24
|
_props$bottomStyle = props.bottomStyle,
|
|
25
25
|
bottomStyle = _props$bottomStyle === void 0 ? {} : _props$bottomStyle,
|
|
26
26
|
_props$type = props.type,
|
|
27
|
-
type = _props$type === void 0 ?
|
|
27
|
+
type = _props$type === void 0 ? 'tlr' : _props$type;
|
|
28
28
|
var topSty, leftSty, rightSty, bottomSty, bodySty;
|
|
29
29
|
var position = React__default.useMemo(function () {
|
|
30
30
|
switch (type) {
|
|
31
|
-
case
|
|
31
|
+
case 'tlr':
|
|
32
32
|
// 上 左右
|
|
33
33
|
topSty = Object.assign({
|
|
34
|
-
height: top ?
|
|
35
|
-
width:
|
|
34
|
+
height: top ? '50px' : '0',
|
|
35
|
+
width: '100%'
|
|
36
36
|
}, topStyle);
|
|
37
37
|
leftSty = Object.assign({
|
|
38
|
-
height:
|
|
39
|
-
width:
|
|
38
|
+
height: '100%',
|
|
39
|
+
width: 'auto'
|
|
40
40
|
}, leftStyle);
|
|
41
41
|
bottomSty = Object.assign({
|
|
42
|
-
height: bottom ?
|
|
43
|
-
width:
|
|
42
|
+
height: bottom ? '20px' : '0',
|
|
43
|
+
width: '100%'
|
|
44
44
|
}, bottomStyle);
|
|
45
45
|
rightSty = Object.assign({
|
|
46
46
|
height: "calc(100% - ".concat(bottomSty.height, ")"),
|
|
47
|
-
width:
|
|
47
|
+
width: 'auto'
|
|
48
48
|
}, rightStyle);
|
|
49
49
|
bodySty = {
|
|
50
|
-
width:
|
|
50
|
+
width: '100%',
|
|
51
51
|
height: "calc(100% - ".concat(topSty.height, ")")
|
|
52
52
|
};
|
|
53
53
|
return jsxs("div", Object.assign({
|
|
54
54
|
className: "".concat($prefixCls, "-container ").concat($prefixCls, "-tlr ").concat(className)
|
|
55
55
|
}, {
|
|
56
56
|
children: [jsx("div", Object.assign({
|
|
57
|
-
className:
|
|
57
|
+
className: 'container-top',
|
|
58
58
|
style: topSty
|
|
59
59
|
}, {
|
|
60
60
|
children: top
|
|
61
61
|
})), jsxs("div", Object.assign({
|
|
62
|
-
className:
|
|
62
|
+
className: 'container-body',
|
|
63
63
|
style: bodySty
|
|
64
64
|
}, {
|
|
65
65
|
children: [jsx("div", Object.assign({
|
|
66
|
-
className:
|
|
66
|
+
className: 'container-left',
|
|
67
67
|
style: leftSty
|
|
68
68
|
}, {
|
|
69
69
|
children: left
|
|
70
70
|
})), jsx("div", Object.assign({
|
|
71
|
-
className:
|
|
71
|
+
className: 'container-body-right',
|
|
72
72
|
style: {
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
73
|
+
width: 'auto',
|
|
74
|
+
height: '100%'
|
|
75
75
|
}
|
|
76
76
|
}, {
|
|
77
77
|
children: jsx("div", Object.assign({
|
|
78
|
-
className:
|
|
78
|
+
className: 'container-right',
|
|
79
79
|
style: rightSty
|
|
80
80
|
}, {
|
|
81
81
|
children: right
|
|
@@ -83,139 +83,139 @@ var Container = function Container() {
|
|
|
83
83
|
}))]
|
|
84
84
|
}))]
|
|
85
85
|
}));
|
|
86
|
-
case
|
|
86
|
+
case 'tlrb':
|
|
87
87
|
// 上 左右 下
|
|
88
88
|
topSty = Object.assign({
|
|
89
|
-
height: top ?
|
|
90
|
-
width:
|
|
89
|
+
height: top ? '50px' : '0',
|
|
90
|
+
width: '100%'
|
|
91
91
|
}, topStyle);
|
|
92
92
|
leftSty = Object.assign({
|
|
93
|
-
height:
|
|
94
|
-
width:
|
|
93
|
+
height: '100%',
|
|
94
|
+
width: 'auto'
|
|
95
95
|
}, leftStyle);
|
|
96
96
|
rightSty = Object.assign({
|
|
97
|
-
height:
|
|
98
|
-
width:
|
|
97
|
+
height: '100%',
|
|
98
|
+
width: 'auto'
|
|
99
99
|
}, rightStyle);
|
|
100
100
|
bottomSty = Object.assign({
|
|
101
|
-
height: bottom ?
|
|
102
|
-
width:
|
|
101
|
+
height: bottom ? '20px' : '0px',
|
|
102
|
+
width: '100%'
|
|
103
103
|
}, bottomStyle);
|
|
104
104
|
bodySty = {
|
|
105
|
-
width:
|
|
105
|
+
width: '100%',
|
|
106
106
|
height: "calc(100% - ".concat(topSty.height, " - ").concat(bottomSty.height, ")")
|
|
107
107
|
};
|
|
108
108
|
return jsxs("div", Object.assign({
|
|
109
109
|
className: "".concat($prefixCls, "-container ").concat($prefixCls, "-tlrb ").concat(className)
|
|
110
110
|
}, {
|
|
111
111
|
children: [jsx("div", Object.assign({
|
|
112
|
-
className:
|
|
112
|
+
className: 'container-top',
|
|
113
113
|
style: topSty
|
|
114
114
|
}, {
|
|
115
115
|
children: top
|
|
116
116
|
})), jsxs("div", Object.assign({
|
|
117
|
-
className:
|
|
117
|
+
className: 'container-body',
|
|
118
118
|
style: bodySty
|
|
119
119
|
}, {
|
|
120
120
|
children: [jsx("div", Object.assign({
|
|
121
|
-
className:
|
|
121
|
+
className: 'container-left',
|
|
122
122
|
style: leftSty
|
|
123
123
|
}, {
|
|
124
124
|
children: left
|
|
125
125
|
})), jsx("div", Object.assign({
|
|
126
|
-
className:
|
|
126
|
+
className: 'container-right',
|
|
127
127
|
style: rightSty
|
|
128
128
|
}, {
|
|
129
129
|
children: right
|
|
130
130
|
}))]
|
|
131
131
|
})), jsx("div", Object.assign({
|
|
132
|
-
className:
|
|
132
|
+
className: 'container-bottom',
|
|
133
133
|
style: bottomSty
|
|
134
134
|
}, {
|
|
135
135
|
children: bottom
|
|
136
136
|
}))]
|
|
137
137
|
}));
|
|
138
|
-
case
|
|
138
|
+
case 'ltrb':
|
|
139
139
|
// 左 上右下
|
|
140
140
|
leftSty = Object.assign({
|
|
141
|
-
height:
|
|
142
|
-
width:
|
|
141
|
+
height: '100%',
|
|
142
|
+
width: 'auto'
|
|
143
143
|
}, leftStyle);
|
|
144
144
|
topSty = Object.assign({
|
|
145
|
-
height: top ?
|
|
146
|
-
width:
|
|
145
|
+
height: top ? '50px' : '0',
|
|
146
|
+
width: '100%'
|
|
147
147
|
}, topStyle);
|
|
148
148
|
bottomSty = Object.assign({
|
|
149
|
-
height: bottom ?
|
|
150
|
-
width:
|
|
149
|
+
height: bottom ? '30px' : '0px',
|
|
150
|
+
width: '100%'
|
|
151
151
|
}, bottomStyle);
|
|
152
152
|
rightSty = Object.assign({
|
|
153
153
|
height: "calc(100% - ".concat(topSty.height, "px - ").concat(bottomSty.height, ")"),
|
|
154
|
-
width:
|
|
154
|
+
width: '100%'
|
|
155
155
|
}, rightStyle);
|
|
156
156
|
bodySty = {
|
|
157
|
-
width:
|
|
157
|
+
width: 'auto',
|
|
158
158
|
height: "100%"
|
|
159
159
|
};
|
|
160
160
|
return jsxs("div", Object.assign({
|
|
161
161
|
className: "".concat($prefixCls, "-container ").concat($prefixCls, "-ltrb ").concat(className)
|
|
162
162
|
}, {
|
|
163
163
|
children: [jsx("div", Object.assign({
|
|
164
|
-
className:
|
|
164
|
+
className: 'container-left',
|
|
165
165
|
style: leftSty
|
|
166
166
|
}, {
|
|
167
167
|
children: left
|
|
168
168
|
})), jsxs("div", Object.assign({
|
|
169
|
-
className:
|
|
169
|
+
className: 'container-body',
|
|
170
170
|
style: bodySty
|
|
171
171
|
}, {
|
|
172
172
|
children: [jsx("div", Object.assign({
|
|
173
|
-
className:
|
|
173
|
+
className: 'container-top',
|
|
174
174
|
style: topSty
|
|
175
175
|
}, {
|
|
176
176
|
children: top
|
|
177
177
|
})), jsx("div", Object.assign({
|
|
178
|
-
className:
|
|
178
|
+
className: 'container-right',
|
|
179
179
|
style: rightSty
|
|
180
180
|
}, {
|
|
181
181
|
children: right
|
|
182
182
|
})), jsx("div", Object.assign({
|
|
183
|
-
className:
|
|
183
|
+
className: 'container-bottom',
|
|
184
184
|
style: bottomSty
|
|
185
185
|
}, {
|
|
186
186
|
children: bottom
|
|
187
187
|
}))]
|
|
188
188
|
}))]
|
|
189
189
|
}));
|
|
190
|
-
case
|
|
190
|
+
case 'trb':
|
|
191
191
|
// 上 中 下
|
|
192
192
|
topSty = Object.assign({
|
|
193
|
-
height: top ?
|
|
194
|
-
width:
|
|
193
|
+
height: top ? '50px' : '0',
|
|
194
|
+
width: '100%'
|
|
195
195
|
}, topStyle);
|
|
196
196
|
bottomSty = Object.assign({
|
|
197
|
-
height: bottom ?
|
|
198
|
-
width:
|
|
197
|
+
height: bottom ? '30px' : '0px',
|
|
198
|
+
width: '100%'
|
|
199
199
|
}, bottomStyle);
|
|
200
200
|
rightSty = Object.assign({
|
|
201
201
|
height: "calc(100% - ".concat(topSty.height, "px - ").concat(bottomSty.height, ")"),
|
|
202
|
-
width:
|
|
202
|
+
width: '100%'
|
|
203
203
|
}, rightStyle);
|
|
204
204
|
return jsxs("div", Object.assign({
|
|
205
205
|
className: "".concat($prefixCls, "-container ").concat($prefixCls, "-trb ").concat(className)
|
|
206
206
|
}, {
|
|
207
207
|
children: [jsx("div", Object.assign({
|
|
208
|
-
className:
|
|
208
|
+
className: 'container-top',
|
|
209
209
|
style: topSty
|
|
210
210
|
}, {
|
|
211
211
|
children: top
|
|
212
212
|
})), jsx("div", Object.assign({
|
|
213
|
-
className:
|
|
213
|
+
className: 'container-right',
|
|
214
214
|
style: rightSty
|
|
215
215
|
}, {
|
|
216
216
|
children: right
|
|
217
217
|
})), jsx("div", Object.assign({
|
|
218
|
-
className:
|
|
218
|
+
className: 'container-bottom',
|
|
219
219
|
style: bottomSty
|
|
220
220
|
}, {
|
|
221
221
|
children: bottom
|
package/CopyText/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @description 复制文本
|
|
5
5
|
*/
|
|
6
6
|
import { FunctionComponent, ReactNode } from 'react';
|
|
7
|
-
import { TextFieldProps } from
|
|
7
|
+
import { TextFieldProps } from '../TextField';
|
|
8
8
|
import './index.scss';
|
|
9
9
|
export interface CopyTextProps {
|
|
10
10
|
className?: string;
|
|
@@ -27,7 +27,7 @@ export interface CopyTextProps {
|
|
|
27
27
|
/** 延时 */
|
|
28
28
|
timeout?: number;
|
|
29
29
|
/** 复制事件 */
|
|
30
|
-
onCopy?: () =>
|
|
30
|
+
onCopy?: () => Promise<string | void> | string | void;
|
|
31
31
|
}
|
|
32
32
|
declare const CopyText: FunctionComponent<CopyTextProps>;
|
|
33
33
|
export default CopyText;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React, { ReactNode } from
|
|
2
|
-
import { GenerateConfig } from
|
|
3
|
-
import { PickerBaseProps as RCPickerBaseProps, PickerDateProps as RCPickerDateProps, PickerTimeProps as RCPickerTimeProps } from
|
|
4
|
-
import { RangePickerBaseProps as RCRangePickerBaseProps, RangePickerDateProps as RCRangePickerDateProps, RangePickerTimeProps as RCRangePickerTimeProps } from
|
|
5
|
-
import { Locale as RcPickerLocale } from
|
|
6
|
-
import PickerButton from
|
|
7
|
-
import PickerTag from
|
|
8
|
-
import { Dayjs } from
|
|
9
|
-
import { LabelTooltipProps } from
|
|
10
|
-
import { TooltipProps } from
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { GenerateConfig } from 'rc-picker/lib/generate/index';
|
|
3
|
+
import { PickerBaseProps as RCPickerBaseProps, PickerDateProps as RCPickerDateProps, PickerTimeProps as RCPickerTimeProps } from 'rc-picker/lib/Picker';
|
|
4
|
+
import { RangePickerBaseProps as RCRangePickerBaseProps, RangePickerDateProps as RCRangePickerDateProps, RangePickerTimeProps as RCRangePickerTimeProps } from 'rc-picker/lib/RangePicker';
|
|
5
|
+
import { Locale as RcPickerLocale } from 'rc-picker/lib/interface';
|
|
6
|
+
import PickerButton from '../PickerButton';
|
|
7
|
+
import PickerTag from '../PickerTag';
|
|
8
|
+
import { Dayjs } from 'dayjs';
|
|
9
|
+
import { LabelTooltipProps } from '../../Label';
|
|
10
|
+
import { TooltipProps } from '../../Tooltip';
|
|
11
11
|
export type ShortcutType = {
|
|
12
12
|
text: string;
|
|
13
13
|
value: Dayjs[] | (() => Dayjs[]);
|
|
14
14
|
};
|
|
15
|
-
type SizeType =
|
|
15
|
+
type SizeType = 'small' | 'medium' | 'large' | undefined;
|
|
16
16
|
export interface TimePickerLocale {
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
rangePlaceholder?: [string, string];
|
|
@@ -24,9 +24,9 @@ export declare const Components: {
|
|
|
24
24
|
button: typeof PickerButton;
|
|
25
25
|
rangeItem: typeof PickerTag;
|
|
26
26
|
};
|
|
27
|
-
type InjectDefaultProps<Props, Type> = Omit<Props,
|
|
27
|
+
type InjectDefaultProps<Props, Type> = Omit<Props, 'locale' | 'generateConfig' | 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon' | 'hideHeader' | 'components' | 'value' | 'defaultValue'> & {
|
|
28
28
|
/** 国际化 */
|
|
29
|
-
locale?:
|
|
29
|
+
locale?: 'zh' | 'en';
|
|
30
30
|
/** 大小 */
|
|
31
31
|
size?: SizeType;
|
|
32
32
|
/** 显示边框 */
|
|
@@ -36,9 +36,9 @@ type InjectDefaultProps<Props, Type> = Omit<Props, "locale" | "generateConfig" |
|
|
|
36
36
|
/** 帮助文本 */
|
|
37
37
|
helperText?: ReactNode;
|
|
38
38
|
/** value */
|
|
39
|
-
value?: Type extends
|
|
39
|
+
value?: Type extends 'range' ? RangeValue<Dayjs> : NullableDateType<Dayjs>;
|
|
40
40
|
/** 默认值 */
|
|
41
|
-
defaultValue?: Type extends
|
|
41
|
+
defaultValue?: Type extends 'range' ? RangeValue<Dayjs> : NullableDateType<Dayjs>;
|
|
42
42
|
/** 标题 */
|
|
43
43
|
label?: ReactNode;
|
|
44
44
|
/** 帮助提示信息 */
|
|
@@ -76,19 +76,19 @@ export type AdditionalPickerLocaleLangProps = {
|
|
|
76
76
|
rangeWeekPlaceholder?: [string, string];
|
|
77
77
|
rangePlaceholder?: [string, string];
|
|
78
78
|
};
|
|
79
|
-
export type PickerBaseProps<DateType> = InjectDefaultProps<RCPickerBaseProps<DateType>,
|
|
80
|
-
export type PickerDateProps<DateType> = InjectDefaultProps<RCPickerDateProps<DateType>,
|
|
81
|
-
export type PickerTimeProps<DateType> = InjectDefaultProps<RCPickerTimeProps<DateType>,
|
|
79
|
+
export type PickerBaseProps<DateType> = InjectDefaultProps<RCPickerBaseProps<DateType>, ''>;
|
|
80
|
+
export type PickerDateProps<DateType> = InjectDefaultProps<RCPickerDateProps<DateType>, ''>;
|
|
81
|
+
export type PickerTimeProps<DateType> = InjectDefaultProps<RCPickerTimeProps<DateType>, ''>;
|
|
82
82
|
export type PickerProps<DateType> = PickerBaseProps<DateType> | PickerDateProps<DateType> | PickerTimeProps<DateType>;
|
|
83
|
-
export type RangePickerBaseProps<DateType> = InjectDefaultProps<RCRangePickerBaseProps<DateType>,
|
|
84
|
-
export type RangePickerDateProps<DateType> = InjectDefaultProps<RCRangePickerDateProps<DateType>,
|
|
85
|
-
export type RangePickerTimeProps<DateType> = InjectDefaultProps<RCRangePickerTimeProps<DateType>,
|
|
83
|
+
export type RangePickerBaseProps<DateType> = InjectDefaultProps<RCRangePickerBaseProps<DateType>, 'range'>;
|
|
84
|
+
export type RangePickerDateProps<DateType> = InjectDefaultProps<RCRangePickerDateProps<DateType>, 'range'>;
|
|
85
|
+
export type RangePickerTimeProps<DateType> = InjectDefaultProps<RCRangePickerTimeProps<DateType>, 'range'>;
|
|
86
86
|
export type RangePickerProps<DateType> = (RangePickerBaseProps<DateType> | RangePickerDateProps<DateType> | RangePickerTimeProps<DateType>) & {
|
|
87
87
|
/** 预设时间范围快捷选择 */
|
|
88
88
|
/** @deprecated Please use `presets` instead */
|
|
89
89
|
shortcuts?: ShortcutType[];
|
|
90
90
|
/** 预设范围选择面板位置 */
|
|
91
|
-
shortcutsPlacement?:
|
|
91
|
+
shortcutsPlacement?: 'left' | 'right';
|
|
92
92
|
};
|
|
93
93
|
declare function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>): import("./interface").PickerComponentClass<PickerProps<DateType>, unknown> & {
|
|
94
94
|
WeekPicker: import("./interface").PickerComponentClass<Omit<PickerProps<DateType>, "picker">, unknown>;
|
package/DatePicker/index.js
CHANGED
|
@@ -117,8 +117,9 @@ var ELocale = {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
function generatePicker$1(generateConfig) {
|
|
120
|
-
//
|
|
120
|
+
//
|
|
121
121
|
function getPicker(picker, displayName) {
|
|
122
|
+
// const consumerName = displayName === 'TimePicker' ? 'timePicker' : 'datePicker';
|
|
122
123
|
var Picker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
123
124
|
var className = props.className;
|
|
124
125
|
props.size;
|
|
@@ -454,7 +455,7 @@ function generateRangePicker(generateConfig) {
|
|
|
454
455
|
ref: innerRef,
|
|
455
456
|
placeholder: getRangePlaceholder(picker, newLocale, placeholder),
|
|
456
457
|
suffixIcon: picker === 'time' ? jsx(TimeIcon, {}) : jsx(DateIcon, {
|
|
457
|
-
className:
|
|
458
|
+
className: "picker-icon"
|
|
458
459
|
}),
|
|
459
460
|
clearIcon: jsx(CloseCircleF, {}),
|
|
460
461
|
allowClear: true,
|
|
@@ -512,11 +513,11 @@ var Components = {
|
|
|
512
513
|
};
|
|
513
514
|
//format map
|
|
514
515
|
var pickerFormatMap = {
|
|
515
|
-
year:
|
|
516
|
-
quarter:
|
|
517
|
-
month:
|
|
518
|
-
week:
|
|
519
|
-
time:
|
|
516
|
+
year: 'YYYY',
|
|
517
|
+
quarter: 'YYYY-QQ',
|
|
518
|
+
month: 'YYYY-MM',
|
|
519
|
+
week: 'YYYY-WW',
|
|
520
|
+
time: 'HH:mm:ss'
|
|
520
521
|
};
|
|
521
522
|
//picker 生成器
|
|
522
523
|
function generatePicker(generateConfig) {
|
package/DatePicker/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PickerMode } from 'rc-picker/lib/interface';
|
|
2
2
|
import { PickerLocale } from './generatePicker';
|
|
3
|
-
import { SharedTimeProps } from
|
|
3
|
+
import { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel';
|
|
4
4
|
export declare function getPlaceholder(picker: PickerMode | undefined, locale: PickerLocale, customizePlaceholder?: string): string;
|
|
5
5
|
export declare function getRangePlaceholder(picker: PickerMode | undefined, locale: PickerLocale, customizePlaceholder?: [string, string]): [string, string] | undefined;
|
|
6
6
|
export declare function getTimeProps<DateType, DisabledTime>(props: {
|
package/Desktop/index.d.ts
CHANGED
package/Desktop/index.js
CHANGED
|
@@ -260,8 +260,8 @@ var Desktop = function Desktop(props) {
|
|
|
260
260
|
map[index] = getItemData(item, index, type);
|
|
261
261
|
item = map[index];
|
|
262
262
|
var style = {
|
|
263
|
-
left: map[index].point.x
|
|
264
|
-
top: map[index].point.y
|
|
263
|
+
left: "".concat(map[index].point.x, "px"),
|
|
264
|
+
top: "".concat(map[index].point.y, "px"),
|
|
265
265
|
width: defaultMatrix.width,
|
|
266
266
|
height: defaultMatrix.height
|
|
267
267
|
};
|
|
@@ -438,6 +438,7 @@ var Desktop = function Desktop(props) {
|
|
|
438
438
|
// 计算光标碰撞
|
|
439
439
|
//const list = Object.keys(map);
|
|
440
440
|
var dragRect = {
|
|
441
|
+
// 矩阵
|
|
441
442
|
x: x,
|
|
442
443
|
y: y,
|
|
443
444
|
w: dragData.point.x + dragData.point.width,
|
|
@@ -446,6 +447,7 @@ var Desktop = function Desktop(props) {
|
|
|
446
447
|
height: dragData.point.height
|
|
447
448
|
};
|
|
448
449
|
var dragCentre = {
|
|
450
|
+
// 拖拽矩形中心点
|
|
449
451
|
x: dragRect.x + dragRect.width / 2,
|
|
450
452
|
y: dragRect.y + dragRect.height / 2
|
|
451
453
|
};
|
|
@@ -454,11 +456,12 @@ var Desktop = function Desktop(props) {
|
|
|
454
456
|
if (!item || String(item.key) === String(dragData.key)) continue;
|
|
455
457
|
if (item.parent && dir !== item.parent) continue;
|
|
456
458
|
/*
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
* x,y_____
|
|
460
|
+
* | |
|
|
461
|
+
* |_____w,h
|
|
462
|
+
*/
|
|
461
463
|
var rect = {
|
|
464
|
+
// 矩阵
|
|
462
465
|
x: item.point.x,
|
|
463
466
|
y: item.point.y,
|
|
464
467
|
w: item.point.x + item.point.width,
|
|
@@ -484,6 +487,7 @@ var Desktop = function Desktop(props) {
|
|
|
484
487
|
}
|
|
485
488
|
// 计算碰撞位置,左,中,右
|
|
486
489
|
var _dragCentre = {
|
|
490
|
+
// 拖拽矩形中心点
|
|
487
491
|
x: dragRect.x + dragRect.width / 2,
|
|
488
492
|
y: dragRect.y + dragRect.height / 2
|
|
489
493
|
};
|
|
@@ -606,7 +610,7 @@ var Desktop = function Desktop(props) {
|
|
|
606
610
|
*/
|
|
607
611
|
var newDir = function newDir(item, dragMapData, t) {
|
|
608
612
|
if (t === 'R') item.index--;
|
|
609
|
-
var key =
|
|
613
|
+
var key = "dir_".concat(item.key).concat(Math.random() * 1000000 | 0);
|
|
610
614
|
map[item.index] = Object.assign(Object.assign({}, item), {
|
|
611
615
|
key: key,
|
|
612
616
|
point: getPoint(item.index),
|
|
@@ -651,6 +655,7 @@ var Desktop = function Desktop(props) {
|
|
|
651
655
|
* @param point 位置
|
|
652
656
|
*/
|
|
653
657
|
var setNewPoint = function setNewPoint(item, next, point) {
|
|
658
|
+
// item 当前节点,下一个节点索引
|
|
654
659
|
if (!item) return;
|
|
655
660
|
if (!point) point = getPoint(next);
|
|
656
661
|
var dom = getItemByKey(item.key);
|
|
@@ -668,7 +673,7 @@ var Desktop = function Desktop(props) {
|
|
|
668
673
|
var reset = function reset(type) {
|
|
669
674
|
var _a, _b, _c;
|
|
670
675
|
switch (type) {
|
|
671
|
-
case
|
|
676
|
+
case 'impact':
|
|
672
677
|
var impactDom = document.querySelector('[impact="true"]');
|
|
673
678
|
if (!impactDom) return;
|
|
674
679
|
if (dragData && dragData.impact) {
|
|
@@ -677,7 +682,7 @@ var Desktop = function Desktop(props) {
|
|
|
677
682
|
}
|
|
678
683
|
impactDom === null || impactDom === void 0 ? void 0 : impactDom.removeAttribute('impact');
|
|
679
684
|
break;
|
|
680
|
-
case
|
|
685
|
+
case 'end':
|
|
681
686
|
dragData = null;
|
|
682
687
|
(_a = document.querySelector('[impact="true"]')) === null || _a === void 0 ? void 0 : _a.removeAttribute('impact');
|
|
683
688
|
(_b = document.querySelector('[drag-item="true"]')) === null || _b === void 0 ? void 0 : _b.removeAttribute('drag-item');
|
|
@@ -700,8 +705,8 @@ var Desktop = function Desktop(props) {
|
|
|
700
705
|
*/
|
|
701
706
|
var setPoint = function setPoint(dom, x, y) {
|
|
702
707
|
if (!dom) return;
|
|
703
|
-
if (x !== undefined || x !== null) dom.style.left = x
|
|
704
|
-
if (y !== undefined || y !== null) dom.style.top = y
|
|
708
|
+
if (x !== undefined || x !== null) dom.style.left = "".concat(x, "px");
|
|
709
|
+
if (y !== undefined || y !== null) dom.style.top = "".concat(y, "px");
|
|
705
710
|
};
|
|
706
711
|
/** 排序 */
|
|
707
712
|
var onSort = function onSort() {
|
|
@@ -823,8 +828,8 @@ var Desktop = function Desktop(props) {
|
|
|
823
828
|
* @return {string}
|
|
824
829
|
*/
|
|
825
830
|
var handClass = function handClass() {
|
|
826
|
-
var str = $prefixCls
|
|
827
|
-
if (props.className) str +=
|
|
831
|
+
var str = "".concat($prefixCls, "-desktop");
|
|
832
|
+
if (props.className) str += " ".concat(props.className);
|
|
828
833
|
return str;
|
|
829
834
|
};
|
|
830
835
|
return jsxs("div", Object.assign({
|
package/DragVerify/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface DragVerifyProps {
|
|
|
25
25
|
/** 刷新 */
|
|
26
26
|
refresh?: any;
|
|
27
27
|
/** 获取图片接口 */
|
|
28
|
-
getImgInfo: () =>
|
|
28
|
+
getImgInfo: () => Promise<DragVerifyImgProps> | DragVerifyImgProps;
|
|
29
29
|
/** 提交校验接口 xPos: x轴坐标,imgInfo:图片信息
|
|
30
30
|
* true 通过
|
|
31
31
|
* false 不通过
|
package/DragVerify/index.js
CHANGED
|
@@ -57,7 +57,7 @@ var DragVerify = function DragVerify(props) {
|
|
|
57
57
|
getImgInfo: getImgInfo,
|
|
58
58
|
verify: verify
|
|
59
59
|
});
|
|
60
|
-
var prefixCls = $prefixCls
|
|
60
|
+
var prefixCls = "".concat($prefixCls, "-drag-verify");
|
|
61
61
|
constData.current.getImgInfo = getImgInfo;
|
|
62
62
|
constData.current.verify = verify;
|
|
63
63
|
useEffect(function () {
|
|
@@ -147,7 +147,7 @@ var DragVerify = function DragVerify(props) {
|
|
|
147
147
|
imgMove.style.display = 'inline-block'; // 必须先显示图片,要不然ie10获取不到图片
|
|
148
148
|
refreshEle.style.display = 'inline-block';
|
|
149
149
|
imgMove.width = imgMove.width / constData.current.imgScale;
|
|
150
|
-
imgMove.style.top = ((_a = constData.current.imgInfo) === null || _a === void 0 ? void 0 : _a.y) / constData.current.imgScale
|
|
150
|
+
imgMove.style.top = "".concat(((_a = constData.current.imgInfo) === null || _a === void 0 ? void 0 : _a.y) / constData.current.imgScale, "px");
|
|
151
151
|
setLoading(false);
|
|
152
152
|
};
|
|
153
153
|
};
|
|
@@ -167,32 +167,32 @@ var DragVerify = function DragVerify(props) {
|
|
|
167
167
|
var moveSliderWidth = moveSliderRect.width; // 进度条的宽
|
|
168
168
|
moveDom.onmousedown = function (e) {
|
|
169
169
|
if (constData.current.padding) return;
|
|
170
|
-
sliderBox.classList.add(prefixCls
|
|
170
|
+
sliderBox.classList.add("".concat(prefixCls, "-move"));
|
|
171
171
|
document.onmousemove = function (event) {
|
|
172
172
|
var moveW = event.pageX - e.pageX; // 鼠标移动的距离
|
|
173
173
|
if (moveW < 0) moveW = 0;
|
|
174
174
|
if (moveW + moveDomWidth > imgBg.width) moveW = imgBg.width - moveDomWidth;
|
|
175
|
-
moveDom.style.left = moveW - 1
|
|
175
|
+
moveDom.style.left = "".concat(moveW - 1, "px");
|
|
176
176
|
// 加一防止滑块与进度条之间有间隙
|
|
177
|
-
moveProgress.style.width = (moveW < 2 ? 2 : moveW
|
|
177
|
+
moveProgress.style.width = "".concat(moveW < 2 ? 2 : moveW, "px");
|
|
178
178
|
// 进度条走过的比例
|
|
179
179
|
var ratio = moveW / (moveSliderWidth - moveDomWidth);
|
|
180
180
|
var imgMoveWidth = (imgBg.width - imgMove.width) * ratio;
|
|
181
|
-
imgMove.style.left = imgMoveWidth
|
|
181
|
+
imgMove.style.left = "".concat(imgMoveWidth, "px");
|
|
182
182
|
sliderText.innerHTML = '';
|
|
183
183
|
};
|
|
184
184
|
// 鼠标抬起
|
|
185
185
|
document.onmouseup = function () {
|
|
186
186
|
document.onmousemove = null;
|
|
187
187
|
document.onmouseup = null;
|
|
188
|
-
sliderBox.classList.remove(prefixCls
|
|
188
|
+
sliderBox.classList.remove("".concat(prefixCls, "-move"));
|
|
189
189
|
constData.current.padding = true;
|
|
190
190
|
var X = parseFloat(imgMove.style.left);
|
|
191
191
|
var handX = X * constData.current.imgScale;
|
|
192
192
|
sliderPosiCheck(handX, function (result) {
|
|
193
193
|
if (!result) {
|
|
194
194
|
// 错误
|
|
195
|
-
sliderBox.classList.add(prefixCls
|
|
195
|
+
sliderBox.classList.add("".concat(prefixCls, "-error"));
|
|
196
196
|
constData.current.timerError = setTimeout(function () {
|
|
197
197
|
constData.current.padding = false;
|
|
198
198
|
reset();
|
|
@@ -203,7 +203,7 @@ var DragVerify = function DragVerify(props) {
|
|
|
203
203
|
}, 1000);
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
sliderBox.classList.add(prefixCls
|
|
206
|
+
sliderBox.classList.add("".concat(prefixCls, "-success"));
|
|
207
207
|
/*constData.current.timerSuccess = setTimeout(() => {
|
|
208
208
|
//constData.current.padding = false;
|
|
209
209
|
//sliderBox.classList.remove(prefixCls + '-success');
|
|
@@ -216,8 +216,8 @@ var DragVerify = function DragVerify(props) {
|
|
|
216
216
|
var reset = function reset() {
|
|
217
217
|
var sliderBox = refDom.current;
|
|
218
218
|
if (!sliderBox) return;
|
|
219
|
-
sliderBox.classList.remove(prefixCls
|
|
220
|
-
sliderBox.classList.remove(prefixCls
|
|
219
|
+
sliderBox.classList.remove("".concat(prefixCls, "-success"));
|
|
220
|
+
sliderBox.classList.remove("".concat(prefixCls, "-error"));
|
|
221
221
|
var moveDom = sliderBox.querySelector('.slider-move-box'); // 滑块
|
|
222
222
|
var moveProgress = sliderBox.querySelector('.slider-move-mask'); // 滑动距离元素
|
|
223
223
|
var sliderText = sliderBox.querySelector('.slider-move-text'); // 互动轨道显示的文字
|
|
@@ -237,12 +237,12 @@ var DragVerify = function DragVerify(props) {
|
|
|
237
237
|
var obj = {};
|
|
238
238
|
if (width) {
|
|
239
239
|
var widthHand = width;
|
|
240
|
-
if (typeof width === 'number') widthHand = width
|
|
240
|
+
if (typeof width === 'number') widthHand = "".concat(width, "px");
|
|
241
241
|
obj.width = widthHand;
|
|
242
242
|
}
|
|
243
243
|
if (height) {
|
|
244
244
|
var heightHand = height;
|
|
245
|
-
if (typeof height === 'number') heightHand = height
|
|
245
|
+
if (typeof height === 'number') heightHand = "".concat(height, "px");
|
|
246
246
|
obj.height = heightHand;
|
|
247
247
|
}
|
|
248
248
|
return obj;
|