@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.5
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 +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +89 -117
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +7 -9
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +242 -330
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +22 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +219 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +66 -74
- package/FormItem/index.js +14 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +905 -796
- package/SelectorPicker/index.js +111 -133
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +25 -26
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +767 -963
- package/Tabs/index.js +102 -102
- package/Tag/index.js +115 -162
- package/TextEditor/index.js +81 -103
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +27 -28
- package/Timeline/index.js +67 -58
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +53 -52
- package/Tooltip/index.js +79 -82
- package/Transfer/index.js +159 -201
- package/Tree/index.js +7 -12
- package/Upload/index.js +523 -758
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
- package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
- package/index.js +21 -22
- package/locale/index.js +6 -6
- package/package.json +1 -1
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-232d890b.js +0 -327
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/toConsumableArray-8f4c9589.js +0 -19
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Breadcrumbs/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-8f4c9589.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
3
1
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
4
2
|
import { useState, useRef, useEffect, Fragment } from 'react';
|
|
5
3
|
import { Popover } from '../Popover/index.js';
|
|
6
4
|
import AutoTips from '../AutoTips/index.js';
|
|
7
5
|
import More from '@para-ui/icons/More';
|
|
8
6
|
import Return from '@para-ui/icons/Return';
|
|
9
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
10
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
8
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
11
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
12
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
13
10
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
14
11
|
import '../Tooltip/index.js';
|
|
15
12
|
import 'rc-tooltip';
|
|
16
13
|
import 'rc-tooltip/lib/placements';
|
|
17
14
|
import 'clsx';
|
|
18
15
|
import '@para-ui/icons/Forbid';
|
|
19
|
-
import '../_verture/usePopupContainer-
|
|
16
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
20
17
|
import '@paraview/lib';
|
|
21
18
|
import '@para-ui/core/GlobalContext';
|
|
22
19
|
|
|
@@ -29,49 +26,38 @@ var zh = {
|
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
var localeJson = {
|
|
32
|
-
zh
|
|
33
|
-
en
|
|
29
|
+
zh,
|
|
30
|
+
en
|
|
34
31
|
};
|
|
35
32
|
|
|
36
33
|
var css_248z = "@charset \"UTF-8\";\n/**\n * @author linhd\n * @date 2021年10月25日 14:58:12\n * @description 面包屑\n */\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-breadcrumbs {\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 height: 24px;\n line-height: 24px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list {\n display: flex;\n align-items: center;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item {\n padding: 0 4px;\n border-radius: 2px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item .breadcrumbs-item-content {\n white-space: nowrap;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item .breadcrumbs-item-content svg {\n color: rgb(92, 101, 115);\n font-size: 14px;\n margin-right: 4px;\n vertical-align: -2px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click .breadcrumbs-item-content {\n cursor: pointer;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover .breadcrumbs-item-content {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover .breadcrumbs-item-content svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-current .breadcrumbs-item-content {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-current .breadcrumbs-item-content svg {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled .breadcrumbs-item-content {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled .breadcrumbs-item-content svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more {\n display: flex;\n align-items: center;\n height: 100%;\n padding: 0 4px;\n cursor: pointer;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more:hover svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-list > .separator {\n color: rgb(212, 218, 227);\n margin: 0 4px;\n position: relative;\n top: -1px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back {\n display: flex;\n align-items: center;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .line {\n display: inline-block;\n width: 1px;\n height: 14px;\n background-color: rgb(212, 218, 227);\n margin: 0 8px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n height: 100%;\n color: rgb(92, 101, 115);\n padding: 0 4px;\n border-radius: 2px;\n cursor: pointer;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content:hover {\n background-color: rgb(247, 248, 250);\n color: rgb(46, 101, 230);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content:hover svg {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content svg {\n color: rgb(92, 101, 115);\n font-size: 14px;\n margin-right: 4px;\n}\n.paraui-v4-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content span {\n white-space: nowrap;\n}\n.paraui-v4-breadcrumbs.paraui-v4-breadcrumbs-calculation {\n overflow: hidden;\n opacity: 0;\n}\n\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content {\n padding: 4px 0;\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item {\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 height: 30px;\n line-height: 30px;\n padding: 0 12px;\n color: rgb(29, 33, 38);\n display: flex;\n align-items: center;\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item svg {\n color: rgb(29, 33, 38);\n margin-right: 4px;\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-click {\n cursor: pointer;\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-click:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-disabled {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-disabled svg {\n color: rgb(161, 168, 179);\n}";
|
|
37
34
|
styleInject(css_248z);
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
maxWidth =
|
|
42
|
-
className
|
|
43
|
-
list
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
showMore = _useState2[0],
|
|
65
|
-
setShowMore = _useState2[1]; // 是否显示更多按钮
|
|
66
|
-
var _useState3 = useState([]),
|
|
67
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
-
hideArr = _useState4[0],
|
|
69
|
-
setHideArr = _useState4[1]; // 是否隐藏面包屑
|
|
70
|
-
var boxRef = useRef();
|
|
71
|
-
var constData = useRef({
|
|
72
|
-
minNum: minNum,
|
|
73
|
-
isBack: isBack,
|
|
74
|
-
isShrink: isShrink,
|
|
36
|
+
const Breadcrumbs = props => {
|
|
37
|
+
const {
|
|
38
|
+
maxWidth = '160px',
|
|
39
|
+
className,
|
|
40
|
+
list,
|
|
41
|
+
separator = '/',
|
|
42
|
+
popoverClassName,
|
|
43
|
+
isShrink = true,
|
|
44
|
+
isBack = false,
|
|
45
|
+
minNum = 2,
|
|
46
|
+
trigger = 'hover',
|
|
47
|
+
placement = 'bottomLeft',
|
|
48
|
+
backRender,
|
|
49
|
+
onClickItem,
|
|
50
|
+
onBack,
|
|
51
|
+
style
|
|
52
|
+
} = props;
|
|
53
|
+
const intl = useFormatMessage('Breadcrumbs', localeJson);
|
|
54
|
+
const [showMore, setShowMore] = useState(false); // 是否显示更多按钮
|
|
55
|
+
const [hideArr, setHideArr] = useState([]); // 是否隐藏面包屑
|
|
56
|
+
const boxRef = useRef();
|
|
57
|
+
const constData = useRef({
|
|
58
|
+
minNum,
|
|
59
|
+
isBack,
|
|
60
|
+
isShrink,
|
|
75
61
|
timer: null,
|
|
76
62
|
showMore: false,
|
|
77
63
|
hideArr: [],
|
|
@@ -81,42 +67,40 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
81
67
|
constData.current.showMore = showMore;
|
|
82
68
|
constData.current.isShrink = isShrink;
|
|
83
69
|
constData.current.minNum = minNum;
|
|
84
|
-
useEffect(
|
|
70
|
+
useEffect(() => {
|
|
85
71
|
window.addEventListener('resize', winResize);
|
|
86
|
-
return
|
|
72
|
+
return () => {
|
|
87
73
|
clearTimeout(constData.current.timer);
|
|
88
74
|
window.removeEventListener('resize', winResize);
|
|
89
75
|
};
|
|
90
76
|
}, []);
|
|
91
|
-
useEffect(
|
|
92
|
-
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const arr = new Array(props.list.length).fill(false);
|
|
93
79
|
constData.current.hideArr = arr;
|
|
94
80
|
setHideArr(arr);
|
|
95
81
|
changeSize();
|
|
96
82
|
}, [list]);
|
|
97
83
|
/** 点击面包屑 */
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onClickItem && onClickItem(item);
|
|
102
|
-
};
|
|
84
|
+
const clickItem = (item, index) => () => {
|
|
85
|
+
if (props.list.length - 1 === index || item.disabled) return;
|
|
86
|
+
onClickItem && onClickItem(item);
|
|
103
87
|
};
|
|
104
88
|
/** 点击返回, 又返回执行返回事件,否则默认返回上级 */
|
|
105
|
-
|
|
89
|
+
const clickBack = () => {
|
|
106
90
|
if (onBack) return onBack();
|
|
107
91
|
if (props.list.length < 2) return;
|
|
108
|
-
|
|
92
|
+
const item = props.list[props.list.length - 2];
|
|
109
93
|
clickItem(item, props.list.length - 2)();
|
|
110
94
|
};
|
|
111
95
|
/** 改变屏幕 */
|
|
112
|
-
|
|
96
|
+
const winResize = () => {
|
|
113
97
|
changeSize();
|
|
114
98
|
};
|
|
115
99
|
/** 去除遮罩 */
|
|
116
|
-
|
|
100
|
+
const hideMask = () => {
|
|
117
101
|
boxRef.current.classList.remove("".concat($prefixCls, "-breadcrumbs-calculation"));
|
|
118
102
|
};
|
|
119
|
-
|
|
103
|
+
const changeSize = bol => {
|
|
120
104
|
if (!constData.current.isShrink) return hideMask();
|
|
121
105
|
// 不自动计算
|
|
122
106
|
clearTimeout(constData.current.timer);
|
|
@@ -124,7 +108,7 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
124
108
|
if (!bol) {
|
|
125
109
|
constData.current.hidePos = 0;
|
|
126
110
|
constData.current.showMore = false;
|
|
127
|
-
|
|
111
|
+
const arr = new Array(props.list.length).fill(false);
|
|
128
112
|
constData.current.hideArr = arr;
|
|
129
113
|
setHideArr(arr);
|
|
130
114
|
setShowMore(false);
|
|
@@ -134,17 +118,17 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
134
118
|
if (constData.current.hidePos === props.list.length - constData.current.minNum - 1) return hideMask();
|
|
135
119
|
// 隐藏到最小显示数,停止
|
|
136
120
|
boxRef.current.classList.add("".concat($prefixCls, "-breadcrumbs-calculation"));
|
|
137
|
-
constData.current.timer = setTimeout(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
constData.current.timer = setTimeout(() => {
|
|
122
|
+
const boxWidth = boxRef.current.clientWidth;
|
|
123
|
+
const listWidth = boxRef.current.querySelector('.breadcrumbs-list').clientWidth;
|
|
124
|
+
const backWidth = constData.current.isBack ? boxRef.current.querySelector('.breadcrumbs-back').clientWidth : 0;
|
|
141
125
|
if (boxWidth > listWidth + backWidth) {
|
|
142
126
|
// 没有超出
|
|
143
127
|
hideMask();
|
|
144
128
|
} else {
|
|
145
129
|
constData.current.hidePos += 1;
|
|
146
130
|
constData.current.hideArr[constData.current.hidePos] = true;
|
|
147
|
-
setHideArr(
|
|
131
|
+
setHideArr([...constData.current.hideArr]);
|
|
148
132
|
setShowMore(true);
|
|
149
133
|
changeSize(true);
|
|
150
134
|
/*// 超出
|
|
@@ -157,13 +141,13 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
157
141
|
}, 50);
|
|
158
142
|
};
|
|
159
143
|
/** 处理弹窗内容 */
|
|
160
|
-
|
|
144
|
+
const handContent = () => {
|
|
161
145
|
return jsx("div", Object.assign({
|
|
162
146
|
className: "breadcrumbs-popover-content"
|
|
163
147
|
}, {
|
|
164
|
-
children: list.map(
|
|
148
|
+
children: list.map((item, index) => {
|
|
165
149
|
if (!hideArr[index]) return null;
|
|
166
|
-
|
|
150
|
+
let str = 'breadcrumbs-popover-content-item';
|
|
167
151
|
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-popover-content-item-click';
|
|
168
152
|
if (index === list.length - 1) str += ' breadcrumbs-popover-content-item-current';
|
|
169
153
|
if (item.disabled) str += ' breadcrumbs-popover-content-item-disabled';
|
|
@@ -177,14 +161,14 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
177
161
|
}));
|
|
178
162
|
};
|
|
179
163
|
// 处理弹出框className
|
|
180
|
-
|
|
181
|
-
|
|
164
|
+
const popoverHandClass = () => {
|
|
165
|
+
let str = "".concat($prefixCls, "-breadcrumbs-popover");
|
|
182
166
|
if (popoverClassName) str += " ".concat(popoverClassName);
|
|
183
167
|
return str;
|
|
184
168
|
};
|
|
185
169
|
// 处理className
|
|
186
|
-
|
|
187
|
-
|
|
170
|
+
const handClass = () => {
|
|
171
|
+
let str = "".concat($prefixCls, "-breadcrumbs");
|
|
188
172
|
if (isShrink) str += " ".concat($prefixCls, "-breadcrumbs-shrink");
|
|
189
173
|
if (className) str += " ".concat(className);
|
|
190
174
|
return str;
|
|
@@ -197,9 +181,9 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
197
181
|
children: [jsx("ul", Object.assign({
|
|
198
182
|
className: "breadcrumbs-list"
|
|
199
183
|
}, {
|
|
200
|
-
children: list.map(
|
|
184
|
+
children: list.map((item, index) => {
|
|
201
185
|
if (hideArr[index]) return;
|
|
202
|
-
|
|
186
|
+
let str = 'breadcrumbs-item';
|
|
203
187
|
if (index === list.length - 1) str += ' breadcrumbs-item-current';
|
|
204
188
|
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-item-click';
|
|
205
189
|
if (item.disabled) str += ' breadcrumbs-item-disabled';
|
package/Button/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
3
1
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
3
|
import { useRef, useState, useEffect } from 'react';
|
|
@@ -7,17 +5,16 @@ import clsx from 'clsx';
|
|
|
7
5
|
import LoadingOutlined from '@para-ui/icons/LoadingF';
|
|
8
6
|
import { Tooltip } from '../Tooltip/index.js';
|
|
9
7
|
import Down from '@para-ui/icons/Down';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
11
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
12
|
-
import { D as Dropdown } from '../_verture/index-
|
|
13
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
10
|
+
import { D as Dropdown } from '../_verture/index-da9097d3.js';
|
|
11
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
14
12
|
import AutoTips from '../AutoTips/index.js';
|
|
15
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
16
13
|
import 'rc-tooltip';
|
|
17
14
|
import 'rc-tooltip/lib/placements';
|
|
18
15
|
import '@para-ui/icons/Forbid';
|
|
19
16
|
import 'rc-dropdown';
|
|
20
|
-
import '../_verture/usePopupContainer-
|
|
17
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
21
18
|
import 'dayjs';
|
|
22
19
|
import '@paraview/lib';
|
|
23
20
|
import '@para-ui/core/GlobalContext';
|
|
@@ -40,35 +37,30 @@ styleInject(css_248z);
|
|
|
40
37
|
|
|
41
38
|
//分体式按钮
|
|
42
39
|
function SplitButton(props) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
options =
|
|
46
|
-
className
|
|
47
|
-
style
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
optionMaxWidth = _props$optionMaxWidth === void 0 ? '500px' : _props$optionMaxWidth,
|
|
65
|
-
_props$optionTipsPlac = props.optionTipsPlacement,
|
|
66
|
-
optionTipsPlacement = _props$optionTipsPlac === void 0 ? 'top-start' : _props$optionTipsPlac;
|
|
67
|
-
var intl = useFormatMessage('Button', localeJson);
|
|
68
|
-
var btnRef = useRef();
|
|
40
|
+
const {
|
|
41
|
+
buttonText,
|
|
42
|
+
options = [],
|
|
43
|
+
className,
|
|
44
|
+
style,
|
|
45
|
+
disabled = false,
|
|
46
|
+
onClick,
|
|
47
|
+
optionRender,
|
|
48
|
+
placement = 'bottomLeft',
|
|
49
|
+
buttonProps,
|
|
50
|
+
iconButton = false,
|
|
51
|
+
popperStyle,
|
|
52
|
+
popperClassName = '',
|
|
53
|
+
getPopupContainer,
|
|
54
|
+
variant,
|
|
55
|
+
hideStartIcon,
|
|
56
|
+
optionMaxWidth = '500px',
|
|
57
|
+
optionTipsPlacement = 'top-start'
|
|
58
|
+
} = props;
|
|
59
|
+
const intl = useFormatMessage('Button', localeJson);
|
|
60
|
+
const btnRef = useRef();
|
|
69
61
|
// const [selectedIndex, setSelectedIndex] = useState<number | string>();
|
|
70
62
|
// button click
|
|
71
|
-
|
|
63
|
+
const handleButtonClick = (opt, index, event) => {
|
|
72
64
|
var _a;
|
|
73
65
|
if (opt.disabled) {
|
|
74
66
|
event.stopPropagation();
|
|
@@ -79,16 +71,18 @@ function SplitButton(props) {
|
|
|
79
71
|
onClick === null || onClick === void 0 ? void 0 : onClick(opt, event);
|
|
80
72
|
};
|
|
81
73
|
//渲染按钮列表
|
|
82
|
-
|
|
74
|
+
const renderButtonList = () => {
|
|
83
75
|
// 渲染item
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
const renderItem = item => {
|
|
77
|
+
const com = (optionRender === null || optionRender === void 0 ? void 0 : optionRender(item)) || jsx(AutoTips, Object.assign({
|
|
86
78
|
placement: optionTipsPlacement
|
|
87
79
|
}, {
|
|
88
80
|
children: item.label
|
|
89
81
|
}));
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
const {
|
|
83
|
+
disabled,
|
|
84
|
+
disabledTooltip
|
|
85
|
+
} = item;
|
|
92
86
|
if (disabled && disabledTooltip) {
|
|
93
87
|
return jsx(Tooltip, Object.assign({
|
|
94
88
|
disabled: true
|
|
@@ -99,12 +93,12 @@ function SplitButton(props) {
|
|
|
99
93
|
return com;
|
|
100
94
|
};
|
|
101
95
|
//分组列表
|
|
102
|
-
|
|
96
|
+
const generateLiGroup = (opt, index) => {
|
|
103
97
|
return jsx("li", Object.assign({
|
|
104
98
|
className: 'split-li-group'
|
|
105
99
|
}, {
|
|
106
|
-
children: opt.map(
|
|
107
|
-
|
|
100
|
+
children: opt.map((gItem, gIndex) => {
|
|
101
|
+
const idx = "".concat(index, "-").concat(gIndex);
|
|
108
102
|
return jsx("div", Object.assign({
|
|
109
103
|
className: clsx('split-li',
|
|
110
104
|
// idx === selectedIndex && 'split-li--active',
|
|
@@ -112,9 +106,7 @@ function SplitButton(props) {
|
|
|
112
106
|
style: {
|
|
113
107
|
maxWidth: optionMaxWidth
|
|
114
108
|
},
|
|
115
|
-
onClick:
|
|
116
|
-
return handleButtonClick(gItem, idx, evt);
|
|
117
|
-
}
|
|
109
|
+
onClick: evt => handleButtonClick(gItem, idx, evt)
|
|
118
110
|
}, {
|
|
119
111
|
children: renderItem(gItem)
|
|
120
112
|
}), idx);
|
|
@@ -125,7 +117,7 @@ function SplitButton(props) {
|
|
|
125
117
|
className: "".concat($prefixCls, "-button-split-list")
|
|
126
118
|
}, {
|
|
127
119
|
children: jsx("ul", {
|
|
128
|
-
children: options.map(
|
|
120
|
+
children: options.map((opt, index) => {
|
|
129
121
|
if (Array.isArray(opt)) {
|
|
130
122
|
//分组
|
|
131
123
|
return generateLiGroup(opt, index);
|
|
@@ -137,9 +129,7 @@ function SplitButton(props) {
|
|
|
137
129
|
style: {
|
|
138
130
|
maxWidth: optionMaxWidth
|
|
139
131
|
},
|
|
140
|
-
onClick:
|
|
141
|
-
return handleButtonClick(opt, index, evt);
|
|
142
|
-
}
|
|
132
|
+
onClick: evt => handleButtonClick(opt, index, evt)
|
|
143
133
|
}, {
|
|
144
134
|
children: renderItem(opt)
|
|
145
135
|
}), index);
|
|
@@ -148,7 +138,7 @@ function SplitButton(props) {
|
|
|
148
138
|
}));
|
|
149
139
|
};
|
|
150
140
|
//渲染button
|
|
151
|
-
|
|
141
|
+
const renderButton = () => {
|
|
152
142
|
if (iconButton) {
|
|
153
143
|
if (variant) {
|
|
154
144
|
return jsx(Button.IconButton, Object.assign({
|
|
@@ -199,38 +189,31 @@ function SplitButton(props) {
|
|
|
199
189
|
}
|
|
200
190
|
|
|
201
191
|
//按钮
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
_props$danger = props.danger,
|
|
219
|
-
danger = _props$danger === void 0 ? false : _props$danger,
|
|
220
|
-
href = props.href,
|
|
221
|
-
target = props.target,
|
|
192
|
+
const InternalButton = props => {
|
|
193
|
+
const {
|
|
194
|
+
variant = 'contained',
|
|
195
|
+
size = 'large',
|
|
196
|
+
className,
|
|
197
|
+
disabled = false,
|
|
198
|
+
children,
|
|
199
|
+
startIcon,
|
|
200
|
+
endIcon,
|
|
201
|
+
loading = false,
|
|
202
|
+
toolTipTitle = '',
|
|
203
|
+
TooltipProps,
|
|
204
|
+
danger = false,
|
|
205
|
+
href,
|
|
206
|
+
target
|
|
207
|
+
} = props,
|
|
222
208
|
restProps = __rest(props, ["variant", "size", "className", "disabled", "children", "startIcon", "endIcon", "loading", "toolTipTitle", "TooltipProps", "danger", "href", "target"]);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
hasLoading = _useState2[0],
|
|
226
|
-
setHasLoading = _useState2[1];
|
|
227
|
-
var isLinkBtn = ('href' in props);
|
|
209
|
+
const [hasLoading, setHasLoading] = useState(false);
|
|
210
|
+
const isLinkBtn = ('href' in props);
|
|
228
211
|
//cls
|
|
229
|
-
|
|
212
|
+
const makeCls = () => {
|
|
230
213
|
return clsx("".concat($prefixCls, "-button"), className, "".concat($prefixCls, "-button-").concat(variant), "".concat($prefixCls, "-button-").concat(size), hasLoading && "".concat($prefixCls, "-button-loading"), danger && !disabled && "".concat($prefixCls, "-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
|
|
231
214
|
};
|
|
232
215
|
//渲染按钮图标
|
|
233
|
-
|
|
216
|
+
const renderBtnIcon = pos => {
|
|
234
217
|
if (!hasLoading) {
|
|
235
218
|
if (pos === 'start' && startIcon) return jsx("span", Object.assign({
|
|
236
219
|
className: 'button-icon'
|
|
@@ -244,11 +227,9 @@ var InternalButton = function InternalButton(props) {
|
|
|
244
227
|
}));
|
|
245
228
|
return null;
|
|
246
229
|
}
|
|
247
|
-
if (
|
|
248
|
-
|
|
249
|
-
setTimeout(
|
|
250
|
-
return setHasLoading(false);
|
|
251
|
-
}, delay);
|
|
230
|
+
if (typeof loading === 'object') {
|
|
231
|
+
const delay = loading.delay || 0;
|
|
232
|
+
setTimeout(() => setHasLoading(false), delay);
|
|
252
233
|
}
|
|
253
234
|
if (pos === 'start') return jsx("span", Object.assign({
|
|
254
235
|
className: 'button-icon button-icon-loading'
|
|
@@ -258,7 +239,7 @@ var InternalButton = function InternalButton(props) {
|
|
|
258
239
|
return null;
|
|
259
240
|
};
|
|
260
241
|
//按钮
|
|
261
|
-
|
|
242
|
+
const renderButton = () => {
|
|
262
243
|
if (isLinkBtn) {
|
|
263
244
|
return jsxs("a", Object.assign({}, restProps, {
|
|
264
245
|
href: href,
|
|
@@ -284,7 +265,7 @@ var InternalButton = function InternalButton(props) {
|
|
|
284
265
|
})), renderBtnIcon('end')]
|
|
285
266
|
}));
|
|
286
267
|
};
|
|
287
|
-
useEffect(
|
|
268
|
+
useEffect(() => {
|
|
288
269
|
setHasLoading(!!loading);
|
|
289
270
|
}, [loading]);
|
|
290
271
|
return disabled && toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
@@ -302,42 +283,33 @@ var InternalButton = function InternalButton(props) {
|
|
|
302
283
|
})) : renderButton();
|
|
303
284
|
};
|
|
304
285
|
//icon button
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
_props$danger2 = props.danger,
|
|
320
|
-
danger = _props$danger2 === void 0 ? false : _props$danger2,
|
|
321
|
-
href = props.href,
|
|
322
|
-
target = props.target,
|
|
286
|
+
const IconButton = props => {
|
|
287
|
+
const {
|
|
288
|
+
variant = 'contained',
|
|
289
|
+
size = 'large',
|
|
290
|
+
toolTipTitle = '',
|
|
291
|
+
children,
|
|
292
|
+
className,
|
|
293
|
+
disabled = false,
|
|
294
|
+
loading = false,
|
|
295
|
+
TooltipProps,
|
|
296
|
+
danger = false,
|
|
297
|
+
href,
|
|
298
|
+
target
|
|
299
|
+
} = props,
|
|
323
300
|
restProps = __rest(props, ["variant", "size", "toolTipTitle", "children", "className", "disabled", "loading", "TooltipProps", "danger", "href", "target"]);
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
hasLoading = _useState4[0],
|
|
327
|
-
setHasLoading = _useState4[1];
|
|
328
|
-
var isLinkBtn = ('href' in props);
|
|
301
|
+
const [hasLoading, setHasLoading] = useState(false);
|
|
302
|
+
const isLinkBtn = ('href' in props);
|
|
329
303
|
//cls
|
|
330
|
-
|
|
304
|
+
const makeCls = () => {
|
|
331
305
|
return clsx("".concat($prefixCls, "-button ").concat($prefixCls, "-icon-button"), className, "".concat($prefixCls, "-icon-button-").concat(variant), "".concat($prefixCls, "-icon-button-").concat(size), hasLoading && "".concat($prefixCls, "-icon-button-loading"), danger && !disabled && "".concat($prefixCls, "-icon-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
|
|
332
306
|
};
|
|
333
307
|
//渲染图标
|
|
334
|
-
|
|
308
|
+
const renderIcon = () => {
|
|
335
309
|
if (!hasLoading) return children;
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
setTimeout(
|
|
339
|
-
return setHasLoading(false);
|
|
340
|
-
}, delay);
|
|
310
|
+
if (typeof loading === 'object') {
|
|
311
|
+
const delay = loading.delay || 0;
|
|
312
|
+
setTimeout(() => setHasLoading(false), delay);
|
|
341
313
|
}
|
|
342
314
|
return jsx("span", Object.assign({
|
|
343
315
|
className: 'button-loading-icon'
|
|
@@ -346,7 +318,7 @@ var IconButton = function IconButton(props) {
|
|
|
346
318
|
}));
|
|
347
319
|
};
|
|
348
320
|
//icon button
|
|
349
|
-
|
|
321
|
+
const renderIconButton = () => {
|
|
350
322
|
if (isLinkBtn) {
|
|
351
323
|
return jsx("a", Object.assign({}, restProps, {
|
|
352
324
|
href: href,
|
|
@@ -364,7 +336,7 @@ var IconButton = function IconButton(props) {
|
|
|
364
336
|
children: renderIcon()
|
|
365
337
|
}));
|
|
366
338
|
};
|
|
367
|
-
useEffect(
|
|
339
|
+
useEffect(() => {
|
|
368
340
|
setHasLoading(!!loading);
|
|
369
341
|
}, [loading]);
|
|
370
342
|
return !!toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
@@ -381,7 +353,7 @@ var IconButton = function IconButton(props) {
|
|
|
381
353
|
})) : renderIconButton()
|
|
382
354
|
}), +hasLoading) : renderIconButton();
|
|
383
355
|
};
|
|
384
|
-
|
|
356
|
+
const Button = InternalButton;
|
|
385
357
|
Button.IconButton = IconButton;
|
|
386
358
|
Button.SplitButton = SplitButton;
|
|
387
359
|
|