@ywfe/materials-design
Version:
YwDesign for lowcode
89 lines (86 loc) • 2.02 kB
text/typescript
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { TableBaseProps } from '../_base';
const YwFormTableMeta: IPublicTypeComponentMetadata = {
componentName: 'YwFormTable',
title: 'YwFormTable',
docUrl: '',
screenshot: '',
devMode: 'proCode',
group: '基础组件',
category: '数据录入',
npm: {
package: '@ywfe/materials-design',
version: '0.1.0',
exportName: 'YwFormTable',
main: 'src/index.tsx',
destructuring: true,
subName: '',
},
configure: {
props: [...TableBaseProps],
supports: {
style: true,
events: [],
loop: false,
},
},
};
const snippets: IPublicTypeSnippet[] = [
{
title: '表单表格',
screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/lowcode/filterTable',
schema: {
componentName: 'YwFormTable',
props: {
dataSource: [
{
id: 1,
title: '123',
count: 3,
unitAmount: '13.00',
minNumber: 2,
maxNumber: 3,
},
{
id: 2,
title: '123',
count: 5,
unitAmount: '16.00',
minNumber: 4,
maxNumber: 7,
},
],
columns: [
{
title: '采购数量',
dataIndex: 'count',
component: 'YwJsonForm',
width: 120,
componentProps: {
component: 'NumberPicker',
required: true,
},
},
{
title: '采购单价',
dataIndex: 'unitAmount',
component: 'YwJsonForm',
width: 120,
componentProps: {
component: 'NumberPicker',
required: true,
props: {
addonBefore: '¥',
},
},
},
],
rowKey: 'id',
},
},
},
];
export default {
...YwFormTableMeta,
snippets,
};