@hw-component/form 1.9.98 → 1.10.0

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.
@@ -1,3 +1,3 @@
1
1
  import type { HFormProps } from "./modal";
2
- declare const _default: ({ configData, gutter, dismissOnPressEnter, itemSpan, labelWidth, formItemStyle, flexBox: formFlexBox, }: HFormProps) => JSX.Element;
2
+ declare const _default: ({ configData, gutter, dismissOnPressEnter, itemSpan, labelWidth, formItemStyle, flexBox: formFlexBox, requiredMode, }: HFormProps) => JSX.Element;
3
3
  export default _default;
package/es/Form/Basic.js CHANGED
@@ -17,7 +17,8 @@ var Basic = (function (_ref) {
17
17
  itemSpan = _ref.itemSpan,
18
18
  labelWidth = _ref.labelWidth,
19
19
  formItemStyle = _ref.formItemStyle,
20
- formFlexBox = _ref.flexBox;
20
+ formFlexBox = _ref.flexBox,
21
+ requiredMode = _ref.requiredMode;
21
22
  var _useFormContext = useFormContext(),
22
23
  form = _useFormContext.form,
23
24
  formItemProps = _useFormContext.itemProps,
@@ -37,11 +38,15 @@ var Basic = (function (_ref) {
37
38
  form.submit();
38
39
  };
39
40
  var globalItemSpan = itemSpan || formItemSpan;
41
+ var boxStyle = requiredMode ? {
42
+ paddingLeft: 10,
43
+ width: "100%"
44
+ } : {
45
+ width: "100%"
46
+ };
40
47
  return jsx(Row, {
41
48
  gutter: gutter,
42
- style: {
43
- width: "100%"
44
- },
49
+ style: boxStyle,
45
50
  children: newConfigData.map(function (itemData, index) {
46
51
  var _itemData$labelWidth = itemData.labelWidth,
47
52
  itemLabelWidth = _itemData$labelWidth === void 0 ? labelWidth : _itemData$labelWidth,
@@ -32,7 +32,8 @@ var Content = function Content(_ref) {
32
32
  direction: "vertical",
33
33
  size: 4,
34
34
  style: {
35
- width: "100%"
35
+ width: "100%",
36
+ display: 'flex'
36
37
  },
37
38
  children: [jsx("div", {
38
39
  className: className,
@@ -1,3 +1,3 @@
1
1
  import type { HFormProps } from "./modal";
2
- declare const _default: ({ configData, gutter, dismissOnPressEnter, itemSpan, labelWidth, formItemStyle, flexBox: formFlexBox, }: HFormProps) => JSX.Element;
2
+ declare const _default: ({ configData, gutter, dismissOnPressEnter, itemSpan, labelWidth, formItemStyle, flexBox: formFlexBox, requiredMode, }: HFormProps) => JSX.Element;
3
3
  export default _default;
package/lib/Form/Basic.js CHANGED
@@ -20,7 +20,8 @@ var Basic = (function (_ref) {
20
20
  itemSpan = _ref.itemSpan,
21
21
  labelWidth = _ref.labelWidth,
22
22
  formItemStyle = _ref.formItemStyle,
23
- formFlexBox = _ref.flexBox;
23
+ formFlexBox = _ref.flexBox,
24
+ requiredMode = _ref.requiredMode;
24
25
  var _useFormContext = index.useFormContext(),
25
26
  form = _useFormContext.form,
26
27
  formItemProps = _useFormContext.itemProps,
@@ -40,11 +41,15 @@ var Basic = (function (_ref) {
40
41
  form.submit();
41
42
  };
42
43
  var globalItemSpan = itemSpan || formItemSpan;
44
+ var boxStyle = requiredMode ? {
45
+ paddingLeft: 10,
46
+ width: "100%"
47
+ } : {
48
+ width: "100%"
49
+ };
43
50
  return jsxRuntime.jsx(antd.Row, {
44
51
  gutter: gutter,
45
- style: {
46
- width: "100%"
47
- },
52
+ style: boxStyle,
48
53
  children: newConfigData.map(function (itemData, index) {
49
54
  var _itemData$labelWidth = itemData.labelWidth,
50
55
  itemLabelWidth = _itemData$labelWidth === void 0 ? labelWidth : _itemData$labelWidth,
@@ -35,7 +35,8 @@ var Content = function Content(_ref) {
35
35
  direction: "vertical",
36
36
  size: 4,
37
37
  style: {
38
- width: "100%"
38
+ width: "100%",
39
+ display: 'flex'
39
40
  },
40
41
  children: [jsxRuntime.jsx("div", {
41
42
  className: className,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.9.98",
3
+ "version": "1.10.0",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,6 +13,7 @@ export default ({
13
13
  labelWidth,
14
14
  formItemStyle,
15
15
  flexBox: formFlexBox,
16
+ requiredMode,
16
17
  }: HFormProps) => {
17
18
  const {
18
19
  form,
@@ -32,8 +33,9 @@ export default ({
32
33
  form.submit();
33
34
  };
34
35
  const globalItemSpan = itemSpan || formItemSpan;
36
+ const boxStyle= requiredMode?{paddingLeft:10,width: "100%"}:{width: "100%"}
35
37
  return (
36
- <Row gutter={gutter} style={{ width: "100%" }}>
38
+ <Row gutter={gutter} style={boxStyle}>
37
39
  {newConfigData.map((itemData: HItemProps, index) => {
38
40
  const {
39
41
  labelWidth: itemLabelWidth = labelWidth,
@@ -30,7 +30,7 @@ const Content: React.FC<ContentProps> = ({
30
30
  const relChild =
31
31
  children && React.cloneElement(children as any, { value, onChange });
32
32
  return (
33
- <Space direction={"vertical"} size={4} style={{ width: "100%" }}>
33
+ <Space direction={"vertical"} size={4} style={{ width: "100%" ,display:'flex'}}>
34
34
  <div className={className}>{relChild}</div>
35
35
  <Helper helper={helper} />
36
36
  </Space>
@@ -20,7 +20,6 @@ const Index = ({
20
20
  const timeVal = useTimePickerValue({ value, format });
21
21
  const change = useTimePickerChange({ value, format, onChange });
22
22
  const addonClassName=useClassName("hw-addon")
23
-
24
23
  return (
25
24
  <Input.Group compact style={{display:"flex",...style}}>
26
25
  {addonBefore? <div className={addonClassName}>{addonBefore}</div>:null}