forked from alibaba/lowcode-materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeta.design.ts
More file actions
142 lines (141 loc) · 3.26 KB
/
meta.design.ts
File metadata and controls
142 lines (141 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import snippets from './snippets.design';
import parseData from '../utils/parse-data';
export default {
group: '原子组件',
componentName: 'Collapse',
title: '折叠面板',
docUrl: '',
screenshot: '',
npm: {
package: '@ali/ali-lowcode-materials',
version: 'latest',
exportName: 'Collapse',
main: '',
destructuring: true,
subName: '',
},
props: [
{
name: 'dataSource',
propType: 'array',
description: '使用数据模型构建',
},
{
name: 'defaultExpandedKeys',
propType: {
type: 'arrayOf',
value: 'string',
},
description: '默认展开keys',
},
{
name: 'expandedKeys',
propType: {
type: 'arrayOf',
value: 'string',
},
description: '受控展开keys',
},
{
name: 'onExpand',
propType: 'func',
description: '展开状态发升变化时候的回调',
},
{
name: 'disabled',
propType: 'bool',
description: '所有禁用',
},
{
name: 'className',
propType: 'string',
description: '扩展class',
},
{
name: 'style',
propType: 'object',
description: '组件接受行内样式',
},
{
name: 'accordion',
propType: 'bool',
description: '手风琴模式,一次只能打开一个',
defaultValue: false,
},
{
name: 'rtl',
propType: 'bool',
},
],
configure: {
component: {
isContainer: true,
},
props: [
{
name: 'disabled',
title: {
label: '状态',
tip: 'disabled | 是否禁用',
},
setter: {
componentName: 'RadioGroupSetter',
props: {
options: [
{
label: '普通',
value: false,
},
{
label: '禁用',
value: true,
},
],
},
},
defaultValue: false,
},
{
name: 'style.width',
title: '宽度',
setter: 'NumberSetter',
},
{
name: 'plainData',
display: 'block',
title: '内容',
tip: {
title: '数据格式',
url: '',
},
setValue: (target, value) => {
const list = parseData(value).filter((node) => 'node' === node.type);
const defaultExpandedKeys: any[] = [];
const dataSource = list.map((item, index) => {
if (item.state === 'active') {
defaultExpandedKeys.push(`panel_${index}`);
}
return {
key: `panel_${index}`,
title: item.value,
content: item.children.map(({ type, value }) => (type === 'node' ? value : '')),
disabled: item.state === 'disabled',
};
});
target.parent.setPropValue('defaultExpandedKeys', defaultExpandedKeys);
target.parent.setPropValue('dataSource', dataSource);
},
setter: {
componentName: 'MagicEditorSetter',
props: {
toolbar: ['normal', 'active', 'disable'],
disableIcon: true,
},
},
},
],
},
icon: '',
category: '信息展示',
snippets,
};