@para-ui/core 2.2.5-beta → 2.2.7
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 +6 -12
- package/AutoBox/index.js +15 -203
- package/AutoTips/index.d.ts +6 -12
- package/AutoTips/index.js +15 -84
- package/Breadcrumbs/index.d.ts +7 -13
- package/Breadcrumbs/index.js +15 -227
- package/Button/SplitButton.d.ts +61 -0
- package/Button/index.d.ts +11 -92
- package/Button/index.js +14 -348
- package/Button/lang/en_US.d.ts +4 -0
- package/Button/lang/index.d.ts +9 -0
- package/Button/lang/zh_CN.d.ts +4 -0
- package/ButtonGroup/index.d.ts +9 -21
- package/ButtonGroup/index.js +14 -128
- package/Carousel/index.d.ts +11 -17
- package/Carousel/index.js +15 -74
- package/Cascader/index.d.ts +7 -12
- package/Cascader/index.js +15 -166
- package/Cascader/lang/en_US.d.ts +4 -0
- package/Cascader/lang/index.d.ts +9 -0
- package/Cascader/lang/zh_CN.d.ts +4 -0
- package/Checkbox/index.d.ts +7 -13
- package/Checkbox/index.js +14 -105
- package/CheckboxGroup/index.d.ts +9 -15
- package/CheckboxGroup/index.js +14 -138
- package/Collapse/collapsePanel.d.ts +30 -0
- package/Collapse/index.d.ts +14 -49
- package/Collapse/index.js +15 -171
- package/Collapse/motion.d.ts +5 -0
- package/Collapse/util.d.ts +11 -0
- package/CollapseBox/index.d.ts +5 -11
- package/CollapseBox/index.js +15 -164
- package/CollapseBox/util.d.ts +5 -0
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +1 -4
- package/ComboSelect/WithTabsCombo/index.d.ts +11 -0
- package/ComboSelect/WithTabsCombo/interface.d.ts +141 -0
- package/ComboSelect/index.d.ts +6 -306
- package/ComboSelect/index.js +14 -1803
- package/ComboSelect/interface.d.ts +143 -0
- package/ComboSelect/lang/en_US.d.ts +8 -0
- package/ComboSelect/lang/index.d.ts +17 -0
- package/ComboSelect/lang/zh_CN.d.ts +8 -0
- package/ComboSelect/utils.d.ts +12 -0
- package/Container/index.d.ts +8 -13
- package/Container/index.js +15 -239
- package/DatePicker/PickerButton.d.ts +3 -0
- package/DatePicker/PickerTag.d.ts +3 -0
- package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -0
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -0
- package/DatePicker/generatePicker/index.d.ts +77 -0
- package/DatePicker/index.d.ts +17 -30
- package/DatePicker/index.js +14 -733
- package/DatePicker/lang/en_US.d.ts +3 -0
- package/DatePicker/lang/index.d.ts +7 -0
- package/DatePicker/lang/zh_CN.d.ts +3 -0
- package/DatePicker/util.d.ts +20 -0
- package/Desktop/index.d.ts +6 -14
- package/Desktop/index.js +14 -853
- package/Drawer/index.d.ts +6 -92
- package/Drawer/index.js +14 -186
- package/Drawer/interface.d.ts +83 -0
- package/Drawer/lang/en_US.d.ts +5 -0
- package/Drawer/lang/index.d.ts +11 -0
- package/Drawer/lang/zh_CN.d.ts +5 -0
- package/Empty/images/index.d.ts +2 -0
- package/Empty/index.d.ts +10 -16
- package/Empty/index.js +14 -644
- package/Empty/lang/en_US.d.ts +6 -0
- package/Empty/lang/index.d.ts +13 -0
- package/Empty/lang/zh_CN.d.ts +6 -0
- package/Form/index.d.ts +9 -11
- package/Form/index.js +14 -384
- package/FormItem/compoments/defaultCompoments/index.d.ts +19 -0
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -0
- package/FormItem/compoments/formFile/index.d.ts +38 -0
- package/FormItem/compoments/formRadioGroup/index.d.ts +8 -0
- package/FormItem/compoments/formSelect/index.d.ts +18 -0
- package/FormItem/errorTips.d.ts +12 -0
- package/FormItem/index.d.ts +152 -5
- package/FormItem/index.js +14 -81
- package/FormItem/itemType.d.ts +42 -0
- package/FormItem/validateFunction.d.ts +15 -0
- package/FunctionModal/dialog.d.ts +58 -0
- package/FunctionModal/index.d.ts +3 -14
- package/FunctionModal/index.js +14 -39
- package/FunctionModal/modalContext.d.ts +14 -0
- package/GlobalContext/componentsProps.d.ts +19 -0
- package/GlobalContext/confirmLocale.d.ts +7 -0
- package/GlobalContext/index.d.ts +8 -38
- package/GlobalContext/index.js +16 -41
- package/GlobalContext/intl.d.ts +34 -0
- package/GlobalContext/useFormatMessage.d.ts +3 -0
- package/Help/index.d.ts +10 -16
- package/Help/index.js +15 -39
- package/HelperText/index.d.ts +5 -11
- package/HelperText/index.js +15 -29
- package/Hooks/useGlobalProps.d.ts +1 -0
- package/InputLang/index.d.ts +7 -13
- package/InputLang/index.js +14 -270
- package/InputNumber/index.d.ts +10 -16
- package/InputNumber/index.js +14 -308
- package/Label/index.d.ts +6 -12
- package/Label/index.js +14 -81
- package/Loading/index.d.ts +6 -12
- package/Loading/index.js +15 -47
- package/Menu/footerExpansion.d.ts +9 -0
- package/Menu/index.d.ts +5 -123
- package/Menu/index.js +14 -1232
- package/Menu/interface.d.ts +139 -0
- package/Menu/logo.d.ts +9 -0
- package/Menu/verticalMenuList.d.ts +14 -0
- package/Message/index.d.ts +19 -11
- package/Message/index.js +15 -222
- package/Modal/Confirm/index.d.ts +66 -0
- package/Modal/index.d.ts +40 -142
- package/Modal/index.js +14 -443
- package/Modal/lang/en_US.d.ts +5 -0
- package/Modal/lang/index.d.ts +11 -0
- package/Modal/lang/zh_CN.d.ts +5 -0
- package/MultiBox/index.d.ts +7 -13
- package/MultiBox/index.js +14 -231
- package/Notification/index.d.ts +16 -22
- package/Notification/index.js +15 -266
- package/OperateBtn/index.d.ts +10 -16
- package/OperateBtn/index.js +14 -260
- package/OperateBtn/lang/en_US.d.ts +4 -0
- package/OperateBtn/lang/index.d.ts +9 -0
- package/OperateBtn/lang/zh_CN.d.ts +4 -0
- package/PageHeader/horizontalMeun.d.ts +9 -0
- package/PageHeader/horizontalMeunRight.d.ts +9 -0
- package/PageHeader/index.d.ts +5 -178
- package/PageHeader/index.js +14 -1171
- package/PageHeader/interface.d.ts +167 -0
- package/Pagination/index.d.ts +6 -12
- package/Pagination/index.js +14 -469
- package/Pagination/lang/en_US.d.ts +8 -0
- package/Pagination/lang/index.d.ts +17 -0
- package/Pagination/lang/zh_CN.d.ts +8 -0
- package/ParauiProvider/index.d.ts +8 -9
- package/ParauiProvider/index.js +15 -53
- package/PopConfirm/index.d.ts +10 -23
- package/PopConfirm/index.js +14 -189
- package/PopConfirm/lang/en_US.d.ts +5 -0
- package/PopConfirm/lang/index.d.ts +11 -0
- package/PopConfirm/lang/zh_CN.d.ts +5 -0
- package/Popover/index.d.ts +11 -18
- package/Popover/index.js +15 -66
- package/Popper/index.d.ts +13 -0
- package/Popper/index.js +16 -0
- package/Progress/Line.d.ts +47 -0
- package/Progress/Steps.d.ts +17 -0
- package/Progress/index.d.ts +12 -18
- package/Progress/index.js +20 -358
- package/Progress/utils.d.ts +6 -0
- package/Querying/images/index.d.ts +2 -0
- package/Querying/index.d.ts +9 -15
- package/Querying/index.js +14 -762
- package/Querying/lang/en_US.d.ts +4 -0
- package/Querying/lang/index.d.ts +9 -0
- package/Querying/lang/zh_CN.d.ts +4 -0
- package/README.md +506 -0
- package/Radio/index.d.ts +7 -13
- package/Radio/index.js +14 -94
- package/RadioGroup/index.d.ts +9 -15
- package/RadioGroup/index.js +14 -128
- package/Search/index.d.ts +12 -18
- package/Search/index.js +14 -220
- package/Select/index.d.ts +7 -13
- package/Select/index.js +14 -1288
- package/Select/lang/en_US.d.ts +5 -0
- package/Select/lang/index.d.ts +11 -0
- package/Select/lang/zh_CN.d.ts +5 -0
- package/SelectInput/index.d.ts +5 -11
- package/SelectInput/index.js +14 -51
- package/SingleBox/index.d.ts +7 -13
- package/SingleBox/index.js +14 -194
- package/Slider/index.d.ts +7 -104
- package/Slider/index.js +15 -125
- package/Slider/interface.d.ts +102 -0
- package/Split/index.d.ts +3 -8
- package/Split/index.js +15 -134
- package/Stepper/icons.d.ts +5 -0
- package/Stepper/index.d.ts +25 -41
- package/Stepper/index.js +15 -99
- package/Switch/index.d.ts +10 -16
- package/Switch/index.js +14 -73
- package/Table/index.d.ts +4 -12
- package/Table/index.js +14 -2725
- package/{_verture/interface-a9b7c716.js → Table/interface.d.ts} +28 -20
- package/Table/lang/en_US.d.ts +6 -0
- package/Table/lang/index.d.ts +13 -0
- package/Table/lang/zh_CN.d.ts +6 -0
- package/Table/tableBody.d.ts +9 -0
- package/Table/tableBodyElement/index.d.ts +15 -0
- package/Table/tableBodyInterface.d.ts +67 -0
- package/Table/tableContainer/index.d.ts +16 -0
- package/Table/tableElement/index.d.ts +17 -0
- package/Table/tableHead.d.ts +9 -0
- package/Table/tableHeadElement/index.d.ts +15 -0
- package/Table/tableHeadInterface.d.ts +30 -0
- package/Table/tablePagination.d.ts +9 -0
- package/Table/tablePaginationInterFace.d.ts +24 -0
- package/Table/tdElement/index.d.ts +15 -0
- package/Table/thElement/index.d.ts +15 -0
- package/Table/trElement/index.d.ts +15 -0
- package/Table/util.d.ts +16 -0
- package/Tabs/index.d.ts +29 -64
- package/Tabs/index.js +14 -218
- package/Tag/TagGroup.d.ts +66 -0
- package/Tag/index.d.ts +12 -78
- package/Tag/index.js +14 -286
- package/Test/index.d.ts +2 -3
- package/Test/index.js +16 -9
- package/TextField/index.d.ts +16 -22
- package/TextField/index.js +14 -686
- package/TimePicker/index.d.ts +10 -20
- package/TimePicker/index.js +14 -77
- package/TimePicker/locale/en_US.d.ts +3 -0
- package/TimePicker/locale/zh_CN.d.ts +3 -0
- package/TimePicker/style/index.d.ts +1 -0
- package/Timeline/index.d.ts +13 -49
- package/Timeline/index.js +15 -150
- package/ToggleButton/ToggleButtonGroup.d.ts +49 -0
- package/ToggleButton/index.d.ts +10 -61
- package/ToggleButton/index.js +14 -200
- package/Tooltip/index.d.ts +10 -12
- package/Tooltip/index.js +15 -335
- package/Transfer/index.d.ts +3 -8
- package/Transfer/index.js +14 -343
- package/Transfer/lang/en_US.d.ts +6 -0
- package/Transfer/lang/index.d.ts +13 -0
- package/Transfer/lang/zh_CN.d.ts +6 -0
- package/Tree/OperateBar/index.d.ts +13 -0
- package/Tree/Tree.d.ts +4 -0
- package/Tree/index.d.ts +5 -8
- package/Tree/index.js +14 -35
- package/{_verture/interface-128abdd3.js → Tree/interface.d.ts} +25 -15
- package/Tree/lang/en_US.d.ts +8 -0
- package/Tree/lang/index.d.ts +17 -0
- package/Tree/lang/zh_CN.d.ts +8 -0
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +26 -0
- package/Tree/utils/treeUtil.d.ts +15 -0
- package/Upload/Dragger/index.d.ts +10 -0
- package/Upload/ErroTip/index.d.ts +13 -0
- package/Upload/ImageUpload/index.d.ts +14 -0
- package/Upload/ImgCrop/EasyCrop.d.ts +17 -0
- package/Upload/ImgCrop/constants.d.ts +7 -0
- package/Upload/ImgCrop/index.d.ts +6 -0
- package/Upload/ImgCrop/interface.d.ts +24 -0
- package/Upload/UploadList/index.d.ts +5 -0
- package/Upload/index.d.ts +8 -179
- package/Upload/index.js +14 -1542
- package/Upload/interface.d.ts +134 -0
- package/Upload/lang/en_US.d.ts +12 -0
- package/Upload/lang/index.d.ts +25 -0
- package/Upload/lang/zh_CN.d.ts +12 -0
- package/cdn/AutoBox/index.js +29 -0
- package/cdn/AutoTips/index.js +40 -0
- package/cdn/Breadcrumbs/index.js +53 -0
- package/cdn/Button/index.js +79 -0
- package/cdn/ButtonGroup/index.js +79 -0
- package/cdn/Carousel/index.js +6 -0
- package/cdn/Cascader/index.js +42 -0
- package/cdn/Checkbox/index.js +53 -0
- package/cdn/CheckboxGroup/index.js +53 -0
- package/cdn/Collapse/index.js +27 -0
- package/cdn/CollapseBox/index.js +1 -0
- package/cdn/ColorPicker/index.js +1 -0
- package/cdn/ComboSelect/index.js +438 -0
- package/cdn/Container/index.js +1 -0
- package/cdn/DatePicker/index.js +185 -0
- package/cdn/Desktop/index.js +24 -0
- package/cdn/Drawer/index.js +84 -0
- package/cdn/Empty/index.js +1 -0
- package/cdn/Form/index.js +477 -0
- package/cdn/FormItem/index.js +477 -0
- package/cdn/FunctionModal/index.js +144 -0
- package/cdn/GlobalContext/index.js +1 -0
- package/cdn/Help/index.js +53 -0
- package/cdn/HelperText/index.js +1 -0
- package/cdn/InputLang/index.js +144 -0
- package/cdn/InputNumber/index.js +118 -0
- package/cdn/Label/index.js +53 -0
- package/cdn/Loading/index.js +14 -0
- package/cdn/Menu/index.js +40 -0
- package/cdn/Message/index.js +53 -0
- package/cdn/Modal/index.js +144 -0
- package/cdn/MultiBox/index.js +131 -0
- package/cdn/Notification/index.js +66 -0
- package/cdn/OperateBtn/index.js +92 -0
- package/cdn/PageHeader/index.js +92 -0
- package/cdn/Pagination/index.js +214 -0
- package/cdn/ParauiProvider/index.js +9 -0
- package/cdn/PopConfirm/index.js +131 -0
- package/cdn/Popover/index.js +16 -0
- package/cdn/Popper/index.js +26 -0
- package/cdn/Progress/index.js +58 -0
- package/cdn/Querying/index.js +1 -0
- package/cdn/Radio/index.js +53 -0
- package/cdn/RadioGroup/index.js +53 -0
- package/cdn/Search/index.js +144 -0
- package/cdn/Select/index.js +131 -0
- package/cdn/SelectInput/index.js +131 -0
- package/cdn/SingleBox/index.js +131 -0
- package/cdn/Slider/index.js +16 -0
- package/cdn/Split/index.js +1 -0
- package/cdn/Stepper/index.js +154 -0
- package/cdn/Switch/index.js +71 -0
- package/cdn/Table/index.js +292 -0
- package/cdn/Tabs/index.js +165 -0
- package/cdn/Tag/index.js +27 -0
- package/cdn/Test/index.js +1 -0
- package/cdn/TextField/index.js +105 -0
- package/cdn/TimePicker/index.js +185 -0
- package/cdn/Timeline/index.js +16 -0
- package/cdn/ToggleButton/index.js +79 -0
- package/cdn/Tooltip/index.js +40 -0
- package/cdn/Transfer/index.js +170 -0
- package/cdn/Tree/index.js +170 -0
- package/cdn/Upload/index.js +252 -0
- package/index.d.ts +128 -88
- package/index.js +19 -160
- package/package.json +22 -59
- package/style.css +72 -0
- package/Dropdown/index.d.ts +0 -29
- package/Dropdown/index.js +0 -67
- package/_verture/defineProperty-0590dc61.js +0 -16
- package/_verture/index-0d8e1d07.js +0 -4
- package/_verture/index-14a47097.js +0 -4
- package/_verture/index-342379c6.js +0 -391
- package/_verture/index-458032d7.js +0 -10
- package/_verture/index-46bfb2f0.js +0 -778
- package/_verture/index-50401de7.js +0 -4
- package/_verture/index-5b08df83.js +0 -4
- package/_verture/index-6190b129.js +0 -4
- package/_verture/index-7ef1e3b6.js +0 -1553
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/index-c60911dc.js +0 -39
- package/_verture/index-e2881a53.js +0 -16
- package/_verture/index-ff4c2a27.js +0 -200
- package/_verture/interface-a77a851e.js +0 -25
- package/_verture/intl-336570e4.js +0 -65
- package/_verture/modalContext-25890584.js +0 -228
- package/_verture/modalContext-639f2787.js +0 -58
- package/_verture/slicedToArray-d7722f4b.js +0 -62
- package/_verture/style-inject.es-300983ab.js +0 -28
- package/_verture/toConsumableArray-f8047a75.js +0 -19
- package/_verture/tslib.es6-55ed4bd2.js +0 -38
- package/_verture/typeof-498dd2b1.js +0 -11
- package/_verture/useFormatMessage-ac9d6acf.js +0 -20
- package/_verture/useGlobalProps-af9a2af6.js +0 -12
package/SingleBox/index.js
CHANGED
|
@@ -1,194 +1,14 @@
|
|
|
1
|
-
import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import '@para-ui/icons/PreviewClose';
|
|
15
|
-
import '@para-ui/icons/PreviewOpen';
|
|
16
|
-
import '@para-ui/icons/CloseCircle';
|
|
17
|
-
import '../AutoTips/index.js';
|
|
18
|
-
import '../Tooltip/index.js';
|
|
19
|
-
import 'rc-tooltip';
|
|
20
|
-
import 'rc-tooltip/lib/placements';
|
|
21
|
-
import 'clsx';
|
|
22
|
-
import '../Loading/index.js';
|
|
23
|
-
import '@para-ui/icons/LoadingF';
|
|
24
|
-
import '../_verture/useGlobalProps-af9a2af6.js';
|
|
25
|
-
import '@para-ui/core/GlobalContext';
|
|
26
|
-
import '../Dropdown/index.js';
|
|
27
|
-
import 'rc-dropdown';
|
|
28
|
-
import '../Help/index.js';
|
|
29
|
-
import '@para-ui/icons/Help';
|
|
30
|
-
|
|
31
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-single-box {\n display: inline-block;\n width: 100%;\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}\n.paraui-single-box > .single-box-content {\n line-height: 0;\n}\n.paraui-single-box > .single-box-content > .single-box-content-item {\n padding-bottom: 15px;\n display: flex;\n}\n.paraui-single-box > .single-box-content > .single-box-content-item > .text-field {\n width: calc(100% - 30px);\n}\n.paraui-single-box > .single-box-content > .single-box-content-item > .text-field > .paraui-helper-text {\n display: none;\n}\n.paraui-single-box > .single-box-content > .single-box-content-item > .single-box-content-item-svg {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n cursor: pointer;\n}\n.paraui-single-box > .single-box-add {\n text-align: center;\n border: 1px dashed;\n border-color: rgba(171, 176, 185, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n cursor: pointer;\n background-color: rgb(255, 255, 255);\n}\n.paraui-single-box > .single-box-add > svg {\n font-size: 24px;\n}\n.paraui-single-box > .single-box-add:hover {\n border-color: rgb(54, 102, 214);\n color: rgb(54, 102, 214);\n}\n.paraui-single-box.single-box-small > .single-box-add {\n height: 28px;\n}\n.paraui-single-box.single-box-medium > .single-box-add {\n height: 32px;\n}\n.paraui-single-box.single-box-large > .single-box-add {\n height: 36px;\n}\n.paraui-single-box.single-box-disabled > .single-box-content > .single-box-content-item > .single-box-content-item-svg {\n cursor: not-allowed;\n}\n.paraui-single-box.single-box-disabled > .single-box-content > .single-box-content-item > .single-box-content-item-svg > svg {\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-single-box.single-box-disabled > .single-box-add {\n border-color: rgba(171, 176, 185, 0.4);\n cursor: not-allowed;\n background-color: rgba(171, 176, 185, 0.12);\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-single-box.single-box-disabled > .single-box-add > svg {\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-single-box.single-box-disabled > .single-box-add:hover {\n border-color: rgba(171, 176, 185, 0.4);\n color: rgba(46, 55, 67, 0.7);\n}";
|
|
32
|
-
styleInject(css_248z);
|
|
33
|
-
|
|
34
|
-
var SingleBox = function SingleBox(props) {
|
|
35
|
-
var className = props.className,
|
|
36
|
-
style = props.style,
|
|
37
|
-
_props$size = props.size,
|
|
38
|
-
size = _props$size === void 0 ? 'large' : _props$size,
|
|
39
|
-
_props$placeholder = props.placeholder,
|
|
40
|
-
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|
|
41
|
-
_props$label = props.label,
|
|
42
|
-
label = _props$label === void 0 ? '' : _props$label,
|
|
43
|
-
labelTooltip = props.labelTooltip,
|
|
44
|
-
labelSign = props.labelSign,
|
|
45
|
-
_props$disabled = props.disabled,
|
|
46
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
47
|
-
_props$required = props.required,
|
|
48
|
-
required = _props$required === void 0 ? false : _props$required,
|
|
49
|
-
_props$error = props.error,
|
|
50
|
-
error = _props$error === void 0 ? false : _props$error,
|
|
51
|
-
_props$helperText = props.helperText,
|
|
52
|
-
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
53
|
-
value = props.value,
|
|
54
|
-
onChange = props.onChange,
|
|
55
|
-
fetchSuggestions = props.fetchSuggestions;
|
|
56
|
-
|
|
57
|
-
var _useState = useState([]),
|
|
58
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
-
valueCom = _useState2[0],
|
|
60
|
-
setValueCom = _useState2[1];
|
|
61
|
-
|
|
62
|
-
useEffect(function () {
|
|
63
|
-
if (props.defaultValue !== undefined) setValueCom(_toConsumableArray(props.defaultValue));
|
|
64
|
-
}, []);
|
|
65
|
-
useEffect(function () {
|
|
66
|
-
if (value !== undefined) setValueCom(_toConsumableArray(value));
|
|
67
|
-
}, [value]);
|
|
68
|
-
/** 增加 */
|
|
69
|
-
|
|
70
|
-
var add = function add() {
|
|
71
|
-
if (disabled) return;
|
|
72
|
-
valueCom.push('');
|
|
73
|
-
if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
|
|
74
|
-
onChange && onChange(valueCom);
|
|
75
|
-
};
|
|
76
|
-
/** 删除 */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var del = function del(index) {
|
|
80
|
-
return function () {
|
|
81
|
-
if (disabled) return;
|
|
82
|
-
valueCom.splice(index, 1);
|
|
83
|
-
if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
|
|
84
|
-
onChange && onChange(valueCom);
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* 改变输入框
|
|
89
|
-
* @param index
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var changeInput = function changeInput(index) {
|
|
94
|
-
return function (event) {
|
|
95
|
-
valueCom[index] = event.target.value;
|
|
96
|
-
if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
|
|
97
|
-
onChange && onChange(valueCom);
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
/** 选择值*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var selectValue = function selectValue(index) {
|
|
104
|
-
return function (item) {
|
|
105
|
-
valueCom[index] = item;
|
|
106
|
-
|
|
107
|
-
if (_typeof(item) === 'object' && item !== null) {
|
|
108
|
-
valueCom[index] = item.value;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (props.value === undefined) setValueCom(_toConsumableArray(valueCom));
|
|
112
|
-
onChange && onChange(valueCom);
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* 处理label
|
|
117
|
-
* */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var handLabel = function handLabel() {
|
|
121
|
-
if (!label && !labelSign) return null;
|
|
122
|
-
|
|
123
|
-
var handLabelClass = function handLabelClass() {
|
|
124
|
-
var str = 'single-box-label';
|
|
125
|
-
|
|
126
|
-
if (labelTooltip && labelTooltip.className) {
|
|
127
|
-
str += ' ' + labelTooltip.className;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return str;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
return jsx(Label, Object.assign({
|
|
134
|
-
label: label,
|
|
135
|
-
required: required,
|
|
136
|
-
labelSign: labelSign
|
|
137
|
-
}, labelTooltip, {
|
|
138
|
-
className: handLabelClass()
|
|
139
|
-
}));
|
|
140
|
-
};
|
|
141
|
-
/** 处理class */
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var handClass = function handClass() {
|
|
145
|
-
var str = 'paraui-single-box single-box';
|
|
146
|
-
if (className) str += ' ' + className;
|
|
147
|
-
if (size) str += ' single-box-' + size;
|
|
148
|
-
if (error) str += ' single-box-error';
|
|
149
|
-
if (disabled) str += ' single-box-disabled';
|
|
150
|
-
return str;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
return jsxs("div", Object.assign({
|
|
154
|
-
className: handClass(),
|
|
155
|
-
style: style
|
|
156
|
-
}, {
|
|
157
|
-
children: [handLabel(), jsx("div", Object.assign({
|
|
158
|
-
className: "single-box-content"
|
|
159
|
-
}, {
|
|
160
|
-
children: valueCom.map(function (item, index) {
|
|
161
|
-
return jsxs("div", Object.assign({
|
|
162
|
-
className: "single-box-content-item"
|
|
163
|
-
}, {
|
|
164
|
-
children: [jsx(TextField, {
|
|
165
|
-
disabled: disabled,
|
|
166
|
-
value: item,
|
|
167
|
-
placeholder: placeholder,
|
|
168
|
-
size: size,
|
|
169
|
-
onChange: changeInput(index),
|
|
170
|
-
fetchSuggestions: fetchSuggestions,
|
|
171
|
-
onSelect: selectValue(index)
|
|
172
|
-
}), jsx("span", Object.assign({
|
|
173
|
-
className: "single-box-content-item-svg"
|
|
174
|
-
}, {
|
|
175
|
-
children: jsx(Delete, {
|
|
176
|
-
onClick: del(index)
|
|
177
|
-
})
|
|
178
|
-
}))]
|
|
179
|
-
}), index);
|
|
180
|
-
})
|
|
181
|
-
})), jsx("div", Object.assign({
|
|
182
|
-
className: "single-box-add",
|
|
183
|
-
onClick: add
|
|
184
|
-
}, {
|
|
185
|
-
children: jsx(Plus, {})
|
|
186
|
-
})), jsx(HelperText, {
|
|
187
|
-
className: "single-box-error",
|
|
188
|
-
error: error,
|
|
189
|
-
helperText: helperText
|
|
190
|
-
})]
|
|
191
|
-
}));
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export { SingleBox, SingleBox as default };
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@material-ui/core"),require("clsx"),require("@para-ui/icons/Help"),require("@paraview/lib"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/LoadingF"),require("@para-ui/core/GlobalContext"),require("@para-ui/icons/Plus"),require("@para-ui/icons/Delete")):"function"==typeof define&&define.amd?define(["react","@material-ui/core","clsx","@para-ui/icons/Help","@paraview/lib","@para-ui/icons/PreviewClose","@para-ui/icons/PreviewOpen","@para-ui/icons/CloseCircle","@para-ui/icons/LoadingF","@para-ui/core/GlobalContext","@para-ui/icons/Plus","@para-ui/icons/Delete"],t):"object"==typeof exports?exports.ParaUI=t(require("react"),require("@material-ui/core"),require("clsx"),require("@para-ui/icons/Help"),require("@paraview/lib"),require("@para-ui/icons/PreviewClose"),require("@para-ui/icons/PreviewOpen"),require("@para-ui/icons/CloseCircle"),require("@para-ui/icons/LoadingF"),require("@para-ui/core/GlobalContext"),require("@para-ui/icons/Plus"),require("@para-ui/icons/Delete")):e.ParaUI=t(e.react,e["@material-ui/core"],e.clsx,e["@para-ui/icons/Help"],e["@paraview/lib"],e["@para-ui/icons/PreviewClose"],e["@para-ui/icons/PreviewOpen"],e["@para-ui/icons/CloseCircle"],e["@para-ui/icons/LoadingF"],e["@para-ui/core/GlobalContext"],e["@para-ui/icons/Plus"],e["@para-ui/icons/Delete"])}(self,(function(e,t,i,n,o,r,l,a,c,s,d,u){return function(){var f={2565:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-auto-tips{max-width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paraui-auto-tips>.auto-tips-content{display:inline;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paraui-auto-tips-tooltip>div{max-height:calc(100vh - 25px);overflow:auto}",""]),e.exports=t},7381:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-help{display:inline-block;font-size:16px;color:rgba(46,55,67,.7)}.paraui-help:hover{color:#3666d6}.paraui-help .paraui-icon{font-size:inherit;color:inherit}",""]),e.exports=t},9916:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-helper-text{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:12px;font-weight:400;padding-left:12px;line-height:20px;color:rgba(46,55,67,.7)}.paraui-helper-text.paraui-helper-text-error{color:#eb6054}",""]),e.exports=t},4928:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-label{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;color:rgba(46,55,67,.7);margin-bottom:8px;display:inline-block;line-height:1.43;word-break:break-all}.paraui-label>.paraui-label-required{margin-left:2px;color:#eb6054}.paraui-label>.paraui-help{vertical-align:top;margin-left:4px}.paraui-label>.paraui-help svg{color:rgba(46,55,67,.4);vertical-align:top;position:relative;top:2px}.paraui-label.paraui-label-line.paraui-label-tooltip{border-bottom:1px dashed rgba(46,55,67,.4);padding-bottom:2px}",""]),e.exports=t},5714:function(e,t,i){(t=i(3645)(!1)).push([e.id,"@keyframes rotateLoading{0%{transformOrigin:50% 50%}100%{transform:rotate(360deg)}}.paraui-loading{position:absolute;left:0;top:0;width:100%;height:100%}.paraui-loading .paraui-loading-mask{position:absolute;width:100%;height:100%;background-color:#fff;z-index:1}.paraui-loading .paraui-loading-box{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:2}.paraui-loading .paraui-loading-box>svg{transition:all .3s ease-in-out;animation:rotateLoading 1s infinite linear;font-size:20px}",""]),e.exports=t},2645:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-single-box{display:inline-block;width:100%;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-single-box>.single-box-content{line-height:0}.paraui-single-box>.single-box-content>.single-box-content-item{padding-bottom:15px;display:flex}.paraui-single-box>.single-box-content>.single-box-content-item>.text-field{width:calc(100% - 30px)}.paraui-single-box>.single-box-content>.single-box-content-item>.text-field>.paraui-helper-text{display:none}.paraui-single-box>.single-box-content>.single-box-content-item>.single-box-content-item-svg{display:flex;align-items:center;justify-content:center;width:30px;cursor:pointer}.paraui-single-box>.single-box-add{text-align:center;border:1px dashed;border-color:rgba(171,176,185,.4);display:flex;align-items:center;justify-content:center;border-radius:4px;cursor:pointer;background-color:#fff}.paraui-single-box>.single-box-add>svg{font-size:24px}.paraui-single-box>.single-box-add:hover{border-color:#3666d6;color:#3666d6}.paraui-single-box.single-box-small>.single-box-add{height:28px}.paraui-single-box.single-box-medium>.single-box-add{height:32px}.paraui-single-box.single-box-large>.single-box-add{height:36px}.paraui-single-box.single-box-disabled>.single-box-content>.single-box-content-item>.single-box-content-item-svg{cursor:not-allowed}.paraui-single-box.single-box-disabled>.single-box-content>.single-box-content-item>.single-box-content-item-svg>svg{color:rgba(46,55,67,.7)}.paraui-single-box.single-box-disabled>.single-box-add{border-color:rgba(171,176,185,.4);cursor:not-allowed;background-color:rgba(171,176,185,.12);color:rgba(46,55,67,.7)}.paraui-single-box.single-box-disabled>.single-box-add>svg{color:rgba(46,55,67,.7)}.paraui-single-box.single-box-disabled>.single-box-add:hover{border-color:rgba(171,176,185,.4);color:rgba(46,55,67,.7)}",""]),e.exports=t},3637:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-text-field{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;display:inline-block;width:100%}.paraui-text-field>.text-field-content{border:1px solid;border-radius:4px;border-color:rgba(171,176,185,.4);display:flex;width:100%;position:relative;background-color:#fff}.paraui-text-field>.text-field-content:hover{border-color:#3666d6}.paraui-text-field>.text-field-content>.text-field-content-before{color:#2e3743;padding:0 12px;border-right:1px solid rgba(171,176,185,.4);background-color:rgba(171,176,185,.12);border-bottom-left-radius:4px;border-top-left-radius:4px;white-space:nowrap;display:flex;align-items:center}.paraui-text-field>.text-field-content>.text-field-content-before svg{font-size:20px}.paraui-text-field>.text-field-content>.text-field-content-within{position:relative;display:flex;flex-grow:1}.paraui-text-field>.text-field-content>.text-field-content-within>.clean-up-icon{display:flex;height:100%;align-items:center;margin-right:12px;cursor:pointer}.paraui-text-field>.text-field-content>.text-field-content-within>.clean-up-icon svg{color:rgba(46,55,67,.7);font-size:16px}.paraui-text-field>.text-field-content>.text-field-content-within>.clean-up-icon:hover svg{color:rgba(54,102,214,.8)}.paraui-text-field>.text-field-content>.text-field-content-within>.right-icon{display:flex;height:100%;align-items:center;margin-right:12px;cursor:pointer;color:rgba(46,55,67,.7);position:relative;z-index:1}.paraui-text-field>.text-field-content>.text-field-content-within>.right-icon.right-icon-password:hover svg{color:rgba(54,102,214,.8)}.paraui-text-field>.text-field-content>.text-field-content-within>.right-icon svg{color:rgba(46,55,67,.7);font-size:20px}.paraui-text-field>.text-field-content>.text-field-content-within>.length-limit{display:flex;height:100%;align-items:center;margin-right:12px;color:rgba(46,55,67,.7)}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input{width:100%;line-height:0;position:relative}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input input::-webkit-outer-spin-button,.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input input::-webkit-inner-spin-button{-webkit-appearance:none}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input input[type=number]{-moz-appearance:textfield}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>input{width:100%;height:100%}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea{width:100% !important;padding:12px;resize:none}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>input,.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea{font-size:14px;color:#2e3743;border:0;border-radius:4px;background:rgba(0,0,0,0)}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>input::-ms-clear,.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea::-ms-clear{display:none}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>input::-ms-reveal,.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea::-ms-reveal{display:none}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>input:disabled,.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea:disabled{background-color:rgba(0,0,0,0)}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{width:100%;position:absolute;left:0;top:0;height:100%;padding:0 12px;color:rgba(46,55,67,.4);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paraui-text-field>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder>.text-field-required{margin-left:2px;color:#eb6054}.paraui-text-field>.text-field-content>.text-field-content-after{color:#2e3743;padding:0 12px;border-left:1px solid rgba(171,176,185,.4);background-color:rgba(171,176,185,.12);border-bottom-right-radius:4px;border-top-right-radius:4px;white-space:nowrap;display:flex;align-items:center}.paraui-text-field>.text-field-content>.text-field-content-after svg{font-size:20px}.paraui-text-field.text-field-multiline>.text-field-content .text-field-content-within>.clean-up-icon{display:none}.paraui-text-field.text-field-multiline>.text-field-content .text-field-content-within>.length-limit{position:absolute;height:22px;bottom:0;border-radius:4px;width:calc(100% - 12px);background:#fff;justify-content:flex-end;padding-bottom:8px;margin-right:0}.paraui-text-field.text-field-multiline>.text-field-content .text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{padding-top:12px;line-height:1;height:calc(100% - 24px)}.paraui-text-field.text-field-disabled>.text-field-content{background-color:rgba(171,176,185,.12)}.paraui-text-field.text-field-disabled>.text-field-content:hover{border-color:rgba(171,176,185,.4)}.paraui-text-field.text-field-disabled>.text-field-content>.text-field-content-before{background-color:rgba(0,0,0,0)}.paraui-text-field.text-field-disabled>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{cursor:not-allowed}.paraui-text-field.text-field-disabled>.text-field-content>.text-field-content-within>.text-field-content-within-input>input,.paraui-text-field.text-field-disabled>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea{cursor:not-allowed}.paraui-text-field.text-field-disabled>.text-field-content>.text-field-content-after{background-color:rgba(0,0,0,0)}.paraui-text-field.text-field-disabled.text-field-multiline>.text-field-content .text-field-content-within>.length-limit{background-color:rgba(0,0,0,0)}.paraui-text-field.text-field-error>.text-field-content{border-color:#eb6054 !important}.paraui-text-field.text-field-error>.text-field-content:hover{border-color:#eb6054}.paraui-text-field.text-field-limit>.text-field-content{border-color:#eb6054 !important}.paraui-text-field.text-field-limit>.text-field-content:hover{border-color:#eb6054 !important}.paraui-text-field.text-field-limit-length>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea{padding-bottom:25px}.paraui-text-field.text-field-focus>.text-field-content{border-color:#3666d6}.paraui-text-field.text-field-small>.text-field-content{height:28px}.paraui-text-field.text-field-small>.text-field-content>.text-field-content-before{line-height:26px}.paraui-text-field.text-field-small>.text-field-content>.text-field-content-within>.text-field-content-within-input{height:26px}.paraui-text-field.text-field-small>.text-field-content>.text-field-content-within>.text-field-content-within-input>input{padding:6px 12px}.paraui-text-field.text-field-small>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{line-height:26px}.paraui-text-field.text-field-small>.text-field-content .text-field-content-after{line-height:26px}.paraui-text-field.text-field-medium>.text-field-content{height:32px}.paraui-text-field.text-field-medium>.text-field-content>.text-field-content-before{line-height:30px}.paraui-text-field.text-field-medium>.text-field-content>.text-field-content-within>.text-field-content-within-input{height:30px}.paraui-text-field.text-field-medium>.text-field-content>.text-field-content-within>.text-field-content-within-input>input{padding:8px 12px}.paraui-text-field.text-field-medium>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{line-height:30px}.paraui-text-field.text-field-medium>.text-field-content .text-field-content-after{line-height:30px}.paraui-text-field.text-field-large>.text-field-content{height:36px}.paraui-text-field.text-field-large>.text-field-content>.text-field-content-before{line-height:34px}.paraui-text-field.text-field-large>.text-field-content>.text-field-content-within>.text-field-content-within-input{height:34px}.paraui-text-field.text-field-large>.text-field-content>.text-field-content-within>.text-field-content-within-input>input{padding:10px 12px}.paraui-text-field.text-field-large>.text-field-content>.text-field-content-within>.text-field-content-within-input>.text-field-label-placeholder{line-height:34px}.paraui-text-field.text-field-large>.text-field-content .text-field-content-after{line-height:34px}.paraui-text-field.text-field-resize>.text-field-content>.text-field-content-within>.text-field-content-within-input>textarea{resize:both}.paraui-text-field-select.paraui-tooltip>div{max-width:none;padding:0;background-color:#fff;box-shadow:0px 2px 8px 0px rgba(171,176,185,.4);border-radius:4px;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-text-field-select.paraui-tooltip>div>span{color:#fff}.paraui-text-field-select.paraui-tooltip>div .text-field-select-content{max-height:300px;overflow:auto}.paraui-text-field-select.paraui-tooltip>div .text-field-select-content>.text-field-select-content-item{display:flex;cursor:pointer;color:#2e3743;padding:0 12px}.paraui-text-field-select.paraui-tooltip>div .text-field-select-content>.text-field-select-content-item:hover{background-color:rgba(171,176,185,.12);color:#3666d6}.paraui-text-field-select.paraui-tooltip>div .text-field-select-content>.text-field-select-content-item.text-field-select-content-item-keydown{background-color:rgba(171,176,185,.12);color:#3666d6}.paraui-text-field-select.paraui-tooltip>div .text-field-select-content.text-field-select-content-loading{height:100px;position:relative;overflow:hidden}.paraui-text-field-select.paraui-tooltip.paraui-text-field-select-small>div .text-field-select-content>.text-field-select-content-item{line-height:28px}.paraui-text-field-select.paraui-tooltip.paraui-text-field-select-medium>div .text-field-select-content>.text-field-select-content-item{line-height:32px}.paraui-text-field-select.paraui-tooltip.paraui-text-field-select-large>div .text-field-select-content>.text-field-select-content-item{line-height:36px}.paraui-text-field-select.paraui-text-field-select-data.paraui-tooltip{padding:8px 0}",""]),e.exports=t},9929:function(e,t,i){(t=i(3645)(!1)).push([e.id,".paraui-tooltip>div{padding-left:12px;padding-right:12px;font-size:14px;font-weight:400;color:#fff;background-color:rgba(46,55,67,.7)}.paraui-tooltip-left-right>div{margin:0 8px}.paraui-tooltip-top-bottom>div{margin:8px 0}",""]),e.exports=t},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var i=function(e,t){var i=e[1]||"",n=e[3];if(!n)return i;if(t&&"function"==typeof btoa){var o=(l=n,a=btoa(unescape(encodeURIComponent(JSON.stringify(l)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(c," */")),r=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[i].concat(r).concat([o]).join("\n")}var l,a,c;return[i].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(i,"}"):i})).join("")},t.i=function(e,i,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var r=0;r<this.length;r++){var l=this[r][0];null!=l&&(o[l]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);n&&o[c[0]]||(i&&(c[2]?c[2]="".concat(i," and ").concat(c[2]):c[2]=i),t.push(c))}},t}},7418:function(e){"use strict";
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/var t=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var l,a,c=o(e),s=1;s<arguments.length;s++){for(var d in l=Object(arguments[s]))i.call(l,d)&&(c[d]=l[d]);if(t){a=t(l);for(var u=0;u<a.length;u++)n.call(l,a[u])&&(c[a[u]]=l[a[u]])}}return c}},5251:function(e,t,i){"use strict";
|
|
7
|
+
/** @license React v17.0.2
|
|
8
|
+
* react-jsx-runtime.production.min.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/i(7418);var n=i(8156),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var r=Symbol.for;o=r("react.element"),t.Fragment=r("react.fragment")}var l=n.__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 s(e,t,i){var n,r={},s=null,d=null;for(n in void 0!==i&&(s=""+i),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,n)&&!c.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===r[n]&&(r[n]=t[n]);return{$$typeof:o,type:e,key:s,ref:d,props:r,_owner:l.current}}t.jsx=s,t.jsxs=s},5893:function(e,t,i){"use strict";e.exports=i(5251)},9271:function(e,t,i){var n=i(3379),o=i(2565);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},2113:function(e,t,i){var n=i(3379),o=i(7381);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},3936:function(e,t,i){var n=i(3379),o=i(9916);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},9663:function(e,t,i){var n=i(3379),o=i(4928);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},3492:function(e,t,i){var n=i(3379),o=i(5714);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},6894:function(e,t,i){var n=i(3379),o=i(2645);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},6202:function(e,t,i){var n=i(3379),o=i(3637);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},2310:function(e,t,i){var n=i(3379),o=i(9929);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var r={insert:("body","body"),singleton:!1};n(o,r);e.exports=o.locals||{}},3379:function(e,t,i){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var e={};return function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}e[t]=i}return e[t]}}(),l=[];function a(e){for(var t=-1,i=0;i<l.length;i++)if(l[i].identifier===e){t=i;break}return t}function c(e,t){for(var i={},n=[],o=0;o<e.length;o++){var r=e[o],c=t.base?r[0]+t.base:r[0],s=i[c]||0,d="".concat(c," ").concat(s);i[c]=s+1;var u=a(d),f={css:r[1],media:r[2],sourceMap:r[3]};-1!==u?(l[u].references++,l[u].updater(f)):l.push({identifier:d,updater:g(f,t),references:1}),n.push(d)}return n}function s(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=i.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var l=r(e.insert||"head");if(!l)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");l.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function f(e,t,i,n){var o=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=u(t,o);else{var r=document.createTextNode(o),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(r,l[t]):e.appendChild(r)}}function p(e,t,i){var n=i.css,o=i.media,r=i.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var x=null,h=0;function g(e,t){var i,n,o;if(t.singleton){var r=h++;i=x||(x=s(t)),n=f.bind(null,i,r,!1),o=f.bind(null,i,r,!0)}else i=s(t),n=p.bind(null,i,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(i)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var i=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<i.length;n++){var o=a(i[n]);l[o].references--}for(var r=c(e,t),s=0;s<i.length;s++){var d=a(i[s]);0===l[d].references&&(l[d].updater(),l.splice(d,1))}i=r}}}},7839:function(e,t,i){"use strict";var n=i(5893),o=i(8156),r=i(7371),l=(i(9271),function(){return l=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)});t.default=function(e){var t=e.children,i=e.arrow,a=void 0!==i&&i,c=e.placement,s=void 0===c?"bottom-start":c,d=e.tips,u=void 0===d?"":d,f=e.className,p=void 0===f?"":f,x=e.beyondText,h=void 0===x||x,g=e.interactive,b=void 0===g||g,v=e.style,m=(0,o.useRef)(),y=(0,o.useState)(""),w=y[0],j=y[1];(0,o.useEffect)((function(){j(u)}),[u]);var S;return(0,n.jsx)("div",l({ref:m,className:(S="paraui-auto-tips",p&&(S+=" "+p),S),onMouseOver:function(){var e="";m.current&&m.current.scrollWidth>m.current.offsetWidth&&(e=u||(h?m.current.innerText:t)),j(e)},style:v},{children:(0,n.jsx)(r.default,l({arrow:a,title:w,placement:s,interactive:b,boundariesElement:"viewport",className:"paraui-auto-tips-tooltip"},{children:(0,n.jsx)("div",l({className:"auto-tips-content"},{children:t}))}))}))}},3566:function(e,t,i){"use strict";var n=i(5893),o=i(7371),r=i(8076),l=i.n(r),a=i(5744),c=i.n(a),s=(i(2113),function(){return s=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}),d=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i};t.default=function(e){var t=e.title,i=void 0===t?"":t,r=e.children,a=e.arrow,u=void 0===a||a,f=e.interactive,p=void 0===f||f,x=e.className,h=e.placement,g=void 0===h?"top-start":h,b=d(e,["title","children","arrow","interactive","className","placement"]);return(0,n.jsx)(o.default,s({title:i,arrow:u,interactive:p,placement:g},b,{children:(0,n.jsx)("span",s({className:c()("paraui-help",x)},{children:r||(0,n.jsx)(l(),{})}))}))}},4254:function(e,t,i){"use strict";var n=i(5893),o=(i(3936),function(){return o=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)});t.default=function(e){var t,i=e.className,r=e.style,l=e.error,a=void 0!==l&&l,c=e.helperText;return(0,n.jsx)("p",o({className:(t="paraui-helper-text",i&&(t+=" "+i),a&&(t+=" paraui-helper-text-error"),t),style:r},{children:c}))}},6010:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var n=i(8156),o=i.n(n),r=i(5395),l=i.n(r),a=function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function c(e,t){var i=o().useContext(l()).componentsProps,n=i&&i[t];return a(a({},n),e)}},8767:function(e,t,i){"use strict";var n=i(5893),o=i(3566),r=(i(9663),function(){return r=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)});t.default=function(e){var t=e.className,i=e.style,l=e.label,a=e.labelSign,c=e.required,s=void 0!==c&&c,d=e.tooltip,u=e.tooltipType,f=void 0===u?"icon":u,p=e.placement,x=e.arrow,h=e.tooltipIcon,g=function(){var e="paraui-label";return f&&(e+=" paraui-label-"+f),d&&(e+=" paraui-label-tooltip"),t&&(e+=" "+t),e};return(0,n.jsxs)(n.Fragment,{children:["icon"===f&&(0,n.jsxs)("label",r({className:g(),style:i},{children:[(0,n.jsx)(n.Fragment,{children:l}),s&&(0,n.jsx)("span",r({className:"paraui-label-required"},{children:"*"})),a&&(0,n.jsx)("span",{children:a}),d&&(0,n.jsx)(o.default,r({title:d,placement:p,arrow:x},{children:h}))]})),"line"===f&&(0,n.jsx)(o.default,r({title:d||"",placement:p,arrow:x},{children:(0,n.jsxs)("label",r({className:g(),style:i},{children:[(0,n.jsx)(n.Fragment,{children:l}),s&&(0,n.jsx)("span",r({className:"paraui-label-required"},{children:"*"})),a&&(0,n.jsx)("span",{children:a})]}))}))]})}},7502:function(e,t,i){"use strict";var n=i(5893),o=i(8156),r=i(2788),l=i.n(r),a=(i(3492),function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)});t.default=function(e){var t=e.className,i=e.style,r=e.opacity,c=void 0===r?.7:r,s=(0,o.useRef)(null);(0,o.useEffect)((function(){s&&s.current&&s.current.parentNode&&(s.current.parentNode.style.position||(s.current.parentNode.style.position="relative"))}),[]);var d;return(0,n.jsxs)("div",a({className:(d="paraui-loading",t&&(d+=" "+t),d),style:i,ref:s},{children:[(0,n.jsx)("div",a({className:"paraui-loading-box"},{children:(0,n.jsx)(l(),{})})),(0,n.jsx)("div",{className:"paraui-loading-mask",style:{opacity:c}})]}))}},7320:function(e,t,i){"use strict";var n=i(5893),o=i(8156),r=i(8767),l=i(8543),a=i(5428),c=i.n(a),s=i(9979),d=i.n(s),u=i(6788),f=i.n(u),p=i(7839),x=i(7502),h=i(7371),g=i(4254),b=i(6010),v=(i(6202),function(){return v=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)}),m=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i},y=function(e){return"number"==typeof e&&!isNaN(e)};t.default=function(e){var t=(0,b.Z)(e,"TextField"),i=t.className,a=t.style,s=t.size,u=void 0===s?"large":s,w=t.labelMode,j=void 0===w?"outside":w,S=t.placeholder,O=void 0===S?"":S,C=t.label,N=void 0===C?"":C,k=t.labelTooltip,P=t.disabled,M=void 0!==P&&P,q=t.multiline,E=void 0!==q&&q,_=t.required,F=void 0!==_&&_,T=t.labelSign,L=t.rows,z=void 0===L?2:L,H=t.error,I=void 0!==H&&H,B=t.helperText,D=void 0===B?"":B,R=t.addonBefore,A=void 0===R?"":R,U=t.addonAfter,K=void 0===U?"":U,Y=(t.defaultValue,t.value),J=t.autoFocus,W=void 0!==J&&J,V=t.type,Q=void 0===V?"text":V,G=t.onClickIcon,Z=t.rightIcon,$=t.showRightIcon,X=void 0===$||$,ee=t.allowClear,te=void 0!==ee&&ee,ie=t.limitLength,ne=t.fetchSuggestions,oe=t.selectPopoverClass,re=t.renderSelectItem,le=t.showSelectName,ae=void 0===le?"value":le,ce=t.resize,se=void 0===ce||ce,de=t.onBlur,ue=t.onFocus,fe=t.onChange,pe=t.onKeydown,xe=t.onKeyUp,he=t.onEnter,ge=t.onClickAddonBefore,be=t.onClickAddonAfter,ve=t.onSelect,me=t.onClear,ye=m(t,["className","style","size","labelMode","placeholder","label","labelTooltip","disabled","multiline","required","labelSign","rows","error","helperText","addonBefore","addonAfter","defaultValue","value","autoFocus","type","onClickIcon","rightIcon","showRightIcon","allowClear","limitLength","fetchSuggestions","selectPopoverClass","renderSelectItem","showSelectName","resize","onBlur","onFocus","onChange","onKeydown","onKeyUp","onEnter","onClickAddonBefore","onClickAddonAfter","onSelect","onClear"]),we=(0,o.useState)("text-field-select-content-"+(0,l.UUID)())[0],je=(0,o.useState)(!0),Se=je[0],Oe=je[1],Ce=(0,o.useState)(""),Ne=Ce[0],ke=Ce[1],Pe=(0,o.useState)(!1),Me=Pe[0],qe=Pe[1],Ee=(0,o.useState)("text"),_e=Ee[0],Fe=Ee[1],Te=(0,o.useState)(!1),Le=Te[0],ze=Te[1],He=(0,o.useState)(!1),Ie=He[0],Be=He[1],De=(0,o.useState)([]),Re=De[0],Ae=De[1],Ue=(0,o.useRef)(null),Ke=(0,o.useRef)(null);(0,o.useEffect)((function(){void 0!==e.defaultValue&&ke(e.defaultValue)}),[]),(0,o.useEffect)((function(){Q!==_e&&Fe(Q)}),[Q]),(0,o.useEffect)((function(){void 0!==Y&&ke(Y)}),[Y]),(0,o.useEffect)((function(){Oe(""===Ne||void 0===Ne)}),[Ne]),(0,o.useEffect)((function(){ne&&ze(Me)}),[Me,ne]),(0,o.useEffect)((function(){return Le?window.addEventListener("keydown",Ge):window.removeEventListener("keydown",Ge),function(){window.removeEventListener("keydown",Ge)}}),[Le]),(0,o.useEffect)((function(){if(!Me&&Ne){var t=Je(Ne);if(t!==Ne){var i={};i.target=Ue.current,i.target.value=t,void 0===e.value&&ke(t),e.onChange&&e.onChange(i)}}}),[Ne,Me]);var Ye,Je=function(t){var i=t;return y(e.limitLength)&&t.toString().length>Number(e.limitLength)&&(i=i.toString().substr(0,e.limitLength)),i},We=function(){M||(Oe(!1),(Ue&&Ue.current).focus())},Ve=function(e){var t=e.selectDom,i=e.keyCode,n=e.currentDom,o="nextSibling",r=".text-field-select-content-item";38===i&&(o="previousSibling",r=".text-field-select-content-item:last-child"),n?(n=n[o])||(n=t.querySelector(r)):n=t.querySelector(".text-field-select-content-item"),n&&(n.classList.add("text-field-select-content-item-keydown"),Qe(n,t))},Qe=function(e,t){var i=t.clientHeight,n=e.offsetTop+e.clientHeight-i;t.scrollTop=n>0?n:0},Ge=function(e){var t=document.querySelector("."+we),i=null,n=t.querySelector(".text-field-select-content-item-keydown");if(13===e.keyCode&&n){var o=n.dataset.val;lt(JSON.parse(o))(e),(Ue&&Ue.current).blur()}n&&(i=n,n.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ve({selectDom:t,keyCode:e.keyCode,currentDom:i}),38===e.keyCode&&Ve({selectDom:t,keyCode:e.keyCode,currentDom:i})},Ze=function(e){qe(!1),""===e.target.value&&Oe(!0),de&&de(e)},$e=function(e){ne&&(Be(!0),ne(e,(function(e){Ae(e||[]),Be(!1)})))},Xe=function(e){qe(!0),ue&&ue(e),$e(e.target.value)},et=function(t){var i=t.target.value;i&&Oe(!1),void 0===e.value&&ke(i),fe&&fe(t),$e(t.target.value)},tt=function(e){13===e.keyCode&&he&&he(e),pe&&pe(e)},it=function(e){xe&&xe(e)},nt=function(e){"password"===Q&&("text"===_e&&Fe("password"),"password"===_e&&Fe("text")),G&&G(e)},ot=function(){return void 0===e.value?Ne:Y},rt=function(){ze(!1)},lt=function(e){return function(t){ve&&ve(e)}},at=(0,o.useMemo)((function(){return(0,n.jsx)(n.Fragment,{children:y(ie)&&(0,n.jsx)("span",v({className:"length-limit"},{children:(Ne?Ne.toString().length:0)+"/"+ie}))})}),[ie,Ne]),ct=(0,o.useMemo)((function(){var e=Z||("password"===Q?"password"===_e?(0,n.jsx)(c(),{}):(0,n.jsx)(d(),{}):null);return(0,n.jsx)(n.Fragment,{children:X&&e&&(0,n.jsx)("span",v({className:"password"===Q?"right-icon right-icon-password":"right-icon",onClick:nt},{children:e}))})}),[X,Z,Q,_e,G]),st=function(){var t=Ue.current;t.value="",void 0===e.value&&ke(""),fe&&fe({target:t}),$e(""),me&&me()},dt=function(){if(ot()&&!M&&te)return(0,n.jsx)("span",v({className:"clean-up-icon",onClick:st},{children:(0,n.jsx)(f(),{})}))},ut=(0,o.useMemo)((function(){return(0,n.jsxs)("div",v({className:"text-field-content-within",ref:Ke},{children:[(0,n.jsxs)("div",v({className:"text-field-content-within-input"},{children:[E?(0,n.jsx)("textarea",v({ref:Ue,rows:z,value:ot(),onBlur:Ze,onFocus:Xe,onChange:et,onKeyDown:tt,onKeyUp:it,disabled:M},ye)):(0,n.jsx)("input",v({ref:Ue,type:_e,value:ot(),onBlur:Ze,onFocus:Xe,onChange:et,onKeyDown:tt,onKeyUp:it,disabled:M},ye)),Se&&!Me&&(0,n.jsx)("span",v({className:"text-field-label-placeholder",onClick:We},{children:"outside"===j?O:(0,n.jsxs)(n.Fragment,{children:[N||O,F&&(0,n.jsx)("span",v({className:"text-field-required"},{children:"*"})),T&&(0,n.jsx)("span",{children:T})]})}))]})),dt(),at,ct]}))}),[Se,Me,W,_e,Ne,at,ct,j,O,N,M,E,z,ye,fe,ne,G,te,me]),ft=(0,o.useMemo)((function(){var e,t=function(e){return"object"==typeof e&&null!==e?e[ae]:e};return(0,n.jsxs)("div",v({className:(e="text-field-select-content",Ie&&(e+=" text-field-select-content-loading"),we&&(e+=" "+we),e),style:{width:(Ke&&Ke.current?Ke.current.offsetWidth:0)+"px"}},{children:[Re&&Re.map((function(e,i){return(0,n.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:lt(e),"data-val":JSON.stringify(e)},{children:re?re(e):(0,n.jsx)(p.default,{children:t(e)})}),i)})),Ie&&(0,n.jsx)(x.default,{})]}))}),[Ke,Le,Re,re,ae,ve,Ie,we]),pt=(0,o.useMemo)((function(){return(0,n.jsx)(h.default,v({open:Le,title:ft,onClose:rt,arrow:!1,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,placement:"bottom-start",classes:{popper:(e="paraui-text-field-select paraui-scrollbar-small",u&&(e+=" paraui-text-field-select-"+u),oe&&(e+=" "+oe),Re.length>0&&(e+=" paraui-text-field-select-data"),e)}},{children:ut}));var e}),[Se,Me,W,_e,Ne,at,ct,j,O,N,M,E,z,ye,fe,ne,ve,Ke,Le,oe,u,G,Re,te,me]),xt=(0,o.useMemo)((function(){var e,t=Boolean(F||T||N);if("outside"===j&&t){return(0,n.jsx)(r.default,v({label:N,required:F,labelSign:T},k,{className:(e="text-field-label",k&&k.className&&(e+=" "+k.className),e)}))}return null}),[j,N,T,F,k]);return(0,n.jsxs)("div",v({className:(Ye="paraui-text-field",Ye+=" text-field",u&&!E&&(Ye+=" text-field-"+u),i&&(Ye+=" "+i),I&&(Ye+=" text-field-error"),Me&&(Ye+=" text-field-focus"),M&&(Ye+=" text-field-disabled"),E&&(Ye+=" text-field-multiline"),y(e.limitLength)&&(Ye+=" text-field-limit-length"),y(e.limitLength)&&Ne&&Ne.toString().length>Number(e.limitLength)&&(Ye+=" text-field-limit"),se&&(Ye+=" text-field-resize"),ot()&&(Ye+=" text-field-value"),te&&(Ye+=" text-field-allow-clear"),Ye),style:a},{children:[xt,(0,n.jsxs)("div",v({className:"text-field-content"},{children:[A&&(0,n.jsx)("div",v({className:"text-field-content-before",onClick:function(e){ge&&ge(e)}},{children:A})),ne?pt:ut,K&&(0,n.jsx)("div",v({className:"text-field-content-after",onClick:function(e){be&&be(e)}},{children:K}))]})),(0,n.jsx)(g.default,{className:"text-field-error-text",error:I,helperText:D})]}))}},7371:function(e,t,i){"use strict";var n=i(5893),o=i(670),r=i(5744),l=i.n(r),a=(i(2310),function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)}),c=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(i[n[o]]=e[n[o]])}return i};t.default=function(e){var t,i=e.placement,r=void 0===i?"top-start":i,s=e.className,d=e.arrow,u=void 0===d||d,f=e.PopperProps,p=e.boundariesElement,x=void 0===p?"scrollParent":p,h=c(e,["placement","className","arrow","PopperProps","boundariesElement"]),g=a(a({},e.classes),{popper:l()("paraui-tooltip",s,null===(t=e.classes)||void 0===t?void 0:t.popper,{"paraui-tooltip-left-right":(null==r?void 0:r.includes("left"))||(null==r?void 0:r.includes("right")),"paraui-tooltip-top-bottom":(null==r?void 0:r.includes("top"))||(null==r?void 0:r.includes("bottom"))})});return(0,n.jsx)(o.Tooltip,a({},h,{enterTouchDelay:0,arrow:u,placement:r,classes:g,PopperProps:a(a({},f),{modifiers:{preventOverflow:{boundariesElement:x}}})}))}},670:function(e){"use strict";e.exports=t},5395:function(e){"use strict";e.exports=s},6788:function(e){"use strict";e.exports=a},4104:function(e){"use strict";e.exports=u},8076:function(e){"use strict";e.exports=n},2788:function(e){"use strict";e.exports=c},1632:function(e){"use strict";e.exports=d},5428:function(e){"use strict";e.exports=r},9979:function(e){"use strict";e.exports=l},8543:function(e){"use strict";e.exports=o},5744:function(e){"use strict";e.exports=i},8156:function(t){"use strict";t.exports=e}},p={};function x(e){var t=p[e];if(void 0!==t)return t.exports;var i=p[e]={id:e,exports:{}};return f[e](i,i.exports,x),i.exports}x.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(t,{a:t}),t},x.d=function(e,t){for(var i in t)x.o(t,i)&&!x.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},x.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.nc=void 0;var h={};return function(){"use strict";x.r(h),x.d(h,{SingleBox:function(){return u}});var e=x(5893),t=x(8156),i=x(7320),n=x(8767),o=x(4254),r=x(1632),l=x.n(r),a=x(4104),c=x.n(a),s=(x(6894),function(){return s=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}),d=function(e,t,i){if(i||2===arguments.length)for(var n,o=0,r=t.length;o<r;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},u=function(r){var a=r.className,u=r.style,f=r.size,p=void 0===f?"large":f,x=r.placeholder,h=void 0===x?"":x,g=r.label,b=void 0===g?"":g,v=r.labelTooltip,m=r.labelSign,y=r.disabled,w=void 0!==y&&y,j=r.required,S=void 0!==j&&j,O=r.error,C=void 0!==O&&O,N=r.helperText,k=void 0===N?"":N,P=r.value,M=r.onChange,q=r.fetchSuggestions,E=(0,t.useState)([]),_=E[0],F=E[1];(0,t.useEffect)((function(){void 0!==r.defaultValue&&F(d([],r.defaultValue,!0))}),[]),(0,t.useEffect)((function(){void 0!==P&&F(d([],P,!0))}),[P]);var T,L=function(e){return function(){w||(_.splice(e,1),void 0===r.value&&F(d([],_,!0)),M&&M(_))}},z=function(e){return function(t){_[e]=t.target.value,void 0===r.value&&F(d([],_,!0)),M&&M(_)}},H=function(e){return function(t){_[e]=t,"object"==typeof t&&null!==t&&(_[e]=t.value),void 0===r.value&&F(d([],_,!0)),M&&M(_)}};return(0,e.jsxs)("div",s({className:(T="paraui-single-box single-box",a&&(T+=" "+a),p&&(T+=" single-box-"+p),C&&(T+=" single-box-error"),w&&(T+=" single-box-disabled"),T),style:u},{children:[function(){if(!b&&!m)return null;var t;return(0,e.jsx)(n.default,s({label:b,required:S,labelSign:m},v,{className:(t="single-box-label",v&&v.className&&(t+=" "+v.className),t)}))}(),(0,e.jsx)("div",s({className:"single-box-content"},{children:_.map((function(t,n){return(0,e.jsxs)("div",s({className:"single-box-content-item"},{children:[(0,e.jsx)(i.default,{disabled:w,value:t,placeholder:h,size:p,onChange:z(n),fetchSuggestions:q,onSelect:H(n)}),(0,e.jsx)("span",s({className:"single-box-content-item-svg"},{children:(0,e.jsx)(c(),{onClick:L(n)})}))]}),n)}))})),(0,e.jsx)("div",s({className:"single-box-add",onClick:function(){w||(_.push(""),void 0===r.value&&F(d([],_,!0)),M&&M(_))}},{children:(0,e.jsx)(l(),{})})),(0,e.jsx)(o.default,{className:"single-box-error",error:C,helperText:k})]}))};h.default=u}(),h}()}));
|
package/Slider/index.d.ts
CHANGED
|
@@ -1,111 +1,14 @@
|
|
|
1
|
-
import React__default, { FunctionComponent } from 'react';
|
|
2
|
-
import styleInject from './node_modules/style-inject/dist/style-inject.es.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @author Hanz
|
|
6
|
-
* @date 2021/11/5 下午4:05
|
|
7
|
-
* @description
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare type TooltipPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
11
|
-
interface SliderRange {
|
|
12
|
-
draggableTrack?: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface SliderMarks {
|
|
15
|
-
[key: number]: React__default.ReactNode | {
|
|
16
|
-
style: React__default.CSSProperties;
|
|
17
|
-
label: React__default.ReactNode;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface SliderBaseProps {
|
|
21
|
-
/** 反向坐标 */
|
|
22
|
-
reverse?: boolean;
|
|
23
|
-
/** 最小值 */
|
|
24
|
-
min?: number;
|
|
25
|
-
/** 最大值 */
|
|
26
|
-
max?: number;
|
|
27
|
-
/** 步长,取值必须大于 0,并且可被 (max - min) 整除,
|
|
28
|
-
* 当 marks 不为空对象时,
|
|
29
|
-
* 可以设置 step 为 null,
|
|
30
|
-
* 此时 Slider 的可选值仅有 marks 标出来的部分
|
|
31
|
-
*/
|
|
32
|
-
step?: null | number;
|
|
33
|
-
/** 刻度标记,key 的类型必须为 number
|
|
34
|
-
* 且取值在闭区间 [min, max] 内,每个标签可以单独设置样式
|
|
35
|
-
*/
|
|
36
|
-
marks?: SliderMarks;
|
|
37
|
-
/** 是否只能拖拽到刻度上 */
|
|
38
|
-
dots?: boolean;
|
|
39
|
-
/** marks 不为空对象时有效,值为 true 时表示值为包含关系,false 表示并列 */
|
|
40
|
-
included?: boolean;
|
|
41
|
-
/** 禁用状态 */
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
/** 垂直方向 */
|
|
44
|
-
vertical?: boolean;
|
|
45
|
-
/** 提示格式化回调 */
|
|
46
|
-
tipFormatter?: null | ((value?: number) => React__default.ReactNode);
|
|
47
|
-
/** 类名 */
|
|
48
|
-
className?: string;
|
|
49
|
-
/** style */
|
|
50
|
-
style?: React__default.CSSProperties;
|
|
51
|
-
/** tooltip 是否始终显示 */
|
|
52
|
-
tooltipVisible?: boolean;
|
|
53
|
-
/** tooltip 显示位置 */
|
|
54
|
-
tooltipPlacement?: TooltipPlacement;
|
|
55
|
-
/** tooltip 挂载节点 */
|
|
56
|
-
getTooltipPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
57
|
-
/** 是否获得焦点 */
|
|
58
|
-
autoFocus?: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface SliderSingleProps extends SliderBaseProps {
|
|
61
|
-
/** 非范围slider */
|
|
62
|
-
range?: false;
|
|
63
|
-
/** 当前值 */
|
|
64
|
-
value?: number;
|
|
65
|
-
/** 默认值 */
|
|
66
|
-
defaultValue?: number;
|
|
67
|
-
/** 值变化时回调 */
|
|
68
|
-
onChange?: (value: number) => void;
|
|
69
|
-
/** 值变化后回调 */
|
|
70
|
-
onAfterChange?: (value: number) => void;
|
|
71
|
-
/** handle 样式 */
|
|
72
|
-
handleStyle?: React__default.CSSProperties;
|
|
73
|
-
/** 轨道样式 */
|
|
74
|
-
trackStyle?: React__default.CSSProperties;
|
|
75
|
-
}
|
|
76
|
-
interface SliderRangeProps extends SliderBaseProps {
|
|
77
|
-
/** 范围slider */
|
|
78
|
-
range: true | SliderRange;
|
|
79
|
-
/** 当前值 */
|
|
80
|
-
value?: number[];
|
|
81
|
-
/** 默认值 */
|
|
82
|
-
defaultValue?: number[];
|
|
83
|
-
/** 值变化时回调 */
|
|
84
|
-
onChange?: (value: number[]) => void;
|
|
85
|
-
/** 值变化后回调 */
|
|
86
|
-
onAfterChange?: (value: number[]) => void;
|
|
87
|
-
/** handle 样式 */
|
|
88
|
-
handleStyle?: React__default.CSSProperties[];
|
|
89
|
-
/** 轨道样式 */
|
|
90
|
-
trackStyle?: React__default.CSSProperties[];
|
|
91
|
-
/** 允许跨越 */
|
|
92
|
-
allowCross?: boolean;
|
|
93
|
-
/** 允许推动 */
|
|
94
|
-
pushable?: boolean | number;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/11/4 下午2:58\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-slider {\n position: relative;\n height: 8px;\n padding: 0;\n width: 100%;\n border-radius: 4px;\n touch-action: none;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.paraui-slider * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.paraui-slider-rail {\n position: absolute;\n width: 100%;\n background-color: rgba(171, 176, 185, 0.2);\n height: 8px;\n border-radius: 4px;\n}\n.paraui-slider-track {\n position: absolute;\n left: 0;\n height: 8px;\n border-radius: 4px;\n background-color: rgb(54, 102, 214);\n}\n.paraui-slider-handle {\n position: absolute;\n width: 16px;\n height: 16px;\n cursor: pointer;\n margin-top: -4px;\n border-radius: 50%;\n border: solid 2px rgb(54, 102, 214);\n background-color: rgb(255, 255, 255);\n touch-action: pan-x;\n}\n.paraui-slider-handle-dragging {\n border-color: rgb(54, 102, 214);\n box-shadow: 0 0 5px rgba(54, 102, 214, 0.2);\n outline: 2px solid rgba(54, 102, 214, 0.2);\n}\n.paraui-slider-handle:focus {\n outline: none;\n}\n.paraui-slider-handle-click-focused:focus {\n border-color: rgb(54, 102, 214);\n box-shadow: unset;\n}\n.paraui-slider-handle:hover {\n border-color: rgb(54, 102, 214);\n}\n.paraui-slider-handle:active {\n border-color: rgb(54, 102, 214);\n box-shadow: 0 0 5px rgba(54, 102, 214, 0.2);\n outline: 2px solid rgba(54, 102, 214, 0.2);\n cursor: grabbing;\n}\n.paraui-slider-mark {\n position: absolute;\n top: 18px;\n left: 0;\n width: 100%;\n font-size: 12px;\n}\n.paraui-slider-mark-text {\n position: absolute;\n display: inline-block;\n vertical-align: middle;\n text-align: center;\n cursor: pointer;\n color: #999;\n}\n.paraui-slider-mark-text-active {\n color: #666;\n}\n.paraui-slider-step {\n position: absolute;\n width: 100%;\n height: 8px;\n background: transparent;\n}\n.paraui-slider-dot {\n position: absolute;\n bottom: -2px;\n margin-left: -4px;\n width: 12px;\n height: 12px;\n border: solid 2px rgba(171, 176, 185, 0.4);\n background-color: rgb(255, 255, 255);\n cursor: pointer;\n border-radius: 50%;\n vertical-align: middle;\n}\n.paraui-slider-dot-active {\n border-color: rgb(54, 102, 214);\n}\n.paraui-slider-dot-reverse {\n margin-right: -4px;\n}\n.paraui-slider-disabled {\n background-color: #e9e9e9;\n}\n.paraui-slider-disabled .paraui-slider-track {\n background-color: #ccc;\n}\n.paraui-slider-disabled .paraui-slider-handle, .paraui-slider-disabled .paraui-slider-dot {\n border-color: #ccc;\n box-shadow: none;\n background-color: #fff;\n cursor: not-allowed;\n}\n.paraui-slider-disabled .paraui-slider-mark-text, .paraui-slider-disabled .paraui-slider-dot {\n cursor: not-allowed !important;\n}\n.paraui-slider-vertical {\n width: 14px;\n height: 100%;\n padding: 0 5px;\n}\n.paraui-slider-vertical .paraui-slider-rail {\n height: 100%;\n width: 4px;\n}\n.paraui-slider-vertical .paraui-slider-track {\n left: 5px;\n bottom: 0;\n width: 4px;\n}\n.paraui-slider-vertical .paraui-slider-handle {\n margin-left: -6px;\n touch-action: pan-y;\n}\n.paraui-slider-vertical .paraui-slider-mark {\n top: 0;\n left: 18px;\n height: 100%;\n}\n.paraui-slider-vertical .paraui-slider-step {\n height: 100%;\n width: 4px;\n}\n.paraui-slider-vertical .paraui-slider-dot {\n left: 0px;\n margin-bottom: -4px;\n}\n.paraui-slider-vertical .paraui-slider-dot:first-child {\n margin-bottom: -4px;\n}\n.paraui-slider-vertical .paraui-slider-dot:last-child {\n margin-bottom: -4px;\n}\n.paraui-slider-tooltip-zoom-down-enter, .paraui-slider-tooltip-zoom-down-appear {\n animation-duration: 0.3s;\n animation-fill-mode: both;\n display: block !important;\n animation-play-state: paused;\n}\n.paraui-slider-tooltip-zoom-down-leave {\n animation-duration: 0.3s;\n animation-fill-mode: both;\n display: block !important;\n animation-play-state: paused;\n}\n.paraui-slider-tooltip-zoom-down-enter.paraui-slider-tooltip-zoom-down-enter-active, .paraui-slider-tooltip-zoom-down-appear.paraui-slider-tooltip-zoom-down-appear-active {\n animation-name: rcSliderTooltipZoomDownIn;\n animation-play-state: running;\n}\n.paraui-slider-tooltip-zoom-down-leave.paraui-slider-tooltip-zoom-down-leave-active {\n animation-name: rcSliderTooltipZoomDownOut;\n animation-play-state: running;\n}\n.paraui-slider-tooltip-zoom-down-enter, .paraui-slider-tooltip-zoom-down-appear {\n transform: scale(0, 0);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n}\n.paraui-slider-tooltip-zoom-down-leave {\n animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);\n}\n@keyframes rcSliderTooltipZoomDownIn {\n 0% {\n opacity: 0;\n transform-origin: 50% 100%;\n transform: scale(0, 0);\n }\n 100% {\n transform-origin: 50% 100%;\n transform: scale(1, 1);\n }\n}\n@keyframes rcSliderTooltipZoomDownOut {\n 0% {\n transform-origin: 50% 100%;\n transform: scale(1, 1);\n }\n 100% {\n opacity: 0;\n transform-origin: 50% 100%;\n transform: scale(0, 0);\n }\n}\n.paraui-slider-tooltip {\n position: absolute;\n display: block;\n left: -9999px;\n top: -9999px;\n max-width: 250px;\n z-index: 1500;\n visibility: visible;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.paraui-slider-tooltip * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n.paraui-slider-tooltip-hidden {\n display: none;\n}\n.paraui-slider-tooltip-inner {\n min-width: 24px;\n padding-bottom: 3px;\n font-size: 14px;\n line-height: 1;\n color: rgba(46, 55, 67, 0.7);\n text-align: center;\n text-decoration: none;\n background-color: transparent;\n border-radius: 6px;\n white-space: nowrap;\n box-shadow: none;\n}\n.paraui-slider-tooltip-arrow {\n display: none;\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.paraui-slider-tooltip-placement-top .paraui-slider-tooltip-arrow {\n bottom: 4px;\n left: 50%;\n margin-left: -4px;\n border-width: 4px 4px 0;\n border-top-color: #6c6c6c;\n}";
|
|
98
|
-
styleInject(css_248z);
|
|
99
|
-
|
|
100
1
|
/**
|
|
101
2
|
* @author Hanz
|
|
102
3
|
* @date 2022/3/7 下午3:52
|
|
103
4
|
* @description
|
|
104
5
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
6
|
+
import { FunctionComponent } from 'react';
|
|
7
|
+
import { SliderSingleProps, SliderRangeProps } from './interface';
|
|
8
|
+
import './index.scss';
|
|
9
|
+
export declare type Visibles = {
|
|
107
10
|
[index: number]: boolean;
|
|
108
11
|
};
|
|
109
|
-
declare const Slider: FunctionComponent<SliderSingleProps | SliderRangeProps>;
|
|
110
|
-
|
|
111
|
-
export
|
|
12
|
+
export declare const Slider: FunctionComponent<SliderSingleProps | SliderRangeProps>;
|
|
13
|
+
export type { SliderSingleProps, SliderRangeProps };
|
|
14
|
+
export default Slider;
|
package/Slider/index.js
CHANGED
|
@@ -1,125 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
restProps = __rest(props, ["range", "step"]);
|
|
17
|
-
|
|
18
|
-
var prefixCls = 'paraui-slider';
|
|
19
|
-
var tooltipPrefixCls = 'paraui-slider-tooltip';
|
|
20
|
-
var draggableTrack;
|
|
21
|
-
|
|
22
|
-
if (_typeof(range) === 'object') {
|
|
23
|
-
draggableTrack = range.draggableTrack;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var _React$useState = React__default.useState({}),
|
|
27
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
-
visibles = _React$useState2[0],
|
|
29
|
-
setVisibles = _React$useState2[1]; //handle 是否显示
|
|
30
|
-
//切换tooltip 是否显示
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var toggleTooltipVisible = function toggleTooltipVisible(index, visible) {
|
|
34
|
-
setVisibles(function (prev) {
|
|
35
|
-
return Object.assign(Object.assign({}, prev), _defineProperty({}, index, visible));
|
|
36
|
-
});
|
|
37
|
-
}; //获得tooltip 显示位置
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var getTooltipPlacement = function getTooltipPlacement(tooltipPlacement, vertical) {
|
|
41
|
-
if (tooltipPlacement) {
|
|
42
|
-
return tooltipPlacement;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!vertical) {
|
|
46
|
-
return 'top';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return 'right';
|
|
50
|
-
}; //提示格式化
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var tipFormatterFn = function tipFormatterFn(value) {
|
|
54
|
-
return typeof value === 'number' ? value.toString() : '';
|
|
55
|
-
}; //handle with tooltip
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var handleWithTooltip = function handleWithTooltip(config) {
|
|
59
|
-
var tooltipPrefixCls = config.tooltipPrefixCls,
|
|
60
|
-
_a = config.info,
|
|
61
|
-
value = _a.value,
|
|
62
|
-
index = _a.index,
|
|
63
|
-
dragging = _a.dragging,
|
|
64
|
-
restProps = __rest(_a, ["value", "index", "dragging"]);
|
|
65
|
-
|
|
66
|
-
var _props$tipFormatter = props.tipFormatter,
|
|
67
|
-
tipFormatter = _props$tipFormatter === void 0 ? tipFormatterFn : _props$tipFormatter,
|
|
68
|
-
tooltipVisible = props.tooltipVisible,
|
|
69
|
-
tooltipPlacement = props.tooltipPlacement,
|
|
70
|
-
_props$getTooltipPopu = props.getTooltipPopupContainer,
|
|
71
|
-
getTooltipPopupContainer = _props$getTooltipPopu === void 0 ? function (triggerNode) {
|
|
72
|
-
return triggerNode;
|
|
73
|
-
} : _props$getTooltipPopu,
|
|
74
|
-
vertical = props.vertical;
|
|
75
|
-
var isTipFormatter = tipFormatter ? visibles[index] || dragging : false;
|
|
76
|
-
var visible = tooltipVisible || tooltipVisible === undefined && isTipFormatter;
|
|
77
|
-
return jsx(SliderTooltip, Object.assign({
|
|
78
|
-
prefixCls: tooltipPrefixCls,
|
|
79
|
-
overlay: tipFormatter ? tipFormatter(value) : '',
|
|
80
|
-
visible: visible,
|
|
81
|
-
placement: getTooltipPlacement(tooltipPlacement, vertical),
|
|
82
|
-
getTooltipContainer: getTooltipPopupContainer,
|
|
83
|
-
destroyTooltipOnHide: true
|
|
84
|
-
}, {
|
|
85
|
-
children: jsx(Handle, Object.assign({}, restProps, {
|
|
86
|
-
value: value,
|
|
87
|
-
onMouseEnter: function onMouseEnter() {
|
|
88
|
-
return toggleTooltipVisible(index, true);
|
|
89
|
-
},
|
|
90
|
-
onMouseLeave: function onMouseLeave() {
|
|
91
|
-
return toggleTooltipVisible(index, false);
|
|
92
|
-
}
|
|
93
|
-
}))
|
|
94
|
-
}), index);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
if (range) {
|
|
98
|
-
//范围slider
|
|
99
|
-
return jsx(Range, Object.assign({}, restProps, {
|
|
100
|
-
step: step,
|
|
101
|
-
pushable: restProps.pushable,
|
|
102
|
-
draggableTrack: draggableTrack,
|
|
103
|
-
handle: function handle(info) {
|
|
104
|
-
return handleWithTooltip({
|
|
105
|
-
tooltipPrefixCls: tooltipPrefixCls,
|
|
106
|
-
info: info
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
prefixCls: prefixCls
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return jsx(RcSlider, Object.assign({}, restProps, {
|
|
114
|
-
step: step,
|
|
115
|
-
handle: function handle(info) {
|
|
116
|
-
return handleWithTooltip({
|
|
117
|
-
tooltipPrefixCls: tooltipPrefixCls,
|
|
118
|
-
info: info
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
prefixCls: prefixCls
|
|
122
|
-
}));
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export { Slider, Slider as default };
|
|
1
|
+
!function(r,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("rc-slider")):"function"==typeof define&&define.amd?define(["react","rc-slider"],e):"object"==typeof exports?exports.ParaUI=e(require("react"),require("rc-slider")):r.ParaUI=e(r.react,r["rc-slider"])}(self,(function(r,e){return function(){var t={8872:function(r,e,t){(e=t(3645)(!1)).push([r.id,".paraui-slider{position:relative;height:8px;padding:0;width:100%;border-radius:4px;touch-action:none;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.paraui-slider *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.paraui-slider-rail{position:absolute;width:100%;background-color:rgba(171,176,185,.2);height:8px;border-radius:4px}.paraui-slider-track{position:absolute;left:0;height:8px;border-radius:4px;background-color:#3666d6}.paraui-slider-handle{position:absolute;width:16px;height:16px;cursor:pointer;margin-top:-4px;border-radius:50%;border:solid 2px #3666d6;background-color:#fff;touch-action:pan-x}.paraui-slider-handle-dragging{border-color:#3666d6;box-shadow:0 0 5px rgba(54,102,214,.2);outline:2px solid rgba(54,102,214,.2)}.paraui-slider-handle:focus{outline:none}.paraui-slider-handle-click-focused:focus{border-color:#3666d6;box-shadow:unset}.paraui-slider-handle:hover{border-color:#3666d6}.paraui-slider-handle:active{border-color:#3666d6;box-shadow:0 0 5px rgba(54,102,214,.2);outline:2px solid rgba(54,102,214,.2);cursor:grabbing}.paraui-slider-mark{position:absolute;top:18px;left:0;width:100%;font-size:12px}.paraui-slider-mark-text{position:absolute;display:inline-block;vertical-align:middle;text-align:center;cursor:pointer;color:#999}.paraui-slider-mark-text-active{color:#666}.paraui-slider-step{position:absolute;width:100%;height:8px;background:rgba(0,0,0,0)}.paraui-slider-dot{position:absolute;bottom:-2px;margin-left:-4px;width:12px;height:12px;border:solid 2px rgba(171,176,185,.4);background-color:#fff;cursor:pointer;border-radius:50%;vertical-align:middle}.paraui-slider-dot-active{border-color:#3666d6}.paraui-slider-dot-reverse{margin-right:-4px}.paraui-slider-disabled{background-color:#e9e9e9}.paraui-slider-disabled .paraui-slider-track{background-color:#ccc}.paraui-slider-disabled .paraui-slider-handle,.paraui-slider-disabled .paraui-slider-dot{border-color:#ccc;box-shadow:none;background-color:#fff;cursor:not-allowed}.paraui-slider-disabled .paraui-slider-mark-text,.paraui-slider-disabled .paraui-slider-dot{cursor:not-allowed !important}.paraui-slider-vertical{width:14px;height:100%;padding:0 5px}.paraui-slider-vertical .paraui-slider-rail{height:100%;width:4px}.paraui-slider-vertical .paraui-slider-track{left:5px;bottom:0;width:4px}.paraui-slider-vertical .paraui-slider-handle{margin-left:-6px;touch-action:pan-y}.paraui-slider-vertical .paraui-slider-mark{top:0;left:18px;height:100%}.paraui-slider-vertical .paraui-slider-step{height:100%;width:4px}.paraui-slider-vertical .paraui-slider-dot{left:0px;margin-bottom:-4px}.paraui-slider-vertical .paraui-slider-dot:first-child{margin-bottom:-4px}.paraui-slider-vertical .paraui-slider-dot:last-child{margin-bottom:-4px}.paraui-slider-tooltip-zoom-down-enter,.paraui-slider-tooltip-zoom-down-appear{animation-duration:.3s;animation-fill-mode:both;display:block !important;animation-play-state:paused}.paraui-slider-tooltip-zoom-down-leave{animation-duration:.3s;animation-fill-mode:both;display:block !important;animation-play-state:paused}.paraui-slider-tooltip-zoom-down-enter.paraui-slider-tooltip-zoom-down-enter-active,.paraui-slider-tooltip-zoom-down-appear.paraui-slider-tooltip-zoom-down-appear-active{animation-name:rcSliderTooltipZoomDownIn;animation-play-state:running}.paraui-slider-tooltip-zoom-down-leave.paraui-slider-tooltip-zoom-down-leave-active{animation-name:rcSliderTooltipZoomDownOut;animation-play-state:running}.paraui-slider-tooltip-zoom-down-enter,.paraui-slider-tooltip-zoom-down-appear{transform:scale(0, 0);animation-timing-function:cubic-bezier(0.23, 1, 0.32, 1)}.paraui-slider-tooltip-zoom-down-leave{animation-timing-function:cubic-bezier(0.755, 0.05, 0.855, 0.06)}@keyframes rcSliderTooltipZoomDownIn{0%{opacity:0;transform-origin:50% 100%;transform:scale(0, 0)}100%{transform-origin:50% 100%;transform:scale(1, 1)}}@keyframes rcSliderTooltipZoomDownOut{0%{transform-origin:50% 100%;transform:scale(1, 1)}100%{opacity:0;transform-origin:50% 100%;transform:scale(0, 0)}}.paraui-slider-tooltip{position:absolute;display:block;left:-9999px;top:-9999px;max-width:250px;z-index:1500;visibility:visible;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.paraui-slider-tooltip *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.paraui-slider-tooltip-hidden{display:none}.paraui-slider-tooltip-inner{min-width:24px;padding-bottom:3px;font-size:14px;line-height:1;color:rgba(46,55,67,.7);text-align:center;text-decoration:none;background-color:rgba(0,0,0,0);border-radius:6px;white-space:nowrap;box-shadow:none}.paraui-slider-tooltip-arrow{display:none;position:absolute;width:0;height:0;border-color:rgba(0,0,0,0);border-style:solid}.paraui-slider-tooltip-placement-top .paraui-slider-tooltip-arrow{bottom:4px;left:50%;margin-left:-4px;border-width:4px 4px 0;border-top-color:#6c6c6c}",""]),r.exports=e},3645:function(r){"use strict";r.exports=function(r){var e=[];return e.toString=function(){return this.map((function(e){var t=function(r,e){var t=r[1]||"",o=r[3];if(!o)return t;if(e&&"function"==typeof btoa){var i=(a=o,l=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(l),"/*# ".concat(s," */")),n=o.sources.map((function(r){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(r," */")}));return[t].concat(n).concat([i]).join("\n")}var a,l,s;return[t].join("\n")}(e,r);return e[2]?"@media ".concat(e[2]," {").concat(t,"}"):t})).join("")},e.i=function(r,t,o){"string"==typeof r&&(r=[[null,r,""]]);var i={};if(o)for(var n=0;n<this.length;n++){var a=this[n][0];null!=a&&(i[a]=!0)}for(var l=0;l<r.length;l++){var s=[].concat(r[l]);o&&i[s[0]]||(t&&(s[2]?s[2]="".concat(t," and ").concat(s[2]):s[2]=t),e.push(s))}},e}},7418:function(r){"use strict";
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function i(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}r.exports=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(r){o[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(r){return!1}}()?Object.assign:function(r,n){for(var a,l,s=i(r),d=1;d<arguments.length;d++){for(var p in a=Object(arguments[d]))t.call(a,p)&&(s[p]=a[p]);if(e){l=e(a);for(var c=0;c<l.length;c++)o.call(a,l[c])&&(s[l[c]]=a[l[c]])}}return s}},5251:function(r,e,t){"use strict";
|
|
7
|
+
/** @license React v17.0.2
|
|
8
|
+
* react-jsx-runtime.production.min.js
|
|
9
|
+
*
|
|
10
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the MIT license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
t(7418);var o=t(8156),i=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var n=Symbol.for;i=n("react.element"),n("react.fragment")}var a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function d(r,e,t){var o,n={},d=null,p=null;for(o in void 0!==t&&(d=""+t),void 0!==e.key&&(d=""+e.key),void 0!==e.ref&&(p=e.ref),e)l.call(e,o)&&!s.hasOwnProperty(o)&&(n[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===n[o]&&(n[o]=e[o]);return{$$typeof:i,type:r,key:d,ref:p,props:n,_owner:a.current}}e.jsx=d},5893:function(r,e,t){"use strict";r.exports=t(5251)},8677:function(r,e,t){var o=t(3379),i=t(8872);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[r.id,i,""]]);var n={insert:("body","body"),singleton:!1};o(i,n);r.exports=i.locals||{}},3379:function(r,e,t){"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},n=function(){var r={};return function(e){if(void 0===r[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(r){t=null}r[e]=t}return r[e]}}(),a=[];function l(r){for(var e=-1,t=0;t<a.length;t++)if(a[t].identifier===r){e=t;break}return e}function s(r,e){for(var t={},o=[],i=0;i<r.length;i++){var n=r[i],s=e.base?n[0]+e.base:n[0],d=t[s]||0,p="".concat(s," ").concat(d);t[s]=d+1;var c=l(p),u={css:n[1],media:n[2],sourceMap:n[3]};-1!==c?(a[c].references++,a[c].updater(u)):a.push({identifier:p,updater:h(u,e),references:1}),o.push(p)}return o}function d(r){var e=document.createElement("style"),o=r.attributes||{};if(void 0===o.nonce){var i=t.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(r){e.setAttribute(r,o[r])})),"function"==typeof r.insert)r.insert(e);else{var a=n(r.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var p,c=(p=[],function(r,e){return p[r]=e,p.filter(Boolean).join("\n")});function u(r,e,t,o){var i=t?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(r.styleSheet)r.styleSheet.cssText=c(e,i);else{var n=document.createTextNode(i),a=r.childNodes;a[e]&&r.removeChild(a[e]),a.length?r.insertBefore(n,a[e]):r.appendChild(n)}}function f(r,e,t){var o=t.css,i=t.media,n=t.sourceMap;if(i?r.setAttribute("media",i):r.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),r.styleSheet)r.styleSheet.cssText=o;else{for(;r.firstChild;)r.removeChild(r.firstChild);r.appendChild(document.createTextNode(o))}}var b=null,g=0;function h(r,e){var t,o,i;if(e.singleton){var n=g++;t=b||(b=d(e)),o=u.bind(null,t,n,!1),i=u.bind(null,t,n,!0)}else t=d(e),o=f.bind(null,t,e),i=function(){!function(r){if(null===r.parentNode)return!1;r.parentNode.removeChild(r)}(t)};return o(r),function(e){if(e){if(e.css===r.css&&e.media===r.media&&e.sourceMap===r.sourceMap)return;o(r=e)}else i()}}r.exports=function(r,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var t=s(r=r||[],e);return function(r){if(r=r||[],"[object Array]"===Object.prototype.toString.call(r)){for(var o=0;o<t.length;o++){var i=l(t[o]);a[i].references--}for(var n=s(r,e),d=0;d<t.length;d++){var p=l(t[d]);0===a[p].references&&(a[p].updater(),a.splice(p,1))}t=n}}}},5968:function(r){"use strict";r.exports=e},8156:function(e){"use strict";e.exports=r}},o={};function i(r){var e=o[r];if(void 0!==e)return e.exports;var n=o[r]={id:r,exports:{}};return t[r](n,n.exports,i),n.exports}i.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return i.d(e,{a:e}),e},i.d=function(r,e){for(var t in e)i.o(e,t)&&!i.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})},i.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},i.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},i.nc=void 0;var n={};return function(){"use strict";i.r(n),i.d(n,{Slider:function(){return d}});var r=i(5893),e=i(8156),t=i.n(e),o=i(5968),a=i.n(o),l=(i(8677),function(){return l=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i]);return r},l.apply(this,arguments)}),s=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(r);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(t[o[i]]=r[o[i]])}return t},d=function(e){var i,n=e.range,d=e.step,p=s(e,["range","step"]),c="paraui-slider",u="paraui-slider-tooltip";"object"==typeof n&&(i=n.draggableTrack);var f=t().useState({}),b=f[0],g=f[1],h=function(r,e){g((function(t){var o;return l(l({},t),((o={})[r]=e,o))}))},m=function(r,e){return r||(e?"right":"top")},v=function(r){return"number"==typeof r?r.toString():""},x=function(t){var i=t.tooltipPrefixCls,n=t.info,a=n.value,d=n.index,p=n.dragging,c=s(n,["value","index","dragging"]),u=e.tipFormatter,f=void 0===u?v:u,g=e.tooltipVisible,x=e.tooltipPlacement,y=e.getTooltipPopupContainer,w=void 0===y?function(r){return r}:y,O=e.vertical,j=!!f&&(b[d]||p),k=g||void 0===g&&j;return(0,r.jsx)(o.SliderTooltip,l({prefixCls:i,overlay:f?f(a):"",visible:k,placement:m(x,O),getTooltipContainer:w,destroyTooltipOnHide:!0},{children:(0,r.jsx)(o.Handle,l({},c,{value:a,onMouseEnter:function(){return h(d,!0)},onMouseLeave:function(){return h(d,!1)}}))}),d)};return n?(0,r.jsx)(o.Range,l({},p,{step:d,pushable:p.pushable,draggableTrack:i,handle:function(r){return x({tooltipPrefixCls:u,info:r})},prefixCls:c})):(0,r.jsx)(a(),l({},p,{step:d,handle:function(r){return x({tooltipPrefixCls:u,info:r})},prefixCls:c}))};n.default=d}(),n}()}));
|