@hw-component/form 0.0.9-beta-v5 → 0.0.9-beta-v6
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/index.d.ts +1 -1
- package/es/Form/index.js +3 -1
- package/es/Form/modal.d.ts +2 -0
- package/lib/Form/index.d.ts +1 -1
- package/lib/Form/index.js +3 -1
- package/lib/Form/modal.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Form/index.tsx +2 -1
- package/src/components/Form/modal.ts +2 -0
package/es/Form/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { HFormProps } from "./modal";
|
|
2
|
-
declare const _default: ({ configData, labelWidth, form, request, onFinish, infoRequest, valueType, initialValues, params, onValuesChange, itemSpan, hideLabel: formHideLabel, ...props }: HFormProps) => JSX.Element;
|
|
2
|
+
declare const _default: ({ configData, labelWidth, form, request, onFinish, infoRequest, valueType, initialValues, params, onValuesChange, itemSpan, hideLabel: formHideLabel, gutter, ...props }: HFormProps) => JSX.Element;
|
|
3
3
|
export default _default;
|
package/es/Form/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import Index from '../PageHandler/index.js';
|
|
|
19
19
|
import useInitConfigData from './hooks/useInitConfigData.js';
|
|
20
20
|
import InitSet from './InitSet.js';
|
|
21
21
|
|
|
22
|
-
var _excluded = ["configData", "labelWidth", "form", "request", "onFinish", "infoRequest", "valueType", "initialValues", "params", "onValuesChange", "itemSpan", "hideLabel"];
|
|
22
|
+
var _excluded = ["configData", "labelWidth", "form", "request", "onFinish", "infoRequest", "valueType", "initialValues", "params", "onValuesChange", "itemSpan", "hideLabel", "gutter"];
|
|
23
23
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
24
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
25
|
var HForm = (function (_ref) {
|
|
@@ -38,6 +38,7 @@ var HForm = (function (_ref) {
|
|
|
38
38
|
itemSpan = _ref.itemSpan,
|
|
39
39
|
_ref$hideLabel = _ref.hideLabel,
|
|
40
40
|
formHideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
41
|
+
gutter = _ref.gutter,
|
|
41
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
43
|
var hForm = useCurrentForm(form);
|
|
43
44
|
var _useInitConfigData = useInitConfigData({
|
|
@@ -90,6 +91,7 @@ var HForm = (function (_ref) {
|
|
|
90
91
|
onValuesChange: valuesChange
|
|
91
92
|
}, props), {}, {
|
|
92
93
|
children: [jsx(Row, {
|
|
94
|
+
gutter: gutter,
|
|
93
95
|
children: newConfigData.map(function (itemData, index) {
|
|
94
96
|
var itemLabelWidth = itemData.labelWidth,
|
|
95
97
|
_itemData$hideLabel = itemData.hideLabel,
|
package/es/Form/modal.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { PromiseFnResult, ValueCheckMapModal, ValueSwitchMapModal, DateRang
|
|
|
15
15
|
import type { ForwardedRef } from "react";
|
|
16
16
|
import type { DataFnProvider } from "../modal";
|
|
17
17
|
import type { ColProps } from "antd/lib/grid/col";
|
|
18
|
+
import { Gutter } from "antd/lib/grid/row";
|
|
18
19
|
type RenderFun = (props: HItemProps, node: React.ReactNode, form: FormInstance) => React.ReactNode;
|
|
19
20
|
type ItemPropsType = HCheckboxProps | HInputProps | HSelectInputProps | HButtonProps | HRadioGroupProps | HSelectProps | ButtonProps | HSwitchProps | HDatePickerProps | HRangePickerProps | HTimePickerProps | TextAreaProps | IUpLoadProps | CascaderProps<any>;
|
|
20
21
|
export interface HoverModal {
|
|
@@ -56,6 +57,7 @@ export interface HFormProps<T = any, R = any> extends Omit<FormProps, "form" | "
|
|
|
56
57
|
onFinish?: (values: T, params?: any) => void;
|
|
57
58
|
itemSpan?: ColProps;
|
|
58
59
|
hideLabel?: boolean;
|
|
60
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
59
61
|
}
|
|
60
62
|
export interface HFormItemProps extends HItemProps {
|
|
61
63
|
required?: boolean;
|
package/lib/Form/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { HFormProps } from "./modal";
|
|
2
|
-
declare const _default: ({ configData, labelWidth, form, request, onFinish, infoRequest, valueType, initialValues, params, onValuesChange, itemSpan, hideLabel: formHideLabel, ...props }: HFormProps) => JSX.Element;
|
|
2
|
+
declare const _default: ({ configData, labelWidth, form, request, onFinish, infoRequest, valueType, initialValues, params, onValuesChange, itemSpan, hideLabel: formHideLabel, gutter, ...props }: HFormProps) => JSX.Element;
|
|
3
3
|
export default _default;
|
package/lib/Form/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var index$1 = require('../PageHandler/index.js');
|
|
|
22
22
|
var useInitConfigData = require('./hooks/useInitConfigData.js');
|
|
23
23
|
var InitSet = require('./InitSet.js');
|
|
24
24
|
|
|
25
|
-
var _excluded = ["configData", "labelWidth", "form", "request", "onFinish", "infoRequest", "valueType", "initialValues", "params", "onValuesChange", "itemSpan", "hideLabel"];
|
|
25
|
+
var _excluded = ["configData", "labelWidth", "form", "request", "onFinish", "infoRequest", "valueType", "initialValues", "params", "onValuesChange", "itemSpan", "hideLabel", "gutter"];
|
|
26
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
27
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
28
|
var HForm = (function (_ref) {
|
|
@@ -41,6 +41,7 @@ var HForm = (function (_ref) {
|
|
|
41
41
|
itemSpan = _ref.itemSpan,
|
|
42
42
|
_ref$hideLabel = _ref.hideLabel,
|
|
43
43
|
formHideLabel = _ref$hideLabel === void 0 ? false : _ref$hideLabel,
|
|
44
|
+
gutter = _ref.gutter,
|
|
44
45
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
46
|
var hForm = index.useCurrentForm(form);
|
|
46
47
|
var _useInitConfigData = useInitConfigData.default({
|
|
@@ -93,6 +94,7 @@ var HForm = (function (_ref) {
|
|
|
93
94
|
onValuesChange: valuesChange
|
|
94
95
|
}, props), {}, {
|
|
95
96
|
children: [jsxRuntime.jsx(antd.Row, {
|
|
97
|
+
gutter: gutter,
|
|
96
98
|
children: newConfigData.map(function (itemData, index) {
|
|
97
99
|
var itemLabelWidth = itemData.labelWidth,
|
|
98
100
|
_itemData$hideLabel = itemData.hideLabel,
|
package/lib/Form/modal.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { PromiseFnResult, ValueCheckMapModal, ValueSwitchMapModal, DateRang
|
|
|
15
15
|
import type { ForwardedRef } from "react";
|
|
16
16
|
import type { DataFnProvider } from "../modal";
|
|
17
17
|
import type { ColProps } from "antd/lib/grid/col";
|
|
18
|
+
import { Gutter } from "antd/lib/grid/row";
|
|
18
19
|
type RenderFun = (props: HItemProps, node: React.ReactNode, form: FormInstance) => React.ReactNode;
|
|
19
20
|
type ItemPropsType = HCheckboxProps | HInputProps | HSelectInputProps | HButtonProps | HRadioGroupProps | HSelectProps | ButtonProps | HSwitchProps | HDatePickerProps | HRangePickerProps | HTimePickerProps | TextAreaProps | IUpLoadProps | CascaderProps<any>;
|
|
20
21
|
export interface HoverModal {
|
|
@@ -56,6 +57,7 @@ export interface HFormProps<T = any, R = any> extends Omit<FormProps, "form" | "
|
|
|
56
57
|
onFinish?: (values: T, params?: any) => void;
|
|
57
58
|
itemSpan?: ColProps;
|
|
58
59
|
hideLabel?: boolean;
|
|
60
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
59
61
|
}
|
|
60
62
|
export interface HFormItemProps extends HItemProps {
|
|
61
63
|
required?: boolean;
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ export default ({
|
|
|
21
21
|
onValuesChange,
|
|
22
22
|
itemSpan,
|
|
23
23
|
hideLabel: formHideLabel = false,
|
|
24
|
+
gutter,
|
|
24
25
|
...props
|
|
25
26
|
}: HFormProps) => {
|
|
26
27
|
const hForm = useCurrentForm(form);
|
|
@@ -69,7 +70,7 @@ export default ({
|
|
|
69
70
|
onValuesChange={valuesChange}
|
|
70
71
|
{...props}
|
|
71
72
|
>
|
|
72
|
-
<Row>
|
|
73
|
+
<Row gutter={gutter}>
|
|
73
74
|
{newConfigData.map((itemData: HItemProps, index) => {
|
|
74
75
|
const { labelWidth: itemLabelWidth, hideLabel = formHideLabel } =
|
|
75
76
|
itemData;
|
|
@@ -33,6 +33,7 @@ import type {
|
|
|
33
33
|
import type { ForwardedRef } from "react";
|
|
34
34
|
import type { DataFnProvider } from "../modal";
|
|
35
35
|
import type { ColProps } from "antd/lib/grid/col";
|
|
36
|
+
import {Gutter} from "antd/lib/grid/row";
|
|
36
37
|
|
|
37
38
|
type RenderFun = (
|
|
38
39
|
props: HItemProps,
|
|
@@ -103,6 +104,7 @@ export interface HFormProps<T = any, R = any>
|
|
|
103
104
|
onFinish?: (values: T, params?: any) => void;
|
|
104
105
|
itemSpan?: ColProps;
|
|
105
106
|
hideLabel?: boolean;
|
|
107
|
+
gutter?: Gutter | [Gutter, Gutter];
|
|
106
108
|
}
|
|
107
109
|
export interface HFormItemProps extends HItemProps {
|
|
108
110
|
required?: boolean;
|