feat: markdown field
This commit is contained in:
parent
ed296cfc5f
commit
122f6bfdb7
11
packages/app/src/components/form.fields/markdown/index.tsx
Normal file
11
packages/app/src/components/form.fields/markdown/index.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { connect } from '@formily/react-schema-renderer'
|
||||||
|
import React from 'react';
|
||||||
|
import { Input as AntdInput } from 'antd'
|
||||||
|
import { acceptEnum, mapStyledProps, mapTextComponent } from '../shared'
|
||||||
|
|
||||||
|
export const Markdown = connect({
|
||||||
|
getProps: mapStyledProps,
|
||||||
|
getComponent: mapTextComponent
|
||||||
|
})(acceptEnum((props) => <AntdInput.TextArea autoSize={{minRows: 2, maxRows: 12}} {...props}/>))
|
||||||
|
|
||||||
|
export default Markdown
|
@ -25,6 +25,7 @@ import { DraggableTable } from './draggable-table'
|
|||||||
import { Values } from './values'
|
import { Values } from './values'
|
||||||
import { Automations } from './automations'
|
import { Automations } from './automations'
|
||||||
import { Wysiwyg } from './wysiwyg'
|
import { Wysiwyg } from './wysiwyg'
|
||||||
|
import { Markdown } from './markdown'
|
||||||
|
|
||||||
export const setup = () => {
|
export const setup = () => {
|
||||||
registerFormFields({
|
registerFormFields({
|
||||||
@ -63,6 +64,7 @@ export const setup = () => {
|
|||||||
draggableTable: DraggableTable,
|
draggableTable: DraggableTable,
|
||||||
values: Values,
|
values: Values,
|
||||||
wysiwyg: Wysiwyg,
|
wysiwyg: Wysiwyg,
|
||||||
|
markdown: Markdown,
|
||||||
'permissions.actions': Permissions.Actions,
|
'permissions.actions': Permissions.Actions,
|
||||||
'permissions.fields': Permissions.Fields,
|
'permissions.fields': Permissions.Fields,
|
||||||
'permissions.tabs': Permissions.Tabs,
|
'permissions.tabs': Permissions.Tabs,
|
||||||
|
@ -98,6 +98,19 @@ export const percent = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const markdown = {
|
||||||
|
title: 'Markdown',
|
||||||
|
group: 'media',
|
||||||
|
options: {
|
||||||
|
interface: 'markdown',
|
||||||
|
type: 'json',
|
||||||
|
component: {
|
||||||
|
type: 'markdown',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export const wysiwyg = {
|
export const wysiwyg = {
|
||||||
title: '可视化编辑器',
|
title: '可视化编辑器',
|
||||||
group: 'media',
|
group: 'media',
|
||||||
|
Loading…
Reference in New Issue
Block a user