@easy-editor/materials-dashboard-scroll-list 0.0.3 → 0.0.5

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.
@@ -1,182 +0,0 @@
1
- /* @easy-editor/materials-dashboard-scroll-list v0.0.2 (component, esm) */
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
-
4
- 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}
5
-
6
- function cn(...inputs) {
7
- return clsx(inputs);
8
- }
9
-
10
- function styleInject(css, ref) {
11
- if (ref === void 0) ref = {};
12
- var insertAt = ref.insertAt;
13
- if (typeof document === 'undefined') {
14
- return;
15
- }
16
- var head = document.head || document.getElementsByTagName('head')[0];
17
- var style = document.createElement('style');
18
- style.type = 'text/css';
19
- if (insertAt === 'top') {
20
- if (head.firstChild) {
21
- head.insertBefore(style, head.firstChild);
22
- } else {
23
- head.appendChild(style);
24
- }
25
- } else {
26
- head.appendChild(style);
27
- }
28
- if (style.styleSheet) {
29
- style.styleSheet.cssText = css;
30
- } else {
31
- style.appendChild(document.createTextNode(css));
32
- }
33
- }
34
-
35
- 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%)}}";
36
- 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"};
37
- styleInject(css_248z);
38
-
39
- /**
40
- * Scroll List Component
41
- * 滚动列表组件 - 用于展示排行榜、数据列表等
42
- */
43
-
44
- const DEFAULT_DATA = [{
45
- rank: 1,
46
- name: '北京市',
47
- value: 9800
48
- }, {
49
- rank: 2,
50
- name: '上海市',
51
- value: 8500
52
- }, {
53
- rank: 3,
54
- name: '广州市',
55
- value: 7200
56
- }, {
57
- rank: 4,
58
- name: '深圳市',
59
- value: 6100
60
- }, {
61
- rank: 5,
62
- name: '杭州市',
63
- value: 4800
64
- }];
65
- const MEDAL_EMOJI = {
66
- 1: '🥇',
67
- 2: '🥈',
68
- 3: '🥉'
69
- };
70
- const getRankClass = rank => {
71
- if (rank === 1) {
72
- return styles.rankGold;
73
- }
74
- if (rank === 2) {
75
- return styles.rankSilver;
76
- }
77
- if (rank === 3) {
78
- return styles.rankBronze;
79
- }
80
- return '';
81
- };
82
- const formatDisplayValue = (value, format, prefix, suffix) => {
83
- let formatted;
84
- switch (format) {
85
- case 'currency':
86
- formatted = value.toLocaleString('zh-CN', {
87
- minimumFractionDigits: 2,
88
- maximumFractionDigits: 2
89
- });
90
- break;
91
- case 'percent':
92
- formatted = `${value}%`;
93
- break;
94
- default:
95
- formatted = value.toLocaleString();
96
- }
97
- return `${prefix}${formatted}${suffix}`;
98
- };
99
- const ScrollList = ({
100
- ref,
101
- data = DEFAULT_DATA,
102
- maxItems = 5,
103
- showRank = true,
104
- showMedal = true,
105
- progressBarEnable = true,
106
- progressBarGradient = true,
107
- progressBarColors = ['#00d4ff', '#9b59b6'],
108
- valueFormat = 'number',
109
- valuePrefix = '',
110
- valueSuffix = '',
111
- nameColor = '#e6e6e6',
112
- valueColor = '#00d4ff',
113
- backgroundColor = 'rgba(10, 10, 26, 0.95)',
114
- borderColor = 'rgba(26, 26, 62, 0.8)',
115
- itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',
116
- itemBorderColor = 'rgba(26, 26, 62, 0.6)',
117
- glowEnable = false,
118
- style: externalStyle
119
- }) => {
120
- const displayData = data.slice(0, maxItems);
121
- const maxValue = Math.max(...displayData.map(item => item.value), 1);
122
- const getProgressBarStyle = value => {
123
- const percentage = value / maxValue * 100;
124
- return {
125
- width: `${percentage}%`,
126
- background: progressBarGradient ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})` : progressBarColors[0],
127
- boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined
128
- };
129
- };
130
- const containerStyle = {
131
- ...externalStyle,
132
- backgroundColor,
133
- borderColor
134
- };
135
- const itemStyle = {
136
- backgroundColor: itemBackgroundColor,
137
- borderColor: itemBorderColor
138
- };
139
- return /*#__PURE__*/jsx("div", {
140
- className: styles.container,
141
- ref: ref,
142
- style: containerStyle,
143
- children: /*#__PURE__*/jsx("div", {
144
- className: styles.list,
145
- children: displayData.map(item => {
146
- const isTopThree = item.rank <= 3;
147
- return /*#__PURE__*/jsxs("div", {
148
- className: styles.item,
149
- style: itemStyle,
150
- children: [showRank ? /*#__PURE__*/jsx("div", {
151
- className: cn(styles.rankBadge, isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal, getRankClass(item.rank)),
152
- children: showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank
153
- }) : null, /*#__PURE__*/jsx("div", {
154
- className: styles.name,
155
- style: {
156
- color: nameColor
157
- },
158
- children: item.name
159
- }), /*#__PURE__*/jsxs("div", {
160
- className: styles.valueContainer,
161
- children: [/*#__PURE__*/jsx("span", {
162
- className: styles.value,
163
- style: {
164
- color: valueColor
165
- },
166
- children: formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)
167
- }), progressBarEnable ? /*#__PURE__*/jsx("div", {
168
- className: styles.progressBar,
169
- children: /*#__PURE__*/jsx("div", {
170
- className: styles.progressFill,
171
- style: getProgressBarStyle(item.value)
172
- })
173
- }) : null]
174
- })]
175
- }, item.rank);
176
- })
177
- })
178
- });
179
- };
180
-
181
- export { ScrollList, ScrollList as default };
182
- //# sourceMappingURL=component.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.esm.js","sources":["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../../shared/src/lib/utils.ts","../../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/component.tsx"],"sourcesContent":["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}export 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}export default clsx;","import { clsx, type ClassValue } from 'clsx'\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs)\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Scroll List Component\n * 滚动列表组件 - 用于展示排行榜、数据列表等\n */\n\nimport type { CSSProperties, Ref } from 'react'\nimport { cn } from '@easy-editor/materials-shared'\nimport styles from './component.module.css'\n\nexport interface ScrollListItem {\n rank: number\n name: string\n value: number\n}\n\nexport interface ScrollListProps {\n ref?: Ref<HTMLDivElement>\n /** 列表数据 */\n data?: ScrollListItem[]\n /** 最大显示条数 */\n maxItems?: number\n /** 是否显示排名 */\n showRank?: boolean\n /** 是否显示奖牌图标 */\n showMedal?: boolean\n /** 是否显示进度条 */\n progressBarEnable?: boolean\n /** 是否使用渐变进度条 */\n progressBarGradient?: boolean\n /** 进度条颜色 [起始色, 结束色] */\n progressBarColors?: [string, string]\n /** 数值格式化 */\n valueFormat?: 'number' | 'currency' | 'percent'\n /** 数值前缀 */\n valuePrefix?: string\n /** 数值后缀 */\n valueSuffix?: string\n /** 名称颜色 */\n nameColor?: string\n /** 数值颜色 */\n valueColor?: string\n /** 背景颜色 */\n backgroundColor?: string\n /** 边框颜色 */\n borderColor?: string\n /** 行背景颜色 */\n itemBackgroundColor?: string\n /** 行边框颜色 */\n itemBorderColor?: string\n /** 是否显示发光效果 */\n glowEnable?: boolean\n /** 外部样式 */\n style?: CSSProperties\n}\n\nconst DEFAULT_DATA: ScrollListItem[] = [\n { rank: 1, name: '北京市', value: 9800 },\n { rank: 2, name: '上海市', value: 8500 },\n { rank: 3, name: '广州市', value: 7200 },\n { rank: 4, name: '深圳市', value: 6100 },\n { rank: 5, name: '杭州市', value: 4800 },\n]\n\nconst MEDAL_EMOJI: Record<number, string> = {\n 1: '🥇',\n 2: '🥈',\n 3: '🥉',\n}\n\nconst getRankClass = (rank: number): string => {\n if (rank === 1) {\n return styles.rankGold\n }\n if (rank === 2) {\n return styles.rankSilver\n }\n if (rank === 3) {\n return styles.rankBronze\n }\n return ''\n}\n\nconst formatDisplayValue = (value: number, format: string, prefix: string, suffix: string): string => {\n let formatted: string\n switch (format) {\n case 'currency':\n formatted = value.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })\n break\n case 'percent':\n formatted = `${value}%`\n break\n default:\n formatted = value.toLocaleString()\n }\n return `${prefix}${formatted}${suffix}`\n}\n\nexport const ScrollList: React.FC<ScrollListProps> = ({\n ref,\n data = DEFAULT_DATA,\n maxItems = 5,\n showRank = true,\n showMedal = true,\n progressBarEnable = true,\n progressBarGradient = true,\n progressBarColors = ['#00d4ff', '#9b59b6'],\n valueFormat = 'number',\n valuePrefix = '',\n valueSuffix = '',\n nameColor = '#e6e6e6',\n valueColor = '#00d4ff',\n backgroundColor = 'rgba(10, 10, 26, 0.95)',\n borderColor = 'rgba(26, 26, 62, 0.8)',\n itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',\n itemBorderColor = 'rgba(26, 26, 62, 0.6)',\n glowEnable = false,\n style: externalStyle,\n}) => {\n const displayData = data.slice(0, maxItems)\n const maxValue = Math.max(...displayData.map(item => item.value), 1)\n\n const getProgressBarStyle = (value: number): CSSProperties => {\n const percentage = (value / maxValue) * 100\n return {\n width: `${percentage}%`,\n background: progressBarGradient\n ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})`\n : progressBarColors[0],\n boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined,\n }\n }\n\n const containerStyle: CSSProperties = {\n ...externalStyle,\n backgroundColor,\n borderColor,\n }\n\n const itemStyle: CSSProperties = {\n backgroundColor: itemBackgroundColor,\n borderColor: itemBorderColor,\n }\n\n return (\n <div className={styles.container} ref={ref} style={containerStyle}>\n <div className={styles.list}>\n {displayData.map(item => {\n const isTopThree = item.rank <= 3\n\n return (\n <div className={styles.item} key={item.rank} style={itemStyle}>\n {/* Rank Badge */}\n {showRank ? (\n <div\n className={cn(\n styles.rankBadge,\n isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal,\n getRankClass(item.rank),\n )}\n >\n {showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank}\n </div>\n ) : null}\n\n {/* Name */}\n <div className={styles.name} style={{ color: nameColor }}>\n {item.name}\n </div>\n\n {/* Value and Progress */}\n <div className={styles.valueContainer}>\n <span className={styles.value} style={{ color: valueColor }}>\n {formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)}\n </span>\n {progressBarEnable ? (\n <div className={styles.progressBar}>\n <div className={styles.progressFill} style={getProgressBarStyle(item.value)} />\n </div>\n ) : null}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default ScrollList\n"],"names":["cn","inputs","clsx","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_DATA","rank","name","value","MEDAL_EMOJI","getRankClass","styles","rankGold","rankSilver","rankBronze","formatDisplayValue","format","prefix","suffix","formatted","toLocaleString","minimumFractionDigits","maximumFractionDigits","ScrollList","data","maxItems","showRank","showMedal","progressBarEnable","progressBarGradient","progressBarColors","valueFormat","valuePrefix","valueSuffix","nameColor","valueColor","backgroundColor","borderColor","itemBackgroundColor","itemBorderColor","glowEnable","externalStyle","displayData","slice","maxValue","Math","max","map","item","getProgressBarStyle","percentage","width","background","boxShadow","undefined","containerStyle","itemStyle","_jsx","className","container","children","list","isTopThree","_jsxs","rankBadge","rankBadgeTopThree","rankBadgeNormal","color","valueContainer","progressBar","progressFill"],"mappings":";;;AAAA,SAAS,CAAC,CAAC,CAAC,CAAC,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D,WAAW,CAACuC,IAAI,CAAC1C,IAAI,CAAC,GAAG0C,IAAI,CAAC1C;AAAI,WAC1D,CAAC,GACJ,IAAI,eAGRmD,GAAA,CAAA,KAAA,EAAA;YAAKC,SAAS,EAAE/C,MAAM,CAACJ,IAAK;AAACX,YAAAA,KAAK,EAAE;AAAEuE,cAAAA,KAAK,EAAEjC;aAAY;YAAA0B,QAAA,EACtDZ,IAAI,CAACzC;WACH,CAAC,eAGNwD,IAAA,CAAA,KAAA,EAAA;YAAKL,SAAS,EAAE/C,MAAM,CAACyD,cAAe;AAAAR,YAAAA,QAAA,gBACpCH,GAAA,CAAA,MAAA,EAAA;cAAMC,SAAS,EAAE/C,MAAM,CAACH,KAAM;AAACZ,cAAAA,KAAK,EAAE;AAAEuE,gBAAAA,KAAK,EAAEhC;eAAa;cAAAyB,QAAA,EACzD7C,kBAAkB,CAACiC,IAAI,CAACxC,KAAK,EAAEuB,WAAW,EAAEC,WAAW,EAAEC,WAAW;AAAC,aAClE,CAAC,EACNL,iBAAiB,gBAChB6B,GAAA,CAAA,KAAA,EAAA;cAAKC,SAAS,EAAE/C,MAAM,CAAC0D,WAAY;AAAAT,cAAAA,QAAA,eACjCH,GAAA,CAAA,KAAA,EAAA;gBAAKC,SAAS,EAAE/C,MAAM,CAAC2D,YAAa;AAAC1E,gBAAAA,KAAK,EAAEqD,mBAAmB,CAACD,IAAI,CAACxC,KAAK;eAAI;aAC3E,CAAC,GACJ,IAAI;AAAA,WACL,CAAC;SAAA,EA7B0BwC,IAAI,CAAC1C,IA8BlC,CAAC;MAEV,CAAC;KACE;AAAC,GACH,CAAC;AAEV;;;;","x_google_ignoreList":[0,2]}
package/dist/component.js DELETED
@@ -1,191 +0,0 @@
1
- /* @easy-editor/materials-dashboard-scroll-list v0.0.2 (component) */
2
- (function (global, factory) {
3
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime')) :
4
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime'], factory) :
5
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.EasyEditorMaterialsScrollListComponent = {}, global.jsxRuntime));
6
- })(this, (function (exports, jsxRuntime) { 'use strict';
7
-
8
- 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}
9
-
10
- function cn(...inputs) {
11
- return clsx(inputs);
12
- }
13
-
14
- function styleInject(css, ref) {
15
- if (ref === void 0) ref = {};
16
- var insertAt = ref.insertAt;
17
- if (typeof document === 'undefined') {
18
- return;
19
- }
20
- var head = document.head || document.getElementsByTagName('head')[0];
21
- var style = document.createElement('style');
22
- style.type = 'text/css';
23
- if (insertAt === 'top') {
24
- if (head.firstChild) {
25
- head.insertBefore(style, head.firstChild);
26
- } else {
27
- head.appendChild(style);
28
- }
29
- } else {
30
- head.appendChild(style);
31
- }
32
- if (style.styleSheet) {
33
- style.styleSheet.cssText = css;
34
- } else {
35
- style.appendChild(document.createTextNode(css));
36
- }
37
- }
38
-
39
- 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%)}}";
40
- 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"};
41
- styleInject(css_248z);
42
-
43
- /**
44
- * Scroll List Component
45
- * 滚动列表组件 - 用于展示排行榜、数据列表等
46
- */
47
-
48
- const DEFAULT_DATA = [{
49
- rank: 1,
50
- name: '北京市',
51
- value: 9800
52
- }, {
53
- rank: 2,
54
- name: '上海市',
55
- value: 8500
56
- }, {
57
- rank: 3,
58
- name: '广州市',
59
- value: 7200
60
- }, {
61
- rank: 4,
62
- name: '深圳市',
63
- value: 6100
64
- }, {
65
- rank: 5,
66
- name: '杭州市',
67
- value: 4800
68
- }];
69
- const MEDAL_EMOJI = {
70
- 1: '🥇',
71
- 2: '🥈',
72
- 3: '🥉'
73
- };
74
- const getRankClass = rank => {
75
- if (rank === 1) {
76
- return styles.rankGold;
77
- }
78
- if (rank === 2) {
79
- return styles.rankSilver;
80
- }
81
- if (rank === 3) {
82
- return styles.rankBronze;
83
- }
84
- return '';
85
- };
86
- const formatDisplayValue = (value, format, prefix, suffix) => {
87
- let formatted;
88
- switch (format) {
89
- case 'currency':
90
- formatted = value.toLocaleString('zh-CN', {
91
- minimumFractionDigits: 2,
92
- maximumFractionDigits: 2
93
- });
94
- break;
95
- case 'percent':
96
- formatted = `${value}%`;
97
- break;
98
- default:
99
- formatted = value.toLocaleString();
100
- }
101
- return `${prefix}${formatted}${suffix}`;
102
- };
103
- const ScrollList = ({
104
- ref,
105
- data = DEFAULT_DATA,
106
- maxItems = 5,
107
- showRank = true,
108
- showMedal = true,
109
- progressBarEnable = true,
110
- progressBarGradient = true,
111
- progressBarColors = ['#00d4ff', '#9b59b6'],
112
- valueFormat = 'number',
113
- valuePrefix = '',
114
- valueSuffix = '',
115
- nameColor = '#e6e6e6',
116
- valueColor = '#00d4ff',
117
- backgroundColor = 'rgba(10, 10, 26, 0.95)',
118
- borderColor = 'rgba(26, 26, 62, 0.8)',
119
- itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',
120
- itemBorderColor = 'rgba(26, 26, 62, 0.6)',
121
- glowEnable = false,
122
- style: externalStyle
123
- }) => {
124
- const displayData = data.slice(0, maxItems);
125
- const maxValue = Math.max(...displayData.map(item => item.value), 1);
126
- const getProgressBarStyle = value => {
127
- const percentage = value / maxValue * 100;
128
- return {
129
- width: `${percentage}%`,
130
- background: progressBarGradient ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})` : progressBarColors[0],
131
- boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined
132
- };
133
- };
134
- const containerStyle = {
135
- ...externalStyle,
136
- backgroundColor,
137
- borderColor
138
- };
139
- const itemStyle = {
140
- backgroundColor: itemBackgroundColor,
141
- borderColor: itemBorderColor
142
- };
143
- return /*#__PURE__*/jsxRuntime.jsx("div", {
144
- className: styles.container,
145
- ref: ref,
146
- style: containerStyle,
147
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
148
- className: styles.list,
149
- children: displayData.map(item => {
150
- const isTopThree = item.rank <= 3;
151
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
152
- className: styles.item,
153
- style: itemStyle,
154
- children: [showRank ? /*#__PURE__*/jsxRuntime.jsx("div", {
155
- className: cn(styles.rankBadge, isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal, getRankClass(item.rank)),
156
- children: showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank
157
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
158
- className: styles.name,
159
- style: {
160
- color: nameColor
161
- },
162
- children: item.name
163
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
164
- className: styles.valueContainer,
165
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
166
- className: styles.value,
167
- style: {
168
- color: valueColor
169
- },
170
- children: formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)
171
- }), progressBarEnable ? /*#__PURE__*/jsxRuntime.jsx("div", {
172
- className: styles.progressBar,
173
- children: /*#__PURE__*/jsxRuntime.jsx("div", {
174
- className: styles.progressFill,
175
- style: getProgressBarStyle(item.value)
176
- })
177
- }) : null]
178
- })]
179
- }, item.rank);
180
- })
181
- })
182
- });
183
- };
184
-
185
- exports.ScrollList = ScrollList;
186
- exports.default = ScrollList;
187
-
188
- Object.defineProperty(exports, '__esModule', { value: true });
189
-
190
- }));
191
- //# sourceMappingURL=component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sources":["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../../shared/src/lib/utils.ts","../../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/component.tsx"],"sourcesContent":["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}export 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}export default clsx;","import { clsx, type ClassValue } from 'clsx'\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs)\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Scroll List Component\n * 滚动列表组件 - 用于展示排行榜、数据列表等\n */\n\nimport type { CSSProperties, Ref } from 'react'\nimport { cn } from '@easy-editor/materials-shared'\nimport styles from './component.module.css'\n\nexport interface ScrollListItem {\n rank: number\n name: string\n value: number\n}\n\nexport interface ScrollListProps {\n ref?: Ref<HTMLDivElement>\n /** 列表数据 */\n data?: ScrollListItem[]\n /** 最大显示条数 */\n maxItems?: number\n /** 是否显示排名 */\n showRank?: boolean\n /** 是否显示奖牌图标 */\n showMedal?: boolean\n /** 是否显示进度条 */\n progressBarEnable?: boolean\n /** 是否使用渐变进度条 */\n progressBarGradient?: boolean\n /** 进度条颜色 [起始色, 结束色] */\n progressBarColors?: [string, string]\n /** 数值格式化 */\n valueFormat?: 'number' | 'currency' | 'percent'\n /** 数值前缀 */\n valuePrefix?: string\n /** 数值后缀 */\n valueSuffix?: string\n /** 名称颜色 */\n nameColor?: string\n /** 数值颜色 */\n valueColor?: string\n /** 背景颜色 */\n backgroundColor?: string\n /** 边框颜色 */\n borderColor?: string\n /** 行背景颜色 */\n itemBackgroundColor?: string\n /** 行边框颜色 */\n itemBorderColor?: string\n /** 是否显示发光效果 */\n glowEnable?: boolean\n /** 外部样式 */\n style?: CSSProperties\n}\n\nconst DEFAULT_DATA: ScrollListItem[] = [\n { rank: 1, name: '北京市', value: 9800 },\n { rank: 2, name: '上海市', value: 8500 },\n { rank: 3, name: '广州市', value: 7200 },\n { rank: 4, name: '深圳市', value: 6100 },\n { rank: 5, name: '杭州市', value: 4800 },\n]\n\nconst MEDAL_EMOJI: Record<number, string> = {\n 1: '🥇',\n 2: '🥈',\n 3: '🥉',\n}\n\nconst getRankClass = (rank: number): string => {\n if (rank === 1) {\n return styles.rankGold\n }\n if (rank === 2) {\n return styles.rankSilver\n }\n if (rank === 3) {\n return styles.rankBronze\n }\n return ''\n}\n\nconst formatDisplayValue = (value: number, format: string, prefix: string, suffix: string): string => {\n let formatted: string\n switch (format) {\n case 'currency':\n formatted = value.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })\n break\n case 'percent':\n formatted = `${value}%`\n break\n default:\n formatted = value.toLocaleString()\n }\n return `${prefix}${formatted}${suffix}`\n}\n\nexport const ScrollList: React.FC<ScrollListProps> = ({\n ref,\n data = DEFAULT_DATA,\n maxItems = 5,\n showRank = true,\n showMedal = true,\n progressBarEnable = true,\n progressBarGradient = true,\n progressBarColors = ['#00d4ff', '#9b59b6'],\n valueFormat = 'number',\n valuePrefix = '',\n valueSuffix = '',\n nameColor = '#e6e6e6',\n valueColor = '#00d4ff',\n backgroundColor = 'rgba(10, 10, 26, 0.95)',\n borderColor = 'rgba(26, 26, 62, 0.8)',\n itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',\n itemBorderColor = 'rgba(26, 26, 62, 0.6)',\n glowEnable = false,\n style: externalStyle,\n}) => {\n const displayData = data.slice(0, maxItems)\n const maxValue = Math.max(...displayData.map(item => item.value), 1)\n\n const getProgressBarStyle = (value: number): CSSProperties => {\n const percentage = (value / maxValue) * 100\n return {\n width: `${percentage}%`,\n background: progressBarGradient\n ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})`\n : progressBarColors[0],\n boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined,\n }\n }\n\n const containerStyle: CSSProperties = {\n ...externalStyle,\n backgroundColor,\n borderColor,\n }\n\n const itemStyle: CSSProperties = {\n backgroundColor: itemBackgroundColor,\n borderColor: itemBorderColor,\n }\n\n return (\n <div className={styles.container} ref={ref} style={containerStyle}>\n <div className={styles.list}>\n {displayData.map(item => {\n const isTopThree = item.rank <= 3\n\n return (\n <div className={styles.item} key={item.rank} style={itemStyle}>\n {/* Rank Badge */}\n {showRank ? (\n <div\n className={cn(\n styles.rankBadge,\n isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal,\n getRankClass(item.rank),\n )}\n >\n {showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank}\n </div>\n ) : null}\n\n {/* Name */}\n <div className={styles.name} style={{ color: nameColor }}>\n {item.name}\n </div>\n\n {/* Value and Progress */}\n <div className={styles.valueContainer}>\n <span className={styles.value} style={{ color: valueColor }}>\n {formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)}\n </span>\n {progressBarEnable ? (\n <div className={styles.progressBar}>\n <div className={styles.progressFill} style={getProgressBarStyle(item.value)} />\n </div>\n ) : null}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default ScrollList\n"],"names":["cn","inputs","clsx","styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_DATA","rank","name","value","MEDAL_EMOJI","getRankClass","styles","rankGold","rankSilver","rankBronze","formatDisplayValue","format","prefix","suffix","formatted","toLocaleString","minimumFractionDigits","maximumFractionDigits","ScrollList","data","maxItems","showRank","showMedal","progressBarEnable","progressBarGradient","progressBarColors","valueFormat","valuePrefix","valueSuffix","nameColor","valueColor","backgroundColor","borderColor","itemBackgroundColor","itemBorderColor","glowEnable","externalStyle","displayData","slice","maxValue","Math","max","map","item","getProgressBarStyle","percentage","width","background","boxShadow","undefined","containerStyle","itemStyle","_jsx","className","container","children","list","isTopThree","_jsxs","rankBadge","rankBadgeTopThree","rankBadgeNormal","color","valueContainer","progressBar","progressFill"],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sD,YAAAA,QAAA,EAEDjC,SAAS,IAAImC,UAAU,GAAGrD,WAAW,CAACuC,IAAI,CAAC1C,IAAI,CAAC,GAAG0C,IAAI,CAAC1C;EAAI,WAC1D,CAAC,GACJ,IAAI,eAGRmD,cAAA,CAAA,KAAA,EAAA;cAAKC,SAAS,EAAE/C,MAAM,CAACJ,IAAK;EAACX,YAAAA,KAAK,EAAE;EAAEuE,cAAAA,KAAK,EAAEjC;eAAY;cAAA0B,QAAA,EACtDZ,IAAI,CAACzC;aACH,CAAC,eAGNwD,eAAA,CAAA,KAAA,EAAA;cAAKL,SAAS,EAAE/C,MAAM,CAACyD,cAAe;EAAAR,YAAAA,QAAA,gBACpCH,cAAA,CAAA,MAAA,EAAA;gBAAMC,SAAS,EAAE/C,MAAM,CAACH,KAAM;EAACZ,cAAAA,KAAK,EAAE;EAAEuE,gBAAAA,KAAK,EAAEhC;iBAAa;gBAAAyB,QAAA,EACzD7C,kBAAkB,CAACiC,IAAI,CAACxC,KAAK,EAAEuB,WAAW,EAAEC,WAAW,EAAEC,WAAW;EAAC,aAClE,CAAC,EACNL,iBAAiB,gBAChB6B,cAAA,CAAA,KAAA,EAAA;gBAAKC,SAAS,EAAE/C,MAAM,CAAC0D,WAAY;EAAAT,cAAAA,QAAA,eACjCH,cAAA,CAAA,KAAA,EAAA;kBAAKC,SAAS,EAAE/C,MAAM,CAAC2D,YAAa;EAAC1E,gBAAAA,KAAK,EAAEqD,mBAAmB,CAACD,IAAI,CAACxC,KAAK;iBAAI;eAC3E,CAAC,GACJ,IAAI;EAAA,WACL,CAAC;WAAA,EA7B0BwC,IAAI,CAAC1C,IA8BlC,CAAC;QAEV,CAAC;OACE;EAAC,GACH,CAAC;EAEV;;;;;;;;;;;","x_google_ignoreList":[0,2]}
@@ -1,2 +0,0 @@
1
- !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsScrollListComponent={},e.jsxRuntime)}(this,function(e,o){"use strict";function n(e){var o,r,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(o=0;o<a;o++)e[o]&&(r=n(e[o]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function r(...e){return function(){for(var e,o,r=0,t="",a=arguments.length;r<a;r++)(e=arguments[r])&&(o=n(e))&&(t&&(t+=" "),t+=o);return t}(e)}var t="component-module__container___VbZSk",a="component-module__list___ZzqLO",l="component-module__item___-0hiq",i="component-module__rankBadge___qWXYW",_="component-module__rankBadgeTopThree___kYqJt",d="component-module__rankBadgeNormal___Fl3nh",s="component-module__rankGold___lLkRo",m="component-module__rankSilver___QUAyV",c="component-module__rankBronze___Wc-LC",p="component-module__name___6zmww",u="component-module__valueContainer___xBbFD",f="component-module__value___Fg70k",g="component-module__progressBar___wROZC",h="component-module__progressFill___F8n5d";!function(e,o){void 0===o&&(o={});var n=o.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===n&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}('.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%)}}');const b=[{rank:1,name:"北京市",value:9800},{rank:2,name:"上海市",value:8500},{rank:3,name:"广州市",value:7200},{rank:4,name:"深圳市",value:6100},{rank:5,name:"杭州市",value:4800}],x={1:"🥇",2:"🥈",3:"🥉"},k=(e,o,n,r)=>{let t;switch(o){case"currency":t=e.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2});break;case"percent":t=`${e}%`;break;default:t=e.toLocaleString()}return`${n}${t}${r}`},v=({ref:e,data:n=b,maxItems:v=5,showRank:w=!0,showMedal:y=!0,progressBarEnable:C=!0,progressBarGradient:B=!0,progressBarColors:j=["#00d4ff","#9b59b6"],valueFormat:q="number",valuePrefix:F="",valueSuffix:N="",nameColor:z="#e6e6e6",valueColor:S="#00d4ff",backgroundColor:L="rgba(10, 10, 26, 0.95)",borderColor:T="rgba(26, 26, 62, 0.8)",itemBackgroundColor:W="rgba(15, 15, 42, 0.9)",itemBorderColor:$="rgba(26, 26, 62, 0.6)",glowEnable:E=!1,style:R})=>{const X=n.slice(0,v),Z=Math.max(...X.map(e=>e.value),1),A={...R,backgroundColor:L,borderColor:T},G={backgroundColor:W,borderColor:$};return o.jsx("div",{className:t,ref:e,style:A,children:o.jsx("div",{className:a,children:X.map(e=>{const n=e.rank<=3;return o.jsxs("div",{className:l,style:G,children:[w?o.jsx("div",{className:r(i,n?_:d,(a=e.rank,1===a?s:2===a?m:3===a?c:"")),children:y&&n?x[e.rank]:e.rank}):null,o.jsx("div",{className:p,style:{color:z},children:e.name}),o.jsxs("div",{className:u,children:[o.jsx("span",{className:f,style:{color:S},children:k(e.value,q,F,N)}),C?o.jsx("div",{className:g,children:o.jsx("div",{className:h,style:(t=e.value,{width:t/Z*100+"%",background:B?`linear-gradient(90deg, ${j[0]}, ${j[1]})`:j[0],boxShadow:E?`0 0 8px ${j[0]}60`:void 0})})}):null]})]},e.rank);var t,a})})})};e.ScrollList=v,e.default=v,Object.defineProperty(e,"__esModule",{value:!0})});
2
- //# sourceMappingURL=component.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.min.js","sources":["../../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../../../../shared/src/lib/utils.ts","../../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../src/component.tsx"],"sourcesContent":["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}export 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}export default clsx;","import { clsx, type ClassValue } from 'clsx'\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs)\n}\n","function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/**\n * Scroll List Component\n * 滚动列表组件 - 用于展示排行榜、数据列表等\n */\n\nimport type { CSSProperties, Ref } from 'react'\nimport { cn } from '@easy-editor/materials-shared'\nimport styles from './component.module.css'\n\nexport interface ScrollListItem {\n rank: number\n name: string\n value: number\n}\n\nexport interface ScrollListProps {\n ref?: Ref<HTMLDivElement>\n /** 列表数据 */\n data?: ScrollListItem[]\n /** 最大显示条数 */\n maxItems?: number\n /** 是否显示排名 */\n showRank?: boolean\n /** 是否显示奖牌图标 */\n showMedal?: boolean\n /** 是否显示进度条 */\n progressBarEnable?: boolean\n /** 是否使用渐变进度条 */\n progressBarGradient?: boolean\n /** 进度条颜色 [起始色, 结束色] */\n progressBarColors?: [string, string]\n /** 数值格式化 */\n valueFormat?: 'number' | 'currency' | 'percent'\n /** 数值前缀 */\n valuePrefix?: string\n /** 数值后缀 */\n valueSuffix?: string\n /** 名称颜色 */\n nameColor?: string\n /** 数值颜色 */\n valueColor?: string\n /** 背景颜色 */\n backgroundColor?: string\n /** 边框颜色 */\n borderColor?: string\n /** 行背景颜色 */\n itemBackgroundColor?: string\n /** 行边框颜色 */\n itemBorderColor?: string\n /** 是否显示发光效果 */\n glowEnable?: boolean\n /** 外部样式 */\n style?: CSSProperties\n}\n\nconst DEFAULT_DATA: ScrollListItem[] = [\n { rank: 1, name: '北京市', value: 9800 },\n { rank: 2, name: '上海市', value: 8500 },\n { rank: 3, name: '广州市', value: 7200 },\n { rank: 4, name: '深圳市', value: 6100 },\n { rank: 5, name: '杭州市', value: 4800 },\n]\n\nconst MEDAL_EMOJI: Record<number, string> = {\n 1: '🥇',\n 2: '🥈',\n 3: '🥉',\n}\n\nconst getRankClass = (rank: number): string => {\n if (rank === 1) {\n return styles.rankGold\n }\n if (rank === 2) {\n return styles.rankSilver\n }\n if (rank === 3) {\n return styles.rankBronze\n }\n return ''\n}\n\nconst formatDisplayValue = (value: number, format: string, prefix: string, suffix: string): string => {\n let formatted: string\n switch (format) {\n case 'currency':\n formatted = value.toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })\n break\n case 'percent':\n formatted = `${value}%`\n break\n default:\n formatted = value.toLocaleString()\n }\n return `${prefix}${formatted}${suffix}`\n}\n\nexport const ScrollList: React.FC<ScrollListProps> = ({\n ref,\n data = DEFAULT_DATA,\n maxItems = 5,\n showRank = true,\n showMedal = true,\n progressBarEnable = true,\n progressBarGradient = true,\n progressBarColors = ['#00d4ff', '#9b59b6'],\n valueFormat = 'number',\n valuePrefix = '',\n valueSuffix = '',\n nameColor = '#e6e6e6',\n valueColor = '#00d4ff',\n backgroundColor = 'rgba(10, 10, 26, 0.95)',\n borderColor = 'rgba(26, 26, 62, 0.8)',\n itemBackgroundColor = 'rgba(15, 15, 42, 0.9)',\n itemBorderColor = 'rgba(26, 26, 62, 0.6)',\n glowEnable = false,\n style: externalStyle,\n}) => {\n const displayData = data.slice(0, maxItems)\n const maxValue = Math.max(...displayData.map(item => item.value), 1)\n\n const getProgressBarStyle = (value: number): CSSProperties => {\n const percentage = (value / maxValue) * 100\n return {\n width: `${percentage}%`,\n background: progressBarGradient\n ? `linear-gradient(90deg, ${progressBarColors[0]}, ${progressBarColors[1]})`\n : progressBarColors[0],\n boxShadow: glowEnable ? `0 0 8px ${progressBarColors[0]}60` : undefined,\n }\n }\n\n const containerStyle: CSSProperties = {\n ...externalStyle,\n backgroundColor,\n borderColor,\n }\n\n const itemStyle: CSSProperties = {\n backgroundColor: itemBackgroundColor,\n borderColor: itemBorderColor,\n }\n\n return (\n <div className={styles.container} ref={ref} style={containerStyle}>\n <div className={styles.list}>\n {displayData.map(item => {\n const isTopThree = item.rank <= 3\n\n return (\n <div className={styles.item} key={item.rank} style={itemStyle}>\n {/* Rank Badge */}\n {showRank ? (\n <div\n className={cn(\n styles.rankBadge,\n isTopThree ? styles.rankBadgeTopThree : styles.rankBadgeNormal,\n getRankClass(item.rank),\n )}\n >\n {showMedal && isTopThree ? MEDAL_EMOJI[item.rank] : item.rank}\n </div>\n ) : null}\n\n {/* Name */}\n <div className={styles.name} style={{ color: nameColor }}>\n {item.name}\n </div>\n\n {/* Value and Progress */}\n <div className={styles.valueContainer}>\n <span className={styles.value} style={{ color: valueColor }}>\n {formatDisplayValue(item.value, valueFormat, valuePrefix, valueSuffix)}\n </span>\n {progressBarEnable ? (\n <div className={styles.progressBar}>\n <div className={styles.progressFill} style={getProgressBarStyle(item.value)} />\n </div>\n ) : null}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default ScrollList\n"],"names":["r","e","t","f","n","Array","isArray","o","length","cn","inputs","arguments","clsx","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","DEFAULT_DATA","rank","name","value","MEDAL_EMOJI","formatDisplayValue","format","prefix","suffix","formatted","toLocaleString","minimumFractionDigits","maximumFractionDigits","ScrollList","data","maxItems","showRank","showMedal","progressBarEnable","progressBarGradient","progressBarColors","valueFormat","valuePrefix","valueSuffix","nameColor","valueColor","backgroundColor","borderColor","itemBackgroundColor","itemBorderColor","glowEnable","externalStyle","displayData","slice","maxValue","Math","max","map","item","containerStyle","itemStyle","_jsx","className","styles","children","isTopThree","_jsxs","color","width","background","boxShadow","undefined"],"mappings":"6UAAA,SAASA,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAE,GAAG,GAAG,iBAAiBH,GAAG,iBAAiBA,EAAEG,GAAGH,OAAO,GAAG,iBAAiBA,EAAE,GAAGI,MAAMC,QAAQL,GAAG,CAAC,IAAIM,EAAEN,EAAEO,OAAO,IAAIN,EAAE,EAAEA,EAAEK,EAAEL,IAAID,EAAEC,KAAKC,EAAEH,EAAEC,EAAEC,OAAOE,IAAIA,GAAG,KAAKA,GAAGD,EAAE,MAAM,IAAIA,KAAKF,EAAEA,EAAEE,KAAKC,IAAIA,GAAG,KAAKA,GAAGD,GAAG,OAAOC,CAAC,CCEzO,SAASK,KAAMC,GACpB,ODHsP,WAAgB,IAAI,IAAIT,EAAEC,EAAEC,EAAE,EAAEC,EAAE,GAAGG,EAAEI,UAAUH,OAAOL,EAAEI,EAAEJ,KAAKF,EAAEU,UAAUR,MAAMD,EAAEF,EAAEC,MAAMG,IAAIA,GAAG,KAAKA,GAAGF,G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