Skip to content

Commit 7db6a09

Browse files
authored
feat:add anchor component and icons (#1812)
* feat:add anchor component and icons * feat:icon * feat:icon color
1 parent fdad821 commit 7db6a09

15 files changed

Lines changed: 317 additions & 12 deletions

File tree

designer-demo/public/mock/bundle.json

Lines changed: 258 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,221 @@
33
"framework": "Vue",
44
"materials": {
55
"components": [
6+
{
7+
"version": "3.22.0",
8+
"name": {
9+
"zh_CN": "锚点"
10+
},
11+
"component": "TinyAnchor",
12+
"icon": "anchor",
13+
"description": "用于页内导航。",
14+
"docUrl": "",
15+
"screenshot": "",
16+
"tags": "",
17+
"keywords": "",
18+
"devMode": "proCode",
19+
"npm": {
20+
"package": "@opentiny/vue",
21+
"exportName": "TinyAnchor",
22+
"destructuring": true
23+
},
24+
"group": "component",
25+
"category": "锚点",
26+
"priority": 2,
27+
"schema": {
28+
"properties": [
29+
{
30+
"name": "0",
31+
"label": {
32+
"zh_CN": "基础属性"
33+
},
34+
"content": [
35+
{
36+
"cols": 12,
37+
"type": "string",
38+
"label": {
39+
"text": {
40+
"zh_CN": "容器id"
41+
}
42+
},
43+
"widget": {
44+
"props": {
45+
"placeholder": "请输入..."
46+
},
47+
"component": "InputConfigurator"
48+
},
49+
"disabled": false,
50+
"property": "container-id",
51+
"readOnly": false,
52+
"required": false,
53+
"description": "用于单页面 hash 路由模式时指定滚动容器的 id 值,id 为空时则滚动容器默认为 HTML 文档的根节点 body 元素",
54+
"defaultValue": "",
55+
"labelPosition": "left"
56+
},
57+
{
58+
"cols": 12,
59+
"type": "string",
60+
"label": {
61+
"text": {
62+
"zh_CN": "元素类名"
63+
}
64+
},
65+
"widget": {
66+
"props": {
67+
"placeholder": "请输入..."
68+
},
69+
"component": "InputConfigurator"
70+
},
71+
"disabled": false,
72+
"property": "mark-class",
73+
"readOnly": false,
74+
"required": false,
75+
"description": "自定义滚动的目标元素类名",
76+
"defaultValue": "",
77+
"labelPosition": "left"
78+
},
79+
{
80+
"property": "offset-top",
81+
"label": {
82+
"text": {
83+
"zh_CN": "顶部偏移量"
84+
}
85+
},
86+
"required": true,
87+
"readOnly": false,
88+
"disabled": false,
89+
"cols": 12,
90+
"widget": {
91+
"component": "NumberConfigurator",
92+
"props": {}
93+
},
94+
"description": {
95+
"zh_CN": "锚点距离顶部的偏移量,用于调整滚动定位的位置"
96+
},
97+
"labelPosition": "left"
98+
},
99+
{
100+
"property": "is-affix",
101+
"label": {
102+
"text": {
103+
"zh_CN": "固定模式"
104+
}
105+
},
106+
"description": {
107+
"zh_CN": ""
108+
},
109+
"required": true,
110+
"readOnly": false,
111+
"disabled": false,
112+
"cols": 12,
113+
"labelPosition": "left",
114+
"type": "boolean",
115+
"defaultValue": true,
116+
"widget": {
117+
"component": "CheckBoxConfigurator",
118+
"props": {}
119+
}
120+
},
121+
{
122+
"cols": 12,
123+
"type": "string",
124+
"label": {
125+
"text": {
126+
"zh_CN": "类型"
127+
}
128+
},
129+
"widget": {
130+
"props": {
131+
"options": [
132+
{
133+
"label": "line",
134+
"value": "line"
135+
},
136+
{
137+
"label": "dot",
138+
"value": "dot"
139+
}
140+
]
141+
},
142+
"component": "SelectConfigurator"
143+
},
144+
"disabled": false,
145+
"property": "type",
146+
"readOnly": false,
147+
"required": false,
148+
"description": "锚点类型",
149+
"defaultValue": "line",
150+
"labelPosition": "left"
151+
},
152+
{
153+
"property": "links",
154+
"label": {
155+
"text": {
156+
"zh_CN": "选项数据"
157+
}
158+
},
159+
"required": true,
160+
"readOnly": false,
161+
"disabled": false,
162+
"cols": 12,
163+
"widget": {
164+
"component": "CodeConfigurator",
165+
"props": {
166+
"language": "json"
167+
}
168+
},
169+
"description": {
170+
"zh_CN": "导航数据配置项,可通过 children 嵌套"
171+
},
172+
"labelPosition": "top"
173+
}
174+
],
175+
"description": {
176+
"zh_CN": ""
177+
}
178+
}
179+
],
180+
"events": {},
181+
"slots": {
182+
"default": {
183+
"label": {
184+
"zh_CN": "默认插槽"
185+
},
186+
"description": {
187+
"zh_CN": ""
188+
}
189+
}
190+
}
191+
},
192+
"configure": {
193+
"loop": true,
194+
"condition": true,
195+
"styles": true,
196+
"isContainer": false,
197+
"isModal": false,
198+
"nestingRule": {
199+
"childWhitelist": "",
200+
"parentWhitelist": "",
201+
"descendantBlacklist": "",
202+
"ancestorWhitelist": ""
203+
},
204+
"isNullNode": false,
205+
"isLayout": false,
206+
"rootSelector": "",
207+
"shortcuts": {
208+
"properties": []
209+
},
210+
"contextMenu": {
211+
"actions": [
212+
"create symbol"
213+
],
214+
"disable": [
215+
"copy",
216+
"remove"
217+
]
218+
}
219+
}
220+
},
6221
{
7222
"version": "3.22.0",
8223
"name": {
@@ -850,7 +1065,7 @@
8501065
"zh_CN": "动作菜单"
8511066
},
8521067
"component": "TinyActionMenu",
853-
"icon": "dropdown",
1068+
"icon": "action-menu",
8541069
"description": "动作菜单",
8551070
"docUrl": "",
8561071
"screenshot": "",
@@ -28188,7 +28403,7 @@
2818828403
"name": {
2818928404
"zh_CN": "动作菜单"
2819028405
},
28191-
"icon": "dropdown",
28406+
"icon": "action-menu",
2819228407
"screenshot": "",
2819328408
"snippetName": "TinyActionMenu",
2819428409
"schema": {
@@ -28223,6 +28438,47 @@
2822328438
]
2822428439
}
2822528440
}
28441+
},
28442+
{
28443+
"name": {
28444+
"zh_CN": "锚点"
28445+
},
28446+
"icon": "anchor",
28447+
"screenshot": "",
28448+
"snippetName": "TinyAnchor",
28449+
"schema": {
28450+
"componentName": "TinyAnchor",
28451+
"props": {
28452+
"links": [
28453+
{
28454+
"key": "basic-usage",
28455+
"link": "#basic-usage",
28456+
"title": "基本用法"
28457+
},
28458+
{
28459+
"key": "is-affix",
28460+
"link": "#is-affix",
28461+
"title": "固定模式"
28462+
},
28463+
{
28464+
"key": "set-container",
28465+
"link": "#set-container",
28466+
"title": "滚动容器"
28467+
},
28468+
{
28469+
"key": "offset-top",
28470+
"link": "#offset-top",
28471+
"title": "顶部偏移量"
28472+
},
28473+
{
28474+
"key": "on-change",
28475+
"link": "#change",
28476+
"title": "change 事件"
28477+
}
28478+
],
28479+
"type": "dot"
28480+
}
28481+
}
2822628482
}
2822728483
]
2822828484
},

mockServer/src/mock/get/app-center/v1/apps/schema/1.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,13 @@
21762176
"destructuring": true,
21772177
"version": "3.22.0"
21782178
},
2179+
{
2180+
"componentName": "TinyAnchor",
2181+
"package": "@opentiny/vue",
2182+
"exportName": "TinyAnchor",
2183+
"destructuring": true,
2184+
"version": "3.22.0"
2185+
},
21792186
{
21802187
"componentName": "TinyHuichartsFunnel",
21812188
"package": "@opentiny/vue-huicharts",

mockServer/src/mock/get/app-center/v1/apps/schema/16.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,13 @@
12061206
"destructuring": true,
12071207
"version": "3.22.0"
12081208
},
1209+
{
1210+
"componentName": "TinyAnchor",
1211+
"package": "@opentiny/vue",
1212+
"exportName": "TinyAnchor",
1213+
"destructuring": true,
1214+
"version": "3.22.0"
1215+
},
12091216
{
12101217
"componentName": "TinyHuichartsFunnel",
12111218
"package": "@opentiny/vue-huicharts",
Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)