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
178 lines (177 loc) · 4.04 KB
/
meta.design.ts
File metadata and controls
178 lines (177 loc) · 4.04 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import snippets from './snippets.design';
import { getDataFromPlainText } from './adaptor';
export default {
group: '原子组件',
componentName: 'Menu',
title: '菜单',
docUrl: '',
screenshot: '',
npm: {
package: '@alifd/next',
version: '{{version}}',
exportName: 'Menu',
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: '!mode',
title: '模式',
setValue: (target, value) => {
const parentTarget = target.parent;
switch (value) {
case 'single':
parentTarget.setPropValue('selectMode', 'single');
break;
case 'multiple':
parentTarget.setPropValue('selectMode', 'multiple');
break;
case 'arrowLeft':
parentTarget.setPropValue('isSelectIconRight', false);
break;
case 'arrowRight':
parentTarget.setPropValue('isSelectIconRight', true);
break;
default:
break;
}
},
setter: {
componentName: 'SelectSetter',
props: {
options: [
{
title: '单选框',
value: 'single',
},
{
title: '复选框',
value: 'multiple',
},
{
title: '箭头在左',
value: 'arrowLeft',
},
{
title: '箭头在右',
value: 'arrowRight',
},
],
},
},
defaultValue: 'single',
},
{
name: 'mode',
setter: {
componentName: 'RadioGroupSetter',
props: {
options: [
{
label: '内联',
value: 'inline',
},
{
label: '弹出',
value: 'popup',
},
],
},
},
title: '子菜单模式',
defaultValue: 'inline',
},
{
name: 'style.width',
title: '宽度',
setter: 'NumberSetter',
},
{
name: 'plainData',
display: 'block',
title: '内容',
tip: {
title: '数据格式',
url: '',
},
setValue: (target, value) => {
const { children, selectedKeys } = getDataFromPlainText(value);
if (children) {
target.node.children.importSchema(children);
}
if (selectedKeys) {
target.parent.setPropValue('selectedKeys', selectedKeys);
}
},
setter: {
componentName: 'MagicEditorSetter',
props: {
toolbar: ['normal', 'active', 'disable'],
disableIcon: true,
},
},
},
],
},
icon: '',
category: '信息输入',
snippets,
};