@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
package/src/snippets.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll List Snippets
|
|
3
|
+
* 滚动列表组件代码片段
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Snippet } from '@easy-editor/core'
|
|
7
|
+
import { COMPONENT_NAME } from './constants'
|
|
8
|
+
|
|
9
|
+
export const snippets: Snippet[] = [
|
|
10
|
+
{
|
|
11
|
+
title: '排行榜',
|
|
12
|
+
screenshot: '',
|
|
13
|
+
schema: {
|
|
14
|
+
componentName: COMPONENT_NAME,
|
|
15
|
+
props: {
|
|
16
|
+
data: [
|
|
17
|
+
{ rank: 1, name: '北京', value: 9800 },
|
|
18
|
+
{ rank: 2, name: '上海', value: 8500 },
|
|
19
|
+
{ rank: 3, name: '广州', value: 7200 },
|
|
20
|
+
{ rank: 4, name: '深圳', value: 6100 },
|
|
21
|
+
{ rank: 5, name: '杭州', value: 4800 },
|
|
22
|
+
],
|
|
23
|
+
maxItems: 5,
|
|
24
|
+
showMedal: true,
|
|
25
|
+
progressBarEnable: true,
|
|
26
|
+
progressBarGradient: true,
|
|
27
|
+
progressBarColors: ['#00d4ff', '#9b59b6'],
|
|
28
|
+
},
|
|
29
|
+
$dashboard: {
|
|
30
|
+
rect: {
|
|
31
|
+
width: 320,
|
|
32
|
+
height: 280,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: '简单列表',
|
|
39
|
+
screenshot: '',
|
|
40
|
+
schema: {
|
|
41
|
+
componentName: COMPONENT_NAME,
|
|
42
|
+
props: {
|
|
43
|
+
data: [
|
|
44
|
+
{ rank: 1, name: '产品A', value: 1250 },
|
|
45
|
+
{ rank: 2, name: '产品B', value: 980 },
|
|
46
|
+
{ rank: 3, name: '产品C', value: 750 },
|
|
47
|
+
],
|
|
48
|
+
maxItems: 3,
|
|
49
|
+
showMedal: false,
|
|
50
|
+
progressBarEnable: true,
|
|
51
|
+
progressBarGradient: false,
|
|
52
|
+
progressBarColors: ['#00ff88', '#00ff88'],
|
|
53
|
+
},
|
|
54
|
+
$dashboard: {
|
|
55
|
+
rect: {
|
|
56
|
+
width: 280,
|
|
57
|
+
height: 180,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
export default snippets
|
package/src/type.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"strictPropertyInitialization": false,
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"allowSyntheticDefaultImports": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["./src"]
|
|
12
|
+
}
|
package/tsconfig.json
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite Configuration for Material Development
|
|
3
|
+
* 物料开发 Vite 配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { defineConfig } from 'vite'
|
|
7
|
+
import react from '@vitejs/plugin-react'
|
|
8
|
+
import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
|
|
9
|
+
import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
plugins: [
|
|
13
|
+
react(),
|
|
14
|
+
// 外部化 React/ReactDOM,使用父应用提供的实例
|
|
15
|
+
externalDeps({
|
|
16
|
+
externals: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
17
|
+
globals: {
|
|
18
|
+
react: 'React',
|
|
19
|
+
'react-dom': 'ReactDOM',
|
|
20
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
21
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
materialDevPlugin({
|
|
25
|
+
entry: '/src/index.tsx',
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
server: {
|
|
29
|
+
port: 5001,
|
|
30
|
+
host: 'localhost',
|
|
31
|
+
cors: true,
|
|
32
|
+
hmr: {
|
|
33
|
+
port: 5001,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
build: {
|
|
37
|
+
target: 'esnext',
|
|
38
|
+
rollupOptions: {
|
|
39
|
+
// 确保生产构建也外部化这些依赖
|
|
40
|
+
external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
|
|
41
|
+
output: {
|
|
42
|
+
globals: {
|
|
43
|
+
react: 'React',
|
|
44
|
+
'react-dom': 'ReactDOM',
|
|
45
|
+
'react/jsx-runtime': 'jsxRuntime',
|
|
46
|
+
'@easy-editor/core': 'EasyEditorCore',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
resolve: {
|
|
52
|
+
dedupe: ['react', 'react-dom'],
|
|
53
|
+
},
|
|
54
|
+
})
|