@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +90 -118
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +9 -10
- 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 +260 -337
- package/ComboSelect/lang/en_US.d.ts +1 -0
- package/ComboSelect/lang/index.d.ts +2 -0
- package/ComboSelect/lang/zh_CN.d.ts +1 -0
- package/ComboSelect/utils.d.ts +6 -0
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +24 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +222 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +70 -74
- package/FormItem/index.js +18 -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 +104 -113
- 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 +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +582 -796
- package/SelectorPicker/index.js +113 -134
- 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 +24 -25
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +360 -494
- package/Tabs/index.js +100 -100
- package/Tag/index.js +64 -82
- package/TextEditor/index.js +78 -100
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +29 -28
- package/Timeline/index.js +50 -47
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +29 -29
- package/Tooltip/index.js +52 -56
- package/Transfer/index.js +117 -154
- package/Tree/index.js +9 -10
- package/Upload/index.js +125 -143
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-3cdaba96.js} +967 -934
- package/_verture/{index-b1f80962.js → index-4fafd0a0.js} +6 -8
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/{index-232d890b.js → index-d63bd287.js} +1 -1
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-e0f9064d.js} +125 -134
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-8534f23d.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
- package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
- 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-c17b5265.js +97 -0
- package/index.js +24 -23
- package/locale/en-US.d.ts +1 -0
- package/locale/index.d.ts +2 -0
- package/locale/index.js +10 -8
- package/locale/zh-CN.d.ts +1 -0
- package/package.json +11 -10
- 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-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
- package/_verture/utils-418da0a4.js +0 -73
- /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
package/ButtonGroup/index.js
CHANGED
|
@@ -5,19 +5,16 @@ import { Button } from '../Button/index.js';
|
|
|
5
5
|
import { Tooltip } from '../Tooltip/index.js';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import Forbid from '@para-ui/icons/Forbid';
|
|
8
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
8
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
-
import '../_verture/typeof-adeedc13.js';
|
|
11
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
12
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
13
10
|
import '@para-ui/icons/LoadingF';
|
|
14
11
|
import '@para-ui/icons/Down';
|
|
15
|
-
import '../_verture/index-
|
|
12
|
+
import '../_verture/index-da9097d3.js';
|
|
16
13
|
import 'rc-dropdown';
|
|
17
|
-
import '../_verture/usePopupContainer-
|
|
14
|
+
import '../_verture/usePopupContainer-635f66f4.js';
|
|
18
15
|
import 'dayjs';
|
|
19
16
|
import '@paraview/lib';
|
|
20
|
-
import '../_verture/useFormatMessage-
|
|
17
|
+
import '../_verture/useFormatMessage-eb13cf56.js';
|
|
21
18
|
import '@para-ui/core/GlobalContext';
|
|
22
19
|
import '../AutoTips/index.js';
|
|
23
20
|
import 'rc-tooltip';
|
|
@@ -27,22 +24,20 @@ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/26 下
|
|
|
27
24
|
styleInject(css_248z);
|
|
28
25
|
|
|
29
26
|
//按钮组
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
mode =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
41
|
-
style = props.style;
|
|
27
|
+
const ButtonGroup = props => {
|
|
28
|
+
const {
|
|
29
|
+
mode = 'icon',
|
|
30
|
+
data = [],
|
|
31
|
+
className,
|
|
32
|
+
showToolTip = false,
|
|
33
|
+
onClick,
|
|
34
|
+
disabled = false,
|
|
35
|
+
style
|
|
36
|
+
} = props;
|
|
42
37
|
//tooltip title
|
|
43
|
-
|
|
38
|
+
const generateTooltipTitle = (disabled, title) => {
|
|
44
39
|
if (disabled && title) {
|
|
45
|
-
|
|
40
|
+
const svgObj = {
|
|
46
41
|
marginRight: '4px',
|
|
47
42
|
fontSize: '11px',
|
|
48
43
|
color: 'inherit'
|
|
@@ -56,11 +51,13 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
56
51
|
return title;
|
|
57
52
|
};
|
|
58
53
|
//渲染按钮组
|
|
59
|
-
|
|
54
|
+
const renderButtonGroup = () => {
|
|
60
55
|
if (!data || !data.length) return null;
|
|
61
|
-
return data.map(
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
return data.map((item, index) => {
|
|
57
|
+
let {
|
|
58
|
+
text,
|
|
59
|
+
disabled: _disabled
|
|
60
|
+
} = item;
|
|
64
61
|
if (typeof _disabled === 'undefined') {
|
|
65
62
|
_disabled = disabled;
|
|
66
63
|
item.disabled = disabled;
|
|
@@ -78,16 +75,16 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
78
75
|
});
|
|
79
76
|
};
|
|
80
77
|
//按钮组点击
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(data, evt);
|
|
84
|
-
};
|
|
78
|
+
const handleClickBubble = data => evt => {
|
|
79
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(data, evt);
|
|
85
80
|
};
|
|
86
81
|
//生成按钮
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
const generateButton = data => {
|
|
83
|
+
const _a = data !== null && data !== void 0 ? data : {},
|
|
84
|
+
{
|
|
85
|
+
text,
|
|
86
|
+
icon
|
|
87
|
+
} = _a,
|
|
91
88
|
rest = __rest(_a, ["text", "icon"]);
|
|
92
89
|
switch (mode) {
|
|
93
90
|
case 'text':
|
package/Carousel/index.js
CHANGED
|
@@ -1,68 +1,64 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-1d116156.js';
|
|
2
1
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
2
|
import { jsx } from 'react/jsx-runtime';
|
|
4
3
|
import React__default from 'react';
|
|
5
4
|
import SlickCarousel from 'react-slick';
|
|
6
5
|
import clsx from 'clsx';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
6
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
8
7
|
import RightCircleF from '@para-ui/icons/RightCircleF';
|
|
9
8
|
import LeftCircleF from '@para-ui/icons/LeftCircleF';
|
|
10
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
11
|
-
import '../_verture/typeof-adeedc13.js';
|
|
12
10
|
|
|
13
11
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/2/28 上午11:01\n* @description Carousel\n*/\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-carousel {\n color: rgb(29, 33, 38);\n font-size: 14px;\n line-height: 1.5715;\n list-style: none;\n}\n.paraui-v4-carousel .slick-arrow {\n z-index: 1;\n opacity: 0;\n}\n.paraui-v4-carousel .slick-arrow svg {\n color: #a1a8b3;\n font-size: 30px;\n}\n.paraui-v4-carousel:hover .slick-arrow {\n opacity: 1;\n}\n.paraui-v4-carousel .slick-slider {\n position: relative;\n display: block;\n box-sizing: border-box;\n touch-action: pan-y;\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: transparent;\n}\n.paraui-v4-carousel .slick-list {\n position: relative;\n display: block;\n margin: 0;\n padding: 0;\n overflow: hidden;\n}\n.paraui-v4-carousel .slick-list:focus {\n outline: none;\n}\n.paraui-v4-carousel .slick-list.dragging {\n cursor: pointer;\n}\n.paraui-v4-carousel .slick-list .slick-slide {\n pointer-events: none;\n}\n.paraui-v4-carousel .slick-list .slick-slide input.ant-radio-input,\n.paraui-v4-carousel .slick-list .slick-slide input.ant-checkbox-input {\n visibility: hidden;\n}\n.paraui-v4-carousel .slick-list .slick-slide.slick-active {\n pointer-events: auto;\n}\n.paraui-v4-carousel .slick-list .slick-slide.slick-active input.ant-radio-input,\n.paraui-v4-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input {\n visibility: visible;\n}\n.paraui-v4-carousel .slick-list .slick-slide > div > div {\n vertical-align: bottom;\n}\n.paraui-v4-carousel .slick-slider .slick-track,\n.paraui-v4-carousel .slick-slider .slick-list {\n transform: translate3d(0, 0, 0);\n touch-action: pan-y;\n}\n.paraui-v4-carousel .slick-track {\n position: relative;\n top: 0;\n left: 0;\n display: block;\n}\n.paraui-v4-carousel .slick-track::before,\n.paraui-v4-carousel .slick-track::after {\n display: table;\n content: \"\";\n}\n.paraui-v4-carousel .slick-track::after {\n clear: both;\n}\n.paraui-v4-carousel .slick-slide {\n display: none;\n float: left;\n height: 100%;\n min-height: 1px;\n}\n.paraui-v4-carousel .slick-slide img {\n display: block;\n}\n.paraui-v4-carousel .slick-slide.slick-loading img {\n display: none;\n}\n.paraui-v4-carousel .slick-slide.dragging img {\n pointer-events: none;\n}\n.paraui-v4-carousel .slick-initialized .slick-slide {\n display: block;\n}\n.paraui-v4-carousel .slick-loading .slick-slide {\n visibility: hidden;\n}\n.paraui-v4-carousel .slick-vertical .slick-slide {\n display: block;\n height: auto;\n}\n.paraui-v4-carousel .slick-arrow.slick-hidden {\n display: none;\n}\n.paraui-v4-carousel .slick-prev,\n.paraui-v4-carousel .slick-next {\n position: absolute;\n top: 50%;\n display: block;\n width: 30px;\n height: 30px;\n transform: translate(0, -50%);\n padding: 0;\n color: transparent;\n font-size: 0;\n line-height: 0;\n background: transparent;\n border: 0;\n outline: none;\n cursor: pointer;\n}\n.paraui-v4-carousel .slick-prev:hover svg,\n.paraui-v4-carousel .slick-next:hover svg,\n.paraui-v4-carousel .slick-prev:focus svg,\n.paraui-v4-carousel .slick-next:focus svg {\n color: #fff;\n}\n.paraui-v4-carousel .slick-prev.slick-disabled::before,\n.paraui-v4-carousel .slick-next.slick-disabled::before {\n opacity: 0.25;\n}\n.paraui-v4-carousel .slick-prev {\n left: 20px;\n}\n.paraui-v4-carousel .slick-next {\n right: 20px;\n}\n.paraui-v4-carousel .slick-dots {\n position: absolute;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 15;\n display: flex !important;\n justify-content: center;\n margin-right: 15%;\n margin-left: 15%;\n padding-left: 0;\n list-style: none;\n}\n.paraui-v4-carousel .slick-dots-bottom {\n bottom: 20px;\n}\n.paraui-v4-carousel .slick-dots-top {\n top: 20px;\n bottom: auto;\n}\n.paraui-v4-carousel .slick-dots li {\n position: relative;\n display: inline-block;\n flex: 0 1 auto;\n box-sizing: content-box;\n width: 20px;\n height: 4px;\n margin: 0 2px;\n margin-right: 5px;\n margin-left: 5px;\n padding: 0;\n text-align: center;\n text-indent: -999px;\n vertical-align: top;\n transition: all 0.5s;\n}\n.paraui-v4-carousel .slick-dots li button {\n display: block;\n width: 100%;\n height: 4px;\n padding: 0;\n color: transparent;\n font-size: 0;\n background: rgb(255, 255, 255);\n border: 0;\n border-radius: 2px;\n outline: none;\n cursor: pointer;\n opacity: 0.3;\n transition: all 0.5s;\n}\n.paraui-v4-carousel .slick-dots li button:hover,\n.paraui-v4-carousel .slick-dots li button:focus {\n opacity: 0.75;\n}\n.paraui-v4-carousel .slick-dots li.slick-active {\n width: 40px;\n}\n.paraui-v4-carousel .slick-dots li.slick-active button {\n background: rgb(255, 255, 255);\n opacity: 1;\n}\n.paraui-v4-carousel .slick-dots li.slick-active:hover,\n.paraui-v4-carousel .slick-dots li.slick-active:focus {\n opacity: 1;\n}\n.paraui-v4-carousel .slick-loading .paraui-v4-carousel .slick-track {\n visibility: hidden;\n}\n.paraui-v4-carousel-vertical .slick-dots {\n top: 50%;\n bottom: auto;\n flex-direction: column;\n width: 3px;\n height: auto;\n margin: 0;\n transform: translateY(-50%);\n}\n.paraui-v4-carousel-vertical .slick-dots-left {\n right: auto;\n left: 20px;\n}\n.paraui-v4-carousel-vertical .slick-dots-right {\n right: 20px;\n left: auto;\n}\n.paraui-v4-carousel-vertical .slick-dots li {\n width: 3px;\n height: 16px;\n margin: 4px 2px;\n vertical-align: baseline;\n}\n.paraui-v4-carousel-vertical .slick-dots li button {\n width: 3px;\n height: 16px;\n}\n.paraui-v4-carousel-vertical .slick-dots li.slick-active {\n width: 3px;\n height: 24px;\n}\n.paraui-v4-carousel-vertical .slick-dots li.slick-active button {\n width: 3px;\n height: 24px;\n}\n.paraui-v4-carousel-rtl {\n direction: rtl;\n}\n.paraui-v4-carousel-rtl .paraui-v4-carousel .slick-track {\n right: 0;\n left: auto;\n}\n.paraui-v4-carousel-rtl .paraui-v4-carousel .slick-prev {\n right: 20px;\n left: auto;\n}\n.paraui-v4-carousel-rtl .paraui-v4-carousel .slick-next {\n right: auto;\n left: 20px;\n}\n.paraui-v4-carousel-rtl.paraui-v4-carousel .slick-dots {\n flex-direction: row-reverse;\n}\n.paraui-v4-carousel-rtl.paraui-v4-carousel-vertical .slick-dots {\n flex-direction: column;\n}";
|
|
14
12
|
styleInject(css_248z);
|
|
15
13
|
|
|
16
14
|
//Carousel
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
dotPosition = _props$dotPosition === void 0 ? 'bottom' : _props$dotPosition,
|
|
26
|
-
className = props.className,
|
|
15
|
+
const Carousel = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
dots = true,
|
|
18
|
+
arrows = false,
|
|
19
|
+
draggable = false,
|
|
20
|
+
dotPosition = 'bottom',
|
|
21
|
+
className
|
|
22
|
+
} = props,
|
|
27
23
|
restProps = __rest(props, ["dots", "arrows", "draggable", "dotPosition", "className"]);
|
|
28
|
-
|
|
24
|
+
const slickRef = React__default.useRef();
|
|
29
25
|
//切换到指定面板
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const goTo = function (slide) {
|
|
27
|
+
let dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
32
28
|
slickRef.current.slickGoTo(slide, dontAnimate);
|
|
33
29
|
};
|
|
34
30
|
//ref 绑定实例方法
|
|
35
|
-
React__default.useImperativeHandle(ref,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
}, [slickRef.current]);
|
|
31
|
+
React__default.useImperativeHandle(ref, () => ({
|
|
32
|
+
goTo,
|
|
33
|
+
prev: slickRef.current.slickPrev,
|
|
34
|
+
next: slickRef.current.slickNext,
|
|
35
|
+
play: slickRef.current.slickPlay,
|
|
36
|
+
pause: slickRef.current.slickPause
|
|
37
|
+
}), [slickRef.current]);
|
|
44
38
|
//节点数量
|
|
45
|
-
|
|
46
|
-
React__default.useEffect(
|
|
39
|
+
const prevCount = React__default.useRef(React__default.Children.count(props.children));
|
|
40
|
+
React__default.useEffect(() => {
|
|
47
41
|
if (prevCount.current !== React__default.Children.count(props.children)) {
|
|
48
42
|
goTo(props.initialSlide || 0, false);
|
|
49
43
|
prevCount.current = React__default.Children.count(props.children);
|
|
50
44
|
}
|
|
51
45
|
}, [props.children]);
|
|
52
|
-
|
|
46
|
+
const newProps = Object.assign({}, restProps);
|
|
53
47
|
//动画效果
|
|
54
48
|
if (newProps.effect === 'fade') {
|
|
55
49
|
newProps.fade = true;
|
|
56
50
|
}
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
const prefixCls = "".concat($prefixCls, "-carousel");
|
|
52
|
+
const dotsClass = 'slick-dots';
|
|
59
53
|
newProps.vertical = dotPosition === 'left' || dotPosition === 'right';
|
|
60
54
|
//启用dots
|
|
61
|
-
|
|
55
|
+
const enableDots = !!dots;
|
|
62
56
|
//dots cls
|
|
63
|
-
|
|
57
|
+
const dsClass = clsx(dotsClass, "".concat(dotsClass, "-").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);
|
|
64
58
|
//组件cls
|
|
65
|
-
|
|
59
|
+
const cls = clsx(prefixCls, className, {
|
|
60
|
+
["".concat(prefixCls, "-vertical")]: newProps.vertical
|
|
61
|
+
});
|
|
66
62
|
return jsx("div", Object.assign({
|
|
67
63
|
className: cls
|
|
68
64
|
}, {
|
package/Cascader/index.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { C as Cascader } from '../_verture/index-
|
|
2
|
-
export { C as default } from '../_verture/index-
|
|
3
|
-
import '../_verture/defineProperty-1d116156.js';
|
|
4
|
-
import '../_verture/typeof-adeedc13.js';
|
|
5
|
-
import '../_verture/toConsumableArray-8f4c9589.js';
|
|
6
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
7
|
-
import '../_verture/slicedToArray-a8206399.js';
|
|
1
|
+
import { C as Cascader } from '../_verture/index-3cdaba96.js';
|
|
2
|
+
export { C as default } from '../_verture/index-3cdaba96.js';
|
|
8
3
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
9
4
|
import 'react/jsx-runtime';
|
|
5
|
+
import '../_verture/toConsumableArray-c7a8028f.js';
|
|
6
|
+
import '../_verture/slicedToArray-75fa4188.js';
|
|
7
|
+
import '../_verture/defineProperty-1d116156.js';
|
|
8
|
+
import '../_verture/typeof-adeedc13.js';
|
|
10
9
|
import 'react';
|
|
11
10
|
import 'react-dom';
|
|
12
11
|
import 'rc-motion';
|
|
13
12
|
import 'clsx';
|
|
14
|
-
import '../_verture/typeof-
|
|
13
|
+
import '../_verture/typeof-b240b062.js';
|
|
15
14
|
import 'rc-tree/lib/utils/conductUtil';
|
|
16
15
|
import '@para-ui/icons/Right';
|
|
17
16
|
import '@para-ui/icons/Down';
|
|
@@ -20,12 +19,12 @@ import 'rc-tree/lib/utils/treeUtil';
|
|
|
20
19
|
import '../Tooltip/index.js';
|
|
21
20
|
import 'rc-tooltip';
|
|
22
21
|
import 'rc-tooltip/lib/placements';
|
|
23
|
-
import '../_verture/constant-
|
|
22
|
+
import '../_verture/constant-5317fc89.js';
|
|
24
23
|
import '@para-ui/icons/Forbid';
|
|
25
24
|
import '../_verture/style-inject.es-300983ab.js';
|
|
26
25
|
import '@para-ui/icons';
|
|
27
26
|
import '@para-ui/icons/LoadingF';
|
|
28
27
|
import '../AutoTips/index.js';
|
|
29
28
|
import '@paraview/lib';
|
|
30
|
-
import '../_verture/useFormatMessage-
|
|
29
|
+
import '../_verture/useFormatMessage-eb13cf56.js';
|
|
31
30
|
import '@para-ui/core/GlobalContext';
|
package/Checkbox/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
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
3
|
import Label from '../Label/index.js';
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
4
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
5
|
import { Tooltip } from '../Tooltip/index.js';
|
|
7
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
8
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
9
7
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
10
8
|
import '../Help/index.js';
|
|
11
9
|
import '@para-ui/icons/Help';
|
|
@@ -17,33 +15,28 @@ import '@para-ui/icons/Forbid';
|
|
|
17
15
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-checkbox {\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 cursor: pointer;\n display: inline-flex;\n align-items: center;\n line-height: 16px;\n}\n.paraui-v4-checkbox:hover {\n /*& > .checkbox-label {\n color: $NB2;\n cursor: pointer;\n\n svg {\n color: $NB2;\n }\n }\n\n // 帮组\n & > .checkbox-help {\n padding: 0 8px;\n\n & > .checkbox-label {\n color: $NB2;\n cursor: pointer;\n\n svg {\n color: $NB2;\n }\n }\n }*/\n}\n.paraui-v4-checkbox:hover > .checkbox-box > .checkbox-box-inner {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-checkbox > .checkbox-box {\n position: relative;\n}\n.paraui-v4-checkbox > .checkbox-box > input {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n width: 100%;\n height: 100%;\n opacity: 0;\n cursor: pointer;\n}\n.paraui-v4-checkbox > .checkbox-box > .checkbox-box-inner {\n position: relative;\n top: 0;\n left: 0;\n display: block;\n border-radius: 2px;\n background-color: white;\n border: 1px solid rgb(212, 218, 227);\n}\n.paraui-v4-checkbox > .checkbox-box > .checkbox-box-inner:after {\n position: absolute;\n display: table;\n content: \" \";\n}\n.paraui-v4-checkbox > .checkbox-label {\n color: rgb(29, 33, 38);\n padding: 0 8px;\n margin: 0;\n display: inline-flex;\n align-items: flex-start;\n overflow: hidden;\n cursor: pointer;\n}\n.paraui-v4-checkbox > .checkbox-label > .checkbox-help > svg {\n top: 0;\n}\n.paraui-v4-checkbox .checkbox-label {\n line-height: 16px;\n}\n.paraui-v4-checkbox > .checkbox-help {\n padding: 0 8px;\n position: relative;\n top: -1px;\n overflow: hidden;\n}\n.paraui-v4-checkbox > .checkbox-help > .checkbox-label {\n width: 100%;\n color: rgb(29, 33, 38);\n margin: 0;\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n cursor: pointer;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-checked:hover > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(87, 131, 235);\n border-color: transparent;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(46, 101, 230);\n border-color: transparent;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner:after {\n border: 1px solid white;\n border-top: 0;\n border-left: 0;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-indeterminate:hover > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(87, 131, 235);\n border-color: transparent;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(46, 101, 230);\n border-color: transparent;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner:after {\n background-color: white;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(1);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled {\n cursor: not-allowed;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-label {\n color: rgb(161, 168, 179);\n cursor: not-allowed;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-label svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-help > .checkbox-label {\n color: rgb(161, 168, 179);\n cursor: not-allowed;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-help > .checkbox-label svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-box > input {\n cursor: not-allowed;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(234, 236, 241);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-checked:hover > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(212, 218, 227);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(212, 218, 227);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner:after {\n border-color: rgb(255, 255, 255);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-indeterminate:hover > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(212, 218, 227);\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner {\n background-color: rgb(212, 218, 227);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-disabled.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner:after {\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-small > .checkbox-box > .checkbox-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-small.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner:after {\n top: 45%;\n left: 21%;\n width: 4px;\n height: 7px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-small.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner:after {\n width: 8px;\n height: 1px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-medium > .checkbox-box > .checkbox-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-medium.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner:after {\n top: 45%;\n left: 21%;\n width: 4px;\n height: 7px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-medium.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner:after {\n width: 8px;\n height: 1px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-large > .checkbox-box > .checkbox-box-inner {\n width: 14px;\n height: 14px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-large.paraui-v4-checkbox-checked > .checkbox-box > .checkbox-box-inner:after {\n top: 45%;\n left: 21%;\n width: 4px;\n height: 7px;\n}\n.paraui-v4-checkbox.paraui-v4-checkbox-large.paraui-v4-checkbox-indeterminate > .checkbox-box > .checkbox-box-inner:after {\n width: 8px;\n height: 1px;\n}";
|
|
18
16
|
styleInject(css_248z);
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className =
|
|
23
|
-
label
|
|
24
|
-
labelTooltip
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _useState = useState(false),
|
|
36
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
-
checkedCom = _useState2[0],
|
|
38
|
-
setCheckedCom = _useState2[1]; // 复选框状态
|
|
39
|
-
useEffect(function () {
|
|
18
|
+
const Checkbox = props => {
|
|
19
|
+
const {
|
|
20
|
+
className = '',
|
|
21
|
+
label,
|
|
22
|
+
labelTooltip,
|
|
23
|
+
size = 'large',
|
|
24
|
+
disabled = false,
|
|
25
|
+
disabledTooltip,
|
|
26
|
+
indeterminate = false,
|
|
27
|
+
width,
|
|
28
|
+
onChange,
|
|
29
|
+
style
|
|
30
|
+
} = props;
|
|
31
|
+
const [checkedCom, setCheckedCom] = useState(false); // 复选框状态
|
|
32
|
+
useEffect(() => {
|
|
40
33
|
if (props.defaultChecked !== undefined) setCheckedCom(props.defaultChecked);
|
|
41
34
|
}, []);
|
|
42
|
-
useEffect(
|
|
35
|
+
useEffect(() => {
|
|
43
36
|
if (props.checked !== undefined) setCheckedCom(props.checked);
|
|
44
37
|
}, [props.checked]);
|
|
45
38
|
// 点击选择
|
|
46
|
-
|
|
39
|
+
const clickCheck = e => {
|
|
47
40
|
e.preventDefault();
|
|
48
41
|
if (disabled) return;
|
|
49
42
|
if (indeterminate) {
|
|
@@ -59,8 +52,8 @@ var Checkbox = function Checkbox(props) {
|
|
|
59
52
|
onChange && onChange(e, !checkedCom);
|
|
60
53
|
};
|
|
61
54
|
// 处理class
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
const handClass = () => {
|
|
56
|
+
let str = "".concat($prefixCls, "-checkbox");
|
|
64
57
|
if (className) str += " ".concat(className);
|
|
65
58
|
if (size) str += " ".concat($prefixCls, "-checkbox-").concat(size);
|
|
66
59
|
if (disabled) str += " ".concat($prefixCls, "-checkbox-disabled");
|
|
@@ -70,28 +63,28 @@ var Checkbox = function Checkbox(props) {
|
|
|
70
63
|
}
|
|
71
64
|
return str;
|
|
72
65
|
};
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
const handLabelClass = () => {
|
|
67
|
+
let str = 'checkbox-label';
|
|
75
68
|
if (labelTooltip && labelTooltip.className) {
|
|
76
69
|
str += " ".concat(labelTooltip.className);
|
|
77
70
|
}
|
|
78
71
|
return str;
|
|
79
72
|
};
|
|
80
73
|
/** 处理帮组classNaem */
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
const handHelpClassName = () => {
|
|
75
|
+
let str = ' checkbox-help';
|
|
83
76
|
if (labelTooltip && labelTooltip.helpClassName) {
|
|
84
77
|
str += " ".concat(labelTooltip.helpClassName);
|
|
85
78
|
}
|
|
86
79
|
return str;
|
|
87
80
|
};
|
|
88
81
|
/** 处理样式 */
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
const handStyle = () => {
|
|
83
|
+
const obj = Object.assign({}, style);
|
|
91
84
|
if (width) obj.width = width;
|
|
92
85
|
return obj;
|
|
93
86
|
};
|
|
94
|
-
|
|
87
|
+
const contentRender = () => {
|
|
95
88
|
return jsxs("label", Object.assign({
|
|
96
89
|
className: handClass(),
|
|
97
90
|
onClick: clickCheck,
|
|
@@ -114,7 +107,7 @@ var Checkbox = function Checkbox(props) {
|
|
|
114
107
|
})) : null]
|
|
115
108
|
}));
|
|
116
109
|
};
|
|
117
|
-
|
|
110
|
+
const handleContentRender = () => {
|
|
118
111
|
if (disabledTooltip) {
|
|
119
112
|
return jsx(Tooltip, Object.assign({
|
|
120
113
|
disabled: true
|
package/CheckboxGroup/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
|
|
2
1
|
import { useState, useEffect, createElement } from 'react';
|
|
3
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
3
|
import { Checkbox } from '../Checkbox/index.js';
|
|
5
4
|
import Label from '../Label/index.js';
|
|
6
5
|
import HelperText from '../HelperText/index.js';
|
|
7
6
|
import { DeepClone } from '@paraview/lib';
|
|
8
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
9
8
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
|
-
import '../_verture/unsupportedIterableToArray-cb478f24.js';
|
|
11
9
|
import '../Tooltip/index.js';
|
|
12
10
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
13
11
|
import 'rc-tooltip';
|
|
@@ -20,41 +18,30 @@ import '@para-ui/icons/Help';
|
|
|
20
18
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-checkbox-group {\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 width: 100%;\n}\n.paraui-v4-checkbox-group > .checkbox-group-label {\n margin-bottom: 6px;\n}\n.paraui-v4-checkbox-group > .checkbox-group-content {\n line-height: 0;\n}\n.paraui-v4-checkbox-group > .checkbox-group-content .checkbox-item-box {\n margin-bottom: 4px;\n}\n.paraui-v4-checkbox-group > .checkbox-group-content > .checkbox-group-content-item {\n margin-bottom: 6px;\n}\n.paraui-v4-checkbox-group > .checkbox-group-content > .checkbox-group-content-item:last-child {\n margin-bottom: 0;\n}\n.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column > .checkbox-group-content {\n display: flex;\n flex-direction: column;\n}\n.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column > .checkbox-group-content > span {\n margin-bottom: 10px;\n}\n.paraui-v4-checkbox-group.paraui-v4-checkbox-group-column > .checkbox-group-content > span:last-child {\n margin-bottom: 0;\n}";
|
|
21
19
|
styleInject(css_248z);
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
label =
|
|
26
|
-
labelTooltip
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
id = _props$id === void 0 ? 'name' : _props$id,
|
|
45
|
-
list = props.list,
|
|
46
|
-
_props$className = props.className,
|
|
47
|
-
className = _props$className === void 0 ? '' : _props$className,
|
|
48
|
-
onChange = props.onChange,
|
|
49
|
-
style = props.style;
|
|
50
|
-
var _useState = useState([]),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
valueCom = _useState2[0],
|
|
53
|
-
setValueCom = _useState2[1];
|
|
54
|
-
useEffect(function () {
|
|
21
|
+
const CheckboxGroup = props => {
|
|
22
|
+
const {
|
|
23
|
+
label = '',
|
|
24
|
+
labelTooltip,
|
|
25
|
+
spacing = '32px',
|
|
26
|
+
itemWidth,
|
|
27
|
+
size = 'large',
|
|
28
|
+
row = true,
|
|
29
|
+
disabled = false,
|
|
30
|
+
required = false,
|
|
31
|
+
error = false,
|
|
32
|
+
hideErrorDom,
|
|
33
|
+
helperText = '',
|
|
34
|
+
id = 'name',
|
|
35
|
+
list,
|
|
36
|
+
className = '',
|
|
37
|
+
onChange,
|
|
38
|
+
style
|
|
39
|
+
} = props;
|
|
40
|
+
const [valueCom, setValueCom] = useState([]);
|
|
41
|
+
useEffect(() => {
|
|
55
42
|
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
56
43
|
}, []);
|
|
57
|
-
useEffect(
|
|
44
|
+
useEffect(() => {
|
|
58
45
|
if (props.value !== undefined) setValueCom(props.value);
|
|
59
46
|
}, [props.value]);
|
|
60
47
|
/**
|
|
@@ -63,24 +50,22 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
63
50
|
* @event 点击元素
|
|
64
51
|
* @checked 当前值
|
|
65
52
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
onChange && onChange(arr);
|
|
78
|
-
};
|
|
53
|
+
const onchangeCom = item => (event, checked) => {
|
|
54
|
+
const name = item[id]; // 值
|
|
55
|
+
const arr = DeepClone(valueCom);
|
|
56
|
+
if (checked) {
|
|
57
|
+
arr.push(name);
|
|
58
|
+
} else {
|
|
59
|
+
const index = arr.indexOf(name);
|
|
60
|
+
arr.splice(index, 1);
|
|
61
|
+
}
|
|
62
|
+
if (props.value === undefined) setValueCom(arr);
|
|
63
|
+
onChange && onChange(arr);
|
|
79
64
|
};
|
|
80
|
-
|
|
65
|
+
const handLabel = () => {
|
|
81
66
|
if (label || required) {
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
const handLabelClass = () => {
|
|
68
|
+
let str = 'checkbox-group-label';
|
|
84
69
|
if (labelTooltip && labelTooltip.className) {
|
|
85
70
|
str += " ".concat(labelTooltip.className);
|
|
86
71
|
}
|
|
@@ -97,8 +82,8 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
97
82
|
/**
|
|
98
83
|
* @description 处理单选框每一项样式
|
|
99
84
|
* */
|
|
100
|
-
|
|
101
|
-
|
|
85
|
+
const handStyleItem = (item, index, arr) => {
|
|
86
|
+
const obj = Object.assign({
|
|
102
87
|
display: 'inline-block'
|
|
103
88
|
}, item.style);
|
|
104
89
|
if (spacing && row && arr.length !== index + 1) {
|
|
@@ -110,8 +95,8 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
110
95
|
return obj;
|
|
111
96
|
};
|
|
112
97
|
// 处理class
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
const handClass = () => {
|
|
99
|
+
let str = "".concat($prefixCls, "-checkbox-group");
|
|
115
100
|
if (className) str += " ".concat(className);
|
|
116
101
|
if (size) str += " ".concat($prefixCls, "-checkbox-group-").concat(size);
|
|
117
102
|
if (error) str += " ".concat($prefixCls, "-checkbox-group-error");
|
|
@@ -126,12 +111,12 @@ var CheckboxGroup = function CheckboxGroup(props) {
|
|
|
126
111
|
children: [handLabel(), jsx("div", Object.assign({
|
|
127
112
|
className: "checkbox-group-content"
|
|
128
113
|
}, {
|
|
129
|
-
children: list.map(
|
|
114
|
+
children: list.map((item, index) => {
|
|
130
115
|
if (Array.isArray(item)) {
|
|
131
116
|
return jsx("div", Object.assign({
|
|
132
117
|
className: "checkbox-group-content-item"
|
|
133
118
|
}, {
|
|
134
|
-
children: item.map(
|
|
119
|
+
children: item.map((itemChild, inx) => {
|
|
135
120
|
return jsx("span", Object.assign({
|
|
136
121
|
className: 'checkbox-item-box',
|
|
137
122
|
style: handStyleItem(itemChild, inx, item)
|