@para-ui/core 2.2.4 → 2.2.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.d.ts +12 -6
- package/AutoBox/index.js +203 -15
- package/AutoTips/index.d.ts +12 -6
- package/AutoTips/index.js +84 -15
- package/Breadcrumbs/index.d.ts +13 -7
- package/Breadcrumbs/index.js +227 -15
- package/Button/index.d.ts +92 -11
- package/Button/index.js +348 -14
- package/ButtonGroup/index.d.ts +21 -9
- package/ButtonGroup/index.js +128 -14
- package/Carousel/index.d.ts +17 -11
- package/Carousel/index.js +74 -15
- package/Cascader/index.d.ts +12 -7
- package/Cascader/index.js +166 -15
- package/Checkbox/index.d.ts +13 -7
- package/Checkbox/index.js +105 -14
- package/CheckboxGroup/index.d.ts +15 -9
- package/CheckboxGroup/index.js +138 -14
- package/Collapse/index.d.ts +49 -14
- package/Collapse/index.js +171 -15
- package/CollapseBox/index.d.ts +11 -5
- package/CollapseBox/index.js +164 -15
- package/ColorPicker/index.d.ts +4 -4
- package/ColorPicker/index.js +4 -1
- package/ComboSelect/index.d.ts +306 -6
- package/ComboSelect/index.js +1803 -14
- package/Container/index.d.ts +13 -8
- package/Container/index.js +239 -15
- package/DatePicker/index.d.ts +30 -17
- package/DatePicker/index.js +733 -14
- package/Desktop/index.d.ts +14 -6
- package/Desktop/index.js +853 -14
- package/Drawer/index.d.ts +92 -6
- package/Drawer/index.js +186 -14
- package/Dropdown/index.d.ts +29 -0
- package/Dropdown/index.js +67 -0
- package/Empty/index.d.ts +16 -10
- package/Empty/index.js +644 -14
- package/Form/index.d.ts +11 -9
- package/Form/index.js +384 -14
- package/FormItem/index.d.ts +5 -152
- package/FormItem/index.js +81 -14
- package/FunctionModal/index.d.ts +14 -3
- package/FunctionModal/index.js +39 -14
- package/GlobalContext/index.d.ts +38 -8
- package/GlobalContext/index.js +41 -16
- package/Help/index.d.ts +16 -10
- package/Help/index.js +39 -15
- package/HelperText/index.d.ts +11 -5
- package/HelperText/index.js +29 -15
- package/InputLang/index.d.ts +13 -7
- package/InputLang/index.js +270 -14
- package/InputNumber/index.d.ts +16 -10
- package/InputNumber/index.js +308 -14
- package/Label/index.d.ts +12 -6
- package/Label/index.js +81 -14
- package/Loading/index.d.ts +12 -6
- package/Loading/index.js +47 -15
- package/Menu/index.d.ts +123 -5
- package/Menu/index.js +1232 -14
- package/Message/index.d.ts +11 -5
- package/Message/index.js +222 -15
- package/Modal/index.d.ts +142 -40
- package/Modal/index.js +443 -14
- package/MultiBox/index.d.ts +13 -7
- package/MultiBox/index.js +231 -14
- package/Notification/index.d.ts +22 -16
- package/Notification/index.js +266 -15
- package/OperateBtn/index.d.ts +16 -10
- package/OperateBtn/index.js +260 -14
- package/PageHeader/index.d.ts +178 -5
- package/PageHeader/index.js +1171 -14
- package/Pagination/index.d.ts +12 -6
- package/Pagination/index.js +469 -14
- package/ParauiProvider/index.d.ts +9 -8
- package/ParauiProvider/index.js +53 -15
- package/PopConfirm/index.d.ts +23 -10
- package/PopConfirm/index.js +189 -14
- package/Popover/index.d.ts +18 -11
- package/Popover/index.js +66 -15
- package/Progress/index.d.ts +18 -12
- package/Progress/index.js +358 -20
- package/Querying/index.d.ts +15 -9
- package/Querying/index.js +762 -14
- package/Radio/index.d.ts +13 -7
- package/Radio/index.js +94 -14
- package/RadioGroup/index.d.ts +15 -9
- package/RadioGroup/index.js +128 -14
- package/Search/index.d.ts +18 -12
- package/Search/index.js +220 -14
- package/Select/index.d.ts +13 -7
- package/Select/index.js +1288 -14
- package/SelectInput/index.d.ts +11 -5
- package/SelectInput/index.js +51 -14
- package/SingleBox/index.d.ts +13 -7
- package/SingleBox/index.js +194 -14
- package/Slider/index.d.ts +104 -7
- package/Slider/index.js +125 -15
- package/Split/index.d.ts +8 -3
- package/Split/index.js +134 -15
- package/Stepper/index.d.ts +41 -25
- package/Stepper/index.js +99 -15
- package/Switch/index.d.ts +16 -10
- package/Switch/index.js +73 -14
- package/Table/index.d.ts +12 -4
- package/Table/index.js +2725 -14
- package/Tabs/index.d.ts +64 -29
- package/Tabs/index.js +218 -14
- package/Tag/index.d.ts +78 -12
- package/Tag/index.js +286 -14
- package/Test/index.d.ts +3 -2
- package/Test/index.js +9 -16
- package/TextField/index.d.ts +22 -16
- package/TextField/index.js +686 -14
- package/TimePicker/index.d.ts +20 -10
- package/TimePicker/index.js +77 -14
- package/Timeline/index.d.ts +49 -13
- package/Timeline/index.js +150 -15
- package/ToggleButton/index.d.ts +61 -10
- package/ToggleButton/index.js +200 -14
- package/Tooltip/index.d.ts +12 -10
- package/Tooltip/index.js +335 -15
- package/Transfer/index.d.ts +8 -3
- package/Transfer/index.js +343 -14
- package/Tree/index.d.ts +8 -5
- package/Tree/index.js +35 -14
- package/Upload/index.d.ts +179 -8
- package/Upload/index.js +1542 -14
- package/_verture/defineProperty-0590dc61.js +16 -0
- package/_verture/index-0d8e1d07.js +4 -0
- package/_verture/index-14a47097.js +4 -0
- package/_verture/index-342379c6.js +391 -0
- package/_verture/index-458032d7.js +10 -0
- package/_verture/index-46bfb2f0.js +778 -0
- package/_verture/index-50401de7.js +4 -0
- package/_verture/index-5b08df83.js +4 -0
- package/_verture/index-6190b129.js +4 -0
- package/_verture/index-7ef1e3b6.js +1553 -0
- package/_verture/index-a369ca3f.js +4 -0
- package/_verture/index-c60911dc.js +39 -0
- package/_verture/index-e2881a53.js +16 -0
- package/_verture/index-ff4c2a27.js +200 -0
- package/{Tree/interface.d.ts → _verture/interface-128abdd3.js} +15 -25
- package/_verture/interface-a77a851e.js +25 -0
- package/{Table/interface.d.ts → _verture/interface-a9b7c716.js} +20 -28
- package/_verture/intl-336570e4.js +65 -0
- package/_verture/modalContext-25890584.js +228 -0
- package/_verture/modalContext-639f2787.js +58 -0
- package/_verture/slicedToArray-d7722f4b.js +62 -0
- package/_verture/style-inject.es-300983ab.js +28 -0
- package/_verture/toConsumableArray-f8047a75.js +19 -0
- package/_verture/tslib.es6-55ed4bd2.js +38 -0
- package/_verture/typeof-498dd2b1.js +11 -0
- package/_verture/useFormatMessage-ac9d6acf.js +20 -0
- package/_verture/useGlobalProps-af9a2af6.js +12 -0
- package/index.d.ts +88 -128
- package/index.js +160 -19
- package/package.json +59 -22
- package/Button/SplitButton.d.ts +0 -61
- package/Button/lang/en_US.d.ts +0 -4
- package/Button/lang/index.d.ts +0 -9
- package/Button/lang/zh_CN.d.ts +0 -4
- package/Cascader/lang/en_US.d.ts +0 -4
- package/Cascader/lang/index.d.ts +0 -9
- package/Cascader/lang/zh_CN.d.ts +0 -4
- package/Collapse/collapsePanel.d.ts +0 -30
- package/Collapse/motion.d.ts +0 -5
- package/Collapse/util.d.ts +0 -11
- package/CollapseBox/util.d.ts +0 -5
- package/ComboSelect/WithTabsCombo/index.d.ts +0 -11
- package/ComboSelect/WithTabsCombo/interface.d.ts +0 -141
- package/ComboSelect/interface.d.ts +0 -143
- package/ComboSelect/lang/en_US.d.ts +0 -8
- package/ComboSelect/lang/index.d.ts +0 -17
- package/ComboSelect/lang/zh_CN.d.ts +0 -8
- package/ComboSelect/utils.d.ts +0 -12
- package/DatePicker/PickerButton.d.ts +0 -3
- package/DatePicker/PickerTag.d.ts +0 -3
- package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
- package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
- package/DatePicker/generatePicker/index.d.ts +0 -77
- package/DatePicker/lang/en_US.d.ts +0 -3
- package/DatePicker/lang/index.d.ts +0 -7
- package/DatePicker/lang/zh_CN.d.ts +0 -3
- package/DatePicker/util.d.ts +0 -20
- package/Drawer/interface.d.ts +0 -83
- package/Drawer/lang/en_US.d.ts +0 -5
- package/Drawer/lang/index.d.ts +0 -11
- package/Drawer/lang/zh_CN.d.ts +0 -5
- package/Empty/images/index.d.ts +0 -2
- package/Empty/lang/en_US.d.ts +0 -6
- package/Empty/lang/index.d.ts +0 -13
- package/Empty/lang/zh_CN.d.ts +0 -6
- package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
- package/FormItem/compoments/formFile/index.d.ts +0 -38
- package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
- package/FormItem/compoments/formSelect/index.d.ts +0 -18
- package/FormItem/errorTips.d.ts +0 -12
- package/FormItem/itemType.d.ts +0 -42
- package/FormItem/validateFunction.d.ts +0 -15
- package/FunctionModal/dialog.d.ts +0 -58
- package/FunctionModal/modalContext.d.ts +0 -14
- package/GlobalContext/componentsProps.d.ts +0 -19
- package/GlobalContext/confirmLocale.d.ts +0 -7
- package/GlobalContext/intl.d.ts +0 -34
- package/GlobalContext/useFormatMessage.d.ts +0 -3
- package/Hooks/useGlobalProps.d.ts +0 -1
- package/Menu/footerExpansion.d.ts +0 -9
- package/Menu/interface.d.ts +0 -139
- package/Menu/logo.d.ts +0 -9
- package/Menu/verticalMenuList.d.ts +0 -14
- package/Modal/Confirm/index.d.ts +0 -66
- package/Modal/lang/en_US.d.ts +0 -5
- package/Modal/lang/index.d.ts +0 -11
- package/Modal/lang/zh_CN.d.ts +0 -5
- package/OperateBtn/lang/en_US.d.ts +0 -4
- package/OperateBtn/lang/index.d.ts +0 -9
- package/OperateBtn/lang/zh_CN.d.ts +0 -4
- package/PageHeader/horizontalMeun.d.ts +0 -9
- package/PageHeader/horizontalMeunRight.d.ts +0 -9
- package/PageHeader/interface.d.ts +0 -167
- package/Pagination/lang/en_US.d.ts +0 -8
- package/Pagination/lang/index.d.ts +0 -17
- package/Pagination/lang/zh_CN.d.ts +0 -8
- package/PopConfirm/lang/en_US.d.ts +0 -5
- package/PopConfirm/lang/index.d.ts +0 -11
- package/PopConfirm/lang/zh_CN.d.ts +0 -5
- package/Popper/index.d.ts +0 -13
- package/Popper/index.js +0 -16
- package/Progress/Line.d.ts +0 -47
- package/Progress/Steps.d.ts +0 -17
- package/Progress/utils.d.ts +0 -6
- package/Querying/images/index.d.ts +0 -2
- package/Querying/lang/en_US.d.ts +0 -4
- package/Querying/lang/index.d.ts +0 -9
- package/Querying/lang/zh_CN.d.ts +0 -4
- package/README.md +0 -489
- package/Select/lang/en_US.d.ts +0 -5
- package/Select/lang/index.d.ts +0 -11
- package/Select/lang/zh_CN.d.ts +0 -5
- package/Slider/interface.d.ts +0 -102
- package/Stepper/icons.d.ts +0 -5
- package/Table/lang/en_US.d.ts +0 -6
- package/Table/lang/index.d.ts +0 -13
- package/Table/lang/zh_CN.d.ts +0 -6
- package/Table/tableBody.d.ts +0 -9
- package/Table/tableBodyElement/index.d.ts +0 -15
- package/Table/tableBodyInterface.d.ts +0 -67
- package/Table/tableContainer/index.d.ts +0 -16
- package/Table/tableElement/index.d.ts +0 -17
- package/Table/tableHead.d.ts +0 -9
- package/Table/tableHeadElement/index.d.ts +0 -15
- package/Table/tableHeadInterface.d.ts +0 -30
- package/Table/tablePagination.d.ts +0 -9
- package/Table/tablePaginationInterFace.d.ts +0 -24
- package/Table/tdElement/index.d.ts +0 -15
- package/Table/thElement/index.d.ts +0 -15
- package/Table/trElement/index.d.ts +0 -15
- package/Table/util.d.ts +0 -16
- package/Tag/TagGroup.d.ts +0 -66
- package/TimePicker/locale/en_US.d.ts +0 -3
- package/TimePicker/locale/zh_CN.d.ts +0 -3
- package/TimePicker/style/index.d.ts +0 -1
- package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
- package/Transfer/lang/en_US.d.ts +0 -6
- package/Transfer/lang/index.d.ts +0 -13
- package/Transfer/lang/zh_CN.d.ts +0 -6
- package/Tree/OperateBar/index.d.ts +0 -13
- package/Tree/Tree.d.ts +0 -4
- package/Tree/lang/en_US.d.ts +0 -8
- package/Tree/lang/index.d.ts +0 -17
- package/Tree/lang/zh_CN.d.ts +0 -8
- package/Tree/utils/closestPolyfill.d.ts +0 -0
- package/Tree/utils/tools.d.ts +0 -26
- package/Tree/utils/treeUtil.d.ts +0 -15
- package/Upload/Dragger/index.d.ts +0 -10
- package/Upload/ErroTip/index.d.ts +0 -13
- package/Upload/ImageUpload/index.d.ts +0 -14
- package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
- package/Upload/ImgCrop/constants.d.ts +0 -7
- package/Upload/ImgCrop/index.d.ts +0 -6
- package/Upload/ImgCrop/interface.d.ts +0 -24
- package/Upload/UploadList/index.d.ts +0 -5
- package/Upload/interface.d.ts +0 -134
- package/Upload/lang/en_US.d.ts +0 -12
- package/Upload/lang/index.d.ts +0 -25
- package/Upload/lang/zh_CN.d.ts +0 -12
- package/cdn/AutoBox/index.js +0 -29
- package/cdn/AutoTips/index.js +0 -40
- package/cdn/Breadcrumbs/index.js +0 -53
- package/cdn/Button/index.js +0 -79
- package/cdn/ButtonGroup/index.js +0 -79
- package/cdn/Carousel/index.js +0 -6
- package/cdn/Cascader/index.js +0 -42
- package/cdn/Checkbox/index.js +0 -53
- package/cdn/CheckboxGroup/index.js +0 -53
- package/cdn/Collapse/index.js +0 -27
- package/cdn/CollapseBox/index.js +0 -1
- package/cdn/ColorPicker/index.js +0 -1
- package/cdn/ComboSelect/index.js +0 -438
- package/cdn/Container/index.js +0 -1
- package/cdn/DatePicker/index.js +0 -185
- package/cdn/Desktop/index.js +0 -24
- package/cdn/Drawer/index.js +0 -84
- package/cdn/Empty/index.js +0 -1
- package/cdn/Form/index.js +0 -477
- package/cdn/FormItem/index.js +0 -477
- package/cdn/FunctionModal/index.js +0 -144
- package/cdn/GlobalContext/index.js +0 -1
- package/cdn/Help/index.js +0 -53
- package/cdn/HelperText/index.js +0 -1
- package/cdn/InputLang/index.js +0 -144
- package/cdn/InputNumber/index.js +0 -118
- package/cdn/Label/index.js +0 -53
- package/cdn/Loading/index.js +0 -14
- package/cdn/Menu/index.js +0 -40
- package/cdn/Message/index.js +0 -53
- package/cdn/Modal/index.js +0 -144
- package/cdn/MultiBox/index.js +0 -131
- package/cdn/Notification/index.js +0 -66
- package/cdn/OperateBtn/index.js +0 -92
- package/cdn/PageHeader/index.js +0 -92
- package/cdn/Pagination/index.js +0 -214
- package/cdn/ParauiProvider/index.js +0 -9
- package/cdn/PopConfirm/index.js +0 -131
- package/cdn/Popover/index.js +0 -16
- package/cdn/Popper/index.js +0 -26
- package/cdn/Progress/index.js +0 -58
- package/cdn/Querying/index.js +0 -1
- package/cdn/Radio/index.js +0 -53
- package/cdn/RadioGroup/index.js +0 -53
- package/cdn/Search/index.js +0 -144
- package/cdn/Select/index.js +0 -131
- package/cdn/SelectInput/index.js +0 -131
- package/cdn/SingleBox/index.js +0 -131
- package/cdn/Slider/index.js +0 -16
- package/cdn/Split/index.js +0 -1
- package/cdn/Stepper/index.js +0 -154
- package/cdn/Switch/index.js +0 -71
- package/cdn/Table/index.js +0 -292
- package/cdn/Tabs/index.js +0 -165
- package/cdn/Tag/index.js +0 -27
- package/cdn/Test/index.js +0 -1
- package/cdn/TextField/index.js +0 -105
- package/cdn/TimePicker/index.js +0 -185
- package/cdn/Timeline/index.js +0 -16
- package/cdn/ToggleButton/index.js +0 -79
- package/cdn/Tooltip/index.js +0 -40
- package/cdn/Transfer/index.js +0 -170
- package/cdn/Tree/index.js +0 -170
- package/cdn/Upload/index.js +0 -252
- package/style.css +0 -72
package/TextField/index.js
CHANGED
|
@@ -1,14 +1,686 @@
|
|
|
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")):"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"],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")):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"])}(self,(function(e,t,i,n,o,r,l,a,c,d){return function(){var s={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},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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 d(e,t,i){var n,r={},d=null,s=null;for(n in void 0!==i&&(d=""+i),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(s=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:d,ref:s,props:r,_owner:l.current}}t.jsx=d,t.jsxs=d},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||{}},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],d=i[c]||0,s="".concat(c," ").concat(d);i[c]=d+1;var u=a(s),f={css:r[1],media:r[2],sourceMap:r[3]};-1!==u?(l[u].references++,l[u].updater(f)):l.push({identifier:s,updater:g(f,t),references:1}),n.push(s)}return n}function d(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 s,u=(s=[],function(e,t){return s[e]=t,s.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=d(t)),n=f.bind(null,i,r,!1),o=f.bind(null,i,r,!0)}else i=d(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),d=0;d<i.length;d++){var s=a(i[d]);0===l[s].references&&(l[s].updater(),l.splice(s,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,d=void 0===c?"bottom-start":c,s=e.tips,u=void 0===s?"":s,f=e.className,p=void 0===f?"":f,x=e.beyondText,h=void 0===x||x,g=e.interactive,v=void 0===g||g,b=e.style,m=(0,o.useRef)(),w=(0,o.useState)(""),y=w[0],j=w[1];(0,o.useEffect)((function(){j(u)}),[u]);var O;return(0,n.jsx)("div",l({ref:m,className:(O="paraui-auto-tips",p&&(O+=" "+p),O),onMouseOver:function(){var e="";m.current&&m.current.scrollWidth>m.current.offsetWidth&&(e=u||(h?m.current.innerText:t)),j(e)},style:b},{children:(0,n.jsx)(r.default,l({arrow:a,title:y,placement:d,interactive:v,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),d=(i(2113),function(){return d=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},d.apply(this,arguments)}),s=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,v=s(e,["title","children","arrow","interactive","className","placement"]);return(0,n.jsx)(o.default,d({title:i,arrow:u,interactive:p,placement:g},v,{children:(0,n.jsx)("span",d({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,d=void 0!==c&&c,s=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),s&&(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}),d&&(0,n.jsx)("span",r({className:"paraui-label-required"},{children:"*"})),a&&(0,n.jsx)("span",{children:a}),s&&(0,n.jsx)(o.default,r({title:s,placement:p,arrow:x},{children:h}))]})),"line"===f&&(0,n.jsx)(o.default,r({title:s||"",placement:p,arrow:x},{children:(0,n.jsxs)("label",r({className:g(),style:i},{children:[(0,n.jsx)(n.Fragment,{children:l}),d&&(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,d=(0,o.useRef)(null);(0,o.useEffect)((function(){d&&d.current&&d.current.parentNode&&(d.current.parentNode.style.position||(d.current.parentNode.style.position="relative"))}),[]);var s;return(0,n.jsxs)("div",a({className:(s="paraui-loading",t&&(s+=" "+t),s),style:i,ref:d},{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}})]}))}},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,d=e.className,s=e.arrow,u=void 0===s||s,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",d,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=d},6788:function(e){"use strict";e.exports=a},8076:function(e){"use strict";e.exports=n},2788:function(e){"use strict";e.exports=c},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}},u={};function f(e){var t=u[e];if(void 0!==t)return t.exports;var i=u[e]={id:e,exports:{}};return s[e](i,i.exports,f),i.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var i in t)f.o(t,i)&&!f.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.nc=void 0;var p={};return function(){"use strict";f.r(p),f.d(p,{TextField:function(){return w}});var e=f(5893),t=f(8156),i=f(8767),n=f(8543),o=f(5428),r=f.n(o),l=f(9979),a=f.n(l),c=f(6788),d=f.n(c),s=f(7839),u=f(7502),x=f(7371),h=f(4254),g=f(6010),v=(f(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)}),b=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},m=function(e){return"number"==typeof e&&!isNaN(e)},w=function(o){var l=(0,g.Z)(o,"TextField"),c=l.className,f=l.style,p=l.size,w=void 0===p?"large":p,y=l.labelMode,j=void 0===y?"outside":y,O=l.placeholder,S=void 0===O?"":O,C=l.label,N=void 0===C?"":C,k=l.labelTooltip,P=l.disabled,M=void 0!==P&&P,q=l.multiline,E=void 0!==q&&q,_=l.required,F=void 0!==_&&_,L=l.labelSign,T=l.rows,z=void 0===T?2:T,H=l.error,I=void 0!==H&&H,B=l.helperText,R=void 0===B?"":B,U=l.addonBefore,D=void 0===U?"":U,A=l.addonAfter,K=void 0===A?"":A,Y=(l.defaultValue,l.value),J=l.autoFocus,W=void 0!==J&&J,G=l.type,Q=void 0===G?"text":G,V=l.onClickIcon,Z=l.rightIcon,$=l.showRightIcon,X=void 0===$||$,ee=l.allowClear,te=void 0!==ee&&ee,ie=l.limitLength,ne=l.fetchSuggestions,oe=l.selectPopoverClass,re=l.renderSelectItem,le=l.showSelectName,ae=void 0===le?"value":le,ce=l.resize,de=void 0===ce||ce,se=l.onBlur,ue=l.onFocus,fe=l.onChange,pe=l.onKeydown,xe=l.onKeyUp,he=l.onEnter,ge=l.onClickAddonBefore,ve=l.onClickAddonAfter,be=l.onSelect,me=l.onClear,we=b(l,["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"]),ye=(0,t.useState)("text-field-select-content-"+(0,n.UUID)())[0],je=(0,t.useState)(!0),Oe=je[0],Se=je[1],Ce=(0,t.useState)(""),Ne=Ce[0],ke=Ce[1],Pe=(0,t.useState)(!1),Me=Pe[0],qe=Pe[1],Ee=(0,t.useState)("text"),_e=Ee[0],Fe=Ee[1],Le=(0,t.useState)(!1),Te=Le[0],ze=Le[1],He=(0,t.useState)(!1),Ie=He[0],Be=He[1],Re=(0,t.useState)([]),Ue=Re[0],De=Re[1],Ae=(0,t.useRef)(null),Ke=(0,t.useRef)(null);(0,t.useEffect)((function(){void 0!==o.defaultValue&&ke(o.defaultValue)}),[]),(0,t.useEffect)((function(){Q!==_e&&Fe(Q)}),[Q]),(0,t.useEffect)((function(){void 0!==Y&&ke(Y)}),[Y]),(0,t.useEffect)((function(){Se(""===Ne||void 0===Ne)}),[Ne]),(0,t.useEffect)((function(){ne&&ze(Me)}),[Me,ne]),(0,t.useEffect)((function(){return Te?window.addEventListener("keydown",Ve):window.removeEventListener("keydown",Ve),function(){window.removeEventListener("keydown",Ve)}}),[Te]),(0,t.useEffect)((function(){if(!Me&&Ne){var e=Je(Ne);if(e!==Ne){var t={};t.target=Ae.current,t.target.value=e,void 0===o.value&&ke(e),o.onChange&&o.onChange(t)}}}),[Ne,Me]);var Ye,Je=function(e){var t=e;return m(o.limitLength)&&e.toString().length>Number(o.limitLength)&&(t=t.toString().substr(0,o.limitLength)),t},We=function(){M||(Se(!1),(Ae&&Ae.current).focus())},Ge=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},Ve=function(e){var t=document.querySelector("."+ye),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),(Ae&&Ae.current).blur()}n&&(i=n,n.classList.remove("text-field-select-content-item-keydown")),40===e.keyCode&&Ge({selectDom:t,keyCode:e.keyCode,currentDom:i}),38===e.keyCode&&Ge({selectDom:t,keyCode:e.keyCode,currentDom:i})},Ze=function(e){qe(!1),""===e.target.value&&Se(!0),se&&se(e)},$e=function(e){ne&&(Be(!0),ne(e,(function(e){De(e||[]),Be(!1)})))},Xe=function(e){qe(!0),ue&&ue(e),$e(e.target.value)},et=function(e){var t=e.target.value;t&&Se(!1),void 0===o.value&&ke(t),fe&&fe(e),$e(e.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")),V&&V(e)},ot=function(){return void 0===o.value?Ne:Y},rt=function(){ze(!1)},lt=function(e){return function(t){be&&be(e)}},at=(0,t.useMemo)((function(){return(0,e.jsx)(e.Fragment,{children:m(ie)&&(0,e.jsx)("span",v({className:"length-limit"},{children:(Ne?Ne.toString().length:0)+"/"+ie}))})}),[ie,Ne]),ct=(0,t.useMemo)((function(){var t=Z||("password"===Q?"password"===_e?(0,e.jsx)(r(),{}):(0,e.jsx)(a(),{}):null);return(0,e.jsx)(e.Fragment,{children:X&&t&&(0,e.jsx)("span",v({className:"password"===Q?"right-icon right-icon-password":"right-icon",onClick:nt},{children:t}))})}),[X,Z,Q,_e,V]),dt=function(){var e=Ae.current;e.value="",void 0===o.value&&ke(""),fe&&fe({target:e}),$e(""),me&&me()},st=function(){if(ot()&&!M&&te)return(0,e.jsx)("span",v({className:"clean-up-icon",onClick:dt},{children:(0,e.jsx)(d(),{})}))},ut=(0,t.useMemo)((function(){return(0,e.jsxs)("div",v({className:"text-field-content-within",ref:Ke},{children:[(0,e.jsxs)("div",v({className:"text-field-content-within-input"},{children:[E?(0,e.jsx)("textarea",v({ref:Ae,rows:z,value:ot(),onBlur:Ze,onFocus:Xe,onChange:et,onKeyDown:tt,onKeyUp:it,disabled:M},we)):(0,e.jsx)("input",v({ref:Ae,type:_e,value:ot(),onBlur:Ze,onFocus:Xe,onChange:et,onKeyDown:tt,onKeyUp:it,disabled:M},we)),Oe&&!Me&&(0,e.jsx)("span",v({className:"text-field-label-placeholder",onClick:We},{children:"outside"===j?S:(0,e.jsxs)(e.Fragment,{children:[N||S,F&&(0,e.jsx)("span",v({className:"text-field-required"},{children:"*"})),L&&(0,e.jsx)("span",{children:L})]})}))]})),st(),at,ct]}))}),[Oe,Me,W,_e,Ne,at,ct,j,S,N,M,E,z,we,fe,ne,V,te,me]),ft=(0,t.useMemo)((function(){var t,i=function(e){return"object"==typeof e&&null!==e?e[ae]:e};return(0,e.jsxs)("div",v({className:(t="text-field-select-content",Ie&&(t+=" text-field-select-content-loading"),ye&&(t+=" "+ye),t),style:{width:(Ke&&Ke.current?Ke.current.offsetWidth:0)+"px"}},{children:[Ue&&Ue.map((function(t,n){return(0,e.jsx)("div",v({className:"text-field-select-content-item",onMouseDown:lt(t),"data-val":JSON.stringify(t)},{children:re?re(t):(0,e.jsx)(s.default,{children:i(t)})}),n)})),Ie&&(0,e.jsx)(u.default,{})]}))}),[Ke,Te,Ue,re,ae,be,Ie,ye]),pt=(0,t.useMemo)((function(){return(0,e.jsx)(x.default,v({open:Te,title:ft,onClose:rt,arrow:!1,interactive:!0,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,placement:"bottom-start",classes:{popper:(t="paraui-text-field-select paraui-scrollbar-small",w&&(t+=" paraui-text-field-select-"+w),oe&&(t+=" "+oe),Ue.length>0&&(t+=" paraui-text-field-select-data"),t)}},{children:ut}));var t}),[Oe,Me,W,_e,Ne,at,ct,j,S,N,M,E,z,we,fe,ne,be,Ke,Te,oe,w,V,Ue,te,me]),xt=(0,t.useMemo)((function(){var t,n=Boolean(F||L||N);if("outside"===j&&n){return(0,e.jsx)(i.default,v({label:N,required:F,labelSign:L},k,{className:(t="text-field-label",k&&k.className&&(t+=" "+k.className),t)}))}return null}),[j,N,L,F,k]);return(0,e.jsxs)("div",v({className:(Ye="paraui-text-field",Ye+=" text-field",w&&!E&&(Ye+=" text-field-"+w),c&&(Ye+=" "+c),I&&(Ye+=" text-field-error"),Me&&(Ye+=" text-field-focus"),M&&(Ye+=" text-field-disabled"),E&&(Ye+=" text-field-multiline"),m(o.limitLength)&&(Ye+=" text-field-limit-length"),m(o.limitLength)&&Ne&&Ne.toString().length>Number(o.limitLength)&&(Ye+=" text-field-limit"),de&&(Ye+=" text-field-resize"),ot()&&(Ye+=" text-field-value"),te&&(Ye+=" text-field-allow-clear"),Ye),style:f},{children:[xt,(0,e.jsxs)("div",v({className:"text-field-content"},{children:[D&&(0,e.jsx)("div",v({className:"text-field-content-before",onClick:function(e){ge&&ge(e)}},{children:D})),ne?pt:ut,K&&(0,e.jsx)("div",v({className:"text-field-content-after",onClick:function(e){ve&&ve(e)}},{children:K}))]})),(0,e.jsx)(h.default,{className:"text-field-error-text",error:I,helperText:R})]}))};p.default=w}(),p}()}));
|
|
1
|
+
import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
|
|
3
|
+
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
6
|
+
import Label from '../Label/index.js';
|
|
7
|
+
import { UUID } from '@paraview/lib';
|
|
8
|
+
import VisibilityOff from '@para-ui/icons/PreviewClose';
|
|
9
|
+
import Visibility from '@para-ui/icons/PreviewOpen';
|
|
10
|
+
import CloseCircle from '@para-ui/icons/CloseCircle';
|
|
11
|
+
import AutoTips from '../AutoTips/index.js';
|
|
12
|
+
import { Loading } from '../Loading/index.js';
|
|
13
|
+
import HelperText from '../HelperText/index.js';
|
|
14
|
+
import { u as useGlobalProps } from '../_verture/useGlobalProps-af9a2af6.js';
|
|
15
|
+
import { Dropdown } from '../Dropdown/index.js';
|
|
16
|
+
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
17
|
+
import '../Help/index.js';
|
|
18
|
+
import '../Tooltip/index.js';
|
|
19
|
+
import 'rc-tooltip';
|
|
20
|
+
import 'rc-tooltip/lib/placements';
|
|
21
|
+
import 'clsx';
|
|
22
|
+
import '@para-ui/icons/Help';
|
|
23
|
+
import '@para-ui/icons/LoadingF';
|
|
24
|
+
import '@para-ui/core/GlobalContext';
|
|
25
|
+
import 'rc-dropdown';
|
|
26
|
+
|
|
27
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-text-field {\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 display: inline-block;\n width: 100%;\n}\n.paraui-text-field > .text-field-content {\n border: 1px solid;\n border-radius: 4px;\n border-color: rgba(171, 176, 185, 0.4);\n display: flex;\n width: 100%;\n position: relative;\n background-color: rgb(255, 255, 255);\n}\n.paraui-text-field > .text-field-content:hover {\n border-color: rgb(54, 102, 214);\n}\n.paraui-text-field > .text-field-content > .text-field-content-before {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-right: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-text-field > .text-field-content > .text-field-content-before svg {\n font-size: 20px;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within {\n position: relative;\n display: flex;\n flex-grow: 1;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .clean-up-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 16px;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .clean-up-icon:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n cursor: pointer;\n color: rgba(46, 55, 67, 0.7);\n position: relative;\n z-index: 1;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .right-icon.right-icon-password:hover svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .right-icon svg {\n color: rgba(46, 55, 67, 0.7);\n font-size: 20px;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .length-limit {\n display: flex;\n height: 100%;\n align-items: center;\n margin-right: 12px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n width: 100%;\n line-height: 0;\n position: relative;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-outer-spin-button,\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input input[type=number] {\n -moz-appearance: textfield;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n width: 100%;\n height: 100%;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n width: 100% !important;\n padding: 12px;\n resize: none;\n}\n.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 {\n font-size: 14px;\n color: rgb(46, 55, 67);\n border: 0;\n border-radius: 4px;\n background: transparent;\n}\n.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 {\n display: none;\n}\n.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 {\n display: none;\n}\n.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 {\n background-color: transparent;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n width: 100%;\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n padding: 0 12px;\n color: rgba(46, 55, 67, 0.4);\n cursor: text;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.paraui-text-field > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder > .text-field-required {\n margin-left: 2px;\n color: rgb(235, 96, 84);\n}\n.paraui-text-field > .text-field-content > .text-field-content-after {\n color: rgb(46, 55, 67);\n padding: 0 12px;\n border-left: 1px solid rgba(171, 176, 185, 0.4);\n background-color: rgba(171, 176, 185, 0.12);\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n white-space: nowrap;\n display: flex;\n align-items: center;\n}\n.paraui-text-field > .text-field-content > .text-field-content-after svg {\n font-size: 20px;\n}\n.paraui-text-field.text-field-multiline > .text-field-content .text-field-content-within > .clean-up-icon {\n display: none;\n}\n.paraui-text-field.text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n position: absolute;\n height: 22px;\n bottom: 0;\n border-radius: 4px;\n width: calc(100% - 12px);\n background: white;\n justify-content: flex-end;\n padding-bottom: 8px;\n margin-right: 0;\n}\n.paraui-text-field.text-field-multiline > .text-field-content .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n padding-top: 12px;\n line-height: 1;\n height: calc(100% - 24px);\n}\n.paraui-text-field.text-field-disabled > .text-field-content {\n background-color: rgba(171, 176, 185, 0.12);\n}\n.paraui-text-field.text-field-disabled > .text-field-content:hover {\n border-color: rgba(171, 176, 185, 0.4);\n}\n.paraui-text-field.text-field-disabled > .text-field-content > .text-field-content-before {\n background-color: transparent;\n}\n.paraui-text-field.text-field-disabled > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n cursor: not-allowed;\n}\n.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 {\n cursor: not-allowed;\n}\n.paraui-text-field.text-field-disabled > .text-field-content > .text-field-content-after {\n background-color: transparent;\n}\n.paraui-text-field.text-field-disabled.text-field-multiline > .text-field-content .text-field-content-within > .length-limit {\n background-color: transparent;\n}\n.paraui-text-field.text-field-error > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-text-field.text-field-error > .text-field-content:hover {\n border-color: rgb(235, 96, 84);\n}\n.paraui-text-field.text-field-limit > .text-field-content {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-text-field.text-field-limit > .text-field-content:hover {\n border-color: rgb(235, 96, 84) !important;\n}\n.paraui-text-field.text-field-limit-length > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n padding-bottom: 25px;\n}\n.paraui-text-field.text-field-focus > .text-field-content {\n border-color: rgb(54, 102, 214);\n}\n.paraui-text-field.text-field-small > .text-field-content {\n height: 28px;\n}\n.paraui-text-field.text-field-small > .text-field-content > .text-field-content-before {\n line-height: 26px;\n}\n.paraui-text-field.text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 26px;\n}\n.paraui-text-field.text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 6px 12px;\n}\n.paraui-text-field.text-field-small > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 26px;\n}\n.paraui-text-field.text-field-small > .text-field-content .text-field-content-after {\n line-height: 26px;\n}\n.paraui-text-field.text-field-medium > .text-field-content {\n height: 32px;\n}\n.paraui-text-field.text-field-medium > .text-field-content > .text-field-content-before {\n line-height: 30px;\n}\n.paraui-text-field.text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 30px;\n}\n.paraui-text-field.text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 8px 12px;\n}\n.paraui-text-field.text-field-medium > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 30px;\n}\n.paraui-text-field.text-field-medium > .text-field-content .text-field-content-after {\n line-height: 30px;\n}\n.paraui-text-field.text-field-large > .text-field-content {\n height: 36px;\n}\n.paraui-text-field.text-field-large > .text-field-content > .text-field-content-before {\n line-height: 34px;\n}\n.paraui-text-field.text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input {\n height: 34px;\n}\n.paraui-text-field.text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > input {\n padding: 10px 12px;\n}\n.paraui-text-field.text-field-large > .text-field-content > .text-field-content-within > .text-field-content-within-input > .text-field-label-placeholder {\n line-height: 34px;\n}\n.paraui-text-field.text-field-large > .text-field-content .text-field-content-after {\n line-height: 34px;\n}\n.paraui-text-field.text-field-resize > .text-field-content > .text-field-content-within > .text-field-content-within-input > textarea {\n resize: both;\n}\n\n.paraui-text-field-select.paraui-dropdown > .text-field-select-content {\n max-height: 300px;\n overflow: auto;\n}\n.paraui-text-field-select.paraui-dropdown > .text-field-select-content > .text-field-select-content-item {\n display: flex;\n cursor: pointer;\n color: rgb(46, 55, 67);\n padding: 0 12px;\n}\n.paraui-text-field-select.paraui-dropdown > .text-field-select-content > .text-field-select-content-item:hover {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-text-field-select.paraui-dropdown > .text-field-select-content > .text-field-select-content-item.text-field-select-content-item-keydown {\n background-color: rgba(171, 176, 185, 0.12);\n color: rgb(54, 102, 214);\n}\n.paraui-text-field-select.paraui-dropdown > .text-field-select-content.text-field-select-content-loading {\n height: 100px;\n position: relative;\n overflow: hidden;\n}\n.paraui-text-field-select.paraui-dropdown.paraui-text-field-select-small > .text-field-select-content > .text-field-select-content-item {\n line-height: 28px;\n}\n.paraui-text-field-select.paraui-dropdown.paraui-text-field-select-medium > .text-field-select-content > .text-field-select-content-item {\n line-height: 32px;\n}\n.paraui-text-field-select.paraui-dropdown.paraui-text-field-select-large > .text-field-select-content > .text-field-select-content-item {\n line-height: 36px;\n}\n.paraui-text-field-select.paraui-text-field-select-data.paraui-tooltip {\n padding: 8px 0;\n}";
|
|
28
|
+
styleInject(css_248z);
|
|
29
|
+
|
|
30
|
+
var IsNaN = function IsNaN(value) {
|
|
31
|
+
return typeof value === 'number' && !isNaN(value);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var TextField = function TextField(props) {
|
|
35
|
+
var _a = useGlobalProps(props, 'TextField'),
|
|
36
|
+
className = _a.className,
|
|
37
|
+
style = _a.style,
|
|
38
|
+
_a$size = _a.size,
|
|
39
|
+
size = _a$size === void 0 ? 'large' : _a$size,
|
|
40
|
+
_a$labelMode = _a.labelMode,
|
|
41
|
+
labelMode = _a$labelMode === void 0 ? 'outside' : _a$labelMode,
|
|
42
|
+
_a$placeholder = _a.placeholder,
|
|
43
|
+
placeholder = _a$placeholder === void 0 ? '' : _a$placeholder,
|
|
44
|
+
_a$label = _a.label,
|
|
45
|
+
label = _a$label === void 0 ? '' : _a$label,
|
|
46
|
+
labelTooltip = _a.labelTooltip,
|
|
47
|
+
_a$disabled = _a.disabled,
|
|
48
|
+
disabled = _a$disabled === void 0 ? false : _a$disabled,
|
|
49
|
+
_a$multiline = _a.multiline,
|
|
50
|
+
multiline = _a$multiline === void 0 ? false : _a$multiline,
|
|
51
|
+
_a$required = _a.required,
|
|
52
|
+
required = _a$required === void 0 ? false : _a$required,
|
|
53
|
+
labelSign = _a.labelSign,
|
|
54
|
+
_a$rows = _a.rows,
|
|
55
|
+
rows = _a$rows === void 0 ? 2 : _a$rows,
|
|
56
|
+
_a$error = _a.error,
|
|
57
|
+
error = _a$error === void 0 ? false : _a$error,
|
|
58
|
+
_a$helperText = _a.helperText,
|
|
59
|
+
helperText = _a$helperText === void 0 ? '' : _a$helperText,
|
|
60
|
+
_a$addonBefore = _a.addonBefore,
|
|
61
|
+
addonBefore = _a$addonBefore === void 0 ? '' : _a$addonBefore,
|
|
62
|
+
_a$addonAfter = _a.addonAfter,
|
|
63
|
+
addonAfter = _a$addonAfter === void 0 ? '' : _a$addonAfter;
|
|
64
|
+
_a.defaultValue;
|
|
65
|
+
var value = _a.value,
|
|
66
|
+
_a$autoFocus = _a.autoFocus,
|
|
67
|
+
autoFocus = _a$autoFocus === void 0 ? false : _a$autoFocus,
|
|
68
|
+
_a$type = _a.type,
|
|
69
|
+
type = _a$type === void 0 ? 'text' : _a$type,
|
|
70
|
+
onClickIcon = _a.onClickIcon,
|
|
71
|
+
rightIcon = _a.rightIcon,
|
|
72
|
+
_a$showRightIcon = _a.showRightIcon,
|
|
73
|
+
showRightIcon = _a$showRightIcon === void 0 ? true : _a$showRightIcon,
|
|
74
|
+
_a$allowClear = _a.allowClear,
|
|
75
|
+
allowClear = _a$allowClear === void 0 ? false : _a$allowClear,
|
|
76
|
+
limitLength = _a.limitLength,
|
|
77
|
+
fetchSuggestions = _a.fetchSuggestions,
|
|
78
|
+
selectPopoverClass = _a.selectPopoverClass,
|
|
79
|
+
renderSelectItem = _a.renderSelectItem,
|
|
80
|
+
_a$showSelectName = _a.showSelectName,
|
|
81
|
+
showSelectName = _a$showSelectName === void 0 ? 'value' : _a$showSelectName,
|
|
82
|
+
_a$resize = _a.resize,
|
|
83
|
+
resize = _a$resize === void 0 ? true : _a$resize,
|
|
84
|
+
onBlur = _a.onBlur,
|
|
85
|
+
onFocus = _a.onFocus,
|
|
86
|
+
onChange = _a.onChange,
|
|
87
|
+
onKeydown = _a.onKeydown,
|
|
88
|
+
onKeyUp = _a.onKeyUp,
|
|
89
|
+
onEnter = _a.onEnter,
|
|
90
|
+
onClickAddonBefore = _a.onClickAddonBefore,
|
|
91
|
+
onClickAddonAfter = _a.onClickAddonAfter,
|
|
92
|
+
onSelect = _a.onSelect,
|
|
93
|
+
onClear = _a.onClear,
|
|
94
|
+
otherProps = __rest(_a, ["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"]);
|
|
95
|
+
|
|
96
|
+
var _useState = useState('text-field-select-content-' + UUID()),
|
|
97
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
98
|
+
classSearchOne = _useState2[0]; // 唯一class
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
var _useState3 = useState(true),
|
|
102
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
103
|
+
showText = _useState4[0],
|
|
104
|
+
setShowText = _useState4[1]; // 是否显示输入框lable,placeholder true显示
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
var _useState5 = useState(''),
|
|
108
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
109
|
+
valueCom = _useState6[0],
|
|
110
|
+
setValueCom = _useState6[1]; // 组件值
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
var _useState7 = useState(false),
|
|
114
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
115
|
+
isFocus = _useState8[0],
|
|
116
|
+
setIsFocus = _useState8[1]; // 是否得到焦点
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
var _useState9 = useState('text'),
|
|
120
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
121
|
+
typeCom = _useState10[0],
|
|
122
|
+
setTypeCom = _useState10[1];
|
|
123
|
+
|
|
124
|
+
var _useState11 = useState(false),
|
|
125
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
126
|
+
open = _useState12[0],
|
|
127
|
+
setOpen = _useState12[1]; // 是否打开下拉框
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
var _useState13 = useState(false),
|
|
131
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
132
|
+
selectLoading = _useState14[0],
|
|
133
|
+
setSelectLoading = _useState14[1]; // 下拉loading
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
var _useState15 = useState([]),
|
|
137
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
138
|
+
selectData = _useState16[0],
|
|
139
|
+
setSelectData = _useState16[1]; //const [constData] = useState<ConstDataProps>({});
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
var inputDom = useRef(null);
|
|
143
|
+
var selectPosDom = useRef(null); // 下拉框定位元素
|
|
144
|
+
|
|
145
|
+
useEffect(function () {
|
|
146
|
+
if (props.defaultValue !== undefined) {
|
|
147
|
+
setValueCom(props.defaultValue);
|
|
148
|
+
}
|
|
149
|
+
}, []); // 组件类型
|
|
150
|
+
|
|
151
|
+
useEffect(function () {
|
|
152
|
+
if (type !== typeCom) setTypeCom(type);
|
|
153
|
+
}, [type]); // 监听value
|
|
154
|
+
|
|
155
|
+
useEffect(function () {
|
|
156
|
+
if (value !== undefined) {
|
|
157
|
+
setValueCom(value);
|
|
158
|
+
}
|
|
159
|
+
}, [value]); // 监听组件值,判断是否显示placehold,label
|
|
160
|
+
|
|
161
|
+
useEffect(function () {
|
|
162
|
+
if (valueCom !== '' && valueCom !== undefined) setShowText(false);else setShowText(true);
|
|
163
|
+
}, [valueCom]); // 判断是否显示下拉
|
|
164
|
+
|
|
165
|
+
useEffect(function () {
|
|
166
|
+
if (!fetchSuggestions) return;
|
|
167
|
+
setOpen(isFocus);
|
|
168
|
+
}, [isFocus, fetchSuggestions]);
|
|
169
|
+
useEffect(function () {
|
|
170
|
+
if (open) {
|
|
171
|
+
window.addEventListener("keydown", keydownCom);
|
|
172
|
+
} else {
|
|
173
|
+
window.removeEventListener("keydown", keydownCom);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return function () {
|
|
177
|
+
window.removeEventListener("keydown", keydownCom);
|
|
178
|
+
};
|
|
179
|
+
}, [open]);
|
|
180
|
+
useEffect(function () {
|
|
181
|
+
// 失去焦点
|
|
182
|
+
if (!isFocus && valueCom) {
|
|
183
|
+
var val = handValueLimit(valueCom);
|
|
184
|
+
|
|
185
|
+
if (val !== valueCom) {
|
|
186
|
+
var e = {};
|
|
187
|
+
e.target = inputDom.current;
|
|
188
|
+
e.target.value = val;
|
|
189
|
+
|
|
190
|
+
if (props.value === undefined) {
|
|
191
|
+
setValueCom(val);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
props.onChange && props.onChange(e);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}, [valueCom, isFocus]);
|
|
198
|
+
/**
|
|
199
|
+
* 处理value值
|
|
200
|
+
* 超出字符长度限制,截取符合长度内容,并且触发onchange事件
|
|
201
|
+
* */
|
|
202
|
+
|
|
203
|
+
var handValueLimit = function handValueLimit(val) {
|
|
204
|
+
var valHand = val;
|
|
205
|
+
|
|
206
|
+
if (IsNaN(props.limitLength) && val.toString().length > Number(props.limitLength)) {
|
|
207
|
+
valHand = valHand.toString().substr(0, props.limitLength);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return valHand;
|
|
211
|
+
}; // 点击内标题 / placeholder
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
var clickPlaceholder = function clickPlaceholder() {
|
|
215
|
+
if (disabled) return;
|
|
216
|
+
setShowText(false);
|
|
217
|
+
var dom = inputDom && inputDom.current;
|
|
218
|
+
dom.focus();
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* 处理键盘事件 上/下
|
|
222
|
+
* @param config
|
|
223
|
+
* 例:
|
|
224
|
+
* {
|
|
225
|
+
* selectDom: 外容器
|
|
226
|
+
* keyCode: 键盘code
|
|
227
|
+
* currentDom: 当前元素
|
|
228
|
+
* }
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
var handKeydown = function handKeydown(config) {
|
|
233
|
+
var selectDom = config.selectDom,
|
|
234
|
+
keyCode = config.keyCode,
|
|
235
|
+
currentDom = config.currentDom;
|
|
236
|
+
var brotherDom = currentDom;
|
|
237
|
+
var type = 'nextSibling';
|
|
238
|
+
var classSelectStr = '.text-field-select-content-item';
|
|
239
|
+
|
|
240
|
+
if (keyCode === 38) {
|
|
241
|
+
// 上
|
|
242
|
+
type = 'previousSibling';
|
|
243
|
+
classSelectStr = '.text-field-select-content-item:last-child';
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (brotherDom) {
|
|
247
|
+
// 存在键盘上下的元素
|
|
248
|
+
brotherDom = brotherDom[type]; // 没有兄弟节点,去最后跟第一的节点
|
|
249
|
+
|
|
250
|
+
if (!brotherDom) brotherDom = selectDom.querySelector(classSelectStr);
|
|
251
|
+
} else {
|
|
252
|
+
// 不存在,默认情况
|
|
253
|
+
brotherDom = selectDom.querySelector('.text-field-select-content-item');
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (brotherDom) {
|
|
257
|
+
brotherDom.classList.add("text-field-select-content-item-keydown");
|
|
258
|
+
domClientTop(brotherDom, selectDom);
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* 设置当前上下选中的元素是否在当前可见页面里面
|
|
263
|
+
* @param currentDom 当前元素
|
|
264
|
+
* @param selectDom 外容器
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
var domClientTop = function domClientTop(currentDom, selectDom) {
|
|
269
|
+
var clientHeight = selectDom.clientHeight; // 可见区域的高度
|
|
270
|
+
|
|
271
|
+
var top = currentDom.offsetTop + currentDom.clientHeight;
|
|
272
|
+
var difference = top - clientHeight;
|
|
273
|
+
|
|
274
|
+
if (difference > 0) {
|
|
275
|
+
selectDom.scrollTop = difference;
|
|
276
|
+
} else {
|
|
277
|
+
selectDom.scrollTop = 0;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* 键盘事件
|
|
282
|
+
* @param e 键盘信息
|
|
283
|
+
*/
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
var keydownCom = function keydownCom(e) {
|
|
287
|
+
var selectDom = document.querySelector('.' + classSearchOne);
|
|
288
|
+
var currentDom = null;
|
|
289
|
+
var keydownDom = selectDom.querySelector('.text-field-select-content-item-keydown'); // 回车
|
|
290
|
+
|
|
291
|
+
if (e.keyCode === 13) {
|
|
292
|
+
if (keydownDom) {
|
|
293
|
+
var val = keydownDom.dataset.val;
|
|
294
|
+
clickSelectItem(JSON.parse(val))(e);
|
|
295
|
+
var dom = inputDom && inputDom.current;
|
|
296
|
+
dom.blur();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (keydownDom) {
|
|
301
|
+
currentDom = keydownDom;
|
|
302
|
+
keydownDom.classList.remove("text-field-select-content-item-keydown");
|
|
303
|
+
} // 下
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
if (e.keyCode === 40) {
|
|
307
|
+
handKeydown({
|
|
308
|
+
selectDom: selectDom,
|
|
309
|
+
keyCode: e.keyCode,
|
|
310
|
+
currentDom: currentDom
|
|
311
|
+
});
|
|
312
|
+
} // 上
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
if (e.keyCode === 38) {
|
|
316
|
+
handKeydown({
|
|
317
|
+
selectDom: selectDom,
|
|
318
|
+
keyCode: e.keyCode,
|
|
319
|
+
currentDom: currentDom
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* 失去焦点
|
|
325
|
+
* @param event 失去焦点元素对象
|
|
326
|
+
*/
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
var onBlurCom = function onBlurCom(event) {
|
|
330
|
+
setIsFocus(false);
|
|
331
|
+
if (event.target.value === '') setShowText(true);
|
|
332
|
+
onBlur && onBlur(event);
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* 下拉搜索
|
|
336
|
+
* @param val 搜索值
|
|
337
|
+
*/
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
var fetchSuggestionsCom = function fetchSuggestionsCom(val) {
|
|
341
|
+
if (fetchSuggestions) {
|
|
342
|
+
setSelectLoading(true);
|
|
343
|
+
fetchSuggestions(val, function (data) {
|
|
344
|
+
setSelectData(data || []);
|
|
345
|
+
setSelectLoading(false);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* 得到焦点
|
|
351
|
+
* @param event 得到焦点元素
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
var onFocusCom = function onFocusCom(event) {
|
|
356
|
+
setIsFocus(true);
|
|
357
|
+
onFocus && onFocus(event);
|
|
358
|
+
fetchSuggestionsCom(event.target.value);
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* 改变输入框
|
|
362
|
+
* @param event 输入框元素
|
|
363
|
+
*/
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
var onChangeCom = function onChangeCom(event) {
|
|
367
|
+
var val = event.target.value;
|
|
368
|
+
if (val) setShowText(false); // 有值不显示placehold,防止浏览器默认填充
|
|
369
|
+
|
|
370
|
+
/*if (limitLength && val !== undefined && val !== '' && val.toString().length > limitLength) {
|
|
371
|
+
return;
|
|
372
|
+
}*/
|
|
373
|
+
|
|
374
|
+
if (props.value === undefined) {
|
|
375
|
+
setValueCom(val);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
onChange && onChange(event);
|
|
379
|
+
fetchSuggestionsCom(event.target.value);
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* 键盘按下事件
|
|
383
|
+
* @param event 输入框元素
|
|
384
|
+
*/
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
var onKeyDownCom = function onKeyDownCom(event) {
|
|
388
|
+
if (event.keyCode === 13) onEnter && onEnter(event);
|
|
389
|
+
onKeydown && onKeydown(event);
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* 键盘抬起事件
|
|
393
|
+
* @param event 输入框元素
|
|
394
|
+
*/
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
var onKeyUpCom = function onKeyUpCom(event) {
|
|
398
|
+
onKeyUp && onKeyUp(event);
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* 点击图标
|
|
402
|
+
* @param event 图标元素
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
var onClickRightIcon = function onClickRightIcon(event) {
|
|
407
|
+
if (type === 'password') {
|
|
408
|
+
if (typeCom === 'text') {
|
|
409
|
+
setTypeCom('password');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
if (typeCom === 'password') {
|
|
413
|
+
setTypeCom('text');
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
onClickIcon && onClickIcon(event);
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
var handValue = function handValue() {
|
|
421
|
+
if (props.value === undefined) return valueCom;
|
|
422
|
+
return value;
|
|
423
|
+
}; // 处理下拉框样式
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
var handleClassPopover = function handleClassPopover() {
|
|
427
|
+
var str = 'paraui-text-field-select paraui-scrollbar-small';
|
|
428
|
+
if (size) str += ' paraui-text-field-select-' + size;
|
|
429
|
+
if (selectPopoverClass) str += ' ' + selectPopoverClass;
|
|
430
|
+
if (selectData.length > 0) str += ' paraui-text-field-select-data';
|
|
431
|
+
return str;
|
|
432
|
+
}; // 点击下拉
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
var clickSelectItem = function clickSelectItem(item) {
|
|
436
|
+
return function (e) {
|
|
437
|
+
onSelect && onSelect(item);
|
|
438
|
+
};
|
|
439
|
+
}; // 限制长度
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
var limitMemo = useMemo(function () {
|
|
443
|
+
return jsx(Fragment, {
|
|
444
|
+
children: IsNaN(limitLength) && jsx("span", Object.assign({
|
|
445
|
+
className: "length-limit"
|
|
446
|
+
}, {
|
|
447
|
+
children: (valueCom ? valueCom.toString().length : 0) + '/' + limitLength
|
|
448
|
+
}))
|
|
449
|
+
});
|
|
450
|
+
}, [limitLength, valueCom]); // 图标
|
|
451
|
+
|
|
452
|
+
var rightIconMemo = useMemo(function () {
|
|
453
|
+
var rightIconFunc = function rightIconFunc() {
|
|
454
|
+
return rightIcon ? rightIcon : // 只有密码模式有默认图标
|
|
455
|
+
type === 'password' ? typeCom === 'password' ? jsx(VisibilityOff, {}) : jsx(Visibility, {}) : null;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
var rightIconContent = rightIconFunc();
|
|
459
|
+
return jsx(Fragment, {
|
|
460
|
+
children: showRightIcon && rightIconContent && jsx("span", Object.assign({
|
|
461
|
+
className: type === 'password' ? 'right-icon right-icon-password' : 'right-icon',
|
|
462
|
+
onClick: onClickRightIcon
|
|
463
|
+
}, {
|
|
464
|
+
children: rightIconContent
|
|
465
|
+
}))
|
|
466
|
+
});
|
|
467
|
+
}, [showRightIcon, rightIcon, type, typeCom, onClickIcon]); // 输入框
|
|
468
|
+
|
|
469
|
+
var renderInputDom = function renderInputDom() {
|
|
470
|
+
if (multiline) {
|
|
471
|
+
return jsx("textarea", Object.assign({
|
|
472
|
+
ref: inputDom,
|
|
473
|
+
rows: rows,
|
|
474
|
+
value: handValue(),
|
|
475
|
+
onBlur: onBlurCom,
|
|
476
|
+
onFocus: onFocusCom,
|
|
477
|
+
onChange: onChangeCom,
|
|
478
|
+
onKeyDown: onKeyDownCom,
|
|
479
|
+
onKeyUp: onKeyUpCom,
|
|
480
|
+
disabled: disabled
|
|
481
|
+
}, otherProps));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return jsx("input", Object.assign({
|
|
485
|
+
ref: inputDom,
|
|
486
|
+
type: typeCom,
|
|
487
|
+
value: handValue(),
|
|
488
|
+
onBlur: onBlurCom,
|
|
489
|
+
onFocus: onFocusCom,
|
|
490
|
+
onChange: onChangeCom,
|
|
491
|
+
onKeyDown: onKeyDownCom,
|
|
492
|
+
onKeyUp: onKeyUpCom,
|
|
493
|
+
disabled: disabled
|
|
494
|
+
}, otherProps));
|
|
495
|
+
}; // 点击清楚按钮
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
var clickClean = function clickClean() {
|
|
499
|
+
var target = inputDom.current;
|
|
500
|
+
target.value = '';
|
|
501
|
+
|
|
502
|
+
if (props.value === undefined) {
|
|
503
|
+
setValueCom('');
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
onChange && onChange({
|
|
507
|
+
target: target
|
|
508
|
+
});
|
|
509
|
+
fetchSuggestionsCom('');
|
|
510
|
+
onClear && onClear();
|
|
511
|
+
}; // 清空内容
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
var clearRender = function clearRender() {
|
|
515
|
+
if (handValue() && !disabled && allowClear) {
|
|
516
|
+
return jsx("span", Object.assign({
|
|
517
|
+
className: "clean-up-icon",
|
|
518
|
+
onClick: clickClean
|
|
519
|
+
}, {
|
|
520
|
+
children: jsx(CloseCircle, {})
|
|
521
|
+
}));
|
|
522
|
+
}
|
|
523
|
+
}; // 中间主体
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
var contentMemo = useMemo(function () {
|
|
527
|
+
var handPlaceholderCon = function handPlaceholderCon() {
|
|
528
|
+
if (labelMode === 'outside') return placeholder;
|
|
529
|
+
return jsxs(Fragment, {
|
|
530
|
+
children: [label || placeholder, required && jsx("span", Object.assign({
|
|
531
|
+
className: "text-field-required"
|
|
532
|
+
}, {
|
|
533
|
+
children: "*"
|
|
534
|
+
})), labelSign && jsx("span", {
|
|
535
|
+
children: labelSign
|
|
536
|
+
})]
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
return jsxs("div", Object.assign({
|
|
541
|
+
className: "text-field-content-within",
|
|
542
|
+
ref: selectPosDom
|
|
543
|
+
}, {
|
|
544
|
+
children: [jsxs("div", Object.assign({
|
|
545
|
+
className: "text-field-content-within-input"
|
|
546
|
+
}, {
|
|
547
|
+
children: [renderInputDom(), showText && !isFocus && jsx("span", Object.assign({
|
|
548
|
+
className: "text-field-label-placeholder",
|
|
549
|
+
onClick: clickPlaceholder
|
|
550
|
+
}, {
|
|
551
|
+
children: handPlaceholderCon()
|
|
552
|
+
}))]
|
|
553
|
+
})), clearRender(), limitMemo, rightIconMemo]
|
|
554
|
+
}));
|
|
555
|
+
}, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onClickIcon, allowClear, onClear]); // 搜索下拉内容
|
|
556
|
+
|
|
557
|
+
var selectContentMemo = useMemo(function () {
|
|
558
|
+
var handSelectContentClass = function handSelectContentClass() {
|
|
559
|
+
var str = 'text-field-select-content';
|
|
560
|
+
if (selectLoading) str += ' text-field-select-content-loading';
|
|
561
|
+
if (classSearchOne) str += ' ' + classSearchOne;
|
|
562
|
+
return str;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
var handText = function handText(item) {
|
|
566
|
+
if (_typeof(item) === 'object' && item !== null) {
|
|
567
|
+
return item[showSelectName];
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return item;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
return jsxs("div", Object.assign({
|
|
574
|
+
className: handSelectContentClass(),
|
|
575
|
+
style: {
|
|
576
|
+
width: (selectPosDom && selectPosDom.current ? selectPosDom.current.offsetWidth : 0) + 'px'
|
|
577
|
+
}
|
|
578
|
+
}, {
|
|
579
|
+
children: [selectData && selectData.map(function (item, index) {
|
|
580
|
+
return jsx("div", Object.assign({
|
|
581
|
+
className: "text-field-select-content-item",
|
|
582
|
+
onMouseDown: clickSelectItem(item),
|
|
583
|
+
"data-val": JSON.stringify(item)
|
|
584
|
+
}, {
|
|
585
|
+
children: renderSelectItem ? renderSelectItem(item) : jsx(AutoTips, {
|
|
586
|
+
children: handText(item)
|
|
587
|
+
})
|
|
588
|
+
}), index);
|
|
589
|
+
}), selectLoading && jsx(Loading, {})]
|
|
590
|
+
}));
|
|
591
|
+
}, [selectPosDom, open, selectData, renderSelectItem, showSelectName, onSelect, selectLoading, classSearchOne]); // 带有搜索的中间主体
|
|
592
|
+
|
|
593
|
+
var searchContentMemo = useMemo(function () {
|
|
594
|
+
return jsx(Dropdown, Object.assign({
|
|
595
|
+
visible: open,
|
|
596
|
+
placement: 'bottomLeft',
|
|
597
|
+
trigger: ['click'],
|
|
598
|
+
overlay: jsx(Fragment, {
|
|
599
|
+
children: selectContentMemo
|
|
600
|
+
}),
|
|
601
|
+
overlayClassName: handleClassPopover()
|
|
602
|
+
}, {
|
|
603
|
+
children: contentMemo
|
|
604
|
+
}));
|
|
605
|
+
}, [showText, isFocus, autoFocus, typeCom, valueCom, limitMemo, rightIconMemo, labelMode, placeholder, label, disabled, multiline, rows, otherProps, onChange, fetchSuggestions, onSelect, selectPosDom, open, selectPopoverClass, size, onClickIcon, selectData, allowClear, onClear]); // 外标题
|
|
606
|
+
|
|
607
|
+
var outSideMemo = useMemo(function () {
|
|
608
|
+
var showTag = Boolean(required || labelSign || label);
|
|
609
|
+
|
|
610
|
+
if (labelMode === 'outside' && showTag) {
|
|
611
|
+
var handLabelClass = function handLabelClass() {
|
|
612
|
+
var str = 'text-field-label';
|
|
613
|
+
|
|
614
|
+
if (labelTooltip && labelTooltip.className) {
|
|
615
|
+
str += ' ' + labelTooltip.className;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return str;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
return jsx(Label, Object.assign({
|
|
622
|
+
label: label,
|
|
623
|
+
required: required,
|
|
624
|
+
labelSign: labelSign
|
|
625
|
+
}, labelTooltip, {
|
|
626
|
+
className: handLabelClass()
|
|
627
|
+
}));
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
return null;
|
|
631
|
+
}, [labelMode, label, labelSign, required, labelTooltip]); // 处理class
|
|
632
|
+
|
|
633
|
+
var handClass = function handClass() {
|
|
634
|
+
var str = 'paraui-text-field';
|
|
635
|
+
str += ' text-field';
|
|
636
|
+
if (size && !multiline) str += ' text-field-' + size;
|
|
637
|
+
if (className) str += ' ' + className;
|
|
638
|
+
if (error) str += ' text-field-error';
|
|
639
|
+
if (isFocus) str += ' text-field-focus';
|
|
640
|
+
if (disabled) str += ' text-field-disabled';
|
|
641
|
+
if (multiline) str += ' text-field-multiline';
|
|
642
|
+
if (IsNaN(props.limitLength)) str += ' text-field-limit-length';
|
|
643
|
+
if (IsNaN(props.limitLength) && valueCom && valueCom.toString().length > Number(props.limitLength)) str += ' text-field-limit';
|
|
644
|
+
if (resize) str += ' text-field-resize';
|
|
645
|
+
if (handValue()) str += ' text-field-value';
|
|
646
|
+
if (allowClear) str += ' text-field-allow-clear';
|
|
647
|
+
return str;
|
|
648
|
+
}; // 点击前缀
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
var clickBefore = function clickBefore(event) {
|
|
652
|
+
onClickAddonBefore && onClickAddonBefore(event);
|
|
653
|
+
}; // 点击后缀
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
var clickAfter = function clickAfter(event) {
|
|
657
|
+
onClickAddonAfter && onClickAddonAfter(event);
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
return jsxs("div", Object.assign({
|
|
661
|
+
className: handClass(),
|
|
662
|
+
style: style
|
|
663
|
+
}, {
|
|
664
|
+
children: [outSideMemo, jsxs("div", Object.assign({
|
|
665
|
+
className: "text-field-content"
|
|
666
|
+
}, {
|
|
667
|
+
children: [addonBefore && jsx("div", Object.assign({
|
|
668
|
+
className: "text-field-content-before",
|
|
669
|
+
onClick: clickBefore
|
|
670
|
+
}, {
|
|
671
|
+
children: addonBefore
|
|
672
|
+
})), fetchSuggestions ? searchContentMemo : contentMemo, addonAfter && jsx("div", Object.assign({
|
|
673
|
+
className: "text-field-content-after",
|
|
674
|
+
onClick: clickAfter
|
|
675
|
+
}, {
|
|
676
|
+
children: addonAfter
|
|
677
|
+
}))]
|
|
678
|
+
})), jsx(HelperText, {
|
|
679
|
+
className: "text-field-error-text",
|
|
680
|
+
error: error,
|
|
681
|
+
helperText: helperText
|
|
682
|
+
})]
|
|
683
|
+
}));
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
export { TextField, TextField as default };
|