-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
3,239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
const props = [ | ||
{ | ||
name: 'title', | ||
title: { label: '标题', tip: 'title | 标题' }, | ||
setter: 'StringSetter', | ||
}, | ||
{ | ||
name: 'code', | ||
title: { label: '字段名', tip: 'key | 字段名' }, | ||
setter: 'StringSetter', | ||
}, | ||
{ | ||
name: 'defaultValue', | ||
title: { label: '默认值', tip: 'defaultValue | 默认值'}, | ||
setter: 'StringSetter' | ||
}, | ||
{ | ||
name: 'props.placeholder', | ||
title: { label: '提示文案', tip: 'placeholder | 提示文案' }, | ||
setter: 'StringSetter' | ||
}, | ||
{ | ||
name: 'description', | ||
title: { label: '补充说明', tip: 'description | 补充说明' }, | ||
setter: 'StringSetter', | ||
}, | ||
{ | ||
name: 'tooltip.title', | ||
title: { label: '气泡提示', tip: 'tooltip.title | 气泡提示文案' }, | ||
setter: 'StringSetter', | ||
}, | ||
{ | ||
name: 'extra', | ||
title: { label: '额外提示', tip: 'extra | 额外的提示信息'}, | ||
setter: 'StringSetter' | ||
}, | ||
{ | ||
name: 'disabled', | ||
title: { label: '禁用', tip: 'disabled | 禁用' }, | ||
setter: 'FrExpressionSetter' | ||
}, | ||
{ | ||
name: 'hidden', | ||
title: { label: '隐藏', tip: 'hidden | 隐藏' }, | ||
setter: 'FrExpressionSetter' | ||
}, | ||
{ | ||
name: 'readOnly', | ||
title: { label: '只读', tip: 'readOnly | 只读' }, | ||
setter: 'FrExpressionSetter' | ||
}, | ||
{ | ||
name: 'readOnlyWidget', | ||
title: { label: '只读组件', tip: 'readOnlyWidget | 只读组件' }, | ||
setter: 'StringSetter', | ||
condition: (target: any) => !!target.getProps().getPropValue('readOnly') | ||
} | ||
]; | ||
|
||
export const formItemProps = [ | ||
{ | ||
title: '基础配置', | ||
display: 'accordion', | ||
type: 'group', | ||
items: props | ||
} | ||
]; | ||
|
||
const meta = { | ||
componentName: 'FormItem', | ||
title: '高级表单项', | ||
docUrl: '', | ||
screenshot: '', | ||
devMode: 'proCode', | ||
npm: { | ||
package: '@ali/form-render-material', | ||
version: '0.0.1', | ||
exportName: 'FormItem', | ||
main: 'src/index.tsx', | ||
destructuring: true, | ||
subName: '', | ||
}, | ||
category: '表单容器', | ||
group: '基础组件', | ||
props: formItemProps, | ||
configure: { | ||
supports: { | ||
className: true, | ||
style: true, | ||
events: [ | ||
{ | ||
name: 'onRefresh', | ||
description: '点击点击刷新的回调 ', | ||
template: 'function onRefresh(){}', | ||
}, | ||
], | ||
}, | ||
component: { | ||
isContainer: true, | ||
isModal: false, | ||
isMinimalRenderUnit: true, | ||
}, | ||
}, | ||
}; | ||
|
||
export default { | ||
...meta, | ||
icon: 'https://img.alicdn.com/imgextra/i4/O1CN01gxzRdT1hm9KXRbZkU_!!6000000004319-2-tps-200-200.png', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// 常用组件配置 | ||
export { default as input } from './meta/input'; | ||
export { default as number } from './meta/number'; | ||
export { default as select } from './meta/select'; | ||
export { default as radio } from './meta/radio'; | ||
export { default as checkbox } from './meta/checkbox'; | ||
export { default as checkboxes } from './meta/checkboxes'; | ||
export { default as textarea } from './meta/textarea'; | ||
export { default as datePicker } from './meta/date'; | ||
export { default as dateRange } from './meta/dateRange'; | ||
export { default as timePicker } from './meta/time'; | ||
export { default as timeRange } from './meta/timeRange'; | ||
|
||
// 其他组件配置 | ||
export { default as rate } from './meta/rate'; | ||
export { default as _switch } from './meta/switch'; | ||
export { default as slider } from './meta/slider'; | ||
export { default as treeSelect } from './meta/treeSelect'; | ||
export { default as cascader } from './meta/cascader'; | ||
|
||
// 自定义组件配置 | ||
export { default as color } from './meta/color'; | ||
export { default as imageInput } from './meta/imageInput'; | ||
export { default as urlInput } from './meta/urlInput'; | ||
export { default as html } from './meta/html'; | ||
// export { default as upload } from './meta/upload'; | ||
|
||
|
||
// 容器组件配置 | ||
export { default as form } from './meta/form'; | ||
export { default as card } from './meta/card'; | ||
export { default as cardList } from './meta/cardList'; | ||
|
119 changes: 119 additions & 0 deletions
119
tools/schema-builder/src/materails/settings/meta/card.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import { createMeta } from '../utils'; | ||
|
||
const props: any = [ | ||
{ | ||
name: 'title', | ||
title: { label: '标题', tip: 'title | 卡片主题' }, | ||
setter: 'StringSetter' | ||
}, | ||
{ | ||
name: 'code', | ||
title: { label: '字段名', tip: 'key | 字段名' }, | ||
setter: 'StringSetter', | ||
}, | ||
{ | ||
name: 'description', | ||
title: { label: '描述', tip: 'description | 卡片的描述' }, | ||
setter: 'StringSetter' | ||
}, | ||
{ | ||
name: 'column', | ||
title: { | ||
label: '一行多列', | ||
tip: 'column | 表单内容分成几列展示', | ||
}, | ||
defaultValue: 1, | ||
setter: { | ||
componentName: 'RadioGroupSetter', | ||
props: { | ||
options: [ | ||
{ | ||
title: '一列', | ||
value: 1, | ||
}, | ||
{ | ||
title: '两列', | ||
value: 2, | ||
}, | ||
{ | ||
title: '三列', | ||
value: 3, | ||
}, | ||
{ | ||
title: '四列', | ||
value: 4 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
name: 'widget', | ||
title: { | ||
label: '类型', | ||
tip: 'widget | 类型', | ||
}, | ||
defaultValue: 1, | ||
setter: { | ||
componentName: 'RadioGroupSetter', | ||
props: { | ||
options: [ | ||
{ | ||
title: '卡片', | ||
value: 'card', | ||
}, | ||
{ | ||
title: '折叠面板', | ||
value: 'collapse', | ||
}, | ||
{ | ||
title: '标题线', | ||
value: 'lineTitle', | ||
}, | ||
{ | ||
title: '内联', | ||
value: 'subInline' | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
]; | ||
|
||
const snippets = [ | ||
{ | ||
title: '对象', | ||
screenshot: 'icon-object', | ||
schema: { | ||
componentName: 'Card', | ||
props: { | ||
title: '卡片主题', | ||
description: '这是一个对象类型', | ||
column: 3, | ||
type: 'object', | ||
widget: 'collapse' | ||
} | ||
} | ||
} | ||
] | ||
|
||
export default createMeta('Card', { | ||
title: '对象', | ||
category: '布局', | ||
group: '基础组件', | ||
props, | ||
snippets, | ||
configure: { | ||
supports: { | ||
loop: false, | ||
condition: false | ||
}, | ||
component: { | ||
isContainer: true, | ||
isModal: false, | ||
nestingRule: { | ||
parentWhitelist: ['FormRender', 'Card', 'CardList'] | ||
} | ||
} | ||
} | ||
}); |
Oops, something went wrong.