UNPKG

@ywfe/materials-design

Version:
124 lines (121 loc) 3.37 kB
// import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types'; import { uuid } from '../_utils'; import { IComponentDescription, ISnippet } from '../types'; import { default as props } from './common/props'; const snippets: ISnippet[] = [ { title: '通用表单', svgId: 'toolbox-page-form', screenshot: 'https://img.alicdn.com/imgextra/i2/O1CN016gn5DQ1FeXUNKdK22_!!6000000000512-55-tps-50-36.svg', schema: { componentName: 'YwJsonForm', title: 'YwJsonForm', props: { style: { width: '100%', }, items: [ { component: 'Input', primaryKey: `input_${uuid()}`, label: '表单项', size: 'medium', title: '表单项', name: uuid(), }, ], }, }, }, ]; const YwJsonFormMeta: IComponentDescription[] = [ { componentName: 'YwJsonForm', title: 'YwJsonForm', docUrl: '', screenshot: '', devMode: 'proCode', group: '基础组件', category: '表单', npm: { package: '@ywfe/materials-design', version: '0.0.1', exportName: 'YwJsonForm', main: 'src/index.tsx', destructuring: true, subName: '', }, configure: { component: { isContainer: true, isMinimalRenderUnit: true, nestingRule: { childWhitelist: new RegExp('form.*', 'i'), }, }, supports: { style: true, events: ['onCreate', 'onSubmit', 'onReset'], loop: false, }, props, }, snippets, }, // { // componentName: 'ProFormItem', // title: '表单项', // docUrl: '', // screenshot: // 'https://img.alicdn.com/imgextra/i2/O1CN016gn5DQ1FeXUNKdK22_!!6000000000512-55-tps-50-36.svg', // icon: 'https://img.alicdn.com/imgextra/i2/O1CN016gn5DQ1FeXUNKdK22_!!6000000000512-55-tps-50-36.svg', // devMode: 'proCode', // npm: { // package: '@alifd/fusion-ui', // version: '0.1.4', // exportName: 'ProForm', // main: 'lib/index.js', // destructuring: true, // subName: 'Item', // }, // configure: { // component: { // disableBehaviors: ['copy'], // nestingRule: { // parentWhitelist: ['ProForm'], // }, // }, // props: FormItemProps, // supports: { // style: true, // events: ['onPressEnter', 'onClear', 'onChange', 'onKeyDown', 'onFocus', 'onBlur'], // }, // advanced: { // initialChildren: [ // { // componentName: 'Input', // props: { // hasBorder: true, // size: 'medium', // autoComplete: 'off', // }, // }, // ], // callbacks: { // onNodeRemove: (removedNode, currentNode) => { // if (!removedNode || !currentNode) { // return; // } // const { children } = currentNode; // // 若无 children,则说明当前 P 组件内已为空,需要删除 FormItem 组件本身 // if (children && children.isEmptyNode) { // currentNode.remove(); // } // }, // }, // }, // }, // }, ]; export default [...YwJsonFormMeta];