@para-ui/core 3.0.28 → 3.0.30
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.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/OperateBtn/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
2
|
-
import { r as regenerator } from '../_verture/index-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
|
+
import { r as regenerator } from '../_verture/index-06fea29b.js';
|
|
3
3
|
import { a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
4
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
5
5
|
import { useState, Fragment } from 'react';
|
|
@@ -7,7 +7,7 @@ import More from '@para-ui/icons/More';
|
|
|
7
7
|
import { Button } from '../Button/index.js';
|
|
8
8
|
import { Popover } from '../Popover/index.js';
|
|
9
9
|
import AutoTips from '../AutoTips/index.js';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
10
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
11
11
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
12
12
|
import '../_verture/typeof-498dd2b1.js';
|
|
13
13
|
import 'clsx';
|
|
@@ -17,12 +17,12 @@ import '../Tooltip/index.js';
|
|
|
17
17
|
import 'rc-tooltip';
|
|
18
18
|
import 'rc-tooltip/lib/placements';
|
|
19
19
|
import '@para-ui/icons/Down';
|
|
20
|
-
import '../_verture/index-
|
|
20
|
+
import '../_verture/index-be4faaee.js';
|
|
21
21
|
import 'rc-dropdown';
|
|
22
|
-
import '../_verture/usePopupContainer-
|
|
22
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
23
23
|
import 'dayjs';
|
|
24
24
|
import '@paraview/lib';
|
|
25
|
-
import '../_verture/useFormatMessage-
|
|
25
|
+
import '../_verture/useFormatMessage-703f8b20.js';
|
|
26
26
|
import '@para-ui/core/GlobalContext';
|
|
27
27
|
|
|
28
28
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2022/4/13 10:48 AM\n* @description 表格操作按钮\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-operate-btn {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n display: flex;\n align-items: center;\n}\n.paraui-v3-operate-btn > .operate-btn-line {\n display: inline-block;\n width: 1px;\n background-color: rgba(54, 102, 214, 0.2);\n margin: 0 12px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-small > .operate-btn-line {\n height: 12px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-small button svg {\n font-size: 18px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-medium > .operate-btn-line {\n height: 14px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-medium button svg {\n font-size: 24px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-large > .operate-btn-line {\n height: 16px;\n}\n.paraui-v3-operate-btn.paraui-v3-operate-btn-large button > svg {\n font-size: 28px;\n}\n\n.paraui-v3-operate-btn-popover .operate-btn-list {\n padding: 8px 0;\n}\n.paraui-v3-operate-btn-popover .operate-btn-list > .operate-btn-list-item {\n padding: 0 12px;\n max-width: 120px;\n cursor: pointer;\n color: rgb(46, 55, 67);\n line-height: 36px;\n text-align: left;\n}\n.paraui-v3-operate-btn-popover .operate-btn-list > .operate-btn-list-item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-operate-btn-popover .operate-btn-list > .operate-btn-list-item-disabled {\n cursor: not-allowed;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-operate-btn-popover .operate-btn-list > .operate-btn-list-item-danger {\n color: rgb(235, 96, 84);\n}";
|
|
@@ -30,36 +30,31 @@ styleInject(css_248z);
|
|
|
30
30
|
|
|
31
31
|
var OperateBtn = function OperateBtn(props) {
|
|
32
32
|
var _props$className = props.className,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
34
|
+
style = props.style,
|
|
35
|
+
_props$size = props.size,
|
|
36
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
37
|
+
list = props.list,
|
|
38
|
+
_props$showNum = props.showNum,
|
|
39
|
+
showNum = _props$showNum === void 0 ? 3 : _props$showNum,
|
|
40
|
+
popoverClassName = props.popoverClassName,
|
|
41
|
+
_props$placement = props.placement,
|
|
42
|
+
placement = _props$placement === void 0 ? 'bottom-end' : _props$placement,
|
|
43
|
+
_props$clickCloseMore = props.clickCloseMore,
|
|
44
|
+
clickCloseMore = _props$clickCloseMore === void 0 ? true : _props$clickCloseMore,
|
|
45
|
+
onClick = props.onClick,
|
|
46
|
+
loadingMapping = props.loadingMapping,
|
|
47
|
+
_props$key = props.key,
|
|
48
|
+
key = _props$key === void 0 ? 'key' : _props$key;
|
|
50
49
|
var _useState = useState(false),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
openMoreCom = _useState2[0],
|
|
52
|
+
setOpenMoreCom = _useState2[1]; // 显示更多
|
|
56
53
|
var _useState3 = useState({}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
loadingInside = _useState4[0],
|
|
56
|
+
setLoadingInside = _useState4[1]; // 内部loading
|
|
60
57
|
// 点击选项
|
|
61
|
-
|
|
62
|
-
|
|
63
58
|
var clickItem = function clickItem(item, index) {
|
|
64
59
|
return function (e) {
|
|
65
60
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
@@ -72,51 +67,40 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
72
67
|
_context.next = 2;
|
|
73
68
|
break;
|
|
74
69
|
}
|
|
75
|
-
|
|
76
70
|
return _context.abrupt("return");
|
|
77
|
-
|
|
78
71
|
case 2:
|
|
79
72
|
if (clickCloseMore) closeMore();
|
|
80
73
|
handKey = item[key];
|
|
81
74
|
loading = loadingMapping && loadingMapping[handKey]; // 不存在外部loading
|
|
82
|
-
|
|
83
75
|
if (loading === undefined) {
|
|
84
76
|
loadingInside[index] = true;
|
|
85
77
|
setLoadingInside(Object.assign({}, loadingInside));
|
|
86
78
|
}
|
|
87
|
-
|
|
88
79
|
if (!item.onClick) {
|
|
89
80
|
_context.next = 12;
|
|
90
81
|
break;
|
|
91
82
|
}
|
|
92
|
-
|
|
93
83
|
_context.next = 9;
|
|
94
84
|
return item.onClick(item, e);
|
|
95
|
-
|
|
96
85
|
case 9:
|
|
97
86
|
result = _context.sent;
|
|
98
87
|
_context.next = 16;
|
|
99
88
|
break;
|
|
100
|
-
|
|
101
89
|
case 12:
|
|
102
90
|
if (!onClick) {
|
|
103
91
|
_context.next = 16;
|
|
104
92
|
break;
|
|
105
93
|
}
|
|
106
|
-
|
|
107
94
|
_context.next = 15;
|
|
108
95
|
return onClick(item, e);
|
|
109
|
-
|
|
110
96
|
case 15:
|
|
111
97
|
result = _context.sent;
|
|
112
|
-
|
|
113
98
|
case 16:
|
|
114
99
|
// 不存在外部loading
|
|
115
100
|
if (loading === undefined) {
|
|
116
101
|
loadingInside[index] = result;
|
|
117
102
|
setLoadingInside(Object.assign({}, loadingInside));
|
|
118
103
|
}
|
|
119
|
-
|
|
120
104
|
case 17:
|
|
121
105
|
case "end":
|
|
122
106
|
return _context.stop();
|
|
@@ -125,42 +109,35 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
125
109
|
}, _callee);
|
|
126
110
|
}));
|
|
127
111
|
};
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
112
|
+
};
|
|
113
|
+
// 点击更多
|
|
131
114
|
var clickMore = function clickMore() {
|
|
132
115
|
setOpenMoreCom(true);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
|
|
116
|
+
};
|
|
117
|
+
// 关闭显示更多
|
|
136
118
|
var closeMore = function closeMore(bol) {
|
|
137
119
|
if (bol) return;
|
|
138
120
|
setOpenMoreCom(false);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
|
|
121
|
+
};
|
|
122
|
+
// 处理loading
|
|
142
123
|
var handLoadStatus = function handLoadStatus(item, index) {
|
|
143
124
|
var loading;
|
|
144
125
|
var handKey = item[key];
|
|
145
|
-
loading = loadingMapping && loadingMapping[handKey];
|
|
146
|
-
|
|
126
|
+
loading = loadingMapping && loadingMapping[handKey];
|
|
127
|
+
// 外部没有传laoding
|
|
147
128
|
if (loading === undefined) {
|
|
148
129
|
loading = loadingInside[index];
|
|
149
130
|
}
|
|
150
|
-
|
|
151
131
|
return loading;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
};
|
|
133
|
+
// 处理handClassPopover
|
|
155
134
|
var handClassPopover = function handClassPopover() {
|
|
156
135
|
var str = $prefixCls + '-operate-btn-popover';
|
|
157
136
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
158
137
|
return str;
|
|
159
138
|
};
|
|
160
|
-
|
|
161
139
|
var morePopoverContent = function morePopoverContent() {
|
|
162
140
|
var arr = (list === null || list === void 0 ? void 0 : list.slice(showNum, list === null || list === void 0 ? void 0 : list.length)) || [];
|
|
163
|
-
|
|
164
141
|
var handPopoverClass = function handPopoverClass(item) {
|
|
165
142
|
var str = 'operate-btn-list-item';
|
|
166
143
|
if (item.disabled) str += ' operate-btn-list-item-disabled';
|
|
@@ -168,7 +145,6 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
168
145
|
if (item.className) str += ' ' + className;
|
|
169
146
|
return str;
|
|
170
147
|
};
|
|
171
|
-
|
|
172
148
|
return jsx("div", Object.assign({
|
|
173
149
|
className: "operate-btn-list"
|
|
174
150
|
}, {
|
|
@@ -184,9 +160,8 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
184
160
|
}), index);
|
|
185
161
|
})
|
|
186
162
|
}));
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
|
|
163
|
+
};
|
|
164
|
+
// 更多按钮
|
|
190
165
|
var moreRender = function moreRender() {
|
|
191
166
|
return jsx(Fragment$1, {
|
|
192
167
|
children: list && list.length > showNum + 1 && jsx(Popover, Object.assign({
|
|
@@ -211,21 +186,19 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
211
186
|
}))
|
|
212
187
|
});
|
|
213
188
|
};
|
|
214
|
-
|
|
215
189
|
var handClass = function handClass() {
|
|
216
190
|
var str = $prefixCls + '-operate-btn';
|
|
217
191
|
if (className) str += ' ' + className;
|
|
218
192
|
if (size) str += " ".concat($prefixCls, "-operate-btn-").concat(size);
|
|
219
193
|
return str;
|
|
220
194
|
};
|
|
221
|
-
|
|
222
195
|
return jsxs("div", Object.assign({
|
|
223
196
|
className: handClass(),
|
|
224
197
|
style: style
|
|
225
198
|
}, {
|
|
226
199
|
children: [list === null || list === void 0 ? void 0 : list.map(function (item, index) {
|
|
227
|
-
var bol = true;
|
|
228
|
-
|
|
200
|
+
var bol = true;
|
|
201
|
+
// 满足这个条件,有更多按钮
|
|
229
202
|
if (list.length > showNum + 1) {
|
|
230
203
|
// 超出显示个数不显示
|
|
231
204
|
if (showNum < index + 1) {
|
|
@@ -238,7 +211,6 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
238
211
|
bol = false;
|
|
239
212
|
}
|
|
240
213
|
}
|
|
241
|
-
|
|
242
214
|
return jsxs(Fragment, {
|
|
243
215
|
children: [jsx(Button.IconButton, Object.assign({
|
|
244
216
|
className: item.className,
|