@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/Modal/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import Dialog from 'rc-dialog';
|
|
6
6
|
import { Button } from '../Button/index.js';
|
|
7
7
|
import CloseIcon from '@para-ui/icons/Close';
|
|
8
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
8
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
9
9
|
import { d as defaultModalLocale } from '../_verture/index-e2881a53.js';
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
12
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
13
13
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
14
14
|
import CompleteIcon from '@para-ui/icons/CheckCircleF';
|
|
15
15
|
import CloseCircleFilled from '@para-ui/icons/CloseCircleF';
|
|
@@ -18,74 +18,71 @@ import WarningCircleF from '@para-ui/icons/WarningCircleF';
|
|
|
18
18
|
import { UUID } from '@paraview/lib';
|
|
19
19
|
import { getConfirmLocale } from '@para-ui/core/GlobalContext';
|
|
20
20
|
import '../_verture/typeof-498dd2b1.js';
|
|
21
|
-
import '../_verture/slicedToArray-
|
|
21
|
+
import '../_verture/slicedToArray-77980792.js';
|
|
22
22
|
import '@para-ui/icons/LoadingF';
|
|
23
23
|
import '@para-ui/icons/Forbid';
|
|
24
24
|
import '../Tooltip/index.js';
|
|
25
25
|
import 'rc-tooltip';
|
|
26
26
|
import 'rc-tooltip/lib/placements';
|
|
27
27
|
import '@para-ui/icons/Down';
|
|
28
|
-
import '../_verture/index-
|
|
28
|
+
import '../_verture/index-be4faaee.js';
|
|
29
29
|
import 'rc-dropdown';
|
|
30
|
-
import '../_verture/usePopupContainer-
|
|
30
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
31
31
|
import 'dayjs';
|
|
32
32
|
|
|
33
33
|
var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/2 下午7:00\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-confirm.paraui-v3-modal .paraui-v3-modal-body {\n padding: 0;\n}\n.paraui-v3-confirm .confirm-wrapper {\n width: 416px;\n outline: none;\n}\n.paraui-v3-confirm .confirm-content {\n position: relative;\n padding: 32px 32px 24px;\n}\n.paraui-v3-confirm .confirm-content-close {\n position: absolute;\n right: 16px;\n top: 16px;\n border: none;\n}\n.paraui-v3-confirm .confirm-content-close svg {\n font-size: 18px;\n}\n.paraui-v3-confirm .confirm-content-icon {\n float: left;\n margin-top: 2px;\n color: rgb(255, 161, 80);\n}\n.paraui-v3-confirm .confirm-content-icon svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v3-confirm .confirm-content-icon--warn, .paraui-v3-confirm .confirm-content-icon-warning {\n color: rgb(255, 161, 80);\n}\n.paraui-v3-confirm .confirm-content-icon--error {\n color: rgb(235, 96, 84);\n}\n.paraui-v3-confirm .confirm-content-icon--success {\n color: rgb(83, 195, 27);\n}\n.paraui-v3-confirm .confirm-content-icon--info {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-confirm .confirm-content-body {\n margin: 0 16px 0 30px;\n color: rgb(46, 55, 67);\n font-size: 14px;\n}\n.paraui-v3-confirm .confirm-content-body .confirm-body-title {\n display: block;\n margin-bottom: 8px;\n font-weight: 700;\n font-size: 16px;\n}\n.paraui-v3-confirm .confirm-content-actions {\n margin-top: 24px;\n text-align: right;\n}\n.paraui-v3-confirm .confirm-content-actions > button + button {\n margin-left: 16px;\n}";
|
|
34
34
|
styleInject(css_248z$1);
|
|
35
35
|
|
|
36
|
+
//图标
|
|
36
37
|
var iconMap = {
|
|
37
38
|
"success": jsx(CompleteIcon, {}),
|
|
38
39
|
"warn": jsx(WarningCircleF, {}),
|
|
39
40
|
"warning": jsx(WarningCircleF, {}),
|
|
40
41
|
"error": jsx(CloseCircleFilled, {}),
|
|
41
42
|
"info": jsx(InfoOutlined, {})
|
|
42
|
-
};
|
|
43
|
-
|
|
43
|
+
};
|
|
44
|
+
//confirm modal
|
|
44
45
|
var ConfirmDialog = function ConfirmDialog(props) {
|
|
45
46
|
var _props$type = props.type,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
type = _props$type === void 0 ? 'warning' : _props$type,
|
|
48
|
+
title = props.title,
|
|
49
|
+
content = props.content,
|
|
50
|
+
icon = props.icon,
|
|
51
|
+
okText = props.okText,
|
|
52
|
+
cancelText = props.cancelText,
|
|
53
|
+
onOk = props.onOk,
|
|
54
|
+
onCancel = props.onCancel,
|
|
55
|
+
className = props.className,
|
|
56
|
+
_props$showCancel = props.showCancel,
|
|
57
|
+
showCancel = _props$showCancel === void 0 ? true : _props$showCancel,
|
|
58
|
+
_props$closable = props.closable,
|
|
59
|
+
closable = _props$closable === void 0 ? false : _props$closable,
|
|
60
|
+
okButtonProps = props.okButtonProps,
|
|
61
|
+
cancelButtonProps = props.cancelButtonProps,
|
|
62
|
+
resolveFn = props.resolveFn,
|
|
63
|
+
callback = props.callback,
|
|
64
|
+
destroy = props.destroy,
|
|
65
|
+
actions = props.actions,
|
|
66
|
+
_props$showActions = props.showActions,
|
|
67
|
+
showActions = _props$showActions === void 0 ? true : _props$showActions,
|
|
68
|
+
restProps = __rest(props, ["type", "title", "content", "icon", "okText", "cancelText", "onOk", "onCancel", "className", "showCancel", "closable", "okButtonProps", "cancelButtonProps", "resolveFn", "callback", "destroy", "actions", "showActions"]);
|
|
69
|
+
var prefixCls = "".concat($prefixCls, "-confirm");
|
|
70
|
+
//取消
|
|
71
71
|
var handleCancel = function handleCancel() {
|
|
72
72
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
73
73
|
resolveFn === null || resolveFn === void 0 ? void 0 : resolveFn(false);
|
|
74
74
|
destroy === null || destroy === void 0 ? void 0 : destroy();
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
};
|
|
76
|
+
//确认
|
|
78
77
|
var handleOk = function handleOk() {
|
|
79
78
|
onOk === null || onOk === void 0 ? void 0 : onOk();
|
|
80
79
|
resolveFn === null || resolveFn === void 0 ? void 0 : resolveFn(true);
|
|
81
80
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
82
81
|
destroy === null || destroy === void 0 ? void 0 : destroy();
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
};
|
|
83
|
+
//render actions
|
|
86
84
|
var renderActions = function renderActions() {
|
|
87
85
|
if (!showActions) return null;
|
|
88
|
-
|
|
89
86
|
if (actions) {
|
|
90
87
|
return jsx("div", Object.assign({
|
|
91
88
|
className: 'confirm-content-actions'
|
|
@@ -93,7 +90,6 @@ var ConfirmDialog = function ConfirmDialog(props) {
|
|
|
93
90
|
children: actions
|
|
94
91
|
}));
|
|
95
92
|
}
|
|
96
|
-
|
|
97
93
|
return jsxs("div", Object.assign({
|
|
98
94
|
className: 'confirm-content-actions'
|
|
99
95
|
}, {
|
|
@@ -112,7 +108,6 @@ var ConfirmDialog = function ConfirmDialog(props) {
|
|
|
112
108
|
}))]
|
|
113
109
|
}));
|
|
114
110
|
};
|
|
115
|
-
|
|
116
111
|
return jsx(Modal, Object.assign({}, restProps, {
|
|
117
112
|
onOk: handleOk,
|
|
118
113
|
onCancel: handleCancel,
|
|
@@ -156,32 +151,27 @@ var ConfirmDialog = function ConfirmDialog(props) {
|
|
|
156
151
|
}))
|
|
157
152
|
}))
|
|
158
153
|
}));
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
};
|
|
155
|
+
//销毁方法map
|
|
156
|
+
var $destroyFnsMap = new Map();
|
|
157
|
+
//confirm
|
|
164
158
|
var confirm = function confirm(props, resolveFn, callback) {
|
|
165
159
|
var box = document.createElement('div');
|
|
166
160
|
var uuid = props.uuid || UUID();
|
|
167
161
|
if (props.uuid) box.setAttribute('data-confirm-cid', props.uuid);
|
|
168
|
-
document.body.appendChild(box);
|
|
169
|
-
|
|
162
|
+
document.body.appendChild(box);
|
|
163
|
+
//销毁组件
|
|
170
164
|
var destroy = function destroy() {
|
|
171
165
|
var unmountResult = ReactDOM.unmountComponentAtNode(box);
|
|
172
|
-
|
|
173
166
|
if (unmountResult && box.parentNode) {
|
|
174
167
|
box.parentNode.removeChild(box);
|
|
175
168
|
}
|
|
176
|
-
|
|
177
169
|
$destroyFnsMap.delete(uuid);
|
|
178
170
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
171
|
+
$destroyFnsMap.set(uuid, destroy);
|
|
172
|
+
//渲染组件
|
|
182
173
|
setTimeout(function () {
|
|
183
174
|
var _a, _b;
|
|
184
|
-
|
|
185
175
|
var runtimeLocale = getConfirmLocale();
|
|
186
176
|
ReactDOM.render(jsx(ConfirmDialog, Object.assign({}, props, {
|
|
187
177
|
okText: (_a = props.okText) !== null && _a !== void 0 ? _a : runtimeLocale.ok,
|
|
@@ -192,9 +182,8 @@ var confirm = function confirm(props, resolveFn, callback) {
|
|
|
192
182
|
destroy: destroy
|
|
193
183
|
})), box);
|
|
194
184
|
});
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
|
|
185
|
+
};
|
|
186
|
+
//promise factory
|
|
198
187
|
var promiseFactory = function promiseFactory(config, type, callback) {
|
|
199
188
|
var opts = {
|
|
200
189
|
type: type
|
|
@@ -205,9 +194,8 @@ var promiseFactory = function promiseFactory(config, type, callback) {
|
|
|
205
194
|
return new Promise(function (resolve) {
|
|
206
195
|
confirm(opts, resolve, callback);
|
|
207
196
|
});
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
|
|
197
|
+
};
|
|
198
|
+
//销毁弹框
|
|
211
199
|
var destroyAllConfirm = function destroyAllConfirm(uuid) {
|
|
212
200
|
if (uuid) {
|
|
213
201
|
var close = $destroyFnsMap.get(uuid);
|
|
@@ -215,14 +203,12 @@ var destroyAllConfirm = function destroyAllConfirm(uuid) {
|
|
|
215
203
|
$destroyFnsMap.delete(uuid);
|
|
216
204
|
return;
|
|
217
205
|
}
|
|
218
|
-
|
|
219
206
|
$destroyFnsMap.forEach(function (close) {
|
|
220
207
|
if (close) close();
|
|
221
208
|
});
|
|
222
209
|
$destroyFnsMap.clear();
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
|
|
210
|
+
};
|
|
211
|
+
//confirm 方法对象
|
|
226
212
|
var Confirm = {
|
|
227
213
|
info: function info(config, callback) {
|
|
228
214
|
return promiseFactory(config, 'info', callback);
|
|
@@ -242,8 +228,8 @@ var Confirm = {
|
|
|
242
228
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/13 下午6:54\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-modal {\n color: rgb(46, 55, 67);\n font-size: 14px;\n line-height: 1.5715;\n pointer-events: none;\n position: relative;\n top: 100px;\n width: auto;\n max-width: calc(100vw - 32px);\n margin: 0 auto;\n padding-bottom: 24px;\n}\n.paraui-v3-modal.paraui-v3-modal-sm .paraui-v3-modal-content {\n width: 430px;\n max-height: 250px;\n}\n.paraui-v3-modal.paraui-v3-modal-md .paraui-v3-modal-content {\n width: 486px;\n max-height: 610px;\n}\n.paraui-v3-modal.paraui-v3-modal-lg .paraui-v3-modal-content {\n width: 948px;\n max-height: 610px;\n}\n.paraui-v3-modal.paraui-v3-modal-fullscreen {\n max-width: 100%;\n width: 100%;\n height: 100%;\n}\n.paraui-v3-modal.paraui-v3-modal-zoom-enter, .paraui-v3-modal.paraui-v3-modal-zoom-appear {\n transform: none;\n opacity: 0;\n animation-duration: 0.3s;\n user-select: none;\n}\n.paraui-v3-modal-mask {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1500;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.45);\n}\n.paraui-v3-modal-mask-hidden {\n display: none;\n}\n.paraui-v3-modal-wrap {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: auto;\n outline: 0;\n z-index: 1500;\n -webkit-overflow-scrolling: touch;\n}\n.paraui-v3-modal .paraui-v3-modal-content {\n display: flex;\n height: 100%;\n flex-direction: column;\n position: relative;\n border-radius: 4px;\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 2px 8px 0px rgba(171, 176, 185, 0.4);\n pointer-events: auto;\n overflow-y: auto;\n}\n.paraui-v3-modal .paraui-v3-modal-title {\n position: relative;\n height: 44px;\n padding: 12px 24px;\n font-size: 14px;\n color: rgb(46, 55, 67);\n font-weight: 700;\n line-height: 20px;\n border-bottom: 1px solid rgba(171, 176, 185, 0.2);\n overflow-wrap: break-word;\n}\n.paraui-v3-modal .paraui-v3-modal-title .paraui-v3-modal-close {\n position: absolute;\n top: 8px;\n right: 14px;\n z-index: 10;\n border: 0;\n}\n.paraui-v3-modal .paraui-v3-modal-title .paraui-v3-modal-close .paraui-v3-modal-close-icon {\n font-size: 20px;\n}\n.paraui-v3-modal .paraui-v3-modal-body {\n flex: auto;\n padding: 16px 24px;\n overflow-y: auto;\n overflow-wrap: break-word;\n}\n.paraui-v3-modal .paraui-v3-modal-footer {\n padding: 8px 24px 24px;\n text-align: right;\n}\n.paraui-v3-modal .paraui-v3-modal-footer > button + button {\n margin-left: 16px;\n}\n.paraui-v3-modal-open {\n overflow: hidden;\n}\n.paraui-v3-modal-centered {\n text-align: center;\n}\n.paraui-v3-modal-centered::before {\n display: inline-block;\n width: 0;\n height: 100%;\n vertical-align: middle;\n content: \"\";\n}\n.paraui-v3-modal-centered .paraui-v3-modal {\n top: 0;\n display: inline-block;\n padding-bottom: 0;\n text-align: left;\n vertical-align: middle;\n}\n@media (max-width: 767px) {\n .paraui-v3-modal .paraui-v3-modal {\n max-width: calc(100vw - 16px);\n margin: 8px auto;\n }\n .paraui-v3-modal .paraui-v3-modal-centered .paraui-v3-modal {\n flex: 1;\n }\n}\n\n.paraui-v3-modal-zoom-enter,\n.paraui-v3-modal-zoom-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n transform: scale(0);\n opacity: 0;\n animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n}\n\n.paraui-v3-modal-zoom-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-zoom-enter.paraui-v3-modal-zoom-enter-active,\n.paraui-v3-modal-zoom-appear.paraui-v3-modal-zoom-appear-active {\n animation-name: paraui-v3ModalZoomIn;\n animation-play-state: running;\n}\n\n.paraui-v3-modal-zoom-leave.paraui-v3-modal-zoom-leave-active {\n animation-name: paraui-v3ModalZoomOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.paraui-v3-modal-zoom-enter-prepare,\n.paraui-v3-modal-zoom-appear-prepare {\n transform: none;\n}\n\n.paraui-v3-modal-zoom-leave {\n animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n.paraui-v3-modal-fade-enter,\n.paraui-v3-modal-fade-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-fade-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-v3-modal-fade-enter.paraui-v3-modal-fade-enter-active,\n.paraui-v3-modal-fade-appear.paraui-v3-modal-fade-appear-active {\n animation-name: paraui-v3ModalFadeIn;\n animation-play-state: running;\n}\n\n.paraui-v3-modal-fade-leave.paraui-v3-modal-fade-leave-active {\n animation-name: paraui-v3ModalFadeOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.paraui-v3-modal-fade-enter,\n.paraui-v3-modal-fade-appear {\n opacity: 0;\n animation-timing-function: linear;\n}\n\n.paraui-v3-modal-fade-leave {\n animation-timing-function: linear;\n}\n\n@keyframes paraui-v3ModalZoomIn {\n 0% {\n transform: scale(0.2);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@keyframes paraui-v3ModalZoomOut {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0.2);\n opacity: 0;\n }\n}\n@keyframes paraui-v3ModalFadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n@keyframes paraui-v3ModalFadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n}";
|
|
243
229
|
styleInject(css_248z);
|
|
244
230
|
|
|
231
|
+
//鼠标位置内部使用
|
|
245
232
|
var mousePosition;
|
|
246
|
-
|
|
247
233
|
var getClickPosition = function getClickPosition(e) {
|
|
248
234
|
mousePosition = {
|
|
249
235
|
x: e.pageX,
|
|
@@ -252,74 +238,66 @@ var getClickPosition = function getClickPosition(e) {
|
|
|
252
238
|
setTimeout(function () {
|
|
253
239
|
mousePosition = null;
|
|
254
240
|
}, 100);
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
|
|
241
|
+
};
|
|
242
|
+
// 只有点击事件支持从鼠标位置动画展开
|
|
258
243
|
if (window.document.documentElement) {
|
|
259
244
|
document.documentElement.addEventListener('click', getClickPosition, true);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
}
|
|
246
|
+
//Modal
|
|
263
247
|
var Modal = function Modal(props) {
|
|
264
248
|
var open = props.open,
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
249
|
+
_props$visible = props.visible,
|
|
250
|
+
visible = _props$visible === void 0 ? false : _props$visible,
|
|
251
|
+
closeIcon = props.closeIcon,
|
|
252
|
+
_props$centered = props.centered,
|
|
253
|
+
centered = _props$centered === void 0 ? true : _props$centered,
|
|
254
|
+
_props$focusTriggerAf = props.focusTriggerAfterClose,
|
|
255
|
+
focusTriggerAfterClose = _props$focusTriggerAf === void 0 ? true : _props$focusTriggerAf,
|
|
256
|
+
title = props.title,
|
|
257
|
+
footer = props.footer,
|
|
258
|
+
_props$showActions = props.showActions,
|
|
259
|
+
showActions = _props$showActions === void 0 ? true : _props$showActions,
|
|
260
|
+
actions = props.actions,
|
|
261
|
+
header = props.header,
|
|
262
|
+
_props$hideHeader = props.hideHeader,
|
|
263
|
+
hideHeader = _props$hideHeader === void 0 ? false : _props$hideHeader,
|
|
264
|
+
_props$showCancel = props.showCancel,
|
|
265
|
+
showCancel = _props$showCancel === void 0 ? true : _props$showCancel,
|
|
266
|
+
_props$maskClosable = props.maskClosable,
|
|
267
|
+
maskClosable = _props$maskClosable === void 0 ? false : _props$maskClosable,
|
|
268
|
+
_props$disableBackdro = props.disableBackdropClick,
|
|
269
|
+
disableBackdropClick = _props$disableBackdro === void 0 ? true : _props$disableBackdro,
|
|
270
|
+
_props$keyboard = props.keyboard,
|
|
271
|
+
keyboard = _props$keyboard === void 0 ? false : _props$keyboard,
|
|
272
|
+
_props$disableEscapeK = props.disableEscapeKeyDown,
|
|
273
|
+
disableEscapeKeyDown = _props$disableEscapeK === void 0 ? true : _props$disableEscapeK,
|
|
274
|
+
fullScreen = props.fullScreen,
|
|
275
|
+
customizeSize = props.customizeSize,
|
|
276
|
+
style = props.style,
|
|
277
|
+
bodyStyle = props.bodyStyle,
|
|
278
|
+
contentWidth = props.contentWidth,
|
|
279
|
+
contentHeight = props.contentHeight,
|
|
280
|
+
contentStyle = props.contentStyle,
|
|
281
|
+
_props$size = props.size,
|
|
282
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
283
|
+
children = props.children,
|
|
284
|
+
_props$closable = props.closable,
|
|
285
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
286
|
+
restProps = __rest(props, ["open", "visible", "closeIcon", "centered", "focusTriggerAfterClose", "title", "footer", "showActions", "actions", "header", "hideHeader", "showCancel", "maskClosable", "disableBackdropClick", "keyboard", "disableEscapeKeyDown", "fullScreen", "customizeSize", "style", "bodyStyle", "contentWidth", "contentHeight", "contentStyle", "size", "children", "closable"]);
|
|
304
287
|
var isFullScreen = fullScreen || size === 'fullScreen'; //是否全屏
|
|
305
|
-
|
|
306
288
|
var intl = useFormatMessage('Modal', defaultModalLocale);
|
|
307
|
-
var prefixCls = "".concat($prefixCls, "-modal");
|
|
308
|
-
|
|
289
|
+
var prefixCls = "".concat($prefixCls, "-modal");
|
|
290
|
+
//关闭回调
|
|
309
291
|
var handleCancel = function handleCancel(e) {
|
|
310
292
|
var _a;
|
|
311
|
-
|
|
312
293
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
|
|
294
|
+
};
|
|
295
|
+
//确定回调
|
|
316
296
|
var handleOk = function handleOk(e) {
|
|
317
297
|
var _a;
|
|
318
|
-
|
|
319
298
|
(_a = props.onOk) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
|
|
299
|
+
};
|
|
300
|
+
//modal size class
|
|
323
301
|
var makeSizeCls = function makeSizeCls() {
|
|
324
302
|
var sizeMap = {
|
|
325
303
|
sm: "".concat(prefixCls, "-sm"),
|
|
@@ -331,26 +309,23 @@ var Modal = function Modal(props) {
|
|
|
331
309
|
if (contentWidth || contentHeight || contentStyle) return;
|
|
332
310
|
if (isFullScreen) return sizeMap['fullScreen'];
|
|
333
311
|
return sizeMap[size];
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
|
|
312
|
+
};
|
|
313
|
+
//自定义样式
|
|
337
314
|
var getCStyle = function getCStyle() {
|
|
338
315
|
return Object.assign(Object.assign({}, customizeSize), style);
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
|
|
316
|
+
};
|
|
317
|
+
//自定义内容样式
|
|
342
318
|
var getContentStyle = function getContentStyle() {
|
|
343
319
|
return Object.assign(Object.assign(Object.assign({}, bodyStyle), {
|
|
344
320
|
width: contentWidth,
|
|
345
321
|
height: contentHeight
|
|
346
322
|
}), contentStyle);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
|
|
323
|
+
};
|
|
324
|
+
//header
|
|
350
325
|
var renderHeader = function renderHeader() {
|
|
351
326
|
if (hideHeader) return null;
|
|
352
|
-
if (header) return header;
|
|
353
|
-
|
|
327
|
+
if (header) return header;
|
|
328
|
+
//
|
|
354
329
|
var closeNode = closable && jsx(Button.IconButton, Object.assign({
|
|
355
330
|
onClick: handleCancel,
|
|
356
331
|
className: "".concat(prefixCls, "-close"),
|
|
@@ -361,22 +336,19 @@ var Modal = function Modal(props) {
|
|
|
361
336
|
className: "".concat(prefixCls, "-close-icon")
|
|
362
337
|
})
|
|
363
338
|
}));
|
|
364
|
-
|
|
365
339
|
return jsxs(Fragment, {
|
|
366
340
|
children: [title, closeNode]
|
|
367
341
|
});
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
|
|
342
|
+
};
|
|
343
|
+
//footer
|
|
371
344
|
var renderFooter = function renderFooter() {
|
|
372
345
|
if (!showActions) return null;
|
|
373
346
|
var okText = props.okText,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
347
|
+
cancelText = props.cancelText,
|
|
348
|
+
okButtonProps = props.okButtonProps,
|
|
349
|
+
cancelButtonProps = props.cancelButtonProps,
|
|
350
|
+
_props$confirmLoading = props.confirmLoading,
|
|
351
|
+
confirmLoading = _props$confirmLoading === void 0 ? false : _props$confirmLoading;
|
|
380
352
|
var okBtn = jsx(Button, Object.assign({
|
|
381
353
|
variant: "contained",
|
|
382
354
|
size: "medium",
|
|
@@ -387,7 +359,6 @@ var Modal = function Modal(props) {
|
|
|
387
359
|
id: 'ok'
|
|
388
360
|
})
|
|
389
361
|
}));
|
|
390
|
-
|
|
391
362
|
var cancelBtn = showCancel && jsx(Button, Object.assign({
|
|
392
363
|
variant: "outlined",
|
|
393
364
|
size: "medium",
|
|
@@ -397,10 +368,8 @@ var Modal = function Modal(props) {
|
|
|
397
368
|
id: 'cancel'
|
|
398
369
|
})
|
|
399
370
|
}));
|
|
400
|
-
|
|
401
371
|
var buttons = [cancelBtn, okBtn];
|
|
402
372
|
var tActions = actions !== null && actions !== void 0 ? actions : footer;
|
|
403
|
-
|
|
404
373
|
if (typeof tActions === 'function') {
|
|
405
374
|
var btns = tActions(buttons);
|
|
406
375
|
return jsx(Fragment, {
|
|
@@ -413,7 +382,6 @@ var Modal = function Modal(props) {
|
|
|
413
382
|
} else if (tActions) {
|
|
414
383
|
return tActions;
|
|
415
384
|
}
|
|
416
|
-
|
|
417
385
|
return jsx(Fragment, {
|
|
418
386
|
children: buttons.map(function (btn, idx) {
|
|
419
387
|
return jsx(React__default.Fragment, {
|
|
@@ -421,11 +389,10 @@ var Modal = function Modal(props) {
|
|
|
421
389
|
}, idx);
|
|
422
390
|
})
|
|
423
391
|
});
|
|
424
|
-
};
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
392
|
+
};
|
|
393
|
+
//wrap cls
|
|
394
|
+
var makeWrapClassName = clsx(props.wrapClassName, _defineProperty({}, "".concat(prefixCls, "-centered"), centered));
|
|
395
|
+
//modal cls
|
|
429
396
|
var makeModalClassName = clsx(props.className, "".concat($prefixCls, "-scrollbar-small"), makeSizeCls());
|
|
430
397
|
return jsx(Dialog, Object.assign({}, restProps, {
|
|
431
398
|
visible: open !== null && open !== void 0 ? open : visible,
|