@easy-editor/materials-dashboard-scroll-list 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vite/plugins/vite-plugin-external-deps.ts +224 -0
- package/.vite/plugins/vite-plugin-material-dev.ts +218 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +9 -0
- package/dist/component.esm.js +176 -0
- package/dist/component.esm.js.map +1 -0
- package/dist/component.js +185 -0
- package/dist/component.js.map +1 -0
- package/dist/component.min.js +2 -0
- package/dist/component.min.js.map +1 -0
- package/dist/index.cjs +669 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +666 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +674 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/meta.esm.js +494 -0
- package/dist/meta.esm.js.map +1 -0
- package/dist/meta.js +505 -0
- package/dist/meta.js.map +1 -0
- package/dist/meta.min.js +2 -0
- package/dist/meta.min.js.map +1 -0
- package/dist/src/component.d.ts +51 -0
- package/dist/src/configure.d.ts +7 -0
- package/dist/src/constants.d.ts +16 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/meta.d.ts +7 -0
- package/dist/src/snippets.d.ts +7 -0
- package/package.json +65 -0
- package/rollup.config.js +222 -0
- package/src/component.module.css +184 -0
- package/src/component.tsx +189 -0
- package/src/configure.ts +439 -0
- package/src/constants.ts +18 -0
- package/src/index.tsx +7 -0
- package/src/meta.ts +28 -0
- package/src/snippets.ts +64 -0
- package/src/type.d.ts +8 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +9 -0
- package/tsconfig.test.json +7 -0
- package/vite.config.ts +54 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
4
|
+
|
|
5
|
+
function cn(...inputs) {
|
|
6
|
+
return clsx(inputs);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const MaterialGroup = {
|
|
10
|
+
DISPLAY: 'display'};
|
|
11
|
+
|
|
12
|
+
function styleInject(css, ref) {
|
|
13
|
+
if (ref === void 0) ref = {};
|
|
14
|
+
var insertAt = ref.insertAt;
|
|
15
|
+
if (typeof document === 'undefined') {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
19
|
+
var style = document.createElement('style');
|
|
20
|
+
style.type = 'text/css';
|
|
21
|
+
if (insertAt === 'top') {
|
|
22
|
+
if (head.firstChild) {
|
|
23
|
+
head.insertBefore(style, head.firstChild);
|
|
24
|
+
} else {
|
|
25
|
+
head.appendChild(style);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
head.appendChild(style);
|
|
29
|
+
}
|
|
30
|
+
if (style.styleSheet) {
|
|
31
|
+
style.styleSheet.cssText = css;
|
|
32
|
+
} else {
|
|
33
|
+
style.appendChild(document.createTextNode(css));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var css_248z = ".component-module__container___VbZSk{backdrop-filter:blur(10px);background:rgba(10,10,26,.95);border:1px solid rgba(26,26,62,.8);border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,.3);box-sizing:border-box;height:100%;overflow:hidden;padding:16px;width:100%}.component-module__list___ZzqLO{display:flex;flex-direction:column;gap:10px;height:100%}.component-module__item___-0hiq{align-items:center;background:rgba(15,15,42,.9);border:1px solid rgba(26,26,62,.6);border-radius:8px;display:flex;gap:14px;overflow:hidden;padding:12px 16px;position:relative;transition:all .3s ease}.component-module__item___-0hiq:before{background:linear-gradient(180deg,transparent,rgba(0,212,255,.5),transparent);bottom:0;content:\"\";left:0;opacity:0;position:absolute;top:0;transition:opacity .3s ease;width:3px}.component-module__item___-0hiq:hover{background:rgba(20,20,52,.95);border-color:rgba(0,212,255,.3);transform:translateX(4px)}.component-module__item___-0hiq:hover:before{opacity:1}.component-module__rankBadge___qWXYW{align-items:center;border-radius:6px;display:flex;font-weight:700;height:32px;justify-content:center;min-width:32px;transition:transform .3s ease}.component-module__item___-0hiq:hover .component-module__rankBadge___qWXYW{transform:scale(1.1)}.component-module__rankBadgeTopThree___kYqJt{font-size:20px;text-shadow:0 2px 8px rgba(0,0,0,.5)}.component-module__rankBadgeNormal___Fl3nh{background:rgba(26,26,62,.8);border:1px solid rgba(136,146,176,.2);color:#8892b0;font-size:14px}.component-module__rankGold___lLkRo{color:gold;filter:drop-shadow(0 0 6px rgba(255,215,0,.6))}.component-module__rankSilver___QUAyV{color:#e8e8e8;filter:drop-shadow(0 0 6px rgba(192,192,192,.6))}.component-module__rankBronze___Wc-LC{color:#f96;filter:drop-shadow(0 0 6px rgba(205,127,50,.6))}.component-module__name___6zmww{color:#e6e6e6;flex:1;font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;transition:color .3s ease;white-space:nowrap}.component-module__item___-0hiq:hover .component-module__name___6zmww{color:#fff}.component-module__valueContainer___xBbFD{align-items:flex-end;display:flex;flex-direction:column;gap:6px;min-width:120px}.component-module__value___Fg70k{color:#00d4ff;font-family:Courier New,Courier,monospace;font-size:15px;font-weight:700;text-shadow:0 0 10px rgba(0,212,255,.3);transition:all .3s ease}.component-module__item___-0hiq:hover .component-module__value___Fg70k{text-shadow:0 0 15px rgba(0,212,255,.5);transform:scale(1.05)}.component-module__progressBar___wROZC{background:rgba(26,26,62,.8);border-radius:3px;box-shadow:inset 0 1px 3px rgba(0,0,0,.3);height:5px;overflow:hidden;width:100%}.component-module__progressFill___F8n5d{border-radius:3px;height:100%;position:relative;transition:width .5s cubic-bezier(.4,0,.2,1)}.component-module__progressFill___F8n5d:after{animation:component-module__shimmer___7hQ6G 2s infinite;background:linear-gradient(90deg,transparent,hsla(0,0%,100%,.2),transparent);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0}@keyframes component-module__shimmer___7hQ6G{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}";
|
|
38
|
+
var styles = {"container":"component-module__container___VbZSk","list":"component-module__list___ZzqLO","item":"component-module__item___-0hiq","rankBadge":"component-module__rankBadge___qWXYW","rankBadgeTopThree":"component-module__rankBadgeTopThree___kYqJt","rankBadgeNormal":"component-module__rankBadgeNormal___Fl3nh","rankGold":"component-module__rankGold___lLkRo","rankSilver":"component-module__rankSilver___QUAyV","rankBronze":"component-module__rankBronze___Wc-LC","name":"component-module__name___6zmww","valueContainer":"component-module__valueContainer___xBbFD","value":"component-module__value___Fg70k","progressBar":"component-module__progressBar___wROZC","progressFill":"component-module__progressFill___F8n5d"};
|
|
39
|
+
styleInject(css_248z);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Scroll List Component
|
|
43
|
+
* 滚动列表组件 - 用于展示排行榜、数据列表等
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
const DEFAULT_DATA = [{
|
|
47
|
+
rank: 1,
|
|
48
|
+
name: '北京市',
|
|
49
|
+
value: 9800
|
|
50
|
+
}, {
|
|
51
|
+
rank: 2,
|
|
52
|
+
name: '上海市',
|
|
53
|
+
value: 8500
|
|
54
|
+
}, {
|
|
55
|
+
rank: 3,
|
|
56
|
+
name: '广州市',
|
|
57
|
+
value: 7200
|
|
58
|
+
}, {
|
|
59
|
+
rank: 4,
|
|
60
|
+
name: '深圳市',
|
|
61
|
+
value: 6100
|
|
62
|
+
}, {
|
|
63
|
+
rank: 5,
|
|
64
|
+
name: '杭州市',
|
|
65
|
+
value: 4800
|
|
66
|
+
}];
|
|
67
|
+
const MEDAL_EMOJI = {
|
|
68
|
+
1: '🥇',
|
|
69
|
+
2: '🥈',
|
|
70
|
+
3: '🥉'
|
|
71
|
+
};
|
|
72
|
+
const getRankClass = rank => {
|
|
73
|
+
if (rank === 1) return styles.rankGold;
|
|
74
|
+
if (rank === 2) return styles.rankSilver;
|
|
75
|
+
if (rank === 3) return styles.rankBronze;
|
|
76
|
+
return '';
|
|
77
|
+
};
|
|
78
|
+
const formatDisplayValue = (value, format, prefix, suffix) => {
|
|
79
|
+
let formatted;
|
|
80
|
+
switch (format) {
|
|
81
|
+
case 'currency':
|
|
82
|
+
formatted = value.toLocaleString('zh-CN', {
|
|
83
|
+
minimumFractionDigits: 2,
|
|
84
|
+
maximumFractionDigits: 2
|
|
85
|
+
});
|
|
86
|
+
break;
|
|
87
|
+
case 'percent':
|
|
88
|
+
formatted = `${value}%`;
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
formatted = value.toLocaleString();
|
|
92
|
+
}
|
|
93
|
+
return `${prefix}${formatted}${suffix}`;
|
|
94
|
+
};
|
|
95
|
+
const ScrollList = ({
|
|
96
|
+
ref,
|
|
97
|
+
data = DEFAULT_DATA,
|
|
98
|
+
maxItems = 5,
|
|
99
|
+
showRank = true,
|
|
100
|
+
showMedal = true,
|
|
101
|
+
progressBarEnable = true,
|
|
102
|
+
progressBarGradient = true,
|
|
103
|
+
progressBarColors = ['#00d4ff', '#9b59b6'],
|
|
104
|
+
valueFormat = 'number',
|
|
105
|
+
valuePrefix = '',
|
|
106
|
+
valueSuffix = '',
|
|
107
|
+
nameColor = '#e6e6e6',
|
|
108
|
+
valueColor = '#00d4ff',
|
|
109
|
+
backgroundColor = 'rgba(10, 10, 26, 0.95)',
|
|
110
|
+
borderColor = 'rgba(26, 26, 62, 0.8)',
|
|
111
|
+
itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',
|
|
112
|
+
itemBorderColor = 'rgba(26, 26, 62, 0.6)',
|
|
113
|
+
glowEnable = false,
|
|
114
|
+
style: externalStyle
|
|
115
|
+
}) => {
|
|
116
|
+
const displayData = data.slice(0, maxItems);
|
|
117
|
+
const maxValue = Math.max(...displayData.map(item => item.value), 1);
|
|
118
|
+
const getProgressBarStyle = value => {
|
|
119
|
+
const percentage = value / maxValue * 100;
|
|
120
|
+
return {
|
|
121
|
+
width: `${percentage}%`,
|
|
122
|
+
background: progressBarGradient ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})` : progressBarColors[0],
|
|
123
|
+
boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
const containerStyle = {
|
|
127
|
+
...externalStyle,
|
|
128
|
+
backgroundColor,
|
|
129
|
+
borderColor
|
|
130
|
+
};
|
|
131
|
+
const itemStyle = {
|
|
132
|
+
backgroundColor: itemBackgroundColor,
|
|
133
|
+
borderColor: itemBorderColor
|
|
134
|
+
};
|
|
135
|
+
return /*#__PURE__*/jsx("div", {
|
|
136
|
+
className: styles.container,
|
|
137
|
+
ref: ref,
|
|
138
|
+
style: containerStyle,
|
|
139
|
+
children: /*#__PURE__*/jsx("div", {
|
|
140
|
+
className: styles.list,
|
|
141
|
+
children: displayData.map(item => {
|
|
142
|
+
const isTopThree = item.rank <= 3;
|
|
143
|
+
return /*#__PURE__*/jsxs("div", {
|
|
144
|
+
className: styles.item,
|
|
145
|
+
style: itemStyle,
|
|
146
|
+
children: [showRank ? /*#__PURE__*/jsx("div", {
|
|
147
|
+
className: cn(styles.rankBadge, isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal, getRankClass(item.rank)),
|
|
148
|
+
children: showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank
|
|
149
|
+
}) : null, /*#__PURE__*/jsx("div", {
|
|
150
|
+
className: styles.name,
|
|
151
|
+
style: {
|
|
152
|
+
color: nameColor
|
|
153
|
+
},
|
|
154
|
+
children: item.name
|
|
155
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
156
|
+
className: styles.valueContainer,
|
|
157
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
158
|
+
className: styles.value,
|
|
159
|
+
style: {
|
|
160
|
+
color: valueColor
|
|
161
|
+
},
|
|
162
|
+
children: formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)
|
|
163
|
+
}), progressBarEnable ? /*#__PURE__*/jsx("div", {
|
|
164
|
+
className: styles.progressBar,
|
|
165
|
+
children: /*#__PURE__*/jsx("div", {
|
|
166
|
+
className: styles.progressFill,
|
|
167
|
+
style: getProgressBarStyle(item.value)
|
|
168
|
+
})
|
|
169
|
+
}) : null]
|
|
170
|
+
})]
|
|
171
|
+
}, item.rank);
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const COMPONENT_NAME = 'EasyEditorMaterialsScrollList';
|
|
178
|
+
const PACKAGE_NAME = '@easy-editor/materials-dashboard-scroll-list';
|
|
179
|
+
|
|
180
|
+
const configure = {
|
|
181
|
+
props: [{
|
|
182
|
+
type: 'group',
|
|
183
|
+
title: '属性',
|
|
184
|
+
setter: 'TabSetter',
|
|
185
|
+
items: [{
|
|
186
|
+
type: 'group',
|
|
187
|
+
key: 'config',
|
|
188
|
+
title: '配置',
|
|
189
|
+
setter: {
|
|
190
|
+
componentName: 'CollapseSetter',
|
|
191
|
+
props: {
|
|
192
|
+
icon: false
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
items: [
|
|
196
|
+
{
|
|
197
|
+
name: 'id',
|
|
198
|
+
title: 'ID',
|
|
199
|
+
setter: 'NodeIdSetter',
|
|
200
|
+
extraProps: {
|
|
201
|
+
label: false
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
name: 'title',
|
|
205
|
+
title: '标题',
|
|
206
|
+
setter: 'StringSetter',
|
|
207
|
+
extraProps: {
|
|
208
|
+
getValue(target) {
|
|
209
|
+
return target.getExtraPropValue('title');
|
|
210
|
+
},
|
|
211
|
+
setValue(target, value) {
|
|
212
|
+
target.setExtraPropValue('title', value);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}, {
|
|
216
|
+
type: 'group',
|
|
217
|
+
title: '基础属性',
|
|
218
|
+
setter: {
|
|
219
|
+
componentName: 'CollapseSetter',
|
|
220
|
+
props: {
|
|
221
|
+
icon: false
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
items: [{
|
|
225
|
+
name: 'rect',
|
|
226
|
+
title: '位置尺寸',
|
|
227
|
+
setter: 'RectSetter',
|
|
228
|
+
extraProps: {
|
|
229
|
+
getValue(target) {
|
|
230
|
+
return target.getExtraPropValue('$dashboard.rect');
|
|
231
|
+
},
|
|
232
|
+
setValue(target, value) {
|
|
233
|
+
target.setExtraPropValue('$dashboard.rect', value);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
type: 'group',
|
|
240
|
+
title: '数据',
|
|
241
|
+
setter: {
|
|
242
|
+
componentName: 'CollapseSetter',
|
|
243
|
+
props: {
|
|
244
|
+
icon: false
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
items: [{
|
|
248
|
+
name: 'data',
|
|
249
|
+
title: '列表数据',
|
|
250
|
+
setter: 'JsonSetter'
|
|
251
|
+
}, {
|
|
252
|
+
name: 'maxItems',
|
|
253
|
+
title: '最大显示数',
|
|
254
|
+
setter: {
|
|
255
|
+
componentName: 'NumberSetter',
|
|
256
|
+
props: {
|
|
257
|
+
min: 1,
|
|
258
|
+
max: 20
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
extraProps: {
|
|
262
|
+
defaultValue: 5
|
|
263
|
+
}
|
|
264
|
+
}]
|
|
265
|
+
}, {
|
|
266
|
+
type: 'group',
|
|
267
|
+
title: '显示',
|
|
268
|
+
setter: {
|
|
269
|
+
componentName: 'CollapseSetter',
|
|
270
|
+
props: {
|
|
271
|
+
icon: false
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
items: [{
|
|
275
|
+
name: 'showRank',
|
|
276
|
+
title: '显示排名',
|
|
277
|
+
setter: 'SwitchSetter',
|
|
278
|
+
extraProps: {
|
|
279
|
+
defaultValue: true
|
|
280
|
+
}
|
|
281
|
+
}, {
|
|
282
|
+
name: 'showMedal',
|
|
283
|
+
title: '显示奖牌',
|
|
284
|
+
setter: 'SwitchSetter',
|
|
285
|
+
extraProps: {
|
|
286
|
+
defaultValue: true
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
name: 'progressBarEnable',
|
|
290
|
+
title: '显示进度条',
|
|
291
|
+
setter: 'SwitchSetter',
|
|
292
|
+
extraProps: {
|
|
293
|
+
defaultValue: true
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
name: 'progressBarGradient',
|
|
297
|
+
title: '渐变效果',
|
|
298
|
+
setter: 'SwitchSetter',
|
|
299
|
+
extraProps: {
|
|
300
|
+
defaultValue: true
|
|
301
|
+
}
|
|
302
|
+
}, {
|
|
303
|
+
name: 'glowEnable',
|
|
304
|
+
title: '发光效果',
|
|
305
|
+
setter: 'SwitchSetter',
|
|
306
|
+
extraProps: {
|
|
307
|
+
defaultValue: false
|
|
308
|
+
}
|
|
309
|
+
}]
|
|
310
|
+
}, {
|
|
311
|
+
type: 'group',
|
|
312
|
+
title: '数值格式',
|
|
313
|
+
setter: {
|
|
314
|
+
componentName: 'CollapseSetter',
|
|
315
|
+
props: {
|
|
316
|
+
icon: false
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
items: [{
|
|
320
|
+
name: 'valueFormat',
|
|
321
|
+
title: '格式类型',
|
|
322
|
+
setter: {
|
|
323
|
+
componentName: 'SelectSetter',
|
|
324
|
+
props: {
|
|
325
|
+
options: [{
|
|
326
|
+
label: '数字',
|
|
327
|
+
value: 'number'
|
|
328
|
+
}, {
|
|
329
|
+
label: '货币',
|
|
330
|
+
value: 'currency'
|
|
331
|
+
}, {
|
|
332
|
+
label: '百分比',
|
|
333
|
+
value: 'percent'
|
|
334
|
+
}]
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
extraProps: {
|
|
338
|
+
defaultValue: 'number'
|
|
339
|
+
}
|
|
340
|
+
}, {
|
|
341
|
+
name: 'valuePrefix',
|
|
342
|
+
title: '数值前缀',
|
|
343
|
+
setter: 'StringSetter',
|
|
344
|
+
extraProps: {
|
|
345
|
+
defaultValue: ''
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
name: 'valueSuffix',
|
|
349
|
+
title: '数值后缀',
|
|
350
|
+
setter: 'StringSetter',
|
|
351
|
+
extraProps: {
|
|
352
|
+
defaultValue: ''
|
|
353
|
+
}
|
|
354
|
+
}]
|
|
355
|
+
}, {
|
|
356
|
+
type: 'group',
|
|
357
|
+
title: '颜色',
|
|
358
|
+
setter: {
|
|
359
|
+
componentName: 'CollapseSetter',
|
|
360
|
+
props: {
|
|
361
|
+
icon: false
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
items: [{
|
|
365
|
+
name: 'progressBarColors',
|
|
366
|
+
title: '进度条颜色',
|
|
367
|
+
setter: 'ColorSetter',
|
|
368
|
+
extraProps: {
|
|
369
|
+
defaultValue: ['#00d4ff', '#9b59b6']
|
|
370
|
+
}
|
|
371
|
+
}, {
|
|
372
|
+
name: 'nameColor',
|
|
373
|
+
title: '名称颜色',
|
|
374
|
+
setter: 'ColorSetter',
|
|
375
|
+
extraProps: {
|
|
376
|
+
defaultValue: '#e6e6e6'
|
|
377
|
+
}
|
|
378
|
+
}, {
|
|
379
|
+
name: 'valueColor',
|
|
380
|
+
title: '数值颜色',
|
|
381
|
+
setter: 'ColorSetter',
|
|
382
|
+
extraProps: {
|
|
383
|
+
defaultValue: '#00d4ff'
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
name: 'backgroundColor',
|
|
387
|
+
title: '背景颜色',
|
|
388
|
+
setter: 'ColorSetter',
|
|
389
|
+
extraProps: {
|
|
390
|
+
defaultValue: 'rgba(10, 10, 26, 0.95)'
|
|
391
|
+
}
|
|
392
|
+
}, {
|
|
393
|
+
name: 'borderColor',
|
|
394
|
+
title: '边框颜色',
|
|
395
|
+
setter: 'ColorSetter',
|
|
396
|
+
extraProps: {
|
|
397
|
+
defaultValue: 'rgba(26, 26, 62, 0.8)'
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
name: 'itemBackgroundColor',
|
|
401
|
+
title: '行背景颜色',
|
|
402
|
+
setter: 'ColorSetter',
|
|
403
|
+
extraProps: {
|
|
404
|
+
defaultValue: 'rgba(15, 15, 42, 0.9)'
|
|
405
|
+
}
|
|
406
|
+
}, {
|
|
407
|
+
name: 'itemBorderColor',
|
|
408
|
+
title: '行边框颜色',
|
|
409
|
+
setter: 'ColorSetter',
|
|
410
|
+
extraProps: {
|
|
411
|
+
defaultValue: 'rgba(26, 26, 62, 0.6)'
|
|
412
|
+
}
|
|
413
|
+
}]
|
|
414
|
+
}]
|
|
415
|
+
}, {
|
|
416
|
+
type: 'group',
|
|
417
|
+
key: 'data',
|
|
418
|
+
title: '数据',
|
|
419
|
+
items: [{
|
|
420
|
+
name: 'dataBinding',
|
|
421
|
+
title: '数据绑定',
|
|
422
|
+
setter: 'DataBindingSetter'
|
|
423
|
+
}]
|
|
424
|
+
}, {
|
|
425
|
+
type: 'group',
|
|
426
|
+
key: 'advanced',
|
|
427
|
+
title: '高级',
|
|
428
|
+
items: [{
|
|
429
|
+
name: 'condition',
|
|
430
|
+
title: '显隐控制',
|
|
431
|
+
setter: 'SwitchSetter',
|
|
432
|
+
extraProps: {
|
|
433
|
+
defaultValue: true,
|
|
434
|
+
supportVariable: true
|
|
435
|
+
}
|
|
436
|
+
}, {
|
|
437
|
+
type: 'group',
|
|
438
|
+
title: '滚动配置',
|
|
439
|
+
setter: {
|
|
440
|
+
componentName: 'CollapseSetter',
|
|
441
|
+
props: {
|
|
442
|
+
icon: false
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
items: [{
|
|
446
|
+
name: 'scrollEnable',
|
|
447
|
+
title: '启用滚动',
|
|
448
|
+
setter: 'SwitchSetter',
|
|
449
|
+
extraProps: {
|
|
450
|
+
defaultValue: true
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
name: 'scrollDirection',
|
|
454
|
+
title: '滚动方向',
|
|
455
|
+
setter: {
|
|
456
|
+
componentName: 'SegmentedSetter',
|
|
457
|
+
props: {
|
|
458
|
+
options: [{
|
|
459
|
+
label: '向上',
|
|
460
|
+
value: 'up'
|
|
461
|
+
}, {
|
|
462
|
+
label: '向下',
|
|
463
|
+
value: 'down'
|
|
464
|
+
}]
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
extraProps: {
|
|
468
|
+
defaultValue: 'up'
|
|
469
|
+
}
|
|
470
|
+
}, {
|
|
471
|
+
name: 'scrollSpeed',
|
|
472
|
+
title: '滚动速度',
|
|
473
|
+
setter: {
|
|
474
|
+
componentName: 'SliderSetter',
|
|
475
|
+
props: {
|
|
476
|
+
min: 1,
|
|
477
|
+
max: 10,
|
|
478
|
+
step: 1,
|
|
479
|
+
suffix: 'x'
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
extraProps: {
|
|
483
|
+
defaultValue: 3
|
|
484
|
+
}
|
|
485
|
+
}, {
|
|
486
|
+
name: 'hoverPause',
|
|
487
|
+
title: '悬停暂停',
|
|
488
|
+
setter: 'SwitchSetter',
|
|
489
|
+
extraProps: {
|
|
490
|
+
defaultValue: true
|
|
491
|
+
}
|
|
492
|
+
}, {
|
|
493
|
+
name: 'scrollInterval',
|
|
494
|
+
title: '滚动间隔',
|
|
495
|
+
setter: {
|
|
496
|
+
componentName: 'SliderSetter',
|
|
497
|
+
props: {
|
|
498
|
+
min: 1000,
|
|
499
|
+
max: 10_000,
|
|
500
|
+
step: 500,
|
|
501
|
+
suffix: 'ms'
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
extraProps: {
|
|
505
|
+
defaultValue: 3000
|
|
506
|
+
}
|
|
507
|
+
}]
|
|
508
|
+
}, {
|
|
509
|
+
type: 'group',
|
|
510
|
+
title: '动画',
|
|
511
|
+
setter: {
|
|
512
|
+
componentName: 'CollapseSetter',
|
|
513
|
+
props: {
|
|
514
|
+
icon: false
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
items: [{
|
|
518
|
+
name: 'animationEnable',
|
|
519
|
+
title: '启用动画',
|
|
520
|
+
setter: 'SwitchSetter',
|
|
521
|
+
extraProps: {
|
|
522
|
+
defaultValue: true
|
|
523
|
+
}
|
|
524
|
+
}, {
|
|
525
|
+
name: 'animationDuration',
|
|
526
|
+
title: '动画时长',
|
|
527
|
+
setter: {
|
|
528
|
+
componentName: 'SliderSetter',
|
|
529
|
+
props: {
|
|
530
|
+
min: 0,
|
|
531
|
+
max: 2000,
|
|
532
|
+
step: 100,
|
|
533
|
+
suffix: 'ms'
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
extraProps: {
|
|
537
|
+
defaultValue: 500
|
|
538
|
+
}
|
|
539
|
+
}, {
|
|
540
|
+
name: 'animationEasing',
|
|
541
|
+
title: '缓动函数',
|
|
542
|
+
setter: {
|
|
543
|
+
componentName: 'SelectSetter',
|
|
544
|
+
props: {
|
|
545
|
+
options: [{
|
|
546
|
+
label: '线性',
|
|
547
|
+
value: 'linear'
|
|
548
|
+
}, {
|
|
549
|
+
label: '缓入',
|
|
550
|
+
value: 'ease-in'
|
|
551
|
+
}, {
|
|
552
|
+
label: '缓出',
|
|
553
|
+
value: 'ease-out'
|
|
554
|
+
}, {
|
|
555
|
+
label: '缓入缓出',
|
|
556
|
+
value: 'ease-in-out'
|
|
557
|
+
}]
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
extraProps: {
|
|
561
|
+
defaultValue: 'ease-out'
|
|
562
|
+
}
|
|
563
|
+
}]
|
|
564
|
+
}]
|
|
565
|
+
}]
|
|
566
|
+
}],
|
|
567
|
+
component: {},
|
|
568
|
+
supports: {},
|
|
569
|
+
advanced: {}
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
const snippets = [{
|
|
573
|
+
title: '排行榜',
|
|
574
|
+
screenshot: '',
|
|
575
|
+
schema: {
|
|
576
|
+
componentName: COMPONENT_NAME,
|
|
577
|
+
props: {
|
|
578
|
+
data: [{
|
|
579
|
+
rank: 1,
|
|
580
|
+
name: '北京',
|
|
581
|
+
value: 9800
|
|
582
|
+
}, {
|
|
583
|
+
rank: 2,
|
|
584
|
+
name: '上海',
|
|
585
|
+
value: 8500
|
|
586
|
+
}, {
|
|
587
|
+
rank: 3,
|
|
588
|
+
name: '广州',
|
|
589
|
+
value: 7200
|
|
590
|
+
}, {
|
|
591
|
+
rank: 4,
|
|
592
|
+
name: '深圳',
|
|
593
|
+
value: 6100
|
|
594
|
+
}, {
|
|
595
|
+
rank: 5,
|
|
596
|
+
name: '杭州',
|
|
597
|
+
value: 4800
|
|
598
|
+
}],
|
|
599
|
+
maxItems: 5,
|
|
600
|
+
showMedal: true,
|
|
601
|
+
progressBarEnable: true,
|
|
602
|
+
progressBarGradient: true,
|
|
603
|
+
progressBarColors: ['#00d4ff', '#9b59b6']
|
|
604
|
+
},
|
|
605
|
+
$dashboard: {
|
|
606
|
+
rect: {
|
|
607
|
+
width: 320,
|
|
608
|
+
height: 280
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}, {
|
|
613
|
+
title: '简单列表',
|
|
614
|
+
screenshot: '',
|
|
615
|
+
schema: {
|
|
616
|
+
componentName: COMPONENT_NAME,
|
|
617
|
+
props: {
|
|
618
|
+
data: [{
|
|
619
|
+
rank: 1,
|
|
620
|
+
name: '产品A',
|
|
621
|
+
value: 1250
|
|
622
|
+
}, {
|
|
623
|
+
rank: 2,
|
|
624
|
+
name: '产品B',
|
|
625
|
+
value: 980
|
|
626
|
+
}, {
|
|
627
|
+
rank: 3,
|
|
628
|
+
name: '产品C',
|
|
629
|
+
value: 750
|
|
630
|
+
}],
|
|
631
|
+
maxItems: 3,
|
|
632
|
+
showMedal: false,
|
|
633
|
+
progressBarEnable: true,
|
|
634
|
+
progressBarGradient: false,
|
|
635
|
+
progressBarColors: ['#00ff88', '#00ff88']
|
|
636
|
+
},
|
|
637
|
+
$dashboard: {
|
|
638
|
+
rect: {
|
|
639
|
+
width: 280,
|
|
640
|
+
height: 180
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}];
|
|
645
|
+
|
|
646
|
+
var version = "0.0.1";
|
|
647
|
+
var pkg = {
|
|
648
|
+
version: version};
|
|
649
|
+
|
|
650
|
+
const meta = {
|
|
651
|
+
componentName: COMPONENT_NAME,
|
|
652
|
+
title: '滚动列表',
|
|
653
|
+
group: MaterialGroup.DISPLAY,
|
|
654
|
+
devMode: 'proCode',
|
|
655
|
+
npm: {
|
|
656
|
+
package: PACKAGE_NAME,
|
|
657
|
+
version: pkg.version,
|
|
658
|
+
globalName: COMPONENT_NAME,
|
|
659
|
+
componentName: COMPONENT_NAME
|
|
660
|
+
},
|
|
661
|
+
snippets,
|
|
662
|
+
configure
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
export { ScrollList as component, meta };
|
|
666
|
+
//# sourceMappingURL=index.esm.js.map
|