@para-ui/core 2.2.4 → 2.2.5-beta
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.d.ts +12 -6
- package/AutoBox/index.js +203 -15
- package/AutoTips/index.d.ts +12 -6
- package/AutoTips/index.js +84 -15
- package/Breadcrumbs/index.d.ts +13 -7
- package/Breadcrumbs/index.js +227 -15
- package/Button/index.d.ts +92 -11
- package/Button/index.js +348 -14
- package/ButtonGroup/index.d.ts +21 -9
- package/ButtonGroup/index.js +128 -14
- package/Carousel/index.d.ts +17 -11
- package/Carousel/index.js +74 -15
- package/Cascader/index.d.ts +12 -7
- package/Cascader/index.js +166 -15
- package/Checkbox/index.d.ts +13 -7
- package/Checkbox/index.js +105 -14
- package/CheckboxGroup/index.d.ts +15 -9
- package/CheckboxGroup/index.js +138 -14
- package/Collapse/index.d.ts +49 -14
- package/Collapse/index.js +171 -15
- package/CollapseBox/index.d.ts +11 -5
- package/CollapseBox/index.js +164 -15
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +4 -1
- package/ComboSelect/index.d.ts +306 -6
- package/ComboSelect/index.js +1803 -14
- package/Container/index.d.ts +13 -8
- package/Container/index.js +239 -15
- package/DatePicker/index.d.ts +30 -17
- package/DatePicker/index.js +733 -14
- package/Desktop/index.d.ts +14 -6
- package/Desktop/index.js +853 -14
- package/Drawer/index.d.ts +92 -6
- package/Drawer/index.js +186 -14
- package/Dropdown/index.d.ts +29 -0
- package/Dropdown/index.js +67 -0
- package/Empty/index.d.ts +16 -10
- package/Empty/index.js +644 -14
- package/Form/index.d.ts +11 -9
- package/Form/index.js +384 -14
- package/FormItem/index.d.ts +5 -152
- package/FormItem/index.js +81 -14
- package/FunctionModal/index.d.ts +14 -3
- package/FunctionModal/index.js +39 -14
- package/GlobalContext/index.d.ts +38 -8
- package/GlobalContext/index.js +41 -16
- package/Help/index.d.ts +16 -10
- package/Help/index.js +39 -15
- package/HelperText/index.d.ts +11 -5
- package/HelperText/index.js +29 -15
- package/InputLang/index.d.ts +13 -7
- package/InputLang/index.js +270 -14
- package/InputNumber/index.d.ts +16 -10
- package/InputNumber/index.js +308 -14
- package/Label/index.d.ts +12 -6
- package/Label/index.js +81 -14
- package/Loading/index.d.ts +12 -6
- package/Loading/index.js +47 -15
- package/Menu/index.d.ts +123 -5
- package/Menu/index.js +1232 -14
- package/Message/index.d.ts +11 -5
- package/Message/index.js +222 -15
- package/Modal/index.d.ts +142 -40
- package/Modal/index.js +443 -14
- package/MultiBox/index.d.ts +13 -7
- package/MultiBox/index.js +231 -14
- package/Notification/index.d.ts +22 -16
- package/Notification/index.js +266 -15
- package/OperateBtn/index.d.ts +16 -10
- package/OperateBtn/index.js +260 -14
- package/PageHeader/index.d.ts +178 -5
- package/PageHeader/index.js +1171 -14
- package/Pagination/index.d.ts +12 -6
- package/Pagination/index.js +469 -14
- package/ParauiProvider/index.d.ts +9 -8
- package/ParauiProvider/index.js +53 -15
- package/PopConfirm/index.d.ts +23 -10
- package/PopConfirm/index.js +189 -14
- package/Popover/index.d.ts +18 -11
- package/Popover/index.js +66 -15
- package/Progress/index.d.ts +18 -12
- package/Progress/index.js +358 -20
- package/Querying/index.d.ts +15 -9
- package/Querying/index.js +762 -14
- package/Radio/index.d.ts +13 -7
- package/Radio/index.js +94 -14
- package/RadioGroup/index.d.ts +15 -9
- package/RadioGroup/index.js +128 -14
- package/Search/index.d.ts +18 -12
- package/Search/index.js +220 -14
- package/Select/index.d.ts +13 -7
- package/Select/index.js +1288 -14
- package/SelectInput/index.d.ts +11 -5
- package/SelectInput/index.js +51 -14
- package/SingleBox/index.d.ts +13 -7
- package/SingleBox/index.js +194 -14
- package/Slider/index.d.ts +104 -7
- package/Slider/index.js +125 -15
- package/Split/index.d.ts +8 -3
- package/Split/index.js +134 -15
- package/Stepper/index.d.ts +41 -25
- package/Stepper/index.js +99 -15
- package/Switch/index.d.ts +16 -10
- package/Switch/index.js +73 -14
- package/Table/index.d.ts +12 -4
- package/Table/index.js +2725 -14
- package/Tabs/index.d.ts +64 -29
- package/Tabs/index.js +218 -14
- package/Tag/index.d.ts +78 -12
- package/Tag/index.js +286 -14
- package/Test/index.d.ts +3 -2
- package/Test/index.js +9 -16
- package/TextField/index.d.ts +22 -16
- package/TextField/index.js +686 -14
- package/TimePicker/index.d.ts +20 -10
- package/TimePicker/index.js +77 -14
- package/Timeline/index.d.ts +49 -13
- package/Timeline/index.js +150 -15
- package/ToggleButton/index.d.ts +61 -10
- package/ToggleButton/index.js +200 -14
- package/Tooltip/index.d.ts +12 -10
- package/Tooltip/index.js +335 -15
- package/Transfer/index.d.ts +8 -3
- package/Transfer/index.js +343 -14
- package/Tree/index.d.ts +8 -5
- package/Tree/index.js +35 -14
- package/Upload/index.d.ts +179 -8
- package/Upload/index.js +1542 -14
- package/_verture/defineProperty-0590dc61.js +16 -0
- package/_verture/index-0d8e1d07.js +4 -0
- package/_verture/index-14a47097.js +4 -0
- package/_verture/index-342379c6.js +391 -0
- package/_verture/index-458032d7.js +10 -0
- package/_verture/index-46bfb2f0.js +778 -0
- package/_verture/index-50401de7.js +4 -0
- package/_verture/index-5b08df83.js +4 -0
- package/_verture/index-6190b129.js +4 -0
- package/_verture/index-7ef1e3b6.js +1553 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-c60911dc.js +39 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/index-ff4c2a27.js +200 -0
- package/{Tree/interface.d.ts → _verture/interface-128abdd3.js} +15 -25
- package/_verture/interface-a77a851e.js +25 -0
- package/{Table/interface.d.ts → _verture/interface-a9b7c716.js} +20 -28
- package/_verture/intl-336570e4.js +65 -0
- package/_verture/modalContext-25890584.js +228 -0
- package/_verture/modalContext-639f2787.js +58 -0
- package/_verture/slicedToArray-d7722f4b.js +62 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-f8047a75.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/useFormatMessage-ac9d6acf.js +20 -0
- package/_verture/useGlobalProps-af9a2af6.js +12 -0
- package/index.d.ts +88 -128
- package/index.js +160 -19
- package/package.json +59 -22
- package/Button/SplitButton.d.ts +0 -61
- package/Button/lang/en_US.d.ts +0 -4
- package/Button/lang/index.d.ts +0 -9
- package/Button/lang/zh_CN.d.ts +0 -4
- package/Cascader/lang/en_US.d.ts +0 -4
- package/Cascader/lang/index.d.ts +0 -9
- package/Cascader/lang/zh_CN.d.ts +0 -4
- package/Collapse/collapsePanel.d.ts +0 -30
- package/Collapse/motion.d.ts +0 -5
- package/Collapse/util.d.ts +0 -11
- package/CollapseBox/util.d.ts +0 -5
- package/ComboSelect/WithTabsCombo/index.d.ts +0 -11
- package/ComboSelect/WithTabsCombo/interface.d.ts +0 -141
- package/ComboSelect/interface.d.ts +0 -143
- package/ComboSelect/lang/en_US.d.ts +0 -8
- package/ComboSelect/lang/index.d.ts +0 -17
- package/ComboSelect/lang/zh_CN.d.ts +0 -8
- package/ComboSelect/utils.d.ts +0 -12
- package/DatePicker/PickerButton.d.ts +0 -3
- package/DatePicker/PickerTag.d.ts +0 -3
- package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
- package/DatePicker/generatePicker/index.d.ts +0 -77
- package/DatePicker/lang/en_US.d.ts +0 -3
- package/DatePicker/lang/index.d.ts +0 -7
- package/DatePicker/lang/zh_CN.d.ts +0 -3
- package/DatePicker/util.d.ts +0 -20
- package/Drawer/interface.d.ts +0 -83
- package/Drawer/lang/en_US.d.ts +0 -5
- package/Drawer/lang/index.d.ts +0 -11
- package/Drawer/lang/zh_CN.d.ts +0 -5
- package/Empty/images/index.d.ts +0 -2
- package/Empty/lang/en_US.d.ts +0 -6
- package/Empty/lang/index.d.ts +0 -13
- package/Empty/lang/zh_CN.d.ts +0 -6
- package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
- package/FormItem/compoments/formFile/index.d.ts +0 -38
- package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
- package/FormItem/compoments/formSelect/index.d.ts +0 -18
- package/FormItem/errorTips.d.ts +0 -12
- package/FormItem/itemType.d.ts +0 -42
- package/FormItem/validateFunction.d.ts +0 -15
- package/FunctionModal/dialog.d.ts +0 -58
- package/FunctionModal/modalContext.d.ts +0 -14
- package/GlobalContext/componentsProps.d.ts +0 -19
- package/GlobalContext/confirmLocale.d.ts +0 -7
- package/GlobalContext/intl.d.ts +0 -34
- package/GlobalContext/useFormatMessage.d.ts +0 -3
- package/Hooks/useGlobalProps.d.ts +0 -1
- package/Menu/footerExpansion.d.ts +0 -9
- package/Menu/interface.d.ts +0 -139
- package/Menu/logo.d.ts +0 -9
- package/Menu/verticalMenuList.d.ts +0 -14
- package/Modal/Confirm/index.d.ts +0 -66
- package/Modal/lang/en_US.d.ts +0 -5
- package/Modal/lang/index.d.ts +0 -11
- package/Modal/lang/zh_CN.d.ts +0 -5
- package/OperateBtn/lang/en_US.d.ts +0 -4
- package/OperateBtn/lang/index.d.ts +0 -9
- package/OperateBtn/lang/zh_CN.d.ts +0 -4
- package/PageHeader/horizontalMeun.d.ts +0 -9
- package/PageHeader/horizontalMeunRight.d.ts +0 -9
- package/PageHeader/interface.d.ts +0 -167
- package/Pagination/lang/en_US.d.ts +0 -8
- package/Pagination/lang/index.d.ts +0 -17
- package/Pagination/lang/zh_CN.d.ts +0 -8
- package/PopConfirm/lang/en_US.d.ts +0 -5
- package/PopConfirm/lang/index.d.ts +0 -11
- package/PopConfirm/lang/zh_CN.d.ts +0 -5
- package/Popper/index.d.ts +0 -13
- package/Popper/index.js +0 -16
- package/Progress/Line.d.ts +0 -47
- package/Progress/Steps.d.ts +0 -17
- package/Progress/utils.d.ts +0 -6
- package/Querying/images/index.d.ts +0 -2
- package/Querying/lang/en_US.d.ts +0 -4
- package/Querying/lang/index.d.ts +0 -9
- package/Querying/lang/zh_CN.d.ts +0 -4
- package/README.md +0 -489
- package/Select/lang/en_US.d.ts +0 -5
- package/Select/lang/index.d.ts +0 -11
- package/Select/lang/zh_CN.d.ts +0 -5
- package/Slider/interface.d.ts +0 -102
- package/Stepper/icons.d.ts +0 -5
- package/Table/lang/en_US.d.ts +0 -6
- package/Table/lang/index.d.ts +0 -13
- package/Table/lang/zh_CN.d.ts +0 -6
- package/Table/tableBody.d.ts +0 -9
- package/Table/tableBodyElement/index.d.ts +0 -15
- package/Table/tableBodyInterface.d.ts +0 -67
- package/Table/tableContainer/index.d.ts +0 -16
- package/Table/tableElement/index.d.ts +0 -17
- package/Table/tableHead.d.ts +0 -9
- package/Table/tableHeadElement/index.d.ts +0 -15
- package/Table/tableHeadInterface.d.ts +0 -30
- package/Table/tablePagination.d.ts +0 -9
- package/Table/tablePaginationInterFace.d.ts +0 -24
- package/Table/tdElement/index.d.ts +0 -15
- package/Table/thElement/index.d.ts +0 -15
- package/Table/trElement/index.d.ts +0 -15
- package/Table/util.d.ts +0 -16
- package/Tag/TagGroup.d.ts +0 -66
- package/TimePicker/locale/en_US.d.ts +0 -3
- package/TimePicker/locale/zh_CN.d.ts +0 -3
- package/TimePicker/style/index.d.ts +0 -1
- package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
- package/Transfer/lang/en_US.d.ts +0 -6
- package/Transfer/lang/index.d.ts +0 -13
- package/Transfer/lang/zh_CN.d.ts +0 -6
- package/Tree/OperateBar/index.d.ts +0 -13
- package/Tree/Tree.d.ts +0 -4
- package/Tree/lang/en_US.d.ts +0 -8
- package/Tree/lang/index.d.ts +0 -17
- package/Tree/lang/zh_CN.d.ts +0 -8
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +0 -26
- package/Tree/utils/treeUtil.d.ts +0 -15
- package/Upload/Dragger/index.d.ts +0 -10
- package/Upload/ErroTip/index.d.ts +0 -13
- package/Upload/ImageUpload/index.d.ts +0 -14
- package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
- package/Upload/ImgCrop/constants.d.ts +0 -7
- package/Upload/ImgCrop/index.d.ts +0 -6
- package/Upload/ImgCrop/interface.d.ts +0 -24
- package/Upload/UploadList/index.d.ts +0 -5
- package/Upload/interface.d.ts +0 -134
- package/Upload/lang/en_US.d.ts +0 -12
- package/Upload/lang/index.d.ts +0 -25
- package/Upload/lang/zh_CN.d.ts +0 -12
- package/cdn/AutoBox/index.js +0 -29
- package/cdn/AutoTips/index.js +0 -40
- package/cdn/Breadcrumbs/index.js +0 -53
- package/cdn/Button/index.js +0 -79
- package/cdn/ButtonGroup/index.js +0 -79
- package/cdn/Carousel/index.js +0 -6
- package/cdn/Cascader/index.js +0 -42
- package/cdn/Checkbox/index.js +0 -53
- package/cdn/CheckboxGroup/index.js +0 -53
- package/cdn/Collapse/index.js +0 -27
- package/cdn/CollapseBox/index.js +0 -1
- package/cdn/ColorPicker/index.js +0 -1
- package/cdn/ComboSelect/index.js +0 -438
- package/cdn/Container/index.js +0 -1
- package/cdn/DatePicker/index.js +0 -185
- package/cdn/Desktop/index.js +0 -24
- package/cdn/Drawer/index.js +0 -84
- package/cdn/Empty/index.js +0 -1
- package/cdn/Form/index.js +0 -477
- package/cdn/FormItem/index.js +0 -477
- package/cdn/FunctionModal/index.js +0 -144
- package/cdn/GlobalContext/index.js +0 -1
- package/cdn/Help/index.js +0 -53
- package/cdn/HelperText/index.js +0 -1
- package/cdn/InputLang/index.js +0 -144
- package/cdn/InputNumber/index.js +0 -118
- package/cdn/Label/index.js +0 -53
- package/cdn/Loading/index.js +0 -14
- package/cdn/Menu/index.js +0 -40
- package/cdn/Message/index.js +0 -53
- package/cdn/Modal/index.js +0 -144
- package/cdn/MultiBox/index.js +0 -131
- package/cdn/Notification/index.js +0 -66
- package/cdn/OperateBtn/index.js +0 -92
- package/cdn/PageHeader/index.js +0 -92
- package/cdn/Pagination/index.js +0 -214
- package/cdn/ParauiProvider/index.js +0 -9
- package/cdn/PopConfirm/index.js +0 -131
- package/cdn/Popover/index.js +0 -16
- package/cdn/Popper/index.js +0 -26
- package/cdn/Progress/index.js +0 -58
- package/cdn/Querying/index.js +0 -1
- package/cdn/Radio/index.js +0 -53
- package/cdn/RadioGroup/index.js +0 -53
- package/cdn/Search/index.js +0 -144
- package/cdn/Select/index.js +0 -131
- package/cdn/SelectInput/index.js +0 -131
- package/cdn/SingleBox/index.js +0 -131
- package/cdn/Slider/index.js +0 -16
- package/cdn/Split/index.js +0 -1
- package/cdn/Stepper/index.js +0 -154
- package/cdn/Switch/index.js +0 -71
- package/cdn/Table/index.js +0 -292
- package/cdn/Tabs/index.js +0 -165
- package/cdn/Tag/index.js +0 -27
- package/cdn/Test/index.js +0 -1
- package/cdn/TextField/index.js +0 -105
- package/cdn/TimePicker/index.js +0 -185
- package/cdn/Timeline/index.js +0 -16
- package/cdn/ToggleButton/index.js +0 -79
- package/cdn/Tooltip/index.js +0 -40
- package/cdn/Transfer/index.js +0 -170
- package/cdn/Tree/index.js +0 -170
- package/cdn/Upload/index.js +0 -252
- package/style.css +0 -72
package/Popover/index.js
CHANGED
|
@@ -1,15 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
|
|
1
|
+
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { Tooltip } from '../Tooltip/index.js';
|
|
5
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
6
|
+
import '../_verture/slicedToArray-d7722f4b.js';
|
|
7
|
+
import 'rc-tooltip';
|
|
8
|
+
import 'rc-tooltip/lib/placements';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
|
|
11
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/6/7 上午11:06\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-popover {\n color: rgb(46, 55, 67);\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-popover::after {\n position: absolute;\n background: rgba(255, 255, 255, 0.01);\n content: \"\";\n}\n.paraui-popover-hidden {\n display: none;\n}\n.paraui-popover-inner {\n background-color: rgb(255, 255, 255);\n background-clip: padding-box;\n border-radius: 4px;\n box-shadow: 0px 2px 8px 0px rgba(171, 176, 185, 0.4);\n}\n.paraui-popover-title {\n min-height: 32px;\n margin: 0;\n padding: 4px 16px;\n color: rgb(46, 55, 67);\n font-weight: 400;\n border-bottom: 1px solid #f0f0f0;\n}\n.paraui-popover-inner-content {\n color: rgb(46, 55, 67);\n}\n.paraui-popover-buttons {\n margin-bottom: 4px;\n text-align: right;\n}\n.paraui-popover-buttons button {\n margin-left: 8px;\n}\n.paraui-popover-arrow {\n position: absolute;\n display: block;\n width: 16px;\n height: 16px;\n overflow: hidden;\n background: transparent;\n pointer-events: none;\n}\n.paraui-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-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-popover-placement-top .paraui-popover-arrow, .paraui-popover-placement-topLeft .paraui-popover-arrow, .paraui-popover-placement-topRight .paraui-popover-arrow {\n bottom: -0.6862915px;\n}\n.paraui-popover-placement-top .paraui-popover-arrow-content, .paraui-popover-placement-topLeft .paraui-popover-arrow-content, .paraui-popover-placement-topRight .paraui-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateY(-1px) rotate(45deg);\n}\n.paraui-popover-placement-top .paraui-popover-arrow {\n left: 50%;\n transform: translateX(-50%);\n}\n.paraui-popover-placement-topLeft .paraui-popover-arrow {\n left: 16px;\n}\n.paraui-popover-placement-topRight .paraui-popover-arrow {\n right: 16px;\n}\n.paraui-popover-placement-right .paraui-popover-arrow, .paraui-popover-placement-rightTop .paraui-popover-arrow, .paraui-popover-placement-rightBottom .paraui-popover-arrow {\n left: -0.6862915px;\n}\n.paraui-popover-placement-right .paraui-popover-arrow-content, .paraui-popover-placement-rightTop .paraui-popover-arrow-content, .paraui-popover-placement-rightBottom .paraui-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(1px) rotate(135deg);\n}\n.paraui-popover-placement-right .paraui-popover-arrow {\n top: 50%;\n transform: translateY(-50%);\n}\n.paraui-popover-placement-rightTop .paraui-popover-arrow {\n top: 12px;\n}\n.paraui-popover-placement-rightBottom .paraui-popover-arrow {\n bottom: 12px;\n}\n.paraui-popover-placement-bottom .paraui-popover-arrow, .paraui-popover-placement-bottomLeft .paraui-popover-arrow, .paraui-popover-placement-bottomRight .paraui-popover-arrow {\n top: -0.6862915px;\n}\n.paraui-popover-placement-bottom .paraui-popover-arrow-content, .paraui-popover-placement-bottomLeft .paraui-popover-arrow-content, .paraui-popover-placement-bottomRight .paraui-popover-arrow-content {\n box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.06);\n transform: translateY(1px) rotate(-135deg);\n}\n.paraui-popover-placement-bottom .paraui-popover-arrow {\n left: 50%;\n transform: translateX(-50%);\n}\n.paraui-popover-placement-bottomLeft .paraui-popover-arrow {\n left: 16px;\n}\n.paraui-popover-placement-bottomRight .paraui-popover-arrow {\n right: 16px;\n}\n.paraui-popover-placement-left .paraui-popover-arrow, .paraui-popover-placement-leftTop .paraui-popover-arrow, .paraui-popover-placement-leftBottom .paraui-popover-arrow {\n right: -0.6862915px;\n}\n.paraui-popover-placement-left .paraui-popover-arrow-content, .paraui-popover-placement-leftTop .paraui-popover-arrow-content, .paraui-popover-placement-leftBottom .paraui-popover-arrow-content {\n box-shadow: 3px 3px 7px rgba(0, 0, 0, 0.07);\n transform: translateX(-1px) rotate(-45deg);\n}\n.paraui-popover-placement-left .paraui-popover-arrow {\n top: 50%;\n transform: translateY(-50%);\n}\n.paraui-popover-placement-leftTop .paraui-popover-arrow {\n top: 12px;\n}\n.paraui-popover-placement-leftBottom .paraui-popover-arrow {\n bottom: 12px;\n}\n\n.paraui-popover-zoom-big-enter,\n.paraui-popover-zoom-big-appear {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-popover-zoom-big-leave {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-play-state: paused;\n}\n\n.paraui-popover-zoom-big-enter.paraui-popover-zoom-big-enter-active,\n.paraui-popover-zoom-big-appear.paraui-popover-zoom-big-appear-active {\n animation-name: parauiPopoverZoomBigIn;\n animation-play-state: running;\n}\n\n.paraui-popover-zoom-big-leave.paraui-popover-zoom-big-leave-active {\n animation-name: parauiPopoverZoomBigOut;\n animation-play-state: running;\n pointer-events: none;\n}\n\n.paraui-popover-zoom-big-enter,\n.paraui-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.paraui-popover-zoom-big-enter-prepare,\n.paraui-popover-zoom-big-appear-prepare {\n transform: none;\n}\n\n.paraui-popover-zoom-big-leave {\n animation-timing-function: cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n\n@keyframes parauiPopoverZoomBigIn {\n 0% {\n transform: scale(0.8);\n opacity: 0;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@keyframes parauiPopoverZoomBigOut {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0.8);\n opacity: 0;\n }\n}";
|
|
12
|
+
styleInject(css_248z);
|
|
13
|
+
|
|
14
|
+
var Popover = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
15
|
+
var title = props.title,
|
|
16
|
+
content = props.content,
|
|
17
|
+
restProps = __rest(props, ["title", "content"]);
|
|
18
|
+
|
|
19
|
+
var getPopupContainer = function getPopupContainer(triggerNode) {
|
|
20
|
+
var container;
|
|
21
|
+
|
|
22
|
+
if (!props.getPopupContainer) {
|
|
23
|
+
container = document.querySelector('.para-container-right');
|
|
24
|
+
if (!container) container = document.body;
|
|
25
|
+
} else {
|
|
26
|
+
container = props.getPopupContainer(triggerNode) || document.body;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return container;
|
|
30
|
+
}; //浮层
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
var getOverlay = function getOverlay(prefixCls) {
|
|
34
|
+
if (!title && !content) return null;
|
|
35
|
+
return jsxs(Fragment, {
|
|
36
|
+
children: [title && jsx("div", Object.assign({
|
|
37
|
+
className: "".concat(prefixCls, "-title")
|
|
38
|
+
}, {
|
|
39
|
+
children: title
|
|
40
|
+
})), jsx("div", Object.assign({
|
|
41
|
+
className: "".concat(prefixCls, "-inner-content")
|
|
42
|
+
}, {
|
|
43
|
+
children: content
|
|
44
|
+
}))]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var prefixCls = 'paraui-popover';
|
|
49
|
+
return jsx(Tooltip, Object.assign({}, restProps, {
|
|
50
|
+
prefixCls: prefixCls,
|
|
51
|
+
ref: ref,
|
|
52
|
+
title: getOverlay(prefixCls),
|
|
53
|
+
transitionName: 'paraui-popover-zoom-big',
|
|
54
|
+
getPopupContainer: getPopupContainer
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
Popover.displayName = 'Popover';
|
|
58
|
+
Popover.defaultProps = {
|
|
59
|
+
placement: 'bottom',
|
|
60
|
+
trigger: 'click',
|
|
61
|
+
mouseEnterDelay: 0.1,
|
|
62
|
+
mouseLeaveDelay: 0.1,
|
|
63
|
+
arrow: false
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { Popover, Popover as default };
|
package/Progress/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
import React__default, { FunctionComponent } from 'react';
|
|
2
|
+
import styleInject from './node_modules/style-inject/dist/style-inject.es.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-progress-line .progress-outer {\n display: flex;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.paraui-progress-line .progress-outer .progress-inner {\n width: 100%;\n}\n.paraui-progress-line .progress-outer .progress-inner .rc-progress-line {\n height: 10px;\n width: 100%;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer .steps-item {\n flex-shrink: 0;\n min-width: 2px;\n margin-right: 2px;\n background: #f3f3f3;\n transition: all 0.3s;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer .steps-item-active {\n background-color: #2DB7F5;\n}\n.paraui-progress-line .progress-outer .progress-inner .trail-bar {\n position: relative;\n display: inline-block;\n width: 100%;\n overflow: hidden;\n vertical-align: middle;\n background-color: rgba(0, 0, 0, 0.0392156863);\n border-radius: 100px;\n}\n.paraui-progress-line .progress-outer .progress-inner .trail-bar .active-bar {\n position: relative;\n background-color: var(--ant-primary-color);\n border-radius: 100px;\n transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;\n}\n.paraui-progress-line .progress-outer .progress-text {\n font-size: 12px;\n font-weight: 700;\n text-align: left;\n color: #3d66f8;\n display: inline-block;\n margin-left: 20px;\n white-space: nowrap;\n text-align: left;\n vertical-align: middle;\n word-break: normal;\n display: flex;\n align-items: center;\n}\n.paraui-progress-line .progress-outer .progress-text svg {\n width: 14px;\n height: 14px;\n position: relative;\n top: 2px;\n}\n.paraui-progress-line .progress-outer .progress-text svg.success {\n color: #41D658 !important;\n}\n.paraui-progress-line .progress-outer .progress-text svg.error {\n color: #F46B53 !important;\n}\n.paraui-progress-circle, .paraui-progress-dashboard {\n display: inline-block;\n position: relative;\n margin: 0 5px;\n}\n.paraui-progress-circle .progress-outer .progress-text, .paraui-progress-dashboard .progress-outer .progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.8509803922);\n font-size: 1em;\n line-height: 1;\n white-space: normal;\n text-align: center;\n transform: translate(-50%, -50%);\n}\n.paraui-progress-circle .progress-outer .progress-text svg, .paraui-progress-dashboard .progress-outer .progress-text svg {\n width: 2em;\n height: 2em;\n}\n.paraui-progress-circle .progress-outer .progress-text svg.success, .paraui-progress-dashboard .progress-outer .progress-text svg.success {\n color: #52C41A !important;\n}\n.paraui-progress-circle .progress-outer .progress-text svg.error, .paraui-progress-dashboard .progress-outer .progress-text svg.error {\n color: #FF4D4F !important;\n}\n.paraui-progress-success-status .progress-text {\n color: #52c41a !important;\n}\n.paraui-progress-exception-status .progress-text {\n color: #ff4d4f !important;\n}\n.paraui-progress-active-status .active-bar:before {\n position: absolute;\n inset: 0;\n background: #fff;\n border-radius: 10px;\n opacity: 0;\n -webkit-animation: progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;\n animation: progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;\n content: \"\";\n}\n\n@keyframes progress-active {\n 0% {\n transform: translateX(-100%) scaleX(0);\n opacity: 0.1;\n }\n 20% {\n transform: translateX(-100%) scaleX(0);\n opacity: 0.5;\n }\n 100% {\n transform: translateX(0) scaleX(1);\n opacity: 0;\n }\n}";
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @author jill
|
|
3
9
|
* @date 2022/3/10 18:25
|
|
4
10
|
* @description 进度条
|
|
5
11
|
*/
|
|
6
|
-
|
|
7
|
-
import "./index.scss";
|
|
12
|
+
|
|
8
13
|
/** 进度条类型 **/
|
|
9
14
|
declare enum ProgressTypes {
|
|
10
15
|
"line" = 0,
|
|
11
16
|
"circle" = 1,
|
|
12
17
|
"dashboard" = 2
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
declare type ProgressType = typeof ProgressTypes[number];
|
|
15
20
|
/** 进度条状态 **/
|
|
16
21
|
declare enum ProgressStatuses {
|
|
17
22
|
"normal" = 0,
|
|
@@ -20,7 +25,7 @@ declare enum ProgressStatuses {
|
|
|
20
25
|
"success" = 3
|
|
21
26
|
}
|
|
22
27
|
/** 渐变进度条入参格式 两种 **/
|
|
23
|
-
|
|
28
|
+
declare type StringGradients = {
|
|
24
29
|
[percentage: string]: string;
|
|
25
30
|
};
|
|
26
31
|
declare type FromToGradients = {
|
|
@@ -28,19 +33,19 @@ declare type FromToGradients = {
|
|
|
28
33
|
to: string;
|
|
29
34
|
};
|
|
30
35
|
declare type ColorStringGradients = [string, StringGradients];
|
|
31
|
-
|
|
36
|
+
declare type ProgressGradient = {
|
|
32
37
|
direction?: string;
|
|
33
38
|
} & (StringGradients | FromToGradients);
|
|
34
39
|
/** 进度条渐变方向 **/
|
|
35
|
-
|
|
40
|
+
declare type DirectionType = "ltr" | "rtl" | undefined;
|
|
36
41
|
/** 成功的进度条的配置 **/
|
|
37
|
-
|
|
42
|
+
interface SuccessProps {
|
|
38
43
|
/** 进度条值 **/
|
|
39
44
|
percent: number;
|
|
40
45
|
/** 进度条颜色 **/
|
|
41
46
|
strokeColor?: string;
|
|
42
47
|
}
|
|
43
|
-
|
|
48
|
+
interface ProgressProps {
|
|
44
49
|
/** 自定义样式名 **/
|
|
45
50
|
className?: string;
|
|
46
51
|
/** 类型,可选 line circle dashboard **/
|
|
@@ -48,7 +53,7 @@ export interface ProgressProps {
|
|
|
48
53
|
/** 百分比 **/
|
|
49
54
|
percent?: number | number[];
|
|
50
55
|
/** 内容的模板函数 **/
|
|
51
|
-
format?: (percent?: number | number[], successPercent?: number) =>
|
|
56
|
+
format?: (percent?: number | number[], successPercent?: number) => React__default.ReactNode;
|
|
52
57
|
/** 状态,可选:success exception normal active(仅限 line) **/
|
|
53
58
|
status?: typeof ProgressStatuses[number];
|
|
54
59
|
/** 是否显示进度数值或状态图标 **/
|
|
@@ -75,7 +80,8 @@ export interface ProgressProps {
|
|
|
75
80
|
steps?: number;
|
|
76
81
|
/** 渐变颜色的方向 **/
|
|
77
82
|
direction?: DirectionType;
|
|
78
|
-
children?:
|
|
83
|
+
children?: React__default.ReactNode;
|
|
79
84
|
}
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
declare const Progress: FunctionComponent<ProgressProps>;
|
|
86
|
+
|
|
87
|
+
export { DirectionType, Progress, ProgressGradient, ProgressProps, ProgressType, StringGradients, SuccessProps, Progress as default };
|
package/Progress/index.js
CHANGED
|
@@ -1,20 +1,358 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
t(7418);var o=t(8156),n=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var s=Symbol.for;n=s("react.element"),s("react.fragment")}var i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,r,t){var o,s={},l=null,u=null;for(o in void 0!==t&&(l=""+t),void 0!==r.key&&(l=""+r.key),void 0!==r.ref&&(u=r.ref),r)a.call(r,o)&&!c.hasOwnProperty(o)&&(s[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===s[o]&&(s[o]=r[o]);return{$$typeof:n,type:e,key:l,ref:u,props:s,_owner:i.current}}r.jsx=l,r.jsxs=l},5893:function(e,r,t){"use strict";e.exports=t(5251)},2738:function(e,r,t){var o=t(3379),n=t(1442);"string"==typeof(n=n.__esModule?n.default:n)&&(n=[[e.id,n,""]]);var s={insert:("body","body"),singleton:!1};o(n,s);e.exports=n.locals||{}},3379:function(e,r,t){"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),i=[];function a(e){for(var r=-1,t=0;t<i.length;t++)if(i[t].identifier===e){r=t;break}return r}function c(e,r){for(var t={},o=[],n=0;n<e.length;n++){var s=e[n],c=r.base?s[0]+r.base:s[0],l=t[c]||0,u="".concat(c," ").concat(l);t[c]=l+1;var p=a(u),f={css:s[1],media:s[2],sourceMap:s[3]};-1!==p?(i[p].references++,i[p].updater(f)):i.push({identifier:u,updater:h(f,r),references:1}),o.push(u)}return o}function l(e){var r=document.createElement("style"),o=e.attributes||{};if(void 0===o.nonce){var n=t.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(e){r.setAttribute(e,o[e])})),"function"==typeof e.insert)e.insert(r);else{var i=s(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(r)}return r}var u,p=(u=[],function(e,r){return u[e]=r,u.filter(Boolean).join("\n")});function f(e,r,t,o){var n=t?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(e.styleSheet)e.styleSheet.cssText=p(r,n);else{var s=document.createTextNode(n),i=e.childNodes;i[r]&&e.removeChild(i[r]),i.length?e.insertBefore(s,i[r]):e.appendChild(s)}}function d(e,r,t){var o=t.css,n=t.media,s=t.sourceMap;if(n?e.setAttribute("media",n):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleSheet)e.styleSheet.cssText=o;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(o))}}var g=null,y=0;function h(e,r){var t,o,n;if(r.singleton){var s=y++;t=g||(g=l(r)),o=f.bind(null,t,s,!1),n=f.bind(null,t,s,!0)}else t=l(r),o=d.bind(null,t,r),n=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return o(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;o(e=r)}else n()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=n());var t=c(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var o=0;o<t.length;o++){var n=a(t[o]);i[n].references--}for(var s=c(e,r),l=0;l<t.length;l++){var u=a(t[l]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}t=s}}}},2004:function(e){"use strict";e.exports=o},1014:function(e){"use strict";e.exports=r},5927:function(e){"use strict";e.exports=n},6649:function(e){"use strict";e.exports=t},8156:function(r){"use strict";r.exports=e}},i={};function a(e){var r=i[e];if(void 0!==r)return r.exports;var t=i[e]={id:e,exports:{}};return s[e](t,t.exports,a),t.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nc=void 0;var c={};return function(){"use strict";a.r(c),a.d(c,{Progress:function(){return $},default:function(){return H}});var e=a(5893);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},r.apply(this,arguments)}function t(e,r){if(null==e)return{};var t,o,n=function(e,r){if(null==e)return{};var t,o,n={},s=Object.keys(e);for(o=0;o<s.length;o++)t=s[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)t=s[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}var o=a(8156),n=a(4184),s=a.n(n),i={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},l=function(){var e=(0,o.useRef)([]),r=(0,o.useRef)(null);return(0,o.useEffect)((function(){var t=Date.now(),o=!1;e.current.forEach((function(e){if(e){o=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",r.current&&t-r.current<100&&(n.transitionDuration="0s, 0s")}})),o&&(r.current=Date.now())})),e.current},u=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],p=function(e){var n=e.className,i=e.percent,a=e.prefixCls,c=e.strokeColor,p=e.strokeLinecap,f=e.strokeWidth,d=e.style,g=e.trailColor,y=e.trailWidth,h=e.transition,v=t(e,u);delete v.gapPosition;var m=Array.isArray(i)?i:[i],b=Array.isArray(c)?c:[c],x=l(),k=f/2,j=100-f/2,O="M ".concat("round"===p?k:0,",").concat(k,"\n L ").concat("round"===p?j:100,",").concat(k),w="0 0 100 ".concat(f),C=0;return o.createElement("svg",r({className:s()("".concat(a,"-line"),n),viewBox:w,preserveAspectRatio:"none",style:d},v),o.createElement("path",{className:"".concat(a,"-line-trail"),d:O,strokeLinecap:p,stroke:g,strokeWidth:y||f,fillOpacity:"0"}),m.map((function(e,r){var t=1;switch(p){case"round":t=1-f/100;break;case"square":t=1-f/2/100;break;default:t=1}var n={strokeDasharray:"".concat(e*t,"px, 100px"),strokeDashoffset:"-".concat(C,"px"),transition:h||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},s=b[r]||b[b.length-1];return C+=e,o.createElement("path",{key:r,className:"".concat(a,"-line-path"),d:O,strokeLinecap:p,stroke:s,strokeWidth:f,fillOpacity:"0",ref:function(e){x[r]=e},style:n})})))};p.defaultProps=i,p.displayName="Line";function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function g(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,n,s=[],i=!0,a=!1;try{for(t=t.call(e);!(i=(o=t.next()).done)&&(s.push(o.value),!r||s.length!==r);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==t.return||t.return()}finally{if(a)throw n}}return s}}(e,r)||function(e,r){if(e){if("string"==typeof e)return d(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?d(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var y=0,h=!("undefined"==typeof window||!window.document||!window.document.createElement);var v=function(e){var r=g(o.useState(),2),t=r[0],n=r[1];return o.useEffect((function(){var e;n("rc_progress_".concat((h?(e=y,y+=1):e="TEST_OR_SSR",e)))}),[]),e||t},m=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function b(e){return+e.replace("%","")}function x(e){var r=null!=e?e:[];return Array.isArray(r)?r:[r]}var k=100,j=function(e,r,t,o,n,s,i,a,c,l){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,p=t/100*360*((360-s)/360),f=0===s?0:{bottom:0,top:180,left:90,right:-90}[i],d=(100-o)/100*r;return"round"===c&&100!==o&&(d+=l/2)>=r&&(d=r-.01),{stroke:"string"==typeof a?a:void 0,strokeDasharray:"".concat(r,"px ").concat(e),strokeDashoffset:d+u,transform:"rotate(".concat(n+p+f,"deg)"),transformOrigin:"50% 50%",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},O=function(e){var n,i,a,c=e.id,u=e.prefixCls,p=e.steps,d=e.strokeWidth,g=e.trailWidth,y=e.gapDegree,h=void 0===y?0:y,O=e.gapPosition,w=e.trailColor,C=e.strokeLinecap,S=e.style,N=e.className,P=e.strokeColor,E=e.percent,_=t(e,m),D=v(c),W="".concat(D,"-gradient"),A=50-d/2,I=2*Math.PI*A,L=h>0?90+h/2:-90,F=I*((360-h)/360),M="object"===f(p)?p:{count:p,space:2},R=M.count,T=M.space,q=j(I,F,0,100,L,h,O,w,C,d),U=x(E),B=x(P),X=B.find((function(e){return e&&"object"===f(e)})),z=l();return o.createElement("svg",r({className:s()("".concat(u,"-circle"),N),viewBox:"0 0 ".concat(k," ").concat(k),style:S,id:c},_),X&&o.createElement("defs",null,o.createElement("linearGradient",{id:W,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(X).sort((function(e,r){return b(e)-b(r)})).map((function(e,r){return o.createElement("stop",{key:r,offset:e,stopColor:X[e]})})))),!R&&o.createElement("circle",{className:"".concat(u,"-circle-trail"),r:A,cx:50,cy:50,stroke:w,strokeLinecap:C,strokeWidth:g||d,style:q}),R?(n=Math.round(R*(U[0]/100)),i=100/R,a=0,new Array(R).fill(null).map((function(e,r){var t=r<=n-1?B[0]:w,s=t&&"object"===f(t)?"url(#".concat(W,")"):void 0,c=j(I,F,a,i,L,h,O,t,"butt",d,T);return a+=100*(F-c.strokeDashoffset+T)/F,o.createElement("circle",{key:r,className:"".concat(u,"-circle-path"),r:A,cx:50,cy:50,stroke:s,strokeWidth:d,opacity:1,style:c,ref:function(e){z[r]=e}})}))):function(){var e=0;return U.map((function(r,t){var n=B[t]||B[B.length-1],s=n&&"object"===f(n)?"url(#".concat(W,")"):void 0,i=j(I,F,e,r,L,h,O,n,C,d);return e+=r,o.createElement("circle",{key:t,className:"".concat(u,"-circle-path"),r:A,cx:50,cy:50,stroke:s,strokeLinecap:C,strokeWidth:d,opacity:0===r?0:1,style:i,ref:function(e){z[t]=e}})})).reverse()}())};O.defaultProps=i,O.displayName="Circle";var w=O,C=a(1014),S=a.n(C),N=a(6649),P=a.n(N),E=a(2004),_=a.n(E),D=a(5927),W=a.n(D),A=function(){return A=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},A.apply(this,arguments)},I=function(r){for(var t=r.steps,o=r.percent,n=void 0===o?0:o,s=r.strokeWidth,i=void 0===s?8:s,a=r.strokeColor,c=r.trailColor,l=r.children,u="number"==typeof n?Math.round(t*(n/100)):1,p=[],f=0;f<t;f+=1)p.push((0,e.jsx)("div",{className:f<=u-1?"steps-item steps-item-active":"steps-item",style:{backgroundColor:f<=u-1?a:c,width:14,height:i}},f));return(0,e.jsxs)("div",A({className:"steps-outer"},{children:[p,l]}))};function L(e){return!e||e<0?0:e>100?100:e}var F,M,R=function(){return R=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},R.apply(this,arguments)},T=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t},q=function(e,r){var t,o,n=e.from,s=void 0===n?"#3D66F8":n,i=e.to,a=void 0===i?"#4F93F0":i,c=e.direction,l=void 0===c?"rtl"===r?"to left":"to right":c,u=T(e,["from","to","direction"]);if(0!==Object.keys(u).length){var p=(t=u,o=[],Object.keys(t).forEach((function(e){var r=parseFloat(e.replace(/%/g,""));isNaN(r)||o.push({key:r,value:t[e]})})),(o=o.sort((function(e,r){return e.key-r.key}))).map((function(e){var r=e.key,t=e.value;return"".concat(t," ").concat(r,"%")})).join(", "));return{backgroundImage:"linear-gradient(".concat(l,", ").concat(p,")")}}return{backgroundImage:"linear-gradient(".concat(l,", ").concat(s,", ").concat(a,")")}},U=function(r){var t=r.direction,o=r.percent,n=r.strokeWidth,s=r.strokeColor,i=r.strokeLinecap,a=r.trailColor,c=s&&"string"!=typeof s?q(s,t):{background:s},l=a?{backgroundColor:a}:void 0,u=R({width:"".concat(L(o),"%"),height:n||10,borderRadius:"square"===i?0:""},c);return(0,e.jsx)("div",R({className:"trail-bar",style:l},{children:(0,e.jsx)("div",{className:"active-bar",style:u})}))},B=(a(2738),function(){return B=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},B.apply(this,arguments)}),X=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t};!function(e){e[e.line=0]="line",e[e.circle=1]="circle",e[e.dashboard=2]="dashboard"}(F||(F={})),function(e){e[e.normal=0]="normal",e[e.exception=1]="exception",e[e.active=2]="active",e[e.success=3]="success"}(M||(M={}));var z={success:"#41D658",exception:"#F46B53",normal:"#3D66F8",active:"#3D66F8"},$=function(r){var t,o=r.type,n=void 0===o?"line":o,s=r.className,i=(r.children,r.status),a=r.width,c=void 0===a?132:a,l=r.showInfo,u=void 0===l||l,p=r.format,f=r.success,d=r.percent,g=void 0===d?0:d,y=r.steps,h=r.direction,v=r.strokeColor,m=r.gapDegree,b=void 0===m?75:m,x=X(r,["type","className","children","status","width","showInfo","format","success","percent","steps","direction","strokeColor","gapDegree"]),k=function(){return v||(f&&f.percent<g?[f.strokeColor||z.success,z.normal]:O?z.success:z[i||"normal"])},j=function(){return f&&f.percent<g&&"number"==typeof g?[f.percent,g-f.percent]:g},O=g&&100===g&&!i||"success"===i,C="circle"===n||"dashboard"===n?{width:c,height:c}:{},N=function(){return p?p(g):O?"circle"===n?(0,e.jsx)(_(),{className:"success"}):(0,e.jsx)(S(),{className:"success"}):"exception"===i?"circle"===n?(0,e.jsx)(W(),{className:"error"}):(0,e.jsx)(P(),{className:"error"}):L(g)+"%"},E=y?(0,e.jsx)(I,B({steps:y,strokeColor:k(),percent:j()},x,{children:u&&(0,e.jsx)("div",B({className:"progress-text"},{children:N()}))})):(0,e.jsx)(U,B({strokeColor:k(),percent:j(),direction:h},x,{children:" "})),D=(0,e.jsx)(w,B({strokeWidth:6,trailWidth:6,strokeColor:k(),percent:j()},x)),A=(0,e.jsx)(w,B({strokeWidth:6,trailWidth:6,gapPosition:"bottom",gapDegree:b,strokeColor:k(),percent:j()},x));return(0,e.jsx)("div",B({className:(t="paraui-progress paraui-progress-".concat(n||"default"),O&&(t+=" paraui-progress-success-status"),"exception"===i&&(t+=" paraui-progress-exception-status"),"active"===i&&(t+=" paraui-progress-active-status"),s&&(t+=" "+s),t)},{children:(0,e.jsxs)("div",B({className:"progress-outer"},{children:[(0,e.jsx)("div",B({className:"progress-inner",style:C},{children:"dashboard"===n?A:"circle"===n?D:E})),u&&!y&&(0,e.jsx)("div",B({className:"progress-text"},{children:N()}))]}))}))},H=$}(),c}()}));
|
|
1
|
+
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Circle } from 'rc-progress';
|
|
4
|
+
import SuccessOutlined from '@para-ui/icons/CheckCircleF';
|
|
5
|
+
import ErrorOutlined from '@para-ui/icons/CloseCircleF';
|
|
6
|
+
import Check from '@para-ui/icons/Check';
|
|
7
|
+
import CloseIcon from '@para-ui/icons/Close';
|
|
8
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
|
+
|
|
10
|
+
var Steps = function Steps(props) {
|
|
11
|
+
var steps = props.steps,
|
|
12
|
+
_props$percent = props.percent,
|
|
13
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
14
|
+
_props$strokeWidth = props.strokeWidth,
|
|
15
|
+
strokeWidth = _props$strokeWidth === void 0 ? 8 : _props$strokeWidth,
|
|
16
|
+
strokeColor = props.strokeColor,
|
|
17
|
+
trailColor = props.trailColor,
|
|
18
|
+
children = props.children;
|
|
19
|
+
/** 计算出应该高亮多少步 **/
|
|
20
|
+
|
|
21
|
+
var current = typeof percent === "number" ? Math.round(steps * (percent / 100)) : 1;
|
|
22
|
+
var styledSteps = [];
|
|
23
|
+
|
|
24
|
+
for (var i = 0; i < steps; i += 1) {
|
|
25
|
+
styledSteps.push(jsx("div", {
|
|
26
|
+
className: i <= current - 1 ? "steps-item steps-item-active" : "steps-item",
|
|
27
|
+
style: {
|
|
28
|
+
backgroundColor: i <= current - 1 ? strokeColor : trailColor,
|
|
29
|
+
width: 14,
|
|
30
|
+
height: strokeWidth
|
|
31
|
+
}
|
|
32
|
+
}, i));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return jsxs("div", Object.assign({
|
|
36
|
+
className: "steps-outer"
|
|
37
|
+
}, {
|
|
38
|
+
children: [styledSteps, children]
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 判断进度条传的百分比参数是否规范
|
|
44
|
+
* @param {number | undefined} progress 方法入参说明
|
|
45
|
+
* @return {numner} 百分比值
|
|
46
|
+
*/
|
|
47
|
+
function validProgress(progress) {
|
|
48
|
+
if (!progress || progress < 0) {
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (progress > 100) {
|
|
53
|
+
return 100;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return progress;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 转换 百分比 到 样式格式
|
|
61
|
+
* {
|
|
62
|
+
* "0%": "#afc163",
|
|
63
|
+
* "75%": "#009900",
|
|
64
|
+
* "50%": "green", // ====> '#afc163 0%, #66FF00 25%, #00CC00 50%, #009900 75%, #ffffff 100%'
|
|
65
|
+
* "25%": "#66FF00",
|
|
66
|
+
* "100%": "#ffffff"
|
|
67
|
+
* }
|
|
68
|
+
* @param gradients 渐变的参数
|
|
69
|
+
* @return {string} 样式值
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
var sortGradient = function sortGradient(gradients) {
|
|
73
|
+
var tempArr = [];
|
|
74
|
+
Object.keys(gradients).forEach(function (key) {
|
|
75
|
+
// 拿到百分比的数字
|
|
76
|
+
var formattedKey = parseFloat(key.replace(/%/g, "")); // 进行序列化
|
|
77
|
+
|
|
78
|
+
if (!isNaN(formattedKey)) {
|
|
79
|
+
tempArr.push({
|
|
80
|
+
key: formattedKey,
|
|
81
|
+
value: gradients[key]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}); // 排序 从小到大
|
|
85
|
+
|
|
86
|
+
tempArr = tempArr.sort(function (a, b) {
|
|
87
|
+
return a.key - b.key;
|
|
88
|
+
});
|
|
89
|
+
return tempArr.map(function (_ref) {
|
|
90
|
+
var key = _ref.key,
|
|
91
|
+
value = _ref.value;
|
|
92
|
+
return "".concat(value, " ").concat(key, "%");
|
|
93
|
+
}).join(", ");
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* 转换传进来 渐变的参数 为css样式
|
|
97
|
+
* {
|
|
98
|
+
* "0%": "#afc163",
|
|
99
|
+
* "25%": "#66FF00",
|
|
100
|
+
* "50%": "#00CC00", // ====> linear-gradient(to right, #afc163 0%, #66FF00 25%,
|
|
101
|
+
* "75%": "#009900", // #00CC00 50%, #009900 75%, #ffffff 100%)
|
|
102
|
+
* "100%": "#ffffff"
|
|
103
|
+
* }
|
|
104
|
+
*
|
|
105
|
+
* {
|
|
106
|
+
* "from": "#afc163",
|
|
107
|
+
* "to": "#66FF00",// ====> linear-gradient(to right, #afc163, #66FF00)
|
|
108
|
+
* }
|
|
109
|
+
*
|
|
110
|
+
* @param {string} strokeColor 颜色值
|
|
111
|
+
* @return 返回 backgroundImage 的样式值
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
var handleGradient = function handleGradient(strokeColor, directionConfig) {
|
|
115
|
+
var _strokeColor$from = strokeColor.from,
|
|
116
|
+
from = _strokeColor$from === void 0 ? "#3D66F8" : _strokeColor$from,
|
|
117
|
+
_strokeColor$to = strokeColor.to,
|
|
118
|
+
to = _strokeColor$to === void 0 ? "#4F93F0" : _strokeColor$to,
|
|
119
|
+
_strokeColor$directio = strokeColor.direction,
|
|
120
|
+
direction = _strokeColor$directio === void 0 ? directionConfig === "rtl" ? "to left" : "to right" : _strokeColor$directio,
|
|
121
|
+
rest = __rest(strokeColor, ["from", "to", "direction"]); // 剩余参数有值说明除了from to direction 还传了 另外的参数
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if (Object.keys(rest).length !== 0) {
|
|
125
|
+
var sortedGradients = sortGradient(rest);
|
|
126
|
+
return {
|
|
127
|
+
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(sortedGradients, ")")
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
backgroundImage: "linear-gradient(".concat(direction, ", ").concat(from, ", ").concat(to, ")")
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var Line = function Line(props) {
|
|
137
|
+
var directionConfig = props.direction,
|
|
138
|
+
percent = props.percent,
|
|
139
|
+
strokeWidth = props.strokeWidth,
|
|
140
|
+
strokeColor = props.strokeColor,
|
|
141
|
+
strokeLinecap = props.strokeLinecap,
|
|
142
|
+
trailColor = props.trailColor;
|
|
143
|
+
/** 进度条高亮部分的颜色样式 **/
|
|
144
|
+
|
|
145
|
+
var backgroundProps = strokeColor && typeof strokeColor !== "string" ? handleGradient(strokeColor, directionConfig) : {
|
|
146
|
+
background: strokeColor
|
|
147
|
+
};
|
|
148
|
+
/** 进度条轨道部分的颜色样式 **/
|
|
149
|
+
|
|
150
|
+
var trailStyle = trailColor ? {
|
|
151
|
+
backgroundColor: trailColor
|
|
152
|
+
} : undefined;
|
|
153
|
+
/** 进度条百分比的样式 **/
|
|
154
|
+
|
|
155
|
+
var percentStyle = Object.assign({
|
|
156
|
+
width: "".concat(validProgress(percent), "%"),
|
|
157
|
+
height: strokeWidth || 10,
|
|
158
|
+
borderRadius: strokeLinecap === "square" ? 0 : ""
|
|
159
|
+
}, backgroundProps);
|
|
160
|
+
return jsx("div", Object.assign({
|
|
161
|
+
className: "trail-bar",
|
|
162
|
+
style: trailStyle
|
|
163
|
+
}, {
|
|
164
|
+
children: jsx("div", {
|
|
165
|
+
className: "active-bar",
|
|
166
|
+
style: percentStyle
|
|
167
|
+
})
|
|
168
|
+
}));
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-progress-line .progress-outer {\n display: flex;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.paraui-progress-line .progress-outer .progress-inner {\n width: 100%;\n}\n.paraui-progress-line .progress-outer .progress-inner .rc-progress-line {\n height: 10px;\n width: 100%;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer .steps-item {\n flex-shrink: 0;\n min-width: 2px;\n margin-right: 2px;\n background: #f3f3f3;\n transition: all 0.3s;\n}\n.paraui-progress-line .progress-outer .progress-inner .steps-outer .steps-item-active {\n background-color: #2DB7F5;\n}\n.paraui-progress-line .progress-outer .progress-inner .trail-bar {\n position: relative;\n display: inline-block;\n width: 100%;\n overflow: hidden;\n vertical-align: middle;\n background-color: rgba(0, 0, 0, 0.0392156863);\n border-radius: 100px;\n}\n.paraui-progress-line .progress-outer .progress-inner .trail-bar .active-bar {\n position: relative;\n background-color: var(--ant-primary-color);\n border-radius: 100px;\n transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;\n}\n.paraui-progress-line .progress-outer .progress-text {\n font-size: 12px;\n font-weight: 700;\n text-align: left;\n color: #3d66f8;\n display: inline-block;\n margin-left: 20px;\n white-space: nowrap;\n text-align: left;\n vertical-align: middle;\n word-break: normal;\n display: flex;\n align-items: center;\n}\n.paraui-progress-line .progress-outer .progress-text svg {\n width: 14px;\n height: 14px;\n position: relative;\n top: 2px;\n}\n.paraui-progress-line .progress-outer .progress-text svg.success {\n color: #41D658 !important;\n}\n.paraui-progress-line .progress-outer .progress-text svg.error {\n color: #F46B53 !important;\n}\n.paraui-progress-circle, .paraui-progress-dashboard {\n display: inline-block;\n position: relative;\n margin: 0 5px;\n}\n.paraui-progress-circle .progress-outer .progress-text, .paraui-progress-dashboard .progress-outer .progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100%;\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.8509803922);\n font-size: 1em;\n line-height: 1;\n white-space: normal;\n text-align: center;\n transform: translate(-50%, -50%);\n}\n.paraui-progress-circle .progress-outer .progress-text svg, .paraui-progress-dashboard .progress-outer .progress-text svg {\n width: 2em;\n height: 2em;\n}\n.paraui-progress-circle .progress-outer .progress-text svg.success, .paraui-progress-dashboard .progress-outer .progress-text svg.success {\n color: #52C41A !important;\n}\n.paraui-progress-circle .progress-outer .progress-text svg.error, .paraui-progress-dashboard .progress-outer .progress-text svg.error {\n color: #FF4D4F !important;\n}\n.paraui-progress-success-status .progress-text {\n color: #52c41a !important;\n}\n.paraui-progress-exception-status .progress-text {\n color: #ff4d4f !important;\n}\n.paraui-progress-active-status .active-bar:before {\n position: absolute;\n inset: 0;\n background: #fff;\n border-radius: 10px;\n opacity: 0;\n -webkit-animation: progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;\n animation: progress-active 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite;\n content: \"\";\n}\n\n@keyframes progress-active {\n 0% {\n transform: translateX(-100%) scaleX(0);\n opacity: 0.1;\n }\n 20% {\n transform: translateX(-100%) scaleX(0);\n opacity: 0.5;\n }\n 100% {\n transform: translateX(0) scaleX(1);\n opacity: 0;\n }\n}";
|
|
172
|
+
styleInject(css_248z);
|
|
173
|
+
|
|
174
|
+
/** 进度条类型 **/
|
|
175
|
+
|
|
176
|
+
var ProgressTypes;
|
|
177
|
+
|
|
178
|
+
(function (ProgressTypes) {
|
|
179
|
+
ProgressTypes[ProgressTypes["line"] = 0] = "line";
|
|
180
|
+
ProgressTypes[ProgressTypes["circle"] = 1] = "circle";
|
|
181
|
+
ProgressTypes[ProgressTypes["dashboard"] = 2] = "dashboard";
|
|
182
|
+
})(ProgressTypes || (ProgressTypes = {}));
|
|
183
|
+
/** 进度条状态 **/
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
var ProgressStatuses;
|
|
187
|
+
|
|
188
|
+
(function (ProgressStatuses) {
|
|
189
|
+
ProgressStatuses[ProgressStatuses["normal"] = 0] = "normal";
|
|
190
|
+
ProgressStatuses[ProgressStatuses["exception"] = 1] = "exception";
|
|
191
|
+
ProgressStatuses[ProgressStatuses["active"] = 2] = "active";
|
|
192
|
+
ProgressStatuses[ProgressStatuses["success"] = 3] = "success";
|
|
193
|
+
})(ProgressStatuses || (ProgressStatuses = {}));
|
|
194
|
+
/** 每个类型对应的进度条默认颜色 **/
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
var strokeColorMap = {
|
|
198
|
+
success: "#41D658",
|
|
199
|
+
exception: "#F46B53",
|
|
200
|
+
normal: "#3D66F8",
|
|
201
|
+
active: "#3D66F8"
|
|
202
|
+
};
|
|
203
|
+
var Progress = function Progress(props) {
|
|
204
|
+
var _props$type = props.type,
|
|
205
|
+
type = _props$type === void 0 ? "line" : _props$type,
|
|
206
|
+
className = props.className;
|
|
207
|
+
props.children;
|
|
208
|
+
var status = props.status,
|
|
209
|
+
_props$width = props.width,
|
|
210
|
+
width = _props$width === void 0 ? 132 : _props$width,
|
|
211
|
+
_props$showInfo = props.showInfo,
|
|
212
|
+
showInfo = _props$showInfo === void 0 ? true : _props$showInfo,
|
|
213
|
+
format = props.format,
|
|
214
|
+
success = props.success,
|
|
215
|
+
_props$percent = props.percent,
|
|
216
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
217
|
+
steps = props.steps,
|
|
218
|
+
direction = props.direction,
|
|
219
|
+
strokeColor = props.strokeColor,
|
|
220
|
+
_props$gapDegree = props.gapDegree,
|
|
221
|
+
gapDegree = _props$gapDegree === void 0 ? 75 : _props$gapDegree,
|
|
222
|
+
otherProps = __rest(props, ["type", "className", "children", "status", "width", "showInfo", "format", "success", "percent", "steps", "direction", "strokeColor", "gapDegree"]);
|
|
223
|
+
/**
|
|
224
|
+
* 处理class
|
|
225
|
+
* @return {string}
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
var classString = function classString() {
|
|
230
|
+
var str = "paraui-progress paraui-progress-".concat(type || "default"); // 添加成功状态的class
|
|
231
|
+
|
|
232
|
+
if (isSuccessStatus) str += " paraui-progress-success-status"; // 添加错误状态下的class
|
|
233
|
+
|
|
234
|
+
if (status === "exception") str += " paraui-progress-exception-status"; // 添加active状态下的class
|
|
235
|
+
|
|
236
|
+
if (status === "active") str += " paraui-progress-active-status";
|
|
237
|
+
if (className) str += " " + className;
|
|
238
|
+
return str;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* 处理进度条颜色
|
|
242
|
+
* @return {string}
|
|
243
|
+
*/
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
var strokeColorVal = function strokeColorVal() {
|
|
247
|
+
// 如果传了成功进度条的配置
|
|
248
|
+
if (strokeColor) return strokeColor;
|
|
249
|
+
|
|
250
|
+
if (success && success.percent < percent) {
|
|
251
|
+
return [success.strokeColor || strokeColorMap["success"], strokeColorMap["normal"]];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return isSuccessStatus ? strokeColorMap["success"] : strokeColorMap[status || "normal"];
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* 处理进度条的值
|
|
258
|
+
* @return {string}
|
|
259
|
+
*/
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
var renderPercent = function renderPercent() {
|
|
263
|
+
if (success && success.percent < percent && typeof percent === "number") {
|
|
264
|
+
return [success.percent, percent - success.percent];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return percent;
|
|
268
|
+
};
|
|
269
|
+
/** 标记是不是成功状态 **/
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
var isSuccessStatus = percent && percent === 100 && !status || status === "success";
|
|
273
|
+
/** style值 **/
|
|
274
|
+
|
|
275
|
+
var renderStyle = type === "circle" || type === "dashboard" ? {
|
|
276
|
+
width: width,
|
|
277
|
+
height: width
|
|
278
|
+
} : {};
|
|
279
|
+
/**
|
|
280
|
+
* 处理描述信息
|
|
281
|
+
* @return {string | ReactNode}
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
var renderLabel = function renderLabel() {
|
|
285
|
+
if (format) return format(percent);
|
|
286
|
+
if (isSuccessStatus) return type === "circle" ? jsx(Check, {
|
|
287
|
+
className: "success"
|
|
288
|
+
}) : jsx(SuccessOutlined, {
|
|
289
|
+
className: "success"
|
|
290
|
+
});
|
|
291
|
+
if (status === "exception") return type === "circle" ? jsx(CloseIcon, {
|
|
292
|
+
className: "error"
|
|
293
|
+
}) : jsx(ErrorOutlined, {
|
|
294
|
+
className: "error"
|
|
295
|
+
});
|
|
296
|
+
return validProgress(percent) + "%";
|
|
297
|
+
};
|
|
298
|
+
/** 默认进度条 **/
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
var renderLineProgress = steps ? jsx(Steps, Object.assign({
|
|
302
|
+
steps: steps,
|
|
303
|
+
strokeColor: strokeColorVal(),
|
|
304
|
+
percent: renderPercent()
|
|
305
|
+
}, otherProps, {
|
|
306
|
+
children: showInfo && jsx("div", Object.assign({
|
|
307
|
+
className: "progress-text"
|
|
308
|
+
}, {
|
|
309
|
+
children: renderLabel()
|
|
310
|
+
}))
|
|
311
|
+
})) : jsx(Line, Object.assign({
|
|
312
|
+
strokeColor: strokeColorVal(),
|
|
313
|
+
percent: renderPercent(),
|
|
314
|
+
direction: direction
|
|
315
|
+
}, otherProps, {
|
|
316
|
+
children: " "
|
|
317
|
+
}));
|
|
318
|
+
/** 圆形进度条 **/
|
|
319
|
+
|
|
320
|
+
var renderCircleProgress = jsx(Circle, Object.assign({
|
|
321
|
+
strokeWidth: 6,
|
|
322
|
+
trailWidth: 6,
|
|
323
|
+
strokeColor: strokeColorVal(),
|
|
324
|
+
percent: renderPercent()
|
|
325
|
+
}, otherProps));
|
|
326
|
+
/** 仪表盘 **/
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
var renderDashboardProgress = jsx(Circle, Object.assign({
|
|
330
|
+
strokeWidth: 6,
|
|
331
|
+
trailWidth: 6,
|
|
332
|
+
gapPosition: "bottom",
|
|
333
|
+
gapDegree: gapDegree,
|
|
334
|
+
strokeColor: strokeColorVal(),
|
|
335
|
+
percent: renderPercent()
|
|
336
|
+
}, otherProps));
|
|
337
|
+
|
|
338
|
+
return jsx("div", Object.assign({
|
|
339
|
+
className: classString()
|
|
340
|
+
}, {
|
|
341
|
+
children: jsxs("div", Object.assign({
|
|
342
|
+
className: "progress-outer"
|
|
343
|
+
}, {
|
|
344
|
+
children: [jsx("div", Object.assign({
|
|
345
|
+
className: "progress-inner",
|
|
346
|
+
style: renderStyle
|
|
347
|
+
}, {
|
|
348
|
+
children: type === "dashboard" ? renderDashboardProgress : type === "circle" ? renderCircleProgress : renderLineProgress
|
|
349
|
+
})), showInfo && !steps && jsx("div", Object.assign({
|
|
350
|
+
className: "progress-text"
|
|
351
|
+
}, {
|
|
352
|
+
children: renderLabel()
|
|
353
|
+
}))]
|
|
354
|
+
}))
|
|
355
|
+
}));
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export { Progress, Progress as default };
|