@flatbiz/antd
Version:
53 lines (49 loc) • 1.88 kB
JavaScript
/*! @flatjs/forge MIT @flatbiz/antd */
import { _ as _objectWithoutProperties } from './_rollupPluginBabelHelpers-BYm17lo8.js';
import { Form } from 'antd';
import { jsx } from 'react/jsx-runtime';
var _excluded = ["dependencies"];
/**
* FormItem依赖写法包装,当处在EasyForm内部时,不支持 <Form.Item dependencies={['xxx']} noStyle /> 此写法,使用 <FormItemWrapperDependencies dependencies={['xxx']} /> 代替
*
* ```
* 例如:(其中 otherProps 中 style、className透传是必要的)
* <FormItemWrapperDependencies dependencies={['xx2']}>
* {(_form, otherProps) => {
* return (
* <FormItemWrapper
* name="xxxxx"
* label="xx1"
* style={otherProps.style}
* className={otherProps.className}
* >
* <Input />
* </FormItemWrapper>
* );
* }}
* </FormItemWrapperDependencies>
*
*
* 说明:
* 透传style、className 是因为在EasyForm内部的BoxGrid组件下发的style、className在配置了noStyle后Form.Item不接收导致的
*
* ```
*/
var FormItemWrapperDependencies = function FormItemWrapperDependencies(props) {
var dependencies = props.dependencies,
otherProps = _objectWithoutProperties(props, _excluded);
return /*#__PURE__*/jsx(Form.Item, {
dependencies: dependencies,
noStyle: true,
children: function children(form) {
var _props$children;
return (_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.call(props, form, {
style: otherProps === null || otherProps === void 0 ? void 0 : otherProps.style,
className: otherProps.className
});
}
});
};
FormItemWrapperDependencies['domTypeName'] = 'FormItemWrapperDependencies';
export { FormItemWrapperDependencies as F };
//# sourceMappingURL=dependencies-BNYRlfAK.js.map