@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.
@@ -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: /*#__PURE__*/React.cloneElement(children, {
26
- value: value,
27
- onChange: onChange
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: children({
36
- value: value,
37
- onChange: onChange
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: 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
@@ -305,6 +305,9 @@
305
305
  background-color: #fafafa;
306
306
  border: 1px solid #d9d9d9;
307
307
  }
308
+ .ant-hw-addon .ant-hw-addon-children {
309
+ white-space: nowrap;
310
+ }
308
311
  .ant-form-item-has-error .ant-hw-input-group-body {
309
312
  border-color: #ff4d4f !important;
310
313
  }
@@ -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: /*#__PURE__*/React.cloneElement(children, {
29
- value: value,
30
- onChange: onChange
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: children({
39
- value: value,
40
- onChange: onChange
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: 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
@@ -305,6 +305,9 @@
305
305
  background-color: #fafafa;
306
306
  border: 1px solid #d9d9d9;
307
307
  }
308
+ .ant-hw-addon .ant-hw-addon-children {
309
+ white-space: nowrap;
310
+ }
308
311
  .ant-form-item-has-error .ant-hw-input-group-body {
309
312
  border-color: #ff4d4f !important;
310
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.63",
3
+ "version": "1.10.65",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,6 +19,9 @@
19
19
  padding: 0 11px;
20
20
  background-color: #fafafa;
21
21
  border: 1px solid #d9d9d9;
22
+ .@{ant-prefix}-hw-addon-children {
23
+ white-space: nowrap;
24
+ }
22
25
  }
23
26
  .@{ant-prefix}-form-item-has-error {
24
27
  .@{all-input-group}-body {
@@ -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
- {React.cloneElement(children as any, { value, onChange })}
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
- {children({ value, onChange })}
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
  };
@@ -32,6 +32,8 @@ export default () => {
32
32
  />
33
33
  <div style={{backgroundColor:"red"}}>
34
34
  <HInputNumberGroup
35
+ addonBefore="fajhfjsafhsajfhasjhfajhfajhfsjhf"
36
+ addonAfter="fajhfjsafhsajfhasjhfajhfajhfsjhf"
35
37
  inputNumberProps={{
36
38
  precision: 2,
37
39
  }}