@hw-component/form 1.10.63 → 1.10.65
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/InputGroup/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var Addon = function Addon(_ref) {
|
|
|
15
15
|
onChange = _ref.onChange,
|
|
16
16
|
style = _ref.style;
|
|
17
17
|
var addonClassname = useClassName(["hw-addon"]);
|
|
18
|
+
var addonChildClassname = useClassName(["hw-addon-children"]);
|
|
18
19
|
if (!children) {
|
|
19
20
|
return jsx(Fragment, {});
|
|
20
21
|
}
|
|
@@ -22,9 +23,12 @@ var Addon = function Addon(_ref) {
|
|
|
22
23
|
return jsx("div", {
|
|
23
24
|
className: addonClassname,
|
|
24
25
|
style: style,
|
|
25
|
-
children:
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
children: jsx("div", {
|
|
27
|
+
className: addonChildClassname,
|
|
28
|
+
children: /*#__PURE__*/React.cloneElement(children, {
|
|
29
|
+
value: value,
|
|
30
|
+
onChange: onChange
|
|
31
|
+
})
|
|
28
32
|
})
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -32,16 +36,22 @@ var Addon = function Addon(_ref) {
|
|
|
32
36
|
return jsx("div", {
|
|
33
37
|
className: addonClassname,
|
|
34
38
|
style: style,
|
|
35
|
-
children:
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
children: jsx("div", {
|
|
40
|
+
className: addonChildClassname,
|
|
41
|
+
children: children({
|
|
42
|
+
value: value,
|
|
43
|
+
onChange: onChange
|
|
44
|
+
})
|
|
38
45
|
})
|
|
39
46
|
});
|
|
40
47
|
}
|
|
41
48
|
return jsx("div", {
|
|
42
49
|
className: addonClassname,
|
|
43
50
|
style: style,
|
|
44
|
-
children:
|
|
51
|
+
children: jsxs("div", {
|
|
52
|
+
className: addonChildClassname,
|
|
53
|
+
children: [" ", children]
|
|
54
|
+
})
|
|
45
55
|
});
|
|
46
56
|
};
|
|
47
57
|
var Index = function Index(_ref2) {
|
package/es/index.css
CHANGED
package/lib/InputGroup/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var Addon = function Addon(_ref) {
|
|
|
18
18
|
onChange = _ref.onChange,
|
|
19
19
|
style = _ref.style;
|
|
20
20
|
var addonClassname = index.useClassName(["hw-addon"]);
|
|
21
|
+
var addonChildClassname = index.useClassName(["hw-addon-children"]);
|
|
21
22
|
if (!children) {
|
|
22
23
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
23
24
|
}
|
|
@@ -25,9 +26,12 @@ var Addon = function Addon(_ref) {
|
|
|
25
26
|
return jsxRuntime.jsx("div", {
|
|
26
27
|
className: addonClassname,
|
|
27
28
|
style: style,
|
|
28
|
-
children:
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
children: jsxRuntime.jsx("div", {
|
|
30
|
+
className: addonChildClassname,
|
|
31
|
+
children: /*#__PURE__*/React.cloneElement(children, {
|
|
32
|
+
value: value,
|
|
33
|
+
onChange: onChange
|
|
34
|
+
})
|
|
31
35
|
})
|
|
32
36
|
});
|
|
33
37
|
}
|
|
@@ -35,16 +39,22 @@ var Addon = function Addon(_ref) {
|
|
|
35
39
|
return jsxRuntime.jsx("div", {
|
|
36
40
|
className: addonClassname,
|
|
37
41
|
style: style,
|
|
38
|
-
children:
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
children: jsxRuntime.jsx("div", {
|
|
43
|
+
className: addonChildClassname,
|
|
44
|
+
children: children({
|
|
45
|
+
value: value,
|
|
46
|
+
onChange: onChange
|
|
47
|
+
})
|
|
41
48
|
})
|
|
42
49
|
});
|
|
43
50
|
}
|
|
44
51
|
return jsxRuntime.jsx("div", {
|
|
45
52
|
className: addonClassname,
|
|
46
53
|
style: style,
|
|
47
|
-
children:
|
|
54
|
+
children: jsxRuntime.jsxs("div", {
|
|
55
|
+
className: addonChildClassname,
|
|
56
|
+
children: [" ", children]
|
|
57
|
+
})
|
|
48
58
|
});
|
|
49
59
|
};
|
|
50
60
|
var Index = function Index(_ref2) {
|
package/lib/index.css
CHANGED
package/package.json
CHANGED
|
@@ -25,26 +25,31 @@ interface AddonProps extends HInputGroupProps {
|
|
|
25
25
|
}
|
|
26
26
|
const Addon: React.FC<AddonProps> = ({ children, value, onChange, style }) => {
|
|
27
27
|
const addonClassname = useClassName(["hw-addon"]);
|
|
28
|
+
const addonChildClassname = useClassName(["hw-addon-children"]);
|
|
28
29
|
if (!children) {
|
|
29
30
|
return <></>;
|
|
30
31
|
}
|
|
31
32
|
if (React.isValidElement(children)) {
|
|
32
33
|
return (
|
|
33
34
|
<div className={addonClassname} style={style}>
|
|
34
|
-
|
|
35
|
+
<div className={addonChildClassname}>
|
|
36
|
+
{React.cloneElement(children as any, { value, onChange })}
|
|
37
|
+
</div>
|
|
35
38
|
</div>
|
|
36
39
|
);
|
|
37
40
|
}
|
|
38
41
|
if (typeof children === "function") {
|
|
39
42
|
return (
|
|
40
43
|
<div className={addonClassname} style={style}>
|
|
41
|
-
{
|
|
44
|
+
<div className={addonChildClassname}>
|
|
45
|
+
{children({ value, onChange })}
|
|
46
|
+
</div>
|
|
42
47
|
</div>
|
|
43
48
|
);
|
|
44
49
|
}
|
|
45
50
|
return (
|
|
46
51
|
<div className={addonClassname} style={style}>
|
|
47
|
-
{children}
|
|
52
|
+
<div className={addonChildClassname}> {children}</div>
|
|
48
53
|
</div>
|
|
49
54
|
);
|
|
50
55
|
};
|