@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.
Files changed (44) hide show
  1. package/.vite/plugins/vite-plugin-external-deps.ts +224 -0
  2. package/.vite/plugins/vite-plugin-material-dev.ts +218 -0
  3. package/CHANGELOG.md +7 -0
  4. package/LICENSE +9 -0
  5. package/dist/component.esm.js +176 -0
  6. package/dist/component.esm.js.map +1 -0
  7. package/dist/component.js +185 -0
  8. package/dist/component.js.map +1 -0
  9. package/dist/component.min.js +2 -0
  10. package/dist/component.min.js.map +1 -0
  11. package/dist/index.cjs +669 -0
  12. package/dist/index.cjs.map +1 -0
  13. package/dist/index.esm.js +666 -0
  14. package/dist/index.esm.js.map +1 -0
  15. package/dist/index.js +674 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.min.js +2 -0
  18. package/dist/index.min.js.map +1 -0
  19. package/dist/meta.esm.js +494 -0
  20. package/dist/meta.esm.js.map +1 -0
  21. package/dist/meta.js +505 -0
  22. package/dist/meta.js.map +1 -0
  23. package/dist/meta.min.js +2 -0
  24. package/dist/meta.min.js.map +1 -0
  25. package/dist/src/component.d.ts +51 -0
  26. package/dist/src/configure.d.ts +7 -0
  27. package/dist/src/constants.d.ts +16 -0
  28. package/dist/src/index.d.ts +6 -0
  29. package/dist/src/meta.d.ts +7 -0
  30. package/dist/src/snippets.d.ts +7 -0
  31. package/package.json +65 -0
  32. package/rollup.config.js +222 -0
  33. package/src/component.module.css +184 -0
  34. package/src/component.tsx +189 -0
  35. package/src/configure.ts +439 -0
  36. package/src/constants.ts +18 -0
  37. package/src/index.tsx +7 -0
  38. package/src/meta.ts +28 -0
  39. package/src/snippets.ts +64 -0
  40. package/src/type.d.ts +8 -0
  41. package/tsconfig.build.json +12 -0
  42. package/tsconfig.json +9 -0
  43. package/tsconfig.test.json +7 -0
  44. package/vite.config.ts +54 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Scroll List Component
