@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/AutoBox/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import { Popover } from '../Popover/index.js';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { UUID } from '@paraview/lib';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
8
8
|
import More from '@para-ui/icons/More';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -12,19 +12,17 @@ import '../Tooltip/index.js';
|
|
|
12
12
|
import 'rc-tooltip';
|
|
13
13
|
import 'rc-tooltip/lib/placements';
|
|
14
14
|
import 'clsx';
|
|
15
|
-
import '../_verture/usePopupContainer-
|
|
15
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
16
16
|
|
|
17
17
|
var Protal = function Protal(props) {
|
|
18
18
|
var children = props.children,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
className = props.className,
|
|
20
|
+
anchorEl = props.anchorEl,
|
|
21
|
+
onClose = props.onClose;
|
|
23
22
|
var _useState = useState({}),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
styleCom = _useState2[0],
|
|
25
|
+
setStyleCom = _useState2[1];
|
|
28
26
|
var constData = useRef({
|
|
29
27
|
uuid: $prefixCls + '-protal-box-content-' + UUID()
|
|
30
28
|
});
|
|
@@ -43,32 +41,23 @@ var Protal = function Protal(props) {
|
|
|
43
41
|
* @param el 当前元素
|
|
44
42
|
* @param selector 查找元素class
|
|
45
43
|
*/
|
|
46
|
-
|
|
47
44
|
var closest = function closest(el, selector) {
|
|
48
45
|
var matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
|
49
|
-
|
|
50
46
|
while (el) {
|
|
51
47
|
if (matchesSelector.call(el, selector)) {
|
|
52
48
|
break;
|
|
53
49
|
}
|
|
54
|
-
|
|
55
50
|
el = el.parentElement;
|
|
56
51
|
}
|
|
57
|
-
|
|
58
52
|
return el;
|
|
59
53
|
};
|
|
60
54
|
/** 全局监听点击事件 */
|
|
61
|
-
|
|
62
|
-
|
|
63
55
|
var clickFunc = function clickFunc(e) {
|
|
64
56
|
if (!constData.current) return;
|
|
65
57
|
var bol = closest(e.target, '.' + constData.current.uuid); // 是否存在下拉当中
|
|
66
|
-
|
|
67
58
|
if (!bol) onClose && onClose();
|
|
68
59
|
};
|
|
69
60
|
/** 处理内容的定位样式 */
|
|
70
|
-
|
|
71
|
-
|
|
72
61
|
var handStyle = function handStyle() {
|
|
73
62
|
if (!anchorEl || !contentRef.current) return;
|
|
74
63
|
var posDomRect = anchorEl.getBoundingClientRect();
|
|
@@ -80,28 +69,22 @@ var Protal = function Protal(props) {
|
|
|
80
69
|
};
|
|
81
70
|
var winHeight = window.innerHeight;
|
|
82
71
|
var winWidth = window.innerWidth;
|
|
83
|
-
|
|
84
72
|
if (json.left + contentDomRect.width > winWidth) {
|
|
85
73
|
json.left = winWidth - contentDomRect.width - 8;
|
|
86
74
|
if (json.left < 0) json.left = 0;
|
|
87
75
|
}
|
|
88
|
-
|
|
89
76
|
if (json.top + contentDomRect.height > winHeight) {
|
|
90
77
|
json.top = winHeight - contentDomRect.height - 8;
|
|
91
78
|
if (json.top < 0) json.top = 0;
|
|
92
79
|
}
|
|
93
|
-
|
|
94
80
|
setStyleCom(json);
|
|
95
81
|
};
|
|
96
82
|
/** 处理className */
|
|
97
|
-
|
|
98
|
-
|
|
99
83
|
var handClass = function handClass() {
|
|
100
84
|
var str = $prefixCls + '-protal-box';
|
|
101
85
|
if (className) str += ' ' + className;
|
|
102
86
|
return str;
|
|
103
87
|
};
|
|
104
|
-
|
|
105
88
|
var handContent = function handContent() {
|
|
106
89
|
return jsxs("div", Object.assign({
|
|
107
90
|
className: handClass(),
|
|
@@ -118,7 +101,6 @@ var Protal = function Protal(props) {
|
|
|
118
101
|
}))]
|
|
119
102
|
}));
|
|
120
103
|
};
|
|
121
|
-
|
|
122
104
|
return jsx(Fragment, {
|
|
123
105
|
children: /*#__PURE__*/createPortal(handContent(), document.getElementsByTagName('body')[0])
|
|
124
106
|
});
|
|
@@ -129,41 +111,33 @@ styleInject(css_248z);
|
|
|
129
111
|
|
|
130
112
|
var AutoBox = function AutoBox(props) {
|
|
131
113
|
var className = props.className,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
114
|
+
_props$list = props.list,
|
|
115
|
+
list = _props$list === void 0 ? [] : _props$list,
|
|
116
|
+
popoverClassName = props.popoverClassName,
|
|
117
|
+
moreCustomize = props.moreCustomize,
|
|
118
|
+
anchorEl = props.anchorEl,
|
|
119
|
+
_props$hideMore = props.hideMore,
|
|
120
|
+
hideMore = _props$hideMore === void 0 ? false : _props$hideMore,
|
|
121
|
+
showNum = props.showNum,
|
|
122
|
+
onCloseMore = props.onCloseMore,
|
|
123
|
+
onShowMore = props.onShowMore,
|
|
124
|
+
style = props.style;
|
|
144
125
|
var _useState = useState('auto-box-' + UUID()),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
127
|
+
classOne = _useState2[0]; // 唯一class
|
|
149
128
|
var _useState3 = useState(null),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
129
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
130
|
+
morePos = _useState4[0],
|
|
131
|
+
setMorePos = _useState4[1]; // 超出在原始位置
|
|
155
132
|
var _useState5 = useState(false),
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
133
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
134
|
+
openMoreCom = _useState6[0],
|
|
135
|
+
setOpenMoreCom = _useState6[1]; // 显示更多
|
|
161
136
|
var _useState7 = useState({}),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
137
|
+
_useState8 = _slicedToArray(_useState7, 1),
|
|
138
|
+
timer = _useState8[0];
|
|
139
|
+
var posDom = useRef();
|
|
140
|
+
// 监听打开更多
|
|
167
141
|
useEffect(function () {
|
|
168
142
|
if (props.openMore !== undefined) {
|
|
169
143
|
setOpenMoreCom(props.openMore);
|
|
@@ -191,42 +165,36 @@ var AutoBox = function AutoBox(props) {
|
|
|
191
165
|
onShowMore && onShowMore(false);
|
|
192
166
|
}
|
|
193
167
|
}, [list, morePos, onShowMore]);
|
|
194
|
-
|
|
195
168
|
var onVisibleChange = function onVisibleChange(bol) {
|
|
196
169
|
if (bol) return setOpenMoreCom(true);
|
|
197
170
|
closeMore();
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
|
|
171
|
+
};
|
|
172
|
+
// 关闭显示更多
|
|
201
173
|
var closeMore = function closeMore() {
|
|
202
174
|
setOpenMoreCom(false);
|
|
203
175
|
onCloseMore && onCloseMore();
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
|
|
176
|
+
};
|
|
177
|
+
// 关闭显示更多
|
|
207
178
|
var handleCloseMore = function handleCloseMore() {
|
|
208
179
|
closeMore();
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
|
|
180
|
+
};
|
|
181
|
+
// 不换行 计算
|
|
212
182
|
var handMultiline = function handMultiline(index) {
|
|
213
183
|
if (index === null || index === 0) return;
|
|
214
184
|
if (index === undefined) index = list.length;
|
|
215
185
|
var boxDom = document.querySelector('.' + classOne);
|
|
216
186
|
if (!boxDom) return;
|
|
217
|
-
|
|
218
187
|
if (boxDom.scrollWidth > boxDom.clientWidth) {
|
|
219
|
-
var num = Number(index) - 1;
|
|
220
|
-
|
|
188
|
+
var num = Number(index) - 1;
|
|
189
|
+
// 超出
|
|
221
190
|
setMorePos(num);
|
|
222
191
|
handMultiline(num);
|
|
223
192
|
} else {
|
|
224
193
|
// 一个
|
|
225
194
|
if (list.length <= index) handleCloseMore();
|
|
226
195
|
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
|
|
196
|
+
};
|
|
197
|
+
// 多选 不换行
|
|
230
198
|
var changeSize = function changeSize() {
|
|
231
199
|
clearTimeout(timer.timer);
|
|
232
200
|
closeMore();
|
|
@@ -234,24 +202,21 @@ var AutoBox = function AutoBox(props) {
|
|
|
234
202
|
setMorePos(list.length);
|
|
235
203
|
handMultiline();
|
|
236
204
|
}, 100);
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
|
|
205
|
+
};
|
|
206
|
+
// 处理class
|
|
240
207
|
var handClass = function handClass() {
|
|
241
208
|
var str = $prefixCls + '-auto-box';
|
|
242
209
|
if (classOne) str += ' ' + classOne;
|
|
243
210
|
if (className) str += ' ' + className;
|
|
244
211
|
return str;
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
|
|
212
|
+
};
|
|
213
|
+
// 处理handClassPopover
|
|
248
214
|
var handClassPopover = function handClassPopover() {
|
|
249
215
|
var str = $prefixCls + '-auto-box-popover';
|
|
250
216
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
251
217
|
return str;
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
|
|
218
|
+
};
|
|
219
|
+
// 处理更多内容
|
|
255
220
|
var handMoreDom = function handMoreDom() {
|
|
256
221
|
return jsx("div", Object.assign({
|
|
257
222
|
className: "auto-box-popover-content"
|
|
@@ -265,8 +230,6 @@ var AutoBox = function AutoBox(props) {
|
|
|
265
230
|
}));
|
|
266
231
|
};
|
|
267
232
|
/** 处理更多按钮 */
|
|
268
|
-
|
|
269
|
-
|
|
270
233
|
var handMoreBtn = function handMoreBtn() {
|
|
271
234
|
if (morePos !== null && list.length > morePos && !hideMore) {
|
|
272
235
|
return jsx(Popover, Object.assign({
|
|
@@ -286,8 +249,6 @@ var AutoBox = function AutoBox(props) {
|
|
|
286
249
|
}
|
|
287
250
|
};
|
|
288
251
|
/** 自定义更多按钮 */
|
|
289
|
-
|
|
290
|
-
|
|
291
252
|
var handCustomDialog = function handCustomDialog() {
|
|
292
253
|
if (anchorEl && openMoreCom) {
|
|
293
254
|
return jsx(Protal, Object.assign({
|
|
@@ -299,7 +260,6 @@ var AutoBox = function AutoBox(props) {
|
|
|
299
260
|
}));
|
|
300
261
|
}
|
|
301
262
|
};
|
|
302
|
-
|
|
303
263
|
return jsxs("div", Object.assign({
|
|
304
264
|
className: handClass(),
|
|
305
265
|
style: style
|
package/AutoTips/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useState, useEffect } from 'react';
|
|
4
4
|
import { Tooltip } from '../Tooltip/index.js';
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
5
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
6
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
7
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
8
8
|
import 'rc-tooltip';
|
|
@@ -14,37 +14,34 @@ styleInject(css_248z);
|
|
|
14
14
|
|
|
15
15
|
var AutoTips = function AutoTips(props) {
|
|
16
16
|
var children = props.children,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
_props$arrow = props.arrow,
|
|
18
|
+
arrow = _props$arrow === void 0 ? false : _props$arrow,
|
|
19
|
+
_props$placement = props.placement,
|
|
20
|
+
placement = _props$placement === void 0 ? "bottom-start" : _props$placement,
|
|
21
|
+
_props$tips = props.tips,
|
|
22
|
+
tips = _props$tips === void 0 ? '' : _props$tips,
|
|
23
|
+
_props$className = props.className,
|
|
24
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
25
|
+
_props$beyondText = props.beyondText,
|
|
26
|
+
beyondText = _props$beyondText === void 0 ? true : _props$beyondText,
|
|
27
|
+
_props$interactive = props.interactive,
|
|
28
|
+
interactive = _props$interactive === void 0 ? true : _props$interactive,
|
|
29
|
+
tipMaxWidth = props.tipMaxWidth,
|
|
30
|
+
style = props.style;
|
|
31
31
|
var tipsElm = useRef();
|
|
32
32
|
var textElm = useRef();
|
|
33
|
-
|
|
34
33
|
var _useState = useState(''),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
tTips = _useState2[0],
|
|
36
|
+
setTTips = _useState2[1];
|
|
39
37
|
useEffect(function () {
|
|
40
38
|
setTTips(tips);
|
|
41
|
-
}, [tips]);
|
|
42
|
-
|
|
39
|
+
}, [tips]);
|
|
40
|
+
// 鼠标移入事件
|
|
43
41
|
var mouseHover = function mouseHover() {
|
|
44
42
|
var val = '';
|
|
45
43
|
var outBox = tipsElm.current.getBoundingClientRect();
|
|
46
44
|
var innerBox = textElm.current.getBoundingClientRect();
|
|
47
|
-
|
|
48
45
|
if (tipsElm.current && innerBox.width > outBox.width) {
|
|
49
46
|
if (tips) {
|
|
50
47
|
val = tips;
|
|
@@ -52,23 +49,19 @@ var AutoTips = function AutoTips(props) {
|
|
|
52
49
|
val = beyondText ? tipsElm.current.innerText : children;
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
setTTips(val);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
};
|
|
54
|
+
// 处理最大宽度
|
|
60
55
|
var handMaxWidth = function handMaxWidth() {
|
|
61
56
|
if (tipMaxWidth) return tipMaxWidth;
|
|
62
57
|
return tipsElm && tipsElm.current ? tipsElm.current.offsetWidth : 0;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
};
|
|
59
|
+
// 处理class
|
|
66
60
|
var handClass = function handClass() {
|
|
67
61
|
var str = $prefixCls + '-auto-tips';
|
|
68
62
|
if (className) str += ' ' + className;
|
|
69
63
|
return str;
|
|
70
64
|
};
|
|
71
|
-
|
|
72
65
|
return jsx("div", Object.assign({
|
|
73
66
|
ref: tipsElm,
|
|
74
67
|
className: handClass(),
|
package/Breadcrumbs/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
3
3
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useRef, useEffect, Fragment } from 'react';
|
|
5
5
|
import { Popover } from '../Popover/index.js';
|
|
6
6
|
import AutoTips from '../AutoTips/index.js';
|
|
7
7
|
import More from '@para-ui/icons/More';
|
|
8
8
|
import Return from '@para-ui/icons/Return';
|
|
9
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
10
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
9
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
10
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
11
11
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
12
12
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
13
13
|
import '../Tooltip/index.js';
|
|
14
14
|
import 'rc-tooltip';
|
|
15
15
|
import 'rc-tooltip/lib/placements';
|
|
16
16
|
import 'clsx';
|
|
17
|
-
import '../_verture/usePopupContainer-
|
|
17
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
18
18
|
import '@para-ui/core/GlobalContext';
|
|
19
19
|
|
|
20
20
|
var en = {
|
|
@@ -35,40 +35,35 @@ styleInject(css_248z);
|
|
|
35
35
|
|
|
36
36
|
var Breadcrumbs = function Breadcrumbs(props) {
|
|
37
37
|
var _props$maxWidth = props.maxWidth,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
maxWidth = _props$maxWidth === void 0 ? '160px' : _props$maxWidth,
|
|
39
|
+
className = props.className,
|
|
40
|
+
list = props.list,
|
|
41
|
+
_props$separator = props.separator,
|
|
42
|
+
separator = _props$separator === void 0 ? '/' : _props$separator,
|
|
43
|
+
popoverClassName = props.popoverClassName,
|
|
44
|
+
_props$isShrink = props.isShrink,
|
|
45
|
+
isShrink = _props$isShrink === void 0 ? true : _props$isShrink,
|
|
46
|
+
_props$isBack = props.isBack,
|
|
47
|
+
isBack = _props$isBack === void 0 ? false : _props$isBack,
|
|
48
|
+
_props$minNum = props.minNum,
|
|
49
|
+
minNum = _props$minNum === void 0 ? 2 : _props$minNum,
|
|
50
|
+
_props$trigger = props.trigger,
|
|
51
|
+
trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
|
|
52
|
+
_props$placement = props.placement,
|
|
53
|
+
placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,
|
|
54
|
+
backRender = props.backRender,
|
|
55
|
+
onClickItem = props.onClickItem,
|
|
56
|
+
onBack = props.onBack,
|
|
57
|
+
style = props.style;
|
|
58
58
|
var intl = useFormatMessage('Breadcrumbs', localeJson);
|
|
59
|
-
|
|
60
59
|
var _useState = useState(false),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
showMore = _useState2[0],
|
|
62
|
+
setShowMore = _useState2[1]; // 是否显示更多按钮
|
|
66
63
|
var _useState3 = useState([]),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
65
|
+
hideArr = _useState4[0],
|
|
66
|
+
setHideArr = _useState4[1]; // 是否隐藏面包屑
|
|
72
67
|
var boxRef = useRef();
|
|
73
68
|
var constData = useRef({
|
|
74
69
|
minNum: minNum,
|
|
@@ -97,7 +92,6 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
97
92
|
changeSize();
|
|
98
93
|
}, [list]);
|
|
99
94
|
/** 点击面包屑 */
|
|
100
|
-
|
|
101
95
|
var clickItem = function clickItem(item, index) {
|
|
102
96
|
return function () {
|
|
103
97
|
if (props.list.length - 1 === index || item.disabled) return;
|
|
@@ -105,8 +99,6 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
105
99
|
};
|
|
106
100
|
};
|
|
107
101
|
/** 点击返回, 又返回执行返回事件,否则默认返回上级 */
|
|
108
|
-
|
|
109
|
-
|
|
110
102
|
var clickBack = function clickBack() {
|
|
111
103
|
if (onBack) return onBack();
|
|
112
104
|
if (props.list.length < 2) return;
|
|
@@ -114,23 +106,18 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
114
106
|
clickItem(item, props.list.length - 2)();
|
|
115
107
|
};
|
|
116
108
|
/** 改变屏幕 */
|
|
117
|
-
|
|
118
|
-
|
|
119
109
|
var winResize = function winResize() {
|
|
120
110
|
changeSize();
|
|
121
111
|
};
|
|
122
112
|
/** 去除遮罩 */
|
|
123
|
-
|
|
124
|
-
|
|
125
113
|
var hideMask = function hideMask() {
|
|
126
114
|
boxRef.current.classList.remove($prefixCls + '-breadcrumbs-calculation');
|
|
127
115
|
};
|
|
128
|
-
|
|
129
116
|
var changeSize = function changeSize(bol) {
|
|
130
|
-
if (!constData.current.isShrink) return hideMask();
|
|
131
|
-
|
|
132
|
-
clearTimeout(constData.current.timer);
|
|
133
|
-
|
|
117
|
+
if (!constData.current.isShrink) return hideMask();
|
|
118
|
+
// 不自动计算
|
|
119
|
+
clearTimeout(constData.current.timer);
|
|
120
|
+
// 恢复初始状态
|
|
134
121
|
if (!bol) {
|
|
135
122
|
constData.current.hidePos = 0;
|
|
136
123
|
constData.current.showMore = false;
|
|
@@ -139,17 +126,15 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
139
126
|
setHideArr(arr);
|
|
140
127
|
setShowMore(false);
|
|
141
128
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
129
|
+
if (props.list.length <= constData.current.minNum + 1) return hideMask();
|
|
130
|
+
// 面包屑数组长度必须大于最少显示数
|
|
131
|
+
if (constData.current.hidePos === props.list.length - constData.current.minNum - 1) return hideMask();
|
|
132
|
+
// 隐藏到最小显示数,停止
|
|
147
133
|
boxRef.current.classList.add($prefixCls + '-breadcrumbs-calculation');
|
|
148
134
|
constData.current.timer = setTimeout(function () {
|
|
149
135
|
var boxWidth = boxRef.current.clientWidth;
|
|
150
136
|
var listWidth = boxRef.current.querySelector('.breadcrumbs-list').clientWidth;
|
|
151
137
|
var backWidth = constData.current.isBack ? boxRef.current.querySelector('.breadcrumbs-back').clientWidth : 0;
|
|
152
|
-
|
|
153
138
|
if (boxWidth > listWidth + backWidth) {
|
|
154
139
|
// 没有超出
|
|
155
140
|
hideMask();
|
|
@@ -169,8 +154,6 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
169
154
|
}, 50);
|
|
170
155
|
};
|
|
171
156
|
/** 处理弹窗内容 */
|
|
172
|
-
|
|
173
|
-
|
|
174
157
|
var handContent = function handContent() {
|
|
175
158
|
return jsx("div", Object.assign({
|
|
176
159
|
className: "breadcrumbs-popover-content"
|
|
@@ -189,23 +172,20 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
189
172
|
}), index);
|
|
190
173
|
})
|
|
191
174
|
}));
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
|
|
175
|
+
};
|
|
176
|
+
// 处理弹出框className
|
|
195
177
|
var popoverHandClass = function popoverHandClass() {
|
|
196
178
|
var str = $prefixCls + '-breadcrumbs-popover';
|
|
197
179
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
198
180
|
return str;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
|
|
181
|
+
};
|
|
182
|
+
// 处理className
|
|
202
183
|
var handClass = function handClass() {
|
|
203
184
|
var str = $prefixCls + '-breadcrumbs';
|
|
204
185
|
if (isShrink) str += " ".concat($prefixCls, "-breadcrumbs-shrink");
|
|
205
186
|
if (className) str += ' ' + className;
|
|
206
187
|
return str;
|
|
207
188
|
};
|
|
208
|
-
|
|
209
189
|
return jsxs("div", Object.assign({
|
|
210
190
|
className: handClass(),
|
|
211
191
|
style: style,
|
package/Button/SplitButton.d.ts
CHANGED
package/Button/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
|
|
|
71
71
|
}
|
|
72
72
|
declare const InternalButton: FunctionComponent<ButtonProps>;
|
|
73
73
|
declare const IconButton: FunctionComponent<IconButtonProps>;
|
|
74
|
-
|
|
74
|
+
type mergedButtonType = typeof InternalButton & {
|
|
75
75
|
IconButton: typeof IconButton;
|
|
76
76
|
SplitButton: typeof SplitButton;
|
|
77
77
|
};
|