@para-ui/core 3.0.3 → 3.0.6
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 +209 -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/CollapseBox/index.js +1 -18
- package/CollapseLayout/index.d.ts +51 -0
- package/CollapseLayout/index.js +190 -0
- 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/Menu/index.js +1 -0
- package/Modal/index.js +1 -1
- package/OperateBtn/index.js +1 -1
- package/PageHeader/index.js +1 -1
- package/Pagination/index.js +5 -5
- package/PopConfirm/index.js +1 -1
- package/Popover/index.js +2 -16
- package/Querying/index.js +1 -1
- package/README.md +19 -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/TextEditor/common.d.ts +11 -0
- package/TextEditor/index.d.ts +106 -0
- package/TextEditor/index.js +20153 -0
- package/TextField/index.js +1 -1
- package/TimePicker/index.js +1 -1
- package/Title/index.js +6 -6
- 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-7b63f88e.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/_verture/util-a77b261e.js +19 -0
- package/index.d.ts +4 -0
- package/index.js +11 -7
- package/package.json +3 -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,152 @@ 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
|
+
if (props.list.length <= constData.current.minNum + 1) return hideMask(); // 面包屑数组长度必须大于最少显示数
|
|
102
143
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
144
|
+
if (constData.current.hidePos === props.list.length - constData.current.minNum - 1) return hideMask(); // 隐藏到最小显示数,停止
|
|
145
|
+
|
|
146
|
+
boxRef.current.classList.add($prefixCls + '-breadcrumbs-calculation');
|
|
147
|
+
constData.current.timer = setTimeout(function () {
|
|
148
|
+
var boxWidth = boxRef.current.clientWidth;
|
|
149
|
+
var listWidth = boxRef.current.querySelector('.breadcrumbs-list').clientWidth;
|
|
150
|
+
var backWidth = constData.current.isBack ? boxRef.current.querySelector('.breadcrumbs-back').clientWidth : 0;
|
|
106
151
|
|
|
107
|
-
if (
|
|
108
|
-
|
|
152
|
+
if (boxWidth > listWidth + backWidth) {
|
|
153
|
+
// 没有超出
|
|
154
|
+
hideMask();
|
|
109
155
|
} else {
|
|
110
|
-
|
|
156
|
+
constData.current.hidePos += 1;
|
|
157
|
+
constData.current.hideArr[constData.current.hidePos] = true;
|
|
158
|
+
setHideArr(_toConsumableArray(constData.current.hideArr));
|
|
159
|
+
setShowMore(true);
|
|
160
|
+
changeSize(true);
|
|
161
|
+
/*// 超出
|
|
162
|
+
if (constData.current.showMore) {
|
|
163
|
+
// 超出情况下,在超出,继续减一个面包屑
|
|
164
|
+
} else {
|
|
165
|
+
// 没有超出-> 变超出
|
|
166
|
+
}*/
|
|
111
167
|
}
|
|
112
|
-
};
|
|
168
|
+
}, 50);
|
|
169
|
+
};
|
|
170
|
+
/** 处理弹窗内容 */
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
var handContent = function handContent() {
|
|
174
|
+
return jsx("div", Object.assign({
|
|
175
|
+
className: "breadcrumbs-popover-content"
|
|
176
|
+
}, {
|
|
177
|
+
children: list.map(function (item, index) {
|
|
178
|
+
if (!hideArr[index]) return null;
|
|
179
|
+
var str = 'breadcrumbs-popover-content-item';
|
|
180
|
+
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-popover-content-item-click';
|
|
181
|
+
if (index === list.length - 1) str += ' breadcrumbs-popover-content-item-current';
|
|
182
|
+
if (item.disabled) str += ' breadcrumbs-popover-content-item-disabled';
|
|
183
|
+
return jsx("div", Object.assign({
|
|
184
|
+
className: str,
|
|
185
|
+
onClick: clickItem(item, index)
|
|
186
|
+
}, {
|
|
187
|
+
children: item.label
|
|
188
|
+
}), index);
|
|
189
|
+
})
|
|
190
|
+
}));
|
|
113
191
|
}; // 处理弹出框className
|
|
114
192
|
|
|
115
193
|
|
|
@@ -117,114 +195,89 @@ var Breadcrumbs = function Breadcrumbs(props) {
|
|
|
117
195
|
var str = $prefixCls + '-breadcrumbs-popover';
|
|
118
196
|
if (popoverClassName) str += ' ' + popoverClassName;
|
|
119
197
|
return str;
|
|
120
|
-
}; // 关闭弹出菜单
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
var handleClose = function handleClose(bol) {
|
|
124
|
-
if (!bol) setOpen(false);
|
|
125
198
|
}; // 处理className
|
|
126
199
|
|
|
127
200
|
|
|
128
201
|
var handClass = function handClass() {
|
|
129
|
-
var str = $prefixCls + '-breadcrumbs
|
|
202
|
+
var str = $prefixCls + '-breadcrumbs';
|
|
130
203
|
if (isShrink) str += " ".concat($prefixCls, "-breadcrumbs-shrink");
|
|
131
204
|
if (className) str += ' ' + className;
|
|
132
205
|
return str;
|
|
133
206
|
};
|
|
134
207
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var popoverContent = function popoverContent() {
|
|
143
|
-
return jsx("div", Object.assign({
|
|
144
|
-
className: handClass()
|
|
208
|
+
return jsxs("div", Object.assign({
|
|
209
|
+
className: handClass(),
|
|
210
|
+
style: style,
|
|
211
|
+
ref: boxRef
|
|
212
|
+
}, {
|
|
213
|
+
children: [jsx("ul", Object.assign({
|
|
214
|
+
className: "breadcrumbs-list"
|
|
145
215
|
}, {
|
|
146
216
|
children: list.map(function (item, index) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
217
|
+
if (hideArr[index]) return;
|
|
218
|
+
var str = 'breadcrumbs-item';
|
|
219
|
+
if (index === list.length - 1) str += ' breadcrumbs-item-current';
|
|
220
|
+
if (index !== list.length - 1 && !item.disabled) str += ' breadcrumbs-item-click';
|
|
221
|
+
if (item.disabled) str += ' breadcrumbs-item-disabled';
|
|
222
|
+
return jsxs(Fragment, {
|
|
223
|
+
children: [jsx("li", Object.assign({
|
|
224
|
+
className: str,
|
|
225
|
+
style: {
|
|
226
|
+
maxWidth: item.maxWidth || maxWidth
|
|
227
|
+
},
|
|
228
|
+
onClick: clickItem(item, index)
|
|
152
229
|
}, {
|
|
153
|
-
children:
|
|
154
|
-
|
|
155
|
-
|
|
230
|
+
children: jsx(AutoTips, {
|
|
231
|
+
children: jsx("span", Object.assign({
|
|
232
|
+
className: 'breadcrumbs-item-content'
|
|
233
|
+
}, {
|
|
234
|
+
children: item.label
|
|
235
|
+
}))
|
|
236
|
+
})
|
|
237
|
+
})), index !== list.length - 1 && jsx("li", Object.assign({
|
|
238
|
+
className: 'separator'
|
|
156
239
|
}, {
|
|
157
240
|
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"
|
|
241
|
+
})), showMore && index === 0 && jsxs(Fragment$1, {
|
|
242
|
+
children: [jsx(Popover, Object.assign({
|
|
243
|
+
content: handContent(),
|
|
244
|
+
overlayClassName: popoverHandClass(),
|
|
245
|
+
trigger: trigger,
|
|
246
|
+
placement: placement,
|
|
247
|
+
destroyTooltipOnHide: true
|
|
186
248
|
}, {
|
|
187
|
-
children: jsx(
|
|
188
|
-
|
|
189
|
-
|
|
249
|
+
children: jsx("li", Object.assign({
|
|
250
|
+
className: 'breadcrumbs-item-more'
|
|
251
|
+
}, {
|
|
252
|
+
children: jsx(More, {})
|
|
253
|
+
}))
|
|
254
|
+
})), !hideArr[list.length - 1] && jsx("li", Object.assign({
|
|
255
|
+
className: 'separator'
|
|
190
256
|
}, {
|
|
191
257
|
children: separator
|
|
192
258
|
}))]
|
|
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
|
-
}))]
|
|
259
|
+
})]
|
|
212
260
|
}, index);
|
|
213
261
|
})
|
|
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()
|
|
262
|
+
})), isBack && jsxs("div", Object.assign({
|
|
263
|
+
className: 'breadcrumbs-back'
|
|
224
264
|
}, {
|
|
225
|
-
children:
|
|
226
|
-
|
|
227
|
-
|
|
265
|
+
children: [jsx("span", {
|
|
266
|
+
className: 'line'
|
|
267
|
+
}), jsx("div", Object.assign({
|
|
268
|
+
className: 'breadcrumbs-back-content',
|
|
269
|
+
onClick: clickBack
|
|
270
|
+
}, {
|
|
271
|
+
children: backRender ? backRender : jsxs(Fragment$1, {
|
|
272
|
+
children: [jsx(Return, {}), jsx("span", {
|
|
273
|
+
children: intl({
|
|
274
|
+
id: 'back'
|
|
275
|
+
})
|
|
276
|
+
})]
|
|
277
|
+
})
|
|
278
|
+
}))]
|
|
279
|
+
}))]
|
|
280
|
+
}));
|
|
228
281
|
};
|
|
229
282
|
|
|
230
283
|
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/CollapseBox/index.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useEffect } from 'react';
|
|
3
3
|
import { Transition } from 'react-transition-group';
|
|
4
|
+
import { g as getTransitionProps, a as getAutoHeightDuration } from '../_verture/util-a77b261e.js';
|
|
4
5
|
import { $ as $prefixCls } from '../_verture/constant-bf34e6fa.js';
|
|
5
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
6
7
|
|
|
7
|
-
function getTransitionProps(props, options) {
|
|
8
|
-
var timeout = props.timeout,
|
|
9
|
-
_props$style = props.style,
|
|
10
|
-
style = _props$style === void 0 ? {} : _props$style;
|
|
11
|
-
return {
|
|
12
|
-
duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
|
|
13
|
-
delay: style.transitionDelay
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function getAutoHeightDuration(height) {
|
|
17
|
-
if (!height) {
|
|
18
|
-
return 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var constant = height / 36;
|
|
22
|
-
return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
8
|
var css_248z = "@charset \"UTF-8\";\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-collapse-box {\n transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n width: 100%;\n overflow: hidden;\n height: 0;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper {\n display: flex;\n width: 100%;\n}\n.paraui-v3-collapse-box > .collapse-box-wrapper > .collapse-box-wrapper-inner {\n width: 100%;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-entered {\n overflow: visible;\n}\n.paraui-v3-collapse-box.paraui-v3-collapse-box-hidden {\n visibility: hidden;\n}";
|
|
26
9
|
styleInject(css_248z);
|
|
27
10
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface CollapseLayoutProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/**
|
|
7
|
+
* 收起出现的位置
|
|
8
|
+
* 默认 left
|
|
9
|
+
*/
|
|
10
|
+
type?: 'left' | 'right' | 'top' | 'bottom';
|
|
11
|
+
/**
|
|
12
|
+
* 普通展示数据
|
|
13
|
+
*/
|
|
14
|
+
defaultContent?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 显示隐藏的数据
|
|
17
|
+
*/
|
|
18
|
+
displayContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* 展开还是收起
|
|
21
|
+
*/
|
|
22
|
+
open?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 允许缩放的长度
|
|
25
|
+
* */
|
|
26
|
+
zoomLength?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 单位
|
|
29
|
+
* 默认px
|
|
30
|
+
*/
|
|
31
|
+
unit?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 展开按钮显示文字
|
|
34
|
+
*/
|
|
35
|
+
showLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 收起按钮展示文字
|
|
38
|
+
*/
|
|
39
|
+
hideLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 间距
|
|
42
|
+
* 默认20
|
|
43
|
+
*/
|
|
44
|
+
spacing?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @author zhanzl
|
|
48
|
+
* @date 2022/08/09
|
|
49
|
+
*/
|
|
50
|
+
declare const CollapseLayout: FC<CollapseLayoutProps>;
|
|
51
|
+
export default CollapseLayout;
|