@mi-avalon/libs 0.0.28 → 0.0.29
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/dist/components/MForm/index.js +3 -3
- package/dist/components/MForm/type.d.ts +8 -0
- package/dist/index.es.js +220 -216
- package/dist/index.umd.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* 表单组件
|
|
4
4
|
*/
|
|
5
|
-
import { Col, Form, Row } from 'antd';
|
|
5
|
+
import { Col, Form, Row, Space } from 'antd';
|
|
6
6
|
import { getClassName } from '../../utils';
|
|
7
7
|
import { CompThemeProvider } from '../ThemeContext';
|
|
8
8
|
import './index.scss';
|
|
@@ -38,7 +38,7 @@ function MForm(props) {
|
|
|
38
38
|
...itemLayout,
|
|
39
39
|
...item.itemLayout,
|
|
40
40
|
};
|
|
41
|
-
return (_jsx(Col, { span: item.span || 24 / column, children:
|
|
41
|
+
return (_jsx(Col, { span: item.span || 24 / column, children: _jsxs(Space, { className: classname('item-wrapper'), children: [item.prefix, _jsx(Form.Item, { label: item.label, name: item.id, rules: rules, initialValue: item.initialValue, ...formItemLayout, ...item.formItemProps, children: renderItem(item, form) }), item.suffix] }) }, `col-${item.id}`));
|
|
42
42
|
};
|
|
43
43
|
return (_jsx(CompThemeProvider, { children: _jsx(Form, { form: form, ...formProps, className: `${classname()} ${formProps?.className}`, children: _jsx(Row, { gutter: MFormItemConst.defaultRowGutter, ...formRowProps, className: `${classname('grid')} ${formRowProps?.className}`, children: formItems.map(e => renderFormItem(e)) }) }) }));
|
|
44
44
|
}
|
|
@@ -112,6 +112,14 @@ export interface IMFormBaseItem {
|
|
|
112
112
|
* item组件的其他属性
|
|
113
113
|
*/
|
|
114
114
|
props?: any;
|
|
115
|
+
/**
|
|
116
|
+
* 前缀
|
|
117
|
+
*/
|
|
118
|
+
prefix?: React.ReactNode;
|
|
119
|
+
/**
|
|
120
|
+
* 后缀
|
|
121
|
+
*/
|
|
122
|
+
suffix?: React.ReactNode;
|
|
115
123
|
}
|
|
116
124
|
export interface IMFormInputItem extends IMFormBaseItem {
|
|
117
125
|
type: MFormItemTypeEnum.Input | MFormItemTypeEnum.Password;
|