3
+ * 滚动列表组件 - 用于展示排行榜、数据列表等
4
+ */
5
+ import type { CSSProperties, Ref } from 'react';
6
+ export interface ScrollListItem {
7
+ rank: number;
8
+ name: string;
9
+ value: number;
10
+ }
11
+ export interface ScrollListProps {
12
+ ref?: Ref<HTMLDivElement>;
13
+ /** 列表数据 */
14
+ data?: ScrollListItem[];
15
+ /** 最大显示条数 */
16
+ maxItems?: number;
17
+ /** 是否显示排名 */
18
+ showRank?: boolean;
19
+ /** 是否显示奖牌图标 */
20
+ showMedal?: boolean;
21
+ /** 是否显示进度条 */
22
+ progressBarEnable?: boolean;
23
+ /** 是否使用渐变进度条 */
24
+ progressBarGradient?: boolean;
25
+ /** 进度条颜色 [起始色, 结束色] */
26
+ progressBarColors?: [string, string];
27
+ /** 数值格式化 */
28
+ valueFormat?: 'number' | 'currency' | 'percent';
29
+ /** 数值前缀 */
30
+ valuePrefix?: string;
31
+ /** 数值后缀 */
32
+ valueSuffix?: string;
33
+ /** 名称颜色 */
34
+ nameColor?: string;
35
+ /** 数值颜色 */
36
+ valueColor?: string;
37
+ /** 背景颜色 */
38
+ backgroundColor?: string;
39
+ /** 边框颜色 */
40
+ borderColor?: string;
41
+ /** 行背景颜色 */
42
+ itemBackgroundColor?: string;
43
+ /** 行边框颜色 */
44
+ itemBorderColor?: string;
45
+ /** 是否显示发光效果 */
46
+ glowEnable?: boolean;
47
+ /** 外部样式 */
48
+ style?: CSSProperties;
49
+ }
50
+ export declare const ScrollList: React.FC<ScrollListProps>;
51
+ export default ScrollList;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Scroll List Configure
3
+ * 滚动列表组件配置
4
+ */
5
+ import type { Configure } from '@easy-editor/core';
6
+ export declare const configure: Configure;
7
+ export default configure;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * 物料常量配置
3
+ * 统一管理全局变量名等配置,确保 meta.ts 和 rollup.config.js 使用相同的值
4
+ */
5
+ /**
6
+ * UMD 全局变量基础名称
7
+ * 用于构建:
8
+ * - 元数据:${GLOBAL_NAME}Meta (例如: EasyEditorMaterialsRankingListMeta)
9
+ * - 组件:${GLOBAL_NAME}Component (例如: EasyEditorMaterialsRankingListComponent)
10
+ * - 完整构建:${GLOBAL_NAME} (例如: EasyEditorMaterialsRankingList)
11
+ */
12
+ export declare const COMPONENT_NAME = "EasyEditorMaterialsScrollList";
13
+ /**
14
+ * 包名
15
+ */
16
+ export declare const PACKAGE_NAME = "@easy-editor/materials-dashboard-scroll-list";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Scroll List Entry
3
+ * 滚动列表组件入口
4
+ */
5
+ export { ScrollList as component } from './component';
6
+ export { default as meta } from './meta';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Scroll List Meta
3
+ * 滚动列表组件元数据
4
+ */
5
+ import type { ComponentMetadata } from '@easy-editor/core';
6
+ export declare const meta: ComponentMetadata;
7
+ export default meta;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Scroll List Snippets
3
+ * 滚动列表组件代码片段
4
+ */
5
+ import type { Snippet } from '@easy-editor/core';
6
+ export declare const snippets: Snippet[];
7
+ export default snippets;
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@easy-editor/materials-dashboard-scroll-list",
3
+ "version": "0.0.2",
4
+ "description": "Scroll List component for EasyEditor dashboard",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs"
13
+ }
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "jsdelivr": "dist/index.min.js",
18
+ "registry": "https://registry.npmjs.org/"
19
+ },
20
+ "homepage": "https://github.com/Easy-Editor/EasyMaterials",
21
+ "license": "MIT",
22
+ "author": "JinSo <kimjinso@qq.com>",
23
+ "keywords": [
24
+ "@easy-editor",
25
+ "easyeditor",
26
+ "low-code",
27
+ "dashboard",
28
+ "scroll-list",
29
+ "component",
30
+ "react"
31
+ ],
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/Easy-Editor/EasyMaterials",
35
+ "directory": "packages/dashboard/scroll-list"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/Easy-Editor/EasyMaterials/issues"
39
+ },
40
+ "peerDependencies": {
41
+ "@easy-editor/core": "*",
42
+ "react": "^18 || ^19",
43
+ "react-dom": "^18 || ^19",
44
+ "@types/react": "^18 || ^19",
45
+ "@types/react-dom": "^18 || ^19"
46
+ },
47
+ "dependencies": {
48
+ "@easy-editor/materials-shared": "0.0.0"
49
+ },
50
+ "scripts": {
51
+ "dev": "vite",
52
+ "dev:debug": "vite --port 5023",
53
+ "format": "biome format --write .",
54
+ "lint": "biome check .",
55
+ "build": "npm-run-all -nl build:*",
56
+ "build:clean": "rimraf dist/",
57
+ "build:js": "rollup -c",
58
+ "build:types": "pnpm types",
59
+ "types": "npm-run-all -nl types:*",
60
+ "types:src": "tsc --project tsconfig.build.json",
61
+ "test-types": "tsc --project tsconfig.test.json"
62
+ },
63
+ "module": "dist/index.esm.js",
64
+ "unpkg": "dist/index.min.js"
65
+ }
@@ -0,0 +1,222 @@
1
+ import babel from '@rollup/plugin-babel'
2
+ import commonjs from '@rollup/plugin-commonjs'
3
+ import nodeResolve from '@rollup/plugin-node-resolve'
4
+ import json from '@rollup/plugin-json'
5
+ import { terser } from 'rollup-plugin-terser'
6
+ import cleanup from 'rollup-plugin-cleanup'
7
+ import postcss from 'rollup-plugin-postcss'
8
+ import pkg from './package.json' with { type: 'json' }
9
+
10
+ const GLOBAL_NAME = 'EasyEditorMaterialsRankingList'
11
+
12
+ // 外部依赖(不打包进组件)
13
+ const external = ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core']
14
+
15
+ const globals = {
16
+ react: 'React',
17
+ 'react-dom': 'ReactDOM',
18
+ 'react/jsx-runtime': 'jsxRuntime',
19
+ '@easy-editor/core': 'EasyEditorCore',
20
+ }
21
+
22
+ const plugins = [
23
+ nodeResolve({
24
+ extensions: ['.js', '.ts', '.jsx', '.tsx'],
25
+ }),
26
+ commonjs(),
27
+ json(),
28
+ postcss({
29
+ modules: {
30
+ generateScopedName: '[name]__[local]___[hash:base64:5]',
31
+ },
32
+ autoModules: true,
33
+ minimize: true,
34
+ inject: true,
35
+ }),
36
+ babel({
37
+ extensions: ['.js', '.ts', '.jsx', '.tsx'],
38
+ exclude: 'node_modules/**',
39
+ babelrc: false,
40
+ babelHelpers: 'bundled',
41
+ presets: [
42
+ ['@babel/preset-react', { runtime: 'automatic' }],
43
+ [
44
+ '@babel/preset-typescript',
45
+ {
46
+ allowDeclareFields: true,
47
+ },
48
+ ],
49
+ ],
50
+ }),
51
+ cleanup({
52
+ comments: ['some', /PURE/],
53
+ extensions: ['.js', '.ts'],
54
+ }),
55
+ ]
56
+
57
+ export default [
58
+ /* ---------------------------------- 元数据构建 --------------------------------- */
59
+ // 元数据 ESM 构建(用于动态 import)
60
+ {
61
+ input: 'src/meta.ts',
62
+ output: [
63
+ {
64
+ file: 'dist/meta.esm.js',
65
+ format: 'esm',
66
+ sourcemap: true,
67
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta, esm) */`,
68
+ exports: 'named',
69
+ },
70
+ ],
71
+ plugins,
72
+ external,
73
+ },
74
+ // 元数据 UMD 构建(备用方案)
75
+ {
76
+ input: 'src/meta.ts',
77
+ output: [
78
+ {
79
+ file: 'dist/meta.js',
80
+ format: 'umd',
81
+ name: `${GLOBAL_NAME}Meta`,
82
+ globals,
83
+ sourcemap: true,
84
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta) */`,
85
+ exports: 'named',
86
+ },
87
+ ],
88
+ plugins,
89
+ external,
90
+ },
91
+ // 元数据压缩版本(UMD,备用方案)
92
+ {
93
+ input: 'src/meta.ts',
94
+ output: [
95
+ {
96
+ file: 'dist/meta.min.js',
97
+ format: 'umd',
98
+ name: `${GLOBAL_NAME}Meta`,
99
+ globals,
100
+ sourcemap: true,
101
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta, minified) */`,
102
+ exports: 'named',
103
+ },
104
+ ],
105
+ plugins: [...plugins, terser()],
106
+ external,
107
+ },
108
+
109
+ /* ---------------------------------- 组件构建 ---------------------------------- */
110
+ // 组件 ESM 构建(用于动态 import)
111
+ {
112
+ input: 'src/component.tsx',
113
+ output: [
114
+ {
115
+ file: 'dist/component.esm.js',
116
+ format: 'esm',
117
+ sourcemap: true,
118
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component, esm) */`,
119
+ exports: 'named',
120
+ },
121
+ ],
122
+ plugins,
123
+ external,
124
+ },
125
+ // 组件 UMD 构建(备用方案)
126
+ {
127
+ input: 'src/component.tsx',
128
+ output: [
129
+ {
130
+ file: 'dist/component.js',
131
+ format: 'umd',
132
+ name: `${GLOBAL_NAME}Component`,
133
+ globals,
134
+ sourcemap: true,
135
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component) */`,
136
+ exports: 'named',
137
+ },
138
+ ],
139
+ plugins,
140
+ external,
141
+ },
142
+ // 组件压缩版本(UMD,备用方案)
143
+ {
144
+ input: 'src/component.tsx',
145
+ output: [
146
+ {
147
+ file: 'dist/component.min.js',
148
+ format: 'umd',
149
+ name: `${GLOBAL_NAME}Component`,
150
+ globals,
151
+ sourcemap: true,
152
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component, minified) */`,
153
+ exports: 'named',
154
+ },
155
+ ],
156
+ plugins: [...plugins, terser()],
157
+ external,
158
+ },
159
+
160
+ /* ---------------------------------- 完整构建 ---------------------------------- */
161
+ // UMD 构建(用于 CDN 和浏览器)
162
+ {
163
+ input: 'src/index.tsx',
164
+ output: [
165
+ {
166
+ file: 'dist/index.js',
167
+ format: 'umd',
168
+ name: GLOBAL_NAME,
169
+ globals,
170
+ sourcemap: true,
171
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} */`,
172
+ exports: 'named',
173
+ },
174
+ ],
175
+ plugins,
176
+ external,
177
+ },
178
+ // ESM 构建(用于现代打包工具)
179
+ {
180
+ input: 'src/index.tsx',
181
+ output: [
182
+ {
183
+ file: 'dist/index.esm.js',
184
+ format: 'esm',
185
+ sourcemap: true,
186
+ },
187
+ ],
188
+ plugins,
189
+ external,
190
+ },
191
+ // CJS 构建(用于 Node.js)
192
+ {
193
+ input: 'src/index.tsx',
194
+ output: [
195
+ {
196
+ file: 'dist/index.cjs',
197
+ format: 'cjs',
198
+ sourcemap: true,
199
+ exports: 'named',
200
+ },
201
+ ],
202
+ plugins,
203
+ external,
204
+ },
205
+ // 压缩版本(用于生产环境)
206
+ {
207
+ input: 'src/index.tsx',
208
+ output: [
209
+ {
210
+ file: 'dist/index.min.js',
211
+ format: 'umd',
212
+ name: GLOBAL_NAME,
213
+ globals,
214
+ sourcemap: true,
215
+ banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (minified) */`,
216
+ exports: 'named',
217
+ },
218
+ ],
219
+ plugins: [...plugins, terser()],
220
+ external,
221
+ },
222
+ ]
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Scroll List Component Styles
3
+ * 滚动列表组件样式
4
+ */
5
+
6
+ .container {
7
+ box-sizing: border-box;
8
+ width: 100%;
9
+ height: 100%;
10
+ padding: 16px;
11
+ background: rgba(10, 10, 26, 0.95);
12
+ border: 1px solid rgba(26, 26, 62, 0.8);
13
+ border-radius: 12px;
14
+ overflow: hidden;
15
+ backdrop-filter: blur(10px);
16
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
17
+ }
18
+
19
+ .list {
20
+ display: flex;
21
+ flex-direction: column;
22
+ gap: 10px;
23
+ height: 100%;
24
+ }
25
+
26
+ .item {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 14px;
30
+ padding: 12px 16px;
31
+ background: rgba(15, 15, 42, 0.9);
32
+ border: 1px solid rgba(26, 26, 62, 0.6);
33
+ border-radius: 8px;
34
+ transition: all 0.3s ease;
35
+ position: relative;
36
+ overflow: hidden;
37
+ }
38
+
39
+ .item::before {
40
+ content: "";
41
+ position: absolute;
42
+ left: 0;
43
+ top: 0;
44
+ bottom: 0;
45
+ width: 3px;
46
+ background: linear-gradient(
47
+ 180deg,
48
+ transparent,
49
+ rgba(0, 212, 255, 0.5),
50
+ transparent
51
+ );
52
+ opacity: 0;
53
+ transition: opacity 0.3s ease;
54
+ }
55
+
56
+ .item:hover {
57
+ background: rgba(20, 20, 52, 0.95);
58
+ border-color: rgba(0, 212, 255, 0.3);
59
+ transform: translateX(4px);
60
+ }
61
+
62
+ .item:hover::before {
63
+ opacity: 1;
64
+ }
65
+
66
+ .rankBadge {
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ min-width: 32px;
71
+ height: 32px;
72
+ border-radius: 6px;
73
+ font-weight: 700;
74
+ transition: transform 0.3s ease;
75
+ }
76
+
77
+ .item:hover .rankBadge {
78
+ transform: scale(1.1);
79
+ }
80
+
81
+ .rankBadgeTopThree {
82
+ font-size: 20px;
83
+ text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
84
+ }
85
+
86
+ .rankBadgeNormal {
87
+ font-size: 14px;
88
+ background: rgba(26, 26, 62, 0.8);
89
+ color: #8892b0;
90
+ border: 1px solid rgba(136, 146, 176, 0.2);
91
+ }
92
+
93
+ .rankGold {
94
+ color: #ffd700;
95
+ filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
96
+ }
97
+
98
+ .rankSilver {
99
+ color: #e8e8e8;
100
+ filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.6));
101
+ }
102
+
103
+ .rankBronze {
104
+ color: #ff9966;
105
+ filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.6));
106
+ }
107
+
108
+ .name {
109
+ flex: 1;
110
+ font-size: 15px;
111
+ font-weight: 500;
112
+ color: #e6e6e6;
113
+ overflow: hidden;
114
+ text-overflow: ellipsis;
115
+ white-space: nowrap;
116
+ transition: color 0.3s ease;
117
+ }
118
+
119
+ .item:hover .name {
120
+ color: #ffffff;
121
+ }
122
+
123
+ .valueContainer {
124
+ display: flex;
125
+ flex-direction: column;
126
+ align-items: flex-end;
127
+ gap: 6px;
128
+ min-width: 120px;
129
+ }
130
+
131
+ .value {
132
+ font-size: 15px;
133
+ font-weight: 700;
134
+ font-family: "Courier New", Courier, monospace;
135
+ color: #00d4ff;
136
+ text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
137
+ transition: all 0.3s ease;
138
+ }
139
+
140
+ .item:hover .value {
141
+ transform: scale(1.05);
142
+ text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
143
+ }
144
+
145
+ .progressBar {
146
+ width: 100%;
147
+ height: 5px;
148
+ background: rgba(26, 26, 62, 0.8);
149
+ border-radius: 3px;
150
+ overflow: hidden;
151
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
152
+ }
153
+
154
+ .progressFill {
155
+ height: 100%;
156
+ border-radius: 3px;
157
+ transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
158
+ position: relative;
159
+ }
160
+
161
+ .progressFill::after {
162
+ content: "";
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ right: 0;
167
+ bottom: 0;
168
+ background: linear-gradient(
169
+ 90deg,
170
+ transparent,
171
+ rgba(255, 255, 255, 0.2),
172
+ transparent
173
+ );
174
+ animation: shimmer 2s infinite;
175
+ }
176
+
177
+ @keyframes shimmer {
178
+ 0% {
179
+ transform: translateX(-100%);
180
+ }
181
+ 100% {
182
+ transform: translateX(100%);
183
+ }
184
+ }