forked from alibaba/lowcode-materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnippets.ts
More file actions
101 lines (96 loc) · 2.34 KB
/
snippets.ts
File metadata and controls
101 lines (96 loc) · 2.34 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
import { getDataFromPlainText } from '../split-button/adaptor';
const plainData = 'Edit Document\n\tUndo\n\tRedo\n\tCut\n\tCopy\n\tPaste';
const { label, children, selectedKeys } = getDataFromPlainText(plainData);
const splitButtonProps = {
prefix: 'next-',
type: 'normal',
size: 'medium',
label: label,
defaultSelectedKeys: [],
autoWidth: true,
popupTriggerType: 'click',
plainData,
};
if (selectedKeys && selectedKeys.length) {
splitButtonProps.selectedKeys = selectedKeys;
}
const menuButtonProps = splitButtonProps;
const snippets = [
{
title: '按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_button.png',
schema: {
componentName: 'Button',
props: {
prefix: 'next-',
type: 'primary',
size: 'medium',
htmlType: 'button',
component: 'button',
children: '取消',
},
},
},
{
title: '分隔按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_split-button.png',
schema: {
componentName: 'SplitButton',
props: splitButtonProps,
children,
},
},
{
title: '菜单按钮',
screenshot:
'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_split-button.png',
schema: {
componentName: 'MenuButton',
props: menuButtonProps,
children,
},
},
{
title: '按钮组',
screenshot: 'https://img.alicdn.com/tfs/TB1t6dhvV67gK0jSZPfXXahhFXa-310-122.png',
schema: {
componentName: 'Button.Group',
props: {},
children: [
{
componentName: 'Button',
props: {
type: 'primary',
style: {
margin: '0 5px 0 5px',
},
htmlType: 'submit',
children: '提交',
},
children: [
{
componentName: 'Icon',
props: {
type: 'success',
},
},
],
},
{
componentName: 'Button',
props: {
type: 'normal',
style: {
margin: '0 5px 0 5px',
},
htmlType: 'reset',
children: '重置',
},
},
],
},
},
];
export default snippets;