@para-ui/core 4.0.0-rc.3 → 4.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +18 -17
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +89 -117
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +7 -9
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +242 -330
- package/ComboSelect/utils.d.ts +0 -5
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +22 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +82 -97
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +219 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +66 -74
- package/FormItem/index.js +14 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +105 -114
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +62 -79
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +52 -59
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +35 -44
- package/Select/index.js +323 -364
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +905 -796
- package/SelectorPicker/index.js +111 -133
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +25 -26
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +767 -963
- package/Tabs/index.js +102 -102
- package/Tag/index.js +115 -162
- package/TextEditor/index.js +81 -103
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +27 -28
- package/Timeline/index.js +67 -58
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +53 -52
- package/Tooltip/index.js +79 -82
- package/Transfer/index.js +160 -203
- package/Tree/index.js +7 -12
- package/Upload/index.js +527 -759
- package/Upload/interface.d.ts +5 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-f48d5ce6.js → index-0ced30f7.js} +1128 -1080
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-56601c94.js → index-ef1235fb.js} +125 -134
- package/_verture/{index-de8f4428.js → index-f186b5e8.js} +315 -399
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/{utils-06d86594.js → utils-46e99c9a.js} +34 -26
- package/index.js +21 -22
- package/locale/index.js +10 -10
- package/package.json +1 -1
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-232d890b.js +0 -327
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/toConsumableArray-8f4c9589.js +0 -19
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Notification/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import React__default from 'react';
|
|
4
3
|
import Notification from 'rc-notification';
|
|
5
4
|
import WarningCircleF from '@para-ui/icons/WarningCircleF';
|
|
6
|
-
import
|
|
5
|
+
import SuccessOutlined from '@para-ui/icons/CheckCircleF';
|
|
7
6
|
import CloseIcon from '@para-ui/icons/Close';
|
|
8
7
|
import CloseCircleF from '@para-ui/icons/CloseCircleF';
|
|
9
8
|
import clsx from 'clsx';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
9
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
11
10
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
12
|
-
import '../_verture/typeof-adeedc13.js';
|
|
13
11
|
|
|
14
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n * @author Hanz\n * @date 2022/1/13 上午10:30\n * @description 通知提醒框\n */\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-notification {\n position: fixed;\n padding: 0;\n color: rgb(29, 33, 38);\n font-size: 14px;\n z-index: 9999;\n}\n.paraui-v4-notification-topLeft .paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-bottomLeft .paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-topLeft .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active, .paraui-v4-notification-bottomLeft .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active {\n animation-name: NotificationLeftFadeIn;\n}\n.paraui-v4-notification-hook-holder, .paraui-v4-notification-notice {\n position: relative;\n width: 440px;\n max-width: calc(100vw - 48px);\n margin-top: 20px;\n margin-left: auto;\n overflow: hidden;\n word-wrap: break-word;\n background: #fff;\n border-radius: 4px;\n box-shadow: 0px 2px 8px 0px rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-notification-hook-holder:first-child, .paraui-v4-notification-notice:first-child {\n margin-top: 0;\n}\n.paraui-v4-notification-topLeft .paraui-v4-notification-hook-holder, .paraui-v4-notification-topLeft .paraui-v4-notification-notice, .paraui-v4-notification-bottomLeft .paraui-v4-notification-hook-holder, .paraui-v4-notification-bottomLeft .paraui-v4-notification-notice {\n margin-right: auto;\n margin-left: 0;\n}\n.paraui-v4-notification-hook-holder > .paraui-v4-notification-notice {\n margin-bottom: 0;\n box-shadow: none;\n}\n.paraui-v4-notification-notice {\n padding: 16px;\n line-height: 1.5715;\n}\n.paraui-v4-notification-notice-content {\n position: relative;\n}\n.paraui-v4-notification-notice-message {\n margin-bottom: 10px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n font-weight: 700;\n line-height: 20px;\n}\n.paraui-v4-notification-notice-message-single-line-auto-margin {\n display: block;\n width: calc(264px - 100%);\n max-width: 4px;\n background-color: transparent;\n pointer-events: none;\n}\n.paraui-v4-notification-notice-message-single-line-auto-margin::before {\n display: block;\n content: \"\";\n}\n.paraui-v4-notification-notice-description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n}\n.paraui-v4-notification-notice-closable .paraui-v4-notification-notice-message {\n padding-right: 24px;\n}\n.paraui-v4-notification-notice-with-icon .paraui-v4-notification-notice-message {\n margin-bottom: 8px;\n margin-left: 24px;\n}\n.paraui-v4-notification-notice-with-icon .paraui-v4-notification-notice-description {\n margin-left: 24px;\n}\n.paraui-v4-notification-notice-without-description .paraui-v4-notification-notice-message {\n margin-bottom: 0;\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon {\n position: absolute;\n top: 0px;\n font-size: 18px;\n line-height: 24px;\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-success {\n color: rgb(19, 191, 76);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-info {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-warning {\n color: rgb(255, 147, 38);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-error {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-notification-notice-close {\n position: absolute;\n top: 16px;\n right: 16px;\n color: rgb(92, 101, 115);\n outline: none;\n}\n.paraui-v4-notification-notice-close:hover {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-notification .paraui-v4-notification-close-icon {\n font-size: 18px;\n cursor: pointer;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-notification .paraui-v4-notification-close-icon:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-notification-notice-btn {\n float: right;\n margin-top: 12px;\n}\n.paraui-v4-notification .notification-fade-effect {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n}\n.paraui-v4-notification-fade-enter, .paraui-v4-notification-fade-appear {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n opacity: 0;\n animation-play-state: paused;\n}\n.paraui-v4-notification-fade-leave {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n.paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active {\n animation-name: NotificationFadeIn;\n animation-play-state: running;\n}\n.paraui-v4-notification-fade-leave.paraui-v4-notification-fade-leave-active {\n animation-name: NotificationFadeOut;\n animation-play-state: running;\n}\n@keyframes NotificationFadeIn {\n 0% {\n left: 440px;\n opacity: 0;\n }\n 100% {\n left: 0;\n opacity: 1;\n }\n}\n@keyframes NotificationLeftFadeIn {\n 0% {\n right: 440px;\n opacity: 0;\n }\n 100% {\n right: 0;\n opacity: 1;\n }\n}\n@keyframes NotificationFadeOut {\n 0% {\n max-height: 150px;\n margin-bottom: 16px;\n opacity: 1;\n }\n 100% {\n max-height: 0;\n margin-bottom: 0;\n padding-top: 0;\n padding-bottom: 0;\n opacity: 0;\n }\n}";
|
|
12
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n * @author Hanz\n * @date 2022/1/13 上午10:30\n * @description 通知提醒框\n */\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-notification {\n position: fixed;\n padding: 0;\n color: rgb(29, 33, 38);\n font-size: 14px;\n z-index: 9999;\n}\n.paraui-v4-notification-topLeft .paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-bottomLeft .paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-topLeft .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active, .paraui-v4-notification-bottomLeft .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active {\n animation-name: NotificationLeftFadeIn;\n}\n.paraui-v4-notification-hook-holder, .paraui-v4-notification-notice {\n position: relative;\n width: 440px;\n max-width: calc(100vw - 48px);\n margin-top: 20px;\n margin-left: auto;\n overflow: hidden;\n word-wrap: break-word;\n background: #fff;\n border-radius: 4px;\n box-shadow: 0px 2px 8px 0px rgba(212, 218, 227, 0.4);\n border: 1px solid rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-notification-hook-holder:first-child, .paraui-v4-notification-notice:first-child {\n margin-top: 0;\n}\n.paraui-v4-notification-topLeft .paraui-v4-notification-hook-holder, .paraui-v4-notification-topLeft .paraui-v4-notification-notice, .paraui-v4-notification-bottomLeft .paraui-v4-notification-hook-holder, .paraui-v4-notification-bottomLeft .paraui-v4-notification-notice {\n margin-right: auto;\n margin-left: 0;\n}\n.paraui-v4-notification-hook-holder > .paraui-v4-notification-notice {\n margin-bottom: 0;\n box-shadow: none;\n}\n.paraui-v4-notification-notice {\n padding: 16px;\n line-height: 1.5715;\n}\n.paraui-v4-notification-notice-content {\n position: relative;\n}\n.paraui-v4-notification-notice-message {\n margin-bottom: 10px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n font-weight: 700;\n line-height: 20px;\n}\n.paraui-v4-notification-notice-message-single-line-auto-margin {\n display: block;\n width: calc(264px - 100%);\n max-width: 4px;\n background-color: transparent;\n pointer-events: none;\n}\n.paraui-v4-notification-notice-message-single-line-auto-margin::before {\n display: block;\n content: \"\";\n}\n.paraui-v4-notification-notice-description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n}\n.paraui-v4-notification-notice-closable .paraui-v4-notification-notice-message {\n padding-right: 24px;\n}\n.paraui-v4-notification-notice-with-icon .paraui-v4-notification-notice-message {\n margin-bottom: 8px;\n margin-left: 24px;\n}\n.paraui-v4-notification-notice-with-icon .paraui-v4-notification-notice-description {\n margin-left: 24px;\n}\n.paraui-v4-notification-notice-without-description .paraui-v4-notification-notice-message {\n margin-bottom: 0;\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon {\n position: absolute;\n top: 0px;\n font-size: 18px;\n line-height: 24px;\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-success {\n color: rgb(19, 191, 76);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-info {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-warning {\n color: rgb(255, 147, 38);\n}\n.paraui-v4-notification .paraui-v4-notification-notice-icon-error {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-notification-notice-close {\n position: absolute;\n top: 16px;\n right: 16px;\n color: rgb(92, 101, 115);\n outline: none;\n}\n.paraui-v4-notification-notice-close:hover {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-notification .paraui-v4-notification-close-icon {\n font-size: 18px;\n cursor: pointer;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-notification .paraui-v4-notification-close-icon:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-notification-notice-btn {\n float: right;\n margin-top: 12px;\n}\n.paraui-v4-notification .notification-fade-effect {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n}\n.paraui-v4-notification-fade-enter, .paraui-v4-notification-fade-appear {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n opacity: 0;\n animation-play-state: paused;\n}\n.paraui-v4-notification-fade-leave {\n animation-duration: 0.24s;\n animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n.paraui-v4-notification-fade-enter.paraui-v4-notification-fade-enter-active, .paraui-v4-notification-fade-appear.paraui-v4-notification-fade-appear-active {\n animation-name: NotificationFadeIn;\n animation-play-state: running;\n}\n.paraui-v4-notification-fade-leave.paraui-v4-notification-fade-leave-active {\n animation-name: NotificationFadeOut;\n animation-play-state: running;\n}\n@keyframes NotificationFadeIn {\n 0% {\n left: 440px;\n opacity: 0;\n }\n 100% {\n left: 0;\n opacity: 1;\n }\n}\n@keyframes NotificationLeftFadeIn {\n 0% {\n right: 440px;\n opacity: 0;\n }\n 100% {\n right: 0;\n opacity: 1;\n }\n}\n@keyframes NotificationFadeOut {\n 0% {\n max-height: 150px;\n margin-bottom: 16px;\n opacity: 1;\n }\n 100% {\n max-height: 0;\n margin-bottom: 0;\n padding-top: 0;\n padding-bottom: 0;\n opacity: 0;\n }\n}";
|
|
15
13
|
styleInject(css_248z);
|
|
16
14
|
|
|
17
15
|
//通知框实例存储
|
|
18
|
-
|
|
16
|
+
const notificationInstance = {};
|
|
19
17
|
// 默认值
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
let defaultDuration = 5; //默认 5 秒后自动关闭,配置为 null 则不自动关闭
|
|
19
|
+
let defaultTop = 20;
|
|
20
|
+
let defaultBottom = 20;
|
|
21
|
+
let defaultLeft = 20;
|
|
22
|
+
let defaultRight = 20;
|
|
23
|
+
let defaultPlacement = 'topRight';
|
|
24
|
+
let defaultGetContainer;
|
|
25
|
+
const prefixCls = "".concat($prefixCls, "-notification");
|
|
26
|
+
let defaultCloseIcon = jsx(CloseIcon, {
|
|
29
27
|
className: "".concat(prefixCls, "-close-icon")
|
|
30
28
|
});
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const rtl = false;
|
|
30
|
+
let maxCount;
|
|
33
31
|
//设置全局配置
|
|
34
32
|
function setNotificationConfig(options) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
const {
|
|
34
|
+
duration,
|
|
35
|
+
placement,
|
|
36
|
+
bottom,
|
|
37
|
+
top,
|
|
38
|
+
left,
|
|
39
|
+
right,
|
|
40
|
+
getContainer,
|
|
41
|
+
closeIcon
|
|
42
|
+
} = options;
|
|
43
43
|
if (duration !== undefined) {
|
|
44
44
|
defaultDuration = duration;
|
|
45
45
|
}
|
|
@@ -70,38 +70,38 @@ function setNotificationConfig(options) {
|
|
|
70
70
|
}
|
|
71
71
|
//获得位置样式
|
|
72
72
|
function getPlacementStyle(placement) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
let top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTop;
|
|
74
|
+
let bottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultBottom;
|
|
75
|
+
let left = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : defaultLeft;
|
|
76
|
+
let right = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : defaultRight;
|
|
77
|
+
let style;
|
|
78
78
|
switch (placement) {
|
|
79
79
|
case 'topLeft':
|
|
80
80
|
style = {
|
|
81
|
-
left
|
|
82
|
-
top
|
|
81
|
+
left,
|
|
82
|
+
top,
|
|
83
83
|
bottom: 'auto'
|
|
84
84
|
};
|
|
85
85
|
break;
|
|
86
86
|
case 'topRight':
|
|
87
87
|
style = {
|
|
88
|
-
right
|
|
89
|
-
top
|
|
88
|
+
right,
|
|
89
|
+
top,
|
|
90
90
|
bottom: 'auto'
|
|
91
91
|
};
|
|
92
92
|
break;
|
|
93
93
|
case 'bottomLeft':
|
|
94
94
|
style = {
|
|
95
|
-
left
|
|
95
|
+
left,
|
|
96
96
|
top: 'auto',
|
|
97
|
-
bottom
|
|
97
|
+
bottom
|
|
98
98
|
};
|
|
99
99
|
break;
|
|
100
100
|
default:
|
|
101
101
|
style = {
|
|
102
|
-
right
|
|
102
|
+
right,
|
|
103
103
|
top: 'auto',
|
|
104
|
-
bottom
|
|
104
|
+
bottom
|
|
105
105
|
};
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
@@ -109,30 +109,29 @@ function getPlacementStyle(placement) {
|
|
|
109
109
|
}
|
|
110
110
|
//创建通知框实例
|
|
111
111
|
function getNotificationInstance(args, callback) {
|
|
112
|
-
|
|
113
|
-
placement =
|
|
114
|
-
top
|
|
115
|
-
bottom
|
|
116
|
-
left
|
|
117
|
-
right
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var cacheInstance = notificationInstance[cacheKey];
|
|
112
|
+
const {
|
|
113
|
+
placement = defaultPlacement,
|
|
114
|
+
top,
|
|
115
|
+
bottom,
|
|
116
|
+
left,
|
|
117
|
+
right,
|
|
118
|
+
getContainer = defaultGetContainer,
|
|
119
|
+
closeIcon = defaultCloseIcon
|
|
120
|
+
} = args;
|
|
121
|
+
const prefixCls = "".concat($prefixCls, "-notification");
|
|
122
|
+
const cacheKey = "".concat(prefixCls, "-").concat(placement);
|
|
123
|
+
const cacheInstance = notificationInstance[cacheKey];
|
|
125
124
|
if (cacheInstance) {
|
|
126
|
-
Promise.resolve(cacheInstance).then(
|
|
125
|
+
Promise.resolve(cacheInstance).then(instance => {
|
|
127
126
|
callback({
|
|
128
127
|
prefixCls: "".concat(prefixCls, "-notice"),
|
|
129
|
-
instance
|
|
128
|
+
instance
|
|
130
129
|
});
|
|
131
130
|
});
|
|
132
131
|
return;
|
|
133
132
|
}
|
|
134
133
|
//close icon
|
|
135
|
-
|
|
134
|
+
const closeIconToRender = jsx("span", Object.assign({
|
|
136
135
|
className: "".concat(prefixCls, "-close-x")
|
|
137
136
|
}, {
|
|
138
137
|
children: closeIcon || jsx(CloseIcon, {
|
|
@@ -140,16 +139,18 @@ function getNotificationInstance(args, callback) {
|
|
|
140
139
|
})
|
|
141
140
|
}));
|
|
142
141
|
//通知框cls
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
const notificationCls = clsx("".concat(prefixCls, "-").concat(placement), {
|
|
143
|
+
["".concat(prefixCls, "-rtl")]: rtl === true
|
|
144
|
+
});
|
|
145
|
+
notificationInstance[cacheKey] = new Promise(resolve => {
|
|
145
146
|
Notification.newInstance({
|
|
146
|
-
prefixCls
|
|
147
|
+
prefixCls,
|
|
147
148
|
className: notificationCls,
|
|
148
149
|
style: getPlacementStyle(placement, top, bottom, left, right),
|
|
149
|
-
getContainer
|
|
150
|
+
getContainer,
|
|
150
151
|
closeIcon: closeIconToRender,
|
|
151
|
-
maxCount
|
|
152
|
-
},
|
|
152
|
+
maxCount
|
|
153
|
+
}, notification => {
|
|
153
154
|
resolve(notification);
|
|
154
155
|
callback({
|
|
155
156
|
prefixCls: "".concat(prefixCls, "-notice"),
|
|
@@ -159,29 +160,30 @@ function getNotificationInstance(args, callback) {
|
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
162
|
//通知框类型图标
|
|
162
|
-
|
|
163
|
-
success:
|
|
163
|
+
const typeToIcon = {
|
|
164
|
+
success: SuccessOutlined,
|
|
164
165
|
info: WarningCircleF,
|
|
165
166
|
error: CloseCircleF,
|
|
166
167
|
warning: WarningCircleF
|
|
167
168
|
};
|
|
168
169
|
//创建通知框内容配置
|
|
169
170
|
function getNoticeProps(args, prefixCls) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
closeIcon =
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
const {
|
|
172
|
+
duration: durationArg,
|
|
173
|
+
icon,
|
|
174
|
+
type,
|
|
175
|
+
description,
|
|
176
|
+
message,
|
|
177
|
+
btn,
|
|
178
|
+
onClose,
|
|
179
|
+
onClick,
|
|
180
|
+
key,
|
|
181
|
+
style,
|
|
182
|
+
className,
|
|
183
|
+
closeIcon = defaultCloseIcon
|
|
184
|
+
} = args;
|
|
185
|
+
const duration = durationArg === undefined ? defaultDuration : durationArg;
|
|
186
|
+
let iconNode = null;
|
|
185
187
|
if (icon) {
|
|
186
188
|
iconNode = jsx("span", Object.assign({
|
|
187
189
|
className: "".concat(prefixCls, "-icon")
|
|
@@ -193,7 +195,7 @@ function getNoticeProps(args, prefixCls) {
|
|
|
193
195
|
className: "".concat(prefixCls, "-icon ").concat(prefixCls, "-icon-").concat(type)
|
|
194
196
|
});
|
|
195
197
|
}
|
|
196
|
-
|
|
198
|
+
const autoMarginTag = !description && iconNode ? jsx("span", {
|
|
197
199
|
className: "".concat(prefixCls, "-message-single-line-auto-margin")
|
|
198
200
|
}) : null;
|
|
199
201
|
return {
|
|
@@ -214,38 +216,40 @@ function getNoticeProps(args, prefixCls) {
|
|
|
214
216
|
children: btn
|
|
215
217
|
})) : null]
|
|
216
218
|
})),
|
|
217
|
-
duration
|
|
219
|
+
duration,
|
|
218
220
|
closable: true,
|
|
219
|
-
onClose
|
|
220
|
-
onClick
|
|
221
|
-
key
|
|
221
|
+
onClose,
|
|
222
|
+
onClick,
|
|
223
|
+
key,
|
|
222
224
|
style: style || {},
|
|
223
|
-
className: clsx(className,
|
|
224
|
-
|
|
225
|
+
className: clsx(className, {
|
|
226
|
+
["".concat(prefixCls, "-").concat(type)]: !!type
|
|
227
|
+
}),
|
|
228
|
+
closeIcon
|
|
225
229
|
};
|
|
226
230
|
}
|
|
227
231
|
//通知框调用方法
|
|
228
232
|
function notice(args) {
|
|
229
|
-
getNotificationInstance(args,
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
getNotificationInstance(args, _ref => {
|
|
234
|
+
let {
|
|
235
|
+
prefixCls,
|
|
236
|
+
instance
|
|
237
|
+
} = _ref;
|
|
232
238
|
instance.notice(getNoticeProps(args, prefixCls));
|
|
233
239
|
});
|
|
234
240
|
}
|
|
235
241
|
//通知框api method
|
|
236
|
-
|
|
242
|
+
const api = {
|
|
237
243
|
open: notice,
|
|
238
|
-
close
|
|
239
|
-
Object.keys(notificationInstance).forEach(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
+
close(key) {
|
|
245
|
+
Object.keys(notificationInstance).forEach(cacheKey => Promise.resolve(notificationInstance[cacheKey]).then(instance => {
|
|
246
|
+
instance.removeNotice(key);
|
|
247
|
+
}));
|
|
244
248
|
},
|
|
245
249
|
config: setNotificationConfig,
|
|
246
|
-
destroy
|
|
247
|
-
Object.keys(notificationInstance).forEach(
|
|
248
|
-
Promise.resolve(notificationInstance[cacheKey]).then(
|
|
250
|
+
destroy() {
|
|
251
|
+
Object.keys(notificationInstance).forEach(cacheKey => {
|
|
252
|
+
Promise.resolve(notificationInstance[cacheKey]).then(instance => {
|
|
249
253
|
instance.destroy();
|
|
250
254
|
});
|
|
251
255
|
delete notificationInstance[cacheKey];
|
|
@@ -253,12 +257,10 @@ var api = {
|
|
|
253
257
|
}
|
|
254
258
|
};
|
|
255
259
|
//通知框预设类型 'success', 'info', 'warning', 'error'
|
|
256
|
-
['success', 'info', 'warning', 'error'].forEach(
|
|
257
|
-
api[type] =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}));
|
|
261
|
-
};
|
|
260
|
+
['success', 'info', 'warning', 'error'].forEach(type => {
|
|
261
|
+
api[type] = args => api.open(Object.assign(Object.assign({}, args), {
|
|
262
|
+
type
|
|
263
|
+
}));
|
|
262
264
|
});
|
|
263
265
|
//兼容warn、warning
|
|
264
266
|
api.warn = api.warning;
|
package/OperateBtn/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @description 表格操作按钮
|
|
5
5
|
*/
|
|
6
6
|
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import { PopConfirmProps } from '../PopConfirm';
|
|
7
8
|
import './index.scss';
|
|
8
9
|
/** 按钮配置 */
|
|
9
10
|
export interface OperateBtnListProps {
|
|
@@ -27,6 +28,8 @@ export interface OperateBtnListProps {
|
|
|
27
28
|
danger?: boolean;
|
|
28
29
|
/** 点击事件 */
|
|
29
30
|
onClick?: (item: OperateBtnListProps, e: any) => void | Promise<boolean | any>;
|
|
31
|
+
/** 气泡确认框参数 */
|
|
32
|
+
popConfirmProps?: PopConfirmProps;
|
|
30
33
|
[name: string]: any;
|
|
31
34
|
}
|
|
32
35
|
export interface OperateBtnProps {
|
package/OperateBtn/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
|
-
import { r as regenerator } from '../_verture/index-232d890b.js';
|
|
3
1
|
import { a as __awaiter } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
2
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
5
3
|
import { useState, Fragment } from 'react';
|
|
@@ -7,25 +5,27 @@ import More from '@para-ui/icons/More';
|
|
|
7
5
|
import { Button } from '../Button/index.js';
|
|
8
6
|
import { Tooltip } from '../Tooltip/index.js';
|
|
9
7
|
import { Popover } from '../Popover/index.js';
|
|
8
|
+
import { PopConfirm } from '../PopConfirm/index.js';
|
|
10
9
|
import AutoTips from '../AutoTips/index.js';
|
|
11
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
12
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
10
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
11
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
13
12
|
import clsx from 'clsx';
|
|
14
13
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
15
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
16
|
-
import '../_verture/typeof-c310ee4a.js';
|
|
17
|
-
import '../_verture/typeof-adeedc13.js';
|
|
18
14
|
import '@para-ui/icons/LoadingF';
|
|
19
15
|
import '@para-ui/icons/Down';
|
|
20
|
-
import '../_verture/index-
|
|
16
|
+
import '../_verture/index-da9097d3.js';
|
|
21
17
|
import 'rc-dropdown';
|
|
22
|
-
import '../_verture/usePopupContainer-
|
|
18
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
23
19
|
import 'dayjs';
|
|
24
20
|
import '@paraview/lib';
|
|
25
21
|
import 'rc-tooltip';
|
|
26
22
|
import 'rc-tooltip/lib/placements';
|
|
27
23
|
import '@para-ui/icons/Forbid';
|
|
28
24
|
import '@para-ui/core/GlobalContext';
|
|
25
|
+
import '@para-ui/icons/CheckCircleF';
|
|
26
|
+
import '@para-ui/icons/WarningCircle';
|
|
27
|
+
import '@para-ui/icons/CloseCircleF';
|
|
28
|
+
import '@para-ui/icons/WarningCircleF';
|
|
29
29
|
|
|
30
30
|
var en = {
|
|
31
31
|
more: 'more'
|
|
@@ -36,103 +36,64 @@ var zh = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
var localeJson = {
|
|
39
|
-
zh
|
|
40
|
-
en
|
|
39
|
+
zh,
|
|
40
|
+
en
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2022/4/13 10:48 AM\n* @description 表格操作按钮\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-operate-btn {\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 align-items: center;\n}\n.paraui-v4-operate-btn > .operate-btn-line {\n display: inline-block;\n width: 1px;\n background-color: rgb(213, 224, 250);\n margin: 0 10px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-small > .operate-btn-line {\n height: 12px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-small button svg {\n font-size: 18px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-medium > .operate-btn-line {\n height: 12px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-medium button svg {\n font-size: 18px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-large > .operate-btn-line {\n height: 12px;\n}\n.paraui-v4-operate-btn.paraui-v4-operate-btn-large button svg {\n font-size: 18px;\n}\n\n.paraui-v4-operate-btn-popover .operate-btn-list {\n padding: 4px 0;\n}\n.paraui-v4-operate-btn-popover .operate-btn-list > .operate-btn-list-item {\n padding: 0 10px;\n max-width: 120px;\n cursor: pointer;\n color: rgb(29, 33, 38);\n line-height: 30px;\n text-align: left;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-v4-operate-btn-popover .operate-btn-list > .operate-btn-list-item:hover {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-operate-btn-popover .operate-btn-list > .operate-btn-list-item-disabled {\n cursor: not-allowed;\n color: rgb(161, 168, 179);\n}\n.paraui-v4-operate-btn-popover .operate-btn-list > .operate-btn-list-item-disabled:hover {\n background-color: white;\n}\n.paraui-v4-operate-btn-popover .operate-btn-list > .operate-btn-list-item-danger {\n color: rgb(244, 66, 66);\n}";
|
|
44
44
|
styleInject(css_248z);
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className =
|
|
49
|
-
style
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick = props.onClick,
|
|
61
|
-
loadingMapping = props.loadingMapping,
|
|
62
|
-
_props$key = props.key,
|
|
63
|
-
key = _props$key === void 0 ? 'key' : _props$key;
|
|
46
|
+
const OperateBtn = props => {
|
|
47
|
+
const {
|
|
48
|
+
className = '',
|
|
49
|
+
style,
|
|
50
|
+
size = 'small',
|
|
51
|
+
list,
|
|
52
|
+
showNum = 3,
|
|
53
|
+
popoverClassName,
|
|
54
|
+
placement = 'bottom-end',
|
|
55
|
+
clickCloseMore = true,
|
|
56
|
+
onClick,
|
|
57
|
+
loadingMapping,
|
|
58
|
+
key = 'key'
|
|
59
|
+
} = props;
|
|
64
60
|
useFormatMessage('OperateBtn', localeJson);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
openMoreCom = _useState2[0],
|
|
68
|
-
setOpenMoreCom = _useState2[1]; // 显示更多
|
|
69
|
-
var _useState3 = useState({}),
|
|
70
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
|
-
loadingInside = _useState4[0],
|
|
72
|
-
setLoadingInside = _useState4[1]; // 内部loading
|
|
61
|
+
const [openMoreCom, setOpenMoreCom] = useState(false); // 显示更多
|
|
62
|
+
const [loadingInside, setLoadingInside] = useState({}); // 内部loading
|
|
73
63
|
// 点击选项
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_context.next = 9;
|
|
99
|
-
return item.onClick(item, e);
|
|
100
|
-
case 9:
|
|
101
|
-
result = _context.sent;
|
|
102
|
-
_context.next = 16;
|
|
103
|
-
break;
|
|
104
|
-
case 12:
|
|
105
|
-
if (!onClick) {
|
|
106
|
-
_context.next = 16;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
_context.next = 15;
|
|
110
|
-
return onClick(item, e);
|
|
111
|
-
case 15:
|
|
112
|
-
result = _context.sent;
|
|
113
|
-
case 16:
|
|
114
|
-
// 不存在外部loading
|
|
115
|
-
if (loading === undefined) {
|
|
116
|
-
loadingInside[index] = result;
|
|
117
|
-
setLoadingInside(Object.assign({}, loadingInside));
|
|
118
|
-
}
|
|
119
|
-
case 17:
|
|
120
|
-
case "end":
|
|
121
|
-
return _context.stop();
|
|
122
|
-
}
|
|
123
|
-
}, _callee);
|
|
124
|
-
}));
|
|
125
|
-
};
|
|
126
|
-
};
|
|
64
|
+
const clickItem = (item, index) => e => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
if (item.disabled || handLoadStatus(item, index)) return;
|
|
66
|
+
if (clickCloseMore) closeMore();
|
|
67
|
+
const handKey = item[key];
|
|
68
|
+
const loading = loadingMapping && loadingMapping[handKey];
|
|
69
|
+
// 不存在外部loading
|
|
70
|
+
if (loading === undefined) {
|
|
71
|
+
loadingInside[index] = true;
|
|
72
|
+
setLoadingInside(Object.assign({}, loadingInside));
|
|
73
|
+
}
|
|
74
|
+
let result;
|
|
75
|
+
if (item.onClick) {
|
|
76
|
+
result = yield item.onClick(item, e);
|
|
77
|
+
} else {
|
|
78
|
+
if (onClick) {
|
|
79
|
+
result = yield onClick(item, e);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// 不存在外部loading
|
|
83
|
+
if (loading === undefined) {
|
|
84
|
+
loadingInside[index] = result;
|
|
85
|
+
setLoadingInside(Object.assign({}, loadingInside));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
127
88
|
// 关闭显示更多
|
|
128
|
-
|
|
89
|
+
const closeMore = bol => {
|
|
129
90
|
//if (bol) return;
|
|
130
91
|
setOpenMoreCom(Boolean(bol));
|
|
131
92
|
};
|
|
132
93
|
// 处理loading
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
94
|
+
const handLoadStatus = (item, index) => {
|
|
95
|
+
let loading;
|
|
96
|
+
const handKey = item[key];
|
|
136
97
|
loading = loadingMapping && loadingMapping[handKey];
|
|
137
98
|
// 外部没有传laoding
|
|
138
99
|
if (loading === undefined) {
|
|
@@ -141,20 +102,29 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
141
102
|
return loading;
|
|
142
103
|
};
|
|
143
104
|
// 处理handClassPopover
|
|
144
|
-
|
|
145
|
-
|
|
105
|
+
const handClassPopover = () => {
|
|
106
|
+
let str = "".concat($prefixCls, "-operate-btn-popover");
|
|
146
107
|
if (popoverClassName) str += " ".concat(popoverClassName);
|
|
147
108
|
return str;
|
|
148
109
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
110
|
+
// 处理PopConfirm内容
|
|
111
|
+
const handlePopConfirm = (item, children) => {
|
|
112
|
+
if (item.popConfirmProps) {
|
|
113
|
+
return jsx(PopConfirm, Object.assign({}, item.popConfirmProps, {
|
|
114
|
+
children: children
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
return children;
|
|
118
|
+
};
|
|
119
|
+
const morePopoverContent = () => {
|
|
120
|
+
const arr = (list === null || list === void 0 ? void 0 : list.slice(showNum, list === null || list === void 0 ? void 0 : list.length)) || [];
|
|
121
|
+
const handPopoverClass = item => {
|
|
152
122
|
return clsx('operate-btn-list-item', item.className, {
|
|
153
123
|
'operate-btn-list-item-disabled': item.disabled,
|
|
154
124
|
'operate-btn-list-item-danger': item.danger
|
|
155
125
|
});
|
|
156
126
|
};
|
|
157
|
-
|
|
127
|
+
const handleBox = (item, children, index) => {
|
|
158
128
|
return jsx("div", Object.assign({
|
|
159
129
|
className: handPopoverClass(item),
|
|
160
130
|
onClick: clickItem(item, index + showNum),
|
|
@@ -166,7 +136,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
166
136
|
return jsx("div", Object.assign({
|
|
167
137
|
className: "operate-btn-list"
|
|
168
138
|
}, {
|
|
169
|
-
children: arr.map(
|
|
139
|
+
children: arr.map((item, index) => {
|
|
170
140
|
if (item.disabled) {
|
|
171
141
|
return jsx(Tooltip, Object.assign({
|
|
172
142
|
disabled: true,
|
|
@@ -175,16 +145,16 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
175
145
|
children: handleBox(item, item.label || item.toolTipTitle, index)
|
|
176
146
|
}), index);
|
|
177
147
|
}
|
|
178
|
-
return handleBox(item, jsx(AutoTips, Object.assign({
|
|
148
|
+
return handlePopConfirm(item, handleBox(item, jsx(AutoTips, Object.assign({
|
|
179
149
|
tipMaxWidth: 'none'
|
|
180
150
|
}, {
|
|
181
151
|
children: item.label || item.toolTipTitle
|
|
182
|
-
})), index);
|
|
152
|
+
})), index));
|
|
183
153
|
})
|
|
184
154
|
}));
|
|
185
155
|
};
|
|
186
156
|
// 更多按钮
|
|
187
|
-
|
|
157
|
+
const moreRender = () => {
|
|
188
158
|
return jsx(Fragment$1, {
|
|
189
159
|
children: list && list.length > showNum + 1 && jsx(Popover, Object.assign({
|
|
190
160
|
placement: "bottom-end",
|
|
@@ -213,8 +183,8 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
213
183
|
className: clsx("".concat($prefixCls, "-operate-btn"), className, "".concat($prefixCls, "-operate-btn-").concat(size)),
|
|
214
184
|
style: style
|
|
215
185
|
}, {
|
|
216
|
-
children: [list === null || list === void 0 ? void 0 : list.map(
|
|
217
|
-
|
|
186
|
+
children: [list === null || list === void 0 ? void 0 : list.map((item, index) => {
|
|
187
|
+
let bol = true;
|
|
218
188
|
// 满足这个条件,有更多按钮
|
|
219
189
|
if (list.length > showNum + 1) {
|
|
220
190
|
// 超出显示个数不显示
|
|
@@ -243,7 +213,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
243
213
|
danger: item.danger,
|
|
244
214
|
onClick: clickItem(item, index)
|
|
245
215
|
}, {
|
|
246
|
-
children: item.icon
|
|
216
|
+
children: handlePopConfirm(item, item.icon)
|
|
247
217
|
})), bol && jsx("span", {
|
|
248
218
|
className: 'operate-btn-line'
|
|
249
219
|
})]
|