@hw-component/form 1.9.66 → 1.9.67

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/Form/Basic.js CHANGED
@@ -6,6 +6,7 @@ import Item from './FormItem/index.js';
6
6
  import { Row } from 'antd';
7
7
  import { useFormContext } from './Context/index.js';
8
8
  import useInitConfigData from './hooks/useInitConfigData.js';
9
+ import { useClassName } from '../hooks/index.js';
9
10
 
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -29,6 +30,7 @@ var Basic = (function (_ref) {
29
30
  }),
30
31
  newConfigData = _useInitConfigData.newConfigData,
31
32
  dispatchSourceData = _useInitConfigData.dispatchSourceData;
33
+ var rowClassname = useClassName("hw-form-item-row");
32
34
  useEffect(function () {
33
35
  setData === null || setData === void 0 || setData(dispatchSourceData);
34
36
  }, []);
@@ -41,6 +43,7 @@ var Basic = (function (_ref) {
41
43
  style: {
42
44
  width: "100%"
43
45
  },
46
+ className: rowClassname,
44
47
  children: newConfigData.map(function (itemData, index) {
45
48
  var _itemData$labelWidth = itemData.labelWidth,
46
49
  itemLabelWidth = _itemData$labelWidth === void 0 ? labelWidth : _itemData$labelWidth,
package/es/index.css CHANGED
@@ -160,6 +160,12 @@
160
160
  .ant-hw-form-form-item .ant-form-item-label {
161
161
  overflow: visible;
162
162
  }
163
+ .ant-hw-form-item-row .ant-form-item-control-input-content > .ant-space-vertical {
164
+ display: -webkit-box;
165
+ display: -webkit-flex;
166
+ display: -ms-flexbox;
167
+ display: flex;
168
+ }
163
169
  .ant-hw-input-group .ant-hw-input-group-disabled {
164
170
  background-color: #f5f5f5;
165
171
  }
package/lib/Form/Basic.js CHANGED
@@ -5,10 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var React = require('react');
8
- var index$1 = require('./FormItem/index.js');
8
+ var index$2 = require('./FormItem/index.js');
9
9
  var antd = require('antd');
10
10
  var index = require('./Context/index.js');
11
11
  var useInitConfigData = require('./hooks/useInitConfigData.js');
12
+ var index$1 = require('../hooks/index.js');
12
13
 
13
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -32,6 +33,7 @@ var Basic = (function (_ref) {
32
33
  }),
33
34
  newConfigData = _useInitConfigData.newConfigData,
34
35
  dispatchSourceData = _useInitConfigData.dispatchSourceData;
36
+ var rowClassname = index$1.useClassName("hw-form-item-row");
35
37
  React.useEffect(function () {
36
38
  setData === null || setData === void 0 || setData(dispatchSourceData);
37
39
  }, []);
@@ -44,6 +46,7 @@ var Basic = (function (_ref) {
44
46
  style: {
45
47
  width: "100%"
46
48
  },
49
+ className: rowClassname,
47
50
  children: newConfigData.map(function (itemData, index) {
48
51
  var _itemData$labelWidth = itemData.labelWidth,
49
52
  itemLabelWidth = _itemData$labelWidth === void 0 ? labelWidth : _itemData$labelWidth,
@@ -62,7 +65,7 @@ var Basic = (function (_ref) {
62
65
  var arrayName = Array.isArray(name) ? name.join(".") : name;
63
66
  var key = arrayName || nameKey;
64
67
  var itemStyle = style || formItemStyle;
65
- return /*#__PURE__*/React.createElement(index$1.default, _objectSpread(_objectSpread({}, itemData), {}, {
68
+ return /*#__PURE__*/React.createElement(index$2.default, _objectSpread(_objectSpread({}, itemData), {}, {
66
69
  labelAlign: labelAlign,
67
70
  key: key || index,
68
71
  style: itemStyle,
package/lib/index.css CHANGED
@@ -160,6 +160,12 @@
160
160
  .ant-hw-form-form-item .ant-form-item-label {
161
161
  overflow: visible;
162
162
  }
163
+ .ant-hw-form-item-row .ant-form-item-control-input-content > .ant-space-vertical {
164
+ display: -webkit-box;
165
+ display: -webkit-flex;
166
+ display: -ms-flexbox;
167
+ display: flex;
168
+ }
163
169
  .ant-hw-input-group .ant-hw-input-group-disabled {
164
170
  background-color: #f5f5f5;
165
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.9.66",
3
+ "version": "1.9.67",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,6 +8,7 @@ import { Row } from "antd";
8
8
  import { useFormContext } from "./Context";
9
9
  import useInitConfigData from "./hooks/useInitConfigData";
10
10
  import { useEffect } from "react";
11
+ import {useClassName} from "../hooks";
11
12
 
12
13
  export default ({
13
14
  configData,
@@ -28,6 +29,7 @@ export default ({
28
29
  configData,
29
30
  form,
30
31
  });
32
+ const rowClassname=useClassName("hw-form-item-row");
31
33
  useEffect(() => {
32
34
  setData?.(dispatchSourceData);
33
35
  }, []);
@@ -36,7 +38,7 @@ export default ({
36
38
  };
37
39
  const globalItemSpan = itemSpan || formItemSpan;
38
40
  return (
39
- <Row gutter={gutter} style={{ width: "100%" }}>
41
+ <Row gutter={gutter} style={{ width: "100%" }} className={rowClassname}>
40
42
  {newConfigData.map((itemData: HItemProps, index) => {
41
43
  const {
42
44
  labelWidth: itemLabelWidth = labelWidth,
@@ -95,3 +95,8 @@
95
95
  overflow: visible;
96
96
  }
97
97
  }
98
+ .@{ant-prefix}-hw-form-item-row{
99
+ .@{ant-prefix}-form-item-control-input-content>.@{ant-prefix}-space-vertical{
100
+ display: flex;
101
+ }
102
+ }
@@ -1,10 +1,11 @@
1
1
  import { HSelect } from "../../components";
2
- import { Space } from "antd";
3
- import { useState } from "react";
2
+ import {Form, Space} from "antd";
3
+ import {useEffect, useState} from "react";
4
4
  export default () => {
5
5
  const [selectVal, setSelectVal] = useState([{ name: "11", id: -100 }]);
6
6
  const [op, setOp] = useState([{ label: "1", value: 1 }]);
7
7
  const [val, setVal] = useState([2, 3]);
8
+
8
9
  return (
9
10
  <Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
10
11
  <HSelect