@para-ui/core 3.0.28 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Button/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
3
3
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import { useRef, useState, useEffect } from 'react';
|
|
@@ -8,14 +8,14 @@ import LoadingOutlined from '@para-ui/icons/LoadingF';
|
|
|
8
8
|
import Forbid from '@para-ui/icons/Forbid';
|
|
9
9
|
import { Tooltip } from '../Tooltip/index.js';
|
|
10
10
|
import Down from '@para-ui/icons/Down';
|
|
11
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
11
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
|
-
import { D as Dropdown } from '../_verture/index-
|
|
14
|
-
import { u as useFormatMessage } from '../_verture/useFormatMessage-
|
|
13
|
+
import { D as Dropdown } from '../_verture/index-be4faaee.js';
|
|
14
|
+
import { u as useFormatMessage } from '../_verture/useFormatMessage-703f8b20.js';
|
|
15
15
|
import 'rc-tooltip';
|
|
16
16
|
import 'rc-tooltip/lib/placements';
|
|
17
17
|
import 'rc-dropdown';
|
|
18
|
-
import '../_verture/usePopupContainer-
|
|
18
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
19
19
|
import 'dayjs';
|
|
20
20
|
import '@paraview/lib';
|
|
21
21
|
import '@para-ui/core/GlobalContext';
|
|
@@ -36,44 +36,40 @@ var localeJson = {
|
|
|
36
36
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/21 下午5:16\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n@keyframes buttonLoadingSpin {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.paraui-v3-button {\n border: 0;\n cursor: pointer;\n display: inline-flex;\n outline: 0;\n position: relative;\n align-items: center;\n user-select: none;\n vertical-align: middle;\n justify-content: center;\n text-decoration: none;\n background-color: transparent;\n appearance: none;\n -webkit-tap-highlight-color: transparent;\n padding: 0 16px;\n line-height: 1.5715;\n border-radius: 4px;\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 white-space: nowrap;\n color: rgb(255, 255, 255);\n box-sizing: border-box;\n letter-spacing: 0.02857em;\n transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n}\n.paraui-v3-button .button-label {\n width: 100%;\n display: inherit;\n align-items: inherit;\n justify-content: inherit;\n}\n.paraui-v3-button .button-icon {\n display: inherit;\n margin-right: 4px;\n}\n.paraui-v3-button .button-icon svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v3-button .button-icon-end {\n margin-right: 0;\n margin-left: 4px;\n}\n.paraui-v3-button .button-icon-loading {\n animation: buttonLoadingSpin 1s infinite linear;\n}\n.paraui-v3-button-loading {\n pointer-events: none;\n}\n.paraui-v3-button-contained {\n color: rgb(255, 255, 255);\n background-color: rgb(54, 102, 214);\n}\n.paraui-v3-button-contained:hover {\n background-color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-button-contained.paraui-v3-button-link-disabled {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-button-contained.paraui-v3-button-link-disabled:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-contained[disabled] {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-button-contained[disabled]:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-contained.paraui-v3-button-dangerous {\n background-color: rgb(235, 96, 84);\n}\n.paraui-v3-button-contained.paraui-v3-button-dangerous:hover {\n background-color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-button-outlined {\n color: rgba(46, 55, 67, 0.7);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-button-outlined:hover {\n color: rgb(54, 102, 214);\n border-color: rgba(54, 102, 214, 0.2);\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-button-outlined.paraui-v3-button-link-disabled {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-button-outlined.paraui-v3-button-link-disabled:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-outlined[disabled] {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-button-outlined[disabled]:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-outlined.paraui-v3-button-dangerous {\n color: rgb(235, 96, 84);\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-button-outlined.paraui-v3-button-dangerous:hover {\n color: rgb(235, 96, 84);\n border-color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-button-text {\n color: rgb(54, 102, 214);\n background-color: transparent;\n border: none;\n}\n.paraui-v3-button-text:hover {\n color: rgba(54, 102, 214, 0.8);\n background-color: transparent;\n}\n.paraui-v3-button-text.paraui-v3-button-link-disabled {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-button-text.paraui-v3-button-link-disabled:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-text[disabled] {\n color: rgba(46, 55, 67, 0.4);\n background-color: transparent;\n border: none;\n pointer-events: none;\n}\n.paraui-v3-button-text[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v3-button-text.paraui-v3-button-dangerous {\n color: rgb(235, 96, 84);\n}\n.paraui-v3-button-text.paraui-v3-button-dangerous:hover {\n color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-button-large {\n height: 36px;\n}\n.paraui-v3-button-medium {\n height: 32px;\n}\n.paraui-v3-button-small {\n height: 28px;\n}\n.paraui-v3-button--disabled {\n display: inline-block;\n}\n\n.paraui-v3-icon-button {\n flex: 0 0 auto;\n overflow: visible;\n text-align: center;\n transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n padding: 0;\n border-radius: 4px;\n}\n.paraui-v3-icon-button-loading {\n pointer-events: none;\n}\n.paraui-v3-icon-button-loading .button-loading-icon {\n display: inline-flex;\n animation: buttonLoadingSpin 1s infinite linear;\n}\n.paraui-v3-icon-button svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v3-icon-button-contained {\n color: rgb(255, 255, 255);\n background-color: rgb(54, 102, 214);\n}\n.paraui-v3-icon-button-contained:hover {\n background-color: rgba(54, 102, 214, 0.8);\n box-shadow: none;\n}\n.paraui-v3-icon-button-contained.paraui-v3-button-link-disabled {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-icon-button-contained.paraui-v3-button-link-disabled:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-icon-button-contained[disabled] {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-icon-button-contained[disabled]:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-icon-button-contained.paraui-v3-icon-button-dangerous {\n background-color: rgb(235, 96, 84);\n}\n.paraui-v3-icon-button-contained.paraui-v3-icon-button-dangerous:hover {\n background-color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-icon-button-outlined {\n color: rgba(46, 55, 67, 0.7);\n background-color: rgb(255, 255, 255);\n border: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-icon-button-outlined:hover {\n color: rgb(54, 102, 214);\n border-color: rgba(54, 102, 214, 0.2);\n box-shadow: none;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-icon-button-outlined.paraui-v3-button-link-disabled {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-icon-button-outlined.paraui-v3-button-link-disabled:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-icon-button-outlined[disabled] {\n color: rgba(46, 55, 67, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border: 1px solid rgba(171, 176, 185, 0.4);\n cursor: default;\n pointer-events: none;\n}\n.paraui-v3-icon-button-outlined[disabled]:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-icon-button-outlined.paraui-v3-icon-button-dangerous {\n color: rgb(235, 96, 84);\n border-color: rgb(235, 96, 84);\n}\n.paraui-v3-icon-button-outlined.paraui-v3-icon-button-dangerous:hover {\n color: rgb(235, 96, 84);\n border-color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-icon-button-text {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-icon-button-text:hover {\n color: rgba(54, 102, 214, 0.8);\n background-color: transparent;\n}\n.paraui-v3-icon-button-text.paraui-v3-button-link-disabled {\n pointer-events: none;\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-icon-button-text.paraui-v3-button-link-disabled:hover {\n background-color: transparent;\n}\n.paraui-v3-icon-button-text[disabled] {\n color: rgba(46, 55, 67, 0.4);\n pointer-events: none;\n}\n.paraui-v3-icon-button-text[disabled]:hover {\n background-color: transparent;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-dangerous {\n color: rgb(235, 96, 84);\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-dangerous:hover {\n color: rgba(235, 96, 84, 0.8);\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-large {\n width: auto;\n height: auto;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-large svg {\n font-size: 28px;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-medium {\n width: auto;\n height: auto;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-medium svg {\n font-size: 24px;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-small {\n width: auto;\n height: auto;\n}\n.paraui-v3-icon-button-text.paraui-v3-icon-button-small svg {\n font-size: 20px;\n}\n.paraui-v3-icon-button-large {\n width: 36px;\n height: 36px;\n}\n.paraui-v3-icon-button-medium {\n width: 32px;\n height: 32px;\n}\n.paraui-v3-icon-button-small {\n width: 28px;\n height: 28px;\n}\n\n.paraui-v3-button-split {\n display: inline-block;\n}\n.paraui-v3-button-split .paraui-v3-button-split--active {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-button-split-list {\n padding: 8px 0;\n border-radius: 4px;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-button-split-list ul .split-li {\n padding: 11px 12px;\n color: rgb(46, 55, 67);\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n transition: background-color 0.3s, color 0.3s;\n}\n.paraui-v3-button-split-list ul .split-li:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-split-list ul .split-li.split-li--active {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-button-split-list ul .split-li.split-li--active:hover {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-v3-button-split-list ul .split-li.split-li--disabled {\n color: rgba(46, 55, 67, 0.4);\n cursor: not-allowed;\n}\n.paraui-v3-button-split-list ul .split-li.split-li--disabled:hover {\n background-color: rgb(255, 255, 255);\n}\n.paraui-v3-button-split-list ul .split-li-group:not(:first-child) {\n position: relative;\n margin-top: 16px;\n}\n.paraui-v3-button-split-list ul .split-li-group:not(:first-child):before {\n content: \"\";\n position: absolute;\n top: -8px;\n left: 8px;\n right: 8px;\n border-top: 1px solid rgba(171, 176, 185, 0.2);\n}";
|
|
37
37
|
styleInject(css_248z);
|
|
38
38
|
|
|
39
|
+
//分体式按钮
|
|
39
40
|
function SplitButton(props) {
|
|
40
41
|
var buttonText = props.buttonText,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
_props$options = props.options,
|
|
43
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
44
|
+
className = props.className,
|
|
45
|
+
style = props.style,
|
|
46
|
+
_props$disabled = props.disabled,
|
|
47
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
48
|
+
onClick = props.onClick,
|
|
49
|
+
optionRender = props.optionRender,
|
|
50
|
+
_props$placement = props.placement,
|
|
51
|
+
placement = _props$placement === void 0 ? 'bottomRight' : _props$placement,
|
|
52
|
+
buttonProps = props.buttonProps,
|
|
53
|
+
_props$iconButton = props.iconButton,
|
|
54
|
+
iconButton = _props$iconButton === void 0 ? false : _props$iconButton;
|
|
54
55
|
var intl = useFormatMessage('Button', localeJson);
|
|
55
56
|
var btnRef = useRef();
|
|
56
|
-
|
|
57
57
|
var _useState = useState(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
selectedIndex = _useState2[0],
|
|
60
|
+
setSelectedIndex = _useState2[1];
|
|
61
|
+
// button click
|
|
63
62
|
var handleButtonClick = function handleButtonClick(opt, index, event) {
|
|
64
63
|
var _a;
|
|
65
|
-
|
|
66
64
|
if (opt.disabled) {
|
|
67
65
|
event.stopPropagation();
|
|
68
66
|
return;
|
|
69
67
|
}
|
|
70
|
-
|
|
71
68
|
setSelectedIndex(index);
|
|
72
69
|
(_a = btnRef.current) === null || _a === void 0 ? void 0 : _a.classList.remove("".concat($prefixCls, "-button-split--active"));
|
|
73
70
|
onClick === null || onClick === void 0 ? void 0 : onClick(opt, event);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
};
|
|
72
|
+
//渲染按钮列表
|
|
77
73
|
var renderButtonList = function renderButtonList() {
|
|
78
74
|
//分组列表
|
|
79
75
|
var generateLiGroup = function generateLiGroup(opt, index) {
|
|
@@ -93,7 +89,6 @@ function SplitButton(props) {
|
|
|
93
89
|
})
|
|
94
90
|
}), index);
|
|
95
91
|
};
|
|
96
|
-
|
|
97
92
|
return jsx("div", Object.assign({
|
|
98
93
|
className: "".concat($prefixCls, "-button-split-list")
|
|
99
94
|
}, {
|
|
@@ -103,7 +98,6 @@ function SplitButton(props) {
|
|
|
103
98
|
//分组
|
|
104
99
|
return generateLiGroup(opt, index);
|
|
105
100
|
}
|
|
106
|
-
|
|
107
101
|
return jsx("li", Object.assign({
|
|
108
102
|
className: clsx('split-li', index === selectedIndex && 'split-li--active', opt.disabled && 'split-li--disabled'),
|
|
109
103
|
onClick: function onClick(evt) {
|
|
@@ -115,9 +109,8 @@ function SplitButton(props) {
|
|
|
115
109
|
})
|
|
116
110
|
})
|
|
117
111
|
}));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
};
|
|
113
|
+
//渲染button
|
|
121
114
|
var renderButton = function renderButton() {
|
|
122
115
|
if (iconButton) {
|
|
123
116
|
return jsx(Button.IconButton, Object.assign({
|
|
@@ -130,7 +123,6 @@ function SplitButton(props) {
|
|
|
130
123
|
})
|
|
131
124
|
}));
|
|
132
125
|
}
|
|
133
|
-
|
|
134
126
|
return jsx(Button, Object.assign({
|
|
135
127
|
variant: 'outlined',
|
|
136
128
|
size: 'large',
|
|
@@ -142,7 +134,6 @@ function SplitButton(props) {
|
|
|
142
134
|
})
|
|
143
135
|
}));
|
|
144
136
|
};
|
|
145
|
-
|
|
146
137
|
return jsx("div", Object.assign({
|
|
147
138
|
className: clsx("".concat($prefixCls, "-button-split"), className),
|
|
148
139
|
style: style
|
|
@@ -156,40 +147,38 @@ function SplitButton(props) {
|
|
|
156
147
|
}));
|
|
157
148
|
}
|
|
158
149
|
|
|
150
|
+
//按钮
|
|
159
151
|
var InternalButton = function InternalButton(props) {
|
|
160
152
|
var _props$variant = props.variant,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
153
|
+
variant = _props$variant === void 0 ? 'contained' : _props$variant,
|
|
154
|
+
_props$size = props.size,
|
|
155
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
156
|
+
className = props.className,
|
|
157
|
+
_props$disabled = props.disabled,
|
|
158
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
159
|
+
children = props.children,
|
|
160
|
+
startIcon = props.startIcon,
|
|
161
|
+
endIcon = props.endIcon,
|
|
162
|
+
_props$loading = props.loading,
|
|
163
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
164
|
+
_props$toolTipTitle = props.toolTipTitle,
|
|
165
|
+
toolTipTitle = _props$toolTipTitle === void 0 ? '' : _props$toolTipTitle,
|
|
166
|
+
TooltipProps = props.TooltipProps,
|
|
167
|
+
_props$danger = props.danger,
|
|
168
|
+
danger = _props$danger === void 0 ? false : _props$danger,
|
|
169
|
+
href = props.href,
|
|
170
|
+
target = props.target,
|
|
171
|
+
restProps = __rest(props, ["variant", "size", "className", "disabled", "children", "startIcon", "endIcon", "loading", "toolTipTitle", "TooltipProps", "danger", "href", "target"]);
|
|
181
172
|
var _useState = useState(false),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
173
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
174
|
+
hasLoading = _useState2[0],
|
|
175
|
+
setHasLoading = _useState2[1];
|
|
176
|
+
var isLinkBtn = ('href' in props);
|
|
177
|
+
//cls
|
|
188
178
|
var makeCls = function makeCls() {
|
|
189
179
|
return clsx("".concat($prefixCls, "-button"), className, "".concat($prefixCls, "-button-").concat(variant), "".concat($prefixCls, "-button-").concat(size), hasLoading && "".concat($prefixCls, "-button-loading"), danger && !disabled && "".concat($prefixCls, "-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
|
|
180
|
+
};
|
|
181
|
+
//渲染按钮图标
|
|
193
182
|
var renderBtnIcon = function renderBtnIcon(pos) {
|
|
194
183
|
if (!hasLoading) {
|
|
195
184
|
if (pos === 'start' && startIcon) return jsx("span", Object.assign({
|
|
@@ -204,23 +193,20 @@ var InternalButton = function InternalButton(props) {
|
|
|
204
193
|
}));
|
|
205
194
|
return null;
|
|
206
195
|
}
|
|
207
|
-
|
|
208
196
|
if (_typeof(loading) === 'object') {
|
|
209
197
|
var delay = loading.delay || 0;
|
|
210
198
|
setTimeout(function () {
|
|
211
199
|
return setHasLoading(false);
|
|
212
200
|
}, delay);
|
|
213
201
|
}
|
|
214
|
-
|
|
215
202
|
if (pos === 'start') return jsx("span", Object.assign({
|
|
216
203
|
className: 'button-icon button-icon-loading'
|
|
217
204
|
}, {
|
|
218
205
|
children: jsx(LoadingOutlined, {})
|
|
219
206
|
}));
|
|
220
207
|
return null;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
|
|
208
|
+
};
|
|
209
|
+
//tooltip title
|
|
224
210
|
var generateTooltipTitle = function generateTooltipTitle() {
|
|
225
211
|
if (disabled && toolTipTitle) {
|
|
226
212
|
var svgObj = {
|
|
@@ -234,11 +220,9 @@ var InternalButton = function InternalButton(props) {
|
|
|
234
220
|
}), toolTipTitle]
|
|
235
221
|
});
|
|
236
222
|
}
|
|
237
|
-
|
|
238
223
|
return toolTipTitle;
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
|
|
224
|
+
};
|
|
225
|
+
//按钮
|
|
242
226
|
var renderButton = function renderButton() {
|
|
243
227
|
if (isLinkBtn) {
|
|
244
228
|
return jsxs("a", Object.assign({}, restProps, {
|
|
@@ -253,7 +237,6 @@ var InternalButton = function InternalButton(props) {
|
|
|
253
237
|
})), renderBtnIcon('end')]
|
|
254
238
|
}));
|
|
255
239
|
}
|
|
256
|
-
|
|
257
240
|
return jsxs("button", Object.assign({}, restProps, {
|
|
258
241
|
disabled: disabled,
|
|
259
242
|
type: "button",
|
|
@@ -266,7 +249,6 @@ var InternalButton = function InternalButton(props) {
|
|
|
266
249
|
})), renderBtnIcon('end')]
|
|
267
250
|
}));
|
|
268
251
|
};
|
|
269
|
-
|
|
270
252
|
useEffect(function () {
|
|
271
253
|
setHasLoading(!!loading);
|
|
272
254
|
}, [loading]);
|
|
@@ -282,41 +264,37 @@ var InternalButton = function InternalButton(props) {
|
|
|
282
264
|
children: renderButton()
|
|
283
265
|
}))
|
|
284
266
|
})) : renderButton();
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
|
|
267
|
+
};
|
|
268
|
+
//icon button
|
|
288
269
|
var IconButton = function IconButton(props) {
|
|
289
270
|
var _props$variant2 = props.variant,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
271
|
+
variant = _props$variant2 === void 0 ? 'contained' : _props$variant2,
|
|
272
|
+
_props$size2 = props.size,
|
|
273
|
+
size = _props$size2 === void 0 ? 'large' : _props$size2,
|
|
274
|
+
_props$toolTipTitle2 = props.toolTipTitle,
|
|
275
|
+
toolTipTitle = _props$toolTipTitle2 === void 0 ? '' : _props$toolTipTitle2,
|
|
276
|
+
children = props.children,
|
|
277
|
+
className = props.className,
|
|
278
|
+
_props$disabled2 = props.disabled,
|
|
279
|
+
disabled = _props$disabled2 === void 0 ? false : _props$disabled2,
|
|
280
|
+
_props$loading2 = props.loading,
|
|
281
|
+
loading = _props$loading2 === void 0 ? false : _props$loading2,
|
|
282
|
+
TooltipProps = props.TooltipProps,
|
|
283
|
+
_props$danger2 = props.danger,
|
|
284
|
+
danger = _props$danger2 === void 0 ? false : _props$danger2,
|
|
285
|
+
href = props.href,
|
|
286
|
+
target = props.target,
|
|
287
|
+
restProps = __rest(props, ["variant", "size", "toolTipTitle", "children", "className", "disabled", "loading", "TooltipProps", "danger", "href", "target"]);
|
|
308
288
|
var _useState3 = useState(false),
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
289
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
290
|
+
hasLoading = _useState4[0],
|
|
291
|
+
setHasLoading = _useState4[1];
|
|
292
|
+
var isLinkBtn = ('href' in props);
|
|
293
|
+
//cls
|
|
315
294
|
var makeCls = function makeCls() {
|
|
316
295
|
return clsx("".concat($prefixCls, "-button ").concat($prefixCls, "-icon-button"), className, "".concat($prefixCls, "-icon-button-").concat(variant), "".concat($prefixCls, "-icon-button-").concat(size), hasLoading && "".concat($prefixCls, "-icon-button-loading"), danger && !disabled && "".concat($prefixCls, "-icon-button-dangerous"), isLinkBtn && "".concat($prefixCls, "-button-link"), isLinkBtn && disabled && "".concat($prefixCls, "-button-link-disabled"));
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
|
|
296
|
+
};
|
|
297
|
+
//tooltip title
|
|
320
298
|
var generateTooltipTitle = function generateTooltipTitle() {
|
|
321
299
|
if (disabled && toolTipTitle) {
|
|
322
300
|
var svgObj = {
|
|
@@ -330,29 +308,24 @@ var IconButton = function IconButton(props) {
|
|
|
330
308
|
}), toolTipTitle]
|
|
331
309
|
});
|
|
332
310
|
}
|
|
333
|
-
|
|
334
311
|
return toolTipTitle;
|
|
335
|
-
};
|
|
336
|
-
|
|
337
|
-
|
|
312
|
+
};
|
|
313
|
+
//渲染图标
|
|
338
314
|
var renderIcon = function renderIcon() {
|
|
339
315
|
if (!hasLoading) return children;
|
|
340
|
-
|
|
341
316
|
if (_typeof(loading) === 'object') {
|
|
342
317
|
var delay = loading.delay || 0;
|
|
343
318
|
setTimeout(function () {
|
|
344
319
|
return setHasLoading(false);
|
|
345
320
|
}, delay);
|
|
346
321
|
}
|
|
347
|
-
|
|
348
322
|
return jsx("span", Object.assign({
|
|
349
323
|
className: 'button-loading-icon'
|
|
350
324
|
}, {
|
|
351
325
|
children: jsx(LoadingOutlined, {})
|
|
352
326
|
}));
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
|
|
327
|
+
};
|
|
328
|
+
//icon button
|
|
356
329
|
var renderIconButton = function renderIconButton() {
|
|
357
330
|
if (isLinkBtn) {
|
|
358
331
|
return jsx("a", Object.assign({}, restProps, {
|
|
@@ -363,7 +336,6 @@ var IconButton = function IconButton(props) {
|
|
|
363
336
|
children: renderIcon()
|
|
364
337
|
}));
|
|
365
338
|
}
|
|
366
|
-
|
|
367
339
|
return jsx("button", Object.assign({}, restProps, {
|
|
368
340
|
disabled: disabled,
|
|
369
341
|
type: "button",
|
|
@@ -372,7 +344,6 @@ var IconButton = function IconButton(props) {
|
|
|
372
344
|
children: renderIcon()
|
|
373
345
|
}));
|
|
374
346
|
};
|
|
375
|
-
|
|
376
347
|
useEffect(function () {
|
|
377
348
|
setHasLoading(!!loading);
|
|
378
349
|
}, [loading]);
|
|
@@ -389,7 +360,6 @@ var IconButton = function IconButton(props) {
|
|
|
389
360
|
})) : renderIconButton()
|
|
390
361
|
}), +hasLoading) : renderIconButton();
|
|
391
362
|
};
|
|
392
|
-
|
|
393
363
|
var Button = InternalButton;
|
|
394
364
|
Button.IconButton = IconButton;
|
|
395
365
|
Button.SplitButton = SplitButton;
|
package/ButtonGroup/index.js
CHANGED
|
@@ -5,18 +5,18 @@ 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-66aa48a1.js';
|
|
9
9
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
10
10
|
import '../_verture/typeof-498dd2b1.js';
|
|
11
|
-
import '../_verture/slicedToArray-
|
|
11
|
+
import '../_verture/slicedToArray-77980792.js';
|
|
12
12
|
import '@para-ui/icons/LoadingF';
|
|
13
13
|
import '@para-ui/icons/Down';
|
|
14
|
-
import '../_verture/index-
|
|
14
|
+
import '../_verture/index-be4faaee.js';
|
|
15
15
|
import 'rc-dropdown';
|
|
16
|
-
import '../_verture/usePopupContainer-
|
|
16
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
17
17
|
import 'dayjs';
|
|
18
18
|
import '@paraview/lib';
|
|
19
|
-
import '../_verture/useFormatMessage-
|
|
19
|
+
import '../_verture/useFormatMessage-703f8b20.js';
|
|
20
20
|
import '@para-ui/core/GlobalContext';
|
|
21
21
|
import 'rc-tooltip';
|
|
22
22
|
import 'rc-tooltip/lib/placements';
|
|
@@ -24,19 +24,20 @@ import 'rc-tooltip/lib/placements';
|
|
|
24
24
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/26 下午2:39\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-button-group {\n display: inline-flex;\n align-items: center;\n}\n.paraui-v3-button-group-iconSplit .paraui-v3-icon-button:not(:last-child) {\n margin-right: 8px;\n}\n.paraui-v3-button-group-iconSplit.paraui-v3-button-group-tooltip > span:not(:last-child) {\n margin-right: 8px;\n}\n.paraui-v3-button-group-icon {\n border: 1px solid rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n}\n.paraui-v3-button-group-icon .paraui-v3-icon-button {\n border: none;\n border-radius: 0;\n}\n.paraui-v3-button-group-icon .paraui-v3-icon-button:not(:last-child) {\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-button-group-icon .paraui-v3-icon-button:first-child {\n border-radius: 4px 0 0 4px;\n}\n.paraui-v3-button-group-icon .paraui-v3-icon-button:last-child {\n border-radius: 0 4px 4px 0;\n}\n.paraui-v3-button-group-icon.paraui-v3-button-group-tooltip > span .paraui-v3-icon-button {\n border: none;\n border-radius: 0;\n}\n.paraui-v3-button-group-icon.paraui-v3-button-group-tooltip > span:not(:last-child) .paraui-v3-icon-button {\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n}\n.paraui-v3-button-group-icon.paraui-v3-button-group-tooltip > span:first-child .paraui-v3-icon-button {\n border-radius: 4px 0 0 4px;\n}\n.paraui-v3-button-group-icon.paraui-v3-button-group-tooltip > span:last-child .paraui-v3-icon-button {\n border-radius: 0 4px 4px 0;\n}\n.paraui-v3-button-group-text .paraui-v3-button {\n border: none;\n border-radius: 0;\n}\n.paraui-v3-button-group-text .paraui-v3-button:not(:last-child) {\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n}";
|
|
25
25
|
styleInject(css_248z);
|
|
26
26
|
|
|
27
|
+
//按钮组
|
|
27
28
|
var ButtonGroup = function ButtonGroup(props) {
|
|
28
29
|
var _props$mode = props.mode,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
mode = _props$mode === void 0 ? 'icon' : _props$mode,
|
|
31
|
+
_props$data = props.data,
|
|
32
|
+
data = _props$data === void 0 ? [] : _props$data,
|
|
33
|
+
className = props.className,
|
|
34
|
+
_props$showToolTip = props.showToolTip,
|
|
35
|
+
showToolTip = _props$showToolTip === void 0 ? false : _props$showToolTip,
|
|
36
|
+
onClick = props.onClick,
|
|
37
|
+
_props$disabled = props.disabled,
|
|
38
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
39
|
+
style = props.style;
|
|
40
|
+
//tooltip title
|
|
40
41
|
var generateTooltipTitle = function generateTooltipTitle(disabled, title) {
|
|
41
42
|
if (disabled && title) {
|
|
42
43
|
var svgObj = {
|
|
@@ -50,22 +51,18 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
50
51
|
}), title]
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
|
|
54
54
|
return title;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
};
|
|
56
|
+
//渲染按钮组
|
|
58
57
|
var renderButtonGroup = function renderButtonGroup() {
|
|
59
58
|
if (!data || !data.length) return null;
|
|
60
59
|
return data.map(function (item, index) {
|
|
61
60
|
var text = item.text,
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
_disabled = item.disabled;
|
|
64
62
|
if (typeof _disabled === 'undefined') {
|
|
65
63
|
_disabled = disabled;
|
|
66
64
|
item.disabled = disabled;
|
|
67
65
|
}
|
|
68
|
-
|
|
69
66
|
if (showToolTip && ['icon', 'iconSplit'].includes(mode)) return jsx(Tooltip, Object.assign({
|
|
70
67
|
title: generateTooltipTitle(_disabled, text)
|
|
71
68
|
}, {
|
|
@@ -77,22 +74,19 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
77
74
|
children: generateButton(item)
|
|
78
75
|
}, index);
|
|
79
76
|
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
};
|
|
78
|
+
//按钮组点击
|
|
83
79
|
var handleClickBubble = function handleClickBubble(data) {
|
|
84
80
|
return function (evt) {
|
|
85
81
|
onClick === null || onClick === void 0 ? void 0 : onClick(data, evt);
|
|
86
82
|
};
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
};
|
|
84
|
+
//生成按钮
|
|
90
85
|
var generateButton = function generateButton(data) {
|
|
91
86
|
var _a = data !== null && data !== void 0 ? data : {},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
text = _a.text,
|
|
88
|
+
icon = _a.icon,
|
|
89
|
+
rest = __rest(_a, ["text", "icon"]);
|
|
96
90
|
switch (mode) {
|
|
97
91
|
case 'text':
|
|
98
92
|
return jsx(Button, Object.assign({
|
|
@@ -102,7 +96,6 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
102
96
|
}, rest, {
|
|
103
97
|
children: text
|
|
104
98
|
}));
|
|
105
|
-
|
|
106
99
|
case 'icon':
|
|
107
100
|
return jsx(Button.IconButton, Object.assign({
|
|
108
101
|
onClick: handleClickBubble(data),
|
|
@@ -110,7 +103,6 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
110
103
|
}, rest, {
|
|
111
104
|
children: icon
|
|
112
105
|
}));
|
|
113
|
-
|
|
114
106
|
case 'iconSplit':
|
|
115
107
|
return jsx(Button.IconButton, Object.assign({
|
|
116
108
|
onClick: handleClickBubble(data),
|
|
@@ -120,7 +112,6 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
120
112
|
}));
|
|
121
113
|
}
|
|
122
114
|
};
|
|
123
|
-
|
|
124
115
|
return jsx("div", Object.assign({
|
|
125
116
|
className: clsx("".concat($prefixCls, "-button-group"), "".concat($prefixCls, "-button-group-").concat(mode), className, showToolTip && "".concat($prefixCls, "-button-group-tooltip")),
|
|
126
117
|
style: style
|
package/Carousel/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { Settings } from "react-slick";
|
|
8
8
|
import './index.scss';
|
|
9
|
-
export
|
|
10
|
-
export
|
|
9
|
+
export type CarouselEffect = 'scrollx' | 'fade';
|
|
10
|
+
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
11
11
|
export interface CarouselProps extends Omit<Settings, 'dots' | 'dotsClass'> {
|
|
12
12
|
/** 动画效果函数 */
|
|
13
13
|
effect?: CarouselEffect;
|
package/Carousel/index.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
|
|
2
2
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import React__default from 'react';
|
|
5
5
|
import SlickCarousel from 'react-slick';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
8
8
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
|
+
import '../_verture/typeof-498dd2b1.js';
|
|
9
10
|
|
|
10
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 Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-carousel {\n color: rgb(46, 55, 67);\n font-size: 14px;\n line-height: 1.5715;\n list-style: none;\n}\n.paraui-v3-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-v3-carousel .slick-list {\n position: relative;\n display: block;\n margin: 0;\n padding: 0;\n overflow: hidden;\n}\n.paraui-v3-carousel .slick-list:focus {\n outline: none;\n}\n.paraui-v3-carousel .slick-list.dragging {\n cursor: pointer;\n}\n.paraui-v3-carousel .slick-list .slick-slide {\n pointer-events: none;\n}\n.paraui-v3-carousel .slick-list .slick-slide input.ant-radio-input,\n.paraui-v3-carousel .slick-list .slick-slide input.ant-checkbox-input {\n visibility: hidden;\n}\n.paraui-v3-carousel .slick-list .slick-slide.slick-active {\n pointer-events: auto;\n}\n.paraui-v3-carousel .slick-list .slick-slide.slick-active input.ant-radio-input,\n.paraui-v3-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input {\n visibility: visible;\n}\n.paraui-v3-carousel .slick-list .slick-slide > div > div {\n vertical-align: bottom;\n}\n.paraui-v3-carousel .slick-slider .slick-track,\n.paraui-v3-carousel .slick-slider .slick-list {\n transform: translate3d(0, 0, 0);\n touch-action: pan-y;\n}\n.paraui-v3-carousel .slick-track {\n position: relative;\n top: 0;\n left: 0;\n display: block;\n}\n.paraui-v3-carousel .slick-track::before,\n.paraui-v3-carousel .slick-track::after {\n display: table;\n content: \"\";\n}\n.paraui-v3-carousel .slick-track::after {\n clear: both;\n}\n.paraui-v3-carousel .slick-slide {\n display: none;\n float: left;\n height: 100%;\n min-height: 1px;\n}\n.paraui-v3-carousel .slick-slide img {\n display: block;\n}\n.paraui-v3-carousel .slick-slide.slick-loading img {\n display: none;\n}\n.paraui-v3-carousel .slick-slide.dragging img {\n pointer-events: none;\n}\n.paraui-v3-carousel .slick-initialized .slick-slide {\n display: block;\n}\n.paraui-v3-carousel .slick-loading .slick-slide {\n visibility: hidden;\n}\n.paraui-v3-carousel .slick-vertical .slick-slide {\n display: block;\n height: auto;\n}\n.paraui-v3-carousel .slick-arrow.slick-hidden {\n display: none;\n}\n.paraui-v3-carousel .slick-prev,\n.paraui-v3-carousel .slick-next {\n position: absolute;\n top: 50%;\n display: block;\n width: 20px;\n height: 20px;\n margin-top: -10px;\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-v3-carousel .slick-prev:hover,\n.paraui-v3-carousel .slick-next:hover,\n.paraui-v3-carousel .slick-prev:focus,\n.paraui-v3-carousel .slick-next:focus {\n color: transparent;\n background: transparent;\n outline: none;\n}\n.paraui-v3-carousel .slick-prev:hover::before,\n.paraui-v3-carousel .slick-next:hover::before,\n.paraui-v3-carousel .slick-prev:focus::before,\n.paraui-v3-carousel .slick-next:focus::before {\n opacity: 1;\n}\n.paraui-v3-carousel .slick-prev.slick-disabled::before,\n.paraui-v3-carousel .slick-next.slick-disabled::before {\n opacity: 0.25;\n}\n.paraui-v3-carousel .slick-prev {\n left: -25px;\n}\n.paraui-v3-carousel .slick-prev::before {\n content: \"←\";\n}\n.paraui-v3-carousel .slick-next {\n right: -25px;\n}\n.paraui-v3-carousel .slick-next::before {\n content: \"→\";\n}\n.paraui-v3-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-v3-carousel .slick-dots-bottom {\n bottom: 12px;\n}\n.paraui-v3-carousel .slick-dots-top {\n top: 12px;\n bottom: auto;\n}\n.paraui-v3-carousel .slick-dots li {\n position: relative;\n display: inline-block;\n flex: 0 1 auto;\n box-sizing: content-box;\n width: 16px;\n height: 3px;\n margin: 0 2px;\n margin-right: 3px;\n margin-left: 3px;\n padding: 0;\n text-align: center;\n text-indent: -999px;\n vertical-align: top;\n transition: all 0.5s;\n}\n.paraui-v3-carousel .slick-dots li button {\n display: block;\n width: 100%;\n height: 3px;\n padding: 0;\n color: transparent;\n font-size: 0;\n background: rgb(255, 255, 255);\n border: 0;\n border-radius: 1px;\n outline: none;\n cursor: pointer;\n opacity: 0.3;\n transition: all 0.5s;\n}\n.paraui-v3-carousel .slick-dots li button:hover,\n.paraui-v3-carousel .slick-dots li button:focus {\n opacity: 0.75;\n}\n.paraui-v3-carousel .slick-dots li.slick-active {\n width: 24px;\n}\n.paraui-v3-carousel .slick-dots li.slick-active button {\n background: rgb(255, 255, 255);\n opacity: 1;\n}\n.paraui-v3-carousel .slick-dots li.slick-active:hover,\n.paraui-v3-carousel .slick-dots li.slick-active:focus {\n opacity: 1;\n}\n.paraui-v3-carousel .slick-loading .paraui-v3-carousel .slick-track {\n visibility: hidden;\n}\n.paraui-v3-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-v3-carousel-vertical .slick-dots-left {\n right: auto;\n left: 12px;\n}\n.paraui-v3-carousel-vertical .slick-dots-right {\n right: 12px;\n left: auto;\n}\n.paraui-v3-carousel-vertical .slick-dots li {\n width: 3px;\n height: 16px;\n margin: 4px 2px;\n vertical-align: baseline;\n}\n.paraui-v3-carousel-vertical .slick-dots li button {\n width: 3px;\n height: 16px;\n}\n.paraui-v3-carousel-vertical .slick-dots li.slick-active {\n width: 3px;\n height: 24px;\n}\n.paraui-v3-carousel-vertical .slick-dots li.slick-active button {\n width: 3px;\n height: 24px;\n}\n.paraui-v3-carousel-rtl {\n direction: rtl;\n}\n.paraui-v3-carousel-rtl .paraui-v3-carousel .slick-track {\n right: 0;\n left: auto;\n}\n.paraui-v3-carousel-rtl .paraui-v3-carousel .slick-prev {\n right: -25px;\n left: auto;\n}\n.paraui-v3-carousel-rtl .paraui-v3-carousel .slick-prev::before {\n content: \"→\";\n}\n.paraui-v3-carousel-rtl .paraui-v3-carousel .slick-next {\n right: auto;\n left: -25px;\n}\n.paraui-v3-carousel-rtl .paraui-v3-carousel .slick-next::before {\n content: \"←\";\n}\n.paraui-v3-carousel-rtl.paraui-v3-carousel .slick-dots {\n flex-direction: row-reverse;\n}\n.paraui-v3-carousel-rtl.paraui-v3-carousel-vertical .slick-dots {\n flex-direction: column;\n}";
|
|
11
12
|
styleInject(css_248z);
|
|
12
13
|
|
|
14
|
+
//Carousel
|
|
13
15
|
var Carousel = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
14
16
|
var _props$dots = props.dots,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
dots = _props$dots === void 0 ? true : _props$dots,
|
|
18
|
+
_props$arrows = props.arrows,
|
|
19
|
+
arrows = _props$arrows === void 0 ? false : _props$arrows,
|
|
20
|
+
_props$draggable = props.draggable,
|
|
21
|
+
draggable = _props$draggable === void 0 ? false : _props$draggable,
|
|
22
|
+
_props$dotPosition = props.dotPosition,
|
|
23
|
+
dotPosition = _props$dotPosition === void 0 ? 'bottom' : _props$dotPosition,
|
|
24
|
+
className = props.className,
|
|
25
|
+
restProps = __rest(props, ["dots", "arrows", "draggable", "dotPosition", "className"]);
|
|
26
|
+
var slickRef = React__default.useRef();
|
|
27
|
+
//切换到指定面板
|
|
27
28
|
var goTo = function goTo(slide) {
|
|
28
29
|
var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
29
30
|
slickRef.current.slickGoTo(slide, dontAnimate);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
};
|
|
32
|
+
//ref 绑定实例方法
|
|
33
33
|
React__default.useImperativeHandle(ref, function () {
|
|
34
34
|
return {
|
|
35
35
|
goTo: goTo,
|
|
@@ -38,8 +38,8 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
38
38
|
play: slickRef.current.slickPlay,
|
|
39
39
|
pause: slickRef.current.slickPause
|
|
40
40
|
};
|
|
41
|
-
}, [slickRef.current]);
|
|
42
|
-
|
|
41
|
+
}, [slickRef.current]);
|
|
42
|
+
//节点数量
|
|
43
43
|
var prevCount = React__default.useRef(React__default.Children.count(props.children));
|
|
44
44
|
React__default.useEffect(function () {
|
|
45
45
|
if (prevCount.current !== React__default.Children.count(props.children)) {
|
|
@@ -47,20 +47,19 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
|
47
47
|
prevCount.current = React__default.Children.count(props.children);
|
|
48
48
|
}
|
|
49
49
|
}, [props.children]);
|
|
50
|
-
var newProps = Object.assign({}, restProps);
|
|
51
|
-
|
|
50
|
+
var newProps = Object.assign({}, restProps);
|
|
51
|
+
//动画效果
|
|
52
52
|
if (newProps.effect === 'fade') {
|
|
53
53
|
newProps.fade = true;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
55
|
var prefixCls = "".concat($prefixCls, "-carousel");
|
|
57
56
|
var dotsClass = 'slick-dots';
|
|
58
|
-
newProps.vertical = dotPosition === 'left' || dotPosition === 'right';
|
|
59
|
-
|
|
60
|
-
var enableDots = !!dots;
|
|
61
|
-
|
|
62
|
-
var dsClass = clsx(dotsClass, "".concat(dotsClass, "-").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);
|
|
63
|
-
|
|
57
|
+
newProps.vertical = dotPosition === 'left' || dotPosition === 'right';
|
|
58
|
+
//启用dots
|
|
59
|
+
var enableDots = !!dots;
|
|
60
|
+
//dots cls
|
|
61
|
+
var dsClass = clsx(dotsClass, "".concat(dotsClass, "-").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);
|
|
62
|
+
//组件cls
|
|
64
63
|
var cls = clsx(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-vertical"), newProps.vertical));
|
|
65
64
|
return jsx("div", Object.assign({
|
|
66
65
|
className: cls
|