@hw-component/form 1.4.7 → 1.4.8
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/es/Input/InputNumberGroup.js +5 -2
- package/es/index.css +3 -3
- package/lib/Input/InputNumberGroup.js +5 -2
- package/lib/index.css +3 -3
- package/package.json +1 -1
- package/src/components/Input/InputNumberGroup.tsx +5 -1
- package/src/components/Input/index.less +5 -3
- package/src/pages/Form/index.tsx +1 -3
|
@@ -39,7 +39,9 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
39
39
|
placeholder = _ref$placeholder === void 0 ? ['请输入', '请输入'] : _ref$placeholder,
|
|
40
40
|
_ref$inputNumberProps = _ref.inputNumberProps,
|
|
41
41
|
inputNumberProps = _ref$inputNumberProps === void 0 ? {} : _ref$inputNumberProps,
|
|
42
|
-
addonAfter = _ref.addonAfter
|
|
42
|
+
addonAfter = _ref.addonAfter,
|
|
43
|
+
_ref$noHandlerWrap = _ref.noHandlerWrap,
|
|
44
|
+
noHandlerWrap = _ref$noHandlerWrap === void 0 ? true : _ref$noHandlerWrap;
|
|
43
45
|
var min = valueMap.min,
|
|
44
46
|
max = valueMap.max;
|
|
45
47
|
var minVal = value[min],
|
|
@@ -62,6 +64,7 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
62
64
|
var borderClassname = useClassName(["hw-input-group-border"]);
|
|
63
65
|
var oneClassname = useClassName(["hw-input-group-one"]);
|
|
64
66
|
var iconClassname = useClassName(["hw-input-group-icon"]);
|
|
67
|
+
var noHandlerWrapClassname = useClassName(["hw-input-group-no-handler-wrap"]);
|
|
65
68
|
var change = function change(key, val) {
|
|
66
69
|
var newVal = _objectSpread({}, value);
|
|
67
70
|
newVal[key] = val;
|
|
@@ -74,7 +77,7 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
74
77
|
value: value,
|
|
75
78
|
onChange: onChange
|
|
76
79
|
}) : addonAfter, jsxs("div", {
|
|
77
|
-
className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : ''),
|
|
80
|
+
className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : '', " ").concat(noHandlerWrap ? noHandlerWrapClassname : ""),
|
|
78
81
|
children: [jsx("span", {
|
|
79
82
|
className: borderClassname
|
|
80
83
|
}), jsx(InputNumber, _objectSpread({
|
package/es/index.css
CHANGED
|
@@ -111,9 +111,6 @@
|
|
|
111
111
|
align-items: center;
|
|
112
112
|
border: 1px solid #d9d9d9;
|
|
113
113
|
}
|
|
114
|
-
.ant-hw-input-group .ant-hw-input-group-body .ant-input-number-handler-wrap {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
114
|
.ant-hw-input-group .ant-hw-input-group-body:hover {
|
|
118
115
|
border-color: #40a9ff;
|
|
119
116
|
}
|
|
@@ -123,6 +120,9 @@
|
|
|
123
120
|
.ant-hw-input-group .ant-hw-input-group-body:active {
|
|
124
121
|
border-color: #40a9ff;
|
|
125
122
|
}
|
|
123
|
+
.ant-hw-input-group .ant-hw-input-group-no-handler-wrap .ant-input-number-handler-wrap {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
126
|
.ant-hw-input-group .ant-hw-input-group-border {
|
|
127
127
|
position: absolute;
|
|
128
128
|
left: -1px;
|
|
@@ -42,7 +42,9 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
42
42
|
placeholder = _ref$placeholder === void 0 ? ['请输入', '请输入'] : _ref$placeholder,
|
|
43
43
|
_ref$inputNumberProps = _ref.inputNumberProps,
|
|
44
44
|
inputNumberProps = _ref$inputNumberProps === void 0 ? {} : _ref$inputNumberProps,
|
|
45
|
-
addonAfter = _ref.addonAfter
|
|
45
|
+
addonAfter = _ref.addonAfter,
|
|
46
|
+
_ref$noHandlerWrap = _ref.noHandlerWrap,
|
|
47
|
+
noHandlerWrap = _ref$noHandlerWrap === void 0 ? true : _ref$noHandlerWrap;
|
|
46
48
|
var min = valueMap.min,
|
|
47
49
|
max = valueMap.max;
|
|
48
50
|
var minVal = value[min],
|
|
@@ -65,6 +67,7 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
65
67
|
var borderClassname = index.useClassName(["hw-input-group-border"]);
|
|
66
68
|
var oneClassname = index.useClassName(["hw-input-group-one"]);
|
|
67
69
|
var iconClassname = index.useClassName(["hw-input-group-icon"]);
|
|
70
|
+
var noHandlerWrapClassname = index.useClassName(["hw-input-group-no-handler-wrap"]);
|
|
68
71
|
var change = function change(key, val) {
|
|
69
72
|
var newVal = _objectSpread({}, value);
|
|
70
73
|
newVal[key] = val;
|
|
@@ -77,7 +80,7 @@ var InputNumberGroup = function InputNumberGroup(_ref) {
|
|
|
77
80
|
value: value,
|
|
78
81
|
onChange: onChange
|
|
79
82
|
}) : addonAfter, jsxRuntime.jsxs("div", {
|
|
80
|
-
className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : ''),
|
|
83
|
+
className: "".concat(bodyClassname, " ").concat(focus ? activeClassname : '', " ").concat(noHandlerWrap ? noHandlerWrapClassname : ""),
|
|
81
84
|
children: [jsxRuntime.jsx("span", {
|
|
82
85
|
className: borderClassname
|
|
83
86
|
}), jsxRuntime.jsx(antd.InputNumber, _objectSpread({
|
package/lib/index.css
CHANGED
|
@@ -111,9 +111,6 @@
|
|
|
111
111
|
align-items: center;
|
|
112
112
|
border: 1px solid #d9d9d9;
|
|
113
113
|
}
|
|
114
|
-
.ant-hw-input-group .ant-hw-input-group-body .ant-input-number-handler-wrap {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
114
|
.ant-hw-input-group .ant-hw-input-group-body:hover {
|
|
118
115
|
border-color: #40a9ff;
|
|
119
116
|
}
|
|
@@ -123,6 +120,9 @@
|
|
|
123
120
|
.ant-hw-input-group .ant-hw-input-group-body:active {
|
|
124
121
|
border-color: #40a9ff;
|
|
125
122
|
}
|
|
123
|
+
.ant-hw-input-group .ant-hw-input-group-no-handler-wrap .ant-input-number-handler-wrap {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
126
|
.ant-hw-input-group .ant-hw-input-group-border {
|
|
127
127
|
position: absolute;
|
|
128
128
|
left: -1px;
|
package/package.json
CHANGED
|
@@ -17,6 +17,7 @@ interface IProps<T=any> {
|
|
|
17
17
|
value?:T;
|
|
18
18
|
onChange:(value:T)=>void;
|
|
19
19
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
20
|
+
noHandlerWrap?:boolean;
|
|
20
21
|
}
|
|
21
22
|
const useArrayProps = (props: any) => {
|
|
22
23
|
return useMemo(() => {
|
|
@@ -33,6 +34,7 @@ const InputNumberGroup=({
|
|
|
33
34
|
placeholder = ['请输入', '请输入'],
|
|
34
35
|
inputNumberProps = {},
|
|
35
36
|
addonAfter,
|
|
37
|
+
noHandlerWrap=true
|
|
36
38
|
}: IProps) => {
|
|
37
39
|
const { min, max } = valueMap;
|
|
38
40
|
const { [min]: minVal, [max]: maxVal } = value;
|
|
@@ -45,6 +47,8 @@ const InputNumberGroup=({
|
|
|
45
47
|
const borderClassname = useClassName(["hw-input-group-border"]);
|
|
46
48
|
const oneClassname = useClassName(["hw-input-group-one"]);
|
|
47
49
|
const iconClassname = useClassName(["hw-input-group-icon"]);
|
|
50
|
+
const noHandlerWrapClassname = useClassName(["hw-input-group-no-handler-wrap"]);
|
|
51
|
+
|
|
48
52
|
const change = (key: string, val: number | null) => {
|
|
49
53
|
const newVal = { ...value };
|
|
50
54
|
newVal[key] = val;
|
|
@@ -53,7 +57,7 @@ const InputNumberGroup=({
|
|
|
53
57
|
return (
|
|
54
58
|
<Input.Group compact className={contentClassname}>
|
|
55
59
|
{addonAfter ? React.cloneElement(addonAfter as any, { value, onChange }) : addonAfter}
|
|
56
|
-
<div className={`${bodyClassname} ${focus ? activeClassname : ''}`}>
|
|
60
|
+
<div className={`${bodyClassname} ${focus ? activeClassname : ''} ${noHandlerWrap?noHandlerWrapClassname:""}`}>
|
|
57
61
|
<span className={borderClassname} />
|
|
58
62
|
<InputNumber<number>
|
|
59
63
|
bordered={false}
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
flex: 1;
|
|
12
12
|
align-items: center;
|
|
13
13
|
border: 1px solid #d9d9d9;
|
|
14
|
-
.@{ant-prefix}-input-number-handler-wrap {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
14
|
&:hover {
|
|
18
15
|
border-color: #40a9ff;
|
|
19
16
|
.border {
|
|
@@ -24,6 +21,11 @@
|
|
|
24
21
|
border-color: #40a9ff;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
24
|
+
.@{all-input-group}-no-handler-wrap {
|
|
25
|
+
.@{ant-prefix}-input-number-handler-wrap {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
27
29
|
.@{all-input-group}-border{
|
|
28
30
|
position: absolute;
|
|
29
31
|
left: -1px;
|