forked from alibaba/lowcode-materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeta.ts
More file actions
251 lines (250 loc) · 5.76 KB
/
meta.ts
File metadata and controls
251 lines (250 loc) · 5.76 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
import snippets from './snippets';
export default {
group: '原子组件',
componentName: 'Button',
title: '按钮',
icon: 'https://img.alicdn.com/tfs/TB1rT0gPQL0gK0jSZFAXXcA9pXa-200-200.svg',
docUrl: '',
screenshot: '',
npm: {
package: '@alifd/next',
version: '{{version}}',
exportName: 'Button',
main: '',
destructuring: true,
subName: '',
},
props: [
{
name: 'children',
title: '内容',
propType: 'string',
},
{
name: 'icon',
propType: 'string',
description: '自定义内联样式',
},
{
name: 'type',
title: {
label: {
type: 'i18n',
zh_CN: '按钮类型',
en_US: 'Button Type',
},
tip: {
type: 'i18n',
zh_CN: '属性: type | 说明: 按钮类型',
en_US: 'prop: type | description: button type',
},
},
propType: {
type: 'oneOf',
value: ['primary', 'secondary', 'normal'],
},
description: '按钮的类型',
defaultValue: 'normal',
},
{
name: 'size',
title: {
label: {
type: 'i18n',
zh_CN: '按钮尺寸',
en_US: 'Button Size',
},
tip: {
type: 'i18n',
zh_CN: '属性: size | 说明: 按钮尺寸',
en_US: 'prop: size | description: button size',
},
},
propType: {
type: 'oneOf',
value: ['small', 'medium', 'large'],
},
description: '按钮的尺寸',
defaultValue: 'medium',
},
{
name: 'iconSize',
title: {
label: {
type: 'i18n',
zh_CN: '图标尺寸',
en_US: 'Icon Size',
},
tip: {
type: 'i18n',
zh_CN: '属性: iconSize | 说明: 图标尺寸',
en_US: 'prop: iconSize | description: icon size',
},
},
propType: {
type: 'oneOf',
value: ['xxs', 'xs', 'small', 'medium', 'large', 'xl', 'xxl', 'xxxl'],
},
defaultValue: 'small',
description: '按钮中 Icon 的尺寸,用于替代 Icon 的默认大小',
},
{
name: 'ghost',
title: {
type: 'i18n',
zh_CN: '幽灵按钮',
en_US: 'ghost',
},
propType: {
type: 'oneOf',
value: [true, false, 'light', 'dark'],
},
description: '是否为幽灵按钮',
defaultValue: false,
},
{
name: 'loading',
title: 'loading',
propType: 'bool',
description: '设置按钮的载入状态',
defaultValue: false,
},
{
name: 'text',
title: {
type: 'i18n',
zh_CN: '文本按钮',
en_US: 'text',
},
propType: 'bool',
description: '是否为文本按钮',
defaultValue: false,
},
{
name: 'warning',
title: 'warning',
propType: 'bool',
description: '是否为警告按钮',
defaultValue: false,
},
{
name: 'disabled',
title: {
type: 'i18n',
zh_CN: '禁用',
en_US: 'disabled',
},
propType: 'bool',
description: '是否禁用',
defaultValue: false,
},
{
name: 'onClick',
title: 'onClick',
propType: 'func',
description: '点击按钮的回调\n@param {Object} e Event Object',
},
{
name: 'className',
propType: 'string',
},
{
name: 'onMouseUp',
propType: 'func',
},
{
name: 'style',
propType: 'object',
description: '自定义内联样式',
},
],
configure: {
props: {
isExtends: true,
override: [
{
name: 'icon',
title: {
label: {
type: 'i18n',
zh_CN: '图标',
en_US: 'Icon',
},
tip: {
type: 'i18n',
zh_CN: '属性: icon | 说明: 图标类型',
en_US: 'prop: icon | description: icon type',
},
},
setter: 'IconSetter',
supportVariable: true,
setValue: (target, value) => {
target.node.children.importSchema(
value && {
componentName: 'Icon',
props: { type: value, style: { marginRight: 5 } },
},
true,
);
},
},
{
name: 'ghost',
title: {
type: 'i18n',
zh_CN: '幽灵按钮',
en_US: 'ghost',
},
setter: {
componentName: 'RadioGroupSetter',
props: {
options: [
{
title: 'True',
value: true,
},
{
title: 'False',
value: false,
},
{
title: 'Light',
value: 'light',
},
{
title: 'Dark',
value: 'dark',
},
],
},
},
description: '是否为幽灵按钮',
defaultValue: false,
},
{
name: 'children',
title: {
label: {
type: 'i18n',
zh_CN: '按钮内容',
en_US: 'Content',
},
tip: {
type: 'i18n',
zh_CN: '属性: children | 说明: 按钮文本',
en_US: 'prop: children | description: button content',
},
},
setter: {
componentName: 'MixedSetter',
props: {
setters: ['StringSetter', 'ExpressionSetter'],
},
},
},
],
},
},
category: '通用',
snippets,
};