feat(client): add Space
schema component
This commit is contained in:
parent
f8863959b5
commit
451f706b46
@ -24,6 +24,7 @@ export * from './radio';
|
|||||||
export * from './record-picker';
|
export * from './record-picker';
|
||||||
export * from './row-selection';
|
export * from './row-selection';
|
||||||
export * from './select';
|
export * from './select';
|
||||||
|
export * from './space';
|
||||||
export * from './tabs';
|
export * from './tabs';
|
||||||
export * from './time-picker';
|
export * from './time-picker';
|
||||||
export * from './tree-select';
|
export * from './tree-select';
|
||||||
|
18
packages/client/src/schema-component/antd/space/index.tsx
Normal file
18
packages/client/src/schema-component/antd/space/index.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { useFormLayout } from '@formily/antd';
|
||||||
|
import { Divider, Space as AntdSpace, SpaceProps } from 'antd';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export const Space: React.FC<SpaceProps> = (props) => {
|
||||||
|
let { split } = props;
|
||||||
|
if (split === '|') {
|
||||||
|
split = <Divider type="vertical" />;
|
||||||
|
}
|
||||||
|
const layout = useFormLayout();
|
||||||
|
return React.createElement(AntdSpace, {
|
||||||
|
size: props.size ?? layout?.spaceGap,
|
||||||
|
...props,
|
||||||
|
split,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Space;
|
Loading…
Reference in New Issue
Block a user