@para-ui/core 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Breadcrumbs/index.d.ts +14 -0
- package/Breadcrumbs/index.js +210 -156
- package/Breadcrumbs/lang/en_US.d.ts +4 -0
- package/Breadcrumbs/lang/index.d.ts +9 -0
- package/Breadcrumbs/lang/zh_CN.d.ts +4 -0
- package/Button/index.js +9 -3
- package/ButtonGroup/index.js +1 -1
- package/Cascader/index.js +1 -1
- package/ComboSelect/index.js +16 -10
- package/DatePicker/generatePicker/index.d.ts +11 -2
- package/DatePicker/index.js +46 -34
- package/Desktop/index.js +1 -1
- package/Drawer/index.js +1 -1
- package/Empty/index.js +1 -1
- package/Form/index.js +3 -3
- package/FormItem/index.js +3 -3
- package/FunctionModal/index.js +3 -3
- package/Modal/index.js +1 -1
- package/OperateBtn/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +1 -1
- package/PopConfirm/index.js +1 -1
- package/Popover/index.js +2 -16
- package/Querying/index.js +1 -1
- package/README.md +8 -0
- package/Search/index.js +1 -1
- package/Select/index.js +1 -1
- package/SelectInput/index.js +1 -1
- package/Selector/index.js +2 -1
- package/Selector/lang/index.d.ts +2 -0
- package/SelectorPicker/index.js +2 -1
- package/Table/index.js +1 -1
- package/Tabs/index.js +1 -1
- package/TimePicker/index.js +1 -1
- package/ToggleButton/index.js +1 -1
- package/Tooltip/index.js +2 -3
- package/Transfer/index.d.ts +19 -4
- package/Transfer/index.js +118 -70
- package/Transfer/lang/index.d.ts +4 -0
- package/Tree/index.js +3 -3
- package/Upload/index.js +1 -1
- package/_verture/{index-3136f653.js → index-4b4ee8b5.js} +0 -0
- package/_verture/{index-77832168.js → index-e0508c99.js} +1 -1
- package/_verture/{modalContext-f1a611ab.js → modalContext-4bce2dae.js} +0 -0
- package/_verture/{useFormatMessage-ac9d6acf.js → useFormatMessage-f4452258.js} +6 -4
- package/index.js +6 -5
- package/package.json +1 -1
package/Breadcrumbs/index.d.ts
CHANGED
|
@@ -29,11 +29,25 @@ export interface BreadcrumbsProps {
|
|
|
29
29
|
popoverClassName?: string;
|
|
30
30
|
/** 是否收缩 */
|
|
31
31
|
isShrink?: boolean;
|
|
32
|
+
/** 最后最少显示数 */
|
|
33
|
+
minNum?: number;
|
|
34
|
+
/** 是否显示返回 */
|
|
35
|
+
isBack?: boolean;
|
|
36
|
+
/** 自定义返回内容 */
|
|
37
|
+
backRender?: ReactNode;
|
|
38
|
+
/** 弹窗方式 */
|
|
39
|
+
trigger?: 'hover' | 'click';
|
|
40
|
+
/** 弹窗方向 */
|
|
41
|
+
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
32
42
|
/**
|
|
33
43
|
* 点击菜单
|
|
34
44
|
* @param ops 当前点击菜单数据
|
|
35
45
|
*/
|
|
36
46
|
onClickItem?: (ops: listOptions) => void;
|
|
47
|
+
/**
|
|
48
|
+
* 点击返回
|
|
49
|
+
* */
|
|
50
|
+
onBack?: () => void;
|
|
37
51
|
}
|
|
38
52
|
export declare const Breadcrumbs: FunctionComponent<BreadcrumbsProps>;
|
|
39
53
|
export default Breadcrumbs;
|
package/Breadcrumbs/index.js
CHANGED
|
@@ -1,25 +1,40 @@
|
|
|
1
1
|
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.js';
|
|
2
2
|
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
3
|
-
import { jsx, Fragment
|
|
4
|
-
import { useState, useRef, useEffect, Fragment
|
|
3
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
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
|
-
import
|
|
8
|
+
import Return from '@para-ui/icons/Return';
|
|
9
9
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
10
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
10
11
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
11
12
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
12
13
|
import '../Tooltip/index.js';
|
|
13
14
|
import 'rc-tooltip';
|
|
14
15
|
import 'rc-tooltip/lib/placements';
|
|
15
16
|
import 'clsx';
|
|
17
|
+
import '@para-ui/core/GlobalContext';
|
|
16
18
|
|
|
17
|
-
var
|
|
19
|
+
var en = {
|
|
20
|
+
back: 'Back'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var zh = {
|
|
24
|
+
back: '返回'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var localeJson = {
|
|
28
|
+
zh: zh,
|
|
29
|
+
en: en
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n * @author linhd\n * @date 2021年10月25日 14:58:12\n * @description 面包屑\n */\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n/**\n* @author linhd\n* @date 2022/8/12 5:28 PM\n* @description 全局css前缀\n*/\n.paraui-v3-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-v3-breadcrumbs > .breadcrumbs-list {\n display: flex;\n align-items: center;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item {\n padding: 0 4px;\n border-radius: 2px;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item .breadcrumbs-item-content {\n white-space: nowrap;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item .breadcrumbs-item-content svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 14px;\n margin-right: 4px;\n vertical-align: -2px;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click .breadcrumbs-item-content {\n cursor: pointer;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover .breadcrumbs-item-content {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-click:hover .breadcrumbs-item-content svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-current .breadcrumbs-item-content {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-current .breadcrumbs-item-content svg {\n color: rgb(46, 55, 67);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled {\n cursor: not-allowed;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled .breadcrumbs-item-content {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item.breadcrumbs-item-disabled .breadcrumbs-item-content svg {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-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-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more svg {\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .breadcrumbs-item-more:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-list > .separator {\n color: rgba(171, 176, 185, 0.4);\n margin: 0 4px;\n position: relative;\n top: -1px;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back {\n display: flex;\n align-items: center;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .line {\n display: inline-block;\n width: 1px;\n height: 14px;\n background-color: rgba(171, 176, 185, 0.2);\n margin: 0 8px;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n height: 100%;\n color: rgba(46, 55, 67, 0.7);\n padding: 0 4px;\n border-radius: 2px;\n cursor: pointer;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content:hover {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 14px;\n margin-right: 4px;\n}\n.paraui-v3-breadcrumbs > .breadcrumbs-back > .breadcrumbs-back-content span {\n white-space: nowrap;\n}\n.paraui-v3-breadcrumbs.paraui-v3-breadcrumbs-calculation {\n overflow: hidden;\n opacity: 0;\n}\n\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content {\n padding: 8px 0;\n}\n.paraui-v3-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: 36px;\n line-height: 36px;\n padding: 0 12px;\n color: rgb(46, 55, 67);\n display: flex;\n align-items: center;\n}\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item svg {\n color: rgb(46, 55, 67);\n margin-right: 4px;\n}\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-click {\n cursor: pointer;\n}\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-click:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-disabled {\n cursor: not-allowed;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-breadcrumbs-popover .breadcrumbs-popover-content .breadcrumbs-popover-content-item.breadcrumbs-popover-content-item-disabled svg {\n color: rgba(46, 55, 67, 0.4);\n}";
|
|
18
33
|
styleInject(css_248z);
|
|
19
34
|
|
|
20
35
|
var Breadcrumbs = function Breadcrumbs(props) {
|
|
21
36
|
var _props$maxWidth = props.maxWidth,
|
|
22
|
-
maxWidth = _props$maxWidth === void 0 ? '' : _props$maxWidth,
|
|
37
|
+
maxWidth = _props$maxWidth === void 0 ? '160px' : _props$maxWidth,
|
|
23
38
|
className = props.className,
|
|
24
39
|
list = props.list,
|
|
25
40
|
_props$separator = props.separator,
|
|
@@ -27,89 +42,153 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
27
42
|
popoverClassName = props.popoverClassName,
|
|
28
43
|
_props$isShrink = props.isShrink,
|
|
29
44
|
isShrink = _props$isShrink === void 0 ? true : _props$isShrink,
|
|
45
|
+
_props$isBack = props.isBack,
|
|
46
|
+
isBack = _props$isBack === void 0 ? false : _props$isBack,
|
|
47
|
+
_props$minNum = props.minNum,
|
|
48
|
+
minNum = _props$minNum === void 0 ? 2 : _props$minNum,
|
|
49
|
+
_props$trigger = props.trigger,
|
|
50
|
+
trigger = _props$trigger === void 0 ? 'hover' : _props$trigger,
|
|
51
|
+
_props$placement = props.placement,
|
|
52
|
+
placement = _props$placement === void 0 ? 'bottomLeft' : _props$placement,
|
|
53
|
+
backRender = props.backRender,
|
|
30
54
|
onClickItem = props.onClickItem,
|
|
55
|
+
onBack = props.onBack,
|
|
31
56
|
style = props.style;
|
|
57
|
+
var intl = useFormatMessage('Breadcrumbs', localeJson);
|
|
58
|
+
|
|
59
|
+
var _useState = useState(false),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
showMore = _useState2[0],
|
|
62
|
+
setShowMore = _useState2[1]; // 是否显示更多按钮
|
|
32
63
|
|
|
33
|
-
var _useState = useState($prefixCls + '-breadcrumbs-' + UUID()),
|
|
34
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
35
|
-
classStr = _useState2[0];
|
|
36
64
|
|
|
37
65
|
var _useState3 = useState([]),
|
|
38
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _useState5 = useState(0),
|
|
43
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
-
oneNum = _useState6[0],
|
|
45
|
-
setOneNum = _useState6[1];
|
|
46
|
-
|
|
47
|
-
var _useState7 = useState(false),
|
|
48
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
|
-
open = _useState8[0],
|
|
50
|
-
setOpen = _useState8[1];
|
|
67
|
+
hideArr = _useState4[0],
|
|
68
|
+
setHideArr = _useState4[1]; // 是否隐藏面包屑
|
|
51
69
|
|
|
52
|
-
var _useState9 = useState({}),
|
|
53
|
-
_useState10 = _slicedToArray(_useState9, 1),
|
|
54
|
-
constData = _useState10[0];
|
|
55
70
|
|
|
56
|
-
var
|
|
71
|
+
var boxRef = useRef();
|
|
72
|
+
var constData = useRef({
|
|
73
|
+
minNum: minNum,
|
|
74
|
+
isBack: isBack,
|
|
75
|
+
isShrink: isShrink,
|
|
76
|
+
timer: null,
|
|
77
|
+
showMore: false,
|
|
78
|
+
hideArr: [],
|
|
79
|
+
hidePos: 0
|
|
80
|
+
});
|
|
81
|
+
constData.current.isBack = isBack;
|
|
82
|
+
constData.current.showMore = showMore;
|
|
83
|
+
constData.current.isShrink = isShrink;
|
|
84
|
+
constData.current.minNum = minNum;
|
|
57
85
|
useEffect(function () {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [
|
|
86
|
+
window.addEventListener("resize", winResize);
|
|
87
|
+
return function () {
|
|
88
|
+
clearTimeout(constData.current.timer);
|
|
89
|
+
window.removeEventListener("resize", winResize);
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
64
92
|
useEffect(function () {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
93
|
+
var arr = new Array(props.list.length).fill(false);
|
|
94
|
+
constData.current.hideArr = arr;
|
|
95
|
+
setHideArr(arr);
|
|
96
|
+
changeSize();
|
|
97
|
+
}, [list]);
|
|
98
|
+
/** 点击面包屑 */
|
|
71
99
|
|
|
100
|
+
var clickItem = function clickItem(item, index) {
|
|
72
101
|
return function () {
|
|
73
|
-
|
|
102
|
+
if (props.list.length - 1 === index || item.disabled) return;
|
|
103
|
+
onClickItem && onClickItem(item);
|
|
74
104
|
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
105
|
+
};
|
|
106
|
+
/** 点击返回, 又返回执行返回事件,否则默认返回上级 */
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
var clickBack = function clickBack() {
|
|
110
|
+
if (onBack) return onBack();
|
|
111
|
+
if (props.list.length < 2) return;
|
|
112
|
+
var item = props.list[props.list.length - 2];
|
|
113
|
+
clickItem(item, props.list.length - 2)();
|
|
114
|
+
};
|
|
115
|
+
/** 改变屏幕 */
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
var winResize = function winResize() {
|
|
119
|
+
changeSize();
|
|
120
|
+
};
|
|
121
|
+
/** 去除遮罩 */
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
var hideMask = function hideMask() {
|
|
125
|
+
boxRef.current.classList.remove($prefixCls + '-breadcrumbs-calculation');
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var changeSize = function changeSize(bol) {
|
|
129
|
+
if (!constData.current.isShrink) return hideMask(); // 不自动计算
|
|
130
|
+
|
|
131
|
+
clearTimeout(constData.current.timer); // 恢复初始状态
|
|
132
|
+
|
|
133
|
+
if (!bol) {
|
|
134
|
+
constData.current.hidePos = 0;
|
|
135
|
+
constData.current.showMore = false;
|
|
136
|
+
var arr = new Array(props.list.length).fill(false);
|
|
137
|
+
constData.current.hideArr = arr;
|
|
138
|
+
setHideArr(arr);
|
|
139
|
+
setShowMore(false);
|
|
99
140
|
}
|
|
100
|
-
}; // 点击菜单
|
|
101
141
|
|
|
142
|
+
console.log(props.list, props.list.length);
|
|
143
|
+
if (props.list.length <= constData.current.minNum + 1) return hideMask(); // 面包屑数组长度必须大于最少显示数
|
|
102
144
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
145
|
+
if (constData.current.hidePos === props.list.length - constData.current.minNum - 1) return hideMask(); // 隐藏到最小显示数,停止
|
|
146
|
+
|
|
147
|
+
boxRef.current.classList.add($prefixCls + '-breadcrumbs-calculation');
|
|
148
|
+
constData.current.timer = setTimeout(function () {
|
|
149
|
+
var boxWidth = boxRef.current.clientWidth;
|
|
150
|
+
var listWidth = boxRef.current.querySelector('.breadcrumbs-list').clientWidth;
|
|
151
|
+
var backWidth = constData.current.isBack ? boxRef.current.querySelector('.breadcrumbs-back').clientWidth : 0;
|
|
106
152
|
|
|
107
|
-
if (
|
|
108
|
-
|
|
153
|
+
if (boxWidth > listWidth + backWidth) {
|
|
154
|
+
// 没有超出
|
|
155
|
+
hideMask();
|
|
109
156
|
} else {
|
|
110
|
-
|
|
157
|
+
constData.current.hidePos += 1;
|
|
158
|
+
constData.current.hideArr[constData.current.hidePos] = true;
|
|
159
|
+
setHideArr(_toConsumableArray(constData.current.hideArr));
|
|
160
|
+
setShowMore(true);
|
|
161
|
+
changeSize(true);
|
|
162
|
+
/*// 超出
|
|
163
|
+
if (constData.current.showMore) {
|
|
164
|
+
// 超出情况下,在超出,继续减一个面包屑
|
|
165
|
+
} else {
|
|
166
|
+
// 没有超出-> 变超出
|
|
167
|
+
}*/
|
|
111
168
|
}
|
|
112
|
-
};
|
|
169
|
+
}, 50);
|
|
170
|
+
};
|
|
171
|
+
/** 处理弹窗内容 */
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
var handContent = function handContent() {
|
|
175
|
+
return jsx("div", Object.assign({
|
|
176
|
+
className: "breadcrumbs-popover-content"
|
|
177
|
+
}, {
|
|
178
|
+
children: list.map(function (item, index) {
|
|
179
|
+
if (!hideArr[index]) return null;
|
|
180
|
+
var str = 'breadcrumbs-popover-content-item';
|
|
181
|
+
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-popover-content-item-click';
|
|
182
|
+
if (index === list.length - 1) str += ' breadcrumbs-popover-content-item-current';
|
|
183
|
+
if (item.disabled) str += ' breadcrumbs-popover-content-item-disabled';
|
|
184
|
+
return jsx("div", Object.assign({
|
|
185
|
+
className: str,
|
|
186
|
+
onClick: clickItem(item, index)
|
|
187
|
+
}, {
|
|
188
|
+
children: item.label
|
|
189
|
+
}), index);
|
|
190
|
+
})
|
|
191
|
+
}));
|
|
113
192
|
}; // 处理弹出框className
|
|
114
193
|
|
|
115
194
|
|
|
@@ -117,114 +196,89 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
117
196
|
var str = $prefixCls + '-breadcrumbs-popover';
|
|
118
197
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
119
198
|
return str;
|
|
120
|
-
}; // 关闭弹出菜单
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var handleClose = function handleClose(bol) {
|
|
124
|
-
if (!bol) setOpen(false);
|
|
125
199
|
}; // 处理className
|
|
126
200
|
|
|
127
201
|
|
|
128
202
|
var handClass = function handClass() {
|
|
129
|
-
var str = $prefixCls + '-breadcrumbs
|
|
203
|
+
var str = $prefixCls + '-breadcrumbs';
|
|
130
204
|
if (isShrink) str += " ".concat($prefixCls, "-breadcrumbs-shrink");
|
|
131
205
|
if (className) str += ' ' + className;
|
|
132
206
|
return str;
|
|
133
207
|
};
|
|
134
208
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var popoverContent = function popoverContent() {
|
|
143
|
-
return jsx("div", Object.assign({
|
|
144
|
-
className: handClass()
|
|
209
|
+
return jsxs("div", Object.assign({
|
|
210
|
+
className: handClass(),
|
|
211
|
+
style: style,
|
|
212
|
+
ref: boxRef
|
|
213
|
+
}, {
|
|
214
|
+
children: [jsx("ul", Object.assign({
|
|
215
|
+
className: "breadcrumbs-list"
|
|
145
216
|
}, {
|
|
146
217
|
children: list.map(function (item, index) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
218
|
+
if (hideArr[index]) return;
|
|
219
|
+
var str = 'breadcrumbs-item';
|
|
220
|
+
if (index === list.length - 1) str += ' breadcrumbs-item-current';
|
|
221
|
+
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-item-click';
|
|
222
|
+
if (item.disabled) str += ' breadcrumbs-item-disabled';
|
|
223
|
+
return jsxs(Fragment, {
|
|
224
|
+
children: [jsx("li", Object.assign({
|
|
225
|
+
className: str,
|
|
226
|
+
style: {
|
|
227
|
+
maxWidth: item.maxWidth || maxWidth
|
|
228
|
+
},
|
|
229
|
+
onClick: clickItem(item, index)
|
|
152
230
|
}, {
|
|
153
|
-
children:
|
|
154
|
-
|
|
155
|
-
|
|
231
|
+
children: jsx(AutoTips, {
|
|
232
|
+
children: jsx("span", Object.assign({
|
|
233
|
+
className: 'breadcrumbs-item-content'
|
|
234
|
+
}, {
|
|
235
|
+
children: item.label
|
|
236
|
+
}))
|
|
237
|
+
})
|
|
238
|
+
})), index !== list.length - 1 && jsx("li", Object.assign({
|
|
239
|
+
className: 'separator'
|
|
156
240
|
}, {
|
|
157
241
|
children: separator
|
|
158
|
-
}))
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var obj = {};
|
|
166
|
-
if (maxWidth) obj.maxWidth = maxWidth;
|
|
167
|
-
if (item.maxWidth) obj.maxWidth = item.maxWidth;
|
|
168
|
-
return obj;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
var handContent = function handContent() {
|
|
172
|
-
return jsx("div", Object.assign({
|
|
173
|
-
className: handClass(),
|
|
174
|
-
style: style,
|
|
175
|
-
ref: ref
|
|
176
|
-
}, {
|
|
177
|
-
children: listCom.map(function (item, index) {
|
|
178
|
-
var showSeparator = listCom.length - 1 !== index;
|
|
179
|
-
|
|
180
|
-
if (item.more === 'more-breadcrumbs') {
|
|
181
|
-
// 更多
|
|
182
|
-
return jsxs(Fragment$1, {
|
|
183
|
-
children: [jsx("div", Object.assign({
|
|
184
|
-
onClick: handleClick(item),
|
|
185
|
-
className: "more-breadcrumbs"
|
|
242
|
+
})), showMore && index === 0 && jsxs(Fragment$1, {
|
|
243
|
+
children: [jsx(Popover, Object.assign({
|
|
244
|
+
content: handContent(),
|
|
245
|
+
overlayClassName: popoverHandClass(),
|
|
246
|
+
trigger: trigger,
|
|
247
|
+
placement: placement,
|
|
248
|
+
destroyTooltipOnHide: true
|
|
186
249
|
}, {
|
|
187
|
-
children: jsx(
|
|
188
|
-
|
|
189
|
-
|
|
250
|
+
children: jsx("li", Object.assign({
|
|
251
|
+
className: 'breadcrumbs-item-more'
|
|
252
|
+
}, {
|
|
253
|
+
children: jsx(More, {})
|
|
254
|
+
}))
|
|
255
|
+
})), !hideArr[list.length - 1] && jsx("li", Object.assign({
|
|
256
|
+
className: 'separator'
|
|
190
257
|
}, {
|
|
191
258
|
children: separator
|
|
192
259
|
}))]
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return jsxs(Fragment$1, {
|
|
197
|
-
children: [jsx("div", Object.assign({
|
|
198
|
-
style: handStyle(item),
|
|
199
|
-
onClick: handleClick(item),
|
|
200
|
-
className: handClassItem(item, index, listCom)
|
|
201
|
-
}, {
|
|
202
|
-
children: jsx(AutoTips, Object.assign({
|
|
203
|
-
className: 'breadcrumbs-auto-tips'
|
|
204
|
-
}, {
|
|
205
|
-
children: item.label
|
|
206
|
-
}))
|
|
207
|
-
})), showSeparator && jsx("div", Object.assign({
|
|
208
|
-
className: "breadcrumbs-separator"
|
|
209
|
-
}, {
|
|
210
|
-
children: separator
|
|
211
|
-
}))]
|
|
260
|
+
})]
|
|
212
261
|
}, index);
|
|
213
262
|
})
|
|
214
|
-
}))
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return jsx(Fragment, {
|
|
218
|
-
children: isShrink ? jsx(Popover, Object.assign({
|
|
219
|
-
placement: 'bottom-start',
|
|
220
|
-
visible: open,
|
|
221
|
-
content: popoverContent(),
|
|
222
|
-
onVisibleChange: handleClose,
|
|
223
|
-
overlayClassName: popoverHandClass()
|
|
263
|
+
})), isBack && jsxs("div", Object.assign({
|
|
264
|
+
className: 'breadcrumbs-back'
|
|
224
265
|
}, {
|
|
225
|
-
children:
|
|
226
|
-
|
|
227
|
-
|
|
266
|
+
children: [jsx("span", {
|
|
267
|
+
className: 'line'
|
|
268
|
+
}), jsx("div", Object.assign({
|
|
269
|
+
className: 'breadcrumbs-back-content',
|
|
270
|
+
onClick: clickBack
|
|
271
|
+
}, {
|
|
272
|
+
children: backRender ? backRender : jsxs(Fragment$1, {
|
|
273
|
+
children: [jsx(Return, {}), jsx("span", {
|
|
274
|
+
children: intl({
|
|
275
|
+
id: 'back'
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
})
|
|
279
|
+
}))]
|
|
280
|
+
}))]
|
|
281
|
+
}));
|
|
228
282
|
};
|
|
229
283
|
|
|
230
284
|
export { Breadcrumbs, Breadcrumbs as default };
|
package/Button/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import Down from '@para-ui/icons/Down';
|
|
|
11
11
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
13
|
import { Dropdown } from '../Dropdown/index.js';
|
|
14
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
14
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
15
15
|
import 'rc-tooltip';
|
|
16
16
|
import 'rc-tooltip/lib/placements';
|
|
17
17
|
import 'rc-dropdown';
|
|
@@ -267,7 +267,10 @@ var InternalButton = function InternalButton(props) {
|
|
|
267
267
|
useEffect(function () {
|
|
268
268
|
setHasLoading(!!loading);
|
|
269
269
|
}, [loading]);
|
|
270
|
-
return disabled && toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
270
|
+
return disabled && toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
271
|
+
arrow: false,
|
|
272
|
+
placement: 'bottom'
|
|
273
|
+
}, TooltipProps, {
|
|
271
274
|
title: generateTooltipTitle()
|
|
272
275
|
}, {
|
|
273
276
|
children: jsx("span", Object.assign({
|
|
@@ -370,7 +373,10 @@ var IconButton = function IconButton(props) {
|
|
|
370
373
|
useEffect(function () {
|
|
371
374
|
setHasLoading(!!loading);
|
|
372
375
|
}, [loading]);
|
|
373
|
-
return !!toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
376
|
+
return !!toolTipTitle ? jsx(Tooltip, Object.assign({
|
|
377
|
+
arrow: false,
|
|
378
|
+
placement: 'bottom'
|
|
379
|
+
}, TooltipProps, {
|
|
374
380
|
title: generateTooltipTitle()
|
|
375
381
|
}, {
|
|
376
382
|
children: disabled ? jsx("span", Object.assign({
|
package/ButtonGroup/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import '@para-ui/icons/LoadingF';
|
|
|
13
13
|
import '@para-ui/icons/Down';
|
|
14
14
|
import '../Dropdown/index.js';
|
|
15
15
|
import 'rc-dropdown';
|
|
16
|
-
import '../_verture/useFormatMessage-
|
|
16
|
+
import '../_verture/useFormatMessage-f4452258.js';
|
|
17
17
|
import '@para-ui/core/GlobalContext';
|
|
18
18
|
import 'rc-tooltip';
|
|
19
19
|
import 'rc-tooltip/lib/placements';
|
package/Cascader/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useState, useCallback } from 'react';
|
|
|
7
7
|
import RcCascader from 'rc-cascader';
|
|
8
8
|
import Right from '@para-ui/icons/Right';
|
|
9
9
|
import LoadingIcon from '@para-ui/icons/Loading';
|
|
10
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
10
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
11
11
|
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
13
|
import '@para-ui/core/GlobalContext';
|
package/ComboSelect/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import SearchIcon from '@para-ui/icons/Search';
|
|
|
8
8
|
import CloseIcon from '@para-ui/icons/Close';
|
|
9
9
|
import CloseCircle from '@para-ui/icons/CloseCircle';
|
|
10
10
|
import Table from '../Table/index.js';
|
|
11
|
-
import { T as Tree } from '../_verture/index-
|
|
11
|
+
import { T as Tree } from '../_verture/index-e0508c99.js';
|
|
12
12
|
import { Button } from '../Button/index.js';
|
|
13
13
|
import { Dropdown } from '../Dropdown/index.js';
|
|
14
14
|
import { Popover } from '../Popover/index.js';
|
|
@@ -17,7 +17,7 @@ import { Tooltip } from '../Tooltip/index.js';
|
|
|
17
17
|
import clsx from 'clsx';
|
|
18
18
|
import { DeepClone, ArrayToObject } from '@paraview/lib';
|
|
19
19
|
import GlobalContext from '@para-ui/core/GlobalContext';
|
|
20
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
20
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-f4452258.js';
|
|
21
21
|
import Label from '../Label/index.js';
|
|
22
22
|
import HelperText from '../HelperText/index.js';
|
|
23
23
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
@@ -538,18 +538,24 @@ var ComboSelect = function ComboSelect(props) {
|
|
|
538
538
|
|
|
539
539
|
|
|
540
540
|
var renderSearch = function renderSearch() {
|
|
541
|
-
var
|
|
542
|
-
width = _setPopoverWH.width,
|
|
543
|
-
minWidth = _setPopoverWH.minWidth,
|
|
544
|
-
maxWidth = _setPopoverWH.maxWidth;
|
|
541
|
+
var styObj = {};
|
|
545
542
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
543
|
+
if (!disablePopup) {
|
|
544
|
+
var _setPopoverWH = setPopoverWH(),
|
|
545
|
+
width = _setPopoverWH.width,
|
|
546
|
+
minWidth = _setPopoverWH.minWidth,
|
|
547
|
+
maxWidth = _setPopoverWH.maxWidth;
|
|
548
|
+
|
|
549
|
+
styObj = {
|
|
549
550
|
width: width,
|
|
550
551
|
minWidth: minWidth,
|
|
551
552
|
maxWidth: maxWidth
|
|
552
|
-
}
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return jsxs("div", Object.assign({
|
|
557
|
+
className: 'comboselect-search',
|
|
558
|
+
style: styObj
|
|
553
559
|
}, {
|
|
554
560
|
children: [jsx("span", Object.assign({
|
|
555
561
|
className: 'comboselect-search-icon',
|
|
@@ -7,6 +7,10 @@ import PickerButton from '../PickerButton';
|
|
|
7
7
|
import PickerTag from '../PickerTag';
|
|
8
8
|
import { Dayjs } from 'dayjs';
|
|
9
9
|
import { LabelTooltipProps } from "../../Label";
|
|
10
|
+
export declare type ShortcutType = {
|
|
11
|
+
text: string;
|
|
12
|
+
value: Dayjs[] | (() => Dayjs[]);
|
|
13
|
+
};
|
|
10
14
|
declare type SizeType = 'small' | 'medium' | 'large' | undefined;
|
|
11
15
|
export interface TimePickerLocale {
|
|
12
16
|
placeholder?: string;
|
|
@@ -29,7 +33,7 @@ declare type InjectDefaultProps<Props, Type> = Omit<Props, 'locale' | 'generateC
|
|
|
29
33
|
/** 显示错误 */
|
|
30
34
|
error?: boolean;
|
|
31
35
|
/** 帮助文本 */
|
|
32
|
-
helperText?:
|
|
36
|
+
helperText?: ReactNode;
|
|
33
37
|
/** value */
|
|
34
38
|
value?: Type extends 'range' ? RangeValue<Dayjs> : NullableDateType<Dayjs>;
|
|
35
39
|
/** 默认值 */
|
|
@@ -72,7 +76,12 @@ export declare type PickerProps<DateType> = PickerBaseProps<DateType> | PickerDa
|
|
|
72
76
|
export declare type RangePickerBaseProps<DateType> = InjectDefaultProps<RCRangePickerBaseProps<DateType>, 'range'>;
|
|
73
77
|
export declare type RangePickerDateProps<DateType> = InjectDefaultProps<RCRangePickerDateProps<DateType>, 'range'>;
|
|
74
78
|
export declare type RangePickerTimeProps<DateType> = InjectDefaultProps<RCRangePickerTimeProps<DateType>, 'range'>;
|
|
75
|
-
export declare type RangePickerProps<DateType> = RangePickerBaseProps<DateType> | RangePickerDateProps<DateType> | RangePickerTimeProps<DateType
|
|
79
|
+
export declare type RangePickerProps<DateType> = (RangePickerBaseProps<DateType> | RangePickerDateProps<DateType> | RangePickerTimeProps<DateType>) & {
|
|
80
|
+
/** 预设时间范围快捷选择 */
|
|
81
|
+
shortcuts?: ShortcutType[];
|
|
82
|
+
/** 预设范围选择面板位置 */
|
|
83
|
+
shortcutsPlacement?: 'left' | 'right' | 'bottom';
|
|
84
|
+
};
|
|
76
85
|
declare function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>): React.ComponentClass<PickerProps<DateType>, any> & {
|
|
77
86
|
WeekPicker: React.ComponentClass<Omit<PickerDateProps<DateType>, "picker">, any>;
|
|
78
87
|
MonthPicker: React.ComponentClass<Omit<PickerDateProps<DateType>, "picker">, any>;
|