2022-02-22 11:17:24 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
import { SchemaInitializer } from '../SchemaInitializer';
|
|
|
|
import { gridRowColWrap, useFormItemInitializerFields } from './utils';
|
|
|
|
|
|
|
|
// Grid 组件里配置字段
|
|
|
|
export const GridFormItemInitializers = (props: any) => {
|
|
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
|
|
<SchemaInitializer.Button
|
|
|
|
wrap={gridRowColWrap}
|
|
|
|
items={[
|
|
|
|
{
|
|
|
|
type: 'itemGroup',
|
2022-02-24 00:04:41 +08:00
|
|
|
title: t('Display fields'),
|
2022-02-22 11:17:24 +08:00
|
|
|
children: useFormItemInitializerFields(),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'divider',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'item',
|
2022-02-24 00:04:41 +08:00
|
|
|
title: t('Add text'),
|
2022-02-22 11:17:24 +08:00
|
|
|
component: 'GeneralInitializer',
|
|
|
|
schema: {
|
|
|
|
type: 'void',
|
|
|
|
'x-editable': false,
|
|
|
|
'x-decorator': 'FormItem',
|
|
|
|
'x-designer': 'Markdown.Void.Designer',
|
|
|
|
'x-component': 'Markdown.Void',
|
|
|
|
'x-component-props': {
|
|
|
|
content: t('This is a demo text, **supports Markdown syntax**.'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
>
|
|
|
|
{t('Configure fields')}
|
|
|
|
</SchemaInitializer.Button>
|
|
|
|
);
|
|
|
|
};
|