@para-ui/core 3.0.28 → 3.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Radio/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import Label from '../Label/index.js';
|
|
5
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
5
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
6
6
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
7
7
|
import '../Help/index.js';
|
|
8
8
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -17,40 +17,36 @@ styleInject(css_248z);
|
|
|
17
17
|
|
|
18
18
|
var Radio = function Radio(props) {
|
|
19
19
|
var _props$className = props.className,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
21
|
+
labelTooltip = props.labelTooltip,
|
|
22
|
+
_props$label = props.label,
|
|
23
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
24
|
+
_props$size = props.size,
|
|
25
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
26
|
+
_props$disabled = props.disabled,
|
|
27
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
28
|
+
onChange = props.onChange,
|
|
29
|
+
style = props.style;
|
|
31
30
|
var _useState = useState(false),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
checkedCom = _useState2[0],
|
|
33
|
+
setCheckedCom = _useState2[1]; // 复选框状态
|
|
37
34
|
useEffect(function () {
|
|
38
35
|
if (props.defaultChecked !== undefined) setCheckedCom(props.defaultChecked);
|
|
39
36
|
}, []);
|
|
40
37
|
useEffect(function () {
|
|
41
38
|
if (props.checked !== undefined) setCheckedCom(props.checked);
|
|
42
|
-
}, [props.checked]);
|
|
43
|
-
|
|
39
|
+
}, [props.checked]);
|
|
40
|
+
// 点击选择
|
|
44
41
|
var clickCheck = function clickCheck(e) {
|
|
45
42
|
e.preventDefault();
|
|
46
|
-
if (disabled) return;
|
|
47
|
-
|
|
43
|
+
if (disabled) return;
|
|
44
|
+
// 不可受控组件
|
|
48
45
|
if (props.checked === undefined) setCheckedCom(!checkedCom);
|
|
49
46
|
e.target.checked = !checkedCom;
|
|
50
47
|
onChange && onChange(e, !checkedCom);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
};
|
|
49
|
+
// 处理className
|
|
54
50
|
var handClass = function handClass() {
|
|
55
51
|
var str = $prefixCls + '-radio';
|
|
56
52
|
if (className) str += ' ' + className;
|
|
@@ -59,29 +55,21 @@ var Radio = function Radio(props) {
|
|
|
59
55
|
if (checkedCom) str += " ".concat($prefixCls, "-radio-checked");
|
|
60
56
|
return str;
|
|
61
57
|
};
|
|
62
|
-
|
|
63
58
|
var handLabelClass = function handLabelClass() {
|
|
64
59
|
var str = 'radio-label';
|
|
65
|
-
|
|
66
60
|
if (labelTooltip && labelTooltip.className) {
|
|
67
61
|
str += ' ' + labelTooltip.className;
|
|
68
62
|
}
|
|
69
|
-
|
|
70
63
|
return str;
|
|
71
64
|
};
|
|
72
65
|
/** 处理帮组classNaem */
|
|
73
|
-
|
|
74
|
-
|
|
75
66
|
var handHelpClassName = function handHelpClassName() {
|
|
76
67
|
var str = ' radio-help';
|
|
77
|
-
|
|
78
68
|
if (labelTooltip && labelTooltip.helpClassName) {
|
|
79
69
|
str += ' ' + labelTooltip.helpClassName;
|
|
80
70
|
}
|
|
81
|
-
|
|
82
71
|
return str;
|
|
83
72
|
};
|
|
84
|
-
|
|
85
73
|
return jsxs("label", Object.assign({
|
|
86
74
|
className: handClass(),
|
|
87
75
|
onClick: clickCheck,
|
package/RadioGroup/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { useState, useEffect, createElement } from 'react';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { Radio } from '../Radio/index.js';
|
|
5
5
|
import Label from '../Label/index.js';
|
|
6
6
|
import HelperText from '../HelperText/index.js';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
8
8
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
9
|
import '../Help/index.js';
|
|
10
10
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -19,37 +19,35 @@ styleInject(css_248z);
|
|
|
19
19
|
|
|
20
20
|
var RadioGroup = function RadioGroup(props) {
|
|
21
21
|
var _props$className = props.className,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
23
|
+
style = props.style,
|
|
24
|
+
_props$label = props.label,
|
|
25
|
+
label = _props$label === void 0 ? '' : _props$label,
|
|
26
|
+
labelTooltip = props.labelTooltip,
|
|
27
|
+
_props$spacing = props.spacing,
|
|
28
|
+
spacing = _props$spacing === void 0 ? '28px' : _props$spacing,
|
|
29
|
+
_props$size = props.size,
|
|
30
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
31
|
+
_props$row = props.row,
|
|
32
|
+
row = _props$row === void 0 ? true : _props$row,
|
|
33
|
+
_props$disabled = props.disabled,
|
|
34
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
35
|
+
_props$required = props.required,
|
|
36
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
37
|
+
_props$error = props.error,
|
|
38
|
+
error = _props$error === void 0 ? false : _props$error,
|
|
39
|
+
hideErrorDom = props.hideErrorDom,
|
|
40
|
+
_props$helperText = props.helperText,
|
|
41
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
42
|
+
_props$id = props.id,
|
|
43
|
+
id = _props$id === void 0 ? 'name' : _props$id,
|
|
44
|
+
value = props.value,
|
|
45
|
+
list = props.list,
|
|
46
|
+
onChange = props.onChange;
|
|
48
47
|
var _useState = useState(),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
valueCom = _useState2[0],
|
|
50
|
+
setValueCom = _useState2[1];
|
|
53
51
|
useEffect(function () {
|
|
54
52
|
if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
|
|
55
53
|
}, []);
|
|
@@ -60,29 +58,23 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
60
58
|
* 改变值
|
|
61
59
|
* @param item 点击当前项数据
|
|
62
60
|
*/
|
|
63
|
-
|
|
64
61
|
var onchangeCom = function onchangeCom(item) {
|
|
65
62
|
return function () {
|
|
66
63
|
var name = item[id]; // 值
|
|
67
|
-
|
|
68
64
|
if (value === name) return;
|
|
69
65
|
if (props.value === undefined) setValueCom(name);
|
|
70
66
|
onChange && onChange(name, item);
|
|
71
67
|
};
|
|
72
68
|
};
|
|
73
|
-
|
|
74
69
|
var handLabel = function handLabel() {
|
|
75
70
|
if (label || required) {
|
|
76
71
|
var handLabelClass = function handLabelClass() {
|
|
77
72
|
var str = 'radio-group-label';
|
|
78
|
-
|
|
79
73
|
if (labelTooltip && labelTooltip.className) {
|
|
80
74
|
str += ' ' + labelTooltip.className;
|
|
81
75
|
}
|
|
82
|
-
|
|
83
76
|
return str;
|
|
84
77
|
};
|
|
85
|
-
|
|
86
78
|
return jsx(Label, Object.assign({
|
|
87
79
|
label: label,
|
|
88
80
|
required: required
|
|
@@ -90,25 +82,19 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
90
82
|
className: handLabelClass()
|
|
91
83
|
}));
|
|
92
84
|
}
|
|
93
|
-
|
|
94
85
|
return null;
|
|
95
86
|
};
|
|
96
87
|
/**
|
|
97
88
|
* @description 处理单选框每一项样式
|
|
98
89
|
* */
|
|
99
|
-
|
|
100
|
-
|
|
101
90
|
var handStyleItem = function handStyleItem(item, index) {
|
|
102
91
|
var obj = Object.assign({}, item.style);
|
|
103
|
-
|
|
104
92
|
if (spacing && row && list.length !== index + 1) {
|
|
105
93
|
obj.marginRight = spacing;
|
|
106
94
|
}
|
|
107
|
-
|
|
108
95
|
return obj;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
};
|
|
97
|
+
// 处理class
|
|
112
98
|
var handClass = function handClass() {
|
|
113
99
|
var str = $prefixCls + '-radio-group';
|
|
114
100
|
if (className) str += ' ' + className;
|
|
@@ -118,7 +104,6 @@ var RadioGroup = function RadioGroup(props) {
|
|
|
118
104
|
if (row) str += " ".concat($prefixCls, "-radio-group-row");else str += " ".concat($prefixCls, "-radio-group-column");
|
|
119
105
|
return str;
|
|
120
106
|
};
|
|
121
|
-
|
|
122
107
|
return jsxs("div", Object.assign({
|
|
123
108
|
className: handClass(),
|
|
124
109
|
style: style
|
package/Search/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
4
|
import { TextField } from '../TextField/index.js';
|
|
5
5
|
import { Button } from '../Button/index.js';
|
|
6
6
|
import SearchIcon from '@para-ui/icons/Search';
|
|
7
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
7
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
8
8
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
9
9
|
import '../_verture/typeof-498dd2b1.js';
|
|
10
10
|
import '../_verture/tslib.es6-55ed4bd2.js';
|
|
@@ -23,64 +23,62 @@ import '../AutoTips/index.js';
|
|
|
23
23
|
import '../Loading/index.js';
|
|
24
24
|
import '@para-ui/icons/LoadingF';
|
|
25
25
|
import '../HelperText/index.js';
|
|
26
|
-
import '../_verture/useGlobalProps-
|
|
26
|
+
import '../_verture/useGlobalProps-1b846a65.js';
|
|
27
27
|
import '@para-ui/core/GlobalContext';
|
|
28
|
-
import '../_verture/index-
|
|
28
|
+
import '../_verture/index-be4faaee.js';
|
|
29
29
|
import 'rc-dropdown';
|
|
30
|
-
import '../_verture/usePopupContainer-
|
|
30
|
+
import '../_verture/usePopupContainer-87febeb9.js';
|
|
31
31
|
import 'dayjs';
|
|
32
32
|
import '@para-ui/icons/Forbid';
|
|
33
33
|
import '@para-ui/icons/Down';
|
|
34
|
-
import '../_verture/useFormatMessage-
|
|
34
|
+
import '../_verture/useFormatMessage-703f8b20.js';
|
|
35
35
|
|
|
36
36
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-search {\n display: flex;\n width: 100%;\n}\n.paraui-v3-search > .search-text-field {\n padding: 0;\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: none;\n margin-right: 8px;\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-within > .right-icon > svg {\n font-size: 16px;\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-within > .right-icon:hover > svg {\n color: rgba(54, 102, 214, 0.8);\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n margin-right: 8px;\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-after {\n padding: 0;\n background-color: white;\n}\n.paraui-v3-search > .search-text-field > .text-field-content > .text-field-content-after .search-button {\n border: 0;\n}\n.paraui-v3-search.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n}\n.paraui-v3-search.paraui-v3-search-value > .search-text-field > .text-field-content > .text-field-content-within > .right-icon {\n display: flex;\n}\n.paraui-v3-search .search-button > .paraui-v3-button-icon {\n margin-right: 0;\n}\n.paraui-v3-search .search-button > .paraui-v3-button-icon > svg {\n font-size: 16px;\n}\n.paraui-v3-search .search-button > .paraui-v3-button-label {\n margin-left: 4px;\n}\n.paraui-v3-search.paraui-v3-search-outside > .search-button {\n margin-left: 16px;\n}\n.paraui-v3-search.paraui-v3-search-inside .search-button {\n padding: 0 8px;\n}\n.paraui-v3-search.paraui-v3-search-inside .search-button svg {\n font-size: 20px;\n}\n.paraui-v3-search.paraui-v3-search-inside.paraui-v3-search-no-btntext .search-button > span {\n margin-right: 0;\n}\n.paraui-v3-search.paraui-v3-search-btntext .search-button svg {\n font-size: 16px;\n}\n.paraui-v3-search.paraui-v3-search-small > .search-text-field > .text-field-content > .text-field-content-after .search-button {\n height: 26px;\n}\n.paraui-v3-search.paraui-v3-search-small.paraui-v3-search-inside.paraui-v3-search-no-btntext .search-button svg {\n font-size: 16px;\n}\n.paraui-v3-search.paraui-v3-search-small.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .right-icon > svg {\n font-size: 16px;\n}\n.paraui-v3-search.paraui-v3-search-small.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n margin-right: 4px;\n}\n.paraui-v3-search.paraui-v3-search-medium > .search-text-field > .text-field-content > .text-field-content-after .search-button {\n height: 30px;\n}\n.paraui-v3-search.paraui-v3-search-medium.paraui-v3-search-inside.search-no-btntext .search-button svg {\n font-size: 18px;\n}\n.paraui-v3-search.paraui-v3-search-medium.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .right-icon > svg {\n font-size: 18px;\n}\n.paraui-v3-search.paraui-v3-search-medium.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n margin-right: 6px;\n}\n.paraui-v3-search.paraui-v3-search-large > .search-text-field > .text-field-content > .text-field-content-after .search-button {\n height: 34px;\n}\n.paraui-v3-search.paraui-v3-search-large.paraui-v3-search-inside.search-no-btntext .search-button svg {\n font-size: 20px;\n}\n.paraui-v3-search.paraui-v3-search-large.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .right-icon > svg {\n font-size: 20px;\n}\n.paraui-v3-search.paraui-v3-search-large.paraui-v3-search-right-icon-exist > .search-text-field > .text-field-content > .text-field-content-within > .clean-up-icon {\n margin-right: 8px;\n}";
|
|
37
37
|
styleInject(css_248z);
|
|
38
38
|
|
|
39
39
|
var Search = function Search(props) {
|
|
40
40
|
var _props$className = props.className,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
42
|
+
style = props.style,
|
|
43
|
+
_props$size = props.size,
|
|
44
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
45
|
+
_props$btnType = props.btnType,
|
|
46
|
+
btnType = _props$btnType === void 0 ? 'outside' : _props$btnType,
|
|
47
|
+
_props$showBtn = props.showBtn,
|
|
48
|
+
showBtn = _props$showBtn === void 0 ? true : _props$showBtn,
|
|
49
|
+
btnIcon = props.btnIcon,
|
|
50
|
+
_props$btnText = props.btnText,
|
|
51
|
+
btnText = _props$btnText === void 0 ? '' : _props$btnText,
|
|
52
|
+
_props$placeholder = props.placeholder,
|
|
53
|
+
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder;
|
|
54
|
+
props.defaultValue;
|
|
55
|
+
var value = props.value,
|
|
56
|
+
rightIcon = props.rightIcon,
|
|
57
|
+
_props$showRightIcon = props.showRightIcon,
|
|
58
|
+
showRightIcon = _props$showRightIcon === void 0 ? true : _props$showRightIcon,
|
|
59
|
+
_props$allowClear = props.allowClear,
|
|
60
|
+
allowClear = _props$allowClear === void 0 ? true : _props$allowClear,
|
|
61
|
+
_props$rightIconExist = props.rightIconExist,
|
|
62
|
+
rightIconExist = _props$rightIconExist === void 0 ? false : _props$rightIconExist,
|
|
63
|
+
onChange = props.onChange,
|
|
64
|
+
onBlur = props.onBlur,
|
|
65
|
+
onFocus = props.onFocus,
|
|
66
|
+
onKeydown = props.onKeydown,
|
|
67
|
+
onKeyUp = props.onKeyUp,
|
|
68
|
+
onClickBtn = props.onClickBtn,
|
|
69
|
+
onClickRightIcon = props.onClickRightIcon,
|
|
70
|
+
onEnter = props.onEnter,
|
|
71
|
+
onClear = props.onClear;
|
|
73
72
|
var _useState = useState(''),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
74
|
+
valueCom = _useState2[0],
|
|
75
|
+
setValueCom = _useState2[1];
|
|
78
76
|
useEffect(function () {
|
|
79
77
|
if (props.defaultValue !== undefined) {
|
|
80
78
|
setValueCom(props.defaultValue);
|
|
81
79
|
}
|
|
82
|
-
}, []);
|
|
83
|
-
|
|
80
|
+
}, []);
|
|
81
|
+
// 监听value
|
|
84
82
|
useEffect(function () {
|
|
85
83
|
if (value !== undefined) {
|
|
86
84
|
setValueCom(value);
|
|
@@ -90,7 +88,6 @@ var Search = function Search(props) {
|
|
|
90
88
|
* 输入框右侧按钮
|
|
91
89
|
* @return {ReactNode}
|
|
92
90
|
*/
|
|
93
|
-
|
|
94
91
|
var clearIcon = function clearIcon() {
|
|
95
92
|
if (!showRightIcon) return '';
|
|
96
93
|
if (rightIcon) return rightIcon;
|
|
@@ -99,8 +96,6 @@ var Search = function Search(props) {
|
|
|
99
96
|
* 搜索按钮图标
|
|
100
97
|
* @return {ReactNode}
|
|
101
98
|
*/
|
|
102
|
-
|
|
103
|
-
|
|
104
99
|
var searchBtnIcon = function searchBtnIcon() {
|
|
105
100
|
if (btnIcon) return btnIcon;
|
|
106
101
|
return jsx(SearchIcon, {});
|
|
@@ -108,48 +103,37 @@ var Search = function Search(props) {
|
|
|
108
103
|
/**
|
|
109
104
|
* 点击输入框右侧按钮
|
|
110
105
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
106
|
var clickRightIcon = function clickRightIcon() {
|
|
114
|
-
var val = valueCom;
|
|
115
|
-
|
|
107
|
+
var val = valueCom;
|
|
108
|
+
// 显示右侧图标 且 没有自定义右侧图标 为清空按钮
|
|
116
109
|
if (showRightIcon && !rightIcon) {
|
|
117
110
|
if (props.value === undefined) {
|
|
118
111
|
val = '';
|
|
119
112
|
setValueCom('');
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
|
-
|
|
123
115
|
onClickRightIcon && onClickRightIcon(val);
|
|
124
116
|
};
|
|
125
117
|
/**
|
|
126
118
|
* 改变输入框
|
|
127
119
|
* @param event {React.ChangeEvent<HTMLInputElement>} 元素
|
|
128
120
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
121
|
var changeInput = function changeInput(event) {
|
|
132
122
|
var val = event.target.value;
|
|
133
|
-
|
|
134
123
|
if (props.value === undefined) {
|
|
135
124
|
setValueCom(val);
|
|
136
125
|
}
|
|
137
|
-
|
|
138
126
|
onChange && onChange(val, event);
|
|
139
127
|
};
|
|
140
128
|
/**
|
|
141
129
|
* 点击按钮
|
|
142
130
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
131
|
var clickBtn = function clickBtn() {
|
|
146
132
|
onClickBtn && onClickBtn(valueCom);
|
|
147
133
|
};
|
|
148
134
|
/**
|
|
149
135
|
* 内置按钮
|
|
150
136
|
* */
|
|
151
|
-
|
|
152
|
-
|
|
153
137
|
var buttonDom = function buttonDom() {
|
|
154
138
|
if (showBtn && btnType === 'inside') {
|
|
155
139
|
return jsx(Button, Object.assign({
|
|
@@ -162,15 +146,12 @@ var Search = function Search(props) {
|
|
|
162
146
|
children: btnText
|
|
163
147
|
}));
|
|
164
148
|
}
|
|
165
|
-
|
|
166
149
|
return undefined;
|
|
167
150
|
};
|
|
168
151
|
/**
|
|
169
152
|
* 处理class
|
|
170
153
|
* @return {string}
|
|
171
154
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
155
|
var handClass = function handClass() {
|
|
175
156
|
var str = "".concat($prefixCls, "-search");
|
|
176
157
|
if (className) str += ' ' + className;
|
|
@@ -182,15 +163,12 @@ var Search = function Search(props) {
|
|
|
182
163
|
if (rightIconExist) str += " ".concat($prefixCls, "-search-right-icon-exist");
|
|
183
164
|
return str;
|
|
184
165
|
};
|
|
185
|
-
|
|
186
166
|
var handValue = function handValue() {
|
|
187
167
|
if (props.value === undefined) {
|
|
188
168
|
return valueCom;
|
|
189
169
|
}
|
|
190
|
-
|
|
191
170
|
return value;
|
|
192
171
|
};
|
|
193
|
-
|
|
194
172
|
return jsxs("div", Object.assign({
|
|
195
173
|
className: handClass(),
|
|
196
174
|
style: style
|