@ywfe/materials-design
Version:
YwDesign for lowcode
120 lines (117 loc) • 3.19 kB
text/typescript
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { hideProp } from '../_utils';
import { IPublicTypeSnippetMore } from '../_base';
const YwCategroySelectMeta: IPublicTypeComponentMetadata = {
componentName: 'YwCategorySelect',
title: '类目选择器',
docUrl: '',
screenshot: '',
devMode: 'proCode',
group: '基础组件',
category: '表单',
npm: {
package: '@ywfe/materials-design',
version: '0.1.0',
exportName: 'YwCategorySelect',
main: 'src/index.tsx',
destructuring: true,
subName: '',
},
configure: {
props: [
{
title: {
label: '组件唯一标识',
tip: '_flag | 组件唯一标识',
},
condition: hideProp,
name: '_flag',
description: '组件唯一标识',
setter: {
componentName: 'StringSetter',
isRequired: true,
initialValue: '',
},
},
{
title: {
label: '选择后回调',
tip: 'onChange | 选择后回调',
},
name: 'onChange',
description: '选择后回调',
supportVariable: false,
setter: {
componentName: 'MixedSetter',
props: {
setters: [
{
componentName: 'SchemaFunctionSetter',
props: {
title: 'onChange',
async: false,
properties: {
input: {
type: 'object',
properties: {
value: {
type: 'string',
},
},
required: ['value'],
},
body: {
type: 'array',
items: [
{
type: 'Function',
properties: {
template: 'SetStateFunction',
extraProps: {
state: 'categoryNoPathList',
value: '{{value}}',
},
},
},
],
},
},
required: ['body'],
},
},
{
componentName: 'FunctionSetter',
props: {
template:
'function onClick() {\n this.setState({\n isShowDialog: true\n });\n}',
},
},
],
},
},
},
],
supports: {
style: true,
className: true,
},
component: {
isContainer: false,
},
},
};
const snippets: IPublicTypeSnippetMore[] = [
{
title: '类目选择',
svgId: 'icon-leimuxuanze',
screenshot: 'https://yw-fed-static.oss-cn-hangzhou.aliyuncs.com/诗橙/导出.png',
schema: {
componentName: 'YwCategorySelect',
props: {},
},
},
];
export default {
...YwCategroySelectMeta,
snippets,
};