@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/PasswordRules/index.js
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useState, useEffect } from 'react';
|
|
4
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
3
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
5
4
|
import CloseCircleF from '@para-ui/icons/CloseCircleF';
|
|
6
|
-
import
|
|
5
|
+
import SuccessOutlined from '@para-ui/icons/CheckCircleF';
|
|
7
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
9
7
|
|
|
10
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-password-rules {\n padding: 16px;\n line-height: 1.43;\n}\n.paraui-v4-password-rules > .password-rules-item:first-child > .password-rules-item-title {\n margin-top: 0px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n font-weight: 700;\n margin-bottom: 6px;\n margin-top: 10px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail {\n display: flex;\n margin-bottom: 6px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail:last-child {\n margin-bottom: 0;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail > .item-flag {\n min-width: 26px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail > .item-label {\n flex: 1;\n font-size: 14px;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-icon > .item-flag {\n margin-top: 0px;\n line-height: 1;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-icon > .item-flag svg {\n font-size: 18px;\n color: rgb(161, 168, 179);\n position: relative;\n top: 1px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-order {\n font-size: 14px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-order > .item-flag {\n margin-top: -1px;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-success.rules-item-detail-icon > .item-flag svg {\n color: rgb(19, 191, 76);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-error.rules-item-detail-order > .item-flag {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-error.rules-item-detail-order > .item-label {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-password-rules.paraui-v4-password-rules-box-shadow {\n box-shadow:
|
|
8
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 文字隐藏...\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-password-rules {\n padding: 16px;\n line-height: 1.43;\n}\n.paraui-v4-password-rules > .password-rules-item:first-child > .password-rules-item-title {\n margin-top: 0px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-title {\n font-size: 14px;\n color: rgb(29, 33, 38);\n font-weight: 700;\n margin-bottom: 6px;\n margin-top: 10px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail {\n display: flex;\n margin-bottom: 6px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail:last-child {\n margin-bottom: 0;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail > .item-flag {\n min-width: 26px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail > .item-label {\n flex: 1;\n font-size: 14px;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-icon > .item-flag {\n margin-top: 0px;\n line-height: 1;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-icon > .item-flag svg {\n font-size: 18px;\n color: rgb(161, 168, 179);\n position: relative;\n top: 1px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-order {\n font-size: 14px;\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-order > .item-flag {\n margin-top: -1px;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-success.rules-item-detail-icon > .item-flag svg {\n color: rgb(19, 191, 76);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-error.rules-item-detail-order > .item-flag {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-password-rules > .password-rules-item > .password-rules-item-content > .rules-item-detail.rules-item-detail-error.rules-item-detail-order > .item-label {\n color: rgb(244, 66, 66);\n}\n.paraui-v4-password-rules.paraui-v4-password-rules-box-shadow {\n box-shadow: 1px 1px 10px 2px rgba(212, 218, 227, 0.4);\n border-radius: 4px;\n}";
|
|
11
9
|
styleInject(css_248z);
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
boxShadow =
|
|
18
|
-
value
|
|
19
|
-
config
|
|
20
|
-
onCheckAll
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var list = item.list || [];
|
|
31
|
-
list.forEach(function (listItem) {
|
|
11
|
+
const PasswordRules = props => {
|
|
12
|
+
const {
|
|
13
|
+
className,
|
|
14
|
+
style,
|
|
15
|
+
boxShadow = false,
|
|
16
|
+
value,
|
|
17
|
+
config,
|
|
18
|
+
onCheckAll
|
|
19
|
+
} = props;
|
|
20
|
+
const [configCom, setConfigCom] = useState([]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
let bol = undefined;
|
|
23
|
+
const obj = {};
|
|
24
|
+
const configHand = handConfig();
|
|
25
|
+
configHand.forEach(item => {
|
|
26
|
+
const list = item.list || [];
|
|
27
|
+
list.forEach(listItem => {
|
|
32
28
|
// 判断校验
|
|
33
|
-
|
|
29
|
+
let result;
|
|
34
30
|
if (value !== undefined) {
|
|
35
31
|
// 正则
|
|
36
32
|
if (listItem.reg) {
|
|
@@ -59,33 +55,33 @@ var PasswordRules = function PasswordRules(props) {
|
|
|
59
55
|
}
|
|
60
56
|
onCheckAll && onCheckAll(bol);
|
|
61
57
|
}, [value, config, onCheckAll]);
|
|
62
|
-
|
|
58
|
+
const handConfig = () => {
|
|
63
59
|
if (!config) return [];
|
|
64
60
|
return config instanceof Array ? config : [config];
|
|
65
61
|
};
|
|
66
62
|
/** 处理每一项 */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
const handContentItem = item => {
|
|
64
|
+
const list = item.list || [];
|
|
65
|
+
const type = item.type || 'icon';
|
|
66
|
+
const handRuleItem = (listItem, inx) => {
|
|
71
67
|
// 判断校验
|
|
72
|
-
|
|
68
|
+
const result = listItem.result;
|
|
73
69
|
// 处理标志
|
|
74
|
-
|
|
70
|
+
const handFlag = () => {
|
|
75
71
|
if (type === 'order') {
|
|
76
72
|
return "".concat(inx + 1, "\u3001");
|
|
77
73
|
}
|
|
78
|
-
if (result === true) return jsx(
|
|
74
|
+
if (result === true) return jsx(SuccessOutlined, {}); // 成功
|
|
79
75
|
return jsx(CloseCircleF, {});
|
|
80
76
|
};
|
|
81
77
|
// 处理内容
|
|
82
|
-
|
|
78
|
+
const handLabel = () => {
|
|
83
79
|
if (typeof result !== 'boolean' && result) return result;
|
|
84
80
|
return listItem.label;
|
|
85
81
|
};
|
|
86
82
|
// 处理样式
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const handClassRulesItem = () => {
|
|
84
|
+
let str = 'rules-item-detail';
|
|
89
85
|
str += " rules-item-detail-".concat(type);
|
|
90
86
|
if (typeof result === 'boolean' && result) {
|
|
91
87
|
str += ' rules-item-detail-success';
|
|
@@ -111,14 +107,14 @@ var PasswordRules = function PasswordRules(props) {
|
|
|
111
107
|
return jsx("div", Object.assign({
|
|
112
108
|
className: "password-rules-item-content"
|
|
113
109
|
}, {
|
|
114
|
-
children: list.map(
|
|
110
|
+
children: list.map((listItem, index) => {
|
|
115
111
|
return handRuleItem(listItem, index);
|
|
116
112
|
})
|
|
117
113
|
}));
|
|
118
114
|
};
|
|
119
115
|
/** 处理className */
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
const handClass = () => {
|
|
117
|
+
let str = "".concat($prefixCls, "-password-rules");
|
|
122
118
|
if (className) str += " ".concat(className);
|
|
123
119
|
if (boxShadow) str += " ".concat($prefixCls, "-password-rules-box-shadow");
|
|
124
120
|
return str;
|
|
@@ -127,7 +123,7 @@ var PasswordRules = function PasswordRules(props) {
|
|
|
127
123
|
className: handClass(),
|
|
128
124
|
style: style
|
|
129
125
|
}, {
|
|
130
|
-
children: configCom.map(
|
|
126
|
+
children: configCom.map((item, index) => {
|
|
131
127
|
return jsxs("div", Object.assign({
|
|
132
128
|
className: 'password-rules-item'
|
|
133
129
|
}, {
|
package/PopConfirm/index.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
1
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
3
|
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
5
|
-
import
|
|
4
|
+
import SuccessOutlined from '@para-ui/icons/CheckCircleF';
|
|
6
5
|
import InfoOutlined from '@para-ui/icons/WarningCircle';
|
|
7
6
|
import CloseCircleF from '@para-ui/icons/CloseCircleF';
|
|
8
7
|
import WarningCircleF from '@para-ui/icons/WarningCircleF';
|
|
9
8
|
import { Button } from '../Button/index.js';
|
|
10
9
|
import { Tooltip } from '../Tooltip/index.js';
|
|
11
10
|
import clsx from 'clsx';
|
|
12
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
13
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
14
|
-
import { u as usePopupContainer } from '../_verture/usePopupContainer-
|
|
11
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
12
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
13
|
+
import { u as usePopupContainer } from '../_verture/usePopupContainer-635f66f4.js';
|
|
15
14
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
16
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
17
|
-
import '../_verture/typeof-adeedc13.js';
|
|
18
15
|
import '@para-ui/icons/LoadingF';
|
|
19
16
|
import '@para-ui/icons/Down';
|
|
20
|
-
import '../_verture/index-
|
|
17
|
+
import '../_verture/index-da9097d3.js';
|
|
21
18
|
import 'rc-dropdown';
|
|
22
19
|
import 'dayjs';
|
|
23
20
|
import '@paraview/lib';
|
|
@@ -33,87 +30,73 @@ var en = {
|
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
var zh = {
|
|
36
|
-
cancel: '
|
|
37
|
-
ok: '
|
|
33
|
+
cancel: '取 消',
|
|
34
|
+
ok: '确 认'
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
var localeJson = {
|
|
41
|
-
zh
|
|
42
|
-
en
|
|
38
|
+
zh,
|
|
39
|
+
en
|
|
43
40
|
};
|
|
44
41
|
|
|
45
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/2 下午1:44\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-popconfirm.paraui-v4-tooltip {\n position: absolute;\n width: 440px;\n padding: 0;\n font-size: 14px;\n color: initial;\n background-color: rgb(255, 255, 255);\n box-shadow:
|
|
42
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/2 下午1:44\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-popconfirm.paraui-v4-tooltip {\n position: absolute;\n width: 440px;\n padding: 0;\n font-size: 14px;\n color: initial;\n background-color: rgb(255, 255, 255);\n box-shadow: 1px 1px 10px 2px rgba(212, 218, 227, 0.4);\n border-radius: 8px;\n border: 1px solid rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-popconfirm.paraui-v4-tooltip .component-tooltip-inner {\n padding: 0;\n color: initial;\n background-color: transparent;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper {\n padding: 16px;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message {\n position: relative;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-icon {\n position: absolute;\n top: 1px;\n color: rgb(255, 147, 38);\n line-height: 0;\n font-size: 18px;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-icon svg {\n color: inherit;\n font-size: inherit;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-body {\n padding-left: 24px;\n line-height: 20px;\n font-size: 14px;\n color: rgb(29, 33, 38);\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-title {\n font-weight: 600;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-content {\n font-weight: 400;\n margin-top: 8px;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-content.without-title {\n margin-top: 0;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-description {\n margin-top: 4px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-message-description.without-title-or-content {\n margin-top: 0;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-btns {\n margin-top: 12px;\n text-align: right;\n}\n.paraui-v4-popconfirm .popconfirm-wrapper .popconfirm-btns > button + button {\n margin-left: 12px;\n}\n.paraui-v4-popconfirm .paraui-v4-popconfirm-btn {\n min-width: 54px;\n}";
|
|
46
43
|
styleInject(css_248z);
|
|
47
44
|
|
|
48
45
|
//图标
|
|
49
|
-
|
|
50
|
-
success: jsx(
|
|
46
|
+
const iconMapping = {
|
|
47
|
+
success: jsx(SuccessOutlined, {}),
|
|
51
48
|
warning: jsx(WarningCircleF, {}),
|
|
52
49
|
error: jsx(CloseCircleF, {}),
|
|
53
50
|
info: jsx(InfoOutlined, {})
|
|
54
51
|
};
|
|
55
52
|
//popConfirm
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
_props$countdownTime = props.countdownTime,
|
|
88
|
-
countdownTime = _props$countdownTime === void 0 ? 5 : _props$countdownTime,
|
|
89
|
-
actions = props.actions,
|
|
90
|
-
onClose = props.onClose,
|
|
91
|
-
onCountdownFinish = props.onCountdownFinish,
|
|
92
|
-
customizeContainer = props.getPopupContainer,
|
|
53
|
+
const PopConfirm = props => {
|
|
54
|
+
const {
|
|
55
|
+
trigger = 'click',
|
|
56
|
+
type = 'warning',
|
|
57
|
+
title,
|
|
58
|
+
content,
|
|
59
|
+
description,
|
|
60
|
+
icon,
|
|
61
|
+
okText,
|
|
62
|
+
cancelText,
|
|
63
|
+
onOk,
|
|
64
|
+
onCancel,
|
|
65
|
+
okButtonProps,
|
|
66
|
+
cancelButtonProps,
|
|
67
|
+
placement = 'top-start',
|
|
68
|
+
className,
|
|
69
|
+
overlayClassName,
|
|
70
|
+
style,
|
|
71
|
+
children,
|
|
72
|
+
open = false,
|
|
73
|
+
controllable = false,
|
|
74
|
+
showCancel = true,
|
|
75
|
+
bubble = true,
|
|
76
|
+
okButtonDanger,
|
|
77
|
+
countdown,
|
|
78
|
+
countdownTime = 5,
|
|
79
|
+
actions,
|
|
80
|
+
onClose,
|
|
81
|
+
onCountdownFinish,
|
|
82
|
+
getPopupContainer: customizeContainer
|
|
83
|
+
} = props,
|
|
93
84
|
restProps = __rest(props, ["trigger", "type", "title", "content", "description", "icon", "okText", "cancelText", "onOk", "onCancel", "okButtonProps", "cancelButtonProps", "placement", "className", "overlayClassName", "style", "children", "open", "controllable", "showCancel", "bubble", "okButtonDanger", "countdown", "countdownTime", "actions", "onClose", "onCountdownFinish", "getPopupContainer"]);
|
|
94
|
-
|
|
85
|
+
const intl = useFormatMessage('PopConfirm', localeJson);
|
|
95
86
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
const wrapRef = useRef();
|
|
88
|
+
const getPopupContainer = usePopupContainer(wrapRef, customizeContainer);
|
|
98
89
|
//打开
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var _useState3 = useState(countdownTime),
|
|
105
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
106
|
-
inCountdownTime = _useState4[0],
|
|
107
|
-
setInCountdownTime = _useState4[1];
|
|
108
|
-
var isCountting = useMemo(function () {
|
|
109
|
-
return countdown && inCountdownTime >= 1;
|
|
110
|
-
}, [countdown, inCountdownTime]);
|
|
111
|
-
useEffect(function () {
|
|
90
|
+
const [inOpen, setInOpen] = useState(false);
|
|
91
|
+
const countdownTimer = useRef();
|
|
92
|
+
const [inCountdownTime, setInCountdownTime] = useState(countdownTime);
|
|
93
|
+
const isCountting = useMemo(() => countdown && inCountdownTime >= 1, [countdown, inCountdownTime]);
|
|
94
|
+
useEffect(() => {
|
|
112
95
|
if (countdown) {
|
|
113
96
|
if (inOpen) {
|
|
114
97
|
setInCountdownTime(countdownTime);
|
|
115
|
-
countdownTimer.current = setInterval(
|
|
116
|
-
setInCountdownTime(
|
|
98
|
+
countdownTimer.current = setInterval(() => {
|
|
99
|
+
setInCountdownTime(pre => {
|
|
117
100
|
if (pre <= 1) {
|
|
118
101
|
onCountdownFinish === null || onCountdownFinish === void 0 ? void 0 : onCountdownFinish();
|
|
119
102
|
clearInterval(countdownTimer.current);
|
|
@@ -126,29 +109,29 @@ var PopConfirm = function PopConfirm(props) {
|
|
|
126
109
|
clearInterval(countdownTimer.current);
|
|
127
110
|
}
|
|
128
111
|
}
|
|
129
|
-
return
|
|
112
|
+
return () => {
|
|
130
113
|
clearInterval(countdownTimer.current);
|
|
131
114
|
};
|
|
132
115
|
}, [inOpen, countdown]);
|
|
133
116
|
//取消
|
|
134
|
-
|
|
117
|
+
const handleCancel = () => {
|
|
135
118
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
136
119
|
handleClose();
|
|
137
120
|
};
|
|
138
121
|
//确认
|
|
139
|
-
|
|
122
|
+
const handleOk = () => {
|
|
140
123
|
onOk === null || onOk === void 0 ? void 0 : onOk();
|
|
141
124
|
handleClose();
|
|
142
125
|
};
|
|
143
126
|
//关闭
|
|
144
|
-
|
|
127
|
+
const handleClose = () => {
|
|
145
128
|
if (!controllable) {
|
|
146
129
|
setInOpen(false);
|
|
147
130
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
148
131
|
}
|
|
149
132
|
};
|
|
150
133
|
//tooltip vis
|
|
151
|
-
|
|
134
|
+
const onVisibleChange = vis => {
|
|
152
135
|
if (!controllable) {
|
|
153
136
|
setInOpen(vis);
|
|
154
137
|
if (!vis) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
@@ -156,12 +139,12 @@ var PopConfirm = function PopConfirm(props) {
|
|
|
156
139
|
if (open) onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
157
140
|
}
|
|
158
141
|
};
|
|
159
|
-
useEffect(
|
|
142
|
+
useEffect(() => {
|
|
160
143
|
controllable && setInOpen(open);
|
|
161
144
|
}, [open]);
|
|
162
145
|
//渲染内容
|
|
163
|
-
|
|
164
|
-
|
|
146
|
+
const renderOverlay = () => {
|
|
147
|
+
const btns = jsxs(Fragment, {
|
|
165
148
|
children: [showCancel && jsx(Button, Object.assign({
|
|
166
149
|
className: "".concat($prefixCls, "-popconfirm-btn"),
|
|
167
150
|
onClick: handleCancel,
|
|
@@ -188,7 +171,7 @@ var PopConfirm = function PopConfirm(props) {
|
|
|
188
171
|
return jsxs("div", Object.assign({
|
|
189
172
|
className: clsx('popconfirm-wrapper'),
|
|
190
173
|
style: style,
|
|
191
|
-
onClick:
|
|
174
|
+
onClick: evt => {
|
|
192
175
|
if (!bubble) evt.stopPropagation();
|
|
193
176
|
}
|
|
194
177
|
}, {
|
package/Popover/index.js
CHANGED
|
@@ -2,28 +2,28 @@ import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
4
|
import { Tooltip } from '../Tooltip/index.js';
|
|
5
|
-
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-
|
|
6
|
-
import { u as usePopupContainer } from '../_verture/usePopupContainer-
|
|
5
|
+
import { $ as $prefixCls, a as $rcPrefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
|
+
import { u as usePopupContainer } from '../_verture/usePopupContainer-635f66f4.js';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
10
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
9
|
import 'rc-tooltip';
|
|
12
10
|
import 'rc-tooltip/lib/placements';
|
|
13
11
|
import '@para-ui/icons/Forbid';
|
|
14
12
|
|
|
15
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/7 上午11:06\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-popover {\n color: rgb(29, 33, 38);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5715;\n list-style: none;\n font-feature-settings: \"tnum\";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1500;\n font-weight: 400;\n white-space: normal;\n text-align: left;\n cursor: auto;\n user-select: text;\n}\n.paraui-v4-popover::after {\n position: absolute;\n content: \"\";\n}\n.paraui-v4-popover.component-popover-hidden {\n display: none;\n}\n.paraui-v4-popover .component-popover-inner {\n background-color: rgb(255, 255, 255);\n background-clip: padding-box;\n border-radius: 4px;\n box-shadow:
|
|
13
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/7 上午11:06\n* @description\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-popover {\n color: rgb(29, 33, 38);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5715;\n list-style: none;\n font-feature-settings: \"tnum\";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1500;\n font-weight: 400;\n white-space: normal;\n text-align: left;\n cursor: auto;\n user-select: text;\n}\n.paraui-v4-popover::after {\n position: absolute;\n content: \"\";\n}\n.paraui-v4-popover.component-popover-hidden {\n display: none;\n}\n.paraui-v4-popover .component-popover-inner {\n background-color: rgb(255, 255, 255);\n background-clip: padding-box;\n border-radius: 4px;\n box-shadow: 1px 1px 10px 2px rgba(212, 218, 227, 0.4);\n border: 1px solid rgba(212, 218, 227, 0.4);\n}\n.paraui-v4-popover .component-popover-title {\n margin: 0;\n padding: 0 24px;\n color: rgb(29, 33, 38);\n font-weight: 700;\n border-bottom: 1px solid #f0f0f0;\n min-height: 44px;\n display: flex;\n align-items: center;\n}\n.paraui-v4-popover .component-popover-inner-content {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-popover .component-popover-buttons {\n margin-bottom: 4px;\n text-align: right;\n}\n.paraui-v4-popover .component-popover-buttons button {\n margin-left: 8px;\n}\n.paraui-v4-popover .component-popover-arrow {\n position: absolute;\n display: none;\n width: 16px;\n height: 16px;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n}\n.paraui-v4-popover .component-popover-arrow-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: 11.3137085px;\n height: 11.3137085px;\n margin: auto;\n background-color: rgb(255, 255, 255);\n content: \"\";\n border-radius: 0 0 4px;\n pointer-events: none;\n}\n.paraui-v4-popover .component-popover-arrow-content::before {\n position: absolute;\n top: -11.3137085px;\n left: -11.3137085px;\n width: 33.9411255px;\n height: 33.9411255px;\n background: rgb(255, 255, 255) -10px -10px no-repeat;\n content: \"\";\n -webkit-clip-path: path(\"M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z\");\n}\n.paraui-v4-popover.component-popover-placement-top .component-popover-arrow, .paraui-v4-popover.component-popover-placement-topLeft .component-popover-arrow, .paraui-v4-popover.component-popover-placement-topRight .component-popover-arrow {\n bottom: -0.6862915px;\n}\n.paraui-v4-popover.component-popover-placement-top .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-topLeft .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-topRight .component-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateY(-1px) rotate(45deg);\n}\n.paraui-v4-popover.component-popover-placement-top .component-popover-arrow {\n left: 50%;\n transform: translateX(-50%);\n}\n.paraui-v4-popover.component-popover-placement-topLeft .component-popover-arrow {\n left: 16px;\n}\n.paraui-v4-popover.component-popover-placement-topRight .component-popover-arrow {\n right: 16px;\n}\n.paraui-v4-popover.component-popover-placement-right .component-popover-arrow, .paraui-v4-popover.component-popover-placement-rightTop .component-popover-arrow, .paraui-v4-popover.component-popover-placement-rightBottom .component-popover-arrow {\n left: -0.6862915px;\n}\n.paraui-v4-popover.component-popover-placement-right .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-rightTop .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-rightBottom .component-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(1px) rotate(135deg);\n}\n.paraui-v4-popover.component-popover-placement-right .component-popover-arrow {\n top: 50%;\n transform: translateY(-50%);\n}\n.paraui-v4-popover.component-popover-placement-rightTop .component-popover-arrow {\n top: 12px;\n}\n.paraui-v4-popover.component-popover-placement-rightBottom .component-popover-arrow {\n bottom: 12px;\n}\n.paraui-v4-popover.component-popover-placement-bottom .component-popover-arrow, .paraui-v4-popover.component-popover-placement-bottomLeft .component-popover-arrow, .paraui-v4-popover.component-popover-placement-bottomRight .component-popover-arrow {\n top: -0.6862915px;\n}\n.paraui-v4-popover.component-popover-placement-bottom .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-bottomLeft .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-bottomRight .component-popover-arrow-content {\n box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.06);\n transform: translateY(1px) rotate(-135deg);\n}\n.paraui-v4-popover.component-popover-placement-bottom .component-popover-arrow {\n left: 50%;\n transform: translateX(-50%);\n}\n.paraui-v4-popover.component-popover-placement-bottomLeft .component-popover-arrow {\n left: 16px;\n}\n.paraui-v4-popover.component-popover-placement-bottomRight .component-popover-arrow {\n right: 16px;\n}\n.paraui-v4-popover.component-popover-placement-left .component-popover-arrow, .paraui-v4-popover.component-popover-placement-leftTop .component-popover-arrow, .paraui-v4-popover.component-popover-placement-leftBottom .component-popover-arrow {\n right: -0.6862915px;\n}\n.paraui-v4-popover.component-popover-placement-left .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-leftTop .component-popover-arrow-content, .paraui-v4-popover.component-popover-placement-leftBottom .component-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(-1px) rotate(-45deg);\n}\n.paraui-v4-popover.component-popover-placement-left .component-popover-arrow {\n top: 50%;\n transform: translateY(-50%);\n}\n.paraui-v4-popover.component-popover-placement-leftTop .component-popover-arrow {\n top: 12px;\n}\n.paraui-v4-popover.component-popover-placement-leftBottom .component-popover-arrow {\n bottom: 12px;\n}\n\n.component-popover-zoom-big-enter,\n.component-popover-zoom-big-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.component-popover-zoom-big-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.component-popover-zoom-big-enter.component-popover-zoom-big-enter-active,\n.component-popover-zoom-big-appear.component-popover-zoom-big-appear-active {\n animation-name: componentPopoverZoomBigIn;\n animation-play-state: running;\n}\n\n.component-popover-zoom-big-leave.component-popover-zoom-big-leave-active {\n animation-name: componentPopoverZoomBigOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.component-popover-zoom-big-enter,\n.component-popover-zoom-big-appear {\n transform: scale(0);\n opacity: 0;\n animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);\n}\n\n.component-popover-zoom-big-enter-prepare,\n.component-popover-zoom-big-appear-prepare {\n transform: none;\n}\n\n.component-popover-zoom-big-leave {\n animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n@keyframes componentPopoverZoomBigIn {\n 0% {\n transform: scale(0.8);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@keyframes componentPopoverZoomBigOut {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0.8);\n opacity: 0;\n }\n}";
|
|
16
14
|
styleInject(css_248z);
|
|
17
15
|
|
|
18
16
|
//popover
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const Popover = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
18
|
+
const {
|
|
19
|
+
title,
|
|
20
|
+
content
|
|
21
|
+
} = props,
|
|
22
22
|
restProps = __rest(props, ["title", "content"]);
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const wrapRef = React__default.useRef();
|
|
24
|
+
const getPopupContainer = usePopupContainer(wrapRef, props.getPopupContainer);
|
|
25
25
|
//浮层
|
|
26
|
-
|
|
26
|
+
const getOverlay = prefixCls => {
|
|
27
27
|
if (!title && !content) return null;
|
|
28
28
|
return jsxs(Fragment, {
|
|
29
29
|
children: [title && jsx("div", Object.assign({
|
|
@@ -37,7 +37,7 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
37
37
|
}))]
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
|
|
40
|
+
const prefixCls = "".concat($rcPrefixCls, "-popover");
|
|
41
41
|
return jsx(Tooltip, Object.assign({}, restProps, {
|
|
42
42
|
isPopover: true,
|
|
43
43
|
prefixCls: prefixCls,
|