@para-ui/core 3.0.28 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Menu/interface.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { ReactNode } from 'react';
|
|
7
7
|
/** 菜单类型 */
|
|
8
|
-
export
|
|
8
|
+
export type MenuListTypeType = 'redirect' | 'router' | "iframe" | "snack" | "snackPage";
|
|
9
9
|
/** color类型 */
|
|
10
|
-
export
|
|
10
|
+
export type ColorType = 'deep' | 'light';
|
|
11
11
|
/** logo参数 */
|
|
12
12
|
export interface LogoProps {
|
|
13
13
|
/** 展开 / 收起 */
|
package/Message/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ interface MsgGlobalConfig {
|
|
|
17
17
|
}
|
|
18
18
|
declare const _default: () => JSX.Element;
|
|
19
19
|
export default _default;
|
|
20
|
-
export
|
|
20
|
+
export type MsgTypeProps = {
|
|
21
21
|
/**是否启用html渲染内容*/
|
|
22
22
|
html?: boolean;
|
|
23
23
|
/**是否强制显示关闭按钮,默认自动当延迟关闭事件为0或null时自动显示*/
|
package/Message/index.js
CHANGED
|
@@ -5,41 +5,41 @@ import WarningCircleF from '@para-ui/icons/WarningCircleF';
|
|
|
5
5
|
import CompleteIcon from '@para-ui/icons/CheckCircleF';
|
|
6
6
|
import CloseIcon from '@para-ui/icons/Close';
|
|
7
7
|
import CloseCircleFilled from '@para-ui/icons/CloseCircleF';
|
|
8
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
|
|
11
11
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/1 下午5:48\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-message-box {\n position: fixed;\n top: 3%;\n left: 0;\n z-index: 9999;\n text-align: center;\n width: 100%;\n pointer-events: none;\n /*从上到下进入*/\n /*从上到下*/\n}\n.paraui-v3-message-box .msg-item .msg-wrapper {\n position: relative;\n display: inline-block;\n margin: 10px auto;\n min-height: 44px;\n padding: 12px 16px;\n border-radius: 4px;\n font-size: 14px;\n text-align: left;\n}\n.paraui-v3-message-box .msg-item .msg-icon {\n position: absolute;\n top: 15px;\n left: 16px;\n line-height: 0;\n}\n.paraui-v3-message-box .msg-item .msg-icon svg {\n font-size: 14px;\n color: currentColor;\n}\n.paraui-v3-message-box .msg-item .msg-text {\n display: inline-block;\n max-width: 60vw;\n word-wrap: break-word;\n margin-right: 32px;\n margin-left: 22px;\n line-height: 20px;\n word-break: break-all;\n}\n.paraui-v3-message-box .msg-item .msg-text--title {\n font-weight: 700;\n}\n.paraui-v3-message-box .msg-item .msg-text--noicon {\n margin-left: 0;\n}\n.paraui-v3-message-box .msg-item .msg-text .msg-desc {\n display: block;\n margin-top: 8px;\n font-weight: 400;\n word-wrap: break-word;\n}\n.paraui-v3-message-box .msg-item .msg-close {\n position: absolute;\n right: 16px;\n top: 15px;\n cursor: pointer;\n line-height: 0;\n pointer-events: auto;\n}\n.paraui-v3-message-box .msg-item .msg-close svg {\n font-size: 14px;\n color: currentColor;\n}\n.paraui-v3-message-box .msg-info {\n background-color: rgb(243, 246, 252);\n color: rgb(54, 102, 214);\n}\n.paraui-v3-message-box .msg-info .msg-close {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-message-box .msg-warn {\n background-color: rgb(254, 249, 245);\n color: rgb(255, 161, 80);\n}\n.paraui-v3-message-box .msg-warn .msg-close {\n color: rgb(255, 161, 80);\n}\n.paraui-v3-message-box .msg-error {\n background-color: rgb(253, 246, 245);\n color: rgb(235, 96, 84);\n}\n.paraui-v3-message-box .msg-error .msg-close {\n color: rgb(235, 96, 84);\n}\n.paraui-v3-message-box .msg-success {\n background-color: rgb(245, 251, 242);\n color: rgb(83, 195, 27);\n}\n.paraui-v3-message-box .msg-success .msg-close {\n color: rgb(83, 195, 27);\n}\n.paraui-v3-message-box .message-fadeInDown {\n animation-duration: 0.5s;\n animation-name: messageFadeInDown;\n}\n@keyframes messageFadeInDown {\n from {\n opacity: 0;\n transform: translate(0, -50px); /* 标准语法 */\n }\n to {\n opacity: 1;\n transform: translate(0, 0); /* 标准语法 */\n }\n}";
|
|
12
12
|
styleInject(css_248z);
|
|
13
13
|
|
|
14
|
+
//图标map
|
|
14
15
|
var iconMapping = {
|
|
15
16
|
'info': jsx(WarningCircleF, {}),
|
|
16
17
|
'warn': jsx(WarningCircleF, {}),
|
|
17
18
|
'error': jsx(CloseCircleFilled, {}),
|
|
18
19
|
'success': jsx(CompleteIcon, {})
|
|
19
|
-
};
|
|
20
|
-
|
|
20
|
+
};
|
|
21
|
+
//获取window
|
|
21
22
|
var getMsgWindow = function getMsgWindow() {
|
|
22
23
|
return window === window.top ? window : window.top;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
};
|
|
25
|
+
//消息内容模板
|
|
26
26
|
var template = function template(_ref) {
|
|
27
27
|
var icon = _ref.icon,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
text = _ref.text,
|
|
29
|
+
id = _ref.id,
|
|
30
|
+
type = _ref.type,
|
|
31
|
+
html = _ref.html,
|
|
32
|
+
close = _ref.close,
|
|
33
|
+
desc = _ref.desc,
|
|
34
|
+
hideIcon = _ref.hideIcon;
|
|
35
35
|
var item = document.createElement('div');
|
|
36
36
|
item.className = "msg-item";
|
|
37
37
|
item.id = id;
|
|
38
38
|
item.innerHTML = "<div class=\"msg-wrapper message-fadeInDown msg-".concat(type, "\">\n ").concat(icon ? "<div class=\"msg-icon\"></div>" : '', "\n <div class=\"msg-text\"></div>\n ").concat(close ? "<div class=\"msg-close\"></div>" : '', "\n </div>\n ");
|
|
39
39
|
var msgBox = item.querySelector('.msg-text');
|
|
40
40
|
if (!msgBox) return item;
|
|
41
|
-
if (html) msgBox.innerHTML = text;else msgBox.textContent = text;
|
|
42
|
-
|
|
41
|
+
if (html) msgBox.innerHTML = text;else msgBox.textContent = text;
|
|
42
|
+
//描述
|
|
43
43
|
if (desc) {
|
|
44
44
|
var span = document.createElement('span');
|
|
45
45
|
span.className = 'msg-desc';
|
|
@@ -47,44 +47,39 @@ var template = function template(_ref) {
|
|
|
47
47
|
msgBox.classList.add('msg-text--title');
|
|
48
48
|
msgBox.appendChild(span);
|
|
49
49
|
}
|
|
50
|
-
|
|
51
50
|
if (hideIcon) {
|
|
52
51
|
msgBox.classList.add('msg-text--noicon');
|
|
53
52
|
}
|
|
54
|
-
|
|
55
53
|
var msgClose = item.querySelector('.msg-close');
|
|
56
54
|
if (msgClose) msgClose.addEventListener('click', function () {
|
|
57
55
|
var _a;
|
|
58
|
-
|
|
59
56
|
var hasNode = document.querySelector("#".concat(id));
|
|
60
|
-
|
|
61
57
|
if (hasNode) {
|
|
62
58
|
(_a = item === null || item === void 0 ? void 0 : item.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(item);
|
|
63
59
|
item = null;
|
|
64
60
|
}
|
|
65
61
|
});
|
|
66
62
|
return item;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
};
|
|
64
|
+
//消息box id
|
|
65
|
+
var parentId = 'msgbox_' + String(Math.random() * 100000 | 0 + new Date().getTime());
|
|
66
|
+
//message mountNode
|
|
72
67
|
var index = (function () {
|
|
73
68
|
return jsx("div", {
|
|
74
69
|
className: "".concat($prefixCls, "-message-box"),
|
|
75
70
|
id: parentId
|
|
76
71
|
});
|
|
77
|
-
});
|
|
78
|
-
|
|
72
|
+
});
|
|
73
|
+
//渲染msg 内容
|
|
79
74
|
var renderContent = function renderContent(box, _ref2, removeTime, autoClose) {
|
|
80
75
|
var icon = _ref2.icon,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
text = _ref2.text,
|
|
77
|
+
id = _ref2.id,
|
|
78
|
+
type = _ref2.type,
|
|
79
|
+
html = _ref2.html,
|
|
80
|
+
close = _ref2.close,
|
|
81
|
+
desc = _ref2.desc,
|
|
82
|
+
hideIcon = _ref2.hideIcon;
|
|
88
83
|
var item = template({
|
|
89
84
|
id: id,
|
|
90
85
|
text: text,
|
|
@@ -105,26 +100,22 @@ var renderContent = function renderContent(box, _ref2, removeTime, autoClose) {
|
|
|
105
100
|
var hasNode = document.querySelector("#".concat(item.id));
|
|
106
101
|
if (hasNode) box === null || box === void 0 ? void 0 : box.removeChild(item);
|
|
107
102
|
}, removeTime);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
};
|
|
104
|
+
//message 构造方法
|
|
111
105
|
var Msg = function Msg(config, removeTime, type, parentId) {
|
|
112
106
|
var _a, _b;
|
|
113
|
-
|
|
114
107
|
var getMsgConf = function getMsgConf() {
|
|
115
108
|
var _win = getMsgWindow();
|
|
116
|
-
|
|
117
109
|
return _win['__msg_conf__'] || {};
|
|
118
110
|
};
|
|
119
|
-
|
|
120
111
|
var icon = iconMapping[type],
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
112
|
+
text = '',
|
|
113
|
+
desc = '',
|
|
114
|
+
html = false,
|
|
115
|
+
close,
|
|
116
|
+
hideIcon = false,
|
|
117
|
+
maxCount = (_a = getMsgConf().maxCount) !== null && _a !== void 0 ? _a : Infinity,
|
|
118
|
+
duration = (_b = getMsgConf().duration) !== null && _b !== void 0 ? _b : removeTime;
|
|
128
119
|
var autoClose = !isNaN(duration) && duration > 0;
|
|
129
120
|
if (typeof config === "string") text = config;else if (_typeof(config) === "object") {
|
|
130
121
|
text = config.text || '';
|
|
@@ -136,13 +127,11 @@ var Msg = function Msg(config, removeTime, type, parentId) {
|
|
|
136
127
|
}
|
|
137
128
|
if (_typeof(config) === "object" && typeof config.close === "boolean") close = config.close;else close = !autoClose;
|
|
138
129
|
var parent = document.getElementById(parentId);
|
|
139
|
-
|
|
140
130
|
if (!parent) {
|
|
141
131
|
parent = document.createElement('div');
|
|
142
132
|
parent.id = parentId;
|
|
143
133
|
document.body.appendChild(parent);
|
|
144
134
|
}
|
|
145
|
-
|
|
146
135
|
parent.className = "".concat($prefixCls, "-message-box").concat('');
|
|
147
136
|
var id = 'msgitem_' + String(Math.random() * 100000 | 0 + new Date().getTime());
|
|
148
137
|
renderContent(parent, {
|
|
@@ -156,16 +145,13 @@ var Msg = function Msg(config, removeTime, type, parentId) {
|
|
|
156
145
|
hideIcon: hideIcon
|
|
157
146
|
}, duration, autoClose);
|
|
158
147
|
dropEleWhenExceedLimit(parent, maxCount);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
};
|
|
149
|
+
//超出maxCount 删除之前元素
|
|
162
150
|
var dropEleWhenExceedLimit = function dropEleWhenExceedLimit(parent, maxCount) {
|
|
163
151
|
var _a, _b;
|
|
164
|
-
|
|
165
152
|
if (!parent || !((_a = parent.children) === null || _a === void 0 ? void 0 : _a.length)) return;
|
|
166
153
|
var child = parent.children;
|
|
167
154
|
var len = child.length;
|
|
168
|
-
|
|
169
155
|
if (len > maxCount) {
|
|
170
156
|
for (var i = 0; i < len; i++) {
|
|
171
157
|
if (i < maxCount && child[i]) {
|
|
@@ -173,25 +159,20 @@ var dropEleWhenExceedLimit = function dropEleWhenExceedLimit(parent, maxCount) {
|
|
|
173
159
|
}
|
|
174
160
|
}
|
|
175
161
|
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
|
|
162
|
+
};
|
|
163
|
+
//清除所有msg
|
|
179
164
|
var clearFunc = function clearFunc(parentId) {
|
|
180
165
|
var parent = document.getElementById(parentId);
|
|
181
166
|
if (!parent) return;
|
|
182
167
|
parent.innerHTML = '';
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
|
|
168
|
+
};
|
|
169
|
+
//msg 全局配置
|
|
186
170
|
var msgConfig = function msgConfig() {
|
|
187
171
|
var conf = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
188
|
-
|
|
189
172
|
var _win = getMsgWindow();
|
|
190
|
-
|
|
191
173
|
_win.__msg_conf__ = conf;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
|
|
174
|
+
};
|
|
175
|
+
//message
|
|
195
176
|
var Message = {
|
|
196
177
|
info: function info(config) {
|
|
197
178
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
|
package/Modal/Confirm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { ButtonProps } from "../../Button";
|
|
3
3
|
import './index.scss';
|
|
4
|
-
|
|
4
|
+
type ConfirmType = "success" | "info" | "error" | "warn" | "warning";
|
|
5
5
|
interface ConfirmDialogProps {
|
|
6
6
|
/**图标类型*/
|
|
7
7
|
type?: ConfirmType;
|
|
@@ -48,7 +48,7 @@ interface ConfirmDialogProps {
|
|
|
48
48
|
/**销毁方法*/
|
|
49
49
|
destroy?: Function;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
type ConfirmProps = Omit<ConfirmDialogProps, 'open' | 'resolveFn' | 'destroy' | 'callback'> & {
|
|
52
52
|
uuid?: string;
|
|
53
53
|
};
|
|
54
54
|
interface ConfirmFn {
|
package/Modal/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { ButtonProps } from '../Button';
|
|
3
3
|
import { Confirm, ConfirmObject } from "./Confirm";
|
|
4
4
|
import './index.scss';
|
|
5
|
-
|
|
5
|
+
type ModalSize = 'sm' | 'md' | 'lg' | 'auto' | 'fullScreen';
|
|
6
6
|
export interface ModalProps {
|
|
7
7
|
/** 对话框是否可见 */
|
|
8
8
|
visible?: boolean;
